code: def check_numpy_series(obj, return_metadata=False, var_name="obj"):
      metadata = dict()
  
      if not isinstance(obj, np.ndarray):
          msg = f"{var_name} must be a numpy.ndarray, found {type(obj)}"
          return ret(False, msg, None, return_metadata)
  
      if len(obj.shape) == 2:
          # we now know obj is a 2D np.ndarray
          if _req("is_empty", return_metadata):
              metadata["is_empty"] = len(obj) < 1 or obj.shape[1] < 1
          if _req("is_univariate", return_metadata):
              metadata["is_univariate"] = obj.shape[1] < 2
          if _req("n_features", return_metadata):
              metadata["n_features"] = obj.shape[1]
          if _req("feature_names", return_metadata):
              metadata["feature_names"] = list(range(obj.shape[1]))
      elif len(obj.shape) == 1:
          # we now know obj is a 1D np.ndarray
          if _req("is_empty", return_metadata):
              metadata["is_empty"] = len(obj) < 1
          if _req("is_univariate", return_metadata):
              metadata["is_univariate"] = True
          if _req("n_features", return_metadata):
              metadata["n_features"] = 1
          if _req("feature_names", return_metadata):
              metadata["feature_names"] = [0]
      else:
          msg = f"{var_name} must be 1D or 2D numpy.ndarray, but found {len(obj.shape)}D"
          return ret(False, msg, None, return_metadata)
  
      # np.arrays are considered equally spaced by assumption
      if _req("is_equally_spaced", return_metadata):
          metadata["is_equally_spaced"] = True
  
      # check whether there any nans; compute only if requested
      if _req("has_nans", return_metadata):
          metadata["has_nans"] = pd.isnull(obj).any()
  
      return ret(True, None, metadata, return_metadata)
  
file_path: sktime/sktime/datatypes/_series/_check.py
imports: import numpy
  import pandas
  from sktime.datatypes._common import _req
  from sktime.datatypes._common import _ret
  from sktime.utils.validation._dependencies import _check_soft_dependencies
  from sktime.utils.validation.series import is_in_valid_index_types
label_desc: Use image node_id 3 for calling a global function with example usage: check_numpy_series(obj, return_metadata, var_name) and returns: ret, ret, ret