class_docstr: Singleton metaclass for :class:`fiftyone.core.frame.Frame`.
  
  This metaclass maintains a weakref dictionary of all in-memory
  :class:`fiftyone.core.frame.Frame` instances keyed by
  ``[collection name][sample ID][frame number]``.
docstr: Syncs the backing documents for all in-memory frames attached to the
  specified sample according to the following rules:
  
  -   Frames whose frame numbers are in ``frame_numbers`` are reloaded
  -   Frames whose frame numbers are not in ``frame_numbers`` are reset
docstr_tok: ["Syncs","the","backing","documents","for","all","in-memory","frames","attached","to","the","specified","sample","according","to","the","following","rules",":","-","Frames","whose","frame","numbers","are","in","``","frame_numbers","``","are","reloaded","-","Frames","whose","frame","numbers","are","not","in","``","frame_numbers","``","are","reset"]
code: def _sync_docs_for_sample(
      cls, collection_name, sample_id, frame_numbers, hard=False
  ):
      """Syncs the backing documents for all in-memory frames attached to the
      specified sample according to the following rules:
  
      -   Frames whose frame numbers are in ``frame_numbers`` are reloaded
      -   Frames whose frame numbers are not in ``frame_numbers`` are reset
      """
      if collection_name not in cls._instances:
          return
  
      samples = cls._instances[collection_name]
      frames = samples.get(str(sample_id), {})
  
      if not frames:
          return
  
      if callable(frame_numbers):
          frame_numbers = frame_numbers()
  
      frame_numbers = set(frame_numbers)
      reset_fns = set()
  
      for frame_number, frame in frames.items():
          if frame_number in frame_numbers:
              frame.reload(hard=hard)
          else:
              reset_fns.add(frame_number)
              frame._reset_backing_doc()
  
      for frame_number in reset_fns:
          frames.pop(frame_number)
  
imports: from collections import defaultdict
  import weakref
label_desc: Use image node_id 10 for calling the FrameSingleton obj's underlying member method code with example usage: obj._sync_docs_for_sample(cls, collection_name, sample_id, frame_numbers, hard) without return types