prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  No documentation for network api
  The following have missing documentation ([readthedocs](http://docker-py.readthedocs.org/)).
  - [x] `Client.networks`
  - [x] `Client.create_network`
  - [x] `Client.remove_network`
  - [x] `Client.inspect_network`
  - [x] `Client.connect_container_to_network`
  - [x] `Client.disconnect_container_from_network`
  
  
  </issue>
  <code>
  [start of docker/api/volume.py]
  1 from .. import utils
  2 
  3 
  4 class VolumeApiMixin(object):
  5     @utils.minimum_version('1.21')
  6     def volumes(self, filters=None):
  7         params = {
  8             'filters': utils.convert_filters(filters) if filters else None
  9         }
  10         url = self._url('/volumes')
  11         return self._result(self._get(url, params=params), True)
  12 
  13     @utils.minimum_version('1.21')
  14     def create_volume(self, name, driver=None, driver_opts=None):
  15         url = self._url('/volumes/create')
  16         if driver_opts is not None and not isinstance(driver_opts, dict):
  17             raise TypeError('driver_opts must be a dictionary')
  18 
  19         data = {
  20             'Name': name,
  21             'Driver': driver,
  22             'DriverOpts': driver_opts,
  23         }
  24         return self._result(self._post_json(url, data=data), True)
  25 
  26     @utils.minimum_version('1.21')
  27     def inspect_volume(self, name):
  28         url = self._url('/volumes/{0}', name)
  29         return self._result(self._get(url), True)
  30 
  31     @utils.minimum_version('1.21')
  32     def remove_volume(self, name):
  33         url = self._url('/volumes/{0}', name)
  34         resp = self._delete(url)
  35         self._raise_for_status(resp)
  36         return True
  37
  [end of docker/api/volume.py]
  [start of docker/api/network.py]
  1 import json
  2 
  3 from ..utils import check_resource, minimum_version
  4 
  5 
  6 class NetworkApiMixin(object):
  7     @minimum_version('1.21')
  8     def networks(self, names=None, ids=None):
  9         filters = {}
  10         if names:
  11             filters['name'] = names
  12         if ids:
  13             filters['id'] = ids
  14 
  15         params = {'filters': json.dumps(filters)}
  16 
  17         url = self._url("/networks")
  18         res = self._get(url, params=params)
  19         return self._result(res, json=True)
  20 
  21     @minimum_version('1.21')
  22     def create_network(self, name, driver=None):
  23         data = {
  24             'name': name,
  25             'driver': driver,
  26         }
  27         url = self._url("/networks/create")
  28         res = self._post_json(url, data=data)
  29         return self._result(res, json=True)
  30 
  31     @minimum_version('1.21')
  32     def remove_network(self, net_id):
  33         url = self._url("/networks/{0}", net_id)
  34         res = self._delete(url)
  35         self._raise_for_status(res)
  36 
  37     @minimum_version('1.21')
  38     def inspect_network(self, net_id):
  39         url = self._url("/networks/{0}", net_id)
  40         res = self._get(url)
  41         return self._result(res, json=True)
  42 
  43     @check_resource
  44     @minimum_version('1.21')
  45     def connect_container_to_network(self, container, net_id):
  46         data = {"container": container}
  47         url = self._url("/networks/{0}/connect", net_id)
  48         self._post_json(url, data=data)
  49 
  50     @check_resource
  51     @minimum_version('1.21')
  52     def disconnect_container_from_network(self, container, net_id):
  53         data = {"container": container}
  54         url = self._url("/networks/{0}/disconnect", net_id)
  55         self._post_json(url, data=data)
  56
  [end of docker/api/network.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/docker/api/network.py b/docker/api/network.py
  --- a/docker/api/network.py
  +++ b/docker/api/network.py
  @@ -19,10 +19,14 @@
           return self._result(res, json=True)
   
       @minimum_version('1.21')
  -    def create_network(self, name, driver=None):
  +    def create_network(self, name, driver=None, options=None):
  +        if options is not None and not isinstance(options, dict):
  +            raise TypeError('options must be a dictionary')
  +
           data = {
               'name': name,
               'driver': driver,
  +            'options': options
           }
           url = self._url("/networks/create")
           res = self._post_json(url, data=data)
  diff --git a/docker/api/volume.py b/docker/api/volume.py
  --- a/docker/api/volume.py
  +++ b/docker/api/volume.py
  @@ -33,4 +33,3 @@
           url = self._url('/volumes/{0}', name)
           resp = self._delete(url)
           self._raise_for_status(resp)
  -        return True
  
verification_info: {"golden_diff": "diff --git a/docker/api/network.py b/docker/api/network.py\n--- a/docker/api/network.py\n+++ b/docker/api/network.py\n@@ -19,10 +19,14 @@\n         return self._result(res, json=True)\n \n     @minimum_version('1.21')\n-    def create_network(self, name, driver=None):\n+    def create_network(self, name, driver=None, options=None):\n+        if options is not None and not isinstance(options, dict):\n+            raise TypeError('options must be a dictionary')\n+\n         data = {\n             'name': name,\n             'driver': driver,\n+            'options': options\n         }\n         url = self._url(\"/networks/create\")\n         res = self._post_json(url, data=data)\ndiff --git a/docker/api/volume.py b/docker/api/volume.py\n--- a/docker/api/volume.py\n+++ b/docker/api/volume.py\n@@ -33,4 +33,3 @@\n         url = self._url('/volumes/{0}', name)\n         resp = self._delete(url)\n         self._raise_for_status(resp)\n-        return True\n", "issue": "No documentation for network api\nThe following have missing documentation ([readthedocs](http://docker-py.readthedocs.org/)).\n- [x] `Client.networks`\n- [x] `Client.create_network`\n- [x] `Client.remove_network`\n- [x] `Client.inspect_network`\n- [x] `Client.connect_container_to_network`\n- [x] `Client.disconnect_container_from_network`\n\n", "before_files": [{"content": "from .. import utils\n\n\nclass VolumeApiMixin(object):\n    @utils.minimum_version('1.21')\n    def volumes(self, filters=None):\n        params = {\n            'filters': utils.convert_filters(filters) if filters else None\n        }\n        url = self._url('/volumes')\n        return self._result(self._get(url, params=params), True)\n\n    @utils.minimum_version('1.21')\n    def create_volume(self, name, driver=None, driver_opts=None):\n        url = self._url('/volumes/create')\n        if driver_opts is not None and not isinstance(driver_opts, dict):\n            raise TypeError('driver_opts must be a dictionary')\n\n        data = {\n            'Name': name,\n            'Driver': driver,\n            'DriverOpts': driver_opts,\n        }\n        return self._result(self._post_json(url, data=data), True)\n\n    @utils.minimum_version('1.21')\n    def inspect_volume(self, name):\n        url = self._url('/volumes/{0}', name)\n        return self._result(self._get(url), True)\n\n    @utils.minimum_version('1.21')\n    def remove_volume(self, name):\n        url = self._url('/volumes/{0}', name)\n        resp = self._delete(url)\n        self._raise_for_status(resp)\n        return True\n", "path": "docker/api/volume.py"}, {"content": "import json\n\nfrom ..utils import check_resource, minimum_version\n\n\nclass NetworkApiMixin(object):\n    @minimum_version('1.21')\n    def networks(self, names=None, ids=None):\n        filters = {}\n        if names:\n            filters['name'] = names\n        if ids:\n            filters['id'] = ids\n\n        params = {'filters': json.dumps(filters)}\n\n        url = self._url(\"/networks\")\n        res = self._get(url, params=params)\n        return self._result(res, json=True)\n\n    @minimum_version('1.21')\n    def create_network(self, name, driver=None):\n        data = {\n            'name': name,\n            'driver': driver,\n        }\n        url = self._url(\"/networks/create\")\n        res = self._post_json(url, data=data)\n        return self._result(res, json=True)\n\n    @minimum_version('1.21')\n    def remove_network(self, net_id):\n        url = self._url(\"/networks/{0}\", net_id)\n        res = self._delete(url)\n        self._raise_for_status(res)\n\n    @minimum_version('1.21')\n    def inspect_network(self, net_id):\n        url = self._url(\"/networks/{0}\", net_id)\n        res = self._get(url)\n        return self._result(res, json=True)\n\n    @check_resource\n    @minimum_version('1.21')\n    def connect_container_to_network(self, container, net_id):\n        data = {\"container\": container}\n        url = self._url(\"/networks/{0}/connect\", net_id)\n        self._post_json(url, data=data)\n\n    @check_resource\n    @minimum_version('1.21')\n    def disconnect_container_from_network(self, container, net_id):\n        data = {\"container\": container}\n        url = self._url(\"/networks/{0}/disconnect\", net_id)\n        self._post_json(url, data=data)\n", "path": "docker/api/network.py"}]}