Return domestic address details for a domestic address id
 @param address_id [String]
 @return address detail object
960003
def details(address_id)
      details_url = File.join(DOMESTIC_URL, address_id.to_s)
      response = @connection.get details_url
      OpenStruct.new(response.parsed['address'])
    end
1307642
def full_address(self):
        
        addr = ""
        # if self.building:
        #     addr = addr + "(" + self.building + ") "
        if self.house_number:
            addr = addr + self.house_number
        if self.street_prefix:
            addr = addr + " " + self.street_prefix
        if self.street:
            addr = addr + " " + self.street
        if self.street_suffix:
            addr = addr + " " + self.street_suffix
        if self.apartment:
            addr = addr + " " + self.apartment
        if self.city:
            addr = addr + ", " + self.city
        if self.state:
            addr = addr + ", " + self.state
        if self.zip:
            addr = addr + " " + self.zip
        return addr
746382
def _parse_address(self, address_string):
        ''''''
        match = utils.match(self.rules, address_string, flags=re.VERBOSE | re.U)
        if match:
            match_as_dict = match.groupdict()
            match_as_dict.update({'country_id': self.country})
            # combine results
            cleaned_dict = self._combine_results(match_as_dict)
            # create object containing results
            return address.Address(**cleaned_dict)

        return False
152871
def describe_ip(ip_address, source='whatismyip'):

    '''  '''
    
# determine url
    if source == 'nekudo':
        source_url = 'https://geoip.nekudo.com/api/%s' % ip_address
    elif source == 'geoip':
        source_url = 'https://freegeoip.net/json/%s' % ip_address
    elif source == 'whatismyip':
        # http://whatismyipaddress.com/ip-lookup
        source_url = 'https://whatismyipaddress.com/ip/%s' % ip_address
    else:
        raise Exception('describe_ip currently only supports queries to nekudo')

    # TODO incorporate geoip module and c dependencies with local database
    # http://tech.marksblogg.com/ip-address-lookups-in-python.html

# send request
    ip_details = {
        'accuracy_radius': 0,
        'asn': '',
        'assignment': '',
        'city': '',
        'continent': '',
        'country': '',
        'hostname': '',
        'ip': '',
        'isp': '',
        'latitude': 0.0,
        'longitude': 0.0,
        'organization': '',
        'postal_code': '',
        'region': '',
        'timezone': '',
        'type': ''
    }
    import requests
    try:
        response = requests.get(url=source_url)
    except Exception as err:
        from labpack.handlers.requests import handle_requests
        from requests import Request
        request_object = Request(method='GET', url=source_url)
        request_details = handle_requests(request_object)
        raise Exception(request_details['error'])

# extract response
    if source == 'whatismyip':
        import re
        response_text = response.content.decode()
        table_regex = re.compile('<table>\n<tr><th>IP.*?</table>\n<span\sstyle', re.S)
        table_search = table_regex.findall(response_text)
        if table_search:
            table_text = table_search[0]
            field_list = [ 'IP', 'Hostname', 'ISP', 'Organization', 'Type', 'ASN', 'Assignment', 'Continent', 'Country', 'State/Region', 'City', 'Latitude', 'Longitude', 'Postal Code']
            for field in field_list:
                field_regex = re.compile('<tr><th>%s:</th><td>(.*?)</td>' % field, re.S)
                field_search = field_regex.findall(table_text)
                if field_search:
                    ip_details[field.lower().replace(' ','_')] = field_search[0]
        for field in ('longitude', 'latitude'):
            if field in ip_details.keys():
                coord_regex = re.compile('\-?\d+\.\d+')
                coord_search = coord_regex.findall(ip_details[field])
                if coord_search:
                    ip_details[field] = float(coord_search[0])
        if 'country' in ip_details.keys():
            country_regex = re.compile('([\w\s]+?)($|\s<img)')
            country_search = country_regex.findall(ip_details['country'])
            if country_search:
                ip_details['country'] = country_search[0][0]
        for field in ('type', 'assignment'):
            if field in ip_details.keys():
                link_regex = re.compile('>(.*?)<')
                link_search = link_regex.findall(ip_details[field])
                if link_search:
                    ip_details[field] = link_search[0]
        if 'state/region' in ip_details.keys():
            ip_details['region'] = ip_details['state/region']
            del ip_details['state/region']
    elif source == 'nekudo':
        response_details = response.json()
        ip_details['country'] = response_details['country']['name']
        ip_details['latitude'] = response_details['location']['latitude']
        ip_details['longitude'] = response_details['location']['longitude']
        ip_details['accuracy_radius'] = response_details['location']['accuracy_radius']
        if response_details['city']:
            ip_details['city'] = response_details['city']
        ip_details['ip'] = response_details['ip']
        for key in response_details.keys():
            if key not in ip_details.keys() and key != 'location':
                ip_details[key] = response_details[key]
    else:
        response_details = response.json()
        for field in ('city', 'ip', 'latitude', 'longitude'):
            ip_details[field] = response_details[field]
        ip_details['country'] = response_details['country_name']
        ip_details['region'] = response_details['region_name']
        ip_details['postal_code'] = response_details['zip_code']
        ip_details['timezone'] = response_details['time_zone']
    
    return ip_details
182510
def getReference(self, id_):
        
        if id_ not in self._referenceIdMap:
            raise exceptions.ReferenceNotFoundException(id_)
        return self._referenceIdMap[id_]
450090
def getaddresses (addr):
    """"""
    parsed = [mail for name, mail in AddressList(addr).addresslist if mail]
    if parsed:
        addresses = parsed
    elif addr:
        # we could not parse any mail addresses, so try with the raw string
        addresses = [addr]
    else:
        addresses = []
    return addresses
1310184
def get_addl_info(instance_ids)
      resp = ec2_client.describe_instances(instance_ids: instance_ids)

      data = {}
      resp.reservations.map(&:instances).flatten.each do |instance|
        data[instance.instance_id] = instance
      end
      data
    end
777517
def getDetails(self, ip_address=None):
        """"""
        raw_details = self._requestDetails(ip_address)
        raw_details['country_name'] = self.countries.get(raw_details.get('country'))
        raw_details['ip_address'] = ipaddress.ip_address(raw_details.get('ip'))
        raw_details['latitude'], raw_details['longitude'] = self._read_coords(raw_details.get('loc'))
        return Details(raw_details)
3915
def get_homepage(self, shop_id):
        
        res = self._post(
            'homepage/get',
            data={'shop_id': shop_id},
            result_processor=lambda x: x['data']
        )
        return res
577174
def getPrintAddress(self):
        
        address_lines = []

        addresses = [
            self.getPostalAddress(),
            self.getPhysicalAddress(),
            self.getBillingAddress(),
        ]

        for address in addresses:
            city = address.get("city", "")
            zip = address.get("zip", "")
            state = address.get("state", "")
            country = address.get("country", "")

            if city:
                address_lines = [
                    address["address"].strip(),
                    "{} {}".format(city, zip).strip(),
                    "{} {}".format(state, country).strip(),
                ]
                break

        return address_lines
280852
def address_detail(self):
        
        pattern = self.bothify(self.random_element(
            self.address_detail_formats))
        return self.generator.parse(pattern)
1300670
def parse_address(address)
      case address
      when Hash
        Addressable::URI.new(address)
      when String
        Addressable::URI.parse(address)
      else
        raise(InvalidConfig,"invalid address: #{address.inspect}",caller)
      end
    end
1017991
def get_address(self, account_id, address_id, **params):
        """"""
        response = self._get('v2', 'accounts', account_id, 'addresses', address_id, params=params)
        return self._make_api_object(response, Address)
119195
@Override
    public EndpointReferenceType getAddressWithId(String id) {
        EndpointReferenceType ref = null;

        if (isMultiplexWithAddress()) {
            String address = EndpointReferenceUtils.getAddress(reference);
            ref = EndpointReferenceUtils.duplicate(reference);
            if (address.endsWith("/")) {
                EndpointReferenceUtils.setAddress(ref, address + id);
            } else {
                EndpointReferenceUtils.setAddress(ref, address + "/" + id);
            }
        } else {
            ref = super.getAddressWithId(id);
        }
        return ref;
    }
1241613
def persons_at_address(address_id)
      body = self.gov_talk_request({
        message: 'CRA_GetPersonsAtAddress',
        class:   'CRA_GetPersonsAtAddress',
        params: {
          long: address_id,
        }
      })
      CRA::PersonAtAddress.list_from_hash(body['ArrayOfPersonsAtAddress'])
    end
1085676
def get_detail(self, course_id):
        
        # the request is done in behalf of the current logged in user
        resp = self._requester.get(
            urljoin(
                self._base_url,
                '/api/courses/v1/courses/{course_key}/'.format(course_key=course_id)
            )
        )

        resp.raise_for_status()

        return CourseDetail(resp.json())
232433
def _get_room_ids_for_address(
            self,
            address: Address,
            filter_private: bool = None,
    ) -> List[_RoomID]:
        
        address_hex: AddressHex = to_checksum_address(address)
        with self._account_data_lock:
            room_ids = self._client.account_data.get(
                'network.raiden.rooms',
                {},
            ).get(address_hex)
            self.log.debug('matrix get account data', room_ids=room_ids, for_address=address_hex)
            if not room_ids:  # None or empty
                room_ids = list()
            if not isinstance(room_ids, list):  # old version, single room
                room_ids = [room_ids]

            if filter_private is None:
                filter_private = self._private_rooms
            if not filter_private:
                # existing rooms
                room_ids = [
                    room_id
                    for room_id in room_ids
                    if room_id in self._client.rooms
                ]
            else:
                # existing and private rooms
                room_ids = [
                    room_id
                    for room_id in room_ids
                    if room_id in self._client.rooms and self._client.rooms[room_id].invite_only
                ]

            return room_ids