Structured nested print of the object to the given stream.

        The print-out is eval()able to reconstruct the object.
176396
def print_nested(self, stream=None, level=0, indent="    ", prefix="", first_level_indent=True, trailer="", print_doc=True, first_line_suffix=""):
        """"""
        import sys
        stream = stream or sys.stdout

        stream.write(
            ((prefix + level * indent) if first_level_indent else "")
            + "{}.{}(".format(self.__class__.__module__, self.__class__.__name__)
            + first_line_suffix
            + "\n"
        )
        for name, value in self._repr_items:
            val = getattr(self, name)
            if print_doc and not name.startswith("_"):
                docstring = self._fields[name]._inline_doc_comment(val)
            else:
                docstring = ""
            if not hasattr(getattr(val, 'print_nested', None), '__call__'):
                stream.write(
                    (prefix + (level + 1) * indent) + "{} = {!r},{}\n".format(name, val, docstring)
                )
            else:
                stream.write(
                    (prefix + (level + 1) * indent) + "{} = ".format(name)
                )
                val.print_nested(stream=stream, level=level + 2, indent=indent, prefix=prefix, first_level_indent=False, trailer=",", print_doc=print_doc,
                                 first_line_suffix=docstring)
        stream.write((prefix + level * indent) + "){}\n".format(trailer))
681725
def printable(object)
      case object
      when Array  then :array
      when Hash   then :hash
      when File   then :file
      when Dir    then :dir
      when Struct then :struct
      else object.class.to_s.gsub(/:+/, "_").downcase.to_sym
      end
    end
930593
def _printout(self, data, output):
        '''
        
        '''
        opts = {'extension_modules': '', 'color': False}
        try:
            printout = salt.output.get_printout(output, opts)(data)
            if printout is not None:
                return printout.rstrip()
        except (KeyError, AttributeError, TypeError) as err:
            log.debug(err, exc_info=True)
            try:
                printout = salt.output.get_printout('nested', opts)(data)
                if printout is not None:
                    return printout.rstrip()
            except (KeyError, AttributeError, TypeError) as err:
                log.debug(err, exc_info=True)
                printout = salt.output.get_printout('raw', opts)(data)
                if printout is not None:
                    return printout.rstrip()

        return salt.output.try_printout(data, output, opts)
158665
private synchronized PrintStream getPrintStream(long numNewChars, String header) {
        switch (currentStatus) {
            case INIT:
                return createStream(header);
            case ACTIVE:
                if (maxFileSizeBytes > 0) {
                    long bytesWritten = currentCountingStream.count();

                    // Replace the stream if the size is or will likely be
                    // exceeded.  We're estimating one byte per char, which is
                    // only accurate for single-byte character sets.  That's
                    // fine: if a multi-byte character set is being used and
                    // we underestimate the number of bytes that will be
                    // written, we'll roll the log next time
                    if (bytesWritten + numNewChars > maxFileSizeBytes) {
                        return createStream(header);

                    }
                }
                break;
        }

        return currentPrintStream;
    }
1108463
def print_subcommands(data, nested_content, markDownHelp=False, settings=None):
    

    definitions = map_nested_definitions(nested_content)
    items = []
    if 'children' in data:
        subCommands = nodes.section(ids=["Sub-commands:"])
        subCommands += nodes.title('Sub-commands:', 'Sub-commands:')

        for child in data['children']:
            sec = nodes.section(ids=[child['name']])
            sec += nodes.title(child['name'], child['name'])

            if 'description' in child and child['description']:
                desc = [child['description']]
            elif child['help']:
                desc = [child['help']]
            else:
                desc = ['Undocumented']

            # Handle nested content
            subContent = []
            if child['name'] in definitions:
                classifier, s, subContent = definitions[child['name']]
                if classifier == '@replace':
                    desc = [s]
                elif classifier == '@after':
                    desc.append(s)
                elif classifier == '@before':
                    desc.insert(0, s)

            for element in renderList(desc, markDownHelp):
                sec += element
            sec += nodes.literal_block(text=child['bare_usage'])
            for x in print_action_groups(child, nested_content + subContent, markDownHelp,
                                         settings=settings):
                sec += x

            for x in print_subcommands(child, nested_content + subContent, markDownHelp,
                                       settings=settings):
                sec += x

            if 'epilog' in child and child['epilog']:
                for element in renderList([child['epilog']], markDownHelp):
                    sec += element

            subCommands += sec
        items.append(subCommands)

    return items
1041437
def _from_json_array_nested(cls, response_raw):
        

        json = response_raw.body_bytes.decode()
        obj = converter.json_to_class(dict, json)
        value = converter.deserialize(cls, obj[cls._FIELD_RESPONSE])

        return client.BunqResponse(value, response_raw.headers)
1105846
public static String printCollectionAware(final Object object, final boolean printBody) {

        if (!printBody) {
            return PRINT_HIDDEN;
        }

        if (object == null) {
            return String.valueOf(object);
        }

        Class<?> clazz = object.getClass();
        if (!Collection.class.isAssignableFrom(clazz)) {
            return String.valueOf(object);
        }

        return new StringBuilder().append("[<")
                                  .append(clazz.getSimpleName())
                                  .append("> size = ")
                                  .append(Collection.class.cast(object).size()).append("]")
                                  .toString();
    }
364365
def print_object(self, d, h, n, nl=False):
        
        s = []
        cls = d.__class__
        md = d.__metadata__
        if d in h:
            s.append('(')
            s.append(cls.__name__)
            s.append(')')
            s.append('...')
            return ''.join(s)
        h.append(d)
        if nl:
            s.append('\n')
            s.append(self.indent(n))
        if cls != Object:
            s.append('(')
            if isinstance(d, Facade):
                s.append(md.facade)
            else:
                s.append(cls.__name__)
            s.append(')')
        s.append('{')
        for item in d:
            if self.exclude(d, item):
                continue
            item = self.unwrap(d, item)
            s.append('\n')
            s.append(self.indent(n+1))
            if isinstance(item[1], (list, tuple)):
                s.append(item[0])
                s.append('[]')
            else:
                s.append(item[0])
            s.append(' = ')
            s.append(self.process(item[1], h, n, True))
        s.append('\n')
        s.append(self.indent(n))
        s.append('}')
        h.pop()
        return ''.join(s)
224336
function(stream) {
		var exportKey = function(obj, env) {
			var keyString = keyStringGenerator(obj, env);

			if(stream.constElements) {
				if(obj.___jp_originalJsonLine)
					return keyString + separator + obj.___jp_originalJsonLine;
			} else {
				if(obj.___jp_originalJsonLine)
					delete obj.___jp_originalJsonLine;
			}

			return keyString + separator + JSON.stringify(obj);
		};

		return stream.pipe(jp.map(exportKey));
	}
1289121
public Object eval(
        Reader in, NameSpace nameSpace, String sourceFileInfo
            /*, CallStack callstack */ )
        throws EvalError
    {
        Object retVal = null;
        Interpreter.debug("eval: nameSpace = ", nameSpace);

        /*
            Create non-interactive local interpreter for this namespace
            with source from the input stream and out/err same as
            this interpreter.
        */
        Interpreter localInterpreter = new Interpreter(
            in, getOut(), getErr(), false, nameSpace, this, sourceFileInfo  );
        CallStack callstack = new CallStack( nameSpace );

        SimpleNode node = null;
        boolean eof = false;
        while( !eof )
        {
            try
            {
                eof = localInterpreter.readLine();
                if (localInterpreter.get_jjtree().nodeArity() > 0)
                {
                    node = (SimpleNode)localInterpreter.get_jjtree().rootNode();
                    // nodes remember from where they were sourced
                    node.setSourceFile( sourceFileInfo );

                    if ( TRACE )
                        println( "// " +node.getText() );

                    retVal = node.eval( callstack, localInterpreter );

                    // sanity check during development
                    if ( callstack.depth() > 1 )
                        throw new InterpreterError(
                            "Callstack growing: "+callstack);

                    if ( retVal instanceof ReturnControl ) {
                        retVal = ((ReturnControl)retVal).value;
                        break; // non-interactive, return control now
                    }
                }
            } catch(ParseException e) {
                if ( DEBUG.get() )
                    // show extra "expecting..." info
                    error( e.getMessage(DEBUG.get()) );

                // add the source file info and throw again
                e.setErrorSourceFile( sourceFileInfo );
                throw e;
            } catch ( InterpreterError e ) {
                throw new EvalError(
                    "Sourced file: "+sourceFileInfo+" internal Error: "
                    + e.getMessage(), node, callstack, e);
            } catch ( TargetError e ) {
                // failsafe, set the Line as the origin of the error.
                if ( e.getNode()==null )
                    e.setNode( node );
                e.reThrow("Sourced file: "+sourceFileInfo);
            } catch ( EvalError e) {
                if ( DEBUG.get())
                    e.printStackTrace();
                // failsafe, set the Line as the origin of the error.
                if ( e.getNode()==null )
                    e.setNode( node );
                e.reThrow( "Sourced file: "+sourceFileInfo );
            } catch ( Exception e) {
                if ( DEBUG.get())
                    e.printStackTrace();
                throw new EvalError(
                    "Sourced file: "+sourceFileInfo+" unknown error: "
                    + e.getMessage(), node, callstack, e);
            } finally {
                localInterpreter.get_jjtree().reset();

                // reinit the callstack
                if ( callstack.depth() > 1 ) {
                    callstack.clear();
                    callstack.push( nameSpace );
                }
            }
        }
        return Primitive.unwrap( retVal );
    }
656977
def pprint(self, stream=None, indent=1, width=80, depth=None):
    
    pp.pprint(to_literal(self), stream, indent, width, depth)
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()
247963
function Printr(options) {
  options = options || {};
  options.out = options.out || process.stdout;
  options.err = options.err || process.stderr;
  options.prefix = options.prefix || '';
  this.options = options;
}
213988
public static void print(PrintStream self, Object value) {
        self.print(InvokerHelper.toString(value));
    }
593525
def pretty_print(self, obj):
        
        s = repr(obj)
        limit = output_limit()
        if len(s) > limit:
            if self.dom_term:
                s = self.color.py_syntax_highlight(s)
                s = self.dom_term.fold_text_string("", s)
            else:
                s = s[:limit - 3]  # cut before syntax highlighting, to avoid missing color endings
                s = self.color.py_syntax_highlight(s)
                s += "..."
        else:
            s = self.color.py_syntax_highlight(s)
        extra_info = self._pp_extra_info(obj)
        if extra_info != "":
            s += ", " + self.color.py_syntax_highlight(extra_info)
        return s
1367989
def try_printout(data, out, opts, **kwargs):
    '''
    
    '''
    try:
        printout = get_printout(out, opts)(data, **kwargs)
        if printout is not None:
            return printout.rstrip()
    except (KeyError, AttributeError, TypeError):
        log.debug(traceback.format_exc())
        try:
            printout = get_printout('nested', opts)(data, **kwargs)
            if printout is not None:
                return printout.rstrip()
        except (KeyError, AttributeError, TypeError):
            log.error('Nested output failed: ', exc_info=True)
            printout = get_printout('raw', opts)(data, **kwargs)
            if printout is not None:
                return printout.rstrip()
716426
def fprint(self, obj, stream=None, **kwargs):
        """"""
        if stream is None:
            stream = sys.stdout

        options = self.options
        options.update(kwargs)

        if isinstance(obj, dimod.SampleSet):
            self._print_sampleset(obj, stream, **options)
            return

        raise TypeError("cannot format type {}".format(type(obj)))