code: def corpus_token_counts(
      text_filepattern, corpus_max_lines, split_on_newlines=True
  ):
      """Read the corpus and compute a dictionary of token counts.
  
      Args:
        text_filepattern: A pattern matching one or more files.
        corpus_max_lines: An integer; maximum total lines to read.
        split_on_newlines: A boolean. If true, then split files by lines and strip
            leading and trailing whitespace from each line. Otherwise, treat each
            file as a single string.
  
      Returns:
        a dictionary mapping token to count.
      """
      counts = collections.Counter()
      for doc in _read_filepattern(
          text_filepattern,
          max_lines=corpus_max_lines,
          split_on_newlines=split_on_newlines,
      ):
          counts.update(encode(doc))
  
      return counts
  
file_path: trax/trax/data/tokenizer.py
imports: import collections
  import sys
  import unicodedata
  from absl import logging
  import six
  import tensorflow
label_desc: Use image node_id 4 for calling a global function with example usage: corpus_token_counts(text_filepattern, corpus_max_lines, split_on_newlines) and returns: counts