We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[BUG][client] web session has a different signature with the local session
**Describe the bug**

Web has it's own session, but it's `run` method has a different signature with the local session, which lead to a bug that when user submits more than one tensor, only the first tensor would be executed.

**To Reproduce**

```python
In [14]: from mars.session import new_session                                   

In [15]: sess = new_session('http://0.0.0.0:49911')                             

In [16]: a = mt.ones((2, 2))                                                    

In [17]: sess.run(a, a+1)                                                       
Out[17]: 
[array([[1., 1.],
        [1., 1.]])]
```




--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `mars/web/session.py`
Content:
```
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 # Copyright 1999-2018 Alibaba Group Holding Ltd.
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #      http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 
17 import base64
18 import json
19 import time
20 import logging
21 
22 import requests
23 
24 from ..compat import six, TimeoutError
25 from ..serialize import dataserializer
26 from ..errors import ExecutionInterrupted
27 
28 logger = logging.getLogger(__name__)
29 
30 
31 class Session(object):
32     def __init__(self, endpoint, args=None):
33         self._endpoint = endpoint
34         self._args = args
35         self._tensor_to_graph = dict()
36 
37         self._req_session = requests.Session()
38 
39         from requests.adapters import HTTPAdapter
40         self._req_session.mount('http://stackoverflow.com', HTTPAdapter(max_retries=5))
41         self._main()
42 
43     @property
44     def session_id(self):
45         return self._session_id
46 
47     def _main(self):
48         resp = self._req_session.post(self._endpoint + '/api/session', self._args)
49         if resp.status_code >= 400:
50             raise SystemError('Failed to create mars session.')
51         content = json.loads(resp.text)
52         self._session_id = content['session_id']
53 
54     def run(self, tensors, compose=True, wait=True, timeout=-1):
55         from ..graph import DirectedGraph
56         graph = DirectedGraph()
57 
58         if not isinstance(tensors, (list, tuple, set)):
59             tensors = [tensors]
60         for t in tensors:
61             graph = t.build_graph(graph=graph, tiled=False, compose=compose)
62         targets = [t.key for t in tensors]
63 
64         targets_join = ','.join(targets)
65         session_url = self._endpoint + '/api/session/' + self._session_id
66         graph_json = graph.to_json()
67 
68         resp_json = self._submit_graph(graph_json, targets_join)
69         graph_key = resp_json['graph_key']
70         graph_url = session_url + '/graph/' + graph_key
71 
72         for t in tensors:
73             self._tensor_to_graph[t.key] = graph_key
74 
75         if wait:
76             exec_start_time = time.time()
77             while timeout <= 0 or time.time() - exec_start_time <= timeout:
78                 try:
79                     time.sleep(1)
80                     try:
81                         resp = self._req_session.get(graph_url)
82                     except requests.ConnectionError as ex:
83                         err_msg = str(ex)
84                         if 'ConnectionResetError' in err_msg or 'Connection refused' in err_msg:
85                             continue
86                         raise
87                     if resp.status_code == 504:
88                         logging.debug('Gateway Time-out, try again')
89                         continue
90                     if resp.status_code >= 400:
91                         raise SystemError('Failed to read task status. Code: %d, Reason: %s, Content:\n%s' %
92                                           (resp.status_code, resp.reason, resp.text))
93                     resp_json = json.loads(resp.text)
94                     if resp_json['state'] in ('running', 'preparing'):
95                         continue
96                     elif resp_json['state'] == 'success':
97                         break
98                     elif resp_json['state'] == 'cancelled':
99                         raise ExecutionInterrupted
100                     elif resp_json['state'] == 'failed':
101                         # TODO add traceback
102                         if 'traceback' in resp_json:
103                             traceback = resp_json['traceback']
104                             if isinstance(traceback, list):
105                                 traceback = ''.join(str(s) for s in traceback)
106                             raise SystemError('Graph execution failed.\nMessage: %s\nTraceback from server:\n%s' %
107                                               (resp_json['msg'], traceback))
108                         else:
109                             raise SystemError('Graph execution failed with unknown reason.')
110                     else:
111                         raise SystemError('Unknown graph execution state %s' % resp_json['state'])
112                 except KeyboardInterrupt:
113                     resp = self._req_session.delete(graph_url)
114                     if resp.status_code >= 400:
115                         raise SystemError('Failed to stop graph execution. Code: %d, Reason: %s, Content:\n%s' %
116                                           (resp.status_code, resp.reason, resp.text))
117             if 0 < timeout < time.time() - exec_start_time:
118                 raise TimeoutError
119             data_list = []
120             for tk in targets:
121                 resp = self._req_session.get(session_url + '/graph/' + graph_key + '/data/' + tk)
122                 if resp.status_code >= 400:
123                     continue
124                 data_list.append(dataserializer.loads(resp.content))
125             return data_list
126         else:
127             return graph_key
128 
129     def decref(self, *keys):
130         session_url = self._endpoint + '/api/session/' + self._session_id
131         for k in keys:
132             if k not in self._tensor_to_graph:
133                 continue
134             data_url = session_url + '/graph/%s/data/%s' % (self._tensor_to_graph[k], k)
135             self._req_session.delete(data_url)
136 
137     def stop(self, graph_key):
138         session_url = self._endpoint + '/api/session/' + self._session_id
139         graph_url = session_url + '/graph/' + graph_key
140         resp = self._req_session.delete(graph_url)
141         if resp.status_code >= 400:
142             raise SystemError('Failed to stop graph execution. Code: %d, Reason: %s, Content:\n%s' %
143                               (resp.status_code, resp.reason, resp.text))
144 
145     def _submit_graph(self, graph_json, targets):
146         session_url = self._endpoint + '/api/session/' + self._session_id
147         resp = self._req_session.post(session_url + '/graph', dict(
148             graph=json.dumps(graph_json),
149             target=targets,
150         ))
151         if resp.status_code >= 400:
152             resp_json = json.loads(resp.text)
153             exc_info = base64.b64decode(resp_json['exc_info'])
154             six.reraise(*exc_info)
155         resp_json = json.loads(resp.text)
156         return resp_json
157 
158     def close(self):
159         self.decref(*list(self._tensor_to_graph.keys()))
160 
161         resp = self._req_session.delete(self._endpoint + '/api/session/' + self._session_id)
162         if resp.status_code >= 400:
163             raise SystemError('Failed to close mars session.')
164 
165     def check_service_ready(self, timeout=1):
166         try:
167             resp = self._req_session.get(self._endpoint + '/api', timeout=timeout)
168         except (requests.ConnectionError, requests.Timeout):
169             return False
170         if resp.status_code >= 400:
171             return False
172         return True
173 
174     def count_workers(self):
175         resp = self._req_session.get(self._endpoint + '/api/worker', timeout=1)
176         return json.loads(resp.text)
177 
178     def __enter__(self):
179         return self
180 
181     def __exit__(self, exc_type, exc_val, exc_tb):
182         self.close()
183
```
--- 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/mars/web/session.py b/mars/web/session.py
--- a/mars/web/session.py
+++ b/mars/web/session.py
@@ -24,6 +24,7 @@
 from ..compat import six, TimeoutError
 from ..serialize import dataserializer
 from ..errors import ExecutionInterrupted
+from ..graph import DirectedGraph
 
 logger = logging.getLogger(__name__)
 
@@ -51,12 +52,14 @@
         content = json.loads(resp.text)
         self._session_id = content['session_id']
 
-    def run(self, tensors, compose=True, wait=True, timeout=-1):
-        from ..graph import DirectedGraph
-        graph = DirectedGraph()
+    def run(self, *tensors, **kw):
+        timeout = kw.pop('timeout', -1)
+        compose = kw.pop('compose', True)
+        wait = kw.pop('wait', True)
+        if kw:
+            raise TypeError('run got unexpected key arguments {0}'.format(', '.join(kw.keys())))
 
-        if not isinstance(tensors, (list, tuple, set)):
-            tensors = [tensors]
+        graph = DirectedGraph()
         for t in tensors:
             graph = t.build_graph(graph=graph, tiled=False, compose=compose)
         targets = [t.key for t in tensors]

{"golden_diff": "diff --git a/mars/web/session.py b/mars/web/session.py\n--- a/mars/web/session.py\n+++ b/mars/web/session.py\n@@ -24,6 +24,7 @@\n from ..compat import six, TimeoutError\n from ..serialize import dataserializer\n from ..errors import ExecutionInterrupted\n+from ..graph import DirectedGraph\n \n logger = logging.getLogger(__name__)\n \n@@ -51,12 +52,14 @@\n         content = json.loads(resp.text)\n         self._session_id = content['session_id']\n \n-    def run(self, tensors, compose=True, wait=True, timeout=-1):\n-        from ..graph import DirectedGraph\n-        graph = DirectedGraph()\n+    def run(self, *tensors, **kw):\n+        timeout = kw.pop('timeout', -1)\n+        compose = kw.pop('compose', True)\n+        wait = kw.pop('wait', True)\n+        if kw:\n+            raise TypeError('run got unexpected key arguments {0}'.format(', '.join(kw.keys())))\n \n-        if not isinstance(tensors, (list, tuple, set)):\n-            tensors = [tensors]\n+        graph = DirectedGraph()\n         for t in tensors:\n             graph = t.build_graph(graph=graph, tiled=False, compose=compose)\n         targets = [t.key for t in tensors]\n", "issue": "[BUG][client] web session has a different signature with the local session\n**Describe the bug**\r\n\r\nWeb has it's own session, but it's `run` method has a different signature with the local session, which lead to a bug that when user submits more than one tensor, only the first tensor would be executed.\r\n\r\n**To Reproduce**\r\n\r\n```python\r\nIn [14]: from mars.session import new_session                                   \r\n\r\nIn [15]: sess = new_session('http://0.0.0.0:49911')                             \r\n\r\nIn [16]: a = mt.ones((2, 2))                                                    \r\n\r\nIn [17]: sess.run(a, a+1)                                                       \r\nOut[17]: \r\n[array([[1., 1.],\r\n        [1., 1.]])]\r\n```\r\n\r\n\r\n\n", "before_files": [{"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Copyright 1999-2018 Alibaba Group Holding Ltd.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport base64\nimport json\nimport time\nimport logging\n\nimport requests\n\nfrom ..compat import six, TimeoutError\nfrom ..serialize import dataserializer\nfrom ..errors import ExecutionInterrupted\n\nlogger = logging.getLogger(__name__)\n\n\nclass Session(object):\n    def __init__(self, endpoint, args=None):\n        self._endpoint = endpoint\n        self._args = args\n        self._tensor_to_graph = dict()\n\n        self._req_session = requests.Session()\n\n        from requests.adapters import HTTPAdapter\n        self._req_session.mount('http://stackoverflow.com', HTTPAdapter(max_retries=5))\n        self._main()\n\n    @property\n    def session_id(self):\n        return self._session_id\n\n    def _main(self):\n        resp = self._req_session.post(self._endpoint + '/api/session', self._args)\n        if resp.status_code >= 400:\n            raise SystemError('Failed to create mars session.')\n        content = json.loads(resp.text)\n        self._session_id = content['session_id']\n\n    def run(self, tensors, compose=True, wait=True, timeout=-1):\n        from ..graph import DirectedGraph\n        graph = DirectedGraph()\n\n        if not isinstance(tensors, (list, tuple, set)):\n            tensors = [tensors]\n        for t in tensors:\n            graph = t.build_graph(graph=graph, tiled=False, compose=compose)\n        targets = [t.key for t in tensors]\n\n        targets_join = ','.join(targets)\n        session_url = self._endpoint + '/api/session/' + self._session_id\n        graph_json = graph.to_json()\n\n        resp_json = self._submit_graph(graph_json, targets_join)\n        graph_key = resp_json['graph_key']\n        graph_url = session_url + '/graph/' + graph_key\n\n        for t in tensors:\n            self._tensor_to_graph[t.key] = graph_key\n\n        if wait:\n            exec_start_time = time.time()\n            while timeout <= 0 or time.time() - exec_start_time <= timeout:\n                try:\n                    time.sleep(1)\n                    try:\n                        resp = self._req_session.get(graph_url)\n                    except requests.ConnectionError as ex:\n                        err_msg = str(ex)\n                        if 'ConnectionResetError' in err_msg or 'Connection refused' in err_msg:\n                            continue\n                        raise\n                    if resp.status_code == 504:\n                        logging.debug('Gateway Time-out, try again')\n                        continue\n                    if resp.status_code >= 400:\n                        raise SystemError('Failed to read task status. Code: %d, Reason: %s, Content:\\n%s' %\n                                          (resp.status_code, resp.reason, resp.text))\n                    resp_json = json.loads(resp.text)\n                    if resp_json['state'] in ('running', 'preparing'):\n                        continue\n                    elif resp_json['state'] == 'success':\n                        break\n                    elif resp_json['state'] == 'cancelled':\n                        raise ExecutionInterrupted\n                    elif resp_json['state'] == 'failed':\n                        # TODO add traceback\n                        if 'traceback' in resp_json:\n                            traceback = resp_json['traceback']\n                            if isinstance(traceback, list):\n                                traceback = ''.join(str(s) for s in traceback)\n                            raise SystemError('Graph execution failed.\\nMessage: %s\\nTraceback from server:\\n%s' %\n                                              (resp_json['msg'], traceback))\n                        else:\n                            raise SystemError('Graph execution failed with unknown reason.')\n                    else:\n                        raise SystemError('Unknown graph execution state %s' % resp_json['state'])\n                except KeyboardInterrupt:\n                    resp = self._req_session.delete(graph_url)\n                    if resp.status_code >= 400:\n                        raise SystemError('Failed to stop graph execution. Code: %d, Reason: %s, Content:\\n%s' %\n                                          (resp.status_code, resp.reason, resp.text))\n            if 0 < timeout < time.time() - exec_start_time:\n                raise TimeoutError\n            data_list = []\n            for tk in targets:\n                resp = self._req_session.get(session_url + '/graph/' + graph_key + '/data/' + tk)\n                if resp.status_code >= 400:\n                    continue\n                data_list.append(dataserializer.loads(resp.content))\n            return data_list\n        else:\n            return graph_key\n\n    def decref(self, *keys):\n        session_url = self._endpoint + '/api/session/' + self._session_id\n        for k in keys:\n            if k not in self._tensor_to_graph:\n                continue\n            data_url = session_url + '/graph/%s/data/%s' % (self._tensor_to_graph[k], k)\n            self._req_session.delete(data_url)\n\n    def stop(self, graph_key):\n        session_url = self._endpoint + '/api/session/' + self._session_id\n        graph_url = session_url + '/graph/' + graph_key\n        resp = self._req_session.delete(graph_url)\n        if resp.status_code >= 400:\n            raise SystemError('Failed to stop graph execution. Code: %d, Reason: %s, Content:\\n%s' %\n                              (resp.status_code, resp.reason, resp.text))\n\n    def _submit_graph(self, graph_json, targets):\n        session_url = self._endpoint + '/api/session/' + self._session_id\n        resp = self._req_session.post(session_url + '/graph', dict(\n            graph=json.dumps(graph_json),\n            target=targets,\n        ))\n        if resp.status_code >= 400:\n            resp_json = json.loads(resp.text)\n            exc_info = base64.b64decode(resp_json['exc_info'])\n            six.reraise(*exc_info)\n        resp_json = json.loads(resp.text)\n        return resp_json\n\n    def close(self):\n        self.decref(*list(self._tensor_to_graph.keys()))\n\n        resp = self._req_session.delete(self._endpoint + '/api/session/' + self._session_id)\n        if resp.status_code >= 400:\n            raise SystemError('Failed to close mars session.')\n\n    def check_service_ready(self, timeout=1):\n        try:\n            resp = self._req_session.get(self._endpoint + '/api', timeout=timeout)\n        except (requests.ConnectionError, requests.Timeout):\n            return False\n        if resp.status_code >= 400:\n            return False\n        return True\n\n    def count_workers(self):\n        resp = self._req_session.get(self._endpoint + '/api/worker', timeout=1)\n        return json.loads(resp.text)\n\n    def __enter__(self):\n        return self\n\n    def __exit__(self, exc_type, exc_val, exc_tb):\n        self.close()\n", "path": "mars/web/session.py"}], "after_files": [{"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Copyright 1999-2018 Alibaba Group Holding Ltd.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport base64\nimport json\nimport time\nimport logging\n\nimport requests\n\nfrom ..compat import six, TimeoutError\nfrom ..serialize import dataserializer\nfrom ..errors import ExecutionInterrupted\nfrom ..graph import DirectedGraph\n\nlogger = logging.getLogger(__name__)\n\n\nclass Session(object):\n    def __init__(self, endpoint, args=None):\n        self._endpoint = endpoint\n        self._args = args\n        self._tensor_to_graph = dict()\n\n        self._req_session = requests.Session()\n\n        from requests.adapters import HTTPAdapter\n        self._req_session.mount('http://stackoverflow.com', HTTPAdapter(max_retries=5))\n        self._main()\n\n    @property\n    def session_id(self):\n        return self._session_id\n\n    def _main(self):\n        resp = self._req_session.post(self._endpoint + '/api/session', self._args)\n        if resp.status_code >= 400:\n            raise SystemError('Failed to create mars session.')\n        content = json.loads(resp.text)\n        self._session_id = content['session_id']\n\n    def run(self, *tensors, **kw):\n        timeout = kw.pop('timeout', -1)\n        compose = kw.pop('compose', True)\n        wait = kw.pop('wait', True)\n        if kw:\n            raise TypeError('run got unexpected key arguments {0}'.format(', '.join(kw.keys())))\n\n        graph = DirectedGraph()\n        for t in tensors:\n            graph = t.build_graph(graph=graph, tiled=False, compose=compose)\n        targets = [t.key for t in tensors]\n\n        targets_join = ','.join(targets)\n        session_url = self._endpoint + '/api/session/' + self._session_id\n        graph_json = graph.to_json()\n\n        resp_json = self._submit_graph(graph_json, targets_join)\n        graph_key = resp_json['graph_key']\n        graph_url = session_url + '/graph/' + graph_key\n\n        for t in tensors:\n            self._tensor_to_graph[t.key] = graph_key\n\n        if wait:\n            exec_start_time = time.time()\n            while timeout <= 0 or time.time() - exec_start_time <= timeout:\n                try:\n                    time.sleep(1)\n                    try:\n                        resp = self._req_session.get(graph_url)\n                    except requests.ConnectionError as ex:\n                        err_msg = str(ex)\n                        if 'ConnectionResetError' in err_msg or 'Connection refused' in err_msg:\n                            continue\n                        raise\n                    if resp.status_code == 504:\n                        logging.debug('Gateway Time-out, try again')\n                        continue\n                    if resp.status_code >= 400:\n                        raise SystemError('Failed to read task status. Code: %d, Reason: %s, Content:\\n%s' %\n                                          (resp.status_code, resp.reason, resp.text))\n                    resp_json = json.loads(resp.text)\n                    if resp_json['state'] in ('running', 'preparing'):\n                        continue\n                    elif resp_json['state'] == 'success':\n                        break\n                    elif resp_json['state'] == 'cancelled':\n                        raise ExecutionInterrupted\n                    elif resp_json['state'] == 'failed':\n                        # TODO add traceback\n                        if 'traceback' in resp_json:\n                            traceback = resp_json['traceback']\n                            if isinstance(traceback, list):\n                                traceback = ''.join(str(s) for s in traceback)\n                            raise SystemError('Graph execution failed.\\nMessage: %s\\nTraceback from server:\\n%s' %\n                                              (resp_json['msg'], traceback))\n                        else:\n                            raise SystemError('Graph execution failed with unknown reason.')\n                    else:\n                        raise SystemError('Unknown graph execution state %s' % resp_json['state'])\n                except KeyboardInterrupt:\n                    resp = self._req_session.delete(graph_url)\n                    if resp.status_code >= 400:\n                        raise SystemError('Failed to stop graph execution. Code: %d, Reason: %s, Content:\\n%s' %\n                                          (resp.status_code, resp.reason, resp.text))\n            if 0 < timeout < time.time() - exec_start_time:\n                raise TimeoutError\n            data_list = []\n            for tk in targets:\n                resp = self._req_session.get(session_url + '/graph/' + graph_key + '/data/' + tk)\n                if resp.status_code >= 400:\n                    continue\n                data_list.append(dataserializer.loads(resp.content))\n            return data_list\n        else:\n            return graph_key\n\n    def decref(self, *keys):\n        session_url = self._endpoint + '/api/session/' + self._session_id\n        for k in keys:\n            if k not in self._tensor_to_graph:\n                continue\n            data_url = session_url + '/graph/%s/data/%s' % (self._tensor_to_graph[k], k)\n            self._req_session.delete(data_url)\n\n    def stop(self, graph_key):\n        session_url = self._endpoint + '/api/session/' + self._session_id\n        graph_url = session_url + '/graph/' + graph_key\n        resp = self._req_session.delete(graph_url)\n        if resp.status_code >= 400:\n            raise SystemError('Failed to stop graph execution. Code: %d, Reason: %s, Content:\\n%s' %\n                              (resp.status_code, resp.reason, resp.text))\n\n    def _submit_graph(self, graph_json, targets):\n        session_url = self._endpoint + '/api/session/' + self._session_id\n        resp = self._req_session.post(session_url + '/graph', dict(\n            graph=json.dumps(graph_json),\n            target=targets,\n        ))\n        if resp.status_code >= 400:\n            resp_json = json.loads(resp.text)\n            exc_info = base64.b64decode(resp_json['exc_info'])\n            six.reraise(*exc_info)\n        resp_json = json.loads(resp.text)\n        return resp_json\n\n    def close(self):\n        self.decref(*list(self._tensor_to_graph.keys()))\n\n        resp = self._req_session.delete(self._endpoint + '/api/session/' + self._session_id)\n        if resp.status_code >= 400:\n            raise SystemError('Failed to close mars session.')\n\n    def check_service_ready(self, timeout=1):\n        try:\n            resp = self._req_session.get(self._endpoint + '/api', timeout=timeout)\n        except (requests.ConnectionError, requests.Timeout):\n            return False\n        if resp.status_code >= 400:\n            return False\n        return True\n\n    def count_workers(self):\n        resp = self._req_session.get(self._endpoint + '/api/worker', timeout=1)\n        return json.loads(resp.text)\n\n    def __enter__(self):\n        return self\n\n    def __exit__(self, exc_type, exc_val, exc_tb):\n        self.close()\n", "path": "mars/web/session.py"}]}