We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
client.networks.create check_duplicates docs not reflective of behavior
Docs say it does, but it's actually set to `None`.

--- 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/network.py`
Content:
```
1 from ..errors import InvalidVersion
2 from ..utils import check_resource, minimum_version
3 from ..utils import version_lt
4 from .. import utils
5 
6 
7 class NetworkApiMixin(object):
8     @minimum_version('1.21')
9     def networks(self, names=None, ids=None, filters=None):
10         """
11         List networks. Similar to the ``docker networks ls`` command.
12 
13         Args:
14             names (:py:class:`list`): List of names to filter by
15             ids (:py:class:`list`): List of ids to filter by
16             filters (dict): Filters to be processed on the network list.
17                 Available filters:
18                 - ``driver=[<driver-name>]`` Matches a network's driver.
19                 - ``label=[<key>]`` or ``label=[<key>=<value>]``.
20                 - ``type=["custom"|"builtin"]`` Filters networks by type.
21 
22         Returns:
23             (dict): List of network objects.
24 
25         Raises:
26             :py:class:`docker.errors.APIError`
27                 If the server returns an error.
28         """
29 
30         if filters is None:
31             filters = {}
32         if names:
33             filters['name'] = names
34         if ids:
35             filters['id'] = ids
36         params = {'filters': utils.convert_filters(filters)}
37         url = self._url("/networks")
38         res = self._get(url, params=params)
39         return self._result(res, json=True)
40 
41     @minimum_version('1.21')
42     def create_network(self, name, driver=None, options=None, ipam=None,
43                        check_duplicate=None, internal=False, labels=None,
44                        enable_ipv6=False, attachable=None, scope=None,
45                        ingress=None):
46         """
47         Create a network. Similar to the ``docker network create``.
48 
49         Args:
50             name (str): Name of the network
51             driver (str): Name of the driver used to create the network
52             options (dict): Driver options as a key-value dictionary
53             ipam (IPAMConfig): Optional custom IP scheme for the network.
54             check_duplicate (bool): Request daemon to check for networks with
55                 same name. Default: ``True``.
56             internal (bool): Restrict external access to the network. Default
57                 ``False``.
58             labels (dict): Map of labels to set on the network. Default
59                 ``None``.
60             enable_ipv6 (bool): Enable IPv6 on the network. Default ``False``.
61             attachable (bool): If enabled, and the network is in the global
62                 scope,  non-service containers on worker nodes will be able to
63                 connect to the network.
64             ingress (bool): If set, create an ingress network which provides
65                 the routing-mesh in swarm mode.
66 
67         Returns:
68             (dict): The created network reference object
69 
70         Raises:
71             :py:class:`docker.errors.APIError`
72                 If the server returns an error.
73 
74         Example:
75             A network using the bridge driver:
76 
77                 >>> client.create_network("network1", driver="bridge")
78 
79             You can also create more advanced networks with custom IPAM
80             configurations. For example, setting the subnet to
81             ``192.168.52.0/24`` and gateway address to ``192.168.52.254``.
82 
83             .. code-block:: python
84 
85                 >>> ipam_pool = docker.types.IPAMPool(
86                     subnet='192.168.52.0/24',
87                     gateway='192.168.52.254'
88                 )
89                 >>> ipam_config = docker.types.IPAMConfig(
90                     pool_configs=[ipam_pool]
91                 )
92                 >>> docker_client.create_network("network1", driver="bridge",
93                                                  ipam=ipam_config)
94         """
95         if options is not None and not isinstance(options, dict):
96             raise TypeError('options must be a dictionary')
97 
98         data = {
99             'Name': name,
100             'Driver': driver,
101             'Options': options,
102             'IPAM': ipam,
103             'CheckDuplicate': check_duplicate,
104         }
105 
106         if labels is not None:
107             if version_lt(self._version, '1.23'):
108                 raise InvalidVersion(
109                     'network labels were introduced in API 1.23'
110                 )
111             if not isinstance(labels, dict):
112                 raise TypeError('labels must be a dictionary')
113             data["Labels"] = labels
114 
115         if enable_ipv6:
116             if version_lt(self._version, '1.23'):
117                 raise InvalidVersion(
118                     'enable_ipv6 was introduced in API 1.23'
119                 )
120             data['EnableIPv6'] = True
121 
122         if internal:
123             if version_lt(self._version, '1.22'):
124                 raise InvalidVersion('Internal networks are not '
125                                      'supported in API version < 1.22')
126             data['Internal'] = True
127 
128         if attachable is not None:
129             if version_lt(self._version, '1.24'):
130                 raise InvalidVersion(
131                     'attachable is not supported in API version < 1.24'
132                 )
133             data['Attachable'] = attachable
134 
135         if ingress is not None:
136             if version_lt(self._version, '1.29'):
137                 raise InvalidVersion(
138                     'ingress is not supported in API version < 1.29'
139                 )
140 
141             data['Ingress'] = ingress
142 
143         url = self._url("/networks/create")
144         res = self._post_json(url, data=data)
145         return self._result(res, json=True)
146 
147     @minimum_version('1.25')
148     def prune_networks(self, filters=None):
149         """
150         Delete unused networks
151 
152         Args:
153             filters (dict): Filters to process on the prune list.
154 
155         Returns:
156             (dict): A dict containing a list of deleted network names and
157                 the amount of disk space reclaimed in bytes.
158 
159         Raises:
160             :py:class:`docker.errors.APIError`
161                 If the server returns an error.
162         """
163         params = {}
164         if filters:
165             params['filters'] = utils.convert_filters(filters)
166         url = self._url('/networks/prune')
167         return self._result(self._post(url, params=params), True)
168 
169     @minimum_version('1.21')
170     @check_resource('net_id')
171     def remove_network(self, net_id):
172         """
173         Remove a network. Similar to the ``docker network rm`` command.
174 
175         Args:
176             net_id (str): The network's id
177         """
178         url = self._url("/networks/{0}", net_id)
179         res = self._delete(url)
180         self._raise_for_status(res)
181 
182     @minimum_version('1.21')
183     @check_resource('net_id')
184     def inspect_network(self, net_id, verbose=None):
185         """
186         Get detailed information about a network.
187 
188         Args:
189             net_id (str): ID of network
190             verbose (bool): Show the service details across the cluster in
191                 swarm mode.
192         """
193         params = {}
194         if verbose is not None:
195             if version_lt(self._version, '1.28'):
196                 raise InvalidVersion('verbose was introduced in API 1.28')
197             params['verbose'] = verbose
198 
199         url = self._url("/networks/{0}", net_id)
200         res = self._get(url, params=params)
201         return self._result(res, json=True)
202 
203     @check_resource('container')
204     @minimum_version('1.21')
205     def connect_container_to_network(self, container, net_id,
206                                      ipv4_address=None, ipv6_address=None,
207                                      aliases=None, links=None,
208                                      link_local_ips=None):
209         """
210         Connect a container to a network.
211 
212         Args:
213             container (str): container-id/name to be connected to the network
214             net_id (str): network id
215             aliases (:py:class:`list`): A list of aliases for this endpoint.
216                 Names in that list can be used within the network to reach the
217                 container. Defaults to ``None``.
218             links (:py:class:`list`): A list of links for this endpoint.
219                 Containers declared in this list will be linked to this
220                 container. Defaults to ``None``.
221             ipv4_address (str): The IP address of this container on the
222                 network, using the IPv4 protocol. Defaults to ``None``.
223             ipv6_address (str): The IP address of this container on the
224                 network, using the IPv6 protocol. Defaults to ``None``.
225             link_local_ips (:py:class:`list`): A list of link-local
226             (IPv4/IPv6) addresses.
227         """
228         data = {
229             "Container": container,
230             "EndpointConfig": self.create_endpoint_config(
231                 aliases=aliases, links=links, ipv4_address=ipv4_address,
232                 ipv6_address=ipv6_address, link_local_ips=link_local_ips
233             ),
234         }
235 
236         url = self._url("/networks/{0}/connect", net_id)
237         res = self._post_json(url, data=data)
238         self._raise_for_status(res)
239 
240     @check_resource('container')
241     @minimum_version('1.21')
242     def disconnect_container_from_network(self, container, net_id,
243                                           force=False):
244         """
245         Disconnect a container from a network.
246 
247         Args:
248             container (str): container ID or name to be disconnected from the
249                 network
250             net_id (str): network ID
251             force (bool): Force the container to disconnect from a network.
252                 Default: ``False``
253         """
254         data = {"Container": container}
255         if force:
256             if version_lt(self._version, '1.22'):
257                 raise InvalidVersion(
258                     'Forced disconnect was introduced in API 1.22'
259                 )
260             data['Force'] = force
261         url = self._url("/networks/{0}/disconnect", net_id)
262         res = self._post_json(url, data=data)
263         self._raise_for_status(res)
264
```
--- 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
@@ -52,7 +52,7 @@
             options (dict): Driver options as a key-value dictionary
             ipam (IPAMConfig): Optional custom IP scheme for the network.
             check_duplicate (bool): Request daemon to check for networks with
-                same name. Default: ``True``.
+                same name. Default: ``None``.
             internal (bool): Restrict external access to the network. Default
                 ``False``.
             labels (dict): Map of labels to set on the network. Default

{"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@@ -52,7 +52,7 @@\n             options (dict): Driver options as a key-value dictionary\n             ipam (IPAMConfig): Optional custom IP scheme for the network.\n             check_duplicate (bool): Request daemon to check for networks with\n-                same name. Default: ``True``.\n+                same name. Default: ``None``.\n             internal (bool): Restrict external access to the network. Default\n                 ``False``.\n             labels (dict): Map of labels to set on the network. Default\n", "issue": "client.networks.create check_duplicates docs not reflective of behavior\nDocs say it does, but it's actually set to `None`.\n", "before_files": [{"content": "from ..errors import InvalidVersion\nfrom ..utils import check_resource, minimum_version\nfrom ..utils import version_lt\nfrom .. import utils\n\n\nclass NetworkApiMixin(object):\n    @minimum_version('1.21')\n    def networks(self, names=None, ids=None, filters=None):\n        \"\"\"\n        List networks. Similar to the ``docker networks ls`` command.\n\n        Args:\n            names (:py:class:`list`): List of names to filter by\n            ids (:py:class:`list`): List of ids to filter by\n            filters (dict): Filters to be processed on the network list.\n                Available filters:\n                - ``driver=[<driver-name>]`` Matches a network's driver.\n                - ``label=[<key>]`` or ``label=[<key>=<value>]``.\n                - ``type=[\"custom\"|\"builtin\"]`` Filters networks by type.\n\n        Returns:\n            (dict): List of network objects.\n\n        Raises:\n            :py:class:`docker.errors.APIError`\n                If the server returns an error.\n        \"\"\"\n\n        if filters is None:\n            filters = {}\n        if names:\n            filters['name'] = names\n        if ids:\n            filters['id'] = ids\n        params = {'filters': utils.convert_filters(filters)}\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, ipam=None,\n                       check_duplicate=None, internal=False, labels=None,\n                       enable_ipv6=False, attachable=None, scope=None,\n                       ingress=None):\n        \"\"\"\n        Create a network. Similar to the ``docker network create``.\n\n        Args:\n            name (str): Name of the network\n            driver (str): Name of the driver used to create the network\n            options (dict): Driver options as a key-value dictionary\n            ipam (IPAMConfig): Optional custom IP scheme for the network.\n            check_duplicate (bool): Request daemon to check for networks with\n                same name. Default: ``True``.\n            internal (bool): Restrict external access to the network. Default\n                ``False``.\n            labels (dict): Map of labels to set on the network. Default\n                ``None``.\n            enable_ipv6 (bool): Enable IPv6 on the network. Default ``False``.\n            attachable (bool): If enabled, and the network is in the global\n                scope,  non-service containers on worker nodes will be able to\n                connect to the network.\n            ingress (bool): If set, create an ingress network which provides\n                the routing-mesh in swarm mode.\n\n        Returns:\n            (dict): The created network reference object\n\n        Raises:\n            :py:class:`docker.errors.APIError`\n                If the server returns an error.\n\n        Example:\n            A network using the bridge driver:\n\n                >>> client.create_network(\"network1\", driver=\"bridge\")\n\n            You can also create more advanced networks with custom IPAM\n            configurations. For example, setting the subnet to\n            ``192.168.52.0/24`` and gateway address to ``192.168.52.254``.\n\n            .. code-block:: python\n\n                >>> ipam_pool = docker.types.IPAMPool(\n                    subnet='192.168.52.0/24',\n                    gateway='192.168.52.254'\n                )\n                >>> ipam_config = docker.types.IPAMConfig(\n                    pool_configs=[ipam_pool]\n                )\n                >>> docker_client.create_network(\"network1\", driver=\"bridge\",\n                                                 ipam=ipam_config)\n        \"\"\"\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            'IPAM': ipam,\n            'CheckDuplicate': check_duplicate,\n        }\n\n        if labels is not None:\n            if version_lt(self._version, '1.23'):\n                raise InvalidVersion(\n                    'network labels were introduced in API 1.23'\n                )\n            if not isinstance(labels, dict):\n                raise TypeError('labels must be a dictionary')\n            data[\"Labels\"] = labels\n\n        if enable_ipv6:\n            if version_lt(self._version, '1.23'):\n                raise InvalidVersion(\n                    'enable_ipv6 was introduced in API 1.23'\n                )\n            data['EnableIPv6'] = True\n\n        if internal:\n            if version_lt(self._version, '1.22'):\n                raise InvalidVersion('Internal networks are not '\n                                     'supported in API version < 1.22')\n            data['Internal'] = True\n\n        if attachable is not None:\n            if version_lt(self._version, '1.24'):\n                raise InvalidVersion(\n                    'attachable is not supported in API version < 1.24'\n                )\n            data['Attachable'] = attachable\n\n        if ingress is not None:\n            if version_lt(self._version, '1.29'):\n                raise InvalidVersion(\n                    'ingress is not supported in API version < 1.29'\n                )\n\n            data['Ingress'] = ingress\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.25')\n    def prune_networks(self, filters=None):\n        \"\"\"\n        Delete unused networks\n\n        Args:\n            filters (dict): Filters to process on the prune list.\n\n        Returns:\n            (dict): A dict containing a list of deleted network names and\n                the amount of disk space reclaimed in bytes.\n\n        Raises:\n            :py:class:`docker.errors.APIError`\n                If the server returns an error.\n        \"\"\"\n        params = {}\n        if filters:\n            params['filters'] = utils.convert_filters(filters)\n        url = self._url('/networks/prune')\n        return self._result(self._post(url, params=params), True)\n\n    @minimum_version('1.21')\n    @check_resource('net_id')\n    def remove_network(self, net_id):\n        \"\"\"\n        Remove a network. Similar to the ``docker network rm`` command.\n\n        Args:\n            net_id (str): The network's id\n        \"\"\"\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    @check_resource('net_id')\n    def inspect_network(self, net_id, verbose=None):\n        \"\"\"\n        Get detailed information about a network.\n\n        Args:\n            net_id (str): ID of network\n            verbose (bool): Show the service details across the cluster in\n                swarm mode.\n        \"\"\"\n        params = {}\n        if verbose is not None:\n            if version_lt(self._version, '1.28'):\n                raise InvalidVersion('verbose was introduced in API 1.28')\n            params['verbose'] = verbose\n\n        url = self._url(\"/networks/{0}\", net_id)\n        res = self._get(url, params=params)\n        return self._result(res, json=True)\n\n    @check_resource('container')\n    @minimum_version('1.21')\n    def connect_container_to_network(self, container, net_id,\n                                     ipv4_address=None, ipv6_address=None,\n                                     aliases=None, links=None,\n                                     link_local_ips=None):\n        \"\"\"\n        Connect a container to a network.\n\n        Args:\n            container (str): container-id/name to be connected to the network\n            net_id (str): network id\n            aliases (:py:class:`list`): A list of aliases for this endpoint.\n                Names in that list can be used within the network to reach the\n                container. Defaults to ``None``.\n            links (:py:class:`list`): A list of links for this endpoint.\n                Containers declared in this list will be linked to this\n                container. Defaults to ``None``.\n            ipv4_address (str): The IP address of this container on the\n                network, using the IPv4 protocol. Defaults to ``None``.\n            ipv6_address (str): The IP address of this container on the\n                network, using the IPv6 protocol. Defaults to ``None``.\n            link_local_ips (:py:class:`list`): A list of link-local\n            (IPv4/IPv6) addresses.\n        \"\"\"\n        data = {\n            \"Container\": container,\n            \"EndpointConfig\": self.create_endpoint_config(\n                aliases=aliases, links=links, ipv4_address=ipv4_address,\n                ipv6_address=ipv6_address, link_local_ips=link_local_ips\n            ),\n        }\n\n        url = self._url(\"/networks/{0}/connect\", net_id)\n        res = self._post_json(url, data=data)\n        self._raise_for_status(res)\n\n    @check_resource('container')\n    @minimum_version('1.21')\n    def disconnect_container_from_network(self, container, net_id,\n                                          force=False):\n        \"\"\"\n        Disconnect a container from a network.\n\n        Args:\n            container (str): container ID or name to be disconnected from the\n                network\n            net_id (str): network ID\n            force (bool): Force the container to disconnect from a network.\n                Default: ``False``\n        \"\"\"\n        data = {\"Container\": container}\n        if force:\n            if version_lt(self._version, '1.22'):\n                raise InvalidVersion(\n                    'Forced disconnect was introduced in API 1.22'\n                )\n            data['Force'] = force\n        url = self._url(\"/networks/{0}/disconnect\", net_id)\n        res = self._post_json(url, data=data)\n        self._raise_for_status(res)\n", "path": "docker/api/network.py"}], "after_files": [{"content": "from ..errors import InvalidVersion\nfrom ..utils import check_resource, minimum_version\nfrom ..utils import version_lt\nfrom .. import utils\n\n\nclass NetworkApiMixin(object):\n    @minimum_version('1.21')\n    def networks(self, names=None, ids=None, filters=None):\n        \"\"\"\n        List networks. Similar to the ``docker networks ls`` command.\n\n        Args:\n            names (:py:class:`list`): List of names to filter by\n            ids (:py:class:`list`): List of ids to filter by\n            filters (dict): Filters to be processed on the network list.\n                Available filters:\n                - ``driver=[<driver-name>]`` Matches a network's driver.\n                - ``label=[<key>]`` or ``label=[<key>=<value>]``.\n                - ``type=[\"custom\"|\"builtin\"]`` Filters networks by type.\n\n        Returns:\n            (dict): List of network objects.\n\n        Raises:\n            :py:class:`docker.errors.APIError`\n                If the server returns an error.\n        \"\"\"\n\n        if filters is None:\n            filters = {}\n        if names:\n            filters['name'] = names\n        if ids:\n            filters['id'] = ids\n        params = {'filters': utils.convert_filters(filters)}\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, ipam=None,\n                       check_duplicate=None, internal=False, labels=None,\n                       enable_ipv6=False, attachable=None, scope=None,\n                       ingress=None):\n        \"\"\"\n        Create a network. Similar to the ``docker network create``.\n\n        Args:\n            name (str): Name of the network\n            driver (str): Name of the driver used to create the network\n            options (dict): Driver options as a key-value dictionary\n            ipam (IPAMConfig): Optional custom IP scheme for the network.\n            check_duplicate (bool): Request daemon to check for networks with\n                same name. Default: ``None``.\n            internal (bool): Restrict external access to the network. Default\n                ``False``.\n            labels (dict): Map of labels to set on the network. Default\n                ``None``.\n            enable_ipv6 (bool): Enable IPv6 on the network. Default ``False``.\n            attachable (bool): If enabled, and the network is in the global\n                scope,  non-service containers on worker nodes will be able to\n                connect to the network.\n            ingress (bool): If set, create an ingress network which provides\n                the routing-mesh in swarm mode.\n\n        Returns:\n            (dict): The created network reference object\n\n        Raises:\n            :py:class:`docker.errors.APIError`\n                If the server returns an error.\n\n        Example:\n            A network using the bridge driver:\n\n                >>> client.create_network(\"network1\", driver=\"bridge\")\n\n            You can also create more advanced networks with custom IPAM\n            configurations. For example, setting the subnet to\n            ``192.168.52.0/24`` and gateway address to ``192.168.52.254``.\n\n            .. code-block:: python\n\n                >>> ipam_pool = docker.types.IPAMPool(\n                    subnet='192.168.52.0/24',\n                    gateway='192.168.52.254'\n                )\n                >>> ipam_config = docker.types.IPAMConfig(\n                    pool_configs=[ipam_pool]\n                )\n                >>> docker_client.create_network(\"network1\", driver=\"bridge\",\n                                                 ipam=ipam_config)\n        \"\"\"\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            'IPAM': ipam,\n            'CheckDuplicate': check_duplicate,\n        }\n\n        if labels is not None:\n            if version_lt(self._version, '1.23'):\n                raise InvalidVersion(\n                    'network labels were introduced in API 1.23'\n                )\n            if not isinstance(labels, dict):\n                raise TypeError('labels must be a dictionary')\n            data[\"Labels\"] = labels\n\n        if enable_ipv6:\n            if version_lt(self._version, '1.23'):\n                raise InvalidVersion(\n                    'enable_ipv6 was introduced in API 1.23'\n                )\n            data['EnableIPv6'] = True\n\n        if internal:\n            if version_lt(self._version, '1.22'):\n                raise InvalidVersion('Internal networks are not '\n                                     'supported in API version < 1.22')\n            data['Internal'] = True\n\n        if attachable is not None:\n            if version_lt(self._version, '1.24'):\n                raise InvalidVersion(\n                    'attachable is not supported in API version < 1.24'\n                )\n            data['Attachable'] = attachable\n\n        if ingress is not None:\n            if version_lt(self._version, '1.29'):\n                raise InvalidVersion(\n                    'ingress is not supported in API version < 1.29'\n                )\n\n            data['Ingress'] = ingress\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.25')\n    def prune_networks(self, filters=None):\n        \"\"\"\n        Delete unused networks\n\n        Args:\n            filters (dict): Filters to process on the prune list.\n\n        Returns:\n            (dict): A dict containing a list of deleted network names and\n                the amount of disk space reclaimed in bytes.\n\n        Raises:\n            :py:class:`docker.errors.APIError`\n                If the server returns an error.\n        \"\"\"\n        params = {}\n        if filters:\n            params['filters'] = utils.convert_filters(filters)\n        url = self._url('/networks/prune')\n        return self._result(self._post(url, params=params), True)\n\n    @minimum_version('1.21')\n    @check_resource('net_id')\n    def remove_network(self, net_id):\n        \"\"\"\n        Remove a network. Similar to the ``docker network rm`` command.\n\n        Args:\n            net_id (str): The network's id\n        \"\"\"\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    @check_resource('net_id')\n    def inspect_network(self, net_id, verbose=None):\n        \"\"\"\n        Get detailed information about a network.\n\n        Args:\n            net_id (str): ID of network\n            verbose (bool): Show the service details across the cluster in\n                swarm mode.\n        \"\"\"\n        params = {}\n        if verbose is not None:\n            if version_lt(self._version, '1.28'):\n                raise InvalidVersion('verbose was introduced in API 1.28')\n            params['verbose'] = verbose\n\n        url = self._url(\"/networks/{0}\", net_id)\n        res = self._get(url, params=params)\n        return self._result(res, json=True)\n\n    @check_resource('container')\n    @minimum_version('1.21')\n    def connect_container_to_network(self, container, net_id,\n                                     ipv4_address=None, ipv6_address=None,\n                                     aliases=None, links=None,\n                                     link_local_ips=None):\n        \"\"\"\n        Connect a container to a network.\n\n        Args:\n            container (str): container-id/name to be connected to the network\n            net_id (str): network id\n            aliases (:py:class:`list`): A list of aliases for this endpoint.\n                Names in that list can be used within the network to reach the\n                container. Defaults to ``None``.\n            links (:py:class:`list`): A list of links for this endpoint.\n                Containers declared in this list will be linked to this\n                container. Defaults to ``None``.\n            ipv4_address (str): The IP address of this container on the\n                network, using the IPv4 protocol. Defaults to ``None``.\n            ipv6_address (str): The IP address of this container on the\n                network, using the IPv6 protocol. Defaults to ``None``.\n            link_local_ips (:py:class:`list`): A list of link-local\n            (IPv4/IPv6) addresses.\n        \"\"\"\n        data = {\n            \"Container\": container,\n            \"EndpointConfig\": self.create_endpoint_config(\n                aliases=aliases, links=links, ipv4_address=ipv4_address,\n                ipv6_address=ipv6_address, link_local_ips=link_local_ips\n            ),\n        }\n\n        url = self._url(\"/networks/{0}/connect\", net_id)\n        res = self._post_json(url, data=data)\n        self._raise_for_status(res)\n\n    @check_resource('container')\n    @minimum_version('1.21')\n    def disconnect_container_from_network(self, container, net_id,\n                                          force=False):\n        \"\"\"\n        Disconnect a container from a network.\n\n        Args:\n            container (str): container ID or name to be disconnected from the\n                network\n            net_id (str): network ID\n            force (bool): Force the container to disconnect from a network.\n                Default: ``False``\n        \"\"\"\n        data = {\"Container\": container}\n        if force:\n            if version_lt(self._version, '1.22'):\n                raise InvalidVersion(\n                    'Forced disconnect was introduced in API 1.22'\n                )\n            data['Force'] = force\n        url = self._url(\"/networks/{0}/disconnect\", net_id)\n        res = self._post_json(url, data=data)\n        self._raise_for_status(res)\n", "path": "docker/api/network.py"}]}