prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Update baggage header name
  As per the spec, baggage propagation must use the header as specified in the w3c baggage specification https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/baggage/api.md#baggage-propagation
  
  </issue>
  <code>
  [start of opentelemetry-api/src/opentelemetry/baggage/propagation/__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 import typing
  16 import urllib.parse
  17 
  18 from opentelemetry import baggage
  19 from opentelemetry.context import get_current
  20 from opentelemetry.context.context import Context
  21 from opentelemetry.trace.propagation import textmap
  22 
  23 
  24 class BaggagePropagator(textmap.TextMapPropagator):
  25     MAX_HEADER_LENGTH = 8192
  26     MAX_PAIR_LENGTH = 4096
  27     MAX_PAIRS = 180
  28     _BAGGAGE_HEADER_NAME = "otcorrelations"
  29 
  30     def extract(
  31         self,
  32         get_from_carrier: textmap.Getter[textmap.TextMapPropagatorT],
  33         carrier: textmap.TextMapPropagatorT,
  34         context: typing.Optional[Context] = None,
  35     ) -> Context:
  36         """Extract Baggage from the carrier.
  37 
  38         See
  39         `opentelemetry.trace.propagation.textmap.TextMapPropagator.extract`
  40         """
  41 
  42         if context is None:
  43             context = get_current()
  44 
  45         header = _extract_first_element(
  46             get_from_carrier(carrier, self._BAGGAGE_HEADER_NAME)
  47         )
  48 
  49         if not header or len(header) > self.MAX_HEADER_LENGTH:
  50             return context
  51 
  52         baggage_entries = header.split(",")
  53         total_baggage_entries = self.MAX_PAIRS
  54         for entry in baggage_entries:
  55             if total_baggage_entries <= 0:
  56                 return context
  57             total_baggage_entries -= 1
  58             if len(entry) > self.MAX_PAIR_LENGTH:
  59                 continue
  60             try:
  61                 name, value = entry.split("=", 1)
  62             except Exception:  # pylint: disable=broad-except
  63                 continue
  64             context = baggage.set_baggage(
  65                 urllib.parse.unquote(name).strip(),
  66                 urllib.parse.unquote(value).strip(),
  67                 context=context,
  68             )
  69 
  70         return context
  71 
  72     def inject(
  73         self,
  74         set_in_carrier: textmap.Setter[textmap.TextMapPropagatorT],
  75         carrier: textmap.TextMapPropagatorT,
  76         context: typing.Optional[Context] = None,
  77     ) -> None:
  78         """Injects Baggage into the carrier.
  79 
  80         See
  81         `opentelemetry.trace.propagation.textmap.TextMapPropagator.inject`
  82         """
  83         baggage_entries = baggage.get_all(context=context)
  84         if not baggage_entries:
  85             return
  86 
  87         baggage_string = _format_baggage(baggage_entries)
  88         set_in_carrier(
  89             carrier, self._BAGGAGE_HEADER_NAME, baggage_string,
  90         )
  91 
  92 
  93 def _format_baggage(baggage_entries: typing.Mapping[str, object]) -> str:
  94     return ",".join(
  95         key + "=" + urllib.parse.quote_plus(str(value))
  96         for key, value in baggage_entries.items()
  97     )
  98 
  99 
  100 def _extract_first_element(
  101     items: typing.Iterable[textmap.TextMapPropagatorT],
  102 ) -> typing.Optional[textmap.TextMapPropagatorT]:
  103     if items is None:
  104         return None
  105     return next(iter(items), None)
  106
  [end of opentelemetry-api/src/opentelemetry/baggage/propagation/__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/opentelemetry-api/src/opentelemetry/baggage/propagation/__init__.py b/opentelemetry-api/src/opentelemetry/baggage/propagation/__init__.py
  --- a/opentelemetry-api/src/opentelemetry/baggage/propagation/__init__.py
  +++ b/opentelemetry-api/src/opentelemetry/baggage/propagation/__init__.py
  @@ -25,7 +25,7 @@
       MAX_HEADER_LENGTH = 8192
       MAX_PAIR_LENGTH = 4096
       MAX_PAIRS = 180
  -    _BAGGAGE_HEADER_NAME = "otcorrelations"
  +    _BAGGAGE_HEADER_NAME = "baggage"
   
       def extract(
           self,
  @@ -85,9 +85,7 @@
               return
   
           baggage_string = _format_baggage(baggage_entries)
  -        set_in_carrier(
  -            carrier, self._BAGGAGE_HEADER_NAME, baggage_string,
  -        )
  +        set_in_carrier(carrier, self._BAGGAGE_HEADER_NAME, baggage_string)
   
   
   def _format_baggage(baggage_entries: typing.Mapping[str, object]) -> str:
  
verification_info: {"golden_diff": "diff --git a/opentelemetry-api/src/opentelemetry/baggage/propagation/__init__.py b/opentelemetry-api/src/opentelemetry/baggage/propagation/__init__.py\n--- a/opentelemetry-api/src/opentelemetry/baggage/propagation/__init__.py\n+++ b/opentelemetry-api/src/opentelemetry/baggage/propagation/__init__.py\n@@ -25,7 +25,7 @@\n     MAX_HEADER_LENGTH = 8192\n     MAX_PAIR_LENGTH = 4096\n     MAX_PAIRS = 180\n-    _BAGGAGE_HEADER_NAME = \"otcorrelations\"\n+    _BAGGAGE_HEADER_NAME = \"baggage\"\n \n     def extract(\n         self,\n@@ -85,9 +85,7 @@\n             return\n \n         baggage_string = _format_baggage(baggage_entries)\n-        set_in_carrier(\n-            carrier, self._BAGGAGE_HEADER_NAME, baggage_string,\n-        )\n+        set_in_carrier(carrier, self._BAGGAGE_HEADER_NAME, baggage_string)\n \n \n def _format_baggage(baggage_entries: typing.Mapping[str, object]) -> str:\n", "issue": "Update baggage header name\nAs per the spec, baggage propagation must use the header as specified in the w3c baggage specification https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/baggage/api.md#baggage-propagation\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#\nimport typing\nimport urllib.parse\n\nfrom opentelemetry import baggage\nfrom opentelemetry.context import get_current\nfrom opentelemetry.context.context import Context\nfrom opentelemetry.trace.propagation import textmap\n\n\nclass BaggagePropagator(textmap.TextMapPropagator):\n    MAX_HEADER_LENGTH = 8192\n    MAX_PAIR_LENGTH = 4096\n    MAX_PAIRS = 180\n    _BAGGAGE_HEADER_NAME = \"otcorrelations\"\n\n    def extract(\n        self,\n        get_from_carrier: textmap.Getter[textmap.TextMapPropagatorT],\n        carrier: textmap.TextMapPropagatorT,\n        context: typing.Optional[Context] = None,\n    ) -> Context:\n        \"\"\"Extract Baggage from the carrier.\n\n        See\n        `opentelemetry.trace.propagation.textmap.TextMapPropagator.extract`\n        \"\"\"\n\n        if context is None:\n            context = get_current()\n\n        header = _extract_first_element(\n            get_from_carrier(carrier, self._BAGGAGE_HEADER_NAME)\n        )\n\n        if not header or len(header) > self.MAX_HEADER_LENGTH:\n            return context\n\n        baggage_entries = header.split(\",\")\n        total_baggage_entries = self.MAX_PAIRS\n        for entry in baggage_entries:\n            if total_baggage_entries <= 0:\n                return context\n            total_baggage_entries -= 1\n            if len(entry) > self.MAX_PAIR_LENGTH:\n                continue\n            try:\n                name, value = entry.split(\"=\", 1)\n            except Exception:  # pylint: disable=broad-except\n                continue\n            context = baggage.set_baggage(\n                urllib.parse.unquote(name).strip(),\n                urllib.parse.unquote(value).strip(),\n                context=context,\n            )\n\n        return context\n\n    def inject(\n        self,\n        set_in_carrier: textmap.Setter[textmap.TextMapPropagatorT],\n        carrier: textmap.TextMapPropagatorT,\n        context: typing.Optional[Context] = None,\n    ) -> None:\n        \"\"\"Injects Baggage into the carrier.\n\n        See\n        `opentelemetry.trace.propagation.textmap.TextMapPropagator.inject`\n        \"\"\"\n        baggage_entries = baggage.get_all(context=context)\n        if not baggage_entries:\n            return\n\n        baggage_string = _format_baggage(baggage_entries)\n        set_in_carrier(\n            carrier, self._BAGGAGE_HEADER_NAME, baggage_string,\n        )\n\n\ndef _format_baggage(baggage_entries: typing.Mapping[str, object]) -> str:\n    return \",\".join(\n        key + \"=\" + urllib.parse.quote_plus(str(value))\n        for key, value in baggage_entries.items()\n    )\n\n\ndef _extract_first_element(\n    items: typing.Iterable[textmap.TextMapPropagatorT],\n) -> typing.Optional[textmap.TextMapPropagatorT]:\n    if items is None:\n        return None\n    return next(iter(items), None)\n", "path": "opentelemetry-api/src/opentelemetry/baggage/propagation/__init__.py"}]}