code: def _to_type(v: FeatureValueType) -> FeatureValueType:
      """Converts string versions of ints and floats to respective values."""
      if isinstance(v, float) or isinstance(v, int):
          return v
      try:
          v = str(v)
          if "." in v:
              return float(v)
          else:
              return int(v)
      except ValueError:
          return v
  
imports: import itertools
  from typing import Any, Callable, Dict, Generator, Iterable, List, NamedTuple, Optional, Tuple, Union
  import apache_beam
  import numpy
  import tensorflow
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.proto import metrics_for_slice_pb2
  from tensorflow_model_analysis.slicer import slice_accessor
label_desc: Use image node_id 3 for calling a global function with example usage: _to_type(v) and returns: v, float, int, v