prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Python 3.10 compatibility issue
  
  
  #### Environment details
  
    - OS type and version: Windows 10
    - Python version: `python --version`  3.10.1
    - pip version: `pip --version` 21.2.4
    - `google-api-python-client` version: `pip show google-api-python-client` - 2.33.0
  
  uritemplate package 3.0.0 is not compatible with python 3.10. Need to update the requirements.
  
  Partial Stack Trace
  
  service = build('gmail', 'v1', credentials=creds)
    File "C:\JA\Envs\GIC\lib\site-packages\googleapiclient\_helpers.py", line 130, in positional_wrapper
      return wrapped(*args, **kwargs)
    File "C:\JA\Envs\GIC\lib\site-packages\googleapiclient\discovery.py", line 219, in build
      requested_url = uritemplate.expand(discovery_url, params)
    File "C:\JA\Envs\GIC\lib\site-packages\uritemplate\api.py", line 33, in expand
      return URITemplate(uri).expand(var_dict, **kwargs)
    File "C:\JA\Envs\GIC\lib\site-packages\uritemplate\template.py", line 132, in expand
      return self._expand(_merge(var_dict, kwargs), False)
    File "C:\JA\Envs\GIC\lib\site-packages\uritemplate\template.py", line 97, in _expand
      expanded.update(v.expand(expansion))
    File "C:\JA\Envs\GIC\lib\site-packages\uritemplate\variable.py", line 338, in expand
      expanded = expansion(name, value, opts['explode'], opts['prefix'])
    File "C:\JA\Envs\GIC\lib\site-packages\uritemplate\variable.py", line 278, in _string_expansion
      if dict_test(value) or tuples:
    File "C:\JA\Envs\GIC\lib\site-packages\uritemplate\variable.py", line 363, in dict_test
      return isinstance(value, (dict, collections.MutableMapping))
  AttributeError: module 'collections' has no attribute 'MutableMapping'
  
  
  </issue>
  <code>
  [start of setup.py]
  1 # Copyright 2014 Google Inc. All Rights Reserved.
  2 #
  3 # Licensed under the Apache License, Version 2.0 (the "License");
  4 # you may not use this file except in compliance with the License.
  5 # You may obtain a copy of the License at
  6 #
  7 #      http://www.apache.org/licenses/LICENSE-2.0
  8 #
  9 # Unless required by applicable law or agreed to in writing, software
  10 # distributed under the License is distributed on an "AS IS" BASIS,
  11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12 # See the License for the specific language governing permissions and
  13 # limitations under the License.
  14 
  15 """Setup script for Google API Python client.
  16 
  17 Also installs included versions of third party libraries, if those libraries
  18 are not already installed.
  19 """
  20 from __future__ import print_function
  21 
  22 import sys
  23 
  24 if sys.version_info < (3, 6):
  25     print("google-api-python-client requires python3 version >= 3.6.", file=sys.stderr)
  26     sys.exit(1)
  27 
  28 import io
  29 import os
  30 from setuptools import setup
  31 
  32 packages = ["apiclient", "googleapiclient", "googleapiclient/discovery_cache"]
  33 
  34 install_requires = [
  35     "httplib2>=0.15.0,<1dev",
  36     # NOTE: Maintainers, please do not require google-auth>=2.x.x
  37     # Until this issue is closed
  38     # https://github.com/googleapis/google-cloud-python/issues/10566
  39     "google-auth>=1.16.0,<3.0.0dev",
  40     "google-auth-httplib2>=0.1.0",
  41     # NOTE: Maintainers, please do not require google-api-core>=2.x.x
  42     # Until this issue is closed
  43     # https://github.com/googleapis/google-cloud-python/issues/10566
  44     "google-api-core>=1.21.0,<3.0.0dev",
  45     "uritemplate>=3.0.0,<5",
  46 ]
  47 
  48 package_root = os.path.abspath(os.path.dirname(__file__))
  49 
  50 readme_filename = os.path.join(package_root, "README.md")
  51 with io.open(readme_filename, encoding="utf-8") as readme_file:
  52     readme = readme_file.read()
  53 
  54 package_root = os.path.abspath(os.path.dirname(__file__))
  55 
  56 version = {}
  57 with open(os.path.join(package_root, "googleapiclient/version.py")) as fp:
  58     exec(fp.read(), version)
  59 version = version["__version__"]
  60 
  61 setup(
  62     name="google-api-python-client",
  63     version=version,
  64     description="Google API Client Library for Python",
  65     long_description=readme,
  66     long_description_content_type='text/markdown',
  67     author="Google LLC",
  68     author_email="googleapis-packages@google.com",
  69     url="https://github.com/googleapis/google-api-python-client/",
  70     install_requires=install_requires,
  71     python_requires=">=3.6",
  72     packages=packages,
  73     package_data={"googleapiclient": ["discovery_cache/documents/*.json"]},
  74     license="Apache 2.0",
  75     keywords="google api client",
  76     classifiers=[
  77         "Programming Language :: Python :: 3",
  78         "Programming Language :: Python :: 3.6",
  79         "Programming Language :: Python :: 3.7",
  80         "Programming Language :: Python :: 3.8",
  81         "Programming Language :: Python :: 3.9",
  82         "Programming Language :: Python :: 3.10",
  83         "Development Status :: 5 - Production/Stable",
  84         "Intended Audience :: Developers",
  85         "License :: OSI Approved :: Apache Software License",
  86         "Operating System :: OS Independent",
  87         "Topic :: Internet :: WWW/HTTP",
  88     ],
  89 )
  90
  [end of setup.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/setup.py b/setup.py
  --- a/setup.py
  +++ b/setup.py
  @@ -42,7 +42,7 @@
       # Until this issue is closed
       # https://github.com/googleapis/google-cloud-python/issues/10566
       "google-api-core>=1.21.0,<3.0.0dev",
  -    "uritemplate>=3.0.0,<5",
  +    "uritemplate>=3.0.1,<5",
   ]
   
   package_root = os.path.abspath(os.path.dirname(__file__))
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -42,7 +42,7 @@\n     # Until this issue is closed\n     # https://github.com/googleapis/google-cloud-python/issues/10566\n     \"google-api-core>=1.21.0,<3.0.0dev\",\n-    \"uritemplate>=3.0.0,<5\",\n+    \"uritemplate>=3.0.1,<5\",\n ]\n \n package_root = os.path.abspath(os.path.dirname(__file__))\n", "issue": "Python 3.10 compatibility issue\n\r\n\r\n#### Environment details\r\n\r\n  - OS type and version: Windows 10\r\n  - Python version: `python --version`  3.10.1\r\n  - pip version: `pip --version` 21.2.4\r\n  - `google-api-python-client` version: `pip show google-api-python-client` - 2.33.0\r\n\r\nuritemplate package 3.0.0 is not compatible with python 3.10. Need to update the requirements.\r\n\r\nPartial Stack Trace\r\n\r\nservice = build('gmail', 'v1', credentials=creds)\r\n  File \"C:\\JA\\Envs\\GIC\\lib\\site-packages\\googleapiclient\\_helpers.py\", line 130, in positional_wrapper\r\n    return wrapped(*args, **kwargs)\r\n  File \"C:\\JA\\Envs\\GIC\\lib\\site-packages\\googleapiclient\\discovery.py\", line 219, in build\r\n    requested_url = uritemplate.expand(discovery_url, params)\r\n  File \"C:\\JA\\Envs\\GIC\\lib\\site-packages\\uritemplate\\api.py\", line 33, in expand\r\n    return URITemplate(uri).expand(var_dict, **kwargs)\r\n  File \"C:\\JA\\Envs\\GIC\\lib\\site-packages\\uritemplate\\template.py\", line 132, in expand\r\n    return self._expand(_merge(var_dict, kwargs), False)\r\n  File \"C:\\JA\\Envs\\GIC\\lib\\site-packages\\uritemplate\\template.py\", line 97, in _expand\r\n    expanded.update(v.expand(expansion))\r\n  File \"C:\\JA\\Envs\\GIC\\lib\\site-packages\\uritemplate\\variable.py\", line 338, in expand\r\n    expanded = expansion(name, value, opts['explode'], opts['prefix'])\r\n  File \"C:\\JA\\Envs\\GIC\\lib\\site-packages\\uritemplate\\variable.py\", line 278, in _string_expansion\r\n    if dict_test(value) or tuples:\r\n  File \"C:\\JA\\Envs\\GIC\\lib\\site-packages\\uritemplate\\variable.py\", line 363, in dict_test\r\n    return isinstance(value, (dict, collections.MutableMapping))\r\nAttributeError: module 'collections' has no attribute 'MutableMapping'\r\n\n", "before_files": [{"content": "# Copyright 2014 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Setup script for Google API Python client.\n\nAlso installs included versions of third party libraries, if those libraries\nare not already installed.\n\"\"\"\nfrom __future__ import print_function\n\nimport sys\n\nif sys.version_info < (3, 6):\n    print(\"google-api-python-client requires python3 version >= 3.6.\", file=sys.stderr)\n    sys.exit(1)\n\nimport io\nimport os\nfrom setuptools import setup\n\npackages = [\"apiclient\", \"googleapiclient\", \"googleapiclient/discovery_cache\"]\n\ninstall_requires = [\n    \"httplib2>=0.15.0,<1dev\",\n    # NOTE: Maintainers, please do not require google-auth>=2.x.x\n    # Until this issue is closed\n    # https://github.com/googleapis/google-cloud-python/issues/10566\n    \"google-auth>=1.16.0,<3.0.0dev\",\n    \"google-auth-httplib2>=0.1.0\",\n    # NOTE: Maintainers, please do not require google-api-core>=2.x.x\n    # Until this issue is closed\n    # https://github.com/googleapis/google-cloud-python/issues/10566\n    \"google-api-core>=1.21.0,<3.0.0dev\",\n    \"uritemplate>=3.0.0,<5\",\n]\n\npackage_root = os.path.abspath(os.path.dirname(__file__))\n\nreadme_filename = os.path.join(package_root, \"README.md\")\nwith io.open(readme_filename, encoding=\"utf-8\") as readme_file:\n    readme = readme_file.read()\n\npackage_root = os.path.abspath(os.path.dirname(__file__))\n\nversion = {}\nwith open(os.path.join(package_root, \"googleapiclient/version.py\")) as fp:\n    exec(fp.read(), version)\nversion = version[\"__version__\"]\n\nsetup(\n    name=\"google-api-python-client\",\n    version=version,\n    description=\"Google API Client Library for Python\",\n    long_description=readme,\n    long_description_content_type='text/markdown',\n    author=\"Google LLC\",\n    author_email=\"googleapis-packages@google.com\",\n    url=\"https://github.com/googleapis/google-api-python-client/\",\n    install_requires=install_requires,\n    python_requires=\">=3.6\",\n    packages=packages,\n    package_data={\"googleapiclient\": [\"discovery_cache/documents/*.json\"]},\n    license=\"Apache 2.0\",\n    keywords=\"google api client\",\n    classifiers=[\n        \"Programming Language :: Python :: 3\",\n        \"Programming Language :: Python :: 3.6\",\n        \"Programming Language :: Python :: 3.7\",\n        \"Programming Language :: Python :: 3.8\",\n        \"Programming Language :: Python :: 3.9\",\n        \"Programming Language :: Python :: 3.10\",\n        \"Development Status :: 5 - Production/Stable\",\n        \"Intended Audience :: Developers\",\n        \"License :: OSI Approved :: Apache Software License\",\n        \"Operating System :: OS Independent\",\n        \"Topic :: Internet :: WWW/HTTP\",\n    ],\n)\n", "path": "setup.py"}]}