Decorate a function so that print arguments before calling it.

    Args:
      output: writable to print args. (Default: sys.stdout)
326361
def print_args(output=sys.stdout):
    
    def decorator(func):
        """The decorator function.
        """
        @wraps(func)
        def _(*args, **kwargs):
            """The decorated function.
            """
            output.write(
                "Args: {0}, KwArgs: {1}\n".format(str(args), str(kwargs)))
            return func(*args, **kwargs)
        return _
    return decorator
1127544
def register_output_format(name):
    

    def check_decorator(fn):
        _output_format_map[name] = fn

        def wrapper(*args, **kwargs):
            return fn(*args, **kwargs)

        return wrapper

    return check_decorator
926562
def ready_print(worker, output, error):  # pragma : no cover
    """"""
    global COUNTER
    COUNTER += 1
    print(COUNTER, output, error)
226728
function outputStdout(s, outputHandler) {
  if (outputHandler) {
    outputHandler(s);
  } else {
    process.stdout.write(s);
  }
}
1013190
def output(data, **kwargs):  # pylint: disable=unused-argument
    '''
    
    '''

    params = {}
    if 'output_indent' not in __opts__:
        # default indentation
        params.update(default_flow_style=False)
    elif __opts__['output_indent'] >= 0:
        # custom indent
        params.update(default_flow_style=False,
                      indent=__opts__['output_indent'])
    else:  # no indentation
        params.update(default_flow_style=True,
                      indent=0)
    try:
        return salt.utils.yaml.safe_dump(data, **params)
    except Exception as exc:
        import pprint
        log.exception(
            'Exception %s encountered when trying to serialize %s',
            exc, pprint.pformat(data)
        )
1016916
def prin(*args, **kwargs):
    

    """
    print >> kwargs.get('out',None), " ".join([str(arg) for arg in args])
1274286
def print(cls, *args):
        
        if cls.verbose:
            if len(args) == 2:
                print(args[0], str("{0:.2f}".format(cls.get(args[1]))), "s")
            else:
                raise Exception("StopWatch: wrong number of arguments")
306271
def _printf(fmt, *args, **print3opts):
    '''
    '''
    if print3opts:  # like Python 3.0
        f = print3opts.get('file', None) or sys.stdout
        if args:
            f.write(fmt % args)
        else:
            f.write(fmt)
        f.write(print3opts.get('end', linesep))
    elif args:
        print(fmt % args)
    else:
        print(fmt)
341878
def prog(self, s=None):
        
        s = s or self.prog_msg
        self.printer(s, end='')
1139271
def _print(self, *args):
        
        string = u" ".join(args) + '\n'
        self.fobj.write(string)
975677
def internal_writer(self, outputs, stdout):
        
        for output in outputs:
            print("\t".join(map(self.internal_serialize, output)), file=stdout)
908982
def set_output(self, output):
        
        self.output = output
        self.logger.info("assigning output to %s", self.output)
295103
def debug(func):
    
    @wraps(func)
    def wrapped(*args, **kwargs):
        arg = repr(args) + ' ' + repr(kwargs)
        sys.stdout.write('Entering ' + func.__name__ + arg + '\n')
        try:
            result = func(*args, **kwargs)
        except:
            sys.stdout.write('Traceback caught:\n')
            sys.stdout.write(format_exception(*sys.exc_info()))
            raise
        arg = repr(result)
        sys.stdout.write('Leaving ' + func.__name__ + '(): ' + arg + '\n')
        return result
    return wrapped
872414
def build_output(self, fout):
        
        fout.write('\n'.join([s for s in self.out]))
1340569
def _Function(self, t):
        
        if t.decorators is not None:
            self._fill("@")
            self._dispatch(t.decorators)
        self._fill("def "+t.name + "(")
        defaults = [None] * (len(t.argnames) - len(t.defaults)) + list(t.defaults)
        for i, arg in enumerate(zip(t.argnames, defaults)):
            self._write(arg[0])
            if arg[1] is not None:
                self._write('=')
                self._dispatch(arg[1])
            if i < len(t.argnames)-1:
                self._write(', ')
        self._write(")")
        if self._single_func:
            self._do_indent = False
        self._enter()
        self._dispatch(t.code)
        self._leave()
        self._do_indent = True
898969
def formatter(name, default=False):
    
    def decorator(func):
        func._output_format = dict(name=name, default=default)
        return func
    return decorator
966232
def _put_output(self, output: Optional[str]) -> None:
        """"""
        if output is None:
            self._argv.extend(["-f", "null", "-"])
            return

        output_cmd = shlex.split(str(output))
        if len(output_cmd) > 1:
            self._argv.extend(output_cmd)
        else:
            self._argv.append(output)