Given a state name or state USPS code it finds the state capital
348104
function getStateCapital(searchKey, strict) {
    searchKey = searchKey && NODE_RATIFY.isString(searchKey) ? _toTitleCase(searchKey) : null;
    var topLevel = (US_STATE_NAME_TO_CAPITAL[searchKey] || US_STATE_NAME_TO_CAPITAL[US_STATE_CODE_TO_NAME[searchKey]]);

    if(strict) {
        return topLevel;
    } else {
        return (US_INHABITED_TERRITORIES_NAME_TO_CAPITAL[searchKey] ||
                US_INHABITED_TERRITORIES_NAME_TO_CAPITAL[US_INHABITED_TERRITORIES_CODE_TO_NAME[searchKey]] ||
                topLevel);
    }
}
1125980
function GetState(state) {
  var SVG = MathJax.OutputJax.SVG,
      TEX = MathJax.InputJax.TeX,
      MML = MathJax.ElementJax.mml,
      AMS = MathJax.Extension["TeX/AMSmath"],
      HUB = MathJax.Hub, HTML = MathJax.HTML,
      GLYPH = (SVG.BBOX||{}).GLYPH;

  if (state && state.AMS) {
    AMS.startNumber = state.AMS.startNumber;
    AMS.labels = state.AMS.labels;
    AMS.IDs = state.AMS.IDs;
    MML.SUPER.ID = state.mmlID;
    GLYPH.glyphs = state.glyphs;
    GLYPH.defs = state.defs;
    GLYPH.n = state.n;
    ID = state.ID;
  } else {
    if (state) {state.AMS = {}}
    if (SVG.resetGlyphs) SVG.resetGlyphs(true);
    if (data.useGlobalCache) {
      state.glyphs = {};
      state.defs = HTML.Element("defs");
      state.n = 0;
    }
    if (TEX.resetEquationNumbers) TEX.resetEquationNumbers();
    MML.SUPER.ID = ID = 0;
    MathJax.OutputJax.CommonHTML.ID = 0;
  }
}
679069
def sender_name=(v)
      @sender_name = nil
      if (v = sanitize(v)) && v.length > 0
        @sender_name = v
      else
        raise USPSValidationError, "'#{v}' is not a valid string in #{__method__}"
      end
    end
600727
def find(self, state, recp):
        """"""
        if recipient.IRecipient.providedBy(recp):
            agent_id = recipient.IRecipient(recp).key
        else:
            agent_id = recp
        desc = state.agent.get_descriptor()
        match = [x for x in desc.partners if x.recipient.key == agent_id]
        if len(match) == 0:
            return None
        elif len(match) > 1:
            raise FindPartnerError('More than one partner was matched by the '
                                   'recipient %r!. Matched: %r' % \
                                   (recp, match, ))
        else:
            return match[0]
288536
function(state) {
      if(state == inputEx.stateRequired) {
         return this.options.messages.required;
      }
      else if(state == inputEx.stateInvalid) {
         return this.options.messages.invalid;
      }
      else {
         return '';
      }
	}
1313166
def name(self):
        """"""
        try:
            return tuple(
                getattr(self, x) if getattr(self, x) else u''
                for x in ('country', 'state', 'county', 'city'))
        except:
            return tuple(
                getattr(self, x) if getattr(self, x) else ''
                for x in ('country', 'state', 'county', 'city'))
1145979
def getStateCode(self,state):
        
        return np.dot(state-self.minvalues,self.statecode)
900926
function stateRefSearch(pages, stateName) {
            for (var i = 0; i < pages.length; i++) {
                if (pages[i].name === stateName) {
                    return pages[i];
                }
            }

            return null;
        }
1339174
function () {
            /*  determine parameters  */
            var params = $cs.params("state", arguments, {
                state: { pos: 0, req: true,
                         valid: function (s) { return _cs.state_name2idx(s) !== -1; } }
            });

            /*  determine index of state by name  */
            var state = _cs.state_name2idx(params.state);

            /*  compare given state against state of component  */
            return (this.__state - state);
        }
492693
function parseState(s) {
  switch (s) {
  case "": return Profile.CodeState.COMPILED;
  case "~": return Profile.CodeState.OPTIMIZABLE;
  case "*": return Profile.CodeState.OPTIMIZED;
  }
  throw new Error("unknown code state: " + s);
}
495606
def translate_state(self, s):
        
        if not isinstance(s, basestring):
            return s
        s = s.capitalize().replace("_", " ")
        return t(_(s))
380126
def find_name(name, state, high):
    '''
    
    '''
    ext_id = []
    if name in high:
        ext_id.append((name, state))
    # if we are requiring an entire SLS, then we need to add ourselves to everything in that SLS
    elif state == 'sls':
        for nid, item in six.iteritems(high):
            if item['__sls__'] == name:
                ext_id.append((nid, next(iter(item))))
    # otherwise we are requiring a single state, lets find it
    else:
        # We need to scan for the name
        for nid in high:
            if state in high[nid]:
                if isinstance(high[nid][state], list):
                    for arg in high[nid][state]:
                        if not isinstance(arg, dict):
                            continue
                        if len(arg) != 1:
                            continue
                        if arg[next(iter(arg))] == name:
                            ext_id.append((nid, state))
    return ext_id
322594
def parse_institution_address(address, city, state_province,
                              country, postal_code, country_code):
    """"""
    address_list = force_list(address)
    state_province = match_us_state(state_province) or state_province

    postal_code = force_list(postal_code)
    country = force_list(country)
    country_code = match_country_code(country_code)

    if isinstance(postal_code, (tuple, list)):
        postal_code = ', '.join(postal_code)

    if isinstance(country, (tuple, list)):
        country = ', '.join(set(country))

    if not country_code and country:
        country_code = match_country_name_to_its_code(country)

    if not country_code and state_province and state_province in us_state_to_iso_code.values():
        country_code = 'US'

    return {
        'cities': force_list(city),
        'country_code': country_code,
        'postal_address': address_list,
        'postal_code': postal_code,
        'state': state_province,
    }
898635
def t_STATESHEADER(self, token):
        '
        title = token.lexer.lexmatch.group("title").decode("utf8")
        token.value = title
        token.lexer.lineno += 1
        return token
594270
async function findPr(branchName, prTitle, state = 'all', refreshCache) {
  logger.debug(`findPr(${branchName}, "${prTitle}", "${state}")`);
  const prList = await getPrList({ refreshCache });
  const pr = prList.find(isRelevantPr(branchName, prTitle, state));
  if (pr) {
    logger.debug(`Found PR #${pr.number}`);
  } else {
    logger.debug(`DID NOT Found PR from branch #${branchName}`);
  }
  return pr;
}
562879
def _collect_state_names(self, variable):
        ""
        states = sorted(list(self.data.ix[:, variable].dropna().unique()))
        return states
628404
function parseGoogleGeocodes(response) {
  // the result has a results property that is an array
  // there may be more than one result when the address is ambiguous
  // for pragmatic reasons, only use the first result
  // if the result does not have a zip code, then assume the user
  // did not provide a valid address

  var result = response.results[0]
    , zipComponent = findAddressComponent(result.address_components, 'postal_code')
    , simple = {}
    ;

  simple.zip5 = zipComponent ? zipComponent.short_name : null;
  simple.address = result.formatted_address.replace(/,\s*USA/, '');
  simple.localAddress = getLocalAddress(result) || simple.address;
  simple.location = result.geometry.location;
  return simple;
}