Get Locations Info.
191345
public function getLocationsInfo() {
    $data = [];
    $cid = 'openy_activity_finder:locations_info';
    if ($cache = $this->cache->get($cid)) {
      $data = $cache->data;
    }
    else {
      $nids = $this->entityQuery
        ->get('node')
        ->condition('type', ['branch', 'camp'], 'IN')
        ->execute();
      $nids_chunked = array_chunk($nids, 20, TRUE);
      foreach ($nids_chunked as $chunked) {
        $locations = $this->entityTypeManager->getStorage('node')->loadMultiple($chunked);
        if (!empty($locations)) {
          foreach ($locations as $location) {
            $address = implode(', ', [
              $location->field_location_address->address_line1,
              $location->field_location_address->locality,
              $location->field_location_address->administrative_area,
              $location->field_location_address->postal_code,
            ]);
            $days = [];
            foreach ($location->field_branch_hours as $multi_hours) {
              $sub_hours = $multi_hours->getValue();
              $days = [
                [
                  0 => "Mon - Fri:",
                  1 => $sub_hours['hours_mon']
                ],
                [
                  0 => "Sat - Sun:",
                  1 => $sub_hours['hours_sat']
                ]
              ];
            }
            $data[$location->title->value] =[
              'type' => $location->bundle(),
              'address' => $address,
              'days' => $days,
              'email' => $location->field_location_email->value,
              'nid' => $location->id(),
              'phone' => $location->field_location_phone->value,
              'title' => $location->title->value
            ];
          }
        }
      }
      $expire = $this->time->getRequestTime() + self::CACHE_TTL;
      $this->cache->set($cid, $data, $expire);
    }

    return $data;
  }
43417
def info(self):
        """"""

        return self._h._get_resource(
            resource=('apps', self.name),
            obj=App,
        )
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
971442
def get_location(self, obj):
        
        if not obj.city and not obj.country:
            return None
        elif obj.city and obj.country:
            return '%s, %s' % (obj.city, obj.country)
        elif obj.city or obj.country:
            return obj.city or obj.country
967096
def select_location(self):
        """"""
        location = osp.normpath(getexistingdirectory(self,
                                                     _("Select directory"),
                                                     self.location))

        if location:
            if is_writable(location):
                self.location = location
                self.update_location()
826225
def get(self, *args, **kwargs):
        """"""
        location = args[0]
        params = self._get_keywords(location, kwargs)
        url = self._create_path(*args)
        request = requests.get(url, params=params)
        content = request.content
        self._request = request
        return self._output(content)
914395
def get_locations():
        
        LOGGER.debug("LocationService.get_locations")
        args = {'http_operation': 'GET', 'operation_path': ''}
        response = LocationService.requester.call(args)
        ret = None
        if response.rc == 0:
            ret = []
            for location in response.response_content['locations']:
                ret.append(Location.json_2_location(location))
        else:
            err_msg = 'LocationService.get_locations - Problem while getting locations. ' \
                      'Reason: ' + str(response.response_content) + '-' + str(response.error_message) + \
                      " (" + str(response.rc) + ")"
            LOGGER.warning(err_msg)
        return ret
83906
def get(self, pos):
        """"""
        latitude = int(round(pos['latitude']))
        search_set = self.bins[latitude]
        i = 1
        if latitude - i >= -90:
            search_set += self.bins[latitude-i]
        if latitude + i <= 90:
            search_set += self.bins[latitude+i]
        while len(search_set) == 0 and i <= 200:
            if latitude - i >= -90:
                search_set += self.bins[latitude-i]
            if latitude + i <= 90:
                search_set += self.bins[latitude+i]
            i += 1
        return find_closest(search_set, pos)
1099474
def get_urls_and_locations(self, urls):
        
        location_generator = self.get_new_locations(urls)
        initial_cache = list(set(urls))
        return CachedIterable(location_generator, initial_cache)
123142
def marts(self):
        """"""
        if self._marts is None:
            self._marts = self._fetch_marts()
        return self._marts
738471
def _get_keywords(self, location, keywords):
        """"""
        if 'xml' in keywords:
            keywords.pop('xml')
            self.xml = True
        else:
            keywords['file_type'] = 'json'
        if 'id' in keywords:
            if location != 'series':
                location = location.rstrip('s')
            key = '%s_id' % location
            value = keywords.pop('id')
            keywords[key] = value
        if 'start' in keywords:
            time = keywords.pop('start')
            keywords['realtime_start'] = time
        if 'end' in keywords:
            time = keywords.pop('end')
            keywords['realtime_end'] = time
        if 'sort' in keywords:
            order = keywords.pop('sort')
            keywords['sort_order'] = order
        keywords['api_key'] = self.api_key
        return keywords
909305
def get_info(self):
        """"""

        reconstructed = self.is_reconstructed()

        site, site_type = self.get_site()

        return reconstructed, site, site_type
346778
def get_location(address=""):
    
    coordinates = None
    try:
        geolocator = Nominatim()
        location = geolocator.geocode(address)
        coordinates = (location.latitude, location.longitude)
    except Exception as ex:
        logger.error('Fail get location - {}'.format(ex))
    return coordinates
114470
def _get_location(self, regions, datacenter):
        """"""
        for region in regions:
            # list of locations
            if region['location']['location']['name'] == datacenter:
                return region

        raise SoftLayer.SoftLayerError("Could not find valid location for: '%s'" % datacenter)
511231
def get_trips(self, authentication_info, start, end):
        """"""
        import requests

        if (authentication_info is None or
            not authentication_info.is_valid()):
            return []

        data_url = "https://api.ritassist.nl/api/trips/GetTrips"
        query = f"?equipmentId={self.identifier}&from={start}&to={end}&extendedInfo=True"
        header = authentication_info.create_header()
        response = requests.get(data_url + query, headers=header)
        trips = response.json()

        result = []
        for trip_json in trips:
            trip = Trip(trip_json)
            result.append(trip)
        return result
17510
def get_info(self, location):
        """"""
        assert not location.rstrip('/').endswith(self.dirname), 'Bad directory: %s' % location
        output = call_subprocess(
            [self.cmd, 'info', location], show_stdout=False, extra_environ={'LANG': 'C'})
        match = _svn_url_re.search(output)
        if not match:
            logger.warn('Cannot determine URL of svn checkout %s' % display_path(location))
            logger.info('Output that cannot be parsed: \n%s' % output)
            return None, None
        url = match.group(1).strip()
        match = _svn_revision_re.search(output)
        if not match:
            logger.warn('Cannot determine revision of svn checkout %s' % display_path(location))
            logger.info('Output that cannot be parsed: \n%s' % output)
            return url, None
        return url, match.group(1)
1168409
def get_by_location(cls, location, include_deactivated=False):
        """"""
        if include_deactivated:
            view = views.service_location
        else:
            view = views.active_service_location

        result = yield view.first(key=location, include_docs=True)
        parent = cls.parent_resource(**result['doc'])

        raise Return(cls(parent=parent, **result['value']))