code: def pyval_to_feature(pyval: List[Any]) -> feature_pb2.Feature:
      """Converts a list of Python value(s) into a Feature."""
      if not pyval:
          return feature_pb2.Feature()
      elif isinstance(pyval[0], int):
          return feature_pb2.Feature(
              int64_list=feature_pb2.Int64List(value=pyval)
          )
      elif isinstance(pyval[0], float):
          return feature_pb2.Feature(
              float_list=feature_pb2.FloatList(value=pyval)
          )
      elif isinstance(pyval[0], str):
          return feature_pb2.Feature(
              bytes_list=feature_pb2.BytesList(
                  value=[v.encode(_DEFAULT_ENCODING) for v in pyval]
              )
          )
      raise RuntimeError(
          f"Value type {type(pyval[0])} is not supported."
      )
  
imports: import datetime
  import os
  import re
  from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
  from absl import logging
  import numpy
  from tfx.dsl.io import fileio
  from tfx.proto import example_gen_pb2
  from tfx.proto import range_config_pb2
  from tfx.utils import io_utils
  from google.protobuf import json_format
  from tensorflow.core.example import example_pb2
  from tensorflow.core.example import feature_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: pyval_to_feature(pyval) and returns: feature_pb2, feature_pb2, feature_pb2, feature_pb2