prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  create a sans-io docker client class and impliment Client with blocking requests
  use https://github.com/mikeal/deferred to create a sans-io version of Client (SansIOClient) that requires something like:
  
  ``` python
  class SimpleStream(object):
      def next(self) -> Deferred:
          ...
  
  class IOAdapter(object):
      def request(self, **kwargs) -> Deferred:
          ...
  
      def stream(self, **kwargs) -> SimpleStream:
          ...
  
      def unwrap_deferred(self, deferred: Deferred) -> Any:
          ...
  ```
  
  and then implement it with something like:
  
  ``` python
  class BlockingSimpleStream(SimpleStream):
      def __init__(self, stream):
          self.generator = _stream_helper(stream):
      def next(self) -> Deferred:
          return deferred.succeeded(next(self.generator))
  
  class BlockingIOAdapter(IOAdapter):
      def __init__(session: requests.Session):
          self.session = session
  
      def request(self, **kwargs) -> Deferred:
          return deferred.execute(self.session.request, **kwargs)
  
      def stream(self, **kwargs) -> BlockingSimpleStream:
          return BlockingSimpleStream(self.session.request(**kwargs, stream=True))
  
      def unwrap_deferred(self, d: Deferred):
          return deferred.waitForDeferred(d).getResult()
  ```
  
  
  </issue>
  <code>
  [start of setup.py]
  1 #!/usr/bin/env python
  2 import os
  3 import sys
  4 
  5 from setuptools import setup
  6 
  7 
  8 ROOT_DIR = os.path.dirname(__file__)
  9 SOURCE_DIR = os.path.join(ROOT_DIR)
  10 
  11 requirements = [
  12     'requests >= 2.5.2, < 2.11',
  13     'six >= 1.4.0',
  14     'websocket-client >= 0.32.0',
  15     'docker-pycreds >= 0.2.1'
  16 ]
  17 
  18 if sys.platform == 'win32':
  19     requirements.append('pypiwin32 >= 219')
  20 
  21 extras_require = {
  22     ':python_version < "3.5"': 'backports.ssl_match_hostname >= 3.5',
  23     # While not imported explicitly, the ipaddress module is required for
  24     # ssl_match_hostname to verify hosts match with certificates via
  25     # ServerAltname: https://pypi.python.org/pypi/backports.ssl_match_hostname
  26     ':python_version < "3.3"': 'ipaddress >= 1.0.16',
  27 }
  28 
  29 version = None
  30 exec(open('docker/version.py').read())
  31 
  32 with open('./test-requirements.txt') as test_reqs_txt:
  33     test_requirements = [line for line in test_reqs_txt]
  34 
  35 
  36 setup(
  37     name="docker-py",
  38     version=version,
  39     description="Python client for Docker.",
  40     url='https://github.com/docker/docker-py/',
  41     packages=[
  42         'docker', 'docker.api', 'docker.auth', 'docker.transport',
  43         'docker.utils', 'docker.utils.ports', 'docker.ssladapter',
  44         'docker.types',
  45     ],
  46     install_requires=requirements,
  47     tests_require=test_requirements,
  48     extras_require=extras_require,
  49     zip_safe=False,
  50     test_suite='tests',
  51     classifiers=[
  52         'Development Status :: 4 - Beta',
  53         'Environment :: Other Environment',
  54         'Intended Audience :: Developers',
  55         'Operating System :: OS Independent',
  56         'Programming Language :: Python',
  57         'Programming Language :: Python :: 2',
  58         'Programming Language :: Python :: 2.6',
  59         'Programming Language :: Python :: 2.7',
  60         'Programming Language :: Python :: 3',
  61         'Programming Language :: Python :: 3.3',
  62         'Programming Language :: Python :: 3.4',
  63         'Programming Language :: Python :: 3.5',
  64         'Topic :: Utilities',
  65         'License :: OSI Approved :: Apache Software License',
  66     ],
  67 )
  68
  [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
  @@ -33,10 +33,20 @@
       test_requirements = [line for line in test_reqs_txt]
   
   
  +long_description = ''
  +try:
  +    with open('./README.rst') as readme_rst:
  +        long_description = readme_rst.read()
  +except IOError:
  +    # README.rst is only generated on release. Its absence should not prevent
  +    # setup.py from working properly.
  +    pass
  +
   setup(
       name="docker-py",
       version=version,
       description="Python client for Docker.",
  +    long_description=long_description,
       url='https://github.com/docker/docker-py/',
       packages=[
           'docker', 'docker.api', 'docker.auth', 'docker.transport',
  @@ -64,4 +74,6 @@
           'Topic :: Utilities',
           'License :: OSI Approved :: Apache Software License',
       ],
  +    maintainer='Joffrey F',
  +    maintainer_email='joffrey@docker.com',
   )
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -33,10 +33,20 @@\n     test_requirements = [line for line in test_reqs_txt]\n \n \n+long_description = ''\n+try:\n+    with open('./README.rst') as readme_rst:\n+        long_description = readme_rst.read()\n+except IOError:\n+    # README.rst is only generated on release. Its absence should not prevent\n+    # setup.py from working properly.\n+    pass\n+\n setup(\n     name=\"docker-py\",\n     version=version,\n     description=\"Python client for Docker.\",\n+    long_description=long_description,\n     url='https://github.com/docker/docker-py/',\n     packages=[\n         'docker', 'docker.api', 'docker.auth', 'docker.transport',\n@@ -64,4 +74,6 @@\n         'Topic :: Utilities',\n         'License :: OSI Approved :: Apache Software License',\n     ],\n+    maintainer='Joffrey F',\n+    maintainer_email='joffrey@docker.com',\n )\n", "issue": "create a sans-io docker client class and impliment Client with blocking requests\nuse https://github.com/mikeal/deferred to create a sans-io version of Client (SansIOClient) that requires something like:\n\n``` python\nclass SimpleStream(object):\n    def next(self) -> Deferred:\n        ...\n\nclass IOAdapter(object):\n    def request(self, **kwargs) -> Deferred:\n        ...\n\n    def stream(self, **kwargs) -> SimpleStream:\n        ...\n\n    def unwrap_deferred(self, deferred: Deferred) -> Any:\n        ...\n```\n\nand then implement it with something like:\n\n``` python\nclass BlockingSimpleStream(SimpleStream):\n    def __init__(self, stream):\n        self.generator = _stream_helper(stream):\n    def next(self) -> Deferred:\n        return deferred.succeeded(next(self.generator))\n\nclass BlockingIOAdapter(IOAdapter):\n    def __init__(session: requests.Session):\n        self.session = session\n\n    def request(self, **kwargs) -> Deferred:\n        return deferred.execute(self.session.request, **kwargs)\n\n    def stream(self, **kwargs) -> BlockingSimpleStream:\n        return BlockingSimpleStream(self.session.request(**kwargs, stream=True))\n\n    def unwrap_deferred(self, d: Deferred):\n        return deferred.waitForDeferred(d).getResult()\n```\n\n", "before_files": [{"content": "#!/usr/bin/env python\nimport os\nimport sys\n\nfrom setuptools import setup\n\n\nROOT_DIR = os.path.dirname(__file__)\nSOURCE_DIR = os.path.join(ROOT_DIR)\n\nrequirements = [\n    'requests >= 2.5.2, < 2.11',\n    'six >= 1.4.0',\n    'websocket-client >= 0.32.0',\n    'docker-pycreds >= 0.2.1'\n]\n\nif sys.platform == 'win32':\n    requirements.append('pypiwin32 >= 219')\n\nextras_require = {\n    ':python_version < \"3.5\"': 'backports.ssl_match_hostname >= 3.5',\n    # While not imported explicitly, the ipaddress module is required for\n    # ssl_match_hostname to verify hosts match with certificates via\n    # ServerAltname: https://pypi.python.org/pypi/backports.ssl_match_hostname\n    ':python_version < \"3.3\"': 'ipaddress >= 1.0.16',\n}\n\nversion = None\nexec(open('docker/version.py').read())\n\nwith open('./test-requirements.txt') as test_reqs_txt:\n    test_requirements = [line for line in test_reqs_txt]\n\n\nsetup(\n    name=\"docker-py\",\n    version=version,\n    description=\"Python client for Docker.\",\n    url='https://github.com/docker/docker-py/',\n    packages=[\n        'docker', 'docker.api', 'docker.auth', 'docker.transport',\n        'docker.utils', 'docker.utils.ports', 'docker.ssladapter',\n        'docker.types',\n    ],\n    install_requires=requirements,\n    tests_require=test_requirements,\n    extras_require=extras_require,\n    zip_safe=False,\n    test_suite='tests',\n    classifiers=[\n        'Development Status :: 4 - Beta',\n        'Environment :: Other Environment',\n        'Intended Audience :: Developers',\n        'Operating System :: OS Independent',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 2',\n        'Programming Language :: Python :: 2.6',\n        'Programming Language :: Python :: 2.7',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.3',\n        'Programming Language :: Python :: 3.4',\n        'Programming Language :: Python :: 3.5',\n        'Topic :: Utilities',\n        'License :: OSI Approved :: Apache Software License',\n    ],\n)\n", "path": "setup.py"}]}