internal. pprinter for iterables. you should probably use pprint_thing()
    rather then calling this directly.
438704
def _pprint_dict(seq, _nest_lvl=0, max_seq_items=None, **kwds):
    
    fmt = "{{{things}}}"
    pairs = []

    pfmt = "{key}: {val}"

    if max_seq_items is False:
        nitems = len(seq)
    else:
        nitems = max_seq_items or get_option("max_seq_items") or len(seq)

    for k, v in list(seq.items())[:nitems]:
        pairs.append(
            pfmt.format(
                key=pprint_thing(k, _nest_lvl + 1,
                                 max_seq_items=max_seq_items, **kwds),
                val=pprint_thing(v, _nest_lvl + 1,
                                 max_seq_items=max_seq_items, **kwds)))

    if nitems < len(seq):
        return fmt.format(things=", ".join(pairs) + ", ...")
    else:
        return fmt.format(things=", ".join(pairs))
181558
def wrap_iterable(obj):
    
    was_scalar = not isiterable(obj)
    wrapped_obj = [obj] if was_scalar else obj
    return wrapped_obj, was_scalar
923139
def pl (listoflists):
    
    for row in listoflists:
        if row[-1] == '\n':
            print(row, end=' ')
        else:
            print(row)
    return None
230929
def printArray(self, node, printState: PrintState):
        
        if (
            self.nameMapper[node["name"]] not in printState.definedVars
            and self.nameMapper[node["name"]] not in printState.globalVars
        ):
            printState.definedVars += [self.nameMapper[node["name"]]]
            assert int(node["count"]) > 0
            printState.definedVars += [node["name"]]

            varType = ""
            if node["type"].upper() == "INTEGER":
                varType = "int"
            elif node["type"].upper() in ("DOUBLE", "REAL"):
                varType = "float"
            elif node["type"].upper() == "CHARACTER":
                varType = "str"
            elif node["isDevTypeVar"]:
                varType = node["type"].lower() + "()"

            assert varType != ""

            self.pyStrings.append(f"{node['name']} = Array({varType}, [")
            for i in range(0, int(node["count"])):
                loBound = node["low" + str(i + 1)]
                upBound = node["up" + str(i + 1)]
                dimensions = f"({loBound}, {upBound})"
                if i < int(node["count"]) - 1:
                    self.pyStrings.append(f"{dimensions}, ")
                else:
                    self.pyStrings.append(f"{dimensions}")
            self.pyStrings.append("])")

            if node["isDevTypeVar"]:
                self.pyStrings.append(printState.sep)
                # This may require updating later when we have to deal with the
                # multi-dimensional derived type arrays
                upBound = node["up1"]
                self.pyStrings.append(
                    f"for z in range(1, {upBound}+1):" + printState.sep
                )
                self.pyStrings.append(
                    f"    obj = {node['type']}()" + printState.sep
                )
                self.pyStrings.append(
                    f"    {node['name']}.set_(z, obj)" + printState.sep
                )
921607
def py(self, output):
        """"""
        import pprint
        pprint.pprint(output, stream=self.outfile)
653382
def pprint_table(table):
    
    col_paddings = []
    for i in range(len(table[0])):
        col_paddings.append(get_max_width(table,i))
    for row in table:
        print(row[0].ljust(col_paddings[0] + 1), end="")
        for i in range(1, len(row)):
            col = str(row[i]).rjust(col_paddings[i]+2)
            print(col, end='')
        print("\n")
1145046
def repr_list(_list, indent):
    """"""
    # pprint represents lists and tuples in one row if possible. We want one
    # per row, so we iterate ourselves.
    if _list is None:
        return 'None'
    if isinstance(_list, MutableSequence):
        bm = '['
        em = ']'
    elif isinstance(_list, Iterable):
        bm = '('
        em = ')'
    else:
        raise TypeError("Object must be an iterable, but is a %s" %
                        type(_list))
    ret = bm + '\n'
    for value in _list:
        ret += _indent('%r,\n' % value, 2)
    ret += em
    ret = repr_text(ret, indent=indent)
    return ret.lstrip(' ')
1148438
def pprint_arg(vnames, value):
    
    ret = ''
    for name, v in zip(vnames, value):
        ret += '%s=%s;' % (name, str(v))
    return ret;
1142693
def get_printable(iterable):
    
    if iterable:
        return ''.join(i for i in iterable if i in string.printable)
    return ''
1176214
def Print(self):
        """"""
        for val, prob in sorted(self.d.iteritems()):
            print(val, prob)
724881
function (toPrint, indent, indentEnd) {
      if (!indent) {
        indent = '&nbsp;&nbsp;'
      }
      if (!indentEnd) {
        indentEnd = ''
      }
      var s = ''
      var name
      if (toPrint instanceof Object) {
        s = 'Object (\n'
        for (name in toPrint) {
          if (toPrint.hasOwnProperty(name)) {
            s += indent + indent + '[' + name + '] => ' + this.printR(toPrint[name], indent + '&nbsp;&nbsp;', indent + indent)
          }
        }
        s += indentEnd + ')\n'
        return s
      } else if (toPrint instanceof Array) {
        s = 'Array (\n'
        for (name in toPrint) {
          if (toPrint.hasOwnProperty(name)) {
            s += indent + indent + '[' + name + '] => ' + this.printR(toPrint[name], indent + '&nbsp;&nbsp;', indent + indent)
          }
        }
        s += indentEnd + ')\n'
        return s
      } else if (toPrint instanceof Boolean) {
        var bool = 'false'
        if (bool === true) {
          bool = 'true'
        }
        return bool + '\n'
      } else {
        return (toPrint + '\n')
      }
    }
229771
def iterate(it):
    """"""
    if is_async_iterable(it):
        return from_async_iterable.raw(it)
    if isinstance(it, Iterable):
        return from_iterable.raw(it)
    raise TypeError(
        f"{type(it).__name__!r} object is not (async) iterable")
1078487
def cprint_map(text, cmap, **kwargs):
    
    try:
        print(colored_map(text, cmap), **kwargs)
    except TypeError:
        # flush is not supported by py2.7
        kwargs.pop("flush", None)
        print(colored_map(text, cmap), **kwargs)
1238714
def _textOutput(self, gaObjects):
        
        for gaObject in gaObjects:
            if hasattr(gaObject, 'name'):
                print(gaObject.id, gaObject.name, sep="\t")
            else:
                print(gaObject.id, sep="\t")
119706
def _dump(self):
        """"""
        pp = pprint.PrettyPrinter(indent=4)

        print("=== Variables ===")
        print("-- Globals --")
        pp.pprint(self._global)
        print("-- Bot vars --")
        pp.pprint(self._var)
        print("-- Substitutions --")
        pp.pprint(self._sub)
        print("-- Person Substitutions --")
        pp.pprint(self._person)
        print("-- Arrays --")
        pp.pprint(self._array)

        print("=== Topic Structure ===")
        pp.pprint(self._topics)
        print("=== %Previous Structure ===")
        pp.pprint(self._thats)

        print("=== Includes ===")
        pp.pprint(self._includes)

        print("=== Inherits ===")
        pp.pprint(self._lineage)

        print("=== Sort Buffer ===")
        pp.pprint(self._sorted)

        print("=== Syntax Tree ===")
        pp.pprint(self._syntax)
439424
def _pprint(dic):
    """"""
    for key, value in dic.items():
        print("        {0}: {1}".format(key, value))
457118
def format(self, name=False, formatter=None, **kwargs):
        
        header = []
        if name:
            header.append(pprint_thing(self.name,
                                       escape_chars=('\t', '\r', '\n')) if
                          self.name is not None else '')

        if formatter is not None:
            return header + list(self.map(formatter))

        return self._format_with_header(header, **kwargs)