code: def _set_type(name, feature, dtype):
      """Set the type of a Feature proto."""
      if dtype == tf.int64:
          feature.type = schema_pb2.INT
      elif dtype == tf.float32:
          feature.type = schema_pb2.FLOAT
      elif dtype == tf.string:
          feature.type = schema_pb2.BYTES
      else:
          raise ValueError(
              'Feature "{}" has invalid dtype {}'.format(name, dtype)
          )
  
imports: import dataclasses
  import typing
  from typing import Dict, List, Mapping, Optional, Tuple, Union
  import tensorflow
  from tensorflow_transform import common_types
  from tensorflow_transform.tf_metadata import schema_utils_legacy
  from tfx_bsl.tfxio import tensor_representation_util
  from tensorflow_metadata.proto.v0 import path_pb2
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 5 for calling a global function with example usage: _set_type(name, feature, dtype) without return types