parameters: ()
return_statement: return build_dir
docstring: find the ELL build directory relative to this file
docstring_summary: find the ELL build directory relative to this file
docstring_tokens: find the ELL build directory relative to this file
function: def find_ell_build():
      """ find the ELL build directory relative to this file """
      build_dir = ""
      for potential_dir in [os.getcwd(), __this_file_directory]:
          head = potential_dir
          tail = ""
          while True:
              # find a file that is unique to the ELL build folder
              # (this works if our search started somewhere in the build folder)
              test = os.path.join(head, "ell_build_tools.json")
              if os.path.isfile(test):
                  return head
  
              # find a file that is unique to the ELL repo root.
              test = os.path.join(head, "StyleGuide.md")
              if os.path.isfile(test):
                  # this happens if we are searching from outside the build folder, so in
                  # order to support different named build folders, like 'build_gcc' or 'build_clang'
                  # we match by "build" prefix.
                  for d in os.listdir(head):
                      dd = os.path.join(head, d)
                      if d.startswith("build") and \
                          os.path.isdir(dd) and \
                              os.path.isfile(os.path.join(dd, "ell_build_tools.json")):  # noqa: E501
                          return dd
                  print("ELL build folder not found in {}\nFound:{}".format(head, os.listdir(head)))
  
              newhead, tail = os.path.split(head)
              if newhead == head:
                  break
              else:
                  head = newhead
      return build_dir
function_tokens: def find_ell_build ( ) : build_dir = "" for potential_dir in [ os . getcwd ( ) , __this_file_directory ] : head = potential_dir tail = "" while True : # find a file that is unique to the ELL build folder # (this works if our search started somewhere in the build folder) test = os . path . join ( head , "ell_build_tools.json" ) if os . path . isfile ( test ) : return head # find a file that is unique to the ELL repo root. test = os . path . join ( head , "StyleGuide.md" ) if os . path . isfile ( test ) : # this happens if we are searching from outside the build folder, so in # order to support different named build folders, like 'build_gcc' or 'build_clang' # we match by "build" prefix. for d in os . listdir ( head ) : dd = os . path . join ( head , d ) if d . startswith ( "build" ) and os . path . isdir ( dd ) and os . path . isfile ( os . path . join ( dd , "ell_build_tools.json" ) ) : # noqa: E501 return dd print ( "ELL build folder not found in {}\nFound:{}" . format ( head , os . listdir ( head ) ) ) newhead , tail = os . path . split ( head ) if newhead == head : break else : head = newhead return build_dir