Get list of organization on DCNM.
516151
def do_list_organizations(self, line):
        ''''''

        org_list = self.dcnm_client.list_organizations()
        if not org_list:
            print('No organization found.')
            return

        org_table = PrettyTable(['Organization Name'])
        for org in org_list:
            org_table.add_row([org['organizationName']])

        print(org_table)
427892
def get_orgs(self):
        
        return github.PaginatedList.PaginatedList(
            github.Organization.Organization,
            self._requester,
            "/user/orgs",
            None
        )
1062999
def keys_list(gandi, fqdn):
    """"""
    keys = gandi.dns.keys(fqdn)
    output_keys = ['uuid', 'algorithm', 'algorithm_name', 'ds', 'flags',
                   'status']
    for num, key in enumerate(keys):
        if num:
            gandi.separator_line()
        output_generic(gandi, key, output_keys, justify=15)
    return keys
560782
def list(self, limit=None, offset=None):
        """"""
        return self._manager.list(limit=limit, offset=offset)
1341170
def list(self):
        """"""
        service = self._service

        lxc_names = service.list_names()
        lxc_list = []
        for name in lxc_names:
            lxc = self.get(name)
            lxc_list.append(lxc)
        return lxc_list
9631
private List<String> getGroups(String dn) throws WIMException {
        List<String> grpList = new ArrayList<String>();
        String filter = iLdapConfigMgr.getGroupMemberFilter(dn);
        String[] searchBases = iLdapConfigMgr.getGroupSearchBases();
        for (int i = 0; i < searchBases.length; i++) {
            String searchBase = searchBases[i];
            NamingEnumeration<SearchResult> nenu = iLdapConn.search(searchBase, filter, SearchControls.SUBTREE_SCOPE,
                                                                    LDAP_ATTR_OBJECTCLASS_ARRAY);
            while (nenu.hasMoreElements()) {
                SearchResult thisEntry = nenu.nextElement();
                if (thisEntry == null) {
                    continue;
                }
                String entryName = thisEntry.getName();
                if (entryName == null || entryName.trim().length() == 0) {
                    continue;
                }
                grpList.add(LdapHelper.prepareDN(entryName, searchBase));
            }
        }
        return grpList;
    }
324208
function list_group_members($dn, $count = false, $entries = null)
    {
        $group_members = array();

        // fetch group object
        if (empty($entries)) {
            $attribs = array_merge(array('dn','objectClass','memberURL'), array_values($this->group_types));
            $entries = $this->ldap->read_entries($dn, '(objectClass=*)', $attribs);
            if ($entries === false) {
                return $group_members;
            }
        }

        for ($i=0; $i < $entries['count']; $i++) {
            $entry = $entries[$i];
            $attrs = array();

            foreach ((array)$entry['objectclass'] as $objectclass) {
                if (($member_attr = $this->get_group_member_attr(array($objectclass), ''))
                    && ($member_attr = strtolower($member_attr)) && !in_array($member_attr, $attrs)
                ) {
                    $members       = $this->_list_group_members($dn, $entry, $member_attr, $count);
                    $group_members = array_merge($group_members, $members);
                    $attrs[]       = $member_attr;
                }
                else if (!empty($entry['memberurl'])) {
                    $members       = $this->_list_group_memberurl($dn, $entry, $count);
                    $group_members = array_merge($group_members, $members);
                }

                if ($this->prop['sizelimit'] && count($group_members) > $this->prop['sizelimit']) {
                    break 2;
                }
            }
        }

        return array_filter($group_members);
    }
1282972
def get_organization_events(self, org):
        
        assert isinstance(org, github.Organization.Organization), org
        return github.PaginatedList.PaginatedList(
            github.Event.Event,
            self._requester,
            "/users/" + self.login + "/events/orgs/" + org.login,
            None
        )
1199304
def list_nodes(call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The list_nodes function must be called with -f or --function.'
        )

    ret = {}
    items = query(action='ve')

    for item in items:
        name = item.attrib['name']
        node = show_instance(name, call='action')

        ret[name] = {
            'id': node['id'],
            'image': node['platform']['template-info']['name'],
            'state': node['state'],
        }
        if 'private-ip' in node['network']:
            ret[name]['private_ips'] = [node['network']['private-ip']]
        if 'public-ip' in node['network']:
            ret[name]['public_ips'] = [node['network']['public-ip']]

    return ret
553721
def list(self, limit=None, marker=None, name=None, visibility=None,
            member_status=None, owner=None, tag=None, status=None,
            size_min=None, size_max=None, sort_key=None, sort_dir=None):
        
        return self._manager.list(limit=limit, marker=marker, name=name,
                visibility=visibility, member_status=member_status,
                owner=owner, tag=tag, status=status, size_min=size_min,
                size_max=size_max, sort_key=sort_key, sort_dir=sort_dir)
879885
public function listPublicOrganizationEvents(string $organization): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/orgs/:org/events', $organization));
    }
1098384
def interface_list(env, securitygroup_id, sortby):
    """"""
    mgr = SoftLayer.NetworkManager(env.client)

    table = formatting.Table(COLUMNS)
    table.sortby = sortby

    mask = (
        '''networkComponentBindings[
            networkComponentId,
            networkComponent[
                id,
                port,
                guest[
                    id,
                    hostname,
                    primaryBackendIpAddress,
                    primaryIpAddress
                ]
            ]
        ]'''
    )

    secgroup = mgr.get_securitygroup(securitygroup_id, mask=mask)
    for binding in secgroup.get('networkComponentBindings', []):
        interface_id = binding['networkComponentId']
        try:
            interface = binding['networkComponent']
            vsi = interface['guest']
            vsi_id = vsi['id']
            hostname = vsi['hostname']
            priv_pub = 'PRIVATE' if interface['port'] == 0 else 'PUBLIC'
            ip_address = (vsi['primaryBackendIpAddress']
                          if interface['port'] == 0
                          else vsi['primaryIpAddress'])
        except KeyError:
            vsi_id = "N/A"
            hostname = "Not enough permission to view"
            priv_pub = "N/A"
            ip_address = "N/A"

        table.add_row([
            interface_id,
            vsi_id,
            hostname,
            priv_pub,
            ip_address
        ])

    env.fout(table)
670696
def members(self):
        """"""
        return [m for m in self.guild.members if self.permissions_for(m).read_messages]
657760
def get_accessibles(request, roles=None):
        
        results = []
        for role_name, organizations in six.iteritems(request.session.get(
                'roles', {})):
            if roles is None or role_name in roles:
                results += organizations
        return results
488804
def list(context, resource, **kwargs):
    """"""
    data = utils.sanitize_kwargs(**kwargs)
    id = data.pop('id', None)
    subresource = data.pop('subresource', None)

    if subresource:
        uri = '%s/%s/%s/%s' % (context.dci_cs_api, resource, id, subresource)
    else:
        uri = '%s/%s' % (context.dci_cs_api, resource)

    return context.session.get(uri, timeout=HTTP_TIMEOUT, params=data)
321508
def list_orgs(self):
        
        orgs = list(self.orgs.keys())
        orgs.sort()
        return orgs
511892
def organizations(self):
        
        if self.api and self.organization_ids:
            return self.api._get_organizations(self.organization_ids)