parameters: ()
docstring: Get the base directory for mongo repo.
          This script assumes that it is running in buildscripts/, and uses
          that to find the base directory.
docstring_summary: Get the base directory for mongo repo.
          This script assumes that it is running in buildscripts/, and uses
          that to find the base directory.
docstring_tokens: Get the base directory for mongo repo . This script assumes that it is running in buildscripts / and uses that to find the base directory .
function: def get_base_dir():
      """Get the base directory for mongo repo.
          This script assumes that it is running in buildscripts/, and uses
          that to find the base directory.
      """
      try:
          return subprocess.check_output(['git', 'rev-parse', '--show-toplevel']).rstrip()
      except:
          # We are not in a valid git directory. Use the script path instead.
          return os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
function_tokens: def get_base_dir ( ) : try : return subprocess . check_output ( [ 'git' , 'rev-parse' , '--show-toplevel' ] ) . rstrip ( ) except : # We are not in a valid git directory. Use the script path instead. return os . path . dirname ( os . path . dirname ( os . path . realpath ( __file__ ) ) )