Return a list of locations
161473
def avail_locations(conn=None, call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The avail_locations function must be called with '
            '-f or --function, or with the --list-locations option'
        )

    if conn is None:
        conn = get_conn()

    endpoints = nova.get_entry(conn.get_catalog(), 'type', 'compute')['endpoints']
    ret = {}
    for endpoint in endpoints:
        ret[endpoint['region']] = endpoint

    return ret
894694
def list_nodes(full=False, call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The list_nodes function must be called with -f or --function.'
        )

    ret = {}
    if POLL_ALL_LOCATIONS:
        for location in JOYENT_LOCATIONS:
            result = query(command='my/machines', location=location,
                           method='GET')
            if result[0] in VALID_RESPONSE_CODES:
                nodes = result[1]
                for node in nodes:
                    if 'name' in node:
                        node['location'] = location
                        ret[node['name']] = reformat_node(item=node, full=full)
            else:
                log.error('Invalid response when listing Joyent nodes: %s', result[1])

    else:
        location = get_location()
        result = query(command='my/machines', location=location,
                       method='GET')
        nodes = result[1]
        for node in nodes:
            if 'name' in node:
                node['location'] = location
                ret[node['name']] = reformat_node(item=node, full=full)
    return ret
641708
def get_buildings(self):
        """"""
        resp = self._request("GET", "/1.1/space/locations").json()
        out = []
        for x in resp:
            if x["lid"] in LOCATION_BLACKLIST:
                continue
            if x["public"] == 1:
                del x["public"]
                x["service"] = "libcal"
                out.append(x)
        return out
31292
def _get_pages(self, locations, req):
        """"""
        pending_queue = Queue()
        for location in locations:
            pending_queue.put(location)
        done = []
        seen = set()
        threads = []
        for i in range(min(10, len(locations))):
            t = threading.Thread(target=self._get_queued_page, args=(req, pending_queue, done, seen))
            t.setDaemon(True)
            threads.append(t)
            t.start()
        for t in threads:
            t.join()
        return done
712855
def all_stop_places_quays(self) -> list:
        """"""
        all_places = self.stops.copy()
        for quay in self.quays:
            all_places.append(quay)
        return all_places
936348
def all_locations(self):
        '''
        
        '''
        qs = self.assoc_locations.all()
        for node in self.get_descendants():
            qs2 = node.assoc_locations.all()
            qs = qs.union(qs2).distinct('pk')
        return qs
225886
def collectLocations(self):
        
        pts = []
        for l, (value, deltaName) in self.items():
            pts.append(Location(l))
        return pts
989207
def avail_locations(call=None):
    '''
    
    '''
    creds = get_creds()
    clc.v1.SetCredentials(creds["token"], creds["token_pass"])
    locations = clc.v1.Account.GetLocations()
    return locations
432106
def getcoordinates(self, tree, location):
        """"""
        return tuple(float(x) for x in tree.xpath('.//%s/*/text()' % location))
638017
def avail_locations(call=None):
    '''
    

    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The avail_locations function must be called with '
            '-f or --function, or with the --list-locations option.'
        )

    server, user, password = _get_xml_rpc()
    auth = ':'.join([user, password])
    host_pool = server.one.hostpool.info(auth)[1]

    locations = {}
    for host in _get_xml(host_pool):
        locations[host.find('NAME').text] = _xml_to_dict(host)

    return locations
153325
def _load_location( self ):
        """"""
        directories = {}
        files = {}
        root = PStatLocation( '/', 'PYTHONPATH' )
        self.location_rows = self.rows.copy()
        for child in self.rows.values():
            current = directories.get( child.directory )
            directory, filename = child.directory, child.filename
            if current is None:
                if directory == '':
                    current = root
                else:
                    current = PStatLocation( directory, '' )
                    self.location_rows[ current.key ] = current
                directories[ directory ] = current
            if filename == '~':
                filename = '<built-in>'
            file_current = files.get( (directory,filename) )
            if file_current is None:
                file_current = PStatLocation( directory, filename )
                self.location_rows[ file_current.key ] = file_current
                files[ (directory,filename) ] = file_current
                current.children.append( file_current )
            file_current.children.append( child )
        # now link the directories...
        for key,value in directories.items():
            if value is root:
                continue
            found = False
            while key:
                new_key,rest = os.path.split( key )
                if new_key == key:
                    break
                key = new_key
                parent = directories.get( key )
                if parent:
                    if value is not parent:
                        parent.children.append( value )
                        found = True
                        break
            if not found:
                root.children.append( value )
        # lastly, finalize all of the directory records...
        root.finalize()
        return root
360249
def get_locations(self, filter_to_my_group=False):
        """"""
        resp = self._post('general-retrievelocations', 'locations')
        groups = {}
        if resp['groupinfo']:
            for group in resp['groupinfo']:
                groups[group['id']] = Group(
                                            name=group.get('name'),
                                            inventory_id=group.get('id')
                                            )
        final_resp = []
        if resp['data']:
            if filter_to_my_group:
                resp['data'] = {self.groupid: resp['data'][self.groupid]}
            for groupid, sublocation in resp['data'].items():
                if type(sublocation) is dict:
                    sublocation = [loc for _, loc in sublocation.items()]
                    sublocation = flatten_list(sublocation)
                if type(sublocation) is list:
                    sublocation = flatten_list(sublocation)
                for location in sublocation:
                    group = groups[groupid]
                    final_resp.append(Location(
                                            name=location.get('name'),
                                            inventory_id=location.get('id'),
                                            parent=location.get('parent'),
                                            group=group,
                                            barcode=location.get('barcode')
                                      ))
        return final_resp
559650
private List<Location> getAllSubLocations(Location location) {
		List<Location> flatSubLocations = new ArrayList<Location>();
		for (Location l : location.getSubLocations()) {
			if (l.isComplex()) {
				flatSubLocations.addAll(getAllSubLocations(l));
			}
			else {
				flatSubLocations.add(l);
			}
		}
		return flatSubLocations;
	}
1232062
def list_modifier_lists(location_id, opts = {})
      data, _status_code, _headers = list_modifier_lists_with_http_info(location_id, opts)
      return data
    end
739676
def avail_locations(conn=None, call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The avail_locations function must be called with '
            '-f or --function, or with the --list-locations option'
        )

    datacenters = []

    if not conn:
        conn = get_conn()

    for datacenter in conn.list_datacenters():
        datacenters.append({datacenter['country_code']: datacenter})

    return {'Locations': datacenters}
1001089
def _generateLocations(self):
    
    size = self.externalInputSize
    bits = self.numInputBits
    random.seed(self.seed)
    self.locations = []
    for _ in xrange(self.numColumns):
      self.locations.append(
        [self._generatePattern(bits, size) for _ in xrange(self.numLocations)]
      )
823460
def get_groups(self):
        ''''''
        resp = self._post('general-retrievelocations', 'locations')
        final_resp = []
        if resp['groupinfo']:
            for group in resp['groupinfo']:
                final_resp.append(Group(
                    name=group.get('name'),
                    inventory_id=group.get('id')
                ))
        return final_resp