Get Locations list.
480085
public static function getLocations($locations_to_be_displayed = null) {
    $db = \Drupal::database();
    $branches_list = [
      'branch' => [],
      'camp' => [],
    ];
    $query = $db->select('node_field_data', 'n')
      ->fields('n', ['nid', 'title', 'type'])
      ->condition('type', ['branch', 'camp'], 'IN')
      ->condition('status', 1);
    $items = $query->execute()->fetchAll();
    foreach ($items as $item) {
      // By default we show all locations instead of showing empty popup.
      if (!empty($locations_to_be_displayed) && !in_array($item->nid, $locations_to_be_displayed)) {
        continue;
      }
      $branches_list[$item->type][$item->nid] = $item->title;
    }

    return $branches_list;
  }
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
687048
public function getLocations() {
    $data = [];

    $location_ids = $this->queryFactory->get('node')
      ->condition('type', 'branch')
      ->execute();

    if (!$location_ids) {
      return [];
    }

    $storage = $this->entityTypeManager->getStorage('node');
    $locations = $storage->loadMultiple($location_ids);

    foreach ($locations as $location) {
      $data[$location->id()] = [
        'title' => $location->label(),
      ];
    }

    return $data;
  }
868036
def list_functions(self, prefix=None):
        """"""
        return self.client.execute_command(
            'list',
            {'parent': "projects/{}/locations/{}".format(
                self.session.get_default_project(),
                self.region)}
        ).get('functions', [])
1026897
def get_locations(self, ip, detailed=False):
        
        if isinstance(ip, str):
            ip = [ip]
            
        seek = map(self._get_pos, ip)

        return [self._parse_location(elem, detailed=detailed) if elem > 0 else False for elem in seek]
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
499249
def get_all(self, path, data=None, limit=100):
        """"""
        return ListResultSet(path=path, data=data or {}, limit=limit)
1161958
public function getLocations() {
    $sql = "SELECT DISTINCT nd.title as location 
            FROM {node} n
            INNER JOIN node__field_session_location l ON n.nid = l.entity_id AND l.bundle = 'session'
            INNER JOIN node_field_data nd ON l.field_session_location_target_id = nd.nid
            WHERE n.type = 'session'
            ORDER BY location ASC";

    $connection = \Drupal::database();
    $query = $connection->query($sql);

    $result = $query->fetchCol();
    natsort($result);
    return $result;
  }
497903
def list(self, search_opts=None, limit=None,
             marker=None, sort_by=None, reverse=None):
        """"""
        query = base.get_query_string(search_opts, limit=limit, marker=marker,
                                      sort_by=sort_by, reverse=reverse)
        url = "/jobs%s" % query
        return self._page(url, 'jobs', limit)
432106
def getcoordinates(self, tree, location):
        """"""
        return tuple(float(x) for x in tree.xpath('.//%s/*/text()' % location))
830814
def GetLocations():
		""""""
		r = clc.v1.API.Call('post','Account/GetLocations',{})
		if r['Success'] != True: 
			if clc.args:  clc.v1.output.Status('ERROR',3,'Error calling %s.   Status code %s.  %s' % ('Account/GetLocations',r['StatusCode'],r['Message']))
			raise Exception('Error calling %s.   Status code %s.  %s' % ('Account/GetLocations',r['StatusCode'],r['Message']))
		elif int(r['StatusCode']) == 0:  
			clc.LOCATIONS = [x['Alias'] for x in r['Locations']]
			return(r['Locations'])
1166223
def _get_pages(self, locations, project_name):
        # type: (Iterable[Link], str) -> Iterable[HTMLPage]
        
        seen = set()  # type: Set[Link]
        for location in locations:
            if location in seen:
                continue
            seen.add(location)

            page = _get_html_page(location, session=self.session)
            if page is None:
                continue

            yield page
941215
def location_query(self):
        
        value = []
        for option in self.options:
            if option.number == defines.OptionRegistry.LOCATION_QUERY.number:
                value.append(option.value)
        return value
52006
def subscriptions_list_locations(subscription_id=None, **kwargs):
    '''
    

    '''
    result = {}

    if not subscription_id:
        subscription_id = kwargs.get('subscription_id')
    elif not kwargs.get('subscription_id'):
        kwargs['subscription_id'] = subscription_id

    subconn = __utils__['azurearm.get_client']('subscription', **kwargs)
    try:
        locations = __utils__['azurearm.paged_object_to_list'](
            subconn.subscriptions.list_locations(
                subscription_id=kwargs['subscription_id']
            )
        )

        for loc in locations:
            result[loc['name']] = loc
    except CloudError as exc:
        __utils__['azurearm.log_cloud_error']('resource', str(exc), **kwargs)
        result = {'error': str(exc)}

    return result
1210182
def get_municipalities(self):
        
        return sorted(list(set([
            location.municipality for location in self.get_locations().values()
        ])))
1049909
def avail_locations():
    '''
    
    '''
    response = list_common_lookups(kwargs={'lookup': 'ip.datacenter'})

    ret = {}
    for item in response['list']:
        name = item['name']
        ret[name] = item

    return ret
626704
def GetRandomLocationsNearStops(schedule):
  """"""
  locations = []
  for s in schedule.GetStopList():
    locations.append(AddNoiseToLatLng(s.stop_lat, s.stop_lon))
  return locations