Load the states file and merge overloads.

@param $country
@return mixed
763032
private function loadStates($country)
    {
        return $this->repository->getHelper()->loadJson($country['cca3'], 'states/default')
                ->overwrite($this->repository->getHelper()->loadJson($country['cca3'], 'states/overload'));
    }
550463
private function loadCountries()
    {
        $items = [];
        $country = $this->factCountry->create();
        $found = $this->modAllowedCountries->getAllowedCountries();
        foreach ($found as $code) {
            $country->loadByCode($code);
            $name = $country->getName();
            $items[$code] = $name;
        }
        $this->cacheCountries = $items;
    }
1171801
function countryFile( $withVariation = false )
    {
        $type = $withVariation ? 'variation' : 'default';
        if ( !( $this->CountryINI[$type] instanceof eZINI ) )
        {
            $country = $this->countryCode();
            $countryVariation = $this->countryVariation();
            $locale = $country;
            if ( $withVariation )
            {
                if ( $countryVariation !== '' )
                    $locale .= '@' . $countryVariation;
            }
            $countryFile = 'country/' . $locale . '.ini';
            if ( eZLocale::isDebugEnabled() )
            {
                eZDebug::writeNotice( "Requesting $countryFile", __METHOD__ );
            }
            if ( eZINI::exists( $countryFile, 'share/locale' ) )
                $this->CountryINI[$type] = eZINI::instance( $countryFile, 'share/locale' );
        }
        return $this->CountryINI[$type];
    }
167722
public function getCountryCode($country = null)
    {
        if ($country === null) {
            $country = $this->_country;
        }

        $code = KlarnaCountry::getCode($country);
        return (string) $code;
    }
919257
public function loadCountry($countryIso)
    {
        $content = $this
            ->locationLoaderAdapter
            ->getSqlForCountry($countryIso);

        $statement = $this
            ->locationEntityManager
            ->getConnection()
            ->prepare($content);

        $statement->execute();

        return $this;
    }
600919
public function largeCities($country, $limit = 0) {
		$options = [
			'conditions' => [$this->getAlias() . '.country_id' => $country],
			'order' => [$this->getAlias() . '.citizens' => 'desc'],
			'limit' => $limit
		];

		return $this->find('all', $options);
	}
282594
protected function has(string $locale, string $country)
    {
        return isset($this->loaded[$locale][$country]);
    }
467964
public function findByCountryAndModule(Country $country, Module $module, State $state = null)
    {
        $response = null;

        $countryInAreaList = CountryAreaQuery::findByCountryAndState($country, $state);

        /** @var CountryArea $countryInArea */
        foreach ($countryInAreaList as $countryInArea) {
            $response = self::create()->filterByAreaId($countryInArea->getAreaId())
                ->filterByModule($module)
                ->findOne()
            ;

            if ($response !== null) {
                break;
            }
        }

        return $response;
    }
44835
public function loadFile($file)
    {
        if (is_array($file)) {
            return collect($file)->mapWithKeys(function ($subFile, $key) {
                return [$key => $this->loadFile($subFile)];
            })->toArray();
        }

        return $this->parser->parseFile($file);
    }
985488
def load_states_xxx( country_key, xxx, name )
    country = Country.find_by_key!( country_key )
    logger.debug "Country #{country.key} >#{country.name} (#{country.code})<"

    reader = create_hash_reader( name )

    reader.each do |key, value|
      state = State.find_by_country_id_and_key!( country.id, key )
      state.send( "#{xxx}=", value )
      state.save!
    end
  end
577720
public static function calculateDynamicParts($country) {
    $dynamic_parts = [];
    $addressFormatRepository = \Drupal::service('address.address_format_repository');
    $address_format = $addressFormatRepository->get($country);
    $subdivisionRepository = \Drupal::service('address.subdivision_repository');
    $options = $subdivisionRepository->getList([$country]);
    $labels = LabelHelper::getFieldLabels($address_format);

    // Update region options based on country.
    $dynamic_parts['region']['#options'] = $options;
    $dynamic_parts['region']['#required'] = TRUE;
    $dynamic_parts['region']['#access'] = TRUE;

    // Update labels.
    $cityLabel = $labels['locality'];
    $postcodeLabel = $labels['postalCode'];
    $regionLabel = $labels['administrativeArea'];
    $dynamic_parts['region']['#title'] = $regionLabel;
    $dynamic_parts['postcode']['#title'] = $postcodeLabel;
    $dynamic_parts['city']['#title'] = $cityLabel;

    if (empty($cityLabel)) {
      $dynamic_parts['city']['#required'] = FALSE;
      $dynamic_parts['city']['#access'] = FALSE;
    }

    if (empty($postcodeLabel)) {
      $dynamic_parts['postcode']['#required'] = FALSE;
      $dynamic_parts['postcode']['#access'] = FALSE;
    }

    if (empty($regionLabel) || empty($options)) {
      $dynamic_parts['region']['#required'] = FALSE;
      $dynamic_parts['region']['#access'] = FALSE;
    }

    return $dynamic_parts;
  }
481903
public function hydrateBorders($country)
    {
        $country['borders'] = isset($country['borders'])
            ? $country['borders'] = countriesCollect($country['borders'])->map(function ($border) {
                return $this->repository->call('where', ['cca3', $border])->first();
            })
            : countriesCollect();

        return $country;
    }
9794
public function loadState(string $name)
    {
        $state = $this->resolve($name);

        if (is_callable($state)) {
            if ($state instanceof Closure) {
                $state = $state->bindTo($this, get_class($this));
            }

            $state = call_user_func($state, $this);
        }

        return $state;
    }
135665
public function callFrom(string $country) : string
    {
        return $this->util->formatOutOfCountryCallingNumber($this->number, $country);
    }
629944
function loadAll() {
      var allStates = 'Alabama, Alaska, Arizona, Arkansas, California, Colorado, Connecticut, Delaware,\
              Florida, Georgia, Hawaii, Idaho, Illinois, Indiana, Iowa, Kansas, Kentucky, Louisiana,\
              Maine, Maryland, Massachusetts, Michigan, Minnesota, Mississippi, Missouri, Montana,\
              Nebraska, Nevada, New Hampshire, New Jersey, New Mexico, New York, North Carolina,\
              North Dakota, Ohio, Oklahoma, Oregon, Pennsylvania, Rhode Island, South Carolina,\
              South Dakota, Tennessee, Texas, Utah, Vermont, Virginia, Washington, West Virginia,\
              Wisconsin, Wyoming';

      return allStates.split(/, +/g).map(function (state) {
        return {
          value: state.toLowerCase(),
          display: state
        };
      });
    }
1148835
public function To($country)
    {
        $country = $this->library->getMetadataForRegion($country);
        $this->instance->setCountryCode($country->getCountryCode());
        return $this;
    }
686850
protected function getCountry($countryId)
    {
        $entityManager = $this->getEntityManager();

        /** @var \Rcm\Repository\Country $countryRepo */
        $countryRepo = $entityManager->getRepository(\Rcm\Entity\Country::class);

        $country = $countryRepo->find(
            $countryId
        );

        if (!$country instanceof Country) {
            throw new \Exception("Country {$countryId} could not be found.");
        }

        return $country;
    }