How to use the pysnooper.snoop 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(*args, **kwargs):
            if os_name != 'nt' and do_not_effect_on_linux:  # 不要修改任何代码,自动就会不在linux上debug,一般linux是部署机器。
                return func(*args, **kwargs)
            else:
                if line_can_click:
                    return _snoop_can_click(output, variables, depth, prefix)(func)(*args, **kwargs)
                else:
                    return pysnooper.snoop(output, variables, depth, prefix)(func)(*args, **kwargs)
github dnanexus / dx-toolkit / src / python / dxpy / sugar / chunking.py View on Github external
@pysnooper.snoop()
def schedule_lpt(jobs, num_bins):
    """This function implements the Longest Processing Time algorithm to get
    a good division of labor for the multiprocessor scheduling problem.

    Args:
        jobs (dict or list): A dictionary with string 'key' specifying job
            name and float 'value' specifying job weight (how long job should
            run compared to other jobs). A list of tuples may also be passed
            if it is equivalent to dict.items()
        num_bins (int): Number of groups to split jobs into.

    Returns:
        List of lists: Each group (list) in list is a group of jobs that should
            be run together on a single worker or instance and consists of
            tuples as provided in jobs input.
github koxudaxi / datamodel-code-generator / datamodel_code_generator / __init__.py View on Github external
def inner(cls: Type[T]) -> Type[T]:
        methods = inspect.getmembers(cls, predicate=inspect.isfunction)
        for name, method in methods:
            snooper_method = pysnooper.snoop(
                output,
                watch,
                watch_explode,
                depth,
                prefix,
                overwrite,
                thread_info,
                custom_repr,
                max_variable_length,
            )(method)
            setattr(cls, name, snooper_method)
        return cls