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: Resets the backing documents for all in-memory frames with the given
  frame numbers attached to the specified sample.
  
  When ``keep=True``, all frames whose frame numbers are **not** in
  ``frame_numbers`` are reset instead.
docstr_tok: ["Resets","the","backing","documents","for","all","in-memory","frames","with","the","given","frame","numbers","attached","to","the","specified","sample",".","When","``","keep=True","``",",","all","frames","whose","frame","numbers","are","*","*","not","*","*","in","``","frame_numbers","``","are","reset","instead","."]
code: def _reset_docs_for_sample(
      cls, collection_name, sample_id, frame_numbers, keep=False
  ):
      """Resets the backing documents for all in-memory frames with the given
      frame numbers attached to the specified sample.
  
      When ``keep=True``, all frames whose frame numbers are **not** in
      ``frame_numbers`` are reset instead.
      """
      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()
  
      if keep:
          for frame_number, frame in frames.items():
              if frame_number not in frame_numbers:
                  reset_fns.add(frame_number)
                  frame._reset_backing_doc()
      else:
          for frame_number, frame in frames.items():
              if frame_number in frame_numbers:
                  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 14 for calling the FrameSingleton obj's underlying member method code with example usage: obj._reset_docs_for_sample(cls, collection_name, sample_id, frame_numbers, keep) without return types