code: def _file_num_records_cached(filename):
      """Return the number of TFRecords in a file."""
      # Cache the result, as this is expensive to compute
      if filename in _file_num_records_cache:
          return _file_num_records_cache[filename]
      ret = 0
      for _ in tf.python_io.tf_record_iterator(filename):
          ret += 1
      _file_num_records_cache[filename] = ret
      return ret
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  import multiprocessing
  import random
  import six
  from six.moves import range
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import mlperf_log
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 13 for calling a global function with example usage: _file_num_records_cached(filename) and returns: ret, _file_num_records_cache