Read HLAs and the pgroups they fall in.
422018
def read_pgroups(in_file):
    
    out = {}
    with open(in_file) as in_handle:
        for line in (l for l in in_handle if not l.startswith("#")):
            locus, alleles, group = line.strip().split(";")
            for allele in alleles.split("/"):
                out["HLA-%s%s" % (locus, allele)] = group
    return out
1227074
def getreadergroups(self):
        
        innerreadergroups.getreadergroups(self)

        hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER)
        if hresult != 0:
            raise EstablishContextException(hresult)
        hresult, readers = SCardListReaderGroups(hcontext)
        if hresult != 0:
            raise ListReadersException(hresult)
        hresult = SCardReleaseContext(hcontext)
        if hresult != 0:
            raise ReleaseContextException(hresult)
        return readers
76933
private void readNextGroup() {
    try {
      int header = readUnsignedVarInt();
      this.mode = (header & 1) == 0 ? MODE.RLE : MODE.PACKED;
      switch (mode) {
        case RLE:
          this.currentCount = header >>> 1;
          this.currentValue = readIntLittleEndianPaddedOnBitWidth();
          return;
        case PACKED:
          int numGroups = header >>> 1;
          this.currentCount = numGroups * 8;

          if (this.currentBuffer.length < this.currentCount) {
            this.currentBuffer = new int[this.currentCount];
          }
          currentBufferIdx = 0;
          int valueIndex = 0;
          while (valueIndex < this.currentCount) {
            // values are bit packed 8 at a time, so reading bitWidth will always work
            ByteBuffer buffer = in.slice(bitWidth);
            this.packer.unpack8Values(buffer, buffer.position(), this.currentBuffer, valueIndex);
            valueIndex += 8;
          }
          return;
        default:
          throw new ParquetDecodingException("not a valid mode " + this.mode);
      }
    } catch (IOException e) {
      throw new ParquetDecodingException("Failed to read from input stream", e);
    }
  }
500390
def get_grouped(self, go_ntsets, go_all, gosubdag, **kws):
        """"""
        kws_grpd = {k:v for k, v in kws.items() if k in Grouped.kws_dict}
        kws_grpd['go2nt'] = self._init_go2ntpresent(go_ntsets, go_all, gosubdag)
        return Grouped(gosubdag, self.godag.version, **kws_grpd)
863399
function processGroupsKeys(){
				var GroupsKeys = [];

				module.groups.forEach(function(table){
					GroupsKeys.push({
						value: table.get('id'),
						text: table.get('name'),
					});
				});

				module.GroupsKeys = GroupsKeys;
			}
748343
def load_entry_point_group(self, entry_point_group):
        """"""
        for ep in pkg_resources.iter_entry_points(group=entry_point_group):
            self.register(ep.name, ep.load())
918970
def fix_groups(groups):
    """"""
    _groups = []
    for g in groups:
        try:
            if not float(g) > 0:
                _groups.append(1000)
            else:
                _groups.append(int(g))
        except TypeError as e:
            logging.info("Error in reading group number (check your db)")
            logging.debug(g)
            logging.debug(e)
            _groups.append(1000)
    return _groups
1281697
def _Members(self, group):
    """"""
    group.members = set(group.members).union(self.gids.get(group.gid, []))
    return group
721746
def group(self):
        """"""
        if hasattr(self, 'group_by'):
            group_by = self.group_by
        else:
            group_by = self.default_group_by
            if self.args['group'] is not None:
                group_by = self.args['group']

        self.groups = Grouping(self.logevents, group_by)
        self.groups.move_items(None, 'others')
        self.groups.sort_by_size(group_limit=self.args['group_limit'],
                                 discard_others=self.args['no_others'])
1064056
def athalianatruth(args):
    
    p = OptionParser(athalianatruth.__doc__)
    opts, args = p.parse_args(args)

    if len(args) != 2:
        sys.exit(not p.print_help())

    atxt, bctxt = args
    g = Grouper()
    pairs = set()
    for txt in (atxt, bctxt):
        extract_groups(g, pairs, txt)

    fw = open("pairs", "w")
    for pair in sorted(pairs):
        print("\t".join(pair), file=fw)
    fw.close()

    fw = open("groups", "w")
    for group in list(g):
        print(",".join(group), file=fw)
    fw.close()
1049139
function findBookFromGroups (book) {
        if (book) {
          return book
        }
        var g
        for (let gu in selectedGroups) {
          g = kb.sym(gu)
          let b = kb.any(undefined, ns.vcard('includesGroup'), g)
          if (b) return b
        }
        throw new Error('findBookFromGroups: Cant find address book which this group is part of')
      }
549835
def group_lines(lines):
    """"""
    groups = []
    group = []

    for line in lines:
        if line.strip() == "":
            groups.append(group[:])
            group = []
            continue
        group.append(line)

    if group:
        groups.append(group[:])

    return groups
1256088
def group(self):
        ""
        if self.main and self.main.group != type(self.main).__name__:
            return self.main.group
        else:
            return 'AdjointLayout'
709138
def parse_group(cls, group, lines, dist=None):
        """"""
        if not MODULE(group):
            raise ValueError("Invalid group name", group)
        this = {}
        for line in yield_lines(lines):
            ep = cls.parse(line, dist)
            if ep.name in this:
                raise ValueError("Duplicate entry point", group, ep.name)
            this[ep.name] = ep
        return this
741005
def rectify_pgroups(self):
        
        # add any parameters groups
        pdata_groups = list(self.parameter_data.loc[:,"pargp"].\
            value_counts().keys())
        #print(pdata_groups)
        need_groups = []
        existing_groups = list(self.parameter_groups.pargpnme)
        for pg in pdata_groups:
            if pg not in existing_groups:
                need_groups.append(pg)
        if len(need_groups) > 0:
            #print(need_groups)
            defaults = copy.copy(pst_utils.pst_config["pargp_defaults"])
            for grp in need_groups:
                defaults["pargpnme"] = grp
                self.parameter_groups = \
                    self.parameter_groups.append(defaults,ignore_index=True)

        # now drop any left over groups that aren't needed
        for gp in self.parameter_groups.loc[:,"pargpnme"]:
            if gp in pdata_groups and gp not in need_groups:
                need_groups.append(gp)
        self.parameter_groups.index = self.parameter_groups.pargpnme
        self.parameter_groups = self.parameter_groups.loc[need_groups,:]
911601
def _prt_read_msg(self, prt, fin_txt, exclude_ungrouped):
        """"""
        if self.sections_seen or exclude_ungrouped:
            # dat = Grouper.get_summary_data(self.section2goids.items(), HdrgosSections.secdflt)
            dat = SummarySec2dHdrGos().summarize_sec2hdrgos(self.section2goids.items())
            sys.stdout.write(Grouper.fmtsum.format(
                GO_DESC='hdr', SECs=len(dat['S']), GOs=len(dat['G']),
                UNGRP="N/A", undesc="unused", ACTION="READ: ", FILE=fin_txt))
        elif self.goids_fin:
            prt.write("  {G} GO IDs READ: {FIN}\n".format(G=len(self.goids_fin), FIN=fin_txt))
1105227
def groups(self):
        """"""
        self._prep_pandas_groupby()

        def extract_group_labels(frame):
            return (frame[0], frame[1].index.values)

        return self._mergedRDD.map(extract_group_labels).collectAsMap()