code: def _get_revisions_to_run(head, dest, revisions):
      revisions = sorted(revisions, key=lambda r: Version(r[0]))
  
      head = Version(head)
      dest = Version(dest)
  
      rev_versions = [Version(r[0]) for r in revisions]
  
      head_idx = bisect.bisect(rev_versions, head)
      dest_idx = bisect.bisect(rev_versions, dest)
  
      if dest >= head:
          revisions_to_run = revisions[head_idx:dest_idx]
          return revisions_to_run, UP
  
      revisions_to_run = revisions[dest_idx:head_idx][::-1]
      return revisions_to_run, DOWN
  
imports: import bisect
  import logging
  import os
  from packaging.requirements import Requirement
  from packaging.version import Version
  import eta.core.utils
  import fiftyone
  import fiftyone.constants
  import fiftyone.core.odm
  import fiftyone.core.utils
label_desc: Use image node_id 13 for calling a global function with example usage: _get_revisions_to_run(head, dest, revisions) and returns: revisions_to_run,  DOWN, revisions_to_run,  UP