Get usrgos in a requested section.
6381
def get_usrgos_g_section(self, section=None):
        """"""
        if section is None:
            section = self.hdrobj.secdflt
        if section is True:
            return self.usrgos
        # Get dict of sections and hdrgos actually used in grouping
        section2hdrgos = cx.OrderedDict(self.get_sections_2d())
        hdrgos_lst = section2hdrgos.get(section, None)
        if hdrgos_lst is not None:
            hdrgos_set = set(hdrgos_lst)
            hdrgos_u = hdrgos_set.intersection(self.hdrgo_is_usrgo)
            hdrgos_h = hdrgos_set.intersection(self.hdrgo2usrgos.keys())
            usrgos = set([u for h in hdrgos_h for u in self.hdrgo2usrgos.get(h)])
            usrgos |= hdrgos_u
            return usrgos
        return set()
1264426
def get_section_by_offset(self, offset):
        """"""

        sections = [s for s in self.sections if s.contains_offset(offset)]

        if sections:
            return sections[0]

        return None
868877
def get_sections_for_student(id, opts = {})
      data, _status_code, _headers = get_sections_for_student_with_http_info(id, opts)
      return data
    end
650692
def get_sections_for_course(id, opts = {})
      data, _status_code, _headers = get_sections_for_course_with_http_info(id, opts)
      return data
    end
744608
def items(self, section=None):
        """"""
        if not section and self.section:
            section = self.section
        config = self.config.get(section, {}) if section else self.config
        return config.items()
247862
def keys(self, section=None):
        """"""
        if not section and self.section:
            section = self.section
        config = self.config.get(section, {}) if section else self.config
        return config.keys()
221177
def _prt_py_section(self, prt, section_name, ntgos):
        """"""
        prt.write('    ("{SEC}", [ # {N} GO-headers\n'.format(SEC=section_name, N=len(ntgos)))
        self.prt_ntgos(prt, ntgos)
        prt.write("    ]),\n")
994257
def keys(cls, section=None):
        """"""
        section = section or cls._default_sect
        if section not in cls._conf:
            cls._load(section=section)
        return cls._conf[section].keys()
460226
def get_section2usrnts(self):
        """"""
        sec_nts = []
        for section_name, _ in self.get_sections_2d():
            usrgos = self.get_usrgos_g_section(section_name)
            sec_nts.append((section_name, [self.go2nt.get(u) for u in usrgos]))
        return cx.OrderedDict(sec_nts)
611232
def summarize_sec2hdrgos(self, sec2d_hdrgos):
        """"""
        hdrgos_all = set([])
        hdrgos_grouped = set()
        hdrgos_ungrouped = set()
        sections_grouped = set()
        for sectionname, hdrgos in sec2d_hdrgos:
            self._chk_hdrgoids(hdrgos)
            hdrgos_all.update(hdrgos)
            if sectionname != HdrgosSections.secdflt:
                hdrgos_grouped.update(hdrgos)
                sections_grouped.add(sectionname)
            else:
                hdrgos_ungrouped.update(hdrgos)
        return {'G': hdrgos_grouped,
                'S': sections_grouped,
                'U': hdrgos_all.difference(hdrgos_grouped)}
734003
def get_mandatory_sections(self):
        """"""
        return [s for s in self.opt
                if s not in self.optional_sections and
                   s not in self.excluded_sections]
442472
def get_sections(self, section_name):
        
        sections = []
        for timer in self.timers():
            for sect in timer.sections:
                if sect.name == section_name:
                    sections.append(sect)
                    break
            else:
                sections.append(AbinitTimerSection.fake())

        return sections
1341654
def generate_sections(self):
        """"""
        authors = Dataset.objects.values(
            'uploaded_by'
        ).annotate(
            upload_count=Count(
                'uploaded_by'
            )
        ).order_by('-upload_count')

        email_name_map = grab_names_from_emails(
            [row['uploaded_by'] for row in authors]
        )

        for author in authors:
            for emailKey in email_name_map:
                if author['uploaded_by'] == emailKey:
                    author['name'] = email_name_map[emailKey]

        return [
            {
                'slug': author['uploaded_by'],
                'name': author['name'],
                'count': author['upload_count']

            }
            for author in authors
        ]
326299
def plot_sections(self, fout_dir=".", **kws_pltargs):
        """"""
        hdrgos = self.grprobj.hdrobj.get_section_hdrgos()
        pltargs = PltGroupedGosArgs(self.grprobj, fout_dir=fout_dir, **kws_pltargs)
        return self._plot_groups_hdrgos(hdrgos, pltargs)
130841
def get(self, section, option, default = None):
  """"""
  if self.has_section(section):
   try:
    return self.config[section][option].get('value', None)
   except KeyError:
    if default == None:
     raise NoOptionError(option)
    else:
     return default
  else:
   raise NoSectionError(section)
516508
def get_students_for_section(id, opts = {})
      data, _status_code, _headers = get_students_for_section_with_http_info(id, opts)
      return data
    end
694360
def get_section2items(self, itemkey):
        """"""
        sec_items = []
        section2usrnts = self.get_section2usrnts()
        for section, usrnts in section2usrnts.items():
            items = set([e for nt in usrnts for e in getattr(nt, itemkey, set())])
            sec_items.append((section, items))
        return cx.OrderedDict(sec_items)