prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <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 -
  ```
  
  </issue>
  <code>
  [start of elasticdl/python/elasticdl/master/tensorboard_service.py]
  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 of elasticdl/python/elasticdl/master/tensorboard_service.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: 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):
  
verification_info: {"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"}]}