code: def to_feature(value: feature_lib.FeatureConnectorArg):
      """Convert the given value to Feature if necessary."""
      if isinstance(value, feature_lib.FeatureConnector):
          return value
      elif dtype_utils.is_np_or_tf_dtype(
          value
      ):  # tf.int32, np.int32,...
          return tensor_feature.Tensor(shape=(), dtype=value)
      elif isinstance(value, dict):
          return FeaturesDict(value)
      else:
          raise ValueError("Feature not supported: {}".format(value))
  
imports: from __future__ import annotations
  import concurrent.futures
  from typing import Dict, List, Union
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core.features import feature
  from tensorflow_datasets.core.features import tensor_feature
  from tensorflow_datasets.core.features import top_level_feature
  from tensorflow_datasets.core.proto import feature_pb2
  from tensorflow_datasets.core.utils import dtype_utils
  from tensorflow_datasets.core.utils import py_utils
  from tensorflow_datasets.core.utils import type_utils
label_desc: Use image node_id 1 for calling a global function with example usage: to_feature(value) and returns: value, tensor_feature, FeaturesDict