Returns the cwd

            Optional kwargs:

                node = <node>
                If specified, return only the directory name at depth <node>.
483829
def pwd(self, **kwargs):
            

            b_node  = False
            node    = 0
            for key,val in kwargs.items():
                if key == 'node':
                    b_node  = True
                    node    = int(val)

            str_path = self.cwd()
            if b_node:
                l_path      = str_path.split('/')
                if len(l_path) >= node+1:
                    str_path    = str_path.split('/')[node]
            return str_path
1343820
def _get_node(self, treelist, pos):
        
        node = None
        if pos is not None:
            subtree = self._get_substructure(treelist, pos)
            if subtree is not None:
                node = subtree[0]
        return node
945818
def cwd (self):
        
        path = self.urlparts[2].encode(self.filename_encoding, 'replace')
        dirname = path.strip('/')
        dirs = dirname.split('/')
        filename = dirs.pop()
        self.url_connection.cwd('/')
        for d in dirs:
            self.url_connection.cwd(d)
        return filename
332889
def _check_node_parameters(self, **kwargs):
        """"""
        if 'fqdn' in kwargs:
            kwargs['fqdn'].pop('autopopulate', '')
            kwargs['fqdn'].pop('addressFamily', '')
        if 'fqdn' in self.__dict__:
            self.__dict__['fqdn'].pop('autopopulate', '')
            self.__dict__['fqdn'].pop('addressFamily', '')
        if 'state' in kwargs:
            if kwargs['state'] != 'user-up' and kwargs['state'] != \
                    'user-down':
                kwargs.pop('state')
        if 'state' in self.__dict__:
            if self.__dict__['state'] != 'user-up' and self.__dict__['state'] \
                    != 'user-down':
                self.__dict__.pop('state')
        if 'session' in kwargs:
            if kwargs['session'] != 'user-enabled' and kwargs['session'] != \
                    'user-disabled':
                kwargs.pop('session')
        if 'session' in self.__dict__:
            if self.__dict__['session'] != 'user-enabled' and \
                    self.__dict__['session'] != 'user-disabled':
                self.__dict__.pop('session')
        # Until we implement sanity checks for __dict__ this needs to stay here
        self.__dict__.pop('ephemeral', '')
        self.__dict__.pop('address', '')
        return kwargs
557741
function (filePath) {
        var name = path.relative(this.opts.cwd, filePath);

        name = path.join(path.dirname(name), path.basename(name, this.opts.extension));

        return name;
    }
411852
def join_cwd(self, path=None):
        

        if self.working_dir:
            logger.debug(
                "'%s' instance 'working_dir' set to '%s' for join_cwd",
                type(self).__name__, self.working_dir,
            )
            cwd = self.working_dir
        else:
            cwd = getcwd()
            logger.debug(
                "'%s' instance 'working_dir' unset; "
                "default to process '%s' for join_cwd",
                type(self).__name__, cwd,
            )

        if path:
            return join(cwd, path)
        return cwd
1099165
private DNode findFrontendNode() {
        DNode frontend = getNode(requirements.getFrontend());
        
        if (frontend == DNode.NOT_FOUND) {
            
            frontend = searchFrontendNode();

            if (frontend == DNode.NOT_FOUND) {
                frontend = calculateSourceNode();
            }
        }
        return frontend;
    }
1135233
function (callback, ctx) {
            var depth, node;
            for (depth = 0, node = this; node !== null; node = node.parent(), depth++)
                ctx = callback(depth, node, ctx);
            return ctx;
        }
782616
def str_lsnode(self, astr_path=""):
            
            self.sCore.reset()
            str_cwd       = self.cwd()
            if len(astr_path): self.cdnode(astr_path)
            for node in self.snode_current.d_nodes.keys():
                self.sCore.write('%s\n' % node)
            str_ls = self.sCore.strget()
            if len(astr_path): self.cdnode(str_cwd)
            return str_ls
530820
def _getFullPathName(self, containingNodes):
        
        assert isinstance(containingNodes, list)
        return [(self.options.fullPathNamespace, 'module')] + containingNodes
1336553
def truncate_cwd(full_filename):
    """"""
    if full_filename.startswith(os.getcwd()):
        truncated_filename = full_filename.split(os.getcwd(), 1)[1]
        truncated_filename = truncated_filename.split(os.sep, 1)[1]
    else:
        truncated_filename = full_filename
    return truncated_filename
563617
function getBook(args, kwargs) {
    var input = path.resolve(args[0] || process.cwd());
    var logLevel = kwargs.log;

    var fs = createNodeFS(input);
    var book = Book.createForFS(fs);

    return book.setLogLevel(logLevel);
}
1031722
function getRootNode(node) {
  if (!Node.Type.isFunction(node, 'nthRoot')) {
    throw Error('Expected nthRoot');
  }

  return node.args.length === 2 ? node.args[1] : Node.Creator.constant(2);
}
574756
def _make_nodes(self, cwd=None):
        
        for i, node in NipypeMapNode._make_nodes(self, cwd=cwd):
            # "Cast" NiPype node to a Arcana Node and set Arcana Node
            # parameters
            node.__class__ = self.node_cls
            node._environment = self._environment
            node._versions = self._versions
            node._wall_time = self._wall_time
            node._annotations = self._annotations
            yield i, node
1277885
def call_method(self, name, args=None, kwargs=None, dyn_args=None,
                    dyn_kwargs=None, lineno=None):
        
        if args is None:
            args = []
        if kwargs is None:
            kwargs = []
        return nodes.Call(self.attr(name, lineno=lineno), args, kwargs,
                          dyn_args, dyn_kwargs, lineno=lineno)
980424
function getInitCwd () {
  if (process.env.INIT_CWD) {
    debug(`process.env.INIT_CWD: ${process.env.INIT_CWD}`)
    return process.env.INIT_CWD
  }

  const cwd = process.cwd()

  debug(`process.cwd(): ${cwd}`)

  // 兼容 npm v3
  return cwd.split(`${path.sep}node_modules${path.sep}`)[0]
}
523481
def node_mkdir(self, path=''):
		''
		return self(path, data=dict(kind='directory'), encode='json', method='put')