parameters: (shape, new_format)
return_statement: return [shape[index] if index != -1 else 1 for index in perm]
docstring: Permutes a shape from one format to another.
  
          Args:
              shape (Tuple[int]): The shape to convert.
              new_format (DataFormat): The desired format of the shape.
  
          Returns:
              Tuple[int]: A new shape in the correct format.
docstring_summary: Permutes a shape from one format to another.
docstring_tokens: Permutes a shape from one format to another .
function: def convert(shape, new_format):
          """
          Permutes a shape from one format to another.
  
          Args:
              shape (Tuple[int]): The shape to convert.
              new_format (DataFormat): The desired format of the shape.
  
          Returns:
              Tuple[int]: A new shape in the correct format.
          """
          old_format = FormatManager.determine_format(shape)
          perm = FormatManager.permutation(old_format, new_format)
          return [shape[index] if index != -1 else 1 for index in perm]
function_tokens: def convert ( shape , new_format ) : old_format = FormatManager . determine_format ( shape ) perm = FormatManager . permutation ( old_format , new_format ) return [ shape [ index ] if index != - 1 else 1 for index in perm ]