code: def _parse_video_frames(
      video_path,
      sample_frames,
      images_patt,
      support,
      total_frame_count,
      frame_rate,
      frame_ids_map,
      force_sample,
      sparse,
      fps,
      max_fps,
      verbose,
  ):
      #
      # Determine target frames, taking subsampling into account
      #
  
      if fps is not None or max_fps is not None:
          target_frame_numbers = fouv.sample_frames_uniform(
              frame_rate,
              total_frame_count=total_frame_count,
              support=support,
              fps=fps,
              max_fps=max_fps,
          )
      elif support is not None:
          first, last = support
          target_frame_numbers = list(range(first, last + 1))
      else:
          target_frame_numbers = None  # all frames
  
      #
      # Determine frames for which to generate documents
      #
  
      if target_frame_numbers is None:
          if total_frame_count < 0:
              doc_frame_numbers = sorted(frame_ids_map.keys())
          else:
              doc_frame_numbers = list(range(1, total_frame_count + 1))
      else:
          doc_frame_numbers = target_frame_numbers
  
      if sparse or sample_frames == False:
          doc_frame_numbers = [
              fn for fn in doc_frame_numbers if fn in frame_ids_map
          ]
  
      if sample_frames != True:
          return doc_frame_numbers, []
  
      #
      # Determine frames that need to be sampled
      #
  
      if force_sample:
          sample_frame_numbers = doc_frame_numbers
      else:
          sample_frame_numbers = _get_non_existent_frame_numbers(
              images_patt, doc_frame_numbers
          )
  
      if (
          target_frame_numbers is None
          and len(sample_frame_numbers) == len(doc_frame_numbers)
          and len(doc_frame_numbers) >= total_frame_count
      ):
          sample_frame_numbers = None  # all frames
  
      if verbose:
          count = total_frame_count if total_frame_count >= 0 else "???"
          if sample_frame_numbers is None:
              logger.info(
                  "Must sample all %s frames of '%s'",
                  count,
                  video_path,
              )
          elif sample_frame_numbers != []:
              logger.info(
                  "Must sample %d/%s frames of '%s'",
                  len(sample_frame_numbers),
                  count,
                  video_path,
              )
          else:
              logger.info(
                  "Required frames already present for '%s'", video_path
              )
  
      return doc_frame_numbers, sample_frame_numbers
  
imports: from collections import defaultdict
  from copy import deepcopy
  import logging
  import os
  from bson import ObjectId
  from pymongo import UpdateOne
  import eta.core.utils
  import fiftyone
  import fiftyone.core.dataset
  import fiftyone.core.fields
  import fiftyone.core.media
  import fiftyone.core.sample
  import fiftyone.core.odm
  import fiftyone.core.odm.sample
  import fiftyone.core.utils
  import fiftyone.core.validation
  import fiftyone.core.view
label_desc: Use image node_id 5 for calling a global function with example usage: _parse_video_frames(video_path, sample_frames, images_patt, support, total_frame_count, frame_rate, frame_ids_map, force_sample, sparse, fps, max_fps, verbose) and returns: doc_frame_numbers,  sample_frame_numbers, doc_frame_numbers,  list