code: def cast(data, array_type="numpy"):
      """Cast data to list or specific backend.
  
      Parameters
      ----------
      data: array-like,
          The input data should be a list or numpy array or torch array.
          The data to cast.
      array_type: string
          The type to cast the data. It can be "numpy", "pytorch" or "list".
  
      Returns
      --------
      data_cast: array-like
          Data cast to array_type.
      """
      data_type_string = str(type(data)).lower()
      array_type = array_type.lower()
      if array_type == "pytorch":
          array_type = "torch"
      if array_type in data_type_string:
          return data
      if array_type == "list":
          return data.tolist()
      be = Backend(array_type)
      return be.array(data)
  
file_path: tslearn/tslearn/backend/backend.py
imports: from tslearn.backend.numpy_backend import NumPyBackend
label_desc: Use image node_id 3 for calling a global function with example usage: cast(data, array_type) and returns: be, data, data