Attempt to become root.
497624
def enable(self, cmd="sudo su", pattern="ssword", re_flags=re.IGNORECASE):
        """"""
        delay_factor = self.select_delay_factor(delay_factor=0)
        output = ""
        if not self.check_enable_mode():
            self.write_channel(self.normalize_cmd(cmd))
            time.sleep(0.3 * delay_factor)
            try:
                output += self.read_channel()
                if re.search(pattern, output, flags=re_flags):
                    self.write_channel(self.normalize_cmd(self.secret))
                self.set_base_prompt()
            except socket.timeout:
                raise NetMikoTimeoutException(
                    "Timed-out reading channel, data not available."
                )
            if not self.check_enable_mode():
                msg = (
                    "Failed to enter enable mode. Please ensure you pass "
                    "the 'secret' argument to ConnectHandler."
                )
                raise ValueError(msg)
        return output
230671
function _getRoot(transform) {
  return function() {
    var parent = transform.parent;
    return parent === undefined ? transform : parent.root;
  }
}
386654
public void setRoot(int root)
  {
    // %OPT% Get this directly from the lpi.
    XPathContext xctxt = wi().getXPathContext();
    m_dtm = xctxt.getDTM(root);
    m_traverser = m_dtm.getAxisTraverser(m_axis);
    m_isFresh = true;
    m_foundLast = false;
    m_root = root;
    m_currentNode = root;

    if (DTM.NULL == root)
    {
      throw new RuntimeException(
        XSLMessages.createXPATHMessage(XPATHErrorResources.ER_SETTING_WALKER_ROOT_TO_NULL, null)); //"\n !!!! Error! Setting the root of a walker to null!!!");
    }

    resetProximityPositions();
  }
1362204
def pop(self):
        """"""
        root = self.heap[1]
        del self.rank[root]
        x = self.heap.pop()    # remove last leaf
        if self:               # if heap is not empty
            self.heap[1] = x   # put last leaf to root
            self.rank[x] = 1
            self.down(1)       # maintain heap order
        return root
617140
def get_root( self, **kwargs ):
        ''' 
        '''
        if self.parent == None:
            return self
        else:
            return self.parent.get_root( **kwargs )
662564
def getRoot():
    """"""
    root = settings.MEDIA_ROOT.replace('\\', '/')
    if not root.endswith('/'):
        root += '/'

    return path.Path(root)
533441
def root
      if parent_ids.present?
        base_class.find(parent_ids.first)
      else
        self.root? ? self : self.parent.root
      end
    end
926556
void root(ProtoMember protoMember) {
    if (protoMember == null) throw new NullPointerException("protoMember == null");
    checkArgument(!identifierSet.excludes(protoMember));
    checkArgument(!types.contains(protoMember.type()));
    members.put(protoMember.type(), protoMember);
  }
717883
def get_root(self):
        """"""
        return get_result_class(self.__class__).objects.get(
            path=self.path[0:self.steplen])
1325477
function resolveInRoot(root) {
    var input, result, err;

    input = _.chain(arguments)
        .toArray()
        .slice(1)
        .reduce(function(current, p) {
            // Handle path relative to book root ("/README.md")
            if (p[0] == "/" || p[0] == "\\") return p.slice(1);

            return current? path.join(current, p) : path.normalize(p);
        }, "")
        .value();

    result = path.resolve(root, input);

    if (!isInRoot(root, result)) {
        err = new Error("EACCESS: \"" + result + "\" not in \"" + root + "\"");
        err.code = "EACCESS";
        throw err;
    }

    return result;
}
350828
def init(image, root=None):
    '''
    
    '''
    nbd = connect(image)
    if not nbd:
        return ''
    return mount(nbd, root)
264554
def move_up(self):
        """"""
        if self.current_item.parent is not None:
            self.current_item = self.current_item.parent

        for f in self._hooks["up"]:
            f(self)
        if self.current_item is self.root:
            for f in self._hooks["top"]:
                f(self)
        return self
836350
private Path relPathToRoot(Path fullPath, Path root) {
    // just take some effort to do it 
    // rather than just using substring 
    // so that we do not break sometime later
    Path justRoot = new Path(Path.SEPARATOR);
    if (fullPath.depth() == root.depth()) {
      return justRoot;
    }
    else if (fullPath.depth() > root.depth()) {
      Path retPath = new Path(fullPath.getName());
      Path parent = fullPath.getParent();
      for (int i=0; i < (fullPath.depth() - root.depth() -1); i++) {
        retPath = new Path(parent.getName(), retPath);
        parent = parent.getParent();
      }
      return new Path(justRoot, retPath);
    }
    return null;
  }
146341
protected void updateRoot(CmsObject rootCms, CmsResource siteRootResource) {

        m_root = siteRootResource;
        m_currentCms = rootCms;
        updateView();
    }
358390
def root (path, root):
    
    if os.path.isabs (path):
        return path
    else:
        return os.path.join (root, path)
471285
def root(self):
            
            str_treeRoot                = '/'
            self.l_cwd                  = [str_treeRoot]
            self.snode_current          = self.snode_root
            self.sbranch_current        = self.sbranch_root
981375
function AttemptRootSymlink() {

    if (process.platform === 'win32') {
      var curPath = resolve("./");
      if (debugging) {
          console.log("RootSymlink Base path is", curPath);
      }
      cp.execSync("powershell -Command \"Start-Process 'node' -ArgumentList '"+curPath+"/install.js symlink' -verb runas\"");
    } else {
      console.log("To automatically create a SymLink between your web app and NativeScript, we need root for a second.");
      cp.execSync("sudo "+process.argv[0] + " " + process.argv[1] +" symlink");
    }
}