{
    "file_diffs": [
        {
            "old_file_content": "CHANGES\n=======\n\n0.8.0 (06-06-2014)\n------------------\n\n- Add support for utf-8 values in HTTP headers\n\n- Allow to use custom response class instead of HttpResponse\n\n- Use MultiDict for client request headers\n\n- Use MultiDict for server request/response headers\n\n- Store response headers in ClientResponse.headers attribute\n\n- Get rid of timeout parameter in aiohttp.client API\n\n- Exceptions refactoring\n\n\n0.7.3 (05-20-2014)\n------------------\n\n- Simple HTTP proxy support.\n\n\n0.7.2 (05-14-2014)\n------------------\n\n- Get rid of __del__ methods\n\n- Use ResourceWarning instead of logging warning record.\n\n\n0.7.1 (04-28-2014)\n------------------\n\n- Do not unquote client request urls.\n\n- Allow multple waiters on transport drain.\n\n- Do not return client connection to pool in case of exceptions.\n\n- Rename SocketConnector to TCPConnector and UnixSocketConnector to UnixConnector.\n\n\n0.7.0 (04-16-2014)\n------------------\n\n- Connection flow control.\n\n- Http client session/connection pool refactoring.\n\n- Better handling for bad server requests.\n\n\n0.6.5 (03-29-2014)\n------------------\n\n- Added client session reuse timeout.\n\n- Better client request cancellation support.\n\n- Better handling responses without content length.\n\n- Added HttpClient verify_ssl parameter support.\n\n\n0.6.4 (02-27-2014)\n------------------\n\n- Log content-length missing warning only for put and post requests.\n\n\n0.6.3 (02-27-2014)\n------------------\n\n- Better support for server exit.\n\n- Read response body until eof if content-length is not defined #14\n\n\n0.6.2 (02-18-2014)\n------------------\n\n- Fix trailing char in allowed_methods.\n\n- Start slow request timer for first request.\n\n\n0.6.1 (02-17-2014)\n------------------\n\n- Added utility method HttpResponse.read_and_close()\n\n- Added slow request timeout.\n\n- Enable socket SO_KEEPALIVE if available. (@polymorphm)\n\n\n0.6.0 (02-12-2014)\n------------------\n\n- Better handling for process exit.\n\n\n0.5.0 (01-29-2014)\n------------------\n\n- Allow to use custom HttpRequest client class.\n\n- Use gunicorn keepalive setting for async worker.\n\n- Log leaking responses.\n\n- python 3.4 compatibility\n\n\n0.4.4 (11-15-2013)\n------------------\n\n- Resolve only AF_INET family, because it is not clear how to pass extra info to asyncio.\n\n\n0.4.3 (11-15-2013)\n------------------\n\n- Allow to wait completion of request with `HttpResponse.wait_for_close()`\n\n\n0.4.2 (11-14-2013)\n------------------\n\n- Handle exception in client request stream.\n\n- Prevent host resolving for each client request.\n\n\n0.4.1 (11-12-2013)\n------------------\n\n- Added client support for `expect: 100-continue` header.\n\n\n0.4 (11-06-2013)\n----------------\n\n- Added custom wsgi application close procedure\n\n- Fixed concurrent host failure in HttpClient\n\n\n0.3 (11-04-2013)\n----------------\n\n- Added PortMapperWorker\n\n- Added HttpClient\n\n- Added tcp connection timeout to http client\n\n- Better client connection errors handling\n\n- Gracefully handle process exit\n\n\n0.2\n---\n\n- Fix packaging\n",
            "new_file_content": "CHANGES\n=======\n\n0.8.1 (unreleased)\n------------------\n\n- MultiDict.getall() accepts default value.\n\n\n0.8.0 (06-06-2014)\n------------------\n\n- Add support for utf-8 values in HTTP headers\n\n- Allow to use custom response class instead of HttpResponse\n\n- Use MultiDict for client request headers\n\n- Use MultiDict for server request/response headers\n\n- Store response headers in ClientResponse.headers attribute\n\n- Get rid of timeout parameter in aiohttp.client API\n\n- Exceptions refactoring\n\n\n0.7.3 (05-20-2014)\n------------------\n\n- Simple HTTP proxy support.\n\n\n0.7.2 (05-14-2014)\n------------------\n\n- Get rid of __del__ methods\n\n- Use ResourceWarning instead of logging warning record.\n\n\n0.7.1 (04-28-2014)\n------------------\n\n- Do not unquote client request urls.\n\n- Allow multple waiters on transport drain.\n\n- Do not return client connection to pool in case of exceptions.\n\n- Rename SocketConnector to TCPConnector and UnixSocketConnector to UnixConnector.\n\n\n0.7.0 (04-16-2014)\n------------------\n\n- Connection flow control.\n\n- Http client session/connection pool refactoring.\n\n- Better handling for bad server requests.\n\n\n0.6.5 (03-29-2014)\n------------------\n\n- Added client session reuse timeout.\n\n- Better client request cancellation support.\n\n- Better handling responses without content length.\n\n- Added HttpClient verify_ssl parameter support.\n\n\n0.6.4 (02-27-2014)\n------------------\n\n- Log content-length missing warning only for put and post requests.\n\n\n0.6.3 (02-27-2014)\n------------------\n\n- Better support for server exit.\n\n- Read response body until eof if content-length is not defined #14\n\n\n0.6.2 (02-18-2014)\n------------------\n\n- Fix trailing char in allowed_methods.\n\n- Start slow request timer for first request.\n\n\n0.6.1 (02-17-2014)\n------------------\n\n- Added utility method HttpResponse.read_and_close()\n\n- Added slow request timeout.\n\n- Enable socket SO_KEEPALIVE if available. (@polymorphm)\n\n\n0.6.0 (02-12-2014)\n------------------\n\n- Better handling for process exit.\n\n\n0.5.0 (01-29-2014)\n------------------\n\n- Allow to use custom HttpRequest client class.\n\n- Use gunicorn keepalive setting for async worker.\n\n- Log leaking responses.\n\n- python 3.4 compatibility\n\n\n0.4.4 (11-15-2013)\n------------------\n\n- Resolve only AF_INET family, because it is not clear how to pass extra info to asyncio.\n\n\n0.4.3 (11-15-2013)\n------------------\n\n- Allow to wait completion of request with `HttpResponse.wait_for_close()`\n\n\n0.4.2 (11-14-2013)\n------------------\n\n- Handle exception in client request stream.\n\n- Prevent host resolving for each client request.\n\n\n0.4.1 (11-12-2013)\n------------------\n\n- Added client support for `expect: 100-continue` header.\n\n\n0.4 (11-06-2013)\n----------------\n\n- Added custom wsgi application close procedure\n\n- Fixed concurrent host failure in HttpClient\n\n\n0.3 (11-04-2013)\n----------------\n\n- Added PortMapperWorker\n\n- Added HttpClient\n\n- Added tcp connection timeout to http client\n\n- Better client connection errors handling\n\n- Gracefully handle process exit\n\n\n0.2\n---\n\n- Fix packaging\n",
            "header": {
                "file": {
                    "path": "CHANGES.txt"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "5cf5cf00",
                "new_commit_hash": "bc75251a",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/CHANGES.txt"
            },
            "plus_file": {
                "path": "b/CHANGES.txt"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 1,
                            "length": 6
                        },
                        "new_range": {
                            "start": 1,
                            "length": 12
                        },
                        "section": ""
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "CHANGES",
                                "type": "context"
                            },
                            {
                                "content": "=======",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "0.8.1 (unreleased)",
                                "type": "added"
                            },
                            {
                                "content": "------------------",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "- MultiDict.getall() accepts default value.",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "0.8.0 (06-06-2014)",
                                "type": "context"
                            },
                            {
                                "content": "------------------",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "from itertools import chain\nfrom collections import OrderedDict, abc\n\n\nclass MultiDict(abc.Mapping):\n    \"\"\"Read-only ordered dictionary that can hava multiple values for each key.\n\n    This type of MultiDict must be used for request headers and query args.\n    \"\"\"\n\n    def __init__(self, *args, **kwargs):\n        if len(args) > 1:\n            raise TypeError(\"MultiDict takes at most 2 positional \"\n                            \"arguments ({} given)\".format(len(args) + 1))\n        self._items = OrderedDict()\n        if args:\n            if hasattr(args[0], 'items'):\n                args = list(args[0].items())\n            else:\n                args = list(args[0])\n\n        for key, value in chain(args, kwargs.items()):\n            if key in self._items:\n                self._items[key].append(value)\n            else:\n                self._items[key] = [value]\n\n    def get(self, key, default=None):\n        \"\"\"Return first value stored at key.\"\"\"\n        if key in self._items and self._items[key]:\n            return self._items[key][0]\n        else:\n            return default\n\n    def getall(self, key):\n        \"\"\"Returns all values stored at key as a tuple.\n\n        Raises KeyError if key doesn't exist.\"\"\"\n        return tuple(self._items[key])\n\n    def getone(self, key):\n        \"\"\"Return first value stored at key.\"\"\"\n        return self._items[key][0]\n\n    # extra methods #\n\n    def copy(self):\n        \"\"\"Returns a copy itself.\"\"\"\n        cls = self.__class__\n        return cls(self.items(getall=True))\n\n    # Mapping interface #\n\n    def __getitem__(self, key):\n        return self._items[key][0]\n\n    def __iter__(self):\n        return iter(self._items)\n\n    def __len__(self):\n        return len(self._items)\n\n    def items(self, *, getall=False):\n        return _ItemsView(self._items, getall=getall)\n\n    def values(self, *, getall=False):\n        return _ValuesView(self._items, getall=getall)\n\n    def __eq__(self, other):\n        if not isinstance(other, abc.Mapping):\n            return NotImplemented\n        if isinstance(other, MultiDict):\n            return self._items == other._items\n        return dict(self.items()) == dict(other.items())\n\n    def __contains__(self, key):\n        return key in self._items\n\n    def __repr__(self):\n        return '<{} {!r}>'.format(self.__class__.__name__, self._items)\n\n\nclass CaseInsensitiveMultiDict(MultiDict):\n    \"\"\"Case insensitive multi dict.\"\"\"\n\n    def getall(self, key):\n        return tuple(self._items[key.upper()])\n\n    def get(self, key, default=None):\n        key = key.upper()\n        if key in self._items and self._items[key]:\n            return self._items[key][0]\n        else:\n            return default\n\n    def getone(self, key):\n        return self._items[key.upper()][0]\n\n    def __getitem__(self, key):\n        return self._items[key.upper()][0]\n\n    def __contains__(self, key):\n        return key.upper() in self._items\n\n\nclass MutableMultiDict(abc.MutableMapping, MultiDict):\n    \"\"\"An ordered dictionary that can have multiple values for each key.\"\"\"\n\n    def getall(self, key):\n        \"\"\"Returns all values stored at key as list.\n\n        Raises KeyError if key doesn't exist.\n        \"\"\"\n        return list(self._items[key])\n\n    def add(self, key, value):\n        \"\"\"Adds value to a key.\"\"\"\n        if key in self._items:\n            self._items[key].append(value)\n        else:\n            self._items[key] = [value]\n\n    def extend(self, *args, **kwargs):\n        \"\"\"Extends current MutableMultiDict with more values.\n\n        This method must be used instead of update.\n        \"\"\"\n        if len(args) > 1:\n            raise TypeError(\"extend takes at most 2 positional arguments\"\n                            \" ({} given)\".format(len(args) + 1))\n        if args:\n            if isinstance(args[0], MultiDict):\n                items = args[0].items(getall=True)\n            elif hasattr(args[0], 'items'):\n                items = args[0].items()\n            else:\n                items = args[0]\n        else:\n            items = []\n        for key, value in chain(items, kwargs.items()):\n            self.add(key, value)\n\n    def clear(self):\n        \"\"\"Remove all items from MutableMultiDict\"\"\"\n        self._items.clear()\n\n    # MutableMapping interface #\n\n    def __setitem__(self, key, value):\n        self._items[key] = [value]\n\n    def __delitem__(self, key):\n        del self._items[key]\n\n    def pop(self, key, default=None):\n        \"\"\"Method not allowed.\"\"\"\n        raise NotImplementedError\n\n    def popitem(self):\n        \"\"\"Method not allowed.\"\"\"\n        raise NotImplementedError\n\n    def update(self, *args, **kw):\n        \"\"\"Method not allowed.\"\"\"\n        raise NotImplementedError(\"Use extend method instead\")\n\n\nclass _ItemsView(abc.ItemsView):\n\n    def __init__(self, mapping, *, getall=False):\n        super().__init__(mapping)\n        self._getall = getall\n\n    def __contains__(self, item):\n        key, value = item\n        try:\n            values = self._mapping[key]\n        except KeyError:\n            return False\n        else:\n            if self._getall:\n                return value in values\n            else:\n                return value == values[0]\n\n    def __iter__(self):\n        for key, values in self._mapping.items():\n            if self._getall:\n                for value in values:\n                    yield key, value\n            else:\n                yield key, values[0]\n\n\nclass _ValuesView(abc.KeysView):\n\n    def __init__(self, mapping, *, getall=False):\n        super().__init__(mapping)\n        self._getall = getall\n\n    def __contains__(self, value):\n        for values in self._mapping.values():\n            if self._getall and value in values:\n                return True\n            elif value == values[0]:\n                return True\n        return False\n\n    def __iter__(self):\n        for values in self._mapping.values():\n            if self._getall:\n                yield from iter(values)\n            else:\n                yield values[0]\n",
            "new_file_content": "from itertools import chain\nfrom collections import OrderedDict, abc\n\n_marker = object()\n\n\nclass MultiDict(abc.Mapping):\n    \"\"\"Read-only ordered dictionary that can hava multiple values for each key.\n\n    This type of MultiDict must be used for request headers and query args.\n    \"\"\"\n\n    def __init__(self, *args, **kwargs):\n        if len(args) > 1:\n            raise TypeError(\"MultiDict takes at most 2 positional \"\n                            \"arguments ({} given)\".format(len(args) + 1))\n        self._items = OrderedDict()\n        if args:\n            if hasattr(args[0], 'items'):\n                args = list(args[0].items())\n            else:\n                args = list(args[0])\n\n        for key, value in chain(args, kwargs.items()):\n            if key in self._items:\n                self._items[key].append(value)\n            else:\n                self._items[key] = [value]\n\n    def get(self, key, default=None):\n        \"\"\"Return first value stored at key.\"\"\"\n        if key in self._items and self._items[key]:\n            return self._items[key][0]\n        else:\n            return default\n\n    def getall(self, key, default=_marker):\n        \"\"\"Returns all values stored at key as a tuple.\n\n        Raises KeyError if key doesn't exist.\"\"\"\n        if key in self._items:\n            return tuple(self._items[key])\n        else:\n            if default is not _marker:\n                return default\n            else:\n                raise KeyError(key)\n\n    def getone(self, key):\n        \"\"\"Return first value stored at key.\"\"\"\n        return self._items[key][0]\n\n    # extra methods #\n\n    def copy(self):\n        \"\"\"Returns a copy itself.\"\"\"\n        cls = self.__class__\n        return cls(self.items(getall=True))\n\n    # Mapping interface #\n\n    def __getitem__(self, key):\n        return self._items[key][0]\n\n    def __iter__(self):\n        return iter(self._items)\n\n    def __len__(self):\n        return len(self._items)\n\n    def items(self, *, getall=False):\n        return _ItemsView(self._items, getall=getall)\n\n    def values(self, *, getall=False):\n        return _ValuesView(self._items, getall=getall)\n\n    def __eq__(self, other):\n        if not isinstance(other, abc.Mapping):\n            return NotImplemented\n        if isinstance(other, MultiDict):\n            return self._items == other._items\n        return dict(self.items()) == dict(other.items())\n\n    def __contains__(self, key):\n        return key in self._items\n\n    def __repr__(self):\n        return '<{} {!r}>'.format(self.__class__.__name__, self._items)\n\n\nclass CaseInsensitiveMultiDict(MultiDict):\n    \"\"\"Case insensitive multi dict.\"\"\"\n\n    def getall(self, key):\n        return tuple(self._items[key.upper()])\n\n    def get(self, key, default=None):\n        key = key.upper()\n        if key in self._items and self._items[key]:\n            return self._items[key][0]\n        else:\n            return default\n\n    def getone(self, key):\n        return self._items[key.upper()][0]\n\n    def __getitem__(self, key):\n        return self._items[key.upper()][0]\n\n    def __contains__(self, key):\n        return key.upper() in self._items\n\n\nclass MutableMultiDict(abc.MutableMapping, MultiDict):\n    \"\"\"An ordered dictionary that can have multiple values for each key.\"\"\"\n\n    def getall(self, key):\n        \"\"\"Returns all values stored at key as list.\n\n        Raises KeyError if key doesn't exist.\n        \"\"\"\n        return list(self._items[key])\n\n    def add(self, key, value):\n        \"\"\"Adds value to a key.\"\"\"\n        if key in self._items:\n            self._items[key].append(value)\n        else:\n            self._items[key] = [value]\n\n    def extend(self, *args, **kwargs):\n        \"\"\"Extends current MutableMultiDict with more values.\n\n        This method must be used instead of update.\n        \"\"\"\n        if len(args) > 1:\n            raise TypeError(\"extend takes at most 2 positional arguments\"\n                            \" ({} given)\".format(len(args) + 1))\n        if args:\n            if isinstance(args[0], MultiDict):\n                items = args[0].items(getall=True)\n            elif hasattr(args[0], 'items'):\n                items = args[0].items()\n            else:\n                items = args[0]\n        else:\n            items = []\n        for key, value in chain(items, kwargs.items()):\n            self.add(key, value)\n\n    def clear(self):\n        \"\"\"Remove all items from MutableMultiDict\"\"\"\n        self._items.clear()\n\n    # MutableMapping interface #\n\n    def __setitem__(self, key, value):\n        self._items[key] = [value]\n\n    def __delitem__(self, key):\n        del self._items[key]\n\n    def pop(self, key, default=None):\n        \"\"\"Method not allowed.\"\"\"\n        raise NotImplementedError\n\n    def popitem(self):\n        \"\"\"Method not allowed.\"\"\"\n        raise NotImplementedError\n\n    def update(self, *args, **kw):\n        \"\"\"Method not allowed.\"\"\"\n        raise NotImplementedError(\"Use extend method instead\")\n\n\nclass _ItemsView(abc.ItemsView):\n\n    def __init__(self, mapping, *, getall=False):\n        super().__init__(mapping)\n        self._getall = getall\n\n    def __contains__(self, item):\n        key, value = item\n        try:\n            values = self._mapping[key]\n        except KeyError:\n            return False\n        else:\n            if self._getall:\n                return value in values\n            else:\n                return value == values[0]\n\n    def __iter__(self):\n        for key, values in self._mapping.items():\n            if self._getall:\n                for value in values:\n                    yield key, value\n            else:\n                yield key, values[0]\n\n\nclass _ValuesView(abc.KeysView):\n\n    def __init__(self, mapping, *, getall=False):\n        super().__init__(mapping)\n        self._getall = getall\n\n    def __contains__(self, value):\n        for values in self._mapping.values():\n            if self._getall and value in values:\n                return True\n            elif value == values[0]:\n                return True\n        return False\n\n    def __iter__(self):\n        for values in self._mapping.values():\n            if self._getall:\n                yield from iter(values)\n            else:\n                yield values[0]\n",
            "header": {
                "file": {
                    "path": "aiohttp/multidict.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "9f49afb2",
                "new_commit_hash": "e57a8343",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/aiohttp/multidict.py"
            },
            "plus_file": {
                "path": "b/aiohttp/multidict.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 1,
                            "length": 6
                        },
                        "new_range": {
                            "start": 1,
                            "length": 8
                        },
                        "section": ""
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "from itertools import chain",
                                "type": "context"
                            },
                            {
                                "content": "from collections import OrderedDict, abc",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "_marker = object()",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "class MultiDict(abc.Mapping):",
                                "type": "context"
                            },
                            {
                                "content": "    \"\"\"Read-only ordered dictionary that can hava multiple values for each key.",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [
                        {
                            "file_name": "aiohttp/multidict.py",
                            "type": "statement",
                            "name": "",
                            "content": "_marker = object()",
                            "ast_type_str": "Assign",
                            "start_lineno": 4,
                            "end_lineno": 4,
                            "parent": null
                        }
                    ],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 32,
                            "length": 11
                        },
                        "new_range": {
                            "start": 34,
                            "length": 17
                        },
                        "section": "class MultiDict(abc.Mapping):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        else:",
                                "type": "context"
                            },
                            {
                                "content": "            return default",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    def getall(self, key):",
                                "type": "deleted"
                            },
                            {
                                "content": "    def getall(self, key, default=_marker):",
                                "type": "added"
                            },
                            {
                                "content": "        \"\"\"Returns all values stored at key as a tuple.",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        Raises KeyError if key doesn't exist.\"\"\"",
                                "type": "context"
                            },
                            {
                                "content": "        return tuple(self._items[key])",
                                "type": "deleted"
                            },
                            {
                                "content": "        if key in self._items:",
                                "type": "added"
                            },
                            {
                                "content": "            return tuple(self._items[key])",
                                "type": "added"
                            },
                            {
                                "content": "        else:",
                                "type": "added"
                            },
                            {
                                "content": "            if default is not _marker:",
                                "type": "added"
                            },
                            {
                                "content": "                return default",
                                "type": "added"
                            },
                            {
                                "content": "            else:",
                                "type": "added"
                            },
                            {
                                "content": "                raise KeyError(key)",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    def getone(self, key):",
                                "type": "context"
                            },
                            {
                                "content": "        \"\"\"Return first value stored at key.\"\"\"",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "aiohttp/multidict.py",
                            "type": "class",
                            "name": "MultiDict",
                            "content": "class MultiDict(abc.Mapping):\n    \"\"\"Read-only ordered dictionary that can hava multiple values for each key.\n\n    This type of MultiDict must be used for request headers and query args.\n    \"\"\"\n\n    def __init__(self, *args, **kwargs):\n        if len(args) > 1:\n            raise TypeError(\"MultiDict takes at most 2 positional \"\n                            \"arguments ({} given)\".format(len(args) + 1))\n        self._items = OrderedDict()\n        if args:\n            if hasattr(args[0], 'items'):\n                args = list(args[0].items())\n            else:\n                args = list(args[0])\n\n        for key, value in chain(args, kwargs.items()):\n            if key in self._items:\n                self._items[key].append(value)\n            else:\n                self._items[key] = [value]\n\n    def get(self, key, default=None):\n        \"\"\"Return first value stored at key.\"\"\"\n        if key in self._items and self._items[key]:\n            return self._items[key][0]\n        else:\n            return default\n\n    def getall(self, key):\n        \"\"\"Returns all values stored at key as a tuple.\n\n        Raises KeyError if key doesn't exist.\"\"\"\n        return tuple(self._items[key])\n\n    def getone(self, key):\n        \"\"\"Return first value stored at key.\"\"\"\n        return self._items[key][0]\n\n    # extra methods #\n\n    def copy(self):\n        \"\"\"Returns a copy itself.\"\"\"\n        cls = self.__class__\n        return cls(self.items(getall=True))\n\n    # Mapping interface #\n\n    def __getitem__(self, key):\n        return self._items[key][0]\n\n    def __iter__(self):\n        return iter(self._items)\n\n    def __len__(self):\n        return len(self._items)\n\n    def items(self, *, getall=False):\n        return _ItemsView(self._items, getall=getall)\n\n    def values(self, *, getall=False):\n        return _ValuesView(self._items, getall=getall)\n\n    def __eq__(self, other):\n        if not isinstance(other, abc.Mapping):\n            return NotImplemented\n        if isinstance(other, MultiDict):\n            return self._items == other._items\n        return dict(self.items()) == dict(other.items())\n\n    def __contains__(self, key):\n        return key in self._items\n\n    def __repr__(self):\n        return '<{} {!r}>'.format(self.__class__.__name__, self._items)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 5,
                            "end_lineno": 80,
                            "parent": null
                        },
                        {
                            "file_name": "aiohttp/multidict.py",
                            "type": "method",
                            "name": "MultiDict.getall",
                            "content": "class MultiDict(abc.Mapping):\n    \"\"\"Read-only ordered dictionary that can hava multiple values for each key.\n\n    This type of MultiDict must be used for request headers and query args.\n    \"\"\"\n\n    def __init__(self, *args, **kwargs):\n        if len(args) > 1:\n            raise TypeError(\"MultiDict takes at most 2 positional \"\n                            \"arguments ({} given)\".format(len(args) + 1))\n        self._items = OrderedDict()\n        if args:\n            if hasattr(args[0], 'items'):\n                args = list(args[0].items())\n            else:\n                args = list(args[0])\n\n        for key, value in chain(args, kwargs.items()):\n            if key in self._items:\n                self._items[key].append(value)\n            else:\n                self._items[key] = [value]\n\n    def get(self, key, default=None):\n        \"\"\"Return first value stored at key.\"\"\"\n        if key in self._items and self._items[key]:\n            return self._items[key][0]\n        else:\n            return default\n\n    def getall(self, key):\n        \"\"\"Returns all values stored at key as a tuple.\n\n        Raises KeyError if key doesn't exist.\"\"\"\n        return tuple(self._items[key])\n\n    def getone(self, key):\n        \"\"\"Return first value stored at key.\"\"\"\n        return self._items[key][0]\n\n    # extra methods #\n\n    def copy(self):\n        \"\"\"Returns a copy itself.\"\"\"\n        cls = self.__class__\n        return cls(self.items(getall=True))\n\n    # Mapping interface #\n\n    def __getitem__(self, key):\n        return self._items[key][0]\n\n    def __iter__(self):\n        return iter(self._items)\n\n    def __len__(self):\n        return len(self._items)\n\n    def items(self, *, getall=False):\n        return _ItemsView(self._items, getall=getall)\n\n    def values(self, *, getall=False):\n        return _ValuesView(self._items, getall=getall)\n\n    def __eq__(self, other):\n        if not isinstance(other, abc.Mapping):\n            return NotImplemented\n        if isinstance(other, MultiDict):\n            return self._items == other._items\n        return dict(self.items()) == dict(other.items())\n\n    def __contains__(self, key):\n        return key in self._items\n\n    def __repr__(self):\n        return '<{} {!r}>'.format(self.__class__.__name__, self._items)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 35,
                            "end_lineno": 39,
                            "parent": {
                                "file_name": "aiohttp/multidict.py",
                                "type": "class",
                                "name": "MultiDict",
                                "content": "class MultiDict(abc.Mapping):\n    \"\"\"Read-only ordered dictionary that can hava multiple values for each key.\n\n    This type of MultiDict must be used for request headers and query args.\n    \"\"\"\n\n    def __init__(self, *args, **kwargs):\n        if len(args) > 1:\n            raise TypeError(\"MultiDict takes at most 2 positional \"\n                            \"arguments ({} given)\".format(len(args) + 1))\n        self._items = OrderedDict()\n        if args:\n            if hasattr(args[0], 'items'):\n                args = list(args[0].items())\n            else:\n                args = list(args[0])\n\n        for key, value in chain(args, kwargs.items()):\n            if key in self._items:\n                self._items[key].append(value)\n            else:\n                self._items[key] = [value]\n\n    def get(self, key, default=None):\n        \"\"\"Return first value stored at key.\"\"\"\n        if key in self._items and self._items[key]:\n            return self._items[key][0]\n        else:\n            return default\n\n    def getall(self, key):\n        \"\"\"Returns all values stored at key as a tuple.\n\n        Raises KeyError if key doesn't exist.\"\"\"\n        return tuple(self._items[key])\n\n    def getone(self, key):\n        \"\"\"Return first value stored at key.\"\"\"\n        return self._items[key][0]\n\n    # extra methods #\n\n    def copy(self):\n        \"\"\"Returns a copy itself.\"\"\"\n        cls = self.__class__\n        return cls(self.items(getall=True))\n\n    # Mapping interface #\n\n    def __getitem__(self, key):\n        return self._items[key][0]\n\n    def __iter__(self):\n        return iter(self._items)\n\n    def __len__(self):\n        return len(self._items)\n\n    def items(self, *, getall=False):\n        return _ItemsView(self._items, getall=getall)\n\n    def values(self, *, getall=False):\n        return _ValuesView(self._items, getall=getall)\n\n    def __eq__(self, other):\n        if not isinstance(other, abc.Mapping):\n            return NotImplemented\n        if isinstance(other, MultiDict):\n            return self._items == other._items\n        return dict(self.items()) == dict(other.items())\n\n    def __contains__(self, key):\n        return key in self._items\n\n    def __repr__(self):\n        return '<{} {!r}>'.format(self.__class__.__name__, self._items)",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 5,
                                "end_lineno": 80,
                                "parent": null
                            }
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "import unittest\n\nfrom aiohttp.multidict import \\\n    MultiDict, MutableMultiDict, CaseInsensitiveMultiDict\n\n\nclass _BaseTest(unittest.TestCase):\n\n    def make_dict(self, *args, **kwargs):\n        raise NotImplementedError\n\n    def test_instantiate__empty(self):\n        d = self.make_dict()\n        self.assertEqual(d, {})\n        self.assertEqual(len(d), 0)\n        self.assertEqual(list(d.keys()), [])\n        self.assertEqual(list(d.values()), [])\n        self.assertEqual(list(d.values(getall=True)), [])\n        self.assertEqual(list(d.items()), [])\n        self.assertEqual(list(d.items(getall=True)), [])\n\n        self.assertNotEqual(self.make_dict(), list())\n        with self.assertRaisesRegex(TypeError, \"\\(3 given\\)\"):\n            self.make_dict(('key1', 'value1'), ('key2', 'value2'))\n\n    def test_instantiate__from_arg0(self):\n        d = self.make_dict([('key', 'value1')])\n\n        self.assertEqual(d, {'key': 'value1'})\n        self.assertEqual(len(d), 1)\n        self.assertEqual(list(d.keys()), ['key'])\n        self.assertEqual(list(d.values()), ['value1'])\n        self.assertEqual(list(d.values(getall=True)), ['value1'])\n        self.assertEqual(list(d.items()), [('key', 'value1')])\n        self.assertEqual(list(d.items(getall=True)), [('key', 'value1')])\n\n    def test_instantiate__from_arg0_dict(self):\n        d = self.make_dict({'key': 'value1'})\n\n        self.assertEqual(d, {'key': 'value1'})\n        self.assertEqual(len(d), 1)\n        self.assertEqual(list(d.keys()), ['key'])\n        self.assertEqual(list(d.values()), ['value1'])\n        self.assertEqual(list(d.values(getall=True)), ['value1'])\n        self.assertEqual(list(d.items()), [('key', 'value1')])\n        self.assertEqual(list(d.items(getall=True)), [('key', 'value1')])\n\n    def test_instantiate__with_kwargs(self):\n        d = self.make_dict([('key', 'value1')], key2='value2')\n\n        self.assertEqual(d, {'key': 'value1', 'key2': 'value2'})\n        self.assertEqual(len(d), 2)\n        self.assertEqual(sorted(d.keys()), ['key', 'key2'])\n        self.assertEqual(sorted(d.values()), ['value1', 'value2'])\n        self.assertEqual(sorted(d.items()), [('key', 'value1'),\n                                             ('key2', 'value2')])\n\n    def test_getone(self):\n        d = self.make_dict([('key', 'value1')], key='value2')\n        self.assertEqual(d.getone('key'), 'value1')\n        self.assertEqual(d.get('key'), 'value1')\n        self.assertEqual(d['key'], 'value1')\n\n        with self.assertRaises(KeyError):\n            d['key2']\n        with self.assertRaises(KeyError):\n            d.getone('key2')\n\n    def test_copy(self):\n        d1 = self.make_dict(key='value', a='b')\n\n        d2 = d1.copy()\n        self.assertEqual(d1, d2)\n        self.assertIsNot(d1, d2)\n\n    def test_values__contains(self):\n        d = self.make_dict([('key', 'one'), ('key', 'two'), ('key', 3)])\n        self.assertEqual(list(d.values()), ['one'])\n        self.assertEqual(list(d.values(getall=True)), ['one', 'two', 3])\n\n        self.assertIn('one', d.values())\n        self.assertNotIn('two', d.values())\n        self.assertNotIn(3, d.values())\n\n        self.assertIn('one', d.values(getall=True))\n        self.assertIn('two', d.values(getall=True))\n        self.assertIn(3, d.values(getall=True))\n\n        self.assertNotIn('foo', d.values())\n        self.assertNotIn('foo', d.values(getall=True))\n\n    def test_items__contains(self):\n        d = self.make_dict([('key', 'one'), ('key', 'two'), ('key', 3)])\n        self.assertEqual(list(d.items()), [('key', 'one')])\n        self.assertEqual(list(d.items(getall=True)),\n                         [('key', 'one'), ('key', 'two'), ('key', 3)])\n\n        self.assertIn(('key', 'one'), d.items())\n        self.assertNotIn(('key', 'two'), d.items())\n        self.assertNotIn(('key', 3), d.items())\n\n        self.assertIn(('key', 'one'), d.items(getall=True))\n        self.assertIn(('key', 'two'), d.items(getall=True))\n        self.assertIn(('key', 3), d.items(getall=True))\n\n        self.assertNotIn(('foo', 'bar'), d.items())\n        self.assertNotIn(('foo', 'bar'), d.items(getall=True))\n\n\nclass MultiDictTests(_BaseTest):\n\n    def make_dict(self, *args, **kwargs):\n        return MultiDict(*args, **kwargs)\n\n    def test__repr__(self):\n        d = self.make_dict()\n        self.assertEqual(str(d), \"<MultiDict OrderedDict()>\")\n        d = self.make_dict([('key', 'one'), ('key', 'two')])\n        self.assertEqual(str(d),\n                         \"<MultiDict OrderedDict([('key', ['one', 'two'])])>\")\n\n    def test_getall(self):\n        d = self.make_dict([('key', 'value1')], key='value2')\n\n        self.assertEqual(d, {'key': 'value1'})\n        self.assertEqual(len(d), 1)\n\n        self.assertEqual(d.getall('key'), ('value1', 'value2'))\n\n        with self.assertRaisesRegex(KeyError, \"some_key\"):\n            d.getall('some_key')\n\n\nclass CaseInsensitiveMultiDictTests(unittest.TestCase):\n\n    def make_dict(self, *args, **kwargs):\n        return CaseInsensitiveMultiDict(*args, **kwargs)\n\n    def test_basics(self):\n        d = self.make_dict([('KEY', 'value1')], KEY='value2')\n        self.assertEqual(d.getone('key'), 'value1')\n        self.assertEqual(d.get('key'), 'value1')\n        self.assertEqual(d.get('key2', 'val'), 'val')\n        self.assertEqual(d['key'], 'value1')\n        self.assertIn('key', d)\n\n        with self.assertRaises(KeyError):\n            d['key2']\n        with self.assertRaises(KeyError):\n            d.getone('key2')\n\n    def test_getall(self):\n        d = self.make_dict([('KEY', 'value1')], KEY='value2')\n\n        self.assertEqual(d, {'KEY': 'value1'})\n        self.assertEqual(len(d), 1)\n\n        self.assertEqual(d.getall('key'), ('value1', 'value2'))\n\n        with self.assertRaisesRegex(KeyError, \"SOME_KEY\"):\n            d.getall('some_key')\n\n\nclass MutableMultiDictTests(_BaseTest):\n\n    def make_dict(self, *args, **kwargs):\n        return MutableMultiDict(*args, **kwargs)\n\n    def test__repr__(self):\n        d = self.make_dict()\n        self.assertEqual(str(d), \"<MutableMultiDict OrderedDict()>\")\n        d = self.make_dict([('key', 'one'), ('key', 'two')])\n        self.assertEqual(\n            str(d),\n            \"<MutableMultiDict OrderedDict([('key', ['one', 'two'])])>\")\n\n    def test_getall(self):\n        d = self.make_dict([('key', 'value1')], key='value2')\n\n        self.assertEqual(d, {'key': 'value1'})\n        self.assertEqual(len(d), 1)\n\n        self.assertEqual(d.getall('key'), ['value1', 'value2'])\n\n        with self.assertRaisesRegex(KeyError, \"some_key\"):\n            d.getall('some_key')\n\n    def test_add(self):\n        d = self.make_dict()\n\n        self.assertEqual(d, {})\n        d['key'] = 'one'\n        self.assertEqual(d, {'key': 'one'})\n        self.assertEqual(d.getall('key'), ['one'])\n\n        d['key'] = 'two'\n        self.assertEqual(d, {'key': 'two'})\n        self.assertEqual(d.getall('key'), ['two'])\n\n        d.add('key', 'one')\n        self.assertEqual(d, {'key': 'two'})\n        self.assertEqual(d.getall('key'), ['two', 'one'])\n\n        d.add('foo', 'bar')\n        self.assertEqual(d, {'key': 'two', 'foo': 'bar'})\n        self.assertEqual(d.getall('foo'), ['bar'])\n\n    def test_extend(self):\n        d = self.make_dict()\n        self.assertEqual(d, {})\n\n        d.extend([('key', 'one'), ('key', 'two')], key=3, foo='bar')\n        self.assertEqual(d, {'key': 'one', 'foo': 'bar'})\n        self.assertEqual(list(d.items(getall=True)), [\n            ('key', 'one'), ('key', 'two'),\n            ('key', 3), ('foo', 'bar')])\n\n        other = self.make_dict(bar='baz')\n        self.assertEqual(other, {'bar': 'baz'})\n\n        d.extend(other)\n        self.assertEqual(d, {'key': 'one', 'foo': 'bar', 'bar': 'baz'})\n        self.assertEqual(list(d.items(getall=True)), [\n            ('key', 'one'), ('key', 'two'),\n            ('key', 3), ('foo', 'bar'),\n            ('bar', 'baz'),\n            ])\n\n        d.extend({'foo': 'moo'})\n        self.assertEqual(d, {'key': 'one', 'foo': 'bar', 'bar': 'baz'})\n        self.assertEqual(list(d.items(getall=True)), [\n            ('key', 'one'), ('key', 'two'),\n            ('key', 3), ('foo', 'bar'),\n            ('foo', 'moo'), ('bar', 'baz'),\n            ])\n\n        d.extend()\n        self.assertEqual(d, {'key': 'one', 'foo': 'bar', 'bar': 'baz'})\n        self.assertEqual(list(d.items(getall=True)), [\n            ('key', 'one'), ('key', 'two'),\n            ('key', 3), ('foo', 'bar'),\n            ('foo', 'moo'), ('bar', 'baz'),\n            ])\n\n        with self.assertRaises(TypeError):\n            d.extend('foo', 'bar')\n\n    def test_clear(self):\n        d = self.make_dict([('key', 'one')], key='two', foo='bar')\n        self.assertEqual(d, {'key': 'one', 'foo': 'bar'})\n\n        d.clear()\n        self.assertEqual(d, {})\n        self.assertEqual(list(d.items(getall=True)), [])\n\n    def test_del(self):\n        d = self.make_dict([('key', 'one'), ('key', 'two')], foo='bar')\n        self.assertEqual(d, {'key': 'one', 'foo': 'bar'})\n\n        del d['key']\n        self.assertEqual(d, {'foo': 'bar'})\n        self.assertEqual(list(d.items(getall=True)), [('foo', 'bar')])\n\n        with self.assertRaises(KeyError):\n            del d['key']\n\n    def test_not_implemented_methods(self):\n        d = self.make_dict()\n\n        with self.assertRaises(NotImplementedError):\n            d.pop('foo')\n        with self.assertRaises(NotImplementedError):\n            d.popitem()\n        with self.assertRaises(NotImplementedError):\n            d.update(bar='baz')\n",
            "new_file_content": "import unittest\n\nfrom aiohttp.multidict import \\\n    MultiDict, MutableMultiDict, CaseInsensitiveMultiDict\n\n\nclass _BaseTest(unittest.TestCase):\n\n    def make_dict(self, *args, **kwargs):\n        raise NotImplementedError\n\n    def test_instantiate__empty(self):\n        d = self.make_dict()\n        self.assertEqual(d, {})\n        self.assertEqual(len(d), 0)\n        self.assertEqual(list(d.keys()), [])\n        self.assertEqual(list(d.values()), [])\n        self.assertEqual(list(d.values(getall=True)), [])\n        self.assertEqual(list(d.items()), [])\n        self.assertEqual(list(d.items(getall=True)), [])\n\n        self.assertNotEqual(self.make_dict(), list())\n        with self.assertRaisesRegex(TypeError, \"\\(3 given\\)\"):\n            self.make_dict(('key1', 'value1'), ('key2', 'value2'))\n\n    def test_instantiate__from_arg0(self):\n        d = self.make_dict([('key', 'value1')])\n\n        self.assertEqual(d, {'key': 'value1'})\n        self.assertEqual(len(d), 1)\n        self.assertEqual(list(d.keys()), ['key'])\n        self.assertEqual(list(d.values()), ['value1'])\n        self.assertEqual(list(d.values(getall=True)), ['value1'])\n        self.assertEqual(list(d.items()), [('key', 'value1')])\n        self.assertEqual(list(d.items(getall=True)), [('key', 'value1')])\n\n    def test_instantiate__from_arg0_dict(self):\n        d = self.make_dict({'key': 'value1'})\n\n        self.assertEqual(d, {'key': 'value1'})\n        self.assertEqual(len(d), 1)\n        self.assertEqual(list(d.keys()), ['key'])\n        self.assertEqual(list(d.values()), ['value1'])\n        self.assertEqual(list(d.values(getall=True)), ['value1'])\n        self.assertEqual(list(d.items()), [('key', 'value1')])\n        self.assertEqual(list(d.items(getall=True)), [('key', 'value1')])\n\n    def test_instantiate__with_kwargs(self):\n        d = self.make_dict([('key', 'value1')], key2='value2')\n\n        self.assertEqual(d, {'key': 'value1', 'key2': 'value2'})\n        self.assertEqual(len(d), 2)\n        self.assertEqual(sorted(d.keys()), ['key', 'key2'])\n        self.assertEqual(sorted(d.values()), ['value1', 'value2'])\n        self.assertEqual(sorted(d.items()), [('key', 'value1'),\n                                             ('key2', 'value2')])\n\n    def test_getone(self):\n        d = self.make_dict([('key', 'value1')], key='value2')\n        self.assertEqual(d.getone('key'), 'value1')\n        self.assertEqual(d.get('key'), 'value1')\n        self.assertEqual(d['key'], 'value1')\n\n        with self.assertRaises(KeyError):\n            d['key2']\n        with self.assertRaises(KeyError):\n            d.getone('key2')\n\n    def test_copy(self):\n        d1 = self.make_dict(key='value', a='b')\n\n        d2 = d1.copy()\n        self.assertEqual(d1, d2)\n        self.assertIsNot(d1, d2)\n\n    def test_values__contains(self):\n        d = self.make_dict([('key', 'one'), ('key', 'two'), ('key', 3)])\n        self.assertEqual(list(d.values()), ['one'])\n        self.assertEqual(list(d.values(getall=True)), ['one', 'two', 3])\n\n        self.assertIn('one', d.values())\n        self.assertNotIn('two', d.values())\n        self.assertNotIn(3, d.values())\n\n        self.assertIn('one', d.values(getall=True))\n        self.assertIn('two', d.values(getall=True))\n        self.assertIn(3, d.values(getall=True))\n\n        self.assertNotIn('foo', d.values())\n        self.assertNotIn('foo', d.values(getall=True))\n\n    def test_items__contains(self):\n        d = self.make_dict([('key', 'one'), ('key', 'two'), ('key', 3)])\n        self.assertEqual(list(d.items()), [('key', 'one')])\n        self.assertEqual(list(d.items(getall=True)),\n                         [('key', 'one'), ('key', 'two'), ('key', 3)])\n\n        self.assertIn(('key', 'one'), d.items())\n        self.assertNotIn(('key', 'two'), d.items())\n        self.assertNotIn(('key', 3), d.items())\n\n        self.assertIn(('key', 'one'), d.items(getall=True))\n        self.assertIn(('key', 'two'), d.items(getall=True))\n        self.assertIn(('key', 3), d.items(getall=True))\n\n        self.assertNotIn(('foo', 'bar'), d.items())\n        self.assertNotIn(('foo', 'bar'), d.items(getall=True))\n\n\nclass MultiDictTests(_BaseTest):\n\n    def make_dict(self, *args, **kwargs):\n        return MultiDict(*args, **kwargs)\n\n    def test__repr__(self):\n        d = self.make_dict()\n        self.assertEqual(str(d), \"<MultiDict OrderedDict()>\")\n        d = self.make_dict([('key', 'one'), ('key', 'two')])\n        self.assertEqual(str(d),\n                         \"<MultiDict OrderedDict([('key', ['one', 'two'])])>\")\n\n    def test_getall(self):\n        d = self.make_dict([('key', 'value1')], key='value2')\n\n        self.assertEqual(d, {'key': 'value1'})\n        self.assertEqual(len(d), 1)\n\n        self.assertEqual(d.getall('key'), ('value1', 'value2'))\n\n        with self.assertRaisesRegex(KeyError, \"some_key\"):\n            d.getall('some_key')\n\n        default = object()\n        self.assertIs(d.getall('some_key', default), default)\n\n\nclass CaseInsensitiveMultiDictTests(unittest.TestCase):\n\n    def make_dict(self, *args, **kwargs):\n        return CaseInsensitiveMultiDict(*args, **kwargs)\n\n    def test_basics(self):\n        d = self.make_dict([('KEY', 'value1')], KEY='value2')\n        self.assertEqual(d.getone('key'), 'value1')\n        self.assertEqual(d.get('key'), 'value1')\n        self.assertEqual(d.get('key2', 'val'), 'val')\n        self.assertEqual(d['key'], 'value1')\n        self.assertIn('key', d)\n\n        with self.assertRaises(KeyError):\n            d['key2']\n        with self.assertRaises(KeyError):\n            d.getone('key2')\n\n    def test_getall(self):\n        d = self.make_dict([('KEY', 'value1')], KEY='value2')\n\n        self.assertEqual(d, {'KEY': 'value1'})\n        self.assertEqual(len(d), 1)\n\n        self.assertEqual(d.getall('key'), ('value1', 'value2'))\n\n        with self.assertRaisesRegex(KeyError, \"SOME_KEY\"):\n            d.getall('some_key')\n\n\nclass MutableMultiDictTests(_BaseTest):\n\n    def make_dict(self, *args, **kwargs):\n        return MutableMultiDict(*args, **kwargs)\n\n    def test__repr__(self):\n        d = self.make_dict()\n        self.assertEqual(str(d), \"<MutableMultiDict OrderedDict()>\")\n        d = self.make_dict([('key', 'one'), ('key', 'two')])\n        self.assertEqual(\n            str(d),\n            \"<MutableMultiDict OrderedDict([('key', ['one', 'two'])])>\")\n\n    def test_getall(self):\n        d = self.make_dict([('key', 'value1')], key='value2')\n\n        self.assertEqual(d, {'key': 'value1'})\n        self.assertEqual(len(d), 1)\n\n        self.assertEqual(d.getall('key'), ['value1', 'value2'])\n\n        with self.assertRaisesRegex(KeyError, \"some_key\"):\n            d.getall('some_key')\n\n    def test_add(self):\n        d = self.make_dict()\n\n        self.assertEqual(d, {})\n        d['key'] = 'one'\n        self.assertEqual(d, {'key': 'one'})\n        self.assertEqual(d.getall('key'), ['one'])\n\n        d['key'] = 'two'\n        self.assertEqual(d, {'key': 'two'})\n        self.assertEqual(d.getall('key'), ['two'])\n\n        d.add('key', 'one')\n        self.assertEqual(d, {'key': 'two'})\n        self.assertEqual(d.getall('key'), ['two', 'one'])\n\n        d.add('foo', 'bar')\n        self.assertEqual(d, {'key': 'two', 'foo': 'bar'})\n        self.assertEqual(d.getall('foo'), ['bar'])\n\n    def test_extend(self):\n        d = self.make_dict()\n        self.assertEqual(d, {})\n\n        d.extend([('key', 'one'), ('key', 'two')], key=3, foo='bar')\n        self.assertEqual(d, {'key': 'one', 'foo': 'bar'})\n        self.assertEqual(list(d.items(getall=True)), [\n            ('key', 'one'), ('key', 'two'),\n            ('key', 3), ('foo', 'bar')])\n\n        other = self.make_dict(bar='baz')\n        self.assertEqual(other, {'bar': 'baz'})\n\n        d.extend(other)\n        self.assertEqual(d, {'key': 'one', 'foo': 'bar', 'bar': 'baz'})\n        self.assertEqual(list(d.items(getall=True)), [\n            ('key', 'one'), ('key', 'two'),\n            ('key', 3), ('foo', 'bar'),\n            ('bar', 'baz'),\n            ])\n\n        d.extend({'foo': 'moo'})\n        self.assertEqual(d, {'key': 'one', 'foo': 'bar', 'bar': 'baz'})\n        self.assertEqual(list(d.items(getall=True)), [\n            ('key', 'one'), ('key', 'two'),\n            ('key', 3), ('foo', 'bar'),\n            ('foo', 'moo'), ('bar', 'baz'),\n            ])\n\n        d.extend()\n        self.assertEqual(d, {'key': 'one', 'foo': 'bar', 'bar': 'baz'})\n        self.assertEqual(list(d.items(getall=True)), [\n            ('key', 'one'), ('key', 'two'),\n            ('key', 3), ('foo', 'bar'),\n            ('foo', 'moo'), ('bar', 'baz'),\n            ])\n\n        with self.assertRaises(TypeError):\n            d.extend('foo', 'bar')\n\n    def test_clear(self):\n        d = self.make_dict([('key', 'one')], key='two', foo='bar')\n        self.assertEqual(d, {'key': 'one', 'foo': 'bar'})\n\n        d.clear()\n        self.assertEqual(d, {})\n        self.assertEqual(list(d.items(getall=True)), [])\n\n    def test_del(self):\n        d = self.make_dict([('key', 'one'), ('key', 'two')], foo='bar')\n        self.assertEqual(d, {'key': 'one', 'foo': 'bar'})\n\n        del d['key']\n        self.assertEqual(d, {'foo': 'bar'})\n        self.assertEqual(list(d.items(getall=True)), [('foo', 'bar')])\n\n        with self.assertRaises(KeyError):\n            del d['key']\n\n    def test_not_implemented_methods(self):\n        d = self.make_dict()\n\n        with self.assertRaises(NotImplementedError):\n            d.pop('foo')\n        with self.assertRaises(NotImplementedError):\n            d.popitem()\n        with self.assertRaises(NotImplementedError):\n            d.update(bar='baz')\n",
            "header": {
                "file": {
                    "path": "tests/test_multidict.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "b6ccd05d",
                "new_commit_hash": "8d3a7b33",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/tests/test_multidict.py"
            },
            "plus_file": {
                "path": "b/tests/test_multidict.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 130,
                            "length": 6
                        },
                        "new_range": {
                            "start": 130,
                            "length": 9
                        },
                        "section": "class MultiDictTests(_BaseTest):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        with self.assertRaisesRegex(KeyError, \"some_key\"):",
                                "type": "context"
                            },
                            {
                                "content": "            d.getall('some_key')",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        default = object()",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertIs(d.getall('some_key', default), default)",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "class CaseInsensitiveMultiDictTests(unittest.TestCase):",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "tests/test_multidict.py",
                            "type": "class",
                            "name": "MultiDictTests",
                            "content": "class MultiDictTests(_BaseTest):\n\n    def make_dict(self, *args, **kwargs):\n        return MultiDict(*args, **kwargs)\n\n    def test__repr__(self):\n        d = self.make_dict()\n        self.assertEqual(str(d), \"<MultiDict OrderedDict()>\")\n        d = self.make_dict([('key', 'one'), ('key', 'two')])\n        self.assertEqual(str(d),\n                         \"<MultiDict OrderedDict([('key', ['one', 'two'])])>\")\n\n    def test_getall(self):\n        d = self.make_dict([('key', 'value1')], key='value2')\n\n        self.assertEqual(d, {'key': 'value1'})\n        self.assertEqual(len(d), 1)\n\n        self.assertEqual(d.getall('key'), ('value1', 'value2'))\n\n        with self.assertRaisesRegex(KeyError, \"some_key\"):\n            d.getall('some_key')\n\n        default = object()\n        self.assertIs(d.getall('some_key', default), default)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 110,
                            "end_lineno": 134,
                            "parent": null
                        },
                        {
                            "file_name": "tests/test_multidict.py",
                            "type": "method",
                            "name": "MultiDictTests.test_getall",
                            "content": "class MultiDictTests(_BaseTest):\n\n    def make_dict(self, *args, **kwargs):\n        return MultiDict(*args, **kwargs)\n\n    def test__repr__(self):\n        d = self.make_dict()\n        self.assertEqual(str(d), \"<MultiDict OrderedDict()>\")\n        d = self.make_dict([('key', 'one'), ('key', 'two')])\n        self.assertEqual(str(d),\n                         \"<MultiDict OrderedDict([('key', ['one', 'two'])])>\")\n\n    def test_getall(self):\n        d = self.make_dict([('key', 'value1')], key='value2')\n\n        self.assertEqual(d, {'key': 'value1'})\n        self.assertEqual(len(d), 1)\n\n        self.assertEqual(d.getall('key'), ('value1', 'value2'))\n\n        with self.assertRaisesRegex(KeyError, \"some_key\"):\n            d.getall('some_key')\n\n        default = object()\n        self.assertIs(d.getall('some_key', default), default)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 122,
                            "end_lineno": 134,
                            "parent": {
                                "file_name": "tests/test_multidict.py",
                                "type": "class",
                                "name": "MultiDictTests",
                                "content": "class MultiDictTests(_BaseTest):\n\n    def make_dict(self, *args, **kwargs):\n        return MultiDict(*args, **kwargs)\n\n    def test__repr__(self):\n        d = self.make_dict()\n        self.assertEqual(str(d), \"<MultiDict OrderedDict()>\")\n        d = self.make_dict([('key', 'one'), ('key', 'two')])\n        self.assertEqual(str(d),\n                         \"<MultiDict OrderedDict([('key', ['one', 'two'])])>\")\n\n    def test_getall(self):\n        d = self.make_dict([('key', 'value1')], key='value2')\n\n        self.assertEqual(d, {'key': 'value1'})\n        self.assertEqual(len(d), 1)\n\n        self.assertEqual(d.getall('key'), ('value1', 'value2'))\n\n        with self.assertRaisesRegex(KeyError, \"some_key\"):\n            d.getall('some_key')\n\n        default = object()\n        self.assertIs(d.getall('some_key', default), default)",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 110,
                                "end_lineno": 134,
                                "parent": null
                            }
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        }
    ],
    "old_commit_hash": "ea948a4a984d2db4fceb42e6706f87e21cfea6a5^",
    "new_commit_hash": "ea948a4a984d2db4fceb42e6706f87e21cfea6a5",
    "commit_message": "MultiDict.getall() accepts default value",
    "commit_date": "2014-06-14T10:29:56-07:00",
    "metadata": {}
}
{
    "repo_name": "aiohttp",
    "new_commit_hash": "ea948a4a984d2db4fceb42e6706f87e21cfea6a5",
    "test_file_codes": [
        "import unittest\n\nfrom aiohttp.multidict import \\\n    MultiDict, MutableMultiDict, CaseInsensitiveMultiDict\n\n\nclass _BaseTest(unittest.TestCase):\n\n    def make_dict(self, *args, **kwargs):\n        raise NotImplementedError\n\n    def test_instantiate__empty(self):\n        d = self.make_dict()\n        self.assertEqual(d, {})\n        self.assertEqual(len(d), 0)\n        self.assertEqual(list(d.keys()), [])\n        self.assertEqual(list(d.values()), [])\n        self.assertEqual(list(d.values(getall=True)), [])\n        self.assertEqual(list(d.items()), [])\n        self.assertEqual(list(d.items(getall=True)), [])\n\n        self.assertNotEqual(self.make_dict(), list())\n        with self.assertRaisesRegex(TypeError, \"\\(3 given\\)\"):\n            self.make_dict(('key1', 'value1'), ('key2', 'value2'))\n\n    def test_instantiate__from_arg0(self):\n        d = self.make_dict([('key', 'value1')])\n\n        self.assertEqual(d, {'key': 'value1'})\n        self.assertEqual(len(d), 1)\n        self.assertEqual(list(d.keys()), ['key'])\n        self.assertEqual(list(d.values()), ['value1'])\n        self.assertEqual(list(d.values(getall=True)), ['value1'])\n        self.assertEqual(list(d.items()), [('key', 'value1')])\n        self.assertEqual(list(d.items(getall=True)), [('key', 'value1')])\n\n    def test_instantiate__from_arg0_dict(self):\n        d = self.make_dict({'key': 'value1'})\n\n        self.assertEqual(d, {'key': 'value1'})\n        self.assertEqual(len(d), 1)\n        self.assertEqual(list(d.keys()), ['key'])\n        self.assertEqual(list(d.values()), ['value1'])\n        self.assertEqual(list(d.values(getall=True)), ['value1'])\n        self.assertEqual(list(d.items()), [('key', 'value1')])\n        self.assertEqual(list(d.items(getall=True)), [('key', 'value1')])\n\n    def test_instantiate__with_kwargs(self):\n        d = self.make_dict([('key', 'value1')], key2='value2')\n\n        self.assertEqual(d, {'key': 'value1', 'key2': 'value2'})\n        self.assertEqual(len(d), 2)\n        self.assertEqual(sorted(d.keys()), ['key', 'key2'])\n        self.assertEqual(sorted(d.values()), ['value1', 'value2'])\n        self.assertEqual(sorted(d.items()), [('key', 'value1'),\n                                             ('key2', 'value2')])\n\n    def test_getone(self):\n        d = self.make_dict([('key', 'value1')], key='value2')\n        self.assertEqual(d.getone('key'), 'value1')\n        self.assertEqual(d.get('key'), 'value1')\n        self.assertEqual(d['key'], 'value1')\n\n        with self.assertRaises(KeyError):\n            d['key2']\n        with self.assertRaises(KeyError):\n            d.getone('key2')\n\n    def test_copy(self):\n        d1 = self.make_dict(key='value', a='b')\n\n        d2 = d1.copy()\n        self.assertEqual(d1, d2)\n        self.assertIsNot(d1, d2)\n\n    def test_values__contains(self):\n        d = self.make_dict([('key', 'one'), ('key', 'two'), ('key', 3)])\n        self.assertEqual(list(d.values()), ['one'])\n        self.assertEqual(list(d.values(getall=True)), ['one', 'two', 3])\n\n        self.assertIn('one', d.values())\n        self.assertNotIn('two', d.values())\n        self.assertNotIn(3, d.values())\n\n        self.assertIn('one', d.values(getall=True))\n        self.assertIn('two', d.values(getall=True))\n        self.assertIn(3, d.values(getall=True))\n\n        self.assertNotIn('foo', d.values())\n        self.assertNotIn('foo', d.values(getall=True))\n\n    def test_items__contains(self):\n        d = self.make_dict([('key', 'one'), ('key', 'two'), ('key', 3)])\n        self.assertEqual(list(d.items()), [('key', 'one')])\n        self.assertEqual(list(d.items(getall=True)),\n                         [('key', 'one'), ('key', 'two'), ('key', 3)])\n\n        self.assertIn(('key', 'one'), d.items())\n        self.assertNotIn(('key', 'two'), d.items())\n        self.assertNotIn(('key', 3), d.items())\n\n        self.assertIn(('key', 'one'), d.items(getall=True))\n        self.assertIn(('key', 'two'), d.items(getall=True))\n        self.assertIn(('key', 3), d.items(getall=True))\n\n        self.assertNotIn(('foo', 'bar'), d.items())\n        self.assertNotIn(('foo', 'bar'), d.items(getall=True))\n\n\nclass MultiDictTests(_BaseTest):\n\n    def make_dict(self, *args, **kwargs):\n        return MultiDict(*args, **kwargs)\n\n    def test__repr__(self):\n        d = self.make_dict()\n        self.assertEqual(str(d), \"<MultiDict OrderedDict()>\")\n        d = self.make_dict([('key', 'one'), ('key', 'two')])\n        self.assertEqual(str(d),\n                         \"<MultiDict OrderedDict([('key', ['one', 'two'])])>\")\n\n    def test_getall(self):\n        d = self.make_dict([('key', 'value1')], key='value2')\n\n        self.assertEqual(d, {'key': 'value1'})\n        self.assertEqual(len(d), 1)\n\n        self.assertEqual(d.getall('key'), ('value1', 'value2'))\n\n        with self.assertRaisesRegex(KeyError, \"some_key\"):\n            d.getall('some_key')\n\n        default = object()\n        self.assertIs(d.getall('some_key', default), default)\n\n\nclass CaseInsensitiveMultiDictTests(unittest.TestCase):\n\n    def make_dict(self, *args, **kwargs):\n        return CaseInsensitiveMultiDict(*args, **kwargs)\n\n    def test_basics(self):\n        d = self.make_dict([('KEY', 'value1')], KEY='value2')\n        self.assertEqual(d.getone('key'), 'value1')\n        self.assertEqual(d.get('key'), 'value1')\n        self.assertEqual(d.get('key2', 'val'), 'val')\n        self.assertEqual(d['key'], 'value1')\n        self.assertIn('key', d)\n\n        with self.assertRaises(KeyError):\n            d['key2']\n        with self.assertRaises(KeyError):\n            d.getone('key2')\n\n    def test_getall(self):\n        d = self.make_dict([('KEY', 'value1')], KEY='value2')\n\n        self.assertEqual(d, {'KEY': 'value1'})\n        self.assertEqual(len(d), 1)\n\n        self.assertEqual(d.getall('key'), ('value1', 'value2'))\n\n        with self.assertRaisesRegex(KeyError, \"SOME_KEY\"):\n            d.getall('some_key')\n\n\nclass MutableMultiDictTests(_BaseTest):\n\n    def make_dict(self, *args, **kwargs):\n        return MutableMultiDict(*args, **kwargs)\n\n    def test__repr__(self):\n        d = self.make_dict()\n        self.assertEqual(str(d), \"<MutableMultiDict OrderedDict()>\")\n        d = self.make_dict([('key', 'one'), ('key', 'two')])\n        self.assertEqual(\n            str(d),\n            \"<MutableMultiDict OrderedDict([('key', ['one', 'two'])])>\")\n\n    def test_getall(self):\n        d = self.make_dict([('key', 'value1')], key='value2')\n\n        self.assertEqual(d, {'key': 'value1'})\n        self.assertEqual(len(d), 1)\n\n        self.assertEqual(d.getall('key'), ['value1', 'value2'])\n\n        with self.assertRaisesRegex(KeyError, \"some_key\"):\n            d.getall('some_key')\n\n    def test_add(self):\n        d = self.make_dict()\n\n        self.assertEqual(d, {})\n        d['key'] = 'one'\n        self.assertEqual(d, {'key': 'one'})\n        self.assertEqual(d.getall('key'), ['one'])\n\n        d['key'] = 'two'\n        self.assertEqual(d, {'key': 'two'})\n        self.assertEqual(d.getall('key'), ['two'])\n\n        d.add('key', 'one')\n        self.assertEqual(d, {'key': 'two'})\n        self.assertEqual(d.getall('key'), ['two', 'one'])\n\n        d.add('foo', 'bar')\n        self.assertEqual(d, {'key': 'two', 'foo': 'bar'})\n        self.assertEqual(d.getall('foo'), ['bar'])\n\n    def test_extend(self):\n        d = self.make_dict()\n        self.assertEqual(d, {})\n\n        d.extend([('key', 'one'), ('key', 'two')], key=3, foo='bar')\n        self.assertEqual(d, {'key': 'one', 'foo': 'bar'})\n        self.assertEqual(list(d.items(getall=True)), [\n            ('key', 'one'), ('key', 'two'),\n            ('key', 3), ('foo', 'bar')])\n\n        other = self.make_dict(bar='baz')\n        self.assertEqual(other, {'bar': 'baz'})\n\n        d.extend(other)\n        self.assertEqual(d, {'key': 'one', 'foo': 'bar', 'bar': 'baz'})\n        self.assertEqual(list(d.items(getall=True)), [\n            ('key', 'one'), ('key', 'two'),\n            ('key', 3), ('foo', 'bar'),\n            ('bar', 'baz'),\n            ])\n\n        d.extend({'foo': 'moo'})\n        self.assertEqual(d, {'key': 'one', 'foo': 'bar', 'bar': 'baz'})\n        self.assertEqual(list(d.items(getall=True)), [\n            ('key', 'one'), ('key', 'two'),\n            ('key', 3), ('foo', 'bar'),\n            ('foo', 'moo'), ('bar', 'baz'),\n            ])\n\n        d.extend()\n        self.assertEqual(d, {'key': 'one', 'foo': 'bar', 'bar': 'baz'})\n        self.assertEqual(list(d.items(getall=True)), [\n            ('key', 'one'), ('key', 'two'),\n            ('key', 3), ('foo', 'bar'),\n            ('foo', 'moo'), ('bar', 'baz'),\n            ])\n\n        with self.assertRaises(TypeError):\n            d.extend('foo', 'bar')\n\n    def test_clear(self):\n        d = self.make_dict([('key', 'one')], key='two', foo='bar')\n        self.assertEqual(d, {'key': 'one', 'foo': 'bar'})\n\n        d.clear()\n        self.assertEqual(d, {})\n        self.assertEqual(list(d.items(getall=True)), [])\n\n    def test_del(self):\n        d = self.make_dict([('key', 'one'), ('key', 'two')], foo='bar')\n        self.assertEqual(d, {'key': 'one', 'foo': 'bar'})\n\n        del d['key']\n        self.assertEqual(d, {'foo': 'bar'})\n        self.assertEqual(list(d.items(getall=True)), [('foo', 'bar')])\n\n        with self.assertRaises(KeyError):\n            del d['key']\n\n    def test_not_implemented_methods(self):\n        d = self.make_dict()\n\n        with self.assertRaises(NotImplementedError):\n            d.pop('foo')\n        with self.assertRaises(NotImplementedError):\n            d.popitem()\n        with self.assertRaises(NotImplementedError):\n            d.update(bar='baz')\n"
    ],
    "test_file_names": [
        "test_1.py"
    ],
    "setup_res_code": 0,
    "setup_res_stdout": "Transforming aiohttp/worker.py\nTransforming aiohttp/server.py\nTransforming aiohttp/client.py\n",
    "setup_res_stderr": "Using CPython 3.9.21\nCreating virtual environment at: .venv\nActivate with: source .venv/bin/activate\nmake: *** No rule to make target '.develop'.  Stop.\nResolved 26 packages in 25ms\nInstalled 26 packages in 29ms\n + async-generator==1.10\n + async-timeout==5.0.1\n + brotlipy==0.7.0\n + cffi==1.17.1\n + chardet==5.2.0\n + coverage==7.6.10\n + cryptography==44.0.0\n + cython==3.0.11\n + exceptiongroup==1.2.2\n + gunicorn==23.0.0\n + idna==3.10\n + iniconfig==2.0.0\n + multdict==0.0.5\n + multidict==6.1.0\n + packaging==24.2\n + pluggy==1.5.0\n + propcache==0.2.1\n + pycparser==2.22\n + pytest==8.3.4\n + pytest-asyncio==0.25.1\n + pytest-cov==6.0.0\n + pytest-mock==3.14.0\n + tomli==2.2.1\n + trustme==1.2.1\n + typing-extensions==4.12.2\n + yarl==1.18.3\n",
    "new_commit_res_code": 1,
    "new_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.9.21, pytest-8.3.4, pluggy-1.5.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/aiohttp_ea948a4a984d2db4fceb42e6706f87e21cfea6a5\nplugins: mock-3.14.0, asyncio-0.25.1, cov-6.0.0\nasyncio: mode=strict, asyncio_default_fixture_loop_scope=None\ncollected 35 items\n\nr2e_tests/test_1.py FFFFFFFF...........................                  [100%]\n\n=================================== FAILURES ===================================\n_____________________________ _BaseTest.test_copy ______________________________\n\nself = <r2e_tests.test_1._BaseTest testMethod=test_copy>\n\n    def test_copy(self):\n>       d1 = self.make_dict(key='value', a='b')\n\nr2e_tests/test_1.py:70: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <r2e_tests.test_1._BaseTest testMethod=test_copy>, args = ()\nkwargs = {'a': 'b', 'key': 'value'}\n\n    def make_dict(self, *args, **kwargs):\n>       raise NotImplementedError\nE       NotImplementedError\n\nr2e_tests/test_1.py:10: NotImplementedError\n____________________________ _BaseTest.test_getone _____________________________\n\nself = <r2e_tests.test_1._BaseTest testMethod=test_getone>\n\n    def test_getone(self):\n>       d = self.make_dict([('key', 'value1')], key='value2')\n\nr2e_tests/test_1.py:59: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <r2e_tests.test_1._BaseTest testMethod=test_getone>\nargs = ([('key', 'value1')],), kwargs = {'key': 'value2'}\n\n    def make_dict(self, *args, **kwargs):\n>       raise NotImplementedError\nE       NotImplementedError\n\nr2e_tests/test_1.py:10: NotImplementedError\n______________________ _BaseTest.test_instantiate__empty _______________________\n\nself = <r2e_tests.test_1._BaseTest testMethod=test_instantiate__empty>\n\n    def test_instantiate__empty(self):\n>       d = self.make_dict()\n\nr2e_tests/test_1.py:13: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <r2e_tests.test_1._BaseTest testMethod=test_instantiate__empty>\nargs = (), kwargs = {}\n\n    def make_dict(self, *args, **kwargs):\n>       raise NotImplementedError\nE       NotImplementedError\n\nr2e_tests/test_1.py:10: NotImplementedError\n____________________ _BaseTest.test_instantiate__from_arg0 _____________________\n\nself = <r2e_tests.test_1._BaseTest testMethod=test_instantiate__from_arg0>\n\n    def test_instantiate__from_arg0(self):\n>       d = self.make_dict([('key', 'value1')])\n\nr2e_tests/test_1.py:27: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <r2e_tests.test_1._BaseTest testMethod=test_instantiate__from_arg0>\nargs = ([('key', 'value1')],), kwargs = {}\n\n    def make_dict(self, *args, **kwargs):\n>       raise NotImplementedError\nE       NotImplementedError\n\nr2e_tests/test_1.py:10: NotImplementedError\n__________________ _BaseTest.test_instantiate__from_arg0_dict __________________\n\nself = <r2e_tests.test_1._BaseTest testMethod=test_instantiate__from_arg0_dict>\n\n    def test_instantiate__from_arg0_dict(self):\n>       d = self.make_dict({'key': 'value1'})\n\nr2e_tests/test_1.py:38: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <r2e_tests.test_1._BaseTest testMethod=test_instantiate__from_arg0_dict>\nargs = ({'key': 'value1'},), kwargs = {}\n\n    def make_dict(self, *args, **kwargs):\n>       raise NotImplementedError\nE       NotImplementedError\n\nr2e_tests/test_1.py:10: NotImplementedError\n___________________ _BaseTest.test_instantiate__with_kwargs ____________________\n\nself = <r2e_tests.test_1._BaseTest testMethod=test_instantiate__with_kwargs>\n\n    def test_instantiate__with_kwargs(self):\n>       d = self.make_dict([('key', 'value1')], key2='value2')\n\nr2e_tests/test_1.py:49: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <r2e_tests.test_1._BaseTest testMethod=test_instantiate__with_kwargs>\nargs = ([('key', 'value1')],), kwargs = {'key2': 'value2'}\n\n    def make_dict(self, *args, **kwargs):\n>       raise NotImplementedError\nE       NotImplementedError\n\nr2e_tests/test_1.py:10: NotImplementedError\n________________________ _BaseTest.test_items__contains ________________________\n\nself = <r2e_tests.test_1._BaseTest testMethod=test_items__contains>\n\n    def test_items__contains(self):\n>       d = self.make_dict([('key', 'one'), ('key', 'two'), ('key', 3)])\n\nr2e_tests/test_1.py:93: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <r2e_tests.test_1._BaseTest testMethod=test_items__contains>\nargs = ([('key', 'one'), ('key', 'two'), ('key', 3)],), kwargs = {}\n\n    def make_dict(self, *args, **kwargs):\n>       raise NotImplementedError\nE       NotImplementedError\n\nr2e_tests/test_1.py:10: NotImplementedError\n_______________________ _BaseTest.test_values__contains ________________________\n\nself = <r2e_tests.test_1._BaseTest testMethod=test_values__contains>\n\n    def test_values__contains(self):\n>       d = self.make_dict([('key', 'one'), ('key', 'two'), ('key', 3)])\n\nr2e_tests/test_1.py:77: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <r2e_tests.test_1._BaseTest testMethod=test_values__contains>\nargs = ([('key', 'one'), ('key', 'two'), ('key', 3)],), kwargs = {}\n\n    def make_dict(self, *args, **kwargs):\n>       raise NotImplementedError\nE       NotImplementedError\n\nr2e_tests/test_1.py:10: NotImplementedError\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::MultiDictTests::test__repr__\nPASSED r2e_tests/test_1.py::MultiDictTests::test_copy\nPASSED r2e_tests/test_1.py::MultiDictTests::test_getall\nPASSED r2e_tests/test_1.py::MultiDictTests::test_getone\nPASSED r2e_tests/test_1.py::MultiDictTests::test_instantiate__empty\nPASSED r2e_tests/test_1.py::MultiDictTests::test_instantiate__from_arg0\nPASSED r2e_tests/test_1.py::MultiDictTests::test_instantiate__from_arg0_dict\nPASSED r2e_tests/test_1.py::MultiDictTests::test_instantiate__with_kwargs\nPASSED r2e_tests/test_1.py::MultiDictTests::test_items__contains\nPASSED r2e_tests/test_1.py::MultiDictTests::test_values__contains\nPASSED r2e_tests/test_1.py::CaseInsensitiveMultiDictTests::test_basics\nPASSED r2e_tests/test_1.py::CaseInsensitiveMultiDictTests::test_getall\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test__repr__\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test_add\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test_clear\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test_copy\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test_del\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test_extend\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test_getall\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test_getone\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test_instantiate__empty\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test_instantiate__from_arg0\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test_instantiate__from_arg0_dict\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test_instantiate__with_kwargs\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test_items__contains\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test_not_implemented_methods\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test_values__contains\nFAILED r2e_tests/test_1.py::_BaseTest::test_copy - NotImplementedError\nFAILED r2e_tests/test_1.py::_BaseTest::test_getone - NotImplementedError\nFAILED r2e_tests/test_1.py::_BaseTest::test_instantiate__empty - NotImplement...\nFAILED r2e_tests/test_1.py::_BaseTest::test_instantiate__from_arg0 - NotImple...\nFAILED r2e_tests/test_1.py::_BaseTest::test_instantiate__from_arg0_dict - Not...\nFAILED r2e_tests/test_1.py::_BaseTest::test_instantiate__with_kwargs - NotImp...\nFAILED r2e_tests/test_1.py::_BaseTest::test_items__contains - NotImplementedE...\nFAILED r2e_tests/test_1.py::_BaseTest::test_values__contains - NotImplemented...\n========================= 8 failed, 27 passed in 0.31s =========================\n",
    "new_commit_res_stderr": "/home/gcpuser/buckets/local_repoeval_bucket/repos/aiohttp_ea948a4a984d2db4fceb42e6706f87e21cfea6a5/.venv/lib/python3.9/site-packages/pytest_asyncio/plugin.py:207: PytestDeprecationWarning: The configuration option \"asyncio_default_fixture_loop_scope\" is unset.\nThe event loop scope for asynchronous fixtures will default to the fixture caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to function scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: \"function\", \"class\", \"module\", \"package\", \"session\"\n\n  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))\n",
    "old_commit_res_code": 1,
    "old_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.9.21, pytest-8.3.4, pluggy-1.5.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/aiohttp_ea948a4a984d2db4fceb42e6706f87e21cfea6a5\nplugins: mock-3.14.0, asyncio-0.25.1, cov-6.0.0\nasyncio: mode=strict, asyncio_default_fixture_loop_scope=None\ncollected 35 items\n\nr2e_tests/test_1.py FFFFFFFF..F........................                  [100%]\n\n=================================== FAILURES ===================================\n_____________________________ _BaseTest.test_copy ______________________________\n\nself = <r2e_tests.test_1._BaseTest testMethod=test_copy>\n\n    def test_copy(self):\n>       d1 = self.make_dict(key='value', a='b')\n\nr2e_tests/test_1.py:70: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <r2e_tests.test_1._BaseTest testMethod=test_copy>, args = ()\nkwargs = {'a': 'b', 'key': 'value'}\n\n    def make_dict(self, *args, **kwargs):\n>       raise NotImplementedError\nE       NotImplementedError\n\nr2e_tests/test_1.py:10: NotImplementedError\n____________________________ _BaseTest.test_getone _____________________________\n\nself = <r2e_tests.test_1._BaseTest testMethod=test_getone>\n\n    def test_getone(self):\n>       d = self.make_dict([('key', 'value1')], key='value2')\n\nr2e_tests/test_1.py:59: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <r2e_tests.test_1._BaseTest testMethod=test_getone>\nargs = ([('key', 'value1')],), kwargs = {'key': 'value2'}\n\n    def make_dict(self, *args, **kwargs):\n>       raise NotImplementedError\nE       NotImplementedError\n\nr2e_tests/test_1.py:10: NotImplementedError\n______________________ _BaseTest.test_instantiate__empty _______________________\n\nself = <r2e_tests.test_1._BaseTest testMethod=test_instantiate__empty>\n\n    def test_instantiate__empty(self):\n>       d = self.make_dict()\n\nr2e_tests/test_1.py:13: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <r2e_tests.test_1._BaseTest testMethod=test_instantiate__empty>\nargs = (), kwargs = {}\n\n    def make_dict(self, *args, **kwargs):\n>       raise NotImplementedError\nE       NotImplementedError\n\nr2e_tests/test_1.py:10: NotImplementedError\n____________________ _BaseTest.test_instantiate__from_arg0 _____________________\n\nself = <r2e_tests.test_1._BaseTest testMethod=test_instantiate__from_arg0>\n\n    def test_instantiate__from_arg0(self):\n>       d = self.make_dict([('key', 'value1')])\n\nr2e_tests/test_1.py:27: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <r2e_tests.test_1._BaseTest testMethod=test_instantiate__from_arg0>\nargs = ([('key', 'value1')],), kwargs = {}\n\n    def make_dict(self, *args, **kwargs):\n>       raise NotImplementedError\nE       NotImplementedError\n\nr2e_tests/test_1.py:10: NotImplementedError\n__________________ _BaseTest.test_instantiate__from_arg0_dict __________________\n\nself = <r2e_tests.test_1._BaseTest testMethod=test_instantiate__from_arg0_dict>\n\n    def test_instantiate__from_arg0_dict(self):\n>       d = self.make_dict({'key': 'value1'})\n\nr2e_tests/test_1.py:38: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <r2e_tests.test_1._BaseTest testMethod=test_instantiate__from_arg0_dict>\nargs = ({'key': 'value1'},), kwargs = {}\n\n    def make_dict(self, *args, **kwargs):\n>       raise NotImplementedError\nE       NotImplementedError\n\nr2e_tests/test_1.py:10: NotImplementedError\n___________________ _BaseTest.test_instantiate__with_kwargs ____________________\n\nself = <r2e_tests.test_1._BaseTest testMethod=test_instantiate__with_kwargs>\n\n    def test_instantiate__with_kwargs(self):\n>       d = self.make_dict([('key', 'value1')], key2='value2')\n\nr2e_tests/test_1.py:49: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <r2e_tests.test_1._BaseTest testMethod=test_instantiate__with_kwargs>\nargs = ([('key', 'value1')],), kwargs = {'key2': 'value2'}\n\n    def make_dict(self, *args, **kwargs):\n>       raise NotImplementedError\nE       NotImplementedError\n\nr2e_tests/test_1.py:10: NotImplementedError\n________________________ _BaseTest.test_items__contains ________________________\n\nself = <r2e_tests.test_1._BaseTest testMethod=test_items__contains>\n\n    def test_items__contains(self):\n>       d = self.make_dict([('key', 'one'), ('key', 'two'), ('key', 3)])\n\nr2e_tests/test_1.py:93: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <r2e_tests.test_1._BaseTest testMethod=test_items__contains>\nargs = ([('key', 'one'), ('key', 'two'), ('key', 3)],), kwargs = {}\n\n    def make_dict(self, *args, **kwargs):\n>       raise NotImplementedError\nE       NotImplementedError\n\nr2e_tests/test_1.py:10: NotImplementedError\n_______________________ _BaseTest.test_values__contains ________________________\n\nself = <r2e_tests.test_1._BaseTest testMethod=test_values__contains>\n\n    def test_values__contains(self):\n>       d = self.make_dict([('key', 'one'), ('key', 'two'), ('key', 3)])\n\nr2e_tests/test_1.py:77: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <r2e_tests.test_1._BaseTest testMethod=test_values__contains>\nargs = ([('key', 'one'), ('key', 'two'), ('key', 3)],), kwargs = {}\n\n    def make_dict(self, *args, **kwargs):\n>       raise NotImplementedError\nE       NotImplementedError\n\nr2e_tests/test_1.py:10: NotImplementedError\n__________________________ MultiDictTests.test_getall __________________________\n\nself = <r2e_tests.test_1.MultiDictTests testMethod=test_getall>\n\n    def test_getall(self):\n        d = self.make_dict([('key', 'value1')], key='value2')\n    \n        self.assertEqual(d, {'key': 'value1'})\n        self.assertEqual(len(d), 1)\n    \n        self.assertEqual(d.getall('key'), ('value1', 'value2'))\n    \n        with self.assertRaisesRegex(KeyError, \"some_key\"):\n            d.getall('some_key')\n    \n        default = object()\n>       self.assertIs(d.getall('some_key', default), default)\nE       TypeError: getall() takes 2 positional arguments but 3 were given\n\nr2e_tests/test_1.py:134: TypeError\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::MultiDictTests::test__repr__\nPASSED r2e_tests/test_1.py::MultiDictTests::test_copy\nPASSED r2e_tests/test_1.py::MultiDictTests::test_getone\nPASSED r2e_tests/test_1.py::MultiDictTests::test_instantiate__empty\nPASSED r2e_tests/test_1.py::MultiDictTests::test_instantiate__from_arg0\nPASSED r2e_tests/test_1.py::MultiDictTests::test_instantiate__from_arg0_dict\nPASSED r2e_tests/test_1.py::MultiDictTests::test_instantiate__with_kwargs\nPASSED r2e_tests/test_1.py::MultiDictTests::test_items__contains\nPASSED r2e_tests/test_1.py::MultiDictTests::test_values__contains\nPASSED r2e_tests/test_1.py::CaseInsensitiveMultiDictTests::test_basics\nPASSED r2e_tests/test_1.py::CaseInsensitiveMultiDictTests::test_getall\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test__repr__\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test_add\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test_clear\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test_copy\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test_del\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test_extend\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test_getall\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test_getone\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test_instantiate__empty\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test_instantiate__from_arg0\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test_instantiate__from_arg0_dict\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test_instantiate__with_kwargs\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test_items__contains\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test_not_implemented_methods\nPASSED r2e_tests/test_1.py::MutableMultiDictTests::test_values__contains\nFAILED r2e_tests/test_1.py::_BaseTest::test_copy - NotImplementedError\nFAILED r2e_tests/test_1.py::_BaseTest::test_getone - NotImplementedError\nFAILED r2e_tests/test_1.py::_BaseTest::test_instantiate__empty - NotImplement...\nFAILED r2e_tests/test_1.py::_BaseTest::test_instantiate__from_arg0 - NotImple...\nFAILED r2e_tests/test_1.py::_BaseTest::test_instantiate__from_arg0_dict - Not...\nFAILED r2e_tests/test_1.py::_BaseTest::test_instantiate__with_kwargs - NotImp...\nFAILED r2e_tests/test_1.py::_BaseTest::test_items__contains - NotImplementedE...\nFAILED r2e_tests/test_1.py::_BaseTest::test_values__contains - NotImplemented...\nFAILED r2e_tests/test_1.py::MultiDictTests::test_getall - TypeError: getall()...\n========================= 9 failed, 26 passed in 0.28s =========================\n",
    "old_commit_res_stderr": "/home/gcpuser/buckets/local_repoeval_bucket/repos/aiohttp_ea948a4a984d2db4fceb42e6706f87e21cfea6a5/.venv/lib/python3.9/site-packages/pytest_asyncio/plugin.py:207: PytestDeprecationWarning: The configuration option \"asyncio_default_fixture_loop_scope\" is unset.\nThe event loop scope for asynchronous fixtures will default to the fixture caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to function scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: \"function\", \"class\", \"module\", \"package\", \"session\"\n\n  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))\n"
}
CHANGES.txt aiohttp/multidict.py tests/test_multidict.py
We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[ISSUE]
**Title:** `MultiDict.getall() does not accept a default value, raising TypeError when provided`

**Description:**
When using the `getall` method on a `MultiDict` instance, providing a default value for a non-existent key results in a `TypeError`. The method currently only accepts the key as an argument, which causes issues when attempting to specify a default value to handle missing keys gracefully.

**Example Code:**
```python
d = MultiDict([('key', 'value1')], key='value2')
default = object()
values = d.getall('some_key', default)  # Raises TypeError
```

**Expected Behavior:**
When a key is not present in the `MultiDict`, and a default value is provided to the `getall` method, it should return the default value instead of raising an error.

**Actual Behavior:**
Providing a default value to `getall` raises a `TypeError` because the method does not accept the default parameter.
[/ISSUE]
--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.

--- BEGIN FILE ---
```
### aiohttp/multidict.py
from itertools import chain
from collections import OrderedDict, abc


class MultiDict(abc.Mapping):
    """Read-only ordered dictionary that can hava multiple values for each key.

    This type of MultiDict must be used for request headers and query args.
    """

    def __init__(self, *args, **kwargs):
        if len(args) > 1:
            raise TypeError("MultiDict takes at most 2 positional "
                            "arguments ({} given)".format(len(args) + 1))
        self._items = OrderedDict()
        if args:
            if hasattr(args[0], 'items'):
                args = list(args[0].items())
            else:
                args = list(args[0])

        for key, value in chain(args, kwargs.items()):
            if key in self._items:
                self._items[key].append(value)
            else:
                self._items[key] = [value]

    def get(self, key, default=None):
        """Return first value stored at key."""
        if key in self._items and self._items[key]:
            return self._items[key][0]
        else:
            return default

    def getall(self, key):
        """Returns all values stored at key as a tuple.

        Raises KeyError if key doesn't exist."""
        return tuple(self._items[key])

    def getone(self, key):
        """Return first value stored at key."""
        return self._items[key][0]

    # extra methods #

    def copy(self):
        """Returns a copy itself."""
        cls = self.__class__
        return cls(self.items(getall=True))

    # Mapping interface #

    def __getitem__(self, key):
        return self._items[key][0]

    def __iter__(self):
        return iter(self._items)

    def __len__(self):
        return len(self._items)

    def items(self, *, getall=False):
        return _ItemsView(self._items, getall=getall)

    def values(self, *, getall=False):
        return _ValuesView(self._items, getall=getall)

    def __eq__(self, other):
        if not isinstance(other, abc.Mapping):
            return NotImplemented
        if isinstance(other, MultiDict):
            return self._items == other._items
        return dict(self.items()) == dict(other.items())

    def __contains__(self, key):
        return key in self._items

    def __repr__(self):
        return '<{} {!r}>'.format(self.__class__.__name__, self._items)


class CaseInsensitiveMultiDict(MultiDict):
    """Case insensitive multi dict."""

    def getall(self, key):
        return tuple(self._items[key.upper()])

    def get(self, key, default=None):
        key = key.upper()
        if key in self._items and self._items[key]:
            return self._items[key][0]
        else:
            return default

    def getone(self, key):
        return self._items[key.upper()][0]

    def __getitem__(self, key):
        return self._items[key.upper()][0]

    def __contains__(self, key):
        return key.upper() in self._items


class MutableMultiDict(abc.MutableMapping, MultiDict):
    """An ordered dictionary that can have multiple values for each key."""

    def getall(self, key):
        """Returns all values stored at key as list.

        Raises KeyError if key doesn't exist.
        """
        return list(self._items[key])

    def add(self, key, value):
        """Adds value to a key."""
        if key in self._items:
            self._items[key].append(value)
        else:
            self._items[key] = [value]

    def extend(self, *args, **kwargs):
        """Extends current MutableMultiDict with more values.

        This method must be used instead of update.
        """
        if len(args) > 1:
            raise TypeError("extend takes at most 2 positional arguments"
                            " ({} given)".format(len(args) + 1))
        if args:
            if isinstance(args[0], MultiDict):
                items = args[0].items(getall=True)
            elif hasattr(args[0], 'items'):
                items = args[0].items()
            else:
                items = args[0]
        else:
            items = []
        for key, value in chain(items, kwargs.items()):
            self.add(key, value)

    def clear(self):
        """Remove all items from MutableMultiDict"""
        self._items.clear()

    # MutableMapping interface #

    def __setitem__(self, key, value):
        self._items[key] = [value]

    def __delitem__(self, key):
        del self._items[key]

    def pop(self, key, default=None):
        """Method not allowed."""
        raise NotImplementedError

    def popitem(self):
        """Method not allowed."""
        raise NotImplementedError

    def update(self, *args, **kw):
        """Method not allowed."""
        raise NotImplementedError("Use extend method instead")


class _ItemsView(abc.ItemsView):

    def __init__(self, mapping, *, getall=False):
        super().__init__(mapping)
        self._getall = getall

    def __contains__(self, item):
        key, value = item
        try:
            values = self._mapping[key]
        except KeyError:
            return False
        else:
            if self._getall:
                return value in values
            else:
                return value == values[0]

    def __iter__(self):
        for key, values in self._mapping.items():
            if self._getall:
                for value in values:
                    yield key, value
            else:
                yield key, values[0]


class _ValuesView(abc.KeysView):

    def __init__(self, mapping, *, getall=False):
        super().__init__(mapping)
        self._getall = getall

    def __contains__(self, value):
        for values in self._mapping.values():
            if self._getall and value in values:
                return True
            elif value == values[0]:
                return True
        return False

    def __iter__(self):
        for values in self._mapping.values():
            if self._getall:
                yield from iter(values)
            else:
                yield values[0]

```
--- END FILE ---

Please first localize the bug based on the issue statement, and then generate *SEARCH/REPLACE* edits to fix the issue.

Every *SEARCH/REPLACE* edit must use this format:
1. The file path
2. The start of search block: <<<<<<< SEARCH
3. A contiguous chunk of lines to search for in the existing source code
4. The dividing line: =======
5. The lines to replace into the source code
6. The end of the replace block: >>>>>>> REPLACE

Here is an example:

```python
### mathweb/flask/app.py
<<<<<<< SEARCH
from flask import Flask
=======
import math
from flask import Flask
>>>>>>> REPLACE
```
</solution>

Please note that the *SEARCH/REPLACE* edit REQUIRES PROPER INDENTATION. If you would like to add the line '        print(x)', you must fully write that out, with all those spaces before the code!
Wrap each *SEARCH/REPLACE* edit in a code block as shown in the example above. If you have multiple *SEARCH/REPLACE* edits, use a separate code block for each one.
[ISSUE]
**Title:** `MultiDict.getall() does not accept a default value, raising TypeError when provided`

**Description:**
When using the `getall` method on a `MultiDict` instance, providing a default value for a non-existent key results in a `TypeError`. The method currently only accepts the key as an argument, which causes issues when attempting to specify a default value to handle missing keys gracefully.

**Example Code:**
```python
d = MultiDict([('key', 'value1')], key='value2')
default = object()
values = d.getall('some_key', default)  # Raises TypeError
```

**Expected Behavior:**
When a key is not present in the `MultiDict`, and a default value is provided to the `getall` method, it should return the default value instead of raising an error.

**Actual Behavior:**
Providing a default value to `getall` raises a `TypeError` because the method does not accept the default parameter.
[/ISSUE]
{
    "MultiDictTests.test__repr__": "PASSED",
    "MultiDictTests.test_copy": "PASSED",
    "MultiDictTests.test_getall": "PASSED",
    "MultiDictTests.test_getone": "PASSED",
    "MultiDictTests.test_instantiate__empty": "PASSED",
    "MultiDictTests.test_instantiate__from_arg0": "PASSED",
    "MultiDictTests.test_instantiate__from_arg0_dict": "PASSED",
    "MultiDictTests.test_instantiate__with_kwargs": "PASSED",
    "MultiDictTests.test_items__contains": "PASSED",
    "MultiDictTests.test_values__contains": "PASSED",
    "CaseInsensitiveMultiDictTests.test_basics": "PASSED",
    "CaseInsensitiveMultiDictTests.test_getall": "PASSED",
    "MutableMultiDictTests.test__repr__": "PASSED",
    "MutableMultiDictTests.test_add": "PASSED",
    "MutableMultiDictTests.test_clear": "PASSED",
    "MutableMultiDictTests.test_copy": "PASSED",
    "MutableMultiDictTests.test_del": "PASSED",
    "MutableMultiDictTests.test_extend": "PASSED",
    "MutableMultiDictTests.test_getall": "PASSED",
    "MutableMultiDictTests.test_getone": "PASSED",
    "MutableMultiDictTests.test_instantiate__empty": "PASSED",
    "MutableMultiDictTests.test_instantiate__from_arg0": "PASSED",
    "MutableMultiDictTests.test_instantiate__from_arg0_dict": "PASSED",
    "MutableMultiDictTests.test_instantiate__with_kwargs": "PASSED",
    "MutableMultiDictTests.test_items__contains": "PASSED",
    "MutableMultiDictTests.test_not_implemented_methods": "PASSED",
    "MutableMultiDictTests.test_values__contains": "PASSED",
    "_BaseTest.test_copy": "FAILED",
    "_BaseTest.test_getone": "FAILED",
    "_BaseTest.test_instantiate__empty": "FAILED",
    "_BaseTest.test_instantiate__from_arg0": "FAILED",
    "_BaseTest.test_instantiate__from_arg0_dict": "FAILED",
    "_BaseTest.test_instantiate__with_kwargs": "FAILED",
    "_BaseTest.test_items__contains": "FAILED",
    "_BaseTest.test_values__contains": "FAILED"
}
diff --git a/aiohttp/multidict.py b/aiohttp/multidict.py
index 9f49afb2..e57a8343 100644
--- a/aiohttp/multidict.py
+++ b/aiohttp/multidict.py
@@ -1,6 +1,8 @@
 from itertools import chain
 from collections import OrderedDict, abc
 
+_marker = object()
+
 
 class MultiDict(abc.Mapping):
     """Read-only ordered dictionary that can hava multiple values for each key.
@@ -32,11 +34,17 @@ class MultiDict(abc.Mapping):
         else:
             return default
 
-    def getall(self, key):
+    def getall(self, key, default=_marker):
         """Returns all values stored at key as a tuple.
 
         Raises KeyError if key doesn't exist."""
-        return tuple(self._items[key])
+        if key in self._items:
+            return tuple(self._items[key])
+        else:
+            if default is not _marker:
+                return default
+            else:
+                raise KeyError(key)
 
     def getone(self, key):
         """Return first value stored at key."""

{"aiohttp/multidict.py": "from itertools import chain\nfrom collections import OrderedDict, abc\n\n\nclass MultiDict(abc.Mapping):\n    \"\"\"Read-only ordered dictionary that can hava multiple values for each key.\n\n    This type of MultiDict must be used for request headers and query args.\n    \"\"\"\n\n    def __init__(self, *args, **kwargs):\n        if len(args) > 1:\n            raise TypeError(\"MultiDict takes at most 2 positional \"\n                            \"arguments ({} given)\".format(len(args) + 1))\n        self._items = OrderedDict()\n        if args:\n            if hasattr(args[0], 'items'):\n                args = list(args[0].items())\n            else:\n                args = list(args[0])\n\n        for key, value in chain(args, kwargs.items()):\n            if key in self._items:\n                self._items[key].append(value)\n            else:\n                self._items[key] = [value]\n\n    def get(self, key, default=None):\n        \"\"\"Return first value stored at key.\"\"\"\n        if key in self._items and self._items[key]:\n            return self._items[key][0]\n        else:\n            return default\n\n    def getall(self, key):\n        \"\"\"Returns all values stored at key as a tuple.\n\n        Raises KeyError if key doesn't exist.\"\"\"\n        return tuple(self._items[key])\n\n    def getone(self, key):\n        \"\"\"Return first value stored at key.\"\"\"\n        return self._items[key][0]\n\n    # extra methods #\n\n    def copy(self):\n        \"\"\"Returns a copy itself.\"\"\"\n        cls = self.__class__\n        return cls(self.items(getall=True))\n\n    # Mapping interface #\n\n    def __getitem__(self, key):\n        return self._items[key][0]\n\n    def __iter__(self):\n        return iter(self._items)\n\n    def __len__(self):\n        return len(self._items)\n\n    def items(self, *, getall=False):\n        return _ItemsView(self._items, getall=getall)\n\n    def values(self, *, getall=False):\n        return _ValuesView(self._items, getall=getall)\n\n    def __eq__(self, other):\n        if not isinstance(other, abc.Mapping):\n            return NotImplemented\n        if isinstance(other, MultiDict):\n            return self._items == other._items\n        return dict(self.items()) == dict(other.items())\n\n    def __contains__(self, key):\n        return key in self._items\n\n    def __repr__(self):\n        return '<{} {!r}>'.format(self.__class__.__name__, self._items)\n\n\nclass CaseInsensitiveMultiDict(MultiDict):\n    \"\"\"Case insensitive multi dict.\"\"\"\n\n    def getall(self, key):\n        return tuple(self._items[key.upper()])\n\n    def get(self, key, default=None):\n        key = key.upper()\n        if key in self._items and self._items[key]:\n            return self._items[key][0]\n        else:\n            return default\n\n    def getone(self, key):\n        return self._items[key.upper()][0]\n\n    def __getitem__(self, key):\n        return self._items[key.upper()][0]\n\n    def __contains__(self, key):\n        return key.upper() in self._items\n\n\nclass MutableMultiDict(abc.MutableMapping, MultiDict):\n    \"\"\"An ordered dictionary that can have multiple values for each key.\"\"\"\n\n    def getall(self, key):\n        \"\"\"Returns all values stored at key as list.\n\n        Raises KeyError if key doesn't exist.\n        \"\"\"\n        return list(self._items[key])\n\n    def add(self, key, value):\n        \"\"\"Adds value to a key.\"\"\"\n        if key in self._items:\n            self._items[key].append(value)\n        else:\n            self._items[key] = [value]\n\n    def extend(self, *args, **kwargs):\n        \"\"\"Extends current MutableMultiDict with more values.\n\n        This method must be used instead of update.\n        \"\"\"\n        if len(args) > 1:\n            raise TypeError(\"extend takes at most 2 positional arguments\"\n                            \" ({} given)\".format(len(args) + 1))\n        if args:\n            if isinstance(args[0], MultiDict):\n                items = args[0].items(getall=True)\n            elif hasattr(args[0], 'items'):\n                items = args[0].items()\n            else:\n                items = args[0]\n        else:\n            items = []\n        for key, value in chain(items, kwargs.items()):\n            self.add(key, value)\n\n    def clear(self):\n        \"\"\"Remove all items from MutableMultiDict\"\"\"\n        self._items.clear()\n\n    # MutableMapping interface #\n\n    def __setitem__(self, key, value):\n        self._items[key] = [value]\n\n    def __delitem__(self, key):\n        del self._items[key]\n\n    def pop(self, key, default=None):\n        \"\"\"Method not allowed.\"\"\"\n        raise NotImplementedError\n\n    def popitem(self):\n        \"\"\"Method not allowed.\"\"\"\n        raise NotImplementedError\n\n    def update(self, *args, **kw):\n        \"\"\"Method not allowed.\"\"\"\n        raise NotImplementedError(\"Use extend method instead\")\n\n\nclass _ItemsView(abc.ItemsView):\n\n    def __init__(self, mapping, *, getall=False):\n        super().__init__(mapping)\n        self._getall = getall\n\n    def __contains__(self, item):\n        key, value = item\n        try:\n            values = self._mapping[key]\n        except KeyError:\n            return False\n        else:\n            if self._getall:\n                return value in values\n            else:\n                return value == values[0]\n\n    def __iter__(self):\n        for key, values in self._mapping.items():\n            if self._getall:\n                for value in values:\n                    yield key, value\n            else:\n                yield key, values[0]\n\n\nclass _ValuesView(abc.KeysView):\n\n    def __init__(self, mapping, *, getall=False):\n        super().__init__(mapping)\n        self._getall = getall\n\n    def __contains__(self, value):\n        for values in self._mapping.values():\n            if self._getall and value in values:\n                return True\n            elif value == values[0]:\n                return True\n        return False\n\n    def __iter__(self):\n        for values in self._mapping.values():\n            if self._getall:\n                yield from iter(values)\n            else:\n                yield values[0]\n"}
A user will ask you to solve a task. You should first draft your thinking process (inner monologue). Then, generate the solution.

Your response format must follow the template below:
<think>
Your thoughts or/and draft, like working through an exercise on scratch paper. Be as casual and as long as you want until you are confident to generate a correct solution.
</think>
<solution>
Final solution presented to the user.
</solution>
system
We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[ISSUE]
**Title:** `MultiDict.getall() does not accept a default value, raising TypeError when provided`

**Description:**
When using the `getall` method on a `MultiDict` instance, providing a default value for a non-existent key results in a `TypeError`. The method currently only accepts the key as an argument, which causes issues when attempting to specify a default value to handle missing keys gracefully.

**Example Code:**
```python
d = MultiDict([('key', 'value1')], key='value2')
default = object()
values = d.getall('some_key', default)  # Raises TypeError
```

**Expected Behavior:**
When a key is not present in the `MultiDict`, and a default value is provided to the `getall` method, it should return the default value instead of raising an error.

**Actual Behavior:**
Providing a default value to `getall` raises a `TypeError` because the method does not accept the default parameter.
[/ISSUE]
--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.

--- BEGIN FILE ---
```
### aiohttp/multidict.py
from itertools import chain
from collections import OrderedDict, abc


class MultiDict(abc.Mapping):
    """Read-only ordered dictionary that can hava multiple values for each key.

    This type of MultiDict must be used for request headers and query args.
    """

    def __init__(self, *args, **kwargs):
        if len(args) > 1:
            raise TypeError("MultiDict takes at most 2 positional "
                            "arguments ({} given)".format(len(args) + 1))
        self._items = OrderedDict()
        if args:
            if hasattr(args[0], 'items'):
                args = list(args[0].items())
            else:
                args = list(args[0])

        for key, value in chain(args, kwargs.items()):
            if key in self._items:
                self._items[key].append(value)
            else:
                self._items[key] = [value]

    def get(self, key, default=None):
        """Return first value stored at key."""
        if key in self._items and self._items[key]:
            return self._items[key][0]
        else:
            return default

    def getall(self, key):
        """Returns all values stored at key as a tuple.

        Raises KeyError if key doesn't exist."""
        return tuple(self._items[key])

    def getone(self, key):
        """Return first value stored at key."""
        return self._items[key][0]

    # extra methods #

    def copy(self):
        """Returns a copy itself."""
        cls = self.__class__
        return cls(self.items(getall=True))

    # Mapping interface #

    def __getitem__(self, key):
        return self._items[key][0]

    def __iter__(self):
        return iter(self._items)

    def __len__(self):
        return len(self._items)

    def items(self, *, getall=False):
        return _ItemsView(self._items, getall=getall)

    def values(self, *, getall=False):
        return _ValuesView(self._items, getall=getall)

    def __eq__(self, other):
        if not isinstance(other, abc.Mapping):
            return NotImplemented
        if isinstance(other, MultiDict):
            return self._items == other._items
        return dict(self.items()) == dict(other.items())

    def __contains__(self, key):
        return key in self._items

    def __repr__(self):
        return '<{} {!r}>'.format(self.__class__.__name__, self._items)


class CaseInsensitiveMultiDict(MultiDict):
    """Case insensitive multi dict."""

    def getall(self, key):
        return tuple(self._items[key.upper()])

    def get(self, key, default=None):
        key = key.upper()
        if key in self._items and self._items[key]:
            return self._items[key][0]
        else:
            return default

    def getone(self, key):
        return self._items[key.upper()][0]

    def __getitem__(self, key):
        return self._items[key.upper()][0]

    def __contains__(self, key):
        return key.upper() in self._items


class MutableMultiDict(abc.MutableMapping, MultiDict):
    """An ordered dictionary that can have multiple values for each key."""

    def getall(self, key):
        """Returns all values stored at key as list.

        Raises KeyError if key doesn't exist.
        """
        return list(self._items[key])

    def add(self, key, value):
        """Adds value to a key."""
        if key in self._items:
            self._items[key].append(value)
        else:
            self._items[key] = [value]

    def extend(self, *args, **kwargs):
        """Extends current MutableMultiDict with more values.

        This method must be used instead of update.
        """
        if len(args) > 1:
            raise TypeError("extend takes at most 2 positional arguments"
                            " ({} given)".format(len(args) + 1))
        if args:
            if isinstance(args[0], MultiDict):
                items = args[0].items(getall=True)
            elif hasattr(args[0], 'items'):
                items = args[0].items()
            else:
                items = args[0]
        else:
            items = []
        for key, value in chain(items, kwargs.items()):
            self.add(key, value)

    def clear(self):
        """Remove all items from MutableMultiDict"""
        self._items.clear()

    # MutableMapping interface #

    def __setitem__(self, key, value):
        self._items[key] = [value]

    def __delitem__(self, key):
        del self._items[key]

    def pop(self, key, default=None):
        """Method not allowed."""
        raise NotImplementedError

    def popitem(self):
        """Method not allowed."""
        raise NotImplementedError

    def update(self, *args, **kw):
        """Method not allowed."""
        raise NotImplementedError("Use extend method instead")


class _ItemsView(abc.ItemsView):

    def __init__(self, mapping, *, getall=False):
        super().__init__(mapping)
        self._getall = getall

    def __contains__(self, item):
        key, value = item
        try:
            values = self._mapping[key]
        except KeyError:
            return False
        else:
            if self._getall:
                return value in values
            else:
                return value == values[0]

    def __iter__(self):
        for key, values in self._mapping.items():
            if self._getall:
                for value in values:
                    yield key, value
            else:
                yield key, values[0]


class _ValuesView(abc.KeysView):

    def __init__(self, mapping, *, getall=False):
        super().__init__(mapping)
        self._getall = getall

    def __contains__(self, value):
        for values in self._mapping.values():
            if self._getall and value in values:
                return True
            elif value == values[0]:
                return True
        return False

    def __iter__(self):
        for values in self._mapping.values():
            if self._getall:
                yield from iter(values)
            else:
                yield values[0]

```
--- END FILE ---

Please first localize the bug based on the issue statement, and then generate *SEARCH/REPLACE* edits to fix the issue.

Every *SEARCH/REPLACE* edit must use this format:
1. The file path
2. The start of search block: <<<<<<< SEARCH
3. A contiguous chunk of lines to search for in the existing source code
4. The dividing line: =======
5. The lines to replace into the source code
6. The end of the replace block: >>>>>>> REPLACE

Here is an example:

```python
### mathweb/flask/app.py
<<<<<<< SEARCH
from flask import Flask
=======
import math
from flask import Flask
>>>>>>> REPLACE
```
</solution>

Please note that the *SEARCH/REPLACE* edit REQUIRES PROPER INDENTATION. If you would like to add the line '        print(x)', you must fully write that out, with all those spaces before the code!
Wrap each *SEARCH/REPLACE* edit in a code block as shown in the example above. If you have multiple *SEARCH/REPLACE* edits, use a separate code block for each one.
user