We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Syft Keras bug on Windows
Relevant slack discussion: https://openmined.slack.com/archives/C6DEWA4FR/p1559899875021800

Bug:
![image](https://user-images.githubusercontent.com/7891333/59118559-79fa9400-891e-11e9-990e-1bba1fe9ec93.png)

It looks like the problem here is that the `tfe.config` is being saved in a location that is not a valid filepath in Windows.  As a result, there is likely a file with the name `/tmp/tfe.config` being saved in some folder on the machine, as opposed to a file with the name `tfe.config` being saved in the root subdirectory called `tmp`.

The fix for this should use `os.path` to figure out which filepath the tfe.config should be saved to, and then the logging messages should print the OS-specific CLI command for launching each `TFEWorker` process.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `syft/workers/tfe.py`
Content:
```
1 """To be extended in the near future."""
2 from collections import OrderedDict
3 import logging
4 import subprocess
5 
6 import tf_encrypted as tfe
7 
8 
9 logger = logging.getLogger("tf_encrypted")
10 
11 
12 class TFEWorker:
13     # TODO(Morten) this should be turned into a proxy, with existing code
14     # extracted into a new component that's launched via a script
15 
16     def __init__(self, host=None, auto_managed=True):
17         self.host = host
18         self._server_process = None
19         self._auto_managed = auto_managed
20 
21     def start(self, player_name, *workers):
22         if self.host is None:
23             # we're running using a tfe.LocalConfig which doesn't require us to do anything
24             return
25 
26         config_filename = "/tmp/tfe.config"
27 
28         config, _ = self.config_from_workers(workers)
29         config.save(config_filename)
30 
31         if self._auto_managed:
32             cmd = "python -m tf_encrypted.player --config {} {}".format(
33                 config_filename, player_name
34             )
35             self._server_process = subprocess.Popen(cmd.split(" "))
36         else:
37             logger.info(
38                 "If not done already, please launch the following "
39                 "command in a terminal on host '%s':\n"
40                 "'python -m tf_encrypted.player --config %s %s'\n"
41                 "This can be done automatically in a local subprocess by "
42                 "setting `auto_managed=True` when instantiating a TFEWorker.",
43                 self.host,
44                 config_filename,
45                 player_name,
46             )
47 
48     def stop(self):
49         if self.host is None:
50             # we're running using a tfe.LocalConfig which doesn't require us to do anything
51             return
52 
53         if self._auto_managed:
54             if self._server_process is None:
55                 return
56             self._server_process.kill()
57             self._server_process.communicate()
58             self._server_process = None
59         else:
60             logger.info("Please terminate the process on host '%s'.", self.host)
61 
62     def connect_to_model(self, input_shape, output_shape, *workers):
63         config, _ = self.config_from_workers(workers)
64         tfe.set_config(config)
65 
66         prot = tfe.protocol.SecureNN(
67             config.get_player("server0"), config.get_player("server1"), config.get_player("server2")
68         )
69         tfe.set_protocol(prot)
70 
71         self._tf_client = tfe.serving.QueueClient(
72             input_shape=input_shape, output_shape=output_shape
73         )
74 
75         sess = tfe.Session(config=config)
76         self._tf_session = sess
77 
78     def query_model(self, data):
79         self.query_model_async(data)
80         return self.query_model_join()
81 
82     def query_model_async(self, data):
83         self._tf_client.send_input(self._tf_session, data)
84 
85     def query_model_join(self):
86         return self._tf_client.receive_output(self._tf_session)
87 
88     @classmethod
89     def config_from_workers(cls, workers):
90         if len(workers) != 3:
91             raise ValueError("Expected three workers but {} were given".format(len(workers)))
92 
93         player_to_worker_mapping = OrderedDict()
94         player_to_worker_mapping["server0"] = workers[0]
95         player_to_worker_mapping["server1"] = workers[1]
96         player_to_worker_mapping["server2"] = workers[2]
97 
98         use_local_config = all(worker.host is None for worker in workers)
99         if use_local_config:
100             config = tfe.LocalConfig(
101                 player_names=player_to_worker_mapping.keys(), auto_add_unknown_players=False
102             )
103             return config, player_to_worker_mapping
104 
105         # use tfe.RemoteConfig
106         hostmap = OrderedDict(
107             [(player_name, worker.host) for player_name, worker in player_to_worker_mapping.items()]
108         )
109         config = tfe.RemoteConfig(hostmap)
110         return config, player_to_worker_mapping
111
```
--- 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/syft/workers/tfe.py b/syft/workers/tfe.py
--- a/syft/workers/tfe.py
+++ b/syft/workers/tfe.py
@@ -1,12 +1,15 @@
 """To be extended in the near future."""
 from collections import OrderedDict
 import logging
+import os
 import subprocess
+import tempfile
 
 import tf_encrypted as tfe
 
 
 logger = logging.getLogger("tf_encrypted")
+_TMP_DIR = tempfile.gettempdir()
 
 
 class TFEWorker:
@@ -23,26 +26,24 @@
             # we're running using a tfe.LocalConfig which doesn't require us to do anything
             return
 
-        config_filename = "/tmp/tfe.config"
+        config_filename = os.path.join(_TMP_DIR, "tfe.config")
 
         config, _ = self.config_from_workers(workers)
         config.save(config_filename)
 
+        launch_cmd = "python -m tf_encrypted.player --config {} {}".format(
+            config_filename, player_name
+        )
         if self._auto_managed:
-            cmd = "python -m tf_encrypted.player --config {} {}".format(
-                config_filename, player_name
-            )
-            self._server_process = subprocess.Popen(cmd.split(" "))
+            self._server_process = subprocess.Popen(launch_cmd.split(" "))
         else:
             logger.info(
                 "If not done already, please launch the following "
-                "command in a terminal on host '%s':\n"
-                "'python -m tf_encrypted.player --config %s %s'\n"
+                "command in a terminal on host %s: '%s'\n"
                 "This can be done automatically in a local subprocess by "
-                "setting `auto_managed=True` when instantiating a TFEWorker.",
+                "setting `auto_managed=True` when instantiating a TFEWorker.\n",
                 self.host,
-                config_filename,
-                player_name,
+                launch_cmd,
             )
 
     def stop(self):

{"golden_diff": "diff --git a/syft/workers/tfe.py b/syft/workers/tfe.py\n--- a/syft/workers/tfe.py\n+++ b/syft/workers/tfe.py\n@@ -1,12 +1,15 @@\n \"\"\"To be extended in the near future.\"\"\"\n from collections import OrderedDict\n import logging\n+import os\n import subprocess\n+import tempfile\n \n import tf_encrypted as tfe\n \n \n logger = logging.getLogger(\"tf_encrypted\")\n+_TMP_DIR = tempfile.gettempdir()\n \n \n class TFEWorker:\n@@ -23,26 +26,24 @@\n             # we're running using a tfe.LocalConfig which doesn't require us to do anything\n             return\n \n-        config_filename = \"/tmp/tfe.config\"\n+        config_filename = os.path.join(_TMP_DIR, \"tfe.config\")\n \n         config, _ = self.config_from_workers(workers)\n         config.save(config_filename)\n \n+        launch_cmd = \"python -m tf_encrypted.player --config {} {}\".format(\n+            config_filename, player_name\n+        )\n         if self._auto_managed:\n-            cmd = \"python -m tf_encrypted.player --config {} {}\".format(\n-                config_filename, player_name\n-            )\n-            self._server_process = subprocess.Popen(cmd.split(\" \"))\n+            self._server_process = subprocess.Popen(launch_cmd.split(\" \"))\n         else:\n             logger.info(\n                 \"If not done already, please launch the following \"\n-                \"command in a terminal on host '%s':\\n\"\n-                \"'python -m tf_encrypted.player --config %s %s'\\n\"\n+                \"command in a terminal on host %s: '%s'\\n\"\n                 \"This can be done automatically in a local subprocess by \"\n-                \"setting `auto_managed=True` when instantiating a TFEWorker.\",\n+                \"setting `auto_managed=True` when instantiating a TFEWorker.\\n\",\n                 self.host,\n-                config_filename,\n-                player_name,\n+                launch_cmd,\n             )\n \n     def stop(self):\n", "issue": "Syft Keras bug on Windows\nRelevant slack discussion: https://openmined.slack.com/archives/C6DEWA4FR/p1559899875021800\r\n\r\nBug:\r\n![image](https://user-images.githubusercontent.com/7891333/59118559-79fa9400-891e-11e9-990e-1bba1fe9ec93.png)\r\n\r\nIt looks like the problem here is that the `tfe.config` is being saved in a location that is not a valid filepath in Windows.  As a result, there is likely a file with the name `/tmp/tfe.config` being saved in some folder on the machine, as opposed to a file with the name `tfe.config` being saved in the root subdirectory called `tmp`.\r\n\r\nThe fix for this should use `os.path` to figure out which filepath the tfe.config should be saved to, and then the logging messages should print the OS-specific CLI command for launching each `TFEWorker` process.\n", "before_files": [{"content": "\"\"\"To be extended in the near future.\"\"\"\nfrom collections import OrderedDict\nimport logging\nimport subprocess\n\nimport tf_encrypted as tfe\n\n\nlogger = logging.getLogger(\"tf_encrypted\")\n\n\nclass TFEWorker:\n    # TODO(Morten) this should be turned into a proxy, with existing code\n    # extracted into a new component that's launched via a script\n\n    def __init__(self, host=None, auto_managed=True):\n        self.host = host\n        self._server_process = None\n        self._auto_managed = auto_managed\n\n    def start(self, player_name, *workers):\n        if self.host is None:\n            # we're running using a tfe.LocalConfig which doesn't require us to do anything\n            return\n\n        config_filename = \"/tmp/tfe.config\"\n\n        config, _ = self.config_from_workers(workers)\n        config.save(config_filename)\n\n        if self._auto_managed:\n            cmd = \"python -m tf_encrypted.player --config {} {}\".format(\n                config_filename, player_name\n            )\n            self._server_process = subprocess.Popen(cmd.split(\" \"))\n        else:\n            logger.info(\n                \"If not done already, please launch the following \"\n                \"command in a terminal on host '%s':\\n\"\n                \"'python -m tf_encrypted.player --config %s %s'\\n\"\n                \"This can be done automatically in a local subprocess by \"\n                \"setting `auto_managed=True` when instantiating a TFEWorker.\",\n                self.host,\n                config_filename,\n                player_name,\n            )\n\n    def stop(self):\n        if self.host is None:\n            # we're running using a tfe.LocalConfig which doesn't require us to do anything\n            return\n\n        if self._auto_managed:\n            if self._server_process is None:\n                return\n            self._server_process.kill()\n            self._server_process.communicate()\n            self._server_process = None\n        else:\n            logger.info(\"Please terminate the process on host '%s'.\", self.host)\n\n    def connect_to_model(self, input_shape, output_shape, *workers):\n        config, _ = self.config_from_workers(workers)\n        tfe.set_config(config)\n\n        prot = tfe.protocol.SecureNN(\n            config.get_player(\"server0\"), config.get_player(\"server1\"), config.get_player(\"server2\")\n        )\n        tfe.set_protocol(prot)\n\n        self._tf_client = tfe.serving.QueueClient(\n            input_shape=input_shape, output_shape=output_shape\n        )\n\n        sess = tfe.Session(config=config)\n        self._tf_session = sess\n\n    def query_model(self, data):\n        self.query_model_async(data)\n        return self.query_model_join()\n\n    def query_model_async(self, data):\n        self._tf_client.send_input(self._tf_session, data)\n\n    def query_model_join(self):\n        return self._tf_client.receive_output(self._tf_session)\n\n    @classmethod\n    def config_from_workers(cls, workers):\n        if len(workers) != 3:\n            raise ValueError(\"Expected three workers but {} were given\".format(len(workers)))\n\n        player_to_worker_mapping = OrderedDict()\n        player_to_worker_mapping[\"server0\"] = workers[0]\n        player_to_worker_mapping[\"server1\"] = workers[1]\n        player_to_worker_mapping[\"server2\"] = workers[2]\n\n        use_local_config = all(worker.host is None for worker in workers)\n        if use_local_config:\n            config = tfe.LocalConfig(\n                player_names=player_to_worker_mapping.keys(), auto_add_unknown_players=False\n            )\n            return config, player_to_worker_mapping\n\n        # use tfe.RemoteConfig\n        hostmap = OrderedDict(\n            [(player_name, worker.host) for player_name, worker in player_to_worker_mapping.items()]\n        )\n        config = tfe.RemoteConfig(hostmap)\n        return config, player_to_worker_mapping\n", "path": "syft/workers/tfe.py"}], "after_files": [{"content": "\"\"\"To be extended in the near future.\"\"\"\nfrom collections import OrderedDict\nimport logging\nimport os\nimport subprocess\nimport tempfile\n\nimport tf_encrypted as tfe\n\n\nlogger = logging.getLogger(\"tf_encrypted\")\n_TMP_DIR = tempfile.gettempdir()\n\n\nclass TFEWorker:\n    # TODO(Morten) this should be turned into a proxy, with existing code\n    # extracted into a new component that's launched via a script\n\n    def __init__(self, host=None, auto_managed=True):\n        self.host = host\n        self._server_process = None\n        self._auto_managed = auto_managed\n\n    def start(self, player_name, *workers):\n        if self.host is None:\n            # we're running using a tfe.LocalConfig which doesn't require us to do anything\n            return\n\n        config_filename = os.path.join(_TMP_DIR, \"tfe.config\")\n\n        config, _ = self.config_from_workers(workers)\n        config.save(config_filename)\n\n        launch_cmd = \"python -m tf_encrypted.player --config {} {}\".format(\n            config_filename, player_name\n        )\n        if self._auto_managed:\n            self._server_process = subprocess.Popen(launch_cmd.split(\" \"))\n        else:\n            logger.info(\n                \"If not done already, please launch the following \"\n                \"command in a terminal on host %s: '%s'\\n\"\n                \"This can be done automatically in a local subprocess by \"\n                \"setting `auto_managed=True` when instantiating a TFEWorker.\\n\",\n                self.host,\n                launch_cmd,\n            )\n\n    def stop(self):\n        if self.host is None:\n            # we're running using a tfe.LocalConfig which doesn't require us to do anything\n            return\n\n        if self._auto_managed:\n            if self._server_process is None:\n                return\n            self._server_process.kill()\n            self._server_process.communicate()\n            self._server_process = None\n        else:\n            logger.info(\"Please terminate the process on host '%s'.\", self.host)\n\n    def connect_to_model(self, input_shape, output_shape, *workers):\n        config, _ = self.config_from_workers(workers)\n        tfe.set_config(config)\n\n        prot = tfe.protocol.SecureNN(\n            config.get_player(\"server0\"), config.get_player(\"server1\"), config.get_player(\"server2\")\n        )\n        tfe.set_protocol(prot)\n\n        self._tf_client = tfe.serving.QueueClient(\n            input_shape=input_shape, output_shape=output_shape\n        )\n\n        sess = tfe.Session(config=config)\n        self._tf_session = sess\n\n    def query_model(self, data):\n        self.query_model_async(data)\n        return self.query_model_join()\n\n    def query_model_async(self, data):\n        self._tf_client.send_input(self._tf_session, data)\n\n    def query_model_join(self):\n        return self._tf_client.receive_output(self._tf_session)\n\n    @classmethod\n    def config_from_workers(cls, workers):\n        if len(workers) != 3:\n            raise ValueError(\"Expected three workers but {} were given\".format(len(workers)))\n\n        player_to_worker_mapping = OrderedDict()\n        player_to_worker_mapping[\"server0\"] = workers[0]\n        player_to_worker_mapping[\"server1\"] = workers[1]\n        player_to_worker_mapping[\"server2\"] = workers[2]\n\n        use_local_config = all(worker.host is None for worker in workers)\n        if use_local_config:\n            config = tfe.LocalConfig(\n                player_names=player_to_worker_mapping.keys(), auto_add_unknown_players=False\n            )\n            return config, player_to_worker_mapping\n\n        # use tfe.RemoteConfig\n        hostmap = OrderedDict(\n            [(player_name, worker.host) for player_name, worker in player_to_worker_mapping.items()]\n        )\n        config = tfe.RemoteConfig(hostmap)\n        return config, player_to_worker_mapping\n", "path": "syft/workers/tfe.py"}]}