We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
client.networks.containers() is always empty
```
>>> import docker
>>> d = docker.from_env()
>>> [n.name for n in d.networks.list()]
['pedlintegrationtests_default', 'bridge', 'host', 'none']
>>> [n.containers for n in d.networks.list()]
[[], [], [], []]
```

```
$ docker network inspect pedlintegrationtests_default | jq '.[0].Containers | length'
4
```

```
$ pip freeze | grep docker && python --version && docker version
docker==2.5.1
docker-compose==1.16.1
docker-pycreds==0.2.1
dockerpty==0.4.1
nvidia-docker-compose==0.1.4
Python 3.5.2
Client:
 Version:      17.09.0-ce
 API version:  1.32
 Go version:   go1.8.3
 Git commit:   afdb6d4
 Built:        Tue Sep 26 22:42:18 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.09.0-ce
 API version:  1.32 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   afdb6d4
 Built:        Tue Sep 26 22:40:56 2017
 OS/Arch:      linux/amd64
 Experimental: false
```

--- 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/models/networks.py`
Content:
```
1 from ..api import APIClient
2 from .containers import Container
3 from .resource import Model, Collection
4 
5 
6 class Network(Model):
7     """
8     A Docker network.
9     """
10     @property
11     def name(self):
12         """
13         The name of the network.
14         """
15         return self.attrs.get('Name')
16 
17     @property
18     def containers(self):
19         """
20         The containers that are connected to the network, as a list of
21         :py:class:`~docker.models.containers.Container` objects.
22         """
23         return [
24             self.client.containers.get(cid) for cid in
25             (self.attrs.get('Containers') or {}).keys()
26         ]
27 
28     def connect(self, container, *args, **kwargs):
29         """
30         Connect a container to this network.
31 
32         Args:
33             container (str): Container to connect to this network, as either
34                 an ID, name, or :py:class:`~docker.models.containers.Container`
35                 object.
36             aliases (:py:class:`list`): A list of aliases for this endpoint.
37                 Names in that list can be used within the network to reach the
38                 container. Defaults to ``None``.
39             links (:py:class:`list`): A list of links for this endpoint.
40                 Containers declared in this list will be linkedto this
41                 container. Defaults to ``None``.
42             ipv4_address (str): The IP address of this container on the
43                 network, using the IPv4 protocol. Defaults to ``None``.
44             ipv6_address (str): The IP address of this container on the
45                 network, using the IPv6 protocol. Defaults to ``None``.
46             link_local_ips (:py:class:`list`): A list of link-local (IPv4/IPv6)
47                 addresses.
48 
49         Raises:
50             :py:class:`docker.errors.APIError`
51                 If the server returns an error.
52         """
53         if isinstance(container, Container):
54             container = container.id
55         return self.client.api.connect_container_to_network(
56             container, self.id, *args, **kwargs
57         )
58 
59     def disconnect(self, container, *args, **kwargs):
60         """
61         Disconnect a container from this network.
62 
63         Args:
64             container (str): Container to disconnect from this network, as
65                 either an ID, name, or
66                 :py:class:`~docker.models.containers.Container` object.
67             force (bool): Force the container to disconnect from a network.
68                 Default: ``False``
69 
70         Raises:
71             :py:class:`docker.errors.APIError`
72                 If the server returns an error.
73         """
74         if isinstance(container, Container):
75             container = container.id
76         return self.client.api.disconnect_container_from_network(
77             container, self.id, *args, **kwargs
78         )
79 
80     def remove(self):
81         """
82         Remove this network.
83 
84         Raises:
85             :py:class:`docker.errors.APIError`
86                 If the server returns an error.
87         """
88         return self.client.api.remove_network(self.id)
89 
90 
91 class NetworkCollection(Collection):
92     """
93     Networks on the Docker server.
94     """
95     model = Network
96 
97     def create(self, name, *args, **kwargs):
98         """
99         Create a network. Similar to the ``docker network create``.
100 
101         Args:
102             name (str): Name of the network
103             driver (str): Name of the driver used to create the network
104             options (dict): Driver options as a key-value dictionary
105             ipam (IPAMConfig): Optional custom IP scheme for the network.
106             check_duplicate (bool): Request daemon to check for networks with
107                 same name. Default: ``None``.
108             internal (bool): Restrict external access to the network. Default
109                 ``False``.
110             labels (dict): Map of labels to set on the network. Default
111                 ``None``.
112             enable_ipv6 (bool): Enable IPv6 on the network. Default ``False``.
113             attachable (bool): If enabled, and the network is in the global
114                 scope,  non-service containers on worker nodes will be able to
115                 connect to the network.
116             scope (str): Specify the network's scope (``local``, ``global`` or
117                 ``swarm``)
118             ingress (bool): If set, create an ingress network which provides
119                 the routing-mesh in swarm mode.
120 
121         Returns:
122             (:py:class:`Network`): The network that was created.
123 
124         Raises:
125             :py:class:`docker.errors.APIError`
126                 If the server returns an error.
127 
128         Example:
129             A network using the bridge driver:
130 
131                 >>> client.networks.create("network1", driver="bridge")
132 
133             You can also create more advanced networks with custom IPAM
134             configurations. For example, setting the subnet to
135             ``192.168.52.0/24`` and gateway address to ``192.168.52.254``.
136 
137             .. code-block:: python
138 
139                 >>> ipam_pool = docker.types.IPAMPool(
140                     subnet='192.168.52.0/24',
141                     gateway='192.168.52.254'
142                 )
143                 >>> ipam_config = docker.types.IPAMConfig(
144                     pool_configs=[ipam_pool]
145                 )
146                 >>> client.networks.create(
147                     "network1",
148                     driver="bridge",
149                     ipam=ipam_config
150                 )
151 
152         """
153         resp = self.client.api.create_network(name, *args, **kwargs)
154         return self.get(resp['Id'])
155 
156     def get(self, network_id):
157         """
158         Get a network by its ID.
159 
160         Args:
161             network_id (str): The ID of the network.
162             verbose (bool): Retrieve the service details across the cluster in
163                 swarm mode.
164             scope (str): Filter the network by scope (``swarm``, ``global``
165                 or ``local``).
166 
167         Returns:
168             (:py:class:`Network`) The network.
169 
170         Raises:
171             :py:class:`docker.errors.NotFound`
172                 If the network does not exist.
173 
174             :py:class:`docker.errors.APIError`
175                 If the server returns an error.
176 
177         """
178         return self.prepare_model(self.client.api.inspect_network(network_id))
179 
180     def list(self, *args, **kwargs):
181         """
182         List networks. Similar to the ``docker networks ls`` command.
183 
184         Args:
185             names (:py:class:`list`): List of names to filter by.
186             ids (:py:class:`list`): List of ids to filter by.
187 
188         Returns:
189             (list of :py:class:`Network`) The networks on the server.
190 
191         Raises:
192             :py:class:`docker.errors.APIError`
193                 If the server returns an error.
194         """
195         resp = self.client.api.networks(*args, **kwargs)
196         return [self.prepare_model(item) for item in resp]
197 
198     def prune(self, filters=None):
199         self.client.api.prune_networks(filters=filters)
200     prune.__doc__ = APIClient.prune_networks.__doc__
201
```
--- 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/models/networks.py b/docker/models/networks.py
--- a/docker/models/networks.py
+++ b/docker/models/networks.py
@@ -1,4 +1,5 @@
 from ..api import APIClient
+from ..utils import version_gte
 from .containers import Container
 from .resource import Model, Collection
 
@@ -153,7 +154,7 @@
         resp = self.client.api.create_network(name, *args, **kwargs)
         return self.get(resp['Id'])
 
-    def get(self, network_id):
+    def get(self, network_id, *args, **kwargs):
         """
         Get a network by its ID.
 
@@ -175,7 +176,9 @@
                 If the server returns an error.
 
         """
-        return self.prepare_model(self.client.api.inspect_network(network_id))
+        return self.prepare_model(
+            self.client.api.inspect_network(network_id, *args, **kwargs)
+        )
 
     def list(self, *args, **kwargs):
         """
@@ -184,6 +187,13 @@
         Args:
             names (:py:class:`list`): List of names to filter by.
             ids (:py:class:`list`): List of ids to filter by.
+            filters (dict): Filters to be processed on the network list.
+                Available filters:
+                - ``driver=[<driver-name>]`` Matches a network's driver.
+                - ``label=[<key>]`` or ``label=[<key>=<value>]``.
+                - ``type=["custom"|"builtin"]`` Filters networks by type.
+            greedy (bool): Fetch more details for each network individually.
+                You might want this to get the containers attached to them.
 
         Returns:
             (list of :py:class:`Network`) The networks on the server.
@@ -192,8 +202,13 @@
             :py:class:`docker.errors.APIError`
                 If the server returns an error.
         """
+        greedy = kwargs.pop('greedy', False)
         resp = self.client.api.networks(*args, **kwargs)
-        return [self.prepare_model(item) for item in resp]
+        networks = [self.prepare_model(item) for item in resp]
+        if greedy and version_gte(self.client.api._version, '1.28'):
+            for net in networks:
+                net.reload()
+        return networks
 
     def prune(self, filters=None):
         self.client.api.prune_networks(filters=filters)

{"golden_diff": "diff --git a/docker/models/networks.py b/docker/models/networks.py\n--- a/docker/models/networks.py\n+++ b/docker/models/networks.py\n@@ -1,4 +1,5 @@\n from ..api import APIClient\n+from ..utils import version_gte\n from .containers import Container\n from .resource import Model, Collection\n \n@@ -153,7 +154,7 @@\n         resp = self.client.api.create_network(name, *args, **kwargs)\n         return self.get(resp['Id'])\n \n-    def get(self, network_id):\n+    def get(self, network_id, *args, **kwargs):\n         \"\"\"\n         Get a network by its ID.\n \n@@ -175,7 +176,9 @@\n                 If the server returns an error.\n \n         \"\"\"\n-        return self.prepare_model(self.client.api.inspect_network(network_id))\n+        return self.prepare_model(\n+            self.client.api.inspect_network(network_id, *args, **kwargs)\n+        )\n \n     def list(self, *args, **kwargs):\n         \"\"\"\n@@ -184,6 +187,13 @@\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+            greedy (bool): Fetch more details for each network individually.\n+                You might want this to get the containers attached to them.\n \n         Returns:\n             (list of :py:class:`Network`) The networks on the server.\n@@ -192,8 +202,13 @@\n             :py:class:`docker.errors.APIError`\n                 If the server returns an error.\n         \"\"\"\n+        greedy = kwargs.pop('greedy', False)\n         resp = self.client.api.networks(*args, **kwargs)\n-        return [self.prepare_model(item) for item in resp]\n+        networks = [self.prepare_model(item) for item in resp]\n+        if greedy and version_gte(self.client.api._version, '1.28'):\n+            for net in networks:\n+                net.reload()\n+        return networks\n \n     def prune(self, filters=None):\n         self.client.api.prune_networks(filters=filters)\n", "issue": "client.networks.containers() is always empty\n```\r\n>>> import docker\r\n>>> d = docker.from_env()\r\n>>> [n.name for n in d.networks.list()]\r\n['pedlintegrationtests_default', 'bridge', 'host', 'none']\r\n>>> [n.containers for n in d.networks.list()]\r\n[[], [], [], []]\r\n```\r\n\r\n```\r\n$ docker network inspect pedlintegrationtests_default | jq '.[0].Containers | length'\r\n4\r\n```\r\n\r\n```\r\n$ pip freeze | grep docker && python --version && docker version\r\ndocker==2.5.1\r\ndocker-compose==1.16.1\r\ndocker-pycreds==0.2.1\r\ndockerpty==0.4.1\r\nnvidia-docker-compose==0.1.4\r\nPython 3.5.2\r\nClient:\r\n Version:      17.09.0-ce\r\n API version:  1.32\r\n Go version:   go1.8.3\r\n Git commit:   afdb6d4\r\n Built:        Tue Sep 26 22:42:18 2017\r\n OS/Arch:      linux/amd64\r\n\r\nServer:\r\n Version:      17.09.0-ce\r\n API version:  1.32 (minimum version 1.12)\r\n Go version:   go1.8.3\r\n Git commit:   afdb6d4\r\n Built:        Tue Sep 26 22:40:56 2017\r\n OS/Arch:      linux/amd64\r\n Experimental: false\r\n```\n", "before_files": [{"content": "from ..api import APIClient\nfrom .containers import Container\nfrom .resource import Model, Collection\n\n\nclass Network(Model):\n    \"\"\"\n    A Docker network.\n    \"\"\"\n    @property\n    def name(self):\n        \"\"\"\n        The name of the network.\n        \"\"\"\n        return self.attrs.get('Name')\n\n    @property\n    def containers(self):\n        \"\"\"\n        The containers that are connected to the network, as a list of\n        :py:class:`~docker.models.containers.Container` objects.\n        \"\"\"\n        return [\n            self.client.containers.get(cid) for cid in\n            (self.attrs.get('Containers') or {}).keys()\n        ]\n\n    def connect(self, container, *args, **kwargs):\n        \"\"\"\n        Connect a container to this network.\n\n        Args:\n            container (str): Container to connect to this network, as either\n                an ID, name, or :py:class:`~docker.models.containers.Container`\n                object.\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 linkedto 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 (IPv4/IPv6)\n                addresses.\n\n        Raises:\n            :py:class:`docker.errors.APIError`\n                If the server returns an error.\n        \"\"\"\n        if isinstance(container, Container):\n            container = container.id\n        return self.client.api.connect_container_to_network(\n            container, self.id, *args, **kwargs\n        )\n\n    def disconnect(self, container, *args, **kwargs):\n        \"\"\"\n        Disconnect a container from this network.\n\n        Args:\n            container (str): Container to disconnect from this network, as\n                either an ID, name, or\n                :py:class:`~docker.models.containers.Container` object.\n            force (bool): Force the container to disconnect from a network.\n                Default: ``False``\n\n        Raises:\n            :py:class:`docker.errors.APIError`\n                If the server returns an error.\n        \"\"\"\n        if isinstance(container, Container):\n            container = container.id\n        return self.client.api.disconnect_container_from_network(\n            container, self.id, *args, **kwargs\n        )\n\n    def remove(self):\n        \"\"\"\n        Remove this network.\n\n        Raises:\n            :py:class:`docker.errors.APIError`\n                If the server returns an error.\n        \"\"\"\n        return self.client.api.remove_network(self.id)\n\n\nclass NetworkCollection(Collection):\n    \"\"\"\n    Networks on the Docker server.\n    \"\"\"\n    model = Network\n\n    def create(self, name, *args, **kwargs):\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            scope (str): Specify the network's scope (``local``, ``global`` or\n                ``swarm``)\n            ingress (bool): If set, create an ingress network which provides\n                the routing-mesh in swarm mode.\n\n        Returns:\n            (:py:class:`Network`): The network that was created.\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.networks.create(\"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                >>> client.networks.create(\n                    \"network1\",\n                    driver=\"bridge\",\n                    ipam=ipam_config\n                )\n\n        \"\"\"\n        resp = self.client.api.create_network(name, *args, **kwargs)\n        return self.get(resp['Id'])\n\n    def get(self, network_id):\n        \"\"\"\n        Get a network by its ID.\n\n        Args:\n            network_id (str): The ID of the network.\n            verbose (bool): Retrieve the service details across the cluster in\n                swarm mode.\n            scope (str): Filter the network by scope (``swarm``, ``global``\n                or ``local``).\n\n        Returns:\n            (:py:class:`Network`) The network.\n\n        Raises:\n            :py:class:`docker.errors.NotFound`\n                If the network does not exist.\n\n            :py:class:`docker.errors.APIError`\n                If the server returns an error.\n\n        \"\"\"\n        return self.prepare_model(self.client.api.inspect_network(network_id))\n\n    def list(self, *args, **kwargs):\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\n        Returns:\n            (list of :py:class:`Network`) The networks on the server.\n\n        Raises:\n            :py:class:`docker.errors.APIError`\n                If the server returns an error.\n        \"\"\"\n        resp = self.client.api.networks(*args, **kwargs)\n        return [self.prepare_model(item) for item in resp]\n\n    def prune(self, filters=None):\n        self.client.api.prune_networks(filters=filters)\n    prune.__doc__ = APIClient.prune_networks.__doc__\n", "path": "docker/models/networks.py"}], "after_files": [{"content": "from ..api import APIClient\nfrom ..utils import version_gte\nfrom .containers import Container\nfrom .resource import Model, Collection\n\n\nclass Network(Model):\n    \"\"\"\n    A Docker network.\n    \"\"\"\n    @property\n    def name(self):\n        \"\"\"\n        The name of the network.\n        \"\"\"\n        return self.attrs.get('Name')\n\n    @property\n    def containers(self):\n        \"\"\"\n        The containers that are connected to the network, as a list of\n        :py:class:`~docker.models.containers.Container` objects.\n        \"\"\"\n        return [\n            self.client.containers.get(cid) for cid in\n            (self.attrs.get('Containers') or {}).keys()\n        ]\n\n    def connect(self, container, *args, **kwargs):\n        \"\"\"\n        Connect a container to this network.\n\n        Args:\n            container (str): Container to connect to this network, as either\n                an ID, name, or :py:class:`~docker.models.containers.Container`\n                object.\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 linkedto 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 (IPv4/IPv6)\n                addresses.\n\n        Raises:\n            :py:class:`docker.errors.APIError`\n                If the server returns an error.\n        \"\"\"\n        if isinstance(container, Container):\n            container = container.id\n        return self.client.api.connect_container_to_network(\n            container, self.id, *args, **kwargs\n        )\n\n    def disconnect(self, container, *args, **kwargs):\n        \"\"\"\n        Disconnect a container from this network.\n\n        Args:\n            container (str): Container to disconnect from this network, as\n                either an ID, name, or\n                :py:class:`~docker.models.containers.Container` object.\n            force (bool): Force the container to disconnect from a network.\n                Default: ``False``\n\n        Raises:\n            :py:class:`docker.errors.APIError`\n                If the server returns an error.\n        \"\"\"\n        if isinstance(container, Container):\n            container = container.id\n        return self.client.api.disconnect_container_from_network(\n            container, self.id, *args, **kwargs\n        )\n\n    def remove(self):\n        \"\"\"\n        Remove this network.\n\n        Raises:\n            :py:class:`docker.errors.APIError`\n                If the server returns an error.\n        \"\"\"\n        return self.client.api.remove_network(self.id)\n\n\nclass NetworkCollection(Collection):\n    \"\"\"\n    Networks on the Docker server.\n    \"\"\"\n    model = Network\n\n    def create(self, name, *args, **kwargs):\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            scope (str): Specify the network's scope (``local``, ``global`` or\n                ``swarm``)\n            ingress (bool): If set, create an ingress network which provides\n                the routing-mesh in swarm mode.\n\n        Returns:\n            (:py:class:`Network`): The network that was created.\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.networks.create(\"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                >>> client.networks.create(\n                    \"network1\",\n                    driver=\"bridge\",\n                    ipam=ipam_config\n                )\n\n        \"\"\"\n        resp = self.client.api.create_network(name, *args, **kwargs)\n        return self.get(resp['Id'])\n\n    def get(self, network_id, *args, **kwargs):\n        \"\"\"\n        Get a network by its ID.\n\n        Args:\n            network_id (str): The ID of the network.\n            verbose (bool): Retrieve the service details across the cluster in\n                swarm mode.\n            scope (str): Filter the network by scope (``swarm``, ``global``\n                or ``local``).\n\n        Returns:\n            (:py:class:`Network`) The network.\n\n        Raises:\n            :py:class:`docker.errors.NotFound`\n                If the network does not exist.\n\n            :py:class:`docker.errors.APIError`\n                If the server returns an error.\n\n        \"\"\"\n        return self.prepare_model(\n            self.client.api.inspect_network(network_id, *args, **kwargs)\n        )\n\n    def list(self, *args, **kwargs):\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            greedy (bool): Fetch more details for each network individually.\n                You might want this to get the containers attached to them.\n\n        Returns:\n            (list of :py:class:`Network`) The networks on the server.\n\n        Raises:\n            :py:class:`docker.errors.APIError`\n                If the server returns an error.\n        \"\"\"\n        greedy = kwargs.pop('greedy', False)\n        resp = self.client.api.networks(*args, **kwargs)\n        networks = [self.prepare_model(item) for item in resp]\n        if greedy and version_gte(self.client.api._version, '1.28'):\n            for net in networks:\n                net.reload()\n        return networks\n\n    def prune(self, filters=None):\n        self.client.api.prune_networks(filters=filters)\n    prune.__doc__ = APIClient.prune_networks.__doc__\n", "path": "docker/models/networks.py"}]}