:example '791 Crist Parks, Sashabury, IL 86039-9874'
320473
def address(self):
        
        pattern = self.random_element(self.address_formats)
        return self.generator.parse(pattern)
817537
def address_info(id)
      body = self.gov_talk_request({
        message: 'CRA_AddrGetAddressInfoByID',
        class:   'CRA_AddrGetAddressInfoByID',
        params: {
          long: id,
        }
      })
      # puts body.to_s
      CRA::AddressInfo.init_from_hash(body['AddressInfo'])
    end
1213530
@RequestMapping(value = "/api/path/{pathIdentifier}/{overrideIdentifier:.+}", method = RequestMethod.DELETE)
    @ResponseBody
    public HashMap<String, Object> deleteOverride(Model model,
                                                  @PathVariable String pathIdentifier,
                                                  @PathVariable String overrideIdentifier,
                                                  @RequestParam(value = "ordinal", defaultValue = "1") Integer ordinal,
                                                  @RequestParam(required = false) String profileIdentifier,
                                                  @RequestParam(value = "clientUUID", defaultValue = Constants.PROFILE_CLIENT_DEFAULT_ID) String clientUUID) throws Exception {
        Identifiers identifiers = ControllerUtils.convertProfileAndPathIdentifier(profileIdentifier, pathIdentifier);

        // need to get overrideId for identifiers..
        Integer overrideId = ControllerUtils.convertOverrideIdentifier(overrideIdentifier);

        OverrideService.getInstance().removeOverride(overrideId, identifiers.getPathId(), ordinal, clientUUID);

        HashMap<String, Object> returnMap = new HashMap<String, Object>();
        returnMap.put("enabledEndpoint", OverrideService.getInstance().getEnabledEndpoint(identifiers.getPathId(), overrideId, ordinal, clientUUID));
        return returnMap;
    }
1267522
def already_coords(self, address):
        """"""

        m = re.search(self.COORD_MATCH, address)
        return (m != None)
615288
def list_address(self, domain):
        " "

        try:
            response = self.get('/REST/ARecord/%s/%s' % (
                self.zone, domain))
        except self.NotFoundError:
            return []

        # Return a generator with the addresses.
        addresses = response.content['data']
        return [Address.from_url(self, uri) for uri in addresses]
553445
function getOverrideAddress() {
    global $db;

    // Only proceed IF *in* markflow mode AND logged-in (have to be logged in to get to markflow mode anyway)
    if (!empty($_GET['markflow']) && isset($_SESSION['customer_id']) && $_SESSION['customer_id']) {
      // From now on for this user we will edit addresses in Zen Cart, not by going to PayPal.
      $_SESSION['paypal_ec_markflow'] = 1;


      // debug
      $this->zcLog('getOverrideAddress - 1', 'Now in markflow mode.' . "\n" . 'SESSION[sendto] = ' . (int)$_SESSION['sendto']);


      // find the users default address id
      if (!empty($_SESSION['sendto'])) {
        $address_id = $_SESSION['sendto'];
      } else {
        $sql = "SELECT customers_default_address_id
                FROM " . TABLE_CUSTOMERS . "
                WHERE customers_id = :customerId";
        $sql = $db->bindVars($sql, ':customerId', $_SESSION['customer_id'], 'integer');
        $default_address_id_arr = $db->Execute($sql);
        if (!$default_address_id_arr->EOF) {
          $address_id = $default_address_id_arr->fields['customers_default_address_id'];
        } else {
          // couldn't find an address.
          return false;
        }
      }
      // now grab the address from the database and set it as the overridden address
      $sql = "SELECT entry_firstname, entry_lastname, entry_company,
                     entry_street_address, entry_suburb, entry_city, entry_postcode,
                     entry_country_id, entry_zone_id, entry_state
              FROM " . TABLE_ADDRESS_BOOK . "
              WHERE address_book_id = :addressId
              AND customers_id = :customerId
              LIMIT 1";
      $sql = $db->bindVars($sql, ':addressId', $address_id, 'integer');
      $sql = $db->bindVars($sql, ':customerId', $_SESSION['customer_id'], 'integer');
      $address_arr = $db->Execute($sql);

      // see if we found a record, if not then we have nothing to override with
      if (!$address_arr->EOF) {
        // get the state/prov code
        $sql = "SELECT zone_code
                FROM " . TABLE_ZONES . "
                WHERE zone_id = :zoneId";
        $sql = $db->bindVars($sql, ':zoneId', $address_arr->fields['entry_zone_id'], 'integer');
        $state_code_arr = $db->Execute($sql);
        if ($state_code_arr->EOF) {
          $state_code_arr->fields['zone_code'] = '';
        }
        if ($state_code_arr->fields['zone_code'] == '' && $address_arr->fields['entry_state'] != '') {
          $state_code_arr->fields['zone_code'] = $address_arr->fields['entry_state'];
        }
        $address_arr->fields['zone_code'] = $state_code_arr->fields['zone_code'];

        // get the country code
        // ISO 3166 standard country code
        $sql = "SELECT countries_iso_code_2
                FROM " . TABLE_COUNTRIES . "
                WHERE countries_id = :countryId";
        $sql = $db->bindVars($sql, ':countryId', $address_arr->fields['entry_country_id'], 'integer');
        $country_code_arr = $db->Execute($sql);
        if ($country_code_arr->EOF) {
          // default to US if not found
          $country_code_arr->fields['countries_iso_code_2'] = 'US';
        }
        $address_arr->fields['countries_iso_code_2'] = $country_code_arr->fields['countries_iso_code_2'];

        // debug
        $this->zcLog('getOverrideAddress - 2', '$address_arr->fields = ' . print_r($address_arr->fields, true));

        // return address data.
        return $address_arr->fields;
      }
      // debug
      $this->zcLog('getOverrideAddress - 3', 'no override record found');
    }
    // debug
    $this->zcLog('getOverrideAddress - 4', 'not logged in and not in markflow mode - nothing to override');

    return false;
  }
1249502
@Override
    public <E> List<E> getColumnsById(String schemaName, String tableName, String pKeyColumnName, String columnName,
            Object pKeyColumnValue, Class columnJavaType)
    {
        // fetch list ADDRESS_ID for given PERSON_ID
        QueryBuilder filterBuilder = new TermQueryBuilder(pKeyColumnName, pKeyColumnValue);

        SearchResponse response = txClient.prepareSearch(schemaName.toLowerCase()).setTypes(tableName)
                .setPostFilter(filterBuilder).addField(columnName).execute().actionGet();

        SearchHits hits = response.getHits();

        List columns = new ArrayList();
        for (SearchHit hit : hits.getHits())
        {
            Map<String, SearchHitField> fields = hit.getFields();
            columns.add(fields.get(columnName).getValue());
        }

        return columns;
    }
453222
def _street_addr_from_response(self, attributes):
        
        # The exact ordering of the address component fields that should be
        # used to reconstruct the full street address is not specified in the
        # Esri documentation, but the examples imply that it is this.
        ordered_fields = ['AddNum', 'StPreDir', 'StPreType', 'StName', 'StType', 'StDir']
        result = []
        for field in ordered_fields:
            result.append(attributes.get(field, ''))
        if any(result):
            return ' '.join([s for s in result if s])  # Filter out empty strings.
        else:
            return ''
498899
def address(self):
        """"""
        path = urlsplit(self.target).path
        suffix = '/' if not path or path.endswith('/') else ''
        return '%s%s/%s%s' % (self._ui_address[:-1], self._proxy_prefix,
                              self.route, suffix)
40884
@RequestMapping(value = "", method = RequestMethod.GET)
    public String pathOrderHome(Model model, @PathVariable int profileId,
                                @RequestParam(value = "clientUUID", defaultValue = "-1") String clientUUID) throws Exception {

        model.addAttribute("profile_id", profileId);
        model.addAttribute("profile_name", ProfileService.getInstance().getNamefromId(profileId));
        model.addAttribute("pathnames", PathOverrideService.getInstance().getPaths(profileId, clientUUID, null));

        return "pathOrder";
    }
614746
def lookup(self, nick):
		query = """
			SELECT fromnick, message, notifytime, notifyid
			FROM notify WHERE tonick = ?
		"""
		'''  '''
		messages = [
			{
				'fromnick': x[0],
				'message': x[1],
				'notifytime': x[2],
				'notifyid': x[3],
			}
			for x in self.db.execute(query, [nick])
		]
		ids = [x['notifyid'] for x in messages]
		query = """
			DELETE FROM notify
			WHERE notifyid IN (%s)
			""" % ','.join('?' for x in ids)
		self.db.execute(query, ids)

		return messages
1099164
def cc(self) -> Optional[Sequence[AddressHeader]]:
        """"""
        try:
            return cast(Sequence[AddressHeader], self[b'cc'])
        except KeyError:
            return None
464860
@Override
    @Path("/{cuid}")
    @ApiOperation(value="Retrieve a specific user or a page of users",
        notes="If cuid is not present, returns a page of users; if Find is present, searches by pattern.",
        response=User.class, responseContainer="List")
    @ApiImplicitParams({
        @ApiImplicitParam(name="find", paramType="query", dataType="string")})
    public JSONObject get(String path, Map<String,String> headers) throws ServiceException, JSONException {
        Map<String,String> parameters = getParameters(headers);
        UserServices userServices = ServiceLocator.getUserServices();
        try {
            String userId = parameters.get("id");
            if (userId == null)
                userId = parameters.get("cuid");
            if (userId == null) // use request path
                userId = getSegment(path, 1);
            if (userId == null && "true".equals(parameters.get("devUser")))
                userId = ApplicationContext.getDevUser();
            if (userId != null) {
                boolean oldStyle = "true".equals(parameters.get("withRoles")); // compatibility for old-style common roles
                User user = userServices.getUser(userId);
                if (user == null)
                    throw new ServiceException(HTTP_404_NOT_FOUND, "User not found: " + userId);
                return user.getJsonWithRoles(oldStyle);
            }
            else {
                Query query = getQuery(path, headers);
                if (query.getFind() != null) {
                    if (query.getBooleanFilter("mdw-central")) {
                        // get users from central
                        if (centralHelper == null) {
                            centralHelper = new HttpHelper(new URL(ApplicationContext.getCentralServicesUrl()
                                    + "/api/users?find=" + query.getFind() + "&appId=" + ApplicationContext.getAppId()));
                            Map<String,String> hdrs = new HashMap<String,String>();
                            centralHelper.setHeaders(hdrs);
                            String appToken = java.lang.System.getenv("MDW_APP_TOKEN");
                            if (appToken == null)
                                throw new IOException("Missing environment variable: MDW_APP_TOKEN");
                            hdrs.put("mdw-app-token", appToken);
                        }
                        return new JSONObject(centralHelper.get());
                    }
                    else {
                        return userServices.findUsers(query.getFind()).getJson();
                    }
                }
                else {
                    return userServices.getUsers(query.getStart(), query.getMax()).getJson();
                }
            }
        }
        catch (DataAccessException ex) {
            if (ex.getCode() >= HTTP_400_BAD_REQUEST)
                throw new ServiceException(ex.getCode(), ex.getMessage(), ex);
            else
                throw new ServiceException(HTTP_500_INTERNAL_ERROR, ex.getMessage(), ex);
        }
        catch (IOException ex) {
            throw new ServiceException(HTTP_500_INTERNAL_ERROR, ex.getMessage(), ex);
        }
        catch (Exception ex) {
            throw new ServiceException(ex.getMessage(), ex);
        }
    }
77315
def to_request
      address = {
        street:       self.street,
        number:       self.number,
        complement:   self.complement,
        district:     self.district,
        city:         self.city,
        state:        self.state,
        postal_code:  self.postal_code,
        country:      self.country,
      }
      return address
    end
1364094
def namedb_get_names_owned_by_address( cur, address, current_block ):
    

    unexpired_fragment, unexpired_args = namedb_select_where_unexpired_names( current_block )

    select_query = "SELECT name FROM name_records JOIN namespaces ON name_records.namespace_id = namespaces.namespace_id " + \
                   "WHERE name_records.address = ? AND name_records.revoked = 0 AND " + unexpired_fragment + ";"
    args = (address,) + unexpired_args

    name_rows = namedb_query_execute( cur, select_query, args )

    names = []
    for name_row in name_rows:
        names.append( name_row['name'] )

    if len(names) == 0:
        return None 
    else:
        return names
596930
def _street_addr_from_response(self, match):
        
        # Same caveat as above regarding the ordering of these fields; the
        # documentation is not explicit about the correct ordering for
        # reconstructing a full address, but implies that this is the ordering.
        ordered_fields = ['preQualifier', 'preDirection', 'preType', 'streetName',
                          'suffixType', 'suffixDirection', 'suffixQualifier']
        result = []
        # The address components only contain a from and to address, not the
        # actual number of the address that was matched, so we need to cheat a
        # bit and extract it from the full address string. This is likely to
        # miss some edge cases (hopefully only a few since this is a US-only
        # geocoder).
        addr_num_re = re.match(r'([0-9]+)', match['matchedAddress'])
        if not addr_num_re:  # Give up
            return ''
        result.append(addr_num_re.group(0))
        for field in ordered_fields:
            result.append(match['addressComponents'].get(field, ''))
        if any(result):
            return ' '.join([s for s in result if s])  # Filter out empty strings.
        else:
            return ''
741503
def show_examples():
    
    first, last = create_name()
    add = create_street()
    zip, city, state = create_city_state_zip()
    phone = create_phone(zip)
    print(first, last)
    print(add)
    print("{0:s} {1:s} {2:s}".format(city, state, zip))
    print(phone)
    print(create_sentence())
    print(create_paragraphs(num=3))
    print(create_cc_number())
    expiry = create_date(max_years_future=3)
    print("{0:%m/%y}".format(expiry))
    print(create_email(name=(first, last)))
    print("Password: {0:s}".format(create_pw()))
    print(create_company_name())
    print(create_job_title())
    print("Born on {0:%m/%d/%Y}".format(create_birthday()))