code: def make_optional(
      name: str,
      elem_type: OptionalProto.DataType,
      value: Optional[Any],
  ) -> OptionalProto:
      """
      Make an Optional with specified value arguments.
      """
      optional = OptionalProto()
      optional.name = name
      optional.elem_type = elem_type
  
      if elem_type == OptionalProto.UNDEFINED:
          return optional
      if elem_type == OptionalProto.TENSOR:
          attribute = optional.tensor_value
      elif elem_type == OptionalProto.SPARSE_TENSOR:
          attribute = optional.sparse_tensor_value  # type: ignore[assignment]
      elif elem_type == OptionalProto.SEQUENCE:
          attribute = optional.sequence_value  # type: ignore[assignment]
      elif elem_type == OptionalProto.MAP:
          attribute = optional.map_value  # type: ignore[assignment]
      elif elem_type == OptionalProto.OPTIONAL:
          attribute = optional.optional_value  # type: ignore[assignment]
      else:
          raise TypeError(
              "The element type in the input optional is not supported."
          )
  
      attribute.CopyFrom(value)  # type: ignore[arg-type]
      return optional
  
imports: import collections.abc
  import numbers
  import struct
  from cmath import isnan
  from typing import Any, Callable, Dict, KeysView, List, Optional, Sequence, Tuple, TypeVar, Union, cast
  import google.protobuf.message
  import numpy
  from onnx import IR_VERSION, AttributeProto, FunctionProto, GraphProto, MapProto, ModelProto, NodeProto, OperatorSetIdProto, OptionalProto, SequenceProto, SparseTensorProto, TensorProto, TensorShapeProto, TrainingInfoProto, TypeProto, ValueInfoProto, defs, mapping
label_desc: Use image node_id 19 for calling a global function with example usage: make_optional(name, elem_type, value) and returns: optional, optional