def _find_mapreduce_yaml(start, checked):
 dir = start
 while (dir not in checked):
  checked.add(dir)
  for mr_yaml_name in MR_YAML_NAMES:
   yaml_path = os.path.join(dir, mr_yaml_name)
   if os.path.exists(yaml_path):
    return yaml_path
  dir = os.path.dirname(dir)
 return None

def _find_mapreduce_yaml ( start , checked ) : dir = start while ( dir not in checked ) : checked . add ( dir ) for mr_yaml_name in MR_YAML_NAMES : yaml_path = os . path . join ( dir , mr_yaml_name ) if os . path . exists ( yaml_path ) : return yaml_path dir = os . path . dirname ( dir ) return None
traverse the directory tree identified by start until a directory already in checked is encountered or the path of mapreduce .