code: def _get_shaping_class(shape):
      """
      Returns a Shape class or EnumeratedShapes class for `shape`
      where `shape` could be lists/tuple/Shape/EnumeratedShapes/etc.
      """
      if isinstance(shape, (Shape, EnumeratedShapes)):
          return shape
  
      try:
          enum_shape = EnumeratedShapes(shape)
          return enum_shape
      except ValueError:
          pass
      try:
          shape = Shape(shape)
          return shape
      except ValueError:
          pass
      raise ValueError(
          "Can't convert to CoreML shaping class from {}.".format(shape)
      )
  
imports: import logging
  import numpy
  import six
  from coremltools.converters.mil.mil.types.symbolic import is_symbolic
  from coremltools.converters.mil.mil import types
  from coremltools.converters.mil.mil.types.type_mapping import numpy_type_to_builtin_type, is_builtin
label_desc: Use image node_id 1 for calling a global function with example usage: _get_shaping_class(shape) and returns: shape, enum_shape, shape