Pretty-print instance data
767697
def show(self):
        
        if not self.data:
            return

        if self.data.get('continue'):
            return

        ptitle = self.params.get('title')
        dtitle = self.data.get('title')
        pageid = self.params.get('pageid')

        seed = dtitle or ptitle or pageid
        if utils.is_text(seed):
            seed = seed.replace('_', ' ')

        prettyprint(self._build_showstr(seed))
133276
protected static String prettyPrint(Object obj){
		StringBuilder sb = new StringBuilder();
		if (obj == null){
			sb.append("NULL");
		} else 	if (obj instanceof Blob){
			sb.append(formatLogParam((Blob)obj));
		} else if (obj instanceof Clob){
			sb.append(formatLogParam((Clob)obj));
		} else if (obj instanceof Ref){
			sb.append(formatLogParam((Ref)obj));
		} else if (obj instanceof Array){
			sb.append(formatLogParam((Array)obj));
		} else if (obj instanceof String || obj instanceof Date){
			sb.append("'" + obj.toString()+"'");
		} else {
			sb.append(obj.toString());
		}
		return sb.toString();
	}
53384
def pretty_print(pp)
      return super if custom_inspect_method_defined?
      pp.object_address_group(self) do
        if defined?(@attributes) && @attributes
          attr_names = self.class.attribute_names.select { |name| has_attribute?(name) }
          pp.seplist(attr_names, proc { pp.text "," }) do |attr_name|
            pp.breakable " "
            pp.group(1) do
              pp.text attr_name
              pp.text ":"
              pp.breakable
              value = _read_attribute(attr_name)
              value = inspection_filter.filter_param(attr_name, value) unless value.nil?
              pp.pp value
            end
          end
        else
          pp.breakable " "
          pp.text "not initialized"
        end
      end
    end
1274066
def print_data(data):
    
    print(", ".join(["{}=>{}".format(key, value) for key, value in data]))
683696
def pformat(object, indent=1, width=80, depth=None):
    """"""
    return PrettyPrinter(indent=indent, width=width, depth=depth).pformat(object)
1322095
def print_one_train(client, verbosity=0):
    
    ts_before = time()
    data, meta = client.next()
    ts_after = time()

    if not data:
        print("Empty data")
        return

    train_id = list(meta.values())[0].get('timestamp.tid', 0)
    print("Train ID:", train_id, "--------------------------")
    delta = ts_after - ts_before
    print('Data from {} sources, REQ-REP took {:.2f} ms'
          .format(len(data), delta))
    print()

    for i, (source, src_data) in enumerate(sorted(data.items()), start=1):
        src_metadata = meta.get(source, {})
        tid = src_metadata.get('timestamp.tid', 0)
        print("Source {}: {!r} @ {}".format(i, source, tid))
        try:
            ts = src_metadata['timestamp']
        except KeyError:
            print("No timestamp")
        else:
            dt = strftime('%Y-%m-%d %H:%M:%S', localtime(ts))

            delay = (ts_after - ts) * 1000
            print('timestamp: {} ({}) | delay: {:.2f} ms'
                  .format(dt, ts, delay))

        if verbosity < 1:
            print("- data:", sorted(src_data))
            print("- metadata:", sorted(src_metadata))
        else:
            print('data:')
            pretty_print(src_data, verbosity=verbosity - 1)
            if src_metadata:
                print('metadata:')
                pretty_print(src_metadata)
        print()

    return data, meta
436258
def prnt(self):
        
        print("= = = =\n\n%s object key: \033[32m%s\033[0m" % (self.__class__.__name__, self.key))
        pprnt(self._data or self.clean_value())
1217511
def pretty_print_device(device):
    """"""
    logging.info('Device Instance ID: %s' % device['id'])
    if 'nickname' in device:
        logging.info('    Nickname: %s' % device['nickname'])
    if 'modelId' in device:
        logging.info('    Model: %s' % device['modelId'])
    logging.info('')
1022663
def pretty_print(self):
        """"""
        pt = PrettyTable()
        if len(self) == 0:
            pt._set_field_names(['Sorry,'])
            pt.add_row([TRAIN_NOT_FOUND])
        else:
            pt._set_field_names(self.headers)
            for train in self.trains:
                pt.add_row(train)
        print(pt)
283267
def pretty_print(self, obj=None):
        
        print(self.pretty(obj if obj is not None else self.obj))
1307202
def json_pretty_print(s):
    ''''''
    s = json.loads(s)
    return json.dumps(s,
                      sort_keys=True,
                      indent=4,
                      separators=(',', ': '))
51722
def prettyPrintDictionary(d):
    ''''''
    maxKeyLength = 0
    maxValueLength = 0
    for key, value in d.iteritems():
        maxKeyLength = max(maxKeyLength, len(key))
        maxValueLength = max(maxValueLength, len(key))
    for key in sorted(d.keys()):
        print ("%"+str(maxKeyLength)+"s : %-" + str(maxValueLength)+ "s") % (key,d[key])
1202244
def pretty_print(source, dest):
    
    parser = etree.XMLParser(remove_blank_text=True)
    if not isinstance(source, str):
        source = str(source)
    tree = etree.parse(source, parser)
    docinfo = tree.docinfo
    with open(dest, 'wb') as fp:
        fp.write(etree.tostring(tree, pretty_print=True,
                                encoding=docinfo.encoding, standalone=docinfo.standalone))
653911
def pprint(object, stream=None, indent=1, width=80, depth=None):
    """"""
    printer = PrettyPrinter(
        stream=stream, indent=indent, width=width, depth=depth)
    printer.pprint(object)
609843
def custom_print(data_structure, indent):
    
    for key, value in data_structure.items():
        print("\n%s%s:" % (' ' * attribute_indent * indent, str(key)), end=' ')
        if isinstance(value, OrderedDict):
            custom_print(value, indent + 1)
        elif isinstance(value, dict):
            custom_print(value, indent + 1)
        else:
            print("%s" % (str(value)), end=' ')
136752
def pretty_print_table(headers, rows):
    """"""
    table = make_table(headers=headers, rows=rows)
    pretty_print_table_instance(table)
15720
def pretty_json(obj):
    
    if isinstance(obj, string_types):
        try:
            obj = json.loads(obj)
        except ValueError:
            raise ClientException("`obj` is not a json string")
    json_str = json.dumps(obj, sort_keys=True, indent=2)
    print(highlight(json_str, JsonLexer(), TerminalFormatter()))