Returns the metadata for the given region code or {@code null} if the region code is invalid
or unknown.
@param string $regionCode
@return PhoneMetadata
962225
public function getMetadataForRegion($regionCode)
    {
        if (!$this->isValidRegionCode($regionCode)) {
            return null;
        }

        return $this->metadataSource->getMetadataForRegion($regionCode);
    }
138165
private static function parseRegion($code)
    {
        $lang = substr($code, 0, 2);
        $reg =  strtoupper(substr($code, 3, 2));
        $needle = "{$lang}-{$reg}";
        foreach (self::codes() as $code) {
            if ($code['code'] == $needle) {
                return [$reg, $code['description']];
            }
        }

        throw new UnknownLanguageCodeException(
            "The region code '{$code}'' is unknown."
        );
    }
1269602
public final function getMetadata($key = null)
   {
       return isset($key)
            ? (array_key_exists($key, $this->meta) ? $this->meta[$key] : null)
            : $this->meta;
   }
1287303
public function getCountryFromCode($code)
    {
        $code = strtoupper($code);
        $output = "Other";
        if (in_array($code, $this->countriesMapping)) {
            foreach ($this->countriesMapping as $country => $short) {
                if ($code == $short) {
                    $output = $country;
                    break;
                }
            }
        }

        return $output;
    }
1276835
public function api($data, $code = null, $meta = [])
    {
        $json = [
            config('http.body') => $data,
            config('http.meta') => $meta,
            config('http.status') => $this->parseStatus($code ?? $this->getStatusCode()),
        ];

        return $this->json($json, $code);
    }
503288
public static function getRegionNameFromCodes($countryCode, $regionCode)
    {
        $regionNames = self::getRegionNames();

        $countryCode = strtoupper($countryCode);
        $regionCode = strtoupper($regionCode);

        if (isset($regionNames[$countryCode][$regionCode])) {
            return $regionNames[$countryCode][$regionCode];
        } else {
            return Piwik::translate('General_Unknown');
        }
    }
660137
public function getAuthorizationCode($code)
    {
        if (isset($this->authorizationCodes[$code])) {
            return $this->authorizationCodes[$code];
        }

        return null;
    }
199586
public static function languageCountryLocaleCode($languageCode, $countryCode)
    {
        $countryLocaleCodes = static::countryLocaleCodes($countryCode);
        $languageLocaleCodes = static::languageLocaleCodes($languageCode);
        if ($localeCodes = array_intersect($languageLocaleCodes, $countryLocaleCodes)) {
            return reset($localeCodes);
        }

        return \Locale::composeLocale([
            'language' => $languageCode,
            'region' => $countryCode,
        ]);
    }
880496
func getMetadataForRegion(regionCode string) *PhoneMetadata {
	if !isValidRegionCode(regionCode) {
		return nil
	}
	val, _ := readFromRegionToMetadataMap(regionCode)
	return val
}
882490
public function findByCode($code)
    {
        try {
            $qb = $this->createQueryBuilder('currency')
                ->andWhere('currency.code = :currencyCode')
                ->setParameter('currencyCode', $code);

            return $qb->getQuery()->getSingleResult();
        } catch (NoResultException $exc) {
            return null;
        }
    }
568885
public static function getcountry($code='')
	{
		$name = '';
		if ($code)
		{
			if (!($gdb = self::getGeoDBO()))
			{
				return $name;
			}

			$gdb->setQuery("SELECT name FROM countries WHERE code = " . $gdb->quote($code));
			$name = stripslashes($gdb->loadResult());
		}
		return $name;
	}
170790
public function getMessageString($errorCode)
	{
		return isset($this->errorMessages[$errorCode]) ? $this->errorMessages[$errorCode] : null;
	}
802861
public function get($code = null): string
    {
        if (!$this->validate($code)) {
            throw new \InvalidArgumentException('Invalid code');
        }

        return isset(self::$codes[$code]) ? self::$codes[$code] : '';
    }
437403
public static function phoneCode($code): string
    {
        return (isset(static::$phoneCodes[strtoupper($code)])) ? static::$phoneCodes[strtoupper($code)] : 'N/A';
    }
733192
public function get($countryCode)
    {
        if (strlen($countryCode) !== 2) {
            throw new \InvalidArgumentException('Please provide a 2 character country code.');
        }

        $countryCode = strtoupper($countryCode);

        if (array_key_exists($countryCode, $this->aliases)) {
            $countryCode = $this->aliases[$countryCode];
        }

        return implode('', array_map([$this, 'toUnicode'], str_split($countryCode)));
    }
554717
public function getByRegionCode($region_code)
    {
        if (\is_scalar($region_code)) {
            // Очищаем входящее значение и приводим к числу
            $region_code = (int) \preg_replace('~\D~', '', $region_code);
            foreach ($this->items as $region) {
                if ($region->getRegionCode() === $region_code) {
                    return $region;
                }
            }
        }
    }
393408
public function getStandardRate($countryCode)
    {
        $country = $this->getCountry($countryCode);
        if (!is_null($country)) {
            return $country->getStandardRate();
        }

        return null;
    }