prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Add readthedocs documentation for pika instrumentation
  Part of [1491](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1491)
  
  </issue>
  <code>
  [start of instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/__init__.py]
  1 # Copyright The OpenTelemetry Authors
  2 #
  3 # Licensed under the Apache License, Version 2.0 (the "License");
  4 # you may not use this file except in compliance with the License.
  5 # You may obtain a copy of the License at
  6 #
  7 #     http://www.apache.org/licenses/LICENSE-2.0
  8 #
  9 # Unless required by applicable law or agreed to in writing, software
  10 # distributed under the License is distributed on an "AS IS" BASIS,
  11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12 # See the License for the specific language governing permissions and
  13 # limitations under the License.
  14 """
  15 Instrument `pika` to trace RabbitMQ applications.
  16 
  17 Usage
  18 -----
  19 
  20 * Start broker backend
  21 
  22 .. code-block:: python
  23 
  24     docker run -p 5672:5672 rabbitmq
  25 
  26 * Run instrumented task
  27 
  28 .. code-block:: python
  29 
  30     import pika
  31     from opentelemetry.instrumentation.pika import PikaInstrumentor
  32 
  33     PikaInstrumentor().instrument()
  34 
  35     connection = pika.BlockingConnection(pika.URLParameters('amqp://localhost'))
  36     channel = connection.channel()
  37     channel.queue_declare(queue='hello')
  38     channel.basic_publish(exchange='', routing_key='hello', body=b'Hello World!')
  39 
  40 * PikaInstrumentor also supports instrumentation of a single channel
  41 
  42 .. code-block:: python
  43 
  44     import pika
  45     from opentelemetry.instrumentation.pika import PikaInstrumentor
  46 
  47     connection = pika.BlockingConnection(pika.URLParameters('amqp://localhost'))
  48     channel = connection.channel()
  49     channel.queue_declare(queue='hello')
  50 
  51     pika_instrumentation = PikaInstrumentor()
  52     pika_instrumentation.instrument_channel(channel=channel)
  53 
  54 
  55     channel.basic_publish(exchange='', routing_key='hello', body=b'Hello World!')
  56 
  57     pika_instrumentation.uninstrument_channel(channel=channel)
  58 
  59 * PikaInstrumentor also supports instrumentation without creating an object, and receiving a tracer_provider
  60 
  61 .. code-block:: python
  62 
  63     PikaInstrumentor.instrument_channel(channel, tracer_provider=tracer_provider)
  64 
  65 * PikaInstrumentor also supports instrumenting with hooks that will be called when producing or consuming a message.
  66   The hooks should be of type `Callable[[Span, bytes, BasicProperties], None]`
  67   where the first parameter is the span, the second parameter is the message body
  68   and the third parameter is the message properties
  69 
  70 .. code-block:: python
  71 
  72     def publish_hook(span: Span, body: bytes, properties: BasicProperties):
  73         span.set_attribute("messaging.payload", body.decode())
  74 
  75     def consume_hook(span: Span, body: bytes, properties: BasicProperties):
  76         span.set_attribute("messaging.id", properties.message_id)
  77 
  78     PikaInstrumentor.instrument_channel(channel, publish_hook=publish_hook, consume_hook=consume_hook)
  79 
  80 API
  81 ---
  82 """
  83 # pylint: disable=import-error
  84 
  85 from .pika_instrumentor import PikaInstrumentor
  86 from .version import __version__
  87 
  88 __all__ = ["PikaInstrumentor", "__version__"]
  89
  [end of instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/__init__.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/__init__.py b/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/__init__.py
  --- a/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/__init__.py
  +++ b/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/__init__.py
  @@ -12,7 +12,7 @@
   # See the License for the specific language governing permissions and
   # limitations under the License.
   """
  -Instrument `pika` to trace RabbitMQ applications.
  +Instrument pika to trace RabbitMQ applications.
   
   Usage
   -----
  @@ -63,7 +63,7 @@
       PikaInstrumentor.instrument_channel(channel, tracer_provider=tracer_provider)
   
   * PikaInstrumentor also supports instrumenting with hooks that will be called when producing or consuming a message.
  -  The hooks should be of type `Callable[[Span, bytes, BasicProperties], None]`
  +  The hooks should be of type "Callable[[Span, bytes, BasicProperties], None]"
     where the first parameter is the span, the second parameter is the message body
     and the third parameter is the message properties
  
verification_info: {"golden_diff": "diff --git a/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/__init__.py b/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/__init__.py\n--- a/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/__init__.py\n+++ b/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/__init__.py\n@@ -12,7 +12,7 @@\n # See the License for the specific language governing permissions and\n # limitations under the License.\n \"\"\"\n-Instrument `pika` to trace RabbitMQ applications.\n+Instrument pika to trace RabbitMQ applications.\n \n Usage\n -----\n@@ -63,7 +63,7 @@\n     PikaInstrumentor.instrument_channel(channel, tracer_provider=tracer_provider)\n \n * PikaInstrumentor also supports instrumenting with hooks that will be called when producing or consuming a message.\n-  The hooks should be of type `Callable[[Span, bytes, BasicProperties], None]`\n+  The hooks should be of type \"Callable[[Span, bytes, BasicProperties], None]\"\n   where the first parameter is the span, the second parameter is the message body\n   and the third parameter is the message properties\n", "issue": "Add readthedocs documentation for pika instrumentation\nPart of [1491](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1491)\n", "before_files": [{"content": "# Copyright The OpenTelemetry Authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"\nInstrument `pika` to trace RabbitMQ applications.\n\nUsage\n-----\n\n* Start broker backend\n\n.. code-block:: python\n\n    docker run -p 5672:5672 rabbitmq\n\n* Run instrumented task\n\n.. code-block:: python\n\n    import pika\n    from opentelemetry.instrumentation.pika import PikaInstrumentor\n\n    PikaInstrumentor().instrument()\n\n    connection = pika.BlockingConnection(pika.URLParameters('amqp://localhost'))\n    channel = connection.channel()\n    channel.queue_declare(queue='hello')\n    channel.basic_publish(exchange='', routing_key='hello', body=b'Hello World!')\n\n* PikaInstrumentor also supports instrumentation of a single channel\n\n.. code-block:: python\n\n    import pika\n    from opentelemetry.instrumentation.pika import PikaInstrumentor\n\n    connection = pika.BlockingConnection(pika.URLParameters('amqp://localhost'))\n    channel = connection.channel()\n    channel.queue_declare(queue='hello')\n\n    pika_instrumentation = PikaInstrumentor()\n    pika_instrumentation.instrument_channel(channel=channel)\n\n\n    channel.basic_publish(exchange='', routing_key='hello', body=b'Hello World!')\n\n    pika_instrumentation.uninstrument_channel(channel=channel)\n\n* PikaInstrumentor also supports instrumentation without creating an object, and receiving a tracer_provider\n\n.. code-block:: python\n\n    PikaInstrumentor.instrument_channel(channel, tracer_provider=tracer_provider)\n\n* PikaInstrumentor also supports instrumenting with hooks that will be called when producing or consuming a message.\n  The hooks should be of type `Callable[[Span, bytes, BasicProperties], None]`\n  where the first parameter is the span, the second parameter is the message body\n  and the third parameter is the message properties\n\n.. code-block:: python\n\n    def publish_hook(span: Span, body: bytes, properties: BasicProperties):\n        span.set_attribute(\"messaging.payload\", body.decode())\n\n    def consume_hook(span: Span, body: bytes, properties: BasicProperties):\n        span.set_attribute(\"messaging.id\", properties.message_id)\n\n    PikaInstrumentor.instrument_channel(channel, publish_hook=publish_hook, consume_hook=consume_hook)\n\nAPI\n---\n\"\"\"\n# pylint: disable=import-error\n\nfrom .pika_instrumentor import PikaInstrumentor\nfrom .version import __version__\n\n__all__ = [\"PikaInstrumentor\", \"__version__\"]\n", "path": "instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/__init__.py"}]}