Find the province object of the given province name or short name

@param {String}  name              english province name or short name
@param {Boolean} [useAlias]        use alias flag, default `false`
@return {Object} province          province object
432280
function getProvinceByNameOrShortName(name, useAlias) {
  if (!_.isString(name) || !_.isArray(this.provinces)) return undefined;

  return _.find(this.provinces, (province) => {
    if (useAlias) {
      return province.name.toUpperCase() === name.toUpperCase()
        || (province.short && province.short.toUpperCase() === name.toUpperCase())
        ||  _.find(province.alias, (alias) => (alias.toUpperCase() === name.toUpperCase()));
    }
    return province.name.toUpperCase() === name.toUpperCase() || (province.short && province.short.toUpperCase() === name.toUpperCase());
  });
}
1358878
function getCountryByNameOrShortName(name, useAlias) {
  if (!_.isString(name)) return undefined;

  return _.find(countries, (country) => {
    if (useAlias) {
      return country.name.toUpperCase() === name.toUpperCase()
        || country.alpha2.toUpperCase() === name.toUpperCase()
        ||  _.find(country.alias, (alias) => (alias.toUpperCase() === name.toUpperCase()));
    }
    return country.name.toUpperCase() === name.toUpperCase() || country.alpha2.toUpperCase() === name.toUpperCase();
  });
}
1367419
def lookup_default(self, name):
        
        if self.default_map is not None:
            rv = self.default_map.get(name)
            if callable(rv):
                rv = rv()
            return rv
539945
function(name) {
    if (name) {
      // Find integration by name.
      var result = integrations[name];
      if (!result) {
        throw new Error('Integration does not exist: ' + name);
      }
      return result;
    } else {
      // Return entire singleton integration map.
      return integrations;
    }
  }
70434
def _onAs( self, name ):
        "  "
        if self.__lastImport.what:
            self.__lastImport.what[ -1 ].alias = name
        else:
            self.__lastImport.alias = name
        return
1162711
function(name) {
			if (typeof name === 'number') {
				return this.list()[name];
			}
			
			if (typeof name === 'string') {
				return utils.find(this.list(), function(prop) {
					return prop.name() === name;
				});
			}
			
			return name;
		}
865259
def with_name(self, name):
    """"""
    with self.g.as_default(), scopes.var_and_name_scope((name, None)) as (
        name_scope, var_scope):
      return Layer(copy=self, name=self._name, scope=(name_scope, var_scope))
225274
function findByName(array, name) {
        if (array && array.length > 0) {
            for (var i = 0, len = array.length; i < len; i++) {
                var elem = array[i];
                if (elem.name == name) {
                    return elem;
                }
            }
        }
        return null;
    }
92798
function(name) {
        var list = this.getProperties();
        for (var i in list) {
            if (list[i].getName() === name) {
                return true;
            }
        }
        return false;
    }
1118315
public function getAlias($name)
    {
        $aliases = $this->getAliases();
        if (isset($aliases[$name])) {
            return $aliases[$name];
        }
        return null;
    }
258591
function(name) {
    name = name || '';

    var state = null;

    // Only use valid state queries
    if(!_validateStateName(name)) {
      return null;
    
    // Use cache if exists
    } else if(_stateCache[name]) {
      return _stateCache[name];
    }

    var nameChain = _getNameChain(name);
    var stateChain = nameChain
      .map(function(name, i) {
        var item = angular.copy(_stateLibrary[name]);
        return item;
      })
      .filter(function(parent) {
        return !!parent;
      });

    // Walk up checking inheritance
    for(var i=stateChain.length-1; i>=0; i--) {
      if(stateChain[i]) {
        var nextState = stateChain[i];
        state = angular.merge(nextState, state || {});
      }

      if(state && state.inherit === false) break;
    }

    // Store in cache
    _stateCache[name] = state;

    return state;
  }
1097144
function get(name) {
    validateArgumentsLength(arguments.length, 1);
    var entries = getInternalParamsState(this).entries;
    var key = name + '';
    var i = 0;
    for (; i < entries.length; i++) if (entries[i].key === key) return entries[i].value;
    return null;
  }
1277005
public function getAlias($name)
        {
            if (isset($this->_aliases[$name])) {
                return $this->_aliases[$name];
            }

            return null;
        }
818423
@SuppressWarnings("unchecked")
    public <T> T getContextData(String name) {
        T rc = null;
        if (null != this.inheritableLocals) {
            rc = (T) this.inheritableLocals.get(name);
        }
        if (null == rc && null != this.locals) {
            rc = (T) this.locals.get(name);
        }
        return rc;
    }
1153360
def match(self, name):
		''''''
		if (self.ns + self.name).startswith(name):
			return True

		for alias in self.aliases:
			if (self.ns + alias).startswith(name):
				return True
1110043
function(name) {
    var idx, length, regexp,
      header = this.headers[Utils.headerize(name)],
      result = [];

    if (header) {
      length = header.length;
      for (idx = 0; idx < length; idx++) {
        result.push(header[idx]);
      }
      return result;
    } else {
      length = this.extraHeaders.length;
      regexp = new RegExp('^\\s*'+ name +'\\s*:','i');
      for (idx=0; idx<length; idx++) {
        header = this.extraHeaders[idx];
        if (regexp.test(header)) {
          result.push(header.substring(header.indexOf(':')+1).trim());
        }
      }
      return result;
    }
  }
1144712
function findRegisteredFontSet(alias) {
    var useDefault = angular.isUndefined(alias) || !(alias && alias.length);
    if (useDefault) {
      return config.defaultFontSet;
    }

    var result = alias;
    angular.forEach(config.fontSets, function(fontSet) {
      if (fontSet.alias === alias) {
        result = fontSet.fontSet || result;
      }
    });

    return result;
  }