code: def _get_argspec(f):
      
      if sys.version_info[0] < 3:
          argspec = inspect.getargspec(f)
      else:
          # `getargspec` is deprecated since python3.0 (incompatible with function annotations).
          # See SPARK-23569.
          argspec = inspect.getfullargspec(f)
      return argspec
docs: Get argspec of a function. Supports both Python 2 and Python 3.