code: def _flatten(object):
      flattened_list = []
      for item in object:
          if isinstance(item, (list, tuple)):
              flattened_list.extend(_flatten(item))
          else:
              flattened_list.append(item)
      return flattened_list
  
imports: import numpy
  import torch
  import torch.nn
  from six import string_types
  from coremltools import TensorType
  from coremltools.converters.mil.testing_reqs import _converter
  from coremltools.models import MLModel
  from coremltools._deps import _IS_MACOS
label_desc: Use image node_id 1 for calling a global function with example usage: _flatten(object) and returns: flattened_list