Provides a common set of address fields such as, street_address_1, street_address_2, city, state, zip_code and country as String fields.
770396
def addressable
        apply_schema :street_address_1, String
        apply_schema :street_address_2, String
        apply_schema :city, String
        apply_schema :state, String
        apply_schema :zip_code, String
        apply_schema :country, String
      end
1170707
public function getAddressStrings(): array
    {
        $strings = [];
        foreach ($this->addresses as $address) {
            $str = $address->getEncodedAddress();
            if ($address instanceof NamedAddress && $name = $address->getName()) {
                $str = $this->createPhrase($this, $name, $this->getCharset(), empty($strings)).' <'.$str.'>';
            }
            $strings[] = $str;
        }

        return $strings;
    }
1316307
private void setAddress(Address address, RolodexContract rolodex) {
        if (rolodex != null) {
            address.setStreet1(rolodex.getAddressLine1());
            address.setStreet2(rolodex.getAddressLine2());
            address.setCity(checkNull(rolodex.getCity()));
            address.setCounty(rolodex.getCounty());
            address.setState(rolodex.getState());
            address.setZipCode(rolodex.getPostalCode());
            if (rolodex.getCountryCode() != null) {
                CountryCodeType.Enum country = CountryCodeType.Enum.forString(rolodex.getCountryCode());
                address.setCountry(country);
            }
        }else {
            address.setStreet1("");
            address.setCity("");
        }
    }
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
373989
function(fields, data) {
    if (!_.isString(fields)) {
      return data;
    }

    // If a field is specified as `foo.bar` or `foo.bar.baz`,
    // Convert it to just `foo`
    var map = {};
    _.forEach(fields.split(','), function(field) {
      map[field.split('.')[0]] = 1;
    });

    var keys = _.keys(map);
    if (_.isArray(data)) {
      data = _.map(data, function(object) {
        return _.pick(object, keys);
      });
    } else if (_.isObject(data)) {
      data = _.pick(data, keys);
    }

    return data;
  }
1072624
def _encodeAddressField(address, smscField=False):
    
    # First, see if this is a number or an alphanumeric string
    toa = 0x80 | 0x00 | 0x01 # Type-of-address start | Unknown type-of-number | ISDN/tel numbering plan
    alphaNumeric = False    
    if address.isalnum():
        # Might just be a local number
        if address.isdigit():
            # Local number
            toa |= 0x20
        else:
            # Alphanumeric address
            toa |= 0x50
            toa &= 0xFE # switch to "unknown" numbering plan
            alphaNumeric = True
    else:
        if address[0] == '+' and address[1:].isdigit():
            # International number
            toa |= 0x10
            # Remove the '+' prefix
            address = address[1:]
        else:
            # Alphanumeric address
            toa |= 0x50
            toa &= 0xFE # switch to "unknown" numbering plan
            alphaNumeric = True
    if  alphaNumeric:
        addressValue = packSeptets(encodeGsm7(address, False))
        addressLen = len(addressValue) * 2        
    else:
        addressValue = encodeSemiOctets(address)
        if smscField:            
            addressLen = len(addressValue) + 1
        else:
            addressLen = len(address)
    result = bytearray()
    result.append(addressLen)
    result.append(toa)
    result.extend(addressValue)
    return result
1171714
def _gen_addr(entry):
        """"""
        return Address(street=entry.get('address', ''),
                       extended=entry.get('address2', ''),
                       city=entry.get('city', ''),
                       region=entry.get('state', ''),
                       code=entry.get('zip', ''),
                       country=entry.get('country', ''))
281430
def batch_geocode(self, addresses, **kwargs):
        
        fields = ",".join(kwargs.pop("fields", []))
        response = self._req(
            "post",
            verb="geocode",
            params={"fields": fields},
            data=json.dumps(addresses),
        )
        if response.status_code != 200:
            return error_response(response)

        return LocationCollection(response.json()["results"])
1009163
def _spec_to_globs(address_mapper, specs):
  """"""
  patterns = set()
  for spec in specs:
    patterns.update(spec.make_glob_patterns(address_mapper))
  return PathGlobs(include=patterns, exclude=address_mapper.build_ignore_patterns)
1050986
function BillingAddress() {
    /**
     * The firstName value
     * @member
     */
    this.firstName = null;
    /**
     * The lastName value
     * @member
     */
    this.lastName = null;
    /**
     * The email value
     * @member
     */
    this.email = null;
    /**
     * The phone value
     * @member
     */
    this.phone = null;
    /**
     * The country value
     * @member
     */
    this.country = null;
    /**
     * The countryCode value
     * @member
     */
    this.countryCode = null;
    /**
     * The region value
     * @member
     */
    this.region = null;
    /**
     * The regionCode value
     * @member
     */
    this.regionCode = null;
    /**
     * The city value
     * @member
     */
    this.city = null;
    /**
     * The address1 value
     * @member
     */
    this.address1 = null;
    /**
     * The address2 value
     * @member
     */
    this.address2 = null;
    /**
     * The zip value
     * @member
     */
    this.zip = null;
    /**
     * The company value
     * @member
     */
    this.company = null;

}
719179
def onelineaddress(self, address, **kwargs):
        '''
        '''
        fields = {
            'address': address,
        }

        return self._fetch('onelineaddress', fields, **kwargs)
727206
def backend_fields(self, fields):
        ''''''
        dfields = self.dfields
        processed = set()
        names = []
        atts = []
        pkname = self.pkname()
        for name in fields:
            if name == pkname or name in processed:
                continue
            elif name in dfields:
                processed.add(name)
                field = dfields[name]
                names.append(field.name)
                atts.append(field.attname)
            else:
                bname = name.split(JSPLITTER)[0]
                if bname in dfields:
                    field = dfields[bname]
                    if field.type in ('json object', 'related object'):
                        processed.add(name)
                        names.append(name)
                        atts.append(name)
        return names, atts
429946
public AddressDataType getAddressDataType(ProposalPersonContract person) {

        AddressDataType addressType = AddressDataType.Factory.newInstance();
        if (person != null) {

            String street1 = person.getAddressLine1();
            addressType.setStreet1(street1);
            String street2 = person.getAddressLine2();
            if (street2 != null && !street2.equals("")) {                
                addressType.setStreet2(street2);
            }
            String city = person.getCity();
            addressType.setCity(city);

            String state = person.getState();
            if (state != null && !state.equals("")) {
                addressType.setState(state);
            }
            String zipcode = person.getPostalCode();
            if (zipcode != null && !zipcode.equals("")) {
                addressType.setZipCode(zipcode);
            }
            String county = person.getCounty();
            if (county != null && !county.equals("")) {
                addressType.setCounty(county);
            }
            String country = person.getCountryCode();
            CountryCodeType.Enum countryCode = null;
            if (country != null && !country.equals("")) {
                countryCode = CountryCodeType.Enum.forString(country);
            }
            addressType.setCountry(countryCode);
        }
        return addressType;
    }
876845
public AddressRequireCountryDataType getAddressRequireCountryDataType(DepartmentalPersonDto person) {

        AddressRequireCountryDataType address = AddressRequireCountryDataType.Factory.newInstance();
        if (person != null) {

            String street1 = person.getAddress1();
            address.setStreet1(street1);
            String street2 = person.getAddress2();
            if (street2 != null && !street2.equals("")) {
                address.setStreet2(street2);
            }
            String city = person.getCity();
            address.setCity(city);
            String county = person.getCounty();
            if (county != null && !county.equals("")) {
                address.setCounty(county);
            }
            String state = person.getState();
            if (state != null && !state.equals("")) {
                address.setState(state);
            }
            String zipcode = person.getPostalCode();
            if (zipcode != null && !zipcode.equals("")) {
                address.setZipCode(zipcode);
            }
            String country = person.getCountryCode();
            address.setCountry(CountryCodeType.Enum.forString(country));

        }
        return address;
    }
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
1211327
def _get_addresses(self, text):
        ''''''
        # find addresses
        addresses = []
        matches = utils.findall(
            self.rules,
            text,
            flags=re.VERBOSE | re.U)

        if(matches):
            for match in matches:
                addresses.append(match[0].strip())
        return addresses
1187504
def get_addresses_from_input_file(input_file_name):
    
    mode = 'r'
    if sys.version_info[0] < 3:
        mode = 'rb'
    with io.open(input_file_name, mode) as input_file:
        reader = csv.reader(input_file, delimiter=',', quotechar='"')

        addresses = list(map(tuple, reader))

        if len(addresses) == 0:
            raise Exception('No addresses found in input file')

        header_columns = list(column.lower() for column in addresses.pop(0))

        try:
            address_index = header_columns.index('address')
            zipcode_index = header_columns.index('zipcode')
        except ValueError:
            raise Exception("""The first row of the input CSV must be a header that contains \
a column labeled 'address' and a column labeled 'zipcode'.""")

        return list((row[address_index], row[zipcode_index]) for row in addresses)