code: def _get_series_name(ts: Union[pd.Series, pd.DataFrame]) -> str:
      """Get series name from Series or column name from DataFrame.
  
      Parameters
      ----------
      ts : Union[pd.Series, pd.DataFrame]
          input series / dataframe
  
      Returns
      -------
      str
          series name or column name
      """
      if isinstance(ts, pd.Series):
          return ts.name
      elif isinstance(ts, pd.DataFrame):
          return ts.columns.values[0]
  
imports: from copy import copy
  from typing import Tuple, Union
  import numpy
  import pandas
  from sklearn.utils import check_random_state
  from sktime.transformations.base import BaseTransformer
  from sktime.transformations.series.boxcox import BoxCoxTransformer
label_desc: Use image node_id 2 for calling a global function with example usage: _get_series_name(ts) and returns: ts, ts