#if you're getting this issue out of a class function
#don't forget to add "self" as the first parameter for your function
class myClass:
def myFunction(self,argument1,argument2)
#calling
#self isn't defined when calling the function
test = myClass()
test.myFunction(1,2)