We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Hide TensorBoard service REST call logs
Currently these logs appear on master pod's log which is not necessary at user level:
```
I0624 15:50:54.834580 140272641951488 _internal.py:122] ::ffff:10.138.0.35 - - [24/Jun/2019 15:50:54] "GET /data/plugin/scalars/tags HTTP/1.1" 200 -
W0624 15:50:55.150964 140556554397440 servicer.py:195] Task result for outdated version 30 dropped
I0624 15:50:57.245738 140272633558784 _internal.py:122] ::ffff:10.36.1.1 - - [24/Jun/2019 15:50:57] "GET /data/environment HTTP/1.1" 200 -
I0624 15:50:57.250612 140271752836864 _internal.py:122] ::ffff:10.138.0.35 - - [24/Jun/2019 15:50:57] "GET /data/experiments HTTP/1.1" 200 -
I0624 15:50:57.252254 140272105903872 _internal.py:122] ::ffff:10.36.1.1 - - [24/Jun/2019 15:50:57] "GET /data/runs HTTP/1.1" 200 -
I0624 15:50:57.255696 140272641951488 _internal.py:122] ::ffff:10.138.0.35 - - [24/Jun/2019 15:50:57] "GET /data/plugins_listing HTTP/1.1" 200 -
I0624 15:50:57.430979 140272641951488 _internal.py:122] ::ffff:10.138.0.35 - - [24/Jun/2019 15:50:57] "GET /data/plugin/scalars/tags HTTP/1.1" 200 -
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `elasticdl/python/elasticdl/master/tensorboard_service.py`
Content:
```
1 import datetime
2 import subprocess
3 import time
4 
5 import tensorflow as tf
6 
7 import numpy as np
8 
9 
10 class TensorboardService(object):
11     """Tensorboard Service implementation"""
12 
13     def __init__(self, tensorboard_log_dir):
14         """
15         Arguments:
16             tensorboard_log_dir: The log directory for Tensorboard.
17         """
18         _current_time = datetime.datetime.now().strftime("%Y%m%d-%H%M%S")
19         self._tensorboard_log_dir = tensorboard_log_dir + _current_time
20         self._initialize_summary_writer()
21         self.tb_process = None
22 
23     def _initialize_summary_writer(self):
24         self.summary_writer = tf.summary.create_file_writer(
25             self._tensorboard_log_dir
26         )
27 
28     def write_dict_to_summary(self, dictionary, version):
29         with self.summary_writer.as_default():
30             for k, v in dictionary.items():
31                 if isinstance(v, np.ndarray) and len(v) == 1:
32                     v = v[0]
33                 tf.summary.scalar(k, v, step=version)
34 
35     def start(self):
36         self.tb_process = subprocess.Popen(
37             ["tensorboard --logdir " + self._tensorboard_log_dir], shell=True
38         )
39 
40     def keep_running(self):
41         while self.tb_process.poll() is None:
42             time.sleep(10)
43
```
--- 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/elasticdl/python/elasticdl/master/tensorboard_service.py b/elasticdl/python/elasticdl/master/tensorboard_service.py
--- a/elasticdl/python/elasticdl/master/tensorboard_service.py
+++ b/elasticdl/python/elasticdl/master/tensorboard_service.py
@@ -34,7 +34,10 @@
 
     def start(self):
         self.tb_process = subprocess.Popen(
-            ["tensorboard --logdir " + self._tensorboard_log_dir], shell=True
+            ["tensorboard --logdir " + self._tensorboard_log_dir],
+            shell=True,
+            stdout=subprocess.DEVNULL,
+            stderr=subprocess.STDOUT,
         )
 
     def keep_running(self):

{"golden_diff": "diff --git a/elasticdl/python/elasticdl/master/tensorboard_service.py b/elasticdl/python/elasticdl/master/tensorboard_service.py\n--- a/elasticdl/python/elasticdl/master/tensorboard_service.py\n+++ b/elasticdl/python/elasticdl/master/tensorboard_service.py\n@@ -34,7 +34,10 @@\n \n     def start(self):\n         self.tb_process = subprocess.Popen(\n-            [\"tensorboard --logdir \" + self._tensorboard_log_dir], shell=True\n+            [\"tensorboard --logdir \" + self._tensorboard_log_dir],\n+            shell=True,\n+            stdout=subprocess.DEVNULL,\n+            stderr=subprocess.STDOUT,\n         )\n \n     def keep_running(self):\n", "issue": "Hide TensorBoard service REST call logs\nCurrently these logs appear on master pod's log which is not necessary at user level:\r\n```\r\nI0624 15:50:54.834580 140272641951488 _internal.py:122] ::ffff:10.138.0.35 - - [24/Jun/2019 15:50:54] \"GET /data/plugin/scalars/tags HTTP/1.1\" 200 -\r\nW0624 15:50:55.150964 140556554397440 servicer.py:195] Task result for outdated version 30 dropped\r\nI0624 15:50:57.245738 140272633558784 _internal.py:122] ::ffff:10.36.1.1 - - [24/Jun/2019 15:50:57] \"GET /data/environment HTTP/1.1\" 200 -\r\nI0624 15:50:57.250612 140271752836864 _internal.py:122] ::ffff:10.138.0.35 - - [24/Jun/2019 15:50:57] \"GET /data/experiments HTTP/1.1\" 200 -\r\nI0624 15:50:57.252254 140272105903872 _internal.py:122] ::ffff:10.36.1.1 - - [24/Jun/2019 15:50:57] \"GET /data/runs HTTP/1.1\" 200 -\r\nI0624 15:50:57.255696 140272641951488 _internal.py:122] ::ffff:10.138.0.35 - - [24/Jun/2019 15:50:57] \"GET /data/plugins_listing HTTP/1.1\" 200 -\r\nI0624 15:50:57.430979 140272641951488 _internal.py:122] ::ffff:10.138.0.35 - - [24/Jun/2019 15:50:57] \"GET /data/plugin/scalars/tags HTTP/1.1\" 200 -\r\n```\n", "before_files": [{"content": "import datetime\nimport subprocess\nimport time\n\nimport tensorflow as tf\n\nimport numpy as np\n\n\nclass TensorboardService(object):\n    \"\"\"Tensorboard Service implementation\"\"\"\n\n    def __init__(self, tensorboard_log_dir):\n        \"\"\"\n        Arguments:\n            tensorboard_log_dir: The log directory for Tensorboard.\n        \"\"\"\n        _current_time = datetime.datetime.now().strftime(\"%Y%m%d-%H%M%S\")\n        self._tensorboard_log_dir = tensorboard_log_dir + _current_time\n        self._initialize_summary_writer()\n        self.tb_process = None\n\n    def _initialize_summary_writer(self):\n        self.summary_writer = tf.summary.create_file_writer(\n            self._tensorboard_log_dir\n        )\n\n    def write_dict_to_summary(self, dictionary, version):\n        with self.summary_writer.as_default():\n            for k, v in dictionary.items():\n                if isinstance(v, np.ndarray) and len(v) == 1:\n                    v = v[0]\n                tf.summary.scalar(k, v, step=version)\n\n    def start(self):\n        self.tb_process = subprocess.Popen(\n            [\"tensorboard --logdir \" + self._tensorboard_log_dir], shell=True\n        )\n\n    def keep_running(self):\n        while self.tb_process.poll() is None:\n            time.sleep(10)\n", "path": "elasticdl/python/elasticdl/master/tensorboard_service.py"}], "after_files": [{"content": "import datetime\nimport subprocess\nimport time\n\nimport tensorflow as tf\n\nimport numpy as np\n\n\nclass TensorboardService(object):\n    \"\"\"Tensorboard Service implementation\"\"\"\n\n    def __init__(self, tensorboard_log_dir):\n        \"\"\"\n        Arguments:\n            tensorboard_log_dir: The log directory for Tensorboard.\n        \"\"\"\n        _current_time = datetime.datetime.now().strftime(\"%Y%m%d-%H%M%S\")\n        self._tensorboard_log_dir = tensorboard_log_dir + _current_time\n        self._initialize_summary_writer()\n        self.tb_process = None\n\n    def _initialize_summary_writer(self):\n        self.summary_writer = tf.summary.create_file_writer(\n            self._tensorboard_log_dir\n        )\n\n    def write_dict_to_summary(self, dictionary, version):\n        with self.summary_writer.as_default():\n            for k, v in dictionary.items():\n                if isinstance(v, np.ndarray) and len(v) == 1:\n                    v = v[0]\n                tf.summary.scalar(k, v, step=version)\n\n    def start(self):\n        self.tb_process = subprocess.Popen(\n            [\"tensorboard --logdir \" + self._tensorboard_log_dir],\n            shell=True,\n            stdout=subprocess.DEVNULL,\n            stderr=subprocess.STDOUT,\n        )\n\n    def keep_running(self):\n        while self.tb_process.poll() is None:\n            time.sleep(10)\n", "path": "elasticdl/python/elasticdl/master/tensorboard_service.py"}]}