How to use the snoop.snoop function in snoop

To help you get started, we’ve selected a few snoop 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 alexmojaki / snoop / tests / samples / with_block_depth.py View on Github external
def main():
    str(3)
    with snoop.snoop(depth=3):
        result1 = f2(5)
    return result1
github alexmojaki / snoop / tests / samples / confusing_decorator_lines.py View on Github external
@snoop.snoop(
    depth=2)  # Multi-line decorator for extra confusion!
@empty_decorator
@empty_decorator
def main():
    str(3)
github alexmojaki / snoop / tests / samples / lambda_function.py View on Github external
def main():
    my_function = snoop.snoop()(lambda x: x ** 2)
    my_function(3)
github alexmojaki / snoop / tests / samples / generator.py View on Github external
@snoop.snoop()
def f(x1):
    assert not original_tracer_active()
    _x2 = (yield x1)
    assert not original_tracer_active()
    _x3 = 'foo'
    assert not original_tracer_active()
    _x4 = (yield 2)
    assert not original_tracer_active()
github alexmojaki / snoop / tests / samples / long_variable.py View on Github external
@snoop.snoop()
def main():
    foo = list(range(1000))
    return foo
github alexmojaki / snoop / tests / samples / multiline.py View on Github external
@snoop.snoop()
def main():
    x = (
        [
            bar(),  # 1
            bar(),  # 2
        ]
    )

    with context(
            bar(),  # 1
            bar(),  # 2
    ):
        try:
            for _ in [
                bar(
                    bar(),  # 1
github alexmojaki / snoop / tests / samples / var_order.py View on Github external
@snoop.snoop()
def f(_one, _two, _three, _four):
    _five = None
    _six = None
    _seven = None

    _five, _six, _seven = 5, 6, 7