Get all the cluster of all the sites.

    Returns:
        dict corresponding to the mapping cluster uid to python-grid5000 site
328973
def get_all_clusters_sites():
    
    result = {}
    gk = get_api_client()
    sites = gk.sites.list()
    for site in sites:
        clusters = site.clusters.list()
        result.update({c.uid: site.uid for c in clusters})
    return result
1271874
def _set_cluster(self):
        
        center = self.struct[self.center_index].coords
        sphere = self.struct.get_neighbors(self.struct[self.center_index], self.radius)

        symbols = [self.absorbing_atom]
        coords = [[0, 0, 0]]
        for i, site_dist in enumerate(sphere):
            site_symbol = re.sub(r"[^aA-zZ]+", "", site_dist[0].species_string)
            symbols.append(site_symbol)
            coords.append(site_dist[0].coords - center)
        return Molecule(symbols, coords)
1037820
def nodes(self):
        
        if not hasattr(self, '_nodes'):
            base_url = "{}/{}".format(NodeBalancerConfig.api_endpoint, NodeBalancerNode.derived_url_path)
            result = self._client._get_objects(base_url, NodeBalancerNode, model=self, parent_id=(self.id, self.nodebalancer_id))

            self._set('_nodes', result)

        return self._nodes
1037280
public List<Long> getSitesForPartitions(int[] partitions) {
        ArrayList<Long> all_sites = new ArrayList<Long>();
        for (int p : partitions) {
            List<Long> sites = getSitesForPartition(p);
            for (long site : sites)
            {
                all_sites.add(site);
            }
        }
        return all_sites;
    }
1060168
def on_site(self, site_id=None):
        
        if settings.PAGES_USE_SITE_ID:
            if not site_id:
                site_id = settings.SITE_ID
            return self.get_queryset().filter(sites=site_id)
        return self.all()
783447
def get_all_zones(self):
        """"""
        zones = {'HostedZones': []}

        new_zones = self.route53.list_hosted_zones(MaxItems='100')
        while new_zones['IsTruncated']:
            zones['HostedZones'] += new_zones['HostedZones']
            new_zones = self.route53.list_hosted_zones(Marker=new_zones['NextMarker'], MaxItems='100')

        zones['HostedZones'] += new_zones['HostedZones']
        return zones
915133
def get_aggregate(self):
        
        return dict([(aggregate.find('query').text, [(ET.tostring(data).lstrip('<data xmlns:cps="www.clusterpoint.com" xmlns:cpse="www.clusterpoint.com">').strip().rstrip("</data>")) for data in aggregate.findall('data')])
                   for aggregate in self._content.findall('aggregate')])
916171
def index(self):
        
        maps = self._get_maps_from_user(c.user)
        serialized_maps = []
        for m in maps:
            serialized_maps.append({
                "id": m.id,
                "name": m.name,
                "href": h.url_for(controller="mapfiles", action="show", id=m.id),
                'wmsproxyurl':h.url_for(controller='mapfiles', action='wms_proxy', id=m.id),
                'wmsurl': "%s?%s" %(config['mapserver_url'], urlencode({'map':os.path.join(config['mapfiles_dir'], m.filepath)}))
            })
        # prevent JSON Array Cross-site Exploits (XSRF/CSRF)
        return {'maps': serialized_maps}
715663
def list_clusters(kwargs=None, call=None):
    '''
    
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The list_clusters function must be called with '
            '-f or --function.'
        )

    return {'Clusters': salt.utils.vmware.list_clusters(_get_si())}
662182
def cluster_2_json(self):
        
        LOGGER.debug("Cluster.cluster_2_json")
        json_obj = {
            'clusterID': self.id,
            'clusterName': self.name,
            'clusterContainersID': self.containers_id
        }
        return json_obj
1219647
def cluster(resolve, **kwargs):
    
    # Actually we have IPs and we need not do anything to resolve them to IPs. So the default
    # behavior fits better to this option name.

    ctx = Context(**kwargs)
    ctx.execute_action('cluster', **{
        'locator': ctx.locator,
        'resolve': resolve,
    })
296707
def get_all(self, uids: Iterable[int]) -> Mapping[int, Record]:
        
        return {uid: self._records[uid] for uid in uids
                if uid in self._records}
168821
def get_nodes(cluster):
    
    gk = get_api_client()
    site = get_cluster_site(cluster)
    return gk.sites[site].clusters[cluster].nodes.list()
1072153
def get_all_clusters(resource_root, view=None):
  
  return call(resource_root.get, CLUSTERS_PATH, ApiCluster, True,
      params=view and dict(view=view) or None)
317377
async def cluster_reset_all_nodes(self, soft=True):
        
        option = 'SOFT' if soft else 'HARD'
        res = list()
        for node in await self.cluster_nodes():
            res.append(
                await self.execute_command(
                    'CLUSTER RESET', option, node_id=node['id']
                ))
        return res
126024
def get_brokers(self, names_only=False):
        
        try:
            broker_ids = self.get_children("/brokers/ids")
        except NoNodeError:
            _log.info(
                "cluster is empty."
            )
            return {}
        # Return broker-ids only
        if names_only:
            return {int(b_id): None for b_id in broker_ids}
        return {int(b_id): self.get_broker_metadata(b_id) for b_id in broker_ids}
1168424
def get_broker_list(cluster_config):
    
    with ZK(cluster_config) as zk:
        brokers = sorted(list(zk.get_brokers().items()), key=itemgetter(0))
        return [(id, data['host']) for id, data in brokers]