Output the data in lines, very nice for running commands
184642
def output(data, **kwargs):  # pylint: disable=unused-argument
    '''
    
    '''
    ret = ''
    if hasattr(data, 'keys'):
        for key in data:
            value = data[key]
            # Don't blow up on non-strings
            try:
                for line in value.splitlines():
                    ret += '{0}: {1}\n'.format(key, line)
            except AttributeError:
                ret += '{0}: {1}\n'.format(key, value)
    else:
        try:
            ret += data + '\n'
        except TypeError:
            # For non-dictionary, non-string data, just use print
            ret += '{0}\n'.format(pprint.pformat(data))

    return ret
1302775
def output(data, **kwargs):
    '''
    
    '''

    rows = _find_durations(data)

    kwargs['opts'] = __opts__
    kwargs['rows_key'] = 'rows'
    kwargs['labels_key'] = 'labels'

    to_show = {'labels': ['name', 'mod.fun', 'duration (ms)'],
               'rows':   rows}

    return table_out.output(to_show, **kwargs)
762646
def run(self, lines):
        

        text = "\n".join(lines)
        while 1:
            m = BLOCK_RE.search(text)
            if m:
                command = m.group('command')
                # Whitelist command, prevent command injection.
                if command not in SUPPORTED_COMMAMDS:
                    raise Exception('Command not supported: %s' % command)
                filename = m.group('filename')
                content = m.group('content')
                filetype = filename[filename.rfind('.')+1:]

                args = [command, '-T'+filetype]
                try:
                    proc = subprocess.Popen(
                        args,
                        stdin=subprocess.PIPE,
                        stderr=subprocess.PIPE,
                        stdout=subprocess.PIPE)
                    proc.stdin.write(content.encode('utf-8'))

                    output, err = proc.communicate()

                    if filetype == 'svg':
                        data_url_filetype = 'svg+xml'
                        encoding = 'utf-8'
                        img = output.decode(encoding)

                    if filetype == 'png':
                        data_url_filetype = 'png'
                        encoding = 'base64'
                        output = base64.b64encode(output)
                        data_path = "data:image/%s;%s,%s" % (
                            data_url_filetype,
                            encoding,
                            output)
                        img = "![" + filename + "](" + data_path + ")"

                    text = '%s\n%s\n%s' % (
                        text[:m.start()], img, text[m.end():])

                except Exception as e:
                        err = str(e) + ' : ' + str(args)
                        return (
                            '<pre>Error : ' + err + '</pre>'
                            '<pre>' + content + '</pre>').split('\n')

            else:
                break
        return text.split("\n")
1235024
def _input_as_lines(self,data):
        
        if data:
            self.Parameters['-infile']\
                .on(super(Clustalw,self)._input_as_lines(data))
        return ''
355180
def stdout_to_results(s):
    """"""
    results = s.strip().split('\n')
    return [BenchmarkResult(*r.split()) for r in results]
1000426
def print_output(self, dotdata, output_file=None):
        """"""
        if six.PY3 and isinstance(dotdata, six.binary_type):
            dotdata = dotdata.decode()

        if output_file:
            with open(output_file, 'wt') as dot_output_f:
                dot_output_f.write(dotdata)
        else:
            self.stdout.write(dotdata)
774446
def write_line(self, values):
        

        if not self._write_line_init:
            self.init_write_line()

        if len(self._out_widths) > len(values):
            raise For2PyError(f"ERROR: too few values for format {self._format_list}\n")

        out_strs = []
        for i in range(len(self._out_widths)):
            out_fmt = self._out_gen_fmt[i]
            out_width = self._out_widths[i]

            out_val = out_fmt.format(values[i])
            if len(out_val) > out_width:  # value too big for field
                out_val = "*" * out_width

            out_strs.append(out_val)

        out_str_exp = (
            '"' + self._output_fmt + '".format' + str(tuple(out_strs))
        )
        out_str = eval(out_str_exp)
        return out_str + "\n"
323618
def print_lines(process: Popen) -> None:
    
    out, err = process.communicate()
    if out:
        for line in out.decode("utf-8").splitlines():
            print(line)
    if err:
        for line in err.decode("utf-8").splitlines():
            print(line)
540203
def dumps(self):
        

        options = self.options.dumps()
        arguments = self.arguments.dumps()

        if self.extra_arguments is None:
            return r'\{command}{options}{arguments}'\
                .format(command=self.latex_name, options=options,
                        arguments=arguments)

        extra_arguments = self.extra_arguments.dumps()

        return r'\{command}{arguments}{options}{extra_arguments}'\
            .format(command=self.latex_name, arguments=arguments,
                    options=options, extra_arguments=extra_arguments)
237015
def insertLine(self, i) :
		""""""
		self.data.insert(i, CSVEntry(self))
		return self.lines[i]
316250
def write_output(self, data, filename=None, args=None):
        """"""
        if args:
            if not args.linejson:
                return 0
        if not filename: filename = args.linejson
        entrylist = []
        for entry in data['entries']:
            entrystring = json.dumps(entry, sort_keys=True)
            entrylist.append(entrystring)
        
        with open(str(filename), 'w') as output_file:
            output_file.write('\n'.join(entrylist))
802670
def output(self, kind, line):
        ""
        self.destination.write(b''.join([
            self._cyan,
            b't=%07d' % (time.time() - self._t0),
            self._reset,
            self._kind_prefixes[kind],
            self.markers[kind],
            line,
            self._reset,
        ]))
        self.destination.flush()
324805
def display(self):
        """"""
        def render(line):
            is_wide_char = False
            for x in range(self.columns):
                if is_wide_char:  # Skip stub
                    is_wide_char = False
                    continue
                char = line[x].data
                assert sum(map(wcwidth, char[1:])) == 0
                is_wide_char = wcwidth(char[0]) == 2
                yield char

        return ["".join(render(self.buffer[y])) for y in range(self.lines)]
828498
def out(self, output, newline=True):
        """"""
        click.echo(output, nl=newline)
128087
def output_for(cmd, options = {})
      output = StringIO.new
      execute(cmd, options.merge(:outstream => output))
      output.string
    end
366839
def tee_output_python():
    """"""
    buffer = StringIO()
    out = CapturedStdout(buffer)
    orig_stdout, orig_stderr = sys.stdout, sys.stderr
    flush()
    sys.stdout = TeeingStreamProxy(sys.stdout, buffer)
    sys.stderr = TeeingStreamProxy(sys.stderr, buffer)
    try:
        yield out
    finally:
        flush()
        out.finalize()
        sys.stdout, sys.stderr = orig_stdout, orig_stderr
933501
def _write(self, lines, fname):
        
        with open(fname, 'wb') as out_fhndl:
            for line in sorted(lines, key=self.key):
                pickle.dump(line, out_fhndl)