Prints a dictionary with one indentation level
439424
def _pprint(dic):
    """"""
    for key, value in dic.items():
        print("        {0}: {1}".format(key, value))
117777
def _pprint_features_dict(features_dict, indent=0, add_prefix=True):
  """"""
  first_last_indent_str = " " * indent
  indent_str = " " * (indent + 4)
  first_line = "%s%s({" % (
      first_last_indent_str if add_prefix else "",
      type(features_dict).__name__,
  )
  lines = [first_line]
  for k in sorted(list(features_dict.keys())):
    v = features_dict[k]
    if isinstance(v, tfds.features.FeaturesDict):
      v_str = _pprint_features_dict(v, indent + 4, False)
    else:
      v_str = str(v)
    lines.append("%s'%s': %s," % (indent_str, k, v_str))
  lines.append("%s})" % first_last_indent_str)
  return "\n".join(lines)
993335
def _print_level(level, msg):
    """"""
    for l in str(msg.rstrip()).split("\n"):
        print("{0:<9s}{1}".format(level, str(l)))
1004224
def pretty_print(ast, indent_str='  '):
    

    return ''.join(chunk.text for chunk in pretty_printer(indent_str)(ast))
268007
def dump(self, indentlevel=0, target=sys.stdout):
        
        self.__print(self, indentlevel, target=target)
        indentlevel += 4
        if self.has_arguments():
            for arg in self.args_definition:
                if not arg["name"] in self.arguments:
                    continue
                value = self.arguments[arg["name"]]
                atype = arg["type"]
                if "tag" in atype:
                    self.__print(str(value), indentlevel, target=target)
                    if arg["name"] in self.extra_arguments:
                        value = self.extra_arguments[arg["name"]]
                        atype = arg["extra_arg"]["type"]
                    else:
                        continue
                if type(value) == list:
                    if self.__get_arg_type(arg["name"]) == ["testlist"]:
                        for t in value:
                            t.dump(indentlevel, target)
                    else:
                        self.__print("[" + (",".join(value)) + "]",
                                     indentlevel, target=target)
                    continue
                if isinstance(value, Command):
                    value.dump(indentlevel, target)
                    continue
                self.__print(str(value), indentlevel, target=target)
        for ch in self.children:
            ch.dump(indentlevel, target)
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')
      }
    }
977874
function printNodes(node, indent) {
  indent = indent || 0;

  print(node.typename + ': ', indent);

  if (node instanceof NodeList) {
    print('\n');
    node.children.forEach((n) => {
      printNodes(n, indent + 2);
    });
  } else if (node instanceof CallExtension) {
    print(`${node.extName}.${node.prop}\n`);

    if (node.args) {
      printNodes(node.args, indent + 2);
    }

    if (node.contentArgs) {
      node.contentArgs.forEach((n) => {
        printNodes(n, indent + 2);
      });
    }
  } else {
    let nodes = [];
    let props = null;

    node.iterFields((val, fieldName) => {
      if (val instanceof Node) {
        nodes.push([fieldName, val]);
      } else {
        props = props || {};
        props[fieldName] = val;
      }
    });

    if (props) {
      print(JSON.stringify(props, null, 2) + '\n', null, true);
    } else {
      print('\n');
    }

    nodes.forEach(([fieldName, n]) => {
      print(`[${fieldName}] =>`, indent + 2);
      printNodes(n, indent + 4);
    });
  }
}
275473
def print_tree(self, indent=2):
        
        config.LOGGER.info("{indent}{data}".format(indent="   " * indent, data=str(self)))
        for child in self.children:
            child.print_tree(indent + 1)
180379
def print_tree(current_node, childattr='children', nameattr='name', indent='', last='updown'):

    if hasattr(current_node, nameattr):
        name = lambda node: getattr(node, nameattr)
    else:
        name = lambda node: str(node)

    children = lambda node: getattr(node, childattr)
    nb_children = lambda node: sum(nb_children(child) for child in children(node)) + 1
    size_branch = {child: nb_children(child) for child in children(current_node)}

    
    up = sorted(children(current_node), key=lambda node: nb_children(node))
    down = []
    while up and sum(size_branch[node] for node in down) < sum(size_branch[node] for node in up):
        down.append(up.pop())

    """ Printing of "up" branch. """
    for child in up:     
        next_last = 'up' if up.index(child) is 0 else ''
        next_indent = '{0}{1}{2}'.format(indent, ' ' if 'up' in last else '│', ' ' * len(name(current_node)))
        print_tree(child, childattr, nameattr, next_indent, next_last)

    """ Printing of current node. """
    if last == 'up': start_shape = '┌'
    elif last == 'down': start_shape = '└'
    elif last == 'updown': start_shape = ' '
    else: start_shape = '├'

    if up: end_shape = '┤'
    elif down: end_shape = '┐'
    else: end_shape = ''

    print('{0}{1}{2}{3}'.format(indent, start_shape, name(current_node), end_shape))

    """ Printing of "down" branch. """
    for child in down:
        next_last = 'down' if down.index(child) is len(down) - 1 else ''
        next_indent = '{0}{1}{2}'.format(indent, ' ' if 'down' in last else '│', ' ' * len(name(current_node)))
        print_tree(child, childattr, nameattr, next_indent, next_last)
171114
def pprint(data, indent=0, end='\n'):
    
    if isinstance(data, dict):
        print('{')
        new_indent = indent + 4
        space = ' ' * new_indent
        keys = list(sorted(data.keys()))
        for i, k in enumerate(keys):
            print(space, json.dumps(k), ': ', sep='', end='')
            pprint(data[k], new_indent,
                   end=',\n' if i < len(keys) - 1 else '\n')
        print(' ' * indent, '}', sep='', end=end)
    elif isinstance(data, list):
        if any(isinstance(x, (dict, list)) for x in data):
            print('[')
            new_indent = indent + 4
            space = ' ' * new_indent
            for i, x in enumerate(data):
                print(space, end='')
                pprint(x, new_indent,
                       end=',\n' if i < len(data) - 1 else '\n')
            print(' ' * indent, ']', sep='', end=end)
        else:
            print(json.dumps(data), end=end)
    else:
        print(json.dumps(data), end=end)
866032
def __print_table(table):
        """"""

        col_width = [max(len(x) for x in col) for col in zip(*table)]
        print("| " + " | ".join("{:{}}".format(x, col_width[i])
                                for i, x in enumerate(table[0])) + " |")
        print("| " + " | ".join("{:{}}".format('-' * col_width[i], col_width[i])
                                for i, x in enumerate(table[0])) + " |")
        for line in table[1:]:
            print("| " + " | ".join("{:{}}".format(x, col_width[i])
                                    for i, x in enumerate(line)) + " |")
848988
def _write_ini(source_dict, namespace_name=None, level=0, indent_size=4,
                   output_stream=sys.stdout):
        """"""
        options = [
            value
            for value in source_dict.values()
            if isinstance(value, Option)
        ]
        options.sort(key=lambda x: x.name)
        indent_spacer = " " * (level * indent_size)
        for an_option in options:
            print("%s# %s" % (indent_spacer, an_option.doc),
                  file=output_stream)
            option_value = to_str(an_option)

            if an_option.reference_value_from:
                print(
                    '%s# see "%s.%s" for the default or override it here' % (
                        indent_spacer,
                        an_option.reference_value_from,
                        an_option.name
                    ),
                    file=output_stream
                )

            if an_option.likely_to_be_changed or an_option.has_changed:
                option_format = '%s%s=%s\n'
            else:
                option_format = '%s#%s=%s\n'

            if isinstance(option_value, six.string_types) and \
                    ',' in option_value:
                # quote lists unless they're already quoted
                if option_value[0] not in '\'"':
                    option_value = '"%s"' % option_value

            print(option_format % (indent_spacer, an_option.name,
                                   option_value),
                  file=output_stream)
        next_level = level + 1
        namespaces = [
            (key, value)
            for key, value in source_dict.items()
            if isinstance(value, Namespace)
        ]
        namespaces.sort(key=ValueSource._namespace_reference_value_from_sort)
        for key, namespace in namespaces:
            next_level_spacer = " " * next_level * indent_size
            print("%s%s%s%s\n" % (indent_spacer, "[" * next_level, key,
                                  "]" * next_level),
                  file=output_stream)
            if namespace._doc:
                print("%s%s" % (next_level_spacer, namespace._doc),
                      file=output_stream)
            if namespace._reference_value_from:
                print("%s#+include ./common_%s.ini\n"
                      % (next_level_spacer, key), file=output_stream)

            if namespace_name:
                ValueSource._write_ini(
                    source_dict=namespace,
                    namespace_name="%s.%s" % (namespace_name, key),
                    level=level+1,
                    indent_size=indent_size,
                    output_stream=output_stream
                )
            else:
                ValueSource._write_ini(
                    source_dict=namespace,
                    namespace_name=key,
                    level=level+1,
                    indent_size=indent_size,
                    output_stream=output_stream
                )
164856
function printNodes(node, indent) {
    indent = indent || 0;

    // This is hacky, but this is just a debugging function anyway
    function print(str, indent, inline) {
        var lines = str.split('\n');

        for(var i=0; i<lines.length; i++) {
            if(lines[i]) {
                if((inline && i > 0) || !inline) {
                    for(var j=0; j<indent; j++) {
                        process.stdout.write(' ');
                    }
                }
            }

            if(i === lines.length-1) {
                process.stdout.write(lines[i]);
            }
            else {
                process.stdout.write(lines[i] + '\n');
            }
        }
    }

    print(node.typename + ': ', indent);

    if(node instanceof NodeList) {
        print('\n');
        lib.each(node.children, function(n) {
            printNodes(n, indent + 2);
        });
    }
    else if(node instanceof CallExtension) {
        print(node.extName + '.' + node.prop);
        print('\n');

        if(node.args) {
            printNodes(node.args, indent + 2);
        }

        if(node.contentArgs) {
            lib.each(node.contentArgs, function(n) {
                printNodes(n, indent + 2);
            });
        }
    }
    else {
        var nodes = null;
        var props = null;

        node.iterFields(function(val, field) {
            if(val instanceof Node) {
                nodes = nodes || {};
                nodes[field] = val;
            }
            else {
                props = props || {};
                props[field] = val;
            }
        });

        if(props) {
            print(JSON.stringify(props, null, 2) + '\n', null, true);
        }
        else {
            print('\n');
        }

        if(nodes) {
            for(var k in nodes) {
                printNodes(nodes[k], indent + 2);
            }
        }

    }
}
685519
def alphadump(d, indent=2, depth=0):
    
    sep = '\n' + ' ' * depth * indent
    return ''.join(
        ("{}: {}{}".format(
            k,
            alphadump(d[k], depth=depth+1) if isinstance(d[k], dict)
            else str(d[k]),
            sep)
         for k in sorted(d.keys()))
    )
15485
@Override
    void dump_i(final int indent_level) {
	for (int i = 0; i < indent_level; i++) {
	    System.out.print("  ");
	}
	System.out.println("|- Group: " + get_name() + " [" + get_size_i(true) + ":" + get_size_i(false) + "]");
	final Iterator it = elements.iterator();
	while (it.hasNext()) {
	    ((GroupElement) it.next()).dump_i(indent_level + 1);
	}
    }
1178323
def print_schemas(self):
        '''
        
        '''
        self.indent_depth += 1
        for i in self.definitions:
            def_name = i.split('/')[-1]
            self.write('.. _{}:'.format(def_name))
            self.write('')
            self.write('{} Schema'.format(def_name))
            self.write('{}'.format('`' * (len(def_name) + 7)))
            self.write('')
            self.write('.. code-block:: json', self.indent_depth)
            self.indent_depth += 1
            self.write('')
            self.definition_rst(def_name)
            self.indent_depth -= 1
            self.write('')
            self.write('')
        self.indent_depth -= 1
742018
private void print(Config config, int indent)
  {
    for(int i = 0; i < indent; ++i) {
      System.out.print("\t");
    }
    System.out.print(config.name);
    System.out.print("\r\n");

    for(Config child : config.children) {
      print(child, indent + 1);
    }
  }