class_docstr: Assigns column names to feature partitions.
class_docstr_tok: ["Assigns","column","names","to","feature","partitions","."]
docstr: Assigns a feature partition based on the name of a feature.
docstr_tok: ["Assigns","a","feature","partition","based","on","the","name","of","a","feature","."]
code: def assign(self, feature_name: Union[bytes, str]) -> int:
      """Assigns a feature partition based on the name of a feature."""
      if isinstance(feature_name, bytes):
          feature_name = feature_name.decode("utf8")
      # TODO(b/236190177): Remove when binding is fixed.
      if "\x00" in feature_name:
          feature_name = feature_name.replace("\x00", "?")
  
      partition = (
          farmhash.fingerprint32(feature_name) % self.num_partitions
      )
      return partition
  
file_path: data-validation/tensorflow_data_validation/utils/feature_partition_util.py
imports: import collections
  from typing import Any, FrozenSet, Iterable, Mapping, Tuple, Union
  import apache_beam
  import farmhash
  import pyarrow
  from tensorflow_data_validation import types
  from tensorflow_metadata.proto.v0 import statistics_pb2
label_desc: Use image node_id 2 for calling the ColumnHasher obj's underlying member method code with example usage: obj.assign(feature_name) and returns: partition