code: def check_variables(variables):
      # treating variables as list simplifies code
      if variables is not None and not isinstance(
          variables, (str, list, np.ndarray, pd.Series)
      ):
          raise TypeError(
              "variables must be None or str or list or np.ndarray or pd.Series"
          )
  
      if variables is None:
          variables_ = None
      elif isinstance(variables, str):
          variables_ = [variables]
      else:
          variables_ = list(variables)
  
      return variables_
  
imports: import numpy
  import pandas
label_desc: Use image node_id 1 for calling a global function with example usage: check_variables(variables) and returns: variables_