[bugfix] import dependecies at top of a script file
[bugfix] import dependecies at top of a script file

Bug: T302774
Change-Id: I939757ea3498927d3df949a478706c472a0a9643

wikimedia/pywikibot-core,wikimedia/pywikibot-core