Returns the node where all users are stored.
430313
Node getUsersStorageNode(Session session) throws PathNotFoundException, RepositoryException
   {
      return (Node)session.getItem(service.getStoragePath() + "/" + JCROrganizationServiceImpl.STORAGE_JOS_USERS);
   }
349779
public DatanodeInfo[] bestNode(LocatedBlocks blks) throws IOException {
    // insert all known replica locations into a tree map where the
    // key is the DatanodeInfo
    TreeMap<DatanodeInfo, NodeRecord> map = 
      new TreeMap<DatanodeInfo, NodeRecord>();
    for (int i = 0; i < blks.getLocatedBlocks().size(); i++) {
      DatanodeInfo [] nodes = blks.get(i).getLocations();
      for (int j = 0; j < nodes.length; j++) {
        NodeRecord obj = map.get(nodes[j]);
        if (obj != null) {
          obj.frequency++;
        } else {
          map.put(nodes[j], new NodeRecord(nodes[j], 1));
        }
      }
    }
    // sort all locations by their frequency of occurance
    Collection<NodeRecord> values = map.values();
    NodeRecord[] nodes = (NodeRecord[]) 
                         values.toArray(new NodeRecord[values.size()]);
    Arrays.sort(nodes, new NodeRecordComparator());
    try {
      List<NodeRecord> candidates = bestNode(nodes, false);
      return candidates.toArray(new DatanodeInfo[candidates.size()]);
    } catch (IOException e) {
      return new DatanodeInfo[] {randomNode()};
    }
  }
759443
def nodes(self, type=None, failed=False, participant_id=None):
        
        if type is None:
            type = Node

        if not issubclass(type, Node):
            raise TypeError("{} is not a valid node type.".format(type))

        if failed not in ["all", False, True]:
            raise ValueError("{} is not a valid node failed".format(failed))

        if participant_id is not None:
            if failed == "all":
                return type.query.filter_by(
                    network_id=self.id, participant_id=participant_id
                ).all()
            else:
                return type.query.filter_by(
                    network_id=self.id, participant_id=participant_id, failed=failed
                ).all()
        else:
            if failed == "all":
                return type.query.filter_by(network_id=self.id).all()
            else:
                return type.query.filter_by(failed=failed, network_id=self.id).all()
1322364
def users(self, user_base='active'):
        """"""
        if not getattr(self, '_%s_users' % user_base):
            self._get_users(user_base)
        return getattr(self, '_%s_users' % user_base)
66178
def get_all_users(path_prefix='/', region=None, key=None, keyid=None,
                 profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
    if not conn:
        return None
    _users = conn.get_all_users(path_prefix=path_prefix)
    users = _users.list_users_response.list_users_result.users
    marker = getattr(
        _users.list_users_response.list_users_result, 'marker', None
    )
    while marker:
        _users = conn.get_all_users(path_prefix=path_prefix, marker=marker)
        users = users + _users.list_users_response.list_users_result.users
        marker = getattr(
            _users.list_users_response.list_users_result, 'marker', None
        )
    return users
421303
def _set_users(self, node):
        '''
        
        '''
        # Get real local users with the local passwords
        shadow = {}
        with salt.utils.files.fopen('/etc/shadow') as rfh:
            for sh_line in rfh.read().split(os.linesep):
                if sh_line.strip():
                    login, pwd = sh_line.split(":")[:2]
                    if pwd and pwd[0] not in '!*':
                        shadow[login] = {'p': pwd}

        with salt.utils.files.fopen('/etc/passwd') as rfh:
            for ps_line in rfh.read().split(os.linesep):
                if ps_line.strip():
                    ps_line = ps_line.strip().split(':')
                    if ps_line[0] in shadow:
                        shadow[ps_line[0]]['h'] = ps_line[5]
                        shadow[ps_line[0]]['s'] = ps_line[6]
                        shadow[ps_line[0]]['g'] = self._get_user_groups(ps_line[0])

        users_groups = []
        users_node = etree.SubElement(node, 'users')
        for u_name, u_data in shadow.items():
            user_node = etree.SubElement(users_node, 'user')
            user_node.set('password', u_data['p'])
            user_node.set('home', u_data['h'])
            user_node.set('name', u_name)
            users_groups.extend(u_data['g'])
        users_node.set('group', ','.join(users_groups))

        return users_node
641742
def get_all_users(resource_root, view=None):
  
  return call(resource_root.get, USERS_PATH, ApiUser, True,
      params=view and dict(view=view) or None)
979804
def _list_nodes(full=False):
    '''
    
    '''
    server, user, password = _get_xml_rpc()
    auth = ':'.join([user, password])

    vm_pool = server.one.vmpool.info(auth, -2, -1, -1, -1)[1]

    vms = {}
    for vm in _get_xml(vm_pool):
        name = vm.find('NAME').text
        vms[name] = {}

        cpu_size = vm.find('TEMPLATE').find('CPU').text
        memory_size = vm.find('TEMPLATE').find('MEMORY').text

        private_ips = []
        for nic in vm.find('TEMPLATE').findall('NIC'):
            try:
                private_ips.append(nic.find('IP').text)
            except Exception:
                pass

        vms[name]['id'] = vm.find('ID').text
        if 'TEMPLATE_ID' in vm.find('TEMPLATE'):
            vms[name]['image'] = vm.find('TEMPLATE').find('TEMPLATE_ID').text
        vms[name]['name'] = name
        vms[name]['size'] = {'cpu': cpu_size, 'memory': memory_size}
        vms[name]['state'] = vm.find('STATE').text
        vms[name]['private_ips'] = private_ips
        vms[name]['public_ips'] = []

        if full:
            vms[vm.find('NAME').text] = _xml_to_dict(vm)

    return vms
886682
def get_node(self, key):
    """"""
    if key in self.names:
      return self.values.get_member_node(key) if hasattr(self.values, 'get_member_node') else None
    return self.parent.get_node(key)
1183948
def nodes_simple_info(self, params={}, **kwargs):
        
        h = ['name', 'pid', 'http_address', 'version', 'jdk', 'disk.total', 'disk.used_percent', 'heap.current',
             'heap.percent', 'ram.current', 'ram.percent', 'uptime', 'node.role']
        result = self.client.cat.nodes(v=True, h=h, **kwargs, params=params)
        result = [x.strip().split(' ') for x in result.split('\n')]
        # Clean up the space
        result.remove(result[-1])
        for i in range(len(result)):
            result[i] = list(filter(lambda x: x != '', result[i]))
        # Packing into the dictionary
        dicts = []
        for i in range(len(result) - 1):
            dict = {}
            for k, v in zip(result[0], result[i + 1]):
                dict[k] = v
            dicts.append(dict)

        logger.info('Acquire simple information of the nodes is done succeeded: %s' % len(dicts))
        return dicts
1045705
def get_node(conn, name):
    '''
    
    '''
    for node in conn.list_servers(per_page=1000):
        if node['name'] == name:
            return node
854926
def nodes():
    '''
    
    '''
    for name, provider in env.providers.items():
        print name
        provider.nodes()
        print
359715
private function getPersistersNode()
    {
        $node = $this->createRootNode('persisters');
        return $node
            ->isRequired()
            ->useAttributeAsKey('name')
            ->prototype('array')
                ->children()

                    ->enumNode('type')
                        ->values(['mongodb', null])
                    ->end()
                    ->scalarNode('service')->cannotBeEmpty()->end()

                    ->arrayNode('parameters')
                        ->performNoDeepMerging()
                        ->prototype('variable')->end()
                    ->end()
                ->end()
            ->end()
            ->validate()
                ->always(function($v) {
                    $this->validatePersisters($v);
                    return $v;
                })
            ->end()
        ;
    }
999263
String getUserNodePath(String userName) throws RepositoryException
   {
      return service.getStoragePath() + "/" + JCROrganizationServiceImpl.STORAGE_JOS_USERS + "/" + userName;
   }
1081035
def getNodeBeingMade(self, buid):
        '''
        
        '''
        nodeevnt = self.allbldgbuids.get(buid)
        if nodeevnt is None:
            return None
        if buid not in self.mybldgbuids:
            self.otherbldgbuids.add(buid)
        return nodeevnt[0]
1050646
public function findAllUsers()
    {
        $this->checkDb();
        return $this->db->connect()
                        ->select()
                        ->from($this->tableName)
                        ->where("deleted IS NULL")
                        ->execute()
                        ->fetchAllClass(get_class($this));
    }
623297
def partition_node(node):
    """"""
    host = node
    port = 27017
    idx = node.rfind(':')
    if idx != -1:
        host, port = node[:idx], int(node[idx + 1:])
    if host.startswith('['):
        host = host[1:-1]
    return host, port