Store the city that will be queried against.

    >>> three.city('sf')
11984
def city(name=None):
    
    info = find_info(name)
    os.environ['OPEN311_CITY_INFO'] = dumps(info)
    return Three(**info)
395160
function checkIfLocalStorageThrows() {
    var localStorageTestKey = '_localforage_support_test';

    try {
        localStorage.setItem(localStorageTestKey, true);
        localStorage.removeItem(localStorageTestKey);

        return false;
    } catch (e) {
        return true;
    }
}
1040482
protected function submitEditCity()
    {
        if ($this->isPosted('delete')) {
            $this->deleteCity();
        } else if ($this->isPosted('save') && $this->validateEditCity()) {
            if (isset($this->data_city['city_id'])) {
                $this->updateCity();
            } else {
                $this->addCity();
            }
        }
    }
651459
function localeMiddleware(req, res, next) {

    // detect locale
    var locale = undefined, requested = undefined, accept = undefined;
    options.getLocaleFrom.some(function(name) {
      if (name === 'default') return false;
      var strategy = strategies[name];
      locale = strategy.getLocaleFrom(req, options.locales);
      if (!requested) {
        requested = (typeof locale === 'object') ? locale.requestedLocale : locale;
      }
      if (typeof locale === 'object') return true;
      if (options.locales) locale = matchLocale(locale);
      return !!locale;
    });

    // no locale detected to store, try with accept-language
    if (!locale) {
      if (strategies['accept-language']) {
        accept = strategies['accept-language'].getLocalesFrom(req);
        // the first one was already tested with getLocaleFrom
        accept.shift();
        accept.some(function(l) {
          locale = l;
          if (!requested) requested = l;
          if (options.locales) locale = matchLocale(l);
          return !!locale;
        });
      }
    }

    // no locale detected to store, take default locale when added as strategy
    if (!locale) {
      if (strategies.default) {
        locale = strategies.default.getLocaleFrom(req, options.locales);
        requested = null;
      }
    }

    // no locale at all
    if (!locale) return next();

    if (typeof locale === 'string') locale = locale.toLowerCase();
    if (typeof requested === 'string') requested = requested.toLowerCase();

    // store locale
    var localeObject = typeof locale === 'object' ? locale : createLocaleObject(locale, accept, requested);

    // ok finally, locale detected -> store locale
    options.storeLocaleTo.forEach(function(name) {
      var strategy = strategies[name];
      strategy.storeLocaleTo(req, res, localeObject);
    });
    return next();

  }
1167558
function (callbackId) {
    const sender = this.sender
    if (!supportLocalStorage) {
      return callNotSupportFail(sender, callbackId)
    }
    try {
      const _arr = []
      for (let i = 0; i < localStorage.length; i++) {
        _arr.push(localStorage.key(i))
      }
      sender.performCallback(callbackId, {
        result: SUCCESS,
        data: _arr
      })
    }
    catch (e) {
      // accept any exception thrown during a storage attempt as a quota error
      callFail(sender, callbackId)
    }
  }
679428
def _conv_adr(adr, entry):
        """"""
        if adr.value.street:
            entry['address'] = adr.value.street
        if adr.value.extended:
            entry['address2'] = adr.value.extended
        if adr.value.city:
            entry['city'] = adr.value.city
        if adr.value.region:
            entry['state'] = adr.value.region
        if adr.value.code and adr.value.code != '0':
            entry['zip'] = adr.value.code
        if adr.value.country:
            entry['country'] = adr.value.country
1229703
protected function setCity($city_id)
    {
        $this->data_city = array();

        if (is_numeric($city_id)) {
            $this->data_city = $this->city->get($city_id);
            if (empty($this->data_city)) {
                $this->outputHttpStatus(404);
            }
        }
    }
1337581
function (query) {
	this.toXml = function () {
		return {
			"CitySearchAndOrderType": {
				"State": {_text: query.state},
				"City": {_text: query.city},
				"Quantity": {_text: query.quantity || 1}
			}
		};
	};
}
472063
async def city(self, city: str, state: str, country: str) -> dict:
        """"""
        data = await self._request(
            'get',
            'city',
            params={
                'city': city,
                'state': state,
                'country': country
            })
        return data['data']
231186
public static function city()
    {
        $format = static::$cityFormats[array_rand(static::$cityFormats)];

        $parts = array();
        foreach ($format['parts'] as $function) {
            $parts[] = call_user_func($function);
        }

        return vsprintf($format['format'], $parts);
    }
1174045
public function city()
	{
		$requestParams = $this->initRequestParams('city');
		$this->request('city', $requestParams);

		return empty($this->error);
	}
429917
public function setCity(City $city): void
    {
        $this->city = $city->getName();
        $this->postCode = $city->getPostCode();
    }
623328
function (surl) {
            var search = (surl || window.location.search).match(/\?.*(?=\b|#)/);
            search && (search = search[0].replace(/^\?/, ''));
            if (!search) return {};
            var queries = {},
                params = search.split('&');

            util.each(params, function (item) {
               var param = item.split('=');
               queries[param[0]] = param[1];
            });

            return queries;
        }
1326562
public function setCity($city)
    {
        if (!is_string($city)) {
            $city = strval($city);
        }

        $this->city = $city;
    }
636194
public function getPreferredCity()
    {
        if ($this->_preferred_city === null
            && is_subclass_of($this->modelsMap['City'], CityInterface::class)
            && $this->needsDetectCity === true
        ) {
            $city_id = Yii::$app->request->get('multilingual-city-id', false);
            if ($city_id === false) {
                $city_id = Yii::$app->request->cookies->getValue('city_id', false);
            }
            if ($city_id !== false) {
                $this->_preferred_city = call_user_func(
                    [
                        $this->modelsMap['City'],
                        'getById'
                    ],
                    $city_id
                );
            } else {
                if ($this->geo() == null) {
                    $this->retrieveInfo();
                }
                $geo = $this->geo() !== null ? $this->geo() : new GeoInfo();
                $this->_preferred_city = call_user_func(
                    [
                        $this->modelsMap['City'],
                        'getPreferredCity'
                    ],
                    $geo->city
                );
            }
            if ($this->_preferred_city !== null &&
                (!Yii::$app->request->cookies->has('city_id') ||
                    Yii::$app->request->cookies->get('city_id') !== $this->_preferred_city->getId()) &&
                $this->cityNeedsConfirmation === false
            ) {
                Yii::$app->response->cookies->add(new Cookie([
                    'name' => 'city_id',
                    'value' => $this->_preferred_city->getId(),
                ]));
            }
        }
        if ($this->_preferred_city === null) {
            $this->cityNeedsConfirmation = true;
        }
        return $this->_preferred_city;
    }
818899
protected function setPagerListCity()
    {
        $options = $this->query_filter;
        $options['count'] = true;
        $options['state_id'] = $this->data_state['state_id'];

        $pager = array(
            'query' => $this->query_filter,
            'total' => (int) $this->city->getList($options)
        );

        return $this->data_limit = $this->setPager($pager);
    }
774386
def store(data, arr, start=0, stop=None, offset=0, blen=None):
    """"""

    # setup
    blen = _util.get_blen_array(data, blen)
    if stop is None:
        stop = len(data)
    else:
        stop = min(stop, len(data))
    length = stop - start
    if length < 0:
        raise ValueError('invalid stop/start')

    # copy block-wise
    for bi in range(start, stop, blen):
        bj = min(bi+blen, stop)
        bl = bj - bi
        arr[offset:offset+bl] = data[bi:bj]
        offset += bl