Return the be current working directory
11269
def cwd():
    """"""
    cwd = os.environ.get("BE_CWD")
    if cwd and not os.path.isdir(cwd):
        sys.stderr.write("ERROR: %s is not a directory" % cwd)
        sys.exit(lib.USER_ERROR)
    return cwd or os.getcwd().replace("\\", "/")
732780
def currentFolder(self, value):
        """"""
        if value is not None and value.lower() == self._currentFolder['title']:
            return
        if value is None:
            self._location = self.root
            self._currentFolder = {
                    'title': 'root',
                    'id': None,
                    'created' : None,
                    'username' : None
                }
            self.__init()
        elif value == "/" or value.lower() == 'root':
            self.location = self.root
            self._currentFolder = {
                    'title': 'root',
                    'id': None,
                    'created' : None,
                    'username' : None
                }
            self.__init()
        else:
            for folder in self.folders:
                if 'title' in folder:
                    if folder['title'].lower() == value.lower():
                        self._location = "%s/%s" % (self.root, folder['id'])
                        self._currentFolder = folder
                        self.__init(folder['title'])
                        break
191886
def get_env(working_directory=None):
    
    working = working_directory if working_directory else os.getcwd()
    dist_dirs = glob.glob(working + "/f5-*-dist")
    print(dist_dirs)
    dist_dir_re = re.compile('/([^/]+)-dist/?')
    if dist_dirs:
        dist_dir = dist_dirs[0]
        match = dist_dir_re.search(dist_dir)
        if match:
            project_name = match.group(1)
        else:
            print("Unrecognized run location:\n" + working)
            exit_cleanly(errnum=errno.EIO)
    elif '-dist/scripts' in working:
        match = dist_dir_re.search(working)
        if match:
            project_name = match.group(1)
    else:
        print("Unable to determine the *-dist directory from " + working)
        exit_cleanly(errnum=errno.ENOSYS)
    stdeb_cfg = dist_dir + "/deb_dist/stdeb.cfg"
    setup_cfg = working + "/setup.cfg"
    stp_reqs = working + "/setup_requirements.txt"
    scripts = dist_dir + "/scripts"
    env = {'working': working, 'dist_dir': dist_dir, 'stdeb_cfg': stdeb_cfg,
           'setup_requirements': stp_reqs, 'setup_cfg': setup_cfg,
           'scripts': scripts, 'project': project_name}
    return env
1144230
def excursion(directory):
    """"""
    old_dir = os.getcwd()
    try:
        os.chdir(directory)
        yield
    finally:
        os.chdir(old_dir)
399142
private void checkWorkingDir(File dir) {
        if (dir != null) {
            if (!dir.exists()) {
                throw new CommandLineException("Working directory \"" + dir.getAbsolutePath() + "\" does not exist!");
            } else if (!dir.isDirectory()) {
                throw new CommandLineException("Path \"" + dir.getAbsolutePath() + "\" does not specify a "
                        + "directory.");
            }
        }
    }
891054
def staticdir():
    """"""
    root = os.path.abspath(os.path.dirname(__file__))
    return os.path.join(root, "static")
481473
def relative_root_dir(self):
        """"""
        return Path(self.bundle.name) / str(self.created_at.date())
344699
def set_current_folder(self, folder):
        """"""
        index = self.fsmodel.setRootPath(folder)
        self.__last_folder = folder
        if self.show_cd_only:
            if self.__original_root_index is None:
                self.__original_root_index = self.rootIndex()
            self.setRootIndex(index)
        return index
1172751
function getAppDir() {
    var fileRepo = args._[1] ? path.resolve(args._[1]) : undefined;
    return fileRepo && fs.existsSync(fileRepo) ? fileRepo : 0;
}
1067789
def set_working_directory(self, path):
        
        """
        _complain_ifclosed(self.closed)
        return self.fs.set_working_directory(path)
1041758
def top_directory(self):
        """"""
        if self.handle:
            return os.path.commonprefix(self.handle.getnames()).rstrip('/')
502073
def step_use_curdir_as_working_directory(context):
    
    context.workdir = os.path.abspath(".")
    command_util.ensure_workdir_exists(context)
369411
def isOriginalLocation(attr):
    
    sourceModule = inspect.getmodule(attr.load())
    if sourceModule is None:
        return False

    currentModule = attr
    while not isinstance(currentModule, PythonModule):
        currentModule = currentModule.onObject

    return currentModule.name == sourceModule.__name__
1204921
def _support_directory():
    """"""
    from os.path import join, dirname, abspath
    return join(dirname(abspath(__file__)), 'support_files')
1304819
def get_dir(self):
        
        if "-WD" in sys.argv and self.FIRST_RUN:
            ind = sys.argv.index('-WD')
            self.WD = os.path.abspath(sys.argv[ind+1])
            os.chdir(self.WD)
            self.WD = os.getcwd()
            self.dir_path.SetValue(self.WD)
        else:
            self.on_change_dir_button(None)
            #self.WD = os.getcwd()

        self.FIRST_RUN = False
49785
def _IsDirectory(parent, item):
  """"""
  return tf.io.gfile.isdir(os.path.join(parent, item))
968608
private synchronized File getWorkingDirectory() {
    if (workingDirectory == null) {
      try {
        workingDirectory =
            Files.createTempDirectory(TEMP_DIRECTORY_PREFIX).toFile();
      } catch (IOException e) {
        throw new UnexpectedException(e);
      }
    }
    return workingDirectory;
  }