code: def _get_serialized_feature(
      feature: tf.train.Feature, float_round_ndigits: Optional[int]
  ) -> str:
      """Gets serialized feature, rounding floats as specified.
  
      Args:
        feature: The feature to serialize.
        float_round_ndigits: Number of digits of precision after the decimal point
          to which to round float values before serializing the feature.
  
      Returns:
        The serialized feature.
      """
      kind = feature.WhichOneof("kind")
      if kind == "bytes_list" or kind == "int64_list":
          return str(
              feature.SerializePartialToString(deterministic=True)
          )
      elif kind == "float_list":
          if float_round_ndigits is None:
              return str(
                  feature.SerializePartialToString(deterministic=True)
              )
          else:
              rounded_feature = tf.train.Feature()
              for value in feature.float_list.value:
                  rounded_feature.float_list.value.append(
                      round(value, float_round_ndigits)
                  )
              return str(
                  rounded_feature.SerializePartialToString(
                      deterministic=True
                  )
              )
      else:
          raise ValueError("Unknown feature type detected: %s" % kind)
  
imports: from typing import Any, Dict, Iterable, Iterator, List, Optional, Tuple, Union
  import apache_beam
  import farmhash
  import numpy
  import tensorflow
  from tensorflow_data_validation import constants
  from tensorflow_data_validation import types
  from tensorflow_data_validation.utils import artifacts_io_impl
  from tensorflow_data_validation.skew.protos import feature_skew_results_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: _get_serialized_feature(feature, float_round_ndigits) and returns: str, str, str