docstr: Count number of references to objects of type |typeof|.
docstr_tok: ["Count","number","of","references","to","objects","of","type","|typeof|","."]
code: def _CountReferences(self, typeof):
      """Count number of references to objects of type |typeof|."""
      objs = gc.get_objects()
      ref_count = 0
      for o in objs:
          try:
              if isinstance(o, typeof):
                  ref_count += 1
          # Certain versions of python keeps a weakref to deleted objects.
          except ReferenceError:
              pass
      return ref_count
  
imports: import gc
  import pickle
  import warnings
  from tensorflow.core.lib.core import error_codes_pb2
  from tensorflow.python.framework import _errors_test_helper
  from tensorflow.python.framework import c_api_util
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import errors_impl
  from tensorflow.python.lib.io import _pywrap_file_io
  from tensorflow.python.platform import test
  from tensorflow.python.util import compat
label_desc: Use image node_id 1 for calling the ErrorsTest obj's underlying member method code with example usage: obj._CountReferences(typeof) and returns: ref_count