code: def _try_parent_dirs(path, entries):
      """Looks for `path` parent dirs in `entries`.
  
      Has the side-effect of writing found parent entries to `entries`
      for the direct parent of `path` as an optimization for future
      lookups.
      """
      dirname = dirname0 = os.path.dirname(path)
      while dirname:
          entry = entries.get(dirname)
          if entry:
              if dirname != dirname0:
                  entries[dirname0] = entry
              return entry
          dirname = os.path.dirname(dirname)
      return None
  
imports: import os
  import re
  from guild import manifest
  from guild import util
  from guild import var
label_desc: Use image node_id 20 for calling a global function with example usage: _try_parent_dirs(path, entries) and returns: None, entry