code: def parse_data_format(input_shape, data_format="channels_last"):
      """Parses the given input shape according to the specified data format.
  
      This function can be used to ensure the shapes of convolutional and pooling layers is correctly parsed. If the first
      element of the given ``input_shape`` is ``None`` it is interpreted as a batch dimension and discarded.The returned tuple
      will have the channels dimension last.
  
      Args:
          input_shape (list or tuple): Input shape of 2D or 3D tensor with optional batch dimension of ``None``.
          data_format (str, optional): Data format type, one of ``channels_first`` or ``channels_last``. (case insensitive).
              Defaults to 'channels_last'.
  
      Raises:
          Exception: Raised if the data format type is unknown.
  
      Returns:
          tuple: The input shape (without the batch dimension) in ``channels_last`` format.
      """
      if input_shape[0] is None:
          # Ignore batch size
          input_shape = input_shape[1:]
  
      if data_format.lower() == "channels_last":
          if len(input_shape) == 2:  # 1D, (n_in, n_filt)
              return (input_shape[0], input_shape[1])
          elif (
              len(input_shape) == 3
          ):  # 2D, (in_height, in_width, n_filt)
              return (input_shape[0], input_shape[1], input_shape[2])
  
      elif data_format.lower() == "channels_first":
          if len(input_shape) == 2:  # 1D, (n_filt, n_in)
              return (input_shape[1], input_shape[0])
          elif (
              len(input_shape) == 3
          ):  # 2D, (n_filt, in_height, in_width)
              return (input_shape[1], input_shape[2], input_shape[0])
      else:
          raise Exception(f"Unknown data format: {data_format}")
  
imports: import math
label_desc: Use image node_id 1 for calling a global function with example usage: parse_data_format(input_shape, data_format) and returns: input_shape,  input_shape, input_shape,  input_shape,  input_shape, input_shape,  input_shape, input_shape,  input_shape,  input_shape