format a BASIC program dump. Useful for debugging.
        returns a list of formated string lines.
480630
def pformat_program_dump(self, program_dump, program_start=None):
        
        assert isinstance(program_dump, bytearray)

        if program_start is None:
            program_start = self.DEFAULT_PROGRAM_START
        return self.listing.pformat_program_dump(program_dump, program_start)
198107
def pformat(self, traceback=False):
        """"""
        buf = six.StringIO()
        if not self._exc_type_names:
            buf.write('Failure: %s' % (self._exception_str))
        else:
            buf.write('Failure: %s: %s' % (self._exc_type_names[0],
                                           self._exception_str))
        if traceback:
            if self._traceback_str is not None:
                traceback_str = self._traceback_str.rstrip()
            else:
                traceback_str = None
            if traceback_str:
                buf.write(os.linesep)
                buf.write(traceback_str)
            else:
                buf.write(os.linesep)
                buf.write('Traceback not available.')
        return buf.getvalue()
474818
def _format_trace(trace):
    
    lines = []
    for fname, lineno, func, src, _ in trace:
        if src:
            for line in src:
                lines.append('    '+line.strip()+'\n')
        lines.append('  %s:%4d in %s\n' % (fname, lineno, func))
    return ''.join(lines)
1208361
def ascii_listing2program_dump(self, basic_program_ascii, program_start=None):
        
        if program_start is None:
            program_start = self.DEFAULT_PROGRAM_START

        basic_lines = self.ascii_listing2basic_lines(basic_program_ascii, program_start)

        program_dump=self.listing.basic_lines2program_dump(basic_lines, program_start)
        assert isinstance(program_dump, bytearray), (
            "is type: %s and not bytearray: %s" % (type(program_dump), repr(program_dump))
        )
        return program_dump
257780
def dumps(self):
        
        with closing(StringIO()) as fileobj:
            self.dump(fileobj)
            return fileobj.getvalue()
1197533
private static void dumpOutDebugInfo() {

        LOG.info("Dump debug output");
        Map<String, String> envs = System.getenv();
        for (Map.Entry<String, String> env : envs.entrySet()) {
            LOG.info("System env: key=" + env.getKey() + ", val=" + env.getValue());
            System.out.println("System env: key=" + env.getKey() + ", val="
                    + env.getValue());
        }

        BufferedReader buf = null;
        try {
            String lines = Shell.WINDOWS ? Shell.execCommand("cmd", "/c", "dir") :
                    Shell.execCommand("ls", "-al");
            buf = new BufferedReader(new StringReader(lines));
            String line = "";
            while ((line = buf.readLine()) != null) {
                LOG.info("System CWD content: " + line);
                System.out.println("System CWD content: " + line);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            org.apache.hadoop.io.IOUtils.cleanup(LOG, buf);
        }
    }
17450
protected static function formatDebugDumps () {
		$dumps = '';
		$lastDump = FALSE;
		$app = static::$app ?: (static::$app = & \MvcCore\Application::GetInstance());
		$appRoot = $app->GetRequest()->GetAppRoot();
		foreach (self::$dumps as $values) {
			list($dumpResult, $lastDumpLocal) = self::formatDebugDump($values, $appRoot);
			$dumps .= $dumpResult;
			if ($lastDumpLocal) $lastDump = $lastDumpLocal;
		}
		return [$dumps, $lastDump];
	}
1040062
def dumps(self):
		
		out = ""
		for option in self.options:
			value = make_value(option.default_value)
			out += "%s = %s%s\n" % (option.name, value, 
				(" # %s" % option.comment) if option.comment else "")
		return out.rstrip("\n")
378223
def pformat_program_dump(self, program_dump, program_start, formated_dump=None):
        
        if formated_dump is None:
            formated_dump = []
            formated_dump.append(
                "program start address: $%04x" % program_start
            )

        assert isinstance(program_dump, bytearray)

        if not program_dump:
            return program_dump

        try:
            next_address = (program_dump[0] << 8) + program_dump[1]
        except IndexError as err:
            raise IndexError(
                "Can't get next address from: %s program start: $%04x (Origin error: %s)" % (
                    repr(program_dump), program_start, err
            ))

        if next_address == 0x0000:
            formated_dump.append("$%04x -> end address" % next_address)
            return formated_dump

        assert next_address > program_start, "Next address $%04x not bigger than program start $%04x ?!?" % (
            next_address, program_start
        )

        length = next_address - program_start
        formated_dump.append(
            "$%04x -> next address (length: %i)" % (next_address, length)
        )
        line_number = (program_dump[2] << 8) + program_dump[3]
        formated_dump.append("$%04x -> %i (line number)" % (line_number, line_number))

        tokens = program_dump[4:length]
        formated_dump.append("tokens:")
        formated_dump += self.token_util.pformat_tokens(tokens)

        return self.pformat_program_dump(program_dump[length:], next_address, formated_dump)
151876
def std_formatter(msg):
    

    if isinstance(msg, dict):
        return yaml.safe_dump(msg, indent=True, default_flow_style=False)
    return str(msg)
766246
def format_cmd(args):
    
    if args is None:
        return ''
    out = ''
    if not isinstance(args, list):
        args = [str(args)]
    for arg in args:
        if out != '':
            out += ' '
        out += pipes.quote(str(arg))
    return out
1352833
def dev_format(errors = @output[:raw_data])
        return if errors.blank?

        pretty_output = ''
        errors.each do |filename, error_list|
          filename = strip_working_dir(filename)
          pretty_output << "\n#{filename.color(:cyan).underline} \n"
          error_list.each do |message|
            pretty_output << severity_color(message['severity'])
            pretty_output << " #{message['line'].to_s.color(:blue)} #{message['linter'].color(:green)}: #{message['reason']} \n"
          end
        end
        pretty_output << "-----\n\n"
        pretty_output
      end
857427
def dump(src):
    
    return b' '.join(binascii.hexlify(bytes(x)) for x in zip(src[::4], src[1::4], src[2::4], src[3::4]))
573901
def _dump(self, stream, pattern=None, object_ids=False):
        """"""
        return self._lists[pattern]._dump(stream, '', object_ids=object_ids)
416882
def dump(self, indentation=0):
        """"""

        dump = []

        dump.append('[{0}]'.format(self.name))

        printable_bytes = [ord(i) for i in string.printable if i not in string.whitespace]

        # Refer to the __set_format__ method for an explanation
        # of the following construct.
        for keys in self.__keys__:
            for key in keys:

                val = getattr(self, key)
                if isinstance(val, (int, long)):
                    if key.startswith('Signature_'):
                        val_str = '%-8X' % (val)
                    else:
                        val_str = '0x%-8X' % (val)
                    if key == 'TimeDateStamp' or key == 'dwTimeStamp':
                        try:
                            val_str += ' [%s UTC]' % time.asctime(time.gmtime(val))
                        except ValueError as e:
                            val_str += ' [INVALID TIME]'
                else:
                    val_str = bytearray(val)
                    if key.startswith('Signature'):
                        val_str = ''.join(
                            ['{:02X}'.format(i) for i in val_str.rstrip(b'\x00')])
                    else:
                        val_str = ''.join(
                            [chr(i) if (i in printable_bytes) else
                             '\\x{0:02x}'.format(i) for i in val_str.rstrip(b'\x00')])

                dump.append('0x%-8X 0x%-3X %-30s %s' % (
                    self.__field_offsets__[key] + self.__file_offset__,
                    self.__field_offsets__[key], key+':', val_str))

        return dump
77753
def dumps(self):
        

        head = self.documentclass.dumps() + '%\n'
        head += self.dumps_packages() + '%\n'
        head += dumps_list(self.variables) + '%\n'
        head += dumps_list(self.preamble) + '%\n'

        return head + '%\n' + super().dumps()
956689
def pformat_codepoints(codepoints):
    
    printable = string.printable.replace("\n", "").replace("\r", "")
    line = []
    strings = ""
    for codepoint in codepoints:
        char = chr(codepoint)
        if char in printable:
            strings += char
        else:
            if strings != "":
                line.append(strings)
                strings = ""
            line.append(char)
    return line