generate a list of arguments given to a function
def function_args(fn):
""" generates a list of the given function's arguments
by: Cody Kochmann """
assert callable(fn), 'function_args needed a callable function, not {0}'.format(repr(fn))
try: # python2 implementation
from inspect import getargspec
return getargspec(fn).args
except: # python3 implementation
from inspect import signature
return signature(fn).parameters