code: def transaction():
      
      client = default_client()
      _thread.client = client.pipeline()
      try:
          yield
          _thread.client.execute()
      finally:
          _thread.client = client
docs: Swaps out the current client with a pipeline instance,
      so that each Redis method call inside the context will be
      pipelined. Once the context is exited, we execute the pipeline.