code: def _get_args(function, varargs=False):
      """Get function arguments."""
      try:
          params = signature(function).parameters
      except ValueError:
          # Error on builtin C function
          return []
      args = [
          key
          for key, param in params.items()
          if param.kind not in (param.VAR_POSITIONAL, param.VAR_KEYWORD)
      ]
      if varargs:
          varargs = [
              param.name
              for param in params.values()
              if param.kind == param.VAR_POSITIONAL
          ]
          if len(varargs) == 0:
              varargs = None
          return args, varargs
      else:
          return args
  
imports: from inspect import isclass, signature
  import numpy
  import pandas
  from pandas.testing import assert_frame_equal
  from sklearn.utils.validation import check_random_state
  from sktime.alignment.base import BaseAligner
  from sktime.base import BaseEstimator, BaseObject
  from sktime.classification.base import BaseClassifier
  from sktime.classification.early_classification import BaseEarlyClassifier
  from sktime.clustering.base import BaseClusterer
  from sktime.datatypes._panel._check import is_nested_dataframe
  from sktime.dists_kernels import BasePairwiseTransformer, BasePairwiseTransformerPanel
  from sktime.forecasting.base import BaseForecaster
  from sktime.registry import scitype
  from sktime.regression.base import BaseRegressor
  from sktime.tests._config import VALID_ESTIMATOR_TYPES
  from sktime.transformations.base import BaseTransformer
label_desc: Use image node_id 8 for calling a global function with example usage: _get_args(function, varargs) and returns: args,  varargs, args, list