code: def sequence_to_numpy(sequence: t.Sequence):
      """Convert a sequence into a numpy array."""
      if isinstance(sequence, np.ndarray):
          return sequence.flatten()
      elif isinstance(sequence, t.List):
          return np.asarray(sequence).flatten()
      elif isinstance(sequence, pd.Series):
          return sequence.to_numpy().flatten()
      else:
          raise DeepchecksValueError(
              "Trying to convert a non sequence into a flat list."
          )
  
imports: import typing
  import numpy
  import pandas
  from deepchecks.core.errors import DeepchecksValueError
label_desc: Use image node_id 2 for calling a global function with example usage: sequence_to_numpy(sequence) and returns: sequence, np, sequence