From fee695ce0b8328a8f2fbfcca1c17508569963e72 Mon Sep 17 00:00:00 2001 From: Reiley Yang Date: Wed, 20 Mar 2019 18:37:44 -0700 Subject: [PATCH] fix lint in examples --- contrib/opencensus-context/examples/async_span.py | 7 ++++++- contrib/opencensus-context/examples/explicit_threading.py | 5 ++++- contrib/opencensus-context/examples/thread_pool.py | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/contrib/opencensus-context/examples/async_span.py b/contrib/opencensus-context/examples/async_span.py index b449dbdf5..a91460689 100644 --- a/contrib/opencensus-context/examples/async_span.py +++ b/contrib/opencensus-context/examples/async_span.py @@ -24,7 +24,12 @@ def __init__(self, name): self.parent = RuntimeContext.current_span def __repr__(self): - return ('{}(name={}, parent={})'.format(type(self).__name__, self.name, self.parent)) + return ('{}(name={}, parent={})' + .format( + type(self).__name__, + self.name, + self.parent, + )) async def __aenter__(self): RuntimeContext.current_span = self diff --git a/contrib/opencensus-context/examples/explicit_threading.py b/contrib/opencensus-context/examples/explicit_threading.py index 2d812e42d..ad6af8841 100644 --- a/contrib/opencensus-context/examples/explicit_threading.py +++ b/contrib/opencensus-context/examples/explicit_threading.py @@ -38,7 +38,10 @@ def work(name): print('Main thread:', RuntimeContext) # user can propagate context explicitly - thread = Thread(target=RuntimeContext.with_current_context(work), args=('bar',)) + thread = Thread( + target=RuntimeContext.with_current_context(work), + args=('bar',), + ) thread.start() thread.join() diff --git a/contrib/opencensus-context/examples/thread_pool.py b/contrib/opencensus-context/examples/thread_pool.py index 5aef47b96..c36d5a304 100644 --- a/contrib/opencensus-context/examples/thread_pool.py +++ b/contrib/opencensus-context/examples/thread_pool.py @@ -36,7 +36,7 @@ def work(name): if __name__ == "__main__": println('Main thread: {}'.format(RuntimeContext)) RuntimeContext.operation_id = 'main' - pool = ThreadPool(2) # create a thread pool with 2 threads + pool = ThreadPool(2) # create a thread pool with 2 threads pool.map(RuntimeContext.with_current_context(work), [ 'bear', 'cat',