class_docstr: Singleton metaclass for :class:`fiftyone.core.sample.Sample`.
  
  This metaclass maintains a weakref dictionary of all in-memory
  :class:`fiftyone.core.sample.Sample` instances keyed by
  ``[collection name][sample ID]``.
docstr: Renames the field on all in-memory samples in the collection.
docstr_tok: ["Renames","the","field","on","all","in-memory","samples","in","the","collection","."]
code: def _rename_fields(
      cls, collection_name, field_names, new_field_names
  ):
      """Renames the field on all in-memory samples in the collection."""
      if collection_name not in cls._instances:
          return
  
      for sample in cls._instances[collection_name].values():
          data = sample._doc._data
          for field_name, new_field_name in zip(
              field_names, new_field_names
          ):
              data[new_field_name] = data.pop(field_name, None)
  
imports: from collections import defaultdict
  import weakref
label_desc: Use image node_id 5 for calling the SampleSingleton obj's underlying member method code with example usage: obj._rename_fields(cls, collection_name, field_names, new_field_names) without return types