code: def function_arg_count(fn):
      
      assert callable(fn), 'function_arg_count needed a callable function, not {0}'.format(repr(fn))
      if hasattr(fn, '__code__') and hasattr(fn.__code__, 'co_argcount'):
          return fn.__code__.co_argcount
      else:
          return 1
docs: returns how many arguments a funciton has