Return group and name for an evidence code.
164160
def get_grp_name(self, code):
        """"""
        nt_code = self.code2nt.get(code.strip(), None)
        if nt_code is not None:
            return nt_code.group, nt_code.name
        return "", ""
822974
private Group getNewGroup(String recordName,Character aminoCode1, long seq_id,String groupCode3) {

		Group g = ChemCompGroupFactory.getGroupFromChemCompDictionary(groupCode3);
		if ( g != null && !g.getChemComp().isEmpty()) {
			if ( g instanceof AminoAcidImpl) {
				AminoAcidImpl aa = (AminoAcidImpl) g;
				aa.setId(seq_id);
			} else if ( g instanceof NucleotideImpl) {
				NucleotideImpl nuc =  (NucleotideImpl) g;
				nuc.setId(seq_id);
			} else if ( g instanceof HetatomImpl) {
				HetatomImpl het = (HetatomImpl)g;
				het.setId(seq_id);
			}
			return g;
		}



		Group group;
		if ( recordName.equals("ATOM") ) {
			if (StructureTools.isNucleotide(groupCode3))  {
				// it is a nucleotide
				NucleotideImpl nu = new NucleotideImpl();
				group = nu;
				nu.setId(seq_id);

			} else if (aminoCode1==null || aminoCode1 == StructureTools.UNKNOWN_GROUP_LABEL){
				HetatomImpl h = new HetatomImpl();
				h.setId(seq_id);
				group = h;

			} else {
				AminoAcidImpl aa = new AminoAcidImpl() ;
				aa.setAminoType(aminoCode1);
				aa.setId(seq_id);
				group = aa ;
			}
		}
		else {
			if (StructureTools.isNucleotide(groupCode3))  {
				// it is a nucleotide
				NucleotideImpl nu = new NucleotideImpl();
				group = nu;
				nu.setId(seq_id);
			}
			else if (aminoCode1 != null ) {
				AminoAcidImpl aa = new AminoAcidImpl() ;
				aa.setAminoType(aminoCode1);
				aa.setId(seq_id);
				group = aa ;
			} else {
				HetatomImpl h = new HetatomImpl();
				h.setId(seq_id);
				group = h;
			}
		}
		return  group ;
	}
364223
def _guess_group(info):
    """"""
    value = "fake"
    if "metadata" in info:
        if info["metadata"]:
            return ",".join(map(str, info["metadata"].values()))
    return value
1168229
def kls_name(self):
        """"""
        # Determine kls for group
        if not self.parent or not self.parent.name:
            return 'Test{0}'.format(self.name)
        else:
            use = self.parent.kls_name
            if use.startswith('Test'):
                use = use[4:]

            return 'Test{0}_{1}'.format(use, self.name)
16628
def info(name):
    '''
    
    '''
    if salt.utils.stringutils.contains_whitespace(name):
        raise SaltInvocationError('Group name cannot contain whitespace')
    try:
        # getgrnam seems to cache weirdly, so don't use it
        grinfo = next(iter(x for x in grp.getgrall() if x.gr_name == name))
    except StopIteration:
        return {}
    else:
        return _format_info(grinfo)
306370
def info(name):
    '''
    
    '''
    ret = {}
    try:
        data = pwd.getpwnam(name)
        ret['gid'] = data.pw_gid
        ret['groups'] = list_groups(name)
        ret['home'] = data.pw_dir
        ret['name'] = data.pw_name
        ret['passwd'] = data.pw_passwd
        ret['shell'] = data.pw_shell
        ret['uid'] = data.pw_uid
        # Put GECOS info into a list
        gecos_field = data.pw_gecos.split(',', 3)
        # Assign empty strings for any unspecified GECOS fields
        while len(gecos_field) < 4:
            gecos_field.append('')
        ret['fullname'] = gecos_field[0]
        ret['roomnumber'] = gecos_field[1]
        ret['workphone'] = gecos_field[2]
        ret['homephone'] = gecos_field[3]
    except KeyError:
        return {}
    return ret
1097346
def group_data(self):
        
        return GroupData(self.group_num,
                         self.group_name,
                         self.group_symbol,
                         self.group_variant)
38958
private String getGroupKey() {
        EntityIdentifier[] groups = null;
        try {
            groups =
                    GroupService.searchForGroups(
                            groupName, IGroupConstants.SearchMethod.DISCRETE, IPerson.class);
        } catch (GroupsException e1) {
            throw new RuntimeException(
                    "An exception occurred searching for " + "the group " + groupName + ".", e1);
        }
        if (groups == null || groups.length == 0)
            throw new RuntimeException(
                    "Group with name '"
                            + groupName
                            + "' not found for "
                            + this.getClass().getName()
                            + ". All evaluations will return false.");

        return groups[0].getKey();
    }
1224055
def name(self) -> str:
        """"""
        if self.is_platform:
            if self._data["publicCode"]:
                return self._data['name'] + " Platform " + \
                       self._data["publicCode"]
            else:
                return self._data['name'] + " Platform " + \
                       self.place_id.split(':')[-1]
        else:
            return self._data['name']
1152953
def get_witnesses(self, name='*'):
        
        for filepath in glob.glob(os.path.join(self._path, name, '*.txt')):
            if os.path.isfile(filepath):
                name = os.path.split(os.path.split(filepath)[0])[1]
                siglum = os.path.splitext(os.path.basename(filepath))[0]
                yield self.get_witness(name, siglum)
498697
def group_attrib(self):
        '''
        
        '''
        group_attributes = [g.attrib for g in self.dataset.groups if self in g]
        if group_attributes:
            return concat_namedtuples(*group_attributes)
518295
def _get_name(self, graph, group=None):
        
        if group is not None:
            graph = graph.get_subgraph(group, normalize=True)

        fingerprint = graph.fingerprint.tobytes()
        name = self.name_cache.get(fingerprint)
        if name is None:
            name = "NM%02i" % len(self.name_cache)
            self.name_cache[fingerprint] = name
        return name
1129018
def commdct2grouplist(gcommdct):
    """"""
    gdict = {}
    for objidd in gcommdct:
        group = objidd[0]['group']
        objname = objidd[0]['idfobj']
        if group in gdict:
            gdict[group].append(objname)
        else:
            gdict[group] = [objname, ]
    return gdict
1288822
def _get_evidence(self, trigger_id, args, agent_coords, site_coords):
        """"""
        trigger_info = self._entity_dict[trigger_id]

        # Get the sentence index from the trigger word.
        s_idx_set = {self._entity_dict[eid]['sentenceIndex']
                     for eid in args.values()
                     if 'sentenceIndex' in self._entity_dict[eid]}
        if s_idx_set:
            i_min = min(s_idx_set)
            i_max = max(s_idx_set)

            text = '. '.join(self._sentences[i_min:(i_max+1)]) + '.'

            s_start = self._sentence_starts[i_min]
            annotations = {
                'agents': {'coords': [_fix_coords(coords, s_start)
                                      for coords in agent_coords]},
                'trigger': {'coords': _fix_coords([trigger_info['charStart'],
                                                   trigger_info['charEnd']],
                                                  s_start)}
                }
        else:
            logger.info('Unable to get sentence index')
            annotations = {}
            text = None
        if site_coords:
            annotations['site'] = {'coords': _fix_coords(site_coords, s_start)}

        return Evidence(text_refs=self._text_refs.copy(), text=text,
                        source_api='rlimsp', pmid=self._text_refs.get('PMID'),
                        annotations=annotations)
946251
def attrget(self, groupname, attrname, rownr):
        """"""
        return self._attrget(groupname, attrname, rownr)
1047820
def _context_names():
    """"""
    import inspect

    from renku.models import provenance
    from renku.models._jsonld import JSONLDMixin

    for name in dir(provenance):
        cls = getattr(provenance, name)
        if inspect.isclass(cls) and issubclass(cls, JSONLDMixin):
            yield name
402699
def group_by_witness(self):
        """"""
        if self._matches.empty:
            # Ensure that the right columns are used, even though the
            # results are empty.
            self._matches = pd.DataFrame(
                {}, columns=[constants.WORK_FIELDNAME,
                             constants.SIGLUM_FIELDNAME,
                             constants.LABEL_FIELDNAME,
                             constants.NGRAMS_FIELDNAME,
                             constants.NUMBER_FIELDNAME,
                             constants.TOTAL_COUNT_FIELDNAME])
            return

        def witness_summary(group):
            matches = group.sort_values(by=[constants.NGRAM_FIELDNAME],
                                        ascending=[True])
            match = matches.iloc[0]
            ngrams = ', '.join(list(matches[constants.NGRAM_FIELDNAME]))
            match[constants.NGRAMS_FIELDNAME] = ngrams
            match[constants.NUMBER_FIELDNAME] = len(matches)
            match[constants.TOTAL_COUNT_FIELDNAME] = matches[
                constants.COUNT_FIELDNAME].sum()
            return match

        group_cols = [constants.WORK_FIELDNAME, constants.SIGLUM_FIELDNAME]
        # Remove zero-count results.
        self._matches = self._matches[
            self._matches[constants.COUNT_FIELDNAME] != 0]
        self._matches = self._matches.groupby(group_cols, sort=False).apply(
            witness_summary)
        del self._matches[constants.NGRAM_FIELDNAME]
        del self._matches[constants.SIZE_FIELDNAME]
        del self._matches[constants.COUNT_FIELDNAME]