We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN 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`


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `docker/api/volume.py`
Content:
```
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
```

Path: `docker/api/network.py`
Content:
```
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 FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

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

{"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"}], "after_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", "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, 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)\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"}]}