code: def find_up(
      relpath, start_dir=None, stop_dir=None, check=os.path.exists
  ):
      start_dir = (
          os.path.abspath(start_dir) if start_dir else os.getcwd()
      )
      stop_dir = util.realpath(stop_dir) if stop_dir else _user_home()
  
      cur = start_dir
      while True:
          maybe_target = os.path.join(cur, relpath)
          if check(maybe_target):
              return maybe_target
          if util.realpath(cur) == stop_dir:
              return None
          parent = os.path.dirname(cur)
          if parent == cur:
              return None
          cur = parent
  
      # `parent == cur` above should be the definitive terminal case
      assert False
  
imports: import fnmatch
  import glob
  import logging
  import os
  import re
  import shutil
  from guild import util
label_desc: Use image node_id 18 for calling a global function with example usage: find_up(relpath, start_dir, stop_dir, check) and returns: maybe_target, None, None