Return print format for Grouper, which includes hdr1usr01 and num_usrgos.
511022
def _init_prtfmt(self, key="fmta"):
        """"""
        prtfmt = self.gosubdag.prt_attr[key]
        return prtfmt.replace("{NS}", "{NS} {hdr1usr01:2} {num_usrgos:>4} uGOs")
629047
def toc_print(self):
        """"""
        res = self.toc()
        for n, k, v in res:
            logging.info('Batch: {:7d} {:30s} {:s}'.format(n, k, v))
1296345
def group_num(self):
        
        xkb_state = XkbStateRec()
        XkbGetState(self._display, XkbUseCoreKbd, byref(xkb_state))
        return xkb_state.group
723995
def format(self, obj, **kwargs):
        """"""
        sio = StringIO()
        self.fprint(obj, stream=sio, **kwargs)
        return sio.getvalue()
848066
def size(self):
        
        result = self.grouper.size()

        if isinstance(self.obj, Series):
            result.name = getattr(self.obj, 'name', None)
        return result
932203
def format_sequence(seq, start=None, end=None, group_size=3):
    

    width = 100
    loc_width = 9
    sep = " "
    body_sep = " : "

    start = start or 0
    end = end or len(seq)

    bw = width - loc_width - len(body_sep)
    assert group_size <= bw, "group size must be less than available line width"
    gpl = int((bw + len(sep)) / (group_size + len(sep)))    # groups per line
    gpl = int(gpl / 5) * 5 if gpl > 20 else gpl
    rpl = group_size * gpl
    line_fmt = "{{l:>{lw}s}}{body_sep}{{body}}".format(lw=loc_width, body_sep=body_sep)
    ge_fmt = "{{ge:>{gs}}}".format(gs=group_size)

    blocks = []
    for ls in range(start, end, rpl):
        le = ls + rpl

        groups = [
            ge_fmt.format(ge=str(gs + group_size)[-group_size + 1:])
            for gs in range(ls, le, group_size)
        ]
        blocks += [line_fmt.format(l="", body=sep.join(groups)) + "\n"]

        groups = [seq[gs:min(gs + group_size, end)] for gs in range(ls, le, group_size)]
        blocks += [line_fmt.format(l=str(ls + 1), body=sep.join(groups)) + "\n"]

        blocks += ["\n"]

    return blocks
1363499
def print_object(self, tobj):
        
        if tobj.death:
            self.stream.write('%-32s ( free )   %-35s\n' % (
                trunc(tobj.name, 32, left=1), trunc(tobj.repr, 35)))
        else:
            self.stream.write('%-32s 0x%08x %-35s\n' % (
                trunc(tobj.name, 32, left=1),
                tobj.id,
                trunc(tobj.repr, 35)
            ))
        if tobj.trace:
            self.stream.write(_format_trace(tobj.trace))
        for (timestamp, size) in tobj.snapshots:
            self.stream.write('  %-30s %s\n' % (
                pp_timestamp(timestamp), pp(size.size)
            ))
            self._print_refs(size.refs, size.size)
        if tobj.death is not None:
            self.stream.write('  %-30s finalize\n' % (
                pp_timestamp(tobj.death),
            ))
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))
439424
def _pprint(dic):
    """"""
    for key, value in dic.items():
        print("        {0}: {1}".format(key, value))
520927
def pformat(
    object,
    indent=_UNSET_SENTINEL,
    width=_UNSET_SENTINEL,
    depth=_UNSET_SENTINEL,
    *,
    ribbon_width=_UNSET_SENTINEL,
    max_seq_len=_UNSET_SENTINEL,
    compact=_UNSET_SENTINEL,
    sort_dict_keys=_UNSET_SENTINEL
):
    
    sdocs = python_to_sdocs(
        object,
        **_merge_defaults(
            indent=indent,
            width=width,
            depth=depth,
            ribbon_width=ribbon_width,
            max_seq_len=max_seq_len,
            sort_dict_keys=sort_dict_keys,
        )
    )
    stream = StringIO()
    default_render_to_stream(stream, sdocs)
    return stream.getvalue()
1178741
def format_op_hdr():
    
    txt = 'Base Filename'.ljust(36) + ' '
    txt += 'Lines'.rjust(7) + ' '
    txt += 'Words'.rjust(7) + '  '
    txt += 'Unique'.ljust(8) + ''
    return txt
644677
def _read_eps_ctr(tomodir):
        
        epsctr_file = tomodir + os.sep + 'inv' + os.sep + 'eps.ctr'
        if not os.path.isfile(epsctr_file):
            print('eps.ctr not found: {0}'.format(epsctr_file))
            print(os.getcwd())
            return 1

        with open(epsctr_file, 'r') as fid:
            lines = fid.readlines()
        group = itertools.groupby(lines, lambda x: x == '\n')
        dfs = []
        # group
        for x in group:
            # print(x)
            if not x[0]:
                data = [y for y in x[1]]
                if data[0].startswith('IT') or data[0].startswith('PIT'):
                    del(data[0])
                data[0] = data[0].replace('-Phase (rad)', '-Phase(rad)')
                tfile = StringIO(''.join(data))
                df = pd.read_csv(
                    tfile,
                    delim_whitespace=True,
                    na_values=['Infinity'],
                )
                dfs.append(df)
        return dfs
123942
def PrintGroup(name, codes):
  """"""

  # See unicode_groups.h for a description of the data structure.

  # Split codes into 16-bit ranges and 32-bit ranges.
  range16 = MakeRanges([c for c in codes if c < 65536])
  range32 = MakeRanges([c for c in codes if c >= 65536])

  # Pull singleton ranges out of range16.
  # code16 = [lo for lo, hi in range16 if lo == hi]
  # range16 = [[lo, hi] for lo, hi in range16 if lo != hi]

  global n16
  global n32
  n16 += len(range16)
  n32 += len(range32)

  ugroup = "{ \"%s\", +1" % (name,)
  # if len(code16) > 0:
  #   PrintCodes("uint16", name+"_code16", code16)
  #   ugroup += ", %s_code16, %d" % (name, len(code16))
  # else:
  #   ugroup += ", 0, 0"
  if len(range16) > 0:
    PrintRanges("URange16", name+"_range16", range16)
    ugroup += ", %s_range16, %d" % (name, len(range16))
  else:
    ugroup += ", 0, 0"
  if len(range32) > 0:
    PrintRanges("URange32", name+"_range32", range32)
    ugroup += ", %s_range32, %d" % (name, len(range32))
  else:
    ugroup += ", 0, 0"
  ugroup += " }"
  return ugroup
302248
def str_numerator(self):
        """"""
        unit_numerator, unit = UnitByte(self.numerator).auto_no_thousands
        if unit_numerator >= 10:
            formatter = '%d'
        else:
            formatter = '%0.1f'
        return '{0} {1}'.format(locale.format(formatter, unit_numerator, grouping=False), unit)
702720
def _get_plt_data(self, hdrgos_usr):
        """"""
        hdrgo2usrgos = self.grprobj.get_hdrgo2usrgos(hdrgos_usr)
        usrgos_actual = set([u for us in hdrgo2usrgos.values() for u in us])
        go2obj = self.gosubdag.get_go2obj(usrgos_actual.union(hdrgo2usrgos.keys()))
        return hdrgo2usrgos, go2obj
749704
def args(self) -> str:
        """"""
        return '{}{}'.format(
            to_ascii_hex(self._group_number, 2),
            to_ascii_hex(self._unit_number, 2))
459716
def _print_returns_summary(self, ret):
        '''
        
        '''
        return_counter = 0
        not_return_counter = 0
        not_return_minions = []
        not_response_minions = []
        not_connected_minions = []
        failed_minions = []
        for each_minion in ret:
            minion_ret = ret[each_minion]
            if isinstance(minion_ret, dict) and 'ret' in minion_ret:
                minion_ret = ret[each_minion].get('ret')
            if (
                    isinstance(minion_ret, six.string_types)
                    and minion_ret.startswith("Minion did not return")
                    ):
                if "Not connected" in minion_ret:
                    not_connected_minions.append(each_minion)
                elif "No response" in minion_ret:
                    not_response_minions.append(each_minion)
                not_return_counter += 1
                not_return_minions.append(each_minion)
            else:
                return_counter += 1
                if self._get_retcode(ret[each_minion]):
                    failed_minions.append(each_minion)
        salt.utils.stringutils.print_cli('\n')
        salt.utils.stringutils.print_cli('-------------------------------------------')
        salt.utils.stringutils.print_cli('Summary')
        salt.utils.stringutils.print_cli('-------------------------------------------')
        salt.utils.stringutils.print_cli('# of minions targeted: {0}'.format(return_counter + not_return_counter))
        salt.utils.stringutils.print_cli('# of minions returned: {0}'.format(return_counter))
        salt.utils.stringutils.print_cli('# of minions that did not return: {0}'.format(not_return_counter))
        salt.utils.stringutils.print_cli('# of minions with errors: {0}'.format(len(failed_minions)))
        if self.options.verbose:
            if not_connected_minions:
                salt.utils.stringutils.print_cli('Minions not connected: {0}'.format(" ".join(not_connected_minions)))
            if not_response_minions:
                salt.utils.stringutils.print_cli('Minions not responding: {0}'.format(" ".join(not_response_minions)))
            if failed_minions:
                salt.utils.stringutils.print_cli('Minions with failures: {0}'.format(" ".join(failed_minions)))
        salt.utils.stringutils.print_cli('-------------------------------------------')