How to use the pysnooper.pysnooper.get_write_function function in PySnooper

To help you get started, we’ve selected a few PySnooper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ydf0509 / distributed_framework / function_scheduling_distributed_framework / utils / custom_pysnooper.py View on Github external
def _snoop_can_click(output=None, variables=(), depth=1, prefix=''):
    write = get_write_function(output)

    # noinspection PyShadowingBuiltins
    @decorator.decorator
    def decorate(function, *args, **kwargs):
        target_code_object = function.__code__
        with TracerCanClick(target_code_object=target_code_object,
                            write=write, variables=variables,
                            depth=depth, prefix=prefix):
            return function(*args, **kwargs)

    return decorate