Check that an address is valid.
Optionally validate it against the corresponding public key.

@param string      $address
@param string|null $publicKey An optional corresponding public key.
@return bool
@throws ApiException
@api
421545
public function checkAddress(string $address, ?string $publicKey = null): bool
    {
        return $this->getJson([
            'q' => 'checkAddress',
            'account' => $address,
            'public_key' => $publicKey,
        ]);
    }
189397
public function deleteAddress( CustomerVault\Address $address )
    {
        $address->setRequiredFields(array(
            'profileID',
            'id'
        ));
        $address->checkRequiredFields();

        $request = new Request(array(
            'method' => Request::DELETE,
            'uri' => $this->prepareURI("/profiles/" . $address->profileID . "/addresses/" . $address->id),
        ));
        $this->client->processRequest($request);

        return true;
    }
499140
public static function reverseIpv4(string $address): bool
    {
        $pattern = '/^((?:[0-9]+\.){1,4})in\-addr\.arpa\.$/i';

        if (1 !== preg_match($pattern, $address, $matches)) {
            return false;
        }

        $octets = explode('.', $matches[1]);
        array_pop($octets); //Remove the last decimal from the array

        foreach ($octets as $octet) {
            if ((int) $octet > 255) {
                return false;
            }
        }

        return true;
    }
1202045
public function contains(Address $address)
    {
        $addressValue = $address->get();

        return $addressValue >= $this->firstAddress->get() && $addressValue <= $this->lastAddress->get();
    }
280818
private function checkIfAddressExists($address)
    {
        $oldAddress = $this->addressRepository->findOneByEmailIgnoreHidden( $address );

        return isset($oldAddress) && $oldAddress ? $oldAddress : null;
    }
98352
protected static function deleteAddressByIdAsyncWithHttpInfo($address_id) 
    {
        $returnType = '';  
        $request = self::deleteAddressByIdRequest($address_id); 

        return self::getHttpClient()
            ->sendAsync($request, self::createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    return [null, $response->getStatusCode(), $response->getHeaders()];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        $response->getBody()
                    );
                }
            );
    }
806118
public function setAddress($address)
    {
        if (is_object($address)) {
            $this->address = $address;
        } elseif (is_string($address) || is_array($address)) {
            $this->address = new Address($address);
        }
    }
109810
protected function validateTypeAddress()
    {
        $field = 'type';
        $value = $this->getSubmitted($field);

        if (!isset($value)) {
            $this->unsetSubmitted($field);
            return null;
        }

        if (!in_array($value, $this->address->getTypes())) {
            $this->setErrorUnavailable($field, $this->translation->text('Type'));
            return false;
        }

        return true;
    }
35838
private function justAddress($address)
    {
        if (($pos = strpos($address, '<')) === false) {
            return $address;
        }

        $n = strlen($address);
        if ($address[$n - 1] == '>') {
            $address = substr($address, $pos + 1, -1);
        }

        return $address;
    }
165560
def validateaddress(self, address: str) -> bool:
        ""

        try:
            Address.from_string(address, self.network_properties)
        except InvalidAddress:
            return False

        return True
752757
public function geocode($address, array $params = []) {
		$this->_buildGeocoder();

		try {
			$result = $this->geocoder->geocode($address);
		} catch (NoResult $e) {
			throw new InconclusiveException(sprintf('Inconclusive result (total of %s)', 0));
		}

		if (!$this->_config['allowInconclusive'] && !$this->isConclusive($result)) {
			throw new InconclusiveException(sprintf('Inconclusive result (total of %s)', $result->count()));
		}
		if ($this->_config['minAccuracy'] && !$this->containsAccurateEnough($result)) {
			throw new NotAccurateEnoughException('Result is not accurate enough');
		}

		return $result;
	}
640639
public function getAccountByAddress($address)
    {
        $args = [
            (string)$address
        ];
        $account = $this->rpc->query("getAccount", $args);

        return !empty($account) ? $account : null;
    }
669662
public static function getCoordinates($address, $apiKey=null) {
        $url = 'https://maps.googleapis.com/maps/api/geocode/json?address='.urlencode($address);
        if (!empty($apiKey)) {
            $url .= "&key={$apiKey}";
        }

        $response = file_get_contents($url);
        $response = json_decode($response, true);

        $addressLatLong = [];
        if (isset($response['results'][0])) {
            $addressLatLong = $response['results'][0];
        }

        return $addressLatLong;
    }
1271302
public function geocode($address)
    {
        $query = $this->buildQuery('address', $address);

        $response = $this->validateResponse(
            $this->getResponse($query)
        );

        return $this->buildResults($response['results']);
    }
29864
@Override
	public void validate() throws AddressStringException {
		if(isValidated()) {
			return;
		}
		synchronized(this) {
			if(isValidated()) {
				return;
			}
			//we know nothing about this address.  See what it is.
			try {
				parsedAddress = getValidator().validateAddress(this);
				isValid = true;
			} catch(AddressStringException e) {
				cachedException = e;
				isValid = false;
				throw e;
			}
		}
	}
108171
public function geocodeAddress($address)
	{
		$url = 'http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=' . urlencode($address);
		$response = $this->http->get($url);

		if ($response->code < 200 || $response->code >= 300)
		{
			throw new RuntimeException('Error code ' . $response->code . ' received geocoding address: ' . $response->body . '.');
		}

		$data = json_decode($response->body, true);

		if (!$data)
		{
			throw new RuntimeException('Invalid json received geocoding address: ' . $response->body . '.');
		}

		if ($data['status'] != 'OK')
		{
			return null;
		}

		return $data['results'][0];
	}
257246
public function geocodeAddress($address)
	{
		$uri = new Uri('https://maps.googleapis.com/maps/api/geocode/json');

		$uri->setVar('address', urlencode($address));

		if (($key = $this->getKey()))
		{
			$uri->setVar('key', $key);
		}

		$response = $this->http->get($uri->toString());

		if ($response->code < 200 || $response->code >= 300)
		{
			throw new RuntimeException('Error code ' . $response->code . ' received geocoding address: ' . $response->body . '.');
		}

		$data = json_decode($response->body, true);

		if (!$data)
		{
			throw new RuntimeException('Invalid json received geocoding address: ' . $response->body . '.');
		}

		if ($data['status'] != 'OK')
		{
			return;
		}

		return $data['results'][0];
	}