Returns the active regiontype code, eg. SA4, or undefined if none _or more than one_ active.
557705
function getActiveRegionTypeCode(item) {
  // We always put the region first, and at most one is active.
  var activeRegions = item._concepts[0].activeItems;
  if (activeRegions.length === 1) {
    return activeRegions[0].code;
  }
}
376945
public static IActionType<?> getType(String script) {
        for (IActionType<?> actionType : instance) {
            if (actionType.matches(script)) {
                return actionType;
            }
        }

        throw new IllegalArgumentException("Script type was not recognized: " + script);
    }
299699
def get_active_forms(self):
        """"""
        act_events = self.tree.findall("EVENT/[type='ONT::ACTIVATE']")
        def _agent_is_basic(agent):
            if not agent.mods and not agent.mutations \
                    and not agent.bound_conditions and not agent.location:
                return True
            return False
        for event in act_events:
            if event.attrib['id'] in self._static_events:
                continue
            agent = event.find(".//*[@role=':AGENT']")
            if agent is not None:
                # In this case this is not an ActiveForm statement
                continue
            affected = event.find(".//*[@role=':AFFECTED']")
            if affected is None:
                msg = 'Skipping active form event with no affected term.'
                logger.debug(msg)
                continue

            affected_id = affected.attrib.get('id')
            if affected_id is None:
                logger.debug(
                    'Skipping active form event with missing affected agent')
                continue

            affected_agent = self._get_agent_by_id(affected_id,
                                                   event.attrib['id'])
            # If it is a list of agents, skip them for now
            if not isinstance(affected_agent, Agent):
                continue
            if _agent_is_basic(affected_agent):
                continue
            # The affected agent has to be protein-like type
            affected_type = affected.find('type')
            if affected_type is None or \
               affected_type.text not in protein_types:
                continue
            # If the Agent state is at the base state then this is not an
            # ActiveForm statement
            if _is_base_agent_state(affected_agent):
                continue
            ev = self._get_evidence(event)
            location = self._get_event_location(event)
            st = ActiveForm(affected_agent, 'activity', True, evidence=ev)
            _stmt_location_to_agents(st, location)
            self.statements.append(st)
            self._add_extracted('ONT::ACTIVATE', event.attrib['id'])
785605
def action_type(self):
        
        if self.start_message:
            return self.start_message.contents[ACTION_TYPE_FIELD]
        elif self.end_message:
            return self.end_message.contents[ACTION_TYPE_FIELD]
        else:
            return None
584828
def get_region (self, rs,cs, re,ce):
        '''
        '''

        rs = constrain (rs, 1, self.rows)
        re = constrain (re, 1, self.rows)
        cs = constrain (cs, 1, self.cols)
        ce = constrain (ce, 1, self.cols)
        if rs > re:
            rs, re = re, rs
        if cs > ce:
            cs, ce = ce, cs
        sc = []
        for r in range (rs, re+1):
            line = u''
            for c in range (cs, ce + 1):
                ch = self.get_abs (r,c)
                line = line + ch
            sc.append (line)
        return sc
1009610
public CountryCodeDataType.Enum getCountryCodeDataType(String countryCode) {
		CountryCodeDataType.Enum countryCodeDataType = null;
		CountryContract country = s2SLocationService.getCountryFromCode(countryCode);
		if (country != null) {
			StringBuilder countryDetail = new StringBuilder();
			countryDetail.append(country.getAlternateCode());
			countryDetail.append(": ");
			countryDetail.append(country.getName().toUpperCase());
			countryCodeDataType = CountryCodeDataType.Enum
					.forString(countryDetail.toString());
		}
		return countryCodeDataType;
	}
80505
@Override
	public List<CommerceRegion> findByC_A(long commerceCountryId, boolean active) {
		return findByC_A(commerceCountryId, active, QueryUtil.ALL_POS,
			QueryUtil.ALL_POS, null);
	}
266783
def active_inactive(self):
        """"""
        active_indices = []
        inactive_indices = []
        for index, active in enumerate(self.active):
            if active:
                active_indices.append(index)
            else:
                inactive_indices.append(index)
        return active_indices, inactive_indices
78144
public Style getStyleForScanValue( int code )
  {
    Style s = _tokenStyles.get( new Integer( code ) );
    if( s == null )
    {
      s = getStyle( DEFAULT_STYLE );
    }
    return s;
  }
1061900
def getActiveSegment(self, c, i, timeStep):
    

    # todo: put back preference for sequence segments.

    nSegments = len(self.cells[c][i])

    bestActivation = self.activationThreshold
    which = -1

    for j,s in enumerate(self.cells[c][i]):

      activity = self.getSegmentActivityLevel(s, self.activeState[timeStep], connectedSynapsesOnly = True)

      if activity >= bestActivation:
        bestActivation = activity
        which = j

    if which != -1:
      return self.cells[c][i][which]
    else:
      return None
987246
@SuppressWarnings("deprecation")
    private int getSubsitemapType() throws CmsRpcException {

        try {
            return OpenCms.getResourceManager().getResourceType(
                CmsResourceTypeFolderSubSitemap.TYPE_SUBSITEMAP).getTypeId();
        } catch (CmsLoaderException e) {
            error(e);
        }
        return CmsResourceTypeUnknownFolder.getStaticTypeId();
    }
125786
public function getRegionCode()
    {
        \preg_match('~^(?<region_digits>[\d]{2}).+$~', $this->getValue(), $matches);

        if (isset($matches['region_digits']) && \is_numeric($region_digits = (string) $matches['region_digits'])) {
            return (int) $region_digits;
        }
    }
1131294
def get_region():
    
    log = logging.getLogger(mod_logger + '.get_region')

    # First get the availability zone
    availability_zone = get_availability_zone()

    if availability_zone is None:
        msg = 'Unable to determine the Availability Zone for this system, cannot determine the AWS Region'
        log.error(msg)
        return

    # Strip of the last character to get the region
    region = availability_zone[:-1]
    return region
139133
function getCode(code, language) {
    if (prism.languages.hasOwnProperty(language)) {
        code = prism.highlight(code, prism.languages[language]);
        return `<pre class="language-${language}"><code>${code}</code></pre>`;
    } else {
        return `<pre class="language-unknown"><code>${code}</code></pre>`;
    }
}
1003564
function getCurrentActiveType (version) {
  let typelist = TypeList
  for (let i = 0; i < typelist.length; i++) {
    if (semver[typelist[i]](version)) {
      return typelist[i]
    }
  }
}
346521
function get(code) {
  if (!Object.prototype.hasOwnProperty.call(osm, code)) {
    throw new TypeError('The alpha-3 code provided was not found: ' + code);
  }
  return osm[code];
}
367134
public static String getAtonType(Integer ts) {
		if (ts == null)
			return null;
		if (ts < 0 || ts > 31) {
			return "unknown code " + ts.intValue();
		} else {
			if (ts >= 0 && ts < 5) {
				return atonTypes[ts];
			} else if (ts < 20) {
				return categoryTypes[0] + atonTypes[ts];
			} else {
				return categoryTypes[1] + atonTypes[ts];
			}
		}
	}