code: def _populate_token_rank_histogram(
      nls: statistics_pb2.NaturalLanguageStatistics,
      accumulator: _PartialNLStats,
      num_rank_histogram_buckets: int,
  ):
      """Populate the token rank histogram."""
      entries = (
          accumulator.token_occurrence_counts.Estimate().to_pylist()
      )
      for i, e in enumerate(entries[:num_rank_histogram_buckets]):
          nls.rank_histogram.buckets.add(
              low_rank=i,
              high_rank=i,
              label=e["values"],
              sample_count=e["counts"],
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  from typing import Dict, Iterable, List, Optional, Set, Text, Union
  import pyarrow
  import six
  from tensorflow_data_validation import types
  from tensorflow_data_validation.statistics.generators import stats_generator
  from tensorflow_data_validation.utils import quantiles_util
  from tensorflow_data_validation.utils import schema_util
  from tensorflow_data_validation.utils import stats_util
  from tensorflow_data_validation.utils import vocab_util
  from tfx_bsl import sketches
  from tensorflow_metadata.proto.v0 import schema_pb2
  from tensorflow_metadata.proto.v0 import statistics_pb2
  from tfx_bsl.types import tfx_namedtuple
label_desc: Use image node_id 10 for calling a global function with example usage: _populate_token_rank_histogram(nls, accumulator, num_rank_histogram_buckets) without return types