code: def to_list(sequence: SequenceProto) -> List[Any]:
      """Converts a sequence def to a Python list.
  
      Args:
          sequence: a SequenceProto object.
  
      Returns:
          list: the converted list.
      """
      elem_type = sequence.elem_type
      if elem_type == SequenceProto.TENSOR:
          return [to_array(v) for v in sequence.tensor_values]  # type: ignore[arg-type]
      if elem_type == SequenceProto.SPARSE_TENSOR:
          return [to_array(v) for v in sequence.sparse_tensor_values]  # type: ignore[arg-type]
      if elem_type == SequenceProto.SEQUENCE:
          return [to_list(v) for v in sequence.sequence_values]
      if elem_type == SequenceProto.MAP:
          return [to_dict(v) for v in sequence.map_values]
      raise TypeError(
          "The element type in the input sequence is not supported."
      )
  
imports: import sys
  from typing import Any, Dict, List, Optional, Sequence, Tuple, Union
  import numpy
  from onnx import MapProto, OptionalProto, SequenceProto, TensorProto, helper, subbyte
  from onnx.external_data_helper import load_external_data_for_tensor, uses_external_data
label_desc: Use image node_id 10 for calling a global function with example usage: to_list(sequence) and returns: unknown, unknown, unknown, unknown