We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Remove gulp from setup entirely.
To continue consolidating our setup process to a python stack, gulp needs to be removed. Currently gulp only provides a watch functionality that starts build processes if some directories are changed. Our dependency on npm already includes access to npm-watch, which can be used to replace gulp.
Remove gulp from setup entirely.
To continue consolidating our setup process to a python stack, gulp needs to be removed. Currently gulp only provides a watch functionality that starts build processes if some directories are changed. Our dependency on npm already includes access to npm-watch, which can be used to replace gulp.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `scripts/start.py`
Content:
```
1 # Copyright 2019 The Oppia Authors. All Rights Reserved.
2 #
3 # Licensed under the Apache License, Version 2.0 (the 'License');
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #      http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an 'AS-IS' BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 
15 """This script starts up a development server running Oppia. It installs any
16 missing third-party dependencies and starts up a local GAE development
17 server.
18 """
19 
20 from __future__ import absolute_import  # pylint: disable=import-only-modules
21 from __future__ import unicode_literals  # pylint: disable=import-only-modules
22 
23 import argparse
24 import atexit
25 import fileinput
26 import os
27 import re
28 import subprocess
29 import time
30 
31 # Install third party libraries before importing other files.
32 from . import install_third_party_libs
33 install_third_party_libs.main()
34 
35 # pylint: disable=wrong-import-position
36 import python_utils  # isort:skip
37 
38 from . import build  # isort:skip
39 from . import common  # isort:skip
40 # pylint: enable=wrong-import-position
41 
42 _PARSER = argparse.ArgumentParser(description="""
43 Run the script from the oppia root folder:
44     python -m scripts.start
45 Note that the root folder MUST be named 'oppia'.
46 """)
47 
48 _PARSER.add_argument(
49     '--save_datastore',
50     help='optional; if specified, does not clear the datastore.',
51     action='store_true')
52 _PARSER.add_argument(
53     '--enable_console',
54     help='optional; if specified, enables console.',
55     action='store_true')
56 _PARSER.add_argument(
57     '--prod_env',
58     help='optional; if specified, runs Oppia in a production environment.',
59     action='store_true')
60 _PARSER.add_argument(
61     '--no_browser',
62     help='optional; if specified, does not open a browser.',
63     action='store_true')
64 _PARSER.add_argument(
65     '--no_auto_restart',
66     help=(
67         'optional; if specified, does not automatically restart when files are '
68         'changed.'),
69     action='store_true')
70 
71 PORT_NUMBER_FOR_GAE_SERVER = 8181
72 
73 
74 def cleanup():
75     """Function for waiting for the servers to go down."""
76     common.print_each_string_after_two_new_lines([
77         'INFORMATION',
78         'Cleaning up the servers.'])
79     while common.is_port_open(PORT_NUMBER_FOR_GAE_SERVER):
80         time.sleep(1)
81 
82 
83 def main(args=None):
84     """Starts up a development server running Oppia."""
85     parsed_args = _PARSER.parse_args(args=args)
86 
87     # Runs cleanup function on exit.
88     atexit.register(cleanup)
89 
90     # Check that there isn't a server already running.
91     if common.is_port_open(PORT_NUMBER_FOR_GAE_SERVER):
92         common.print_each_string_after_two_new_lines([
93             'WARNING',
94             'Could not start new server. There is already an existing server',
95             'running at port %s.'
96             % python_utils.UNICODE(PORT_NUMBER_FOR_GAE_SERVER)])
97 
98     clear_datastore_arg = (
99         '' if parsed_args.save_datastore else '--clear_datastore=true')
100     enable_console_arg = (
101         '--enable_console=true' if parsed_args.enable_console else '')
102     no_auto_restart = (
103         '--automatic_restart=no' if parsed_args.no_auto_restart else '')
104 
105     if parsed_args.prod_env:
106         constants_env_variable = '"DEV_MODE": false'
107         for line in fileinput.input(
108                 files=[os.path.join('assets', 'constants.ts')], inplace=True):
109             # Inside this loop the STDOUT will be redirected to the file,
110             # constants.ts. The end='' is needed to avoid double line breaks.
111             python_utils.PRINT(
112                 re.sub(
113                     r'"DEV_MODE": .*', constants_env_variable, line), end='')
114         build.main(args=['--prod_env'])
115         app_yaml_filepath = 'app.yaml'
116     else:
117         constants_env_variable = '"DEV_MODE": true'
118         for line in fileinput.input(
119                 files=[os.path.join('assets', 'constants.ts')], inplace=True):
120             # Inside this loop the STDOUT will be redirected to the file,
121             # constants.ts. The end='' is needed to avoid double line breaks.
122             python_utils.PRINT(
123                 re.sub(
124                     r'"DEV_MODE": .*', constants_env_variable, line), end='')
125         build.main(args=[])
126         app_yaml_filepath = 'app_dev.yaml'
127 
128     # Set up a local dev instance.
129     # TODO(sll): do this in a new shell.
130     # To turn emailing on, add the option '--enable_sendmail=yes' and change the
131     # relevant settings in feconf.py. Be careful with this -- you do not want to
132     # spam people accidentally.
133     background_processes = []
134     if not parsed_args.prod_env:
135         background_processes.append(subprocess.Popen([
136             common.NODE_BIN_PATH,
137             os.path.join(common.NODE_MODULES_PATH, 'gulp', 'bin', 'gulp.js'),
138             'watch']))
139 
140         # In prod mode webpack is launched through scripts/build.py
141         python_utils.PRINT('Compiling webpack...')
142         background_processes.append(subprocess.Popen([
143             common.NODE_BIN_PATH,
144             os.path.join(
145                 common.NODE_MODULES_PATH, 'webpack', 'bin', 'webpack.js'),
146             '--config', 'webpack.dev.config.ts', '--watch']))
147         # Give webpack few seconds to do the initial compilation.
148         time.sleep(10)
149 
150     python_utils.PRINT('Starting GAE development server')
151     background_processes.append(subprocess.Popen(
152         'python %s/dev_appserver.py %s %s %s --admin_host 0.0.0.0 --admin_port '
153         '8000 --host 0.0.0.0 --port %s --skip_sdk_update_check true %s' % (
154             common.GOOGLE_APP_ENGINE_HOME, clear_datastore_arg,
155             enable_console_arg, no_auto_restart,
156             python_utils.UNICODE(PORT_NUMBER_FOR_GAE_SERVER),
157             app_yaml_filepath), shell=True))
158 
159     # Wait for the servers to come up.
160     while not common.is_port_open(PORT_NUMBER_FOR_GAE_SERVER):
161         time.sleep(1)
162 
163     # Launch a browser window.
164     if common.is_linux_os() and not parsed_args.no_browser:
165         detect_virtualbox_pattern = re.compile('.*VBOX.*')
166         if list(filter(
167                 detect_virtualbox_pattern.match,
168                 os.listdir('/dev/disk/by-id/'))):
169             common.print_each_string_after_two_new_lines([
170                 'INFORMATION',
171                 'Setting up a local development server. You can access this '
172                 'server',
173                 'by navigating to localhost:%s in a browser window.'
174                 % python_utils.UNICODE(PORT_NUMBER_FOR_GAE_SERVER)])
175         else:
176             common.print_each_string_after_two_new_lines([
177                 'INFORMATION',
178                 'Setting up a local development server at localhost:%s. '
179                 % python_utils.UNICODE(PORT_NUMBER_FOR_GAE_SERVER),
180                 'Opening a default browser window pointing to this server'])
181             time.sleep(5)
182             background_processes.append(
183                 subprocess.Popen([
184                     'xdg-open', 'http://localhost:%s/'
185                     % python_utils.UNICODE(PORT_NUMBER_FOR_GAE_SERVER)]))
186     elif common.is_mac_os() and not parsed_args.no_browser:
187         common.print_each_string_after_two_new_lines([
188             'INFORMATION',
189             'Setting up a local development server at localhost:%s. '
190             % python_utils.UNICODE(PORT_NUMBER_FOR_GAE_SERVER),
191             'Opening a default browser window pointing to this server.'])
192         time.sleep(5)
193         background_processes.append(
194             subprocess.Popen([
195                 'open', 'http://localhost:%s/'
196                 % python_utils.UNICODE(PORT_NUMBER_FOR_GAE_SERVER)]))
197     else:
198         common.print_each_string_after_two_new_lines([
199             'INFORMATION',
200             'Setting up a local development server. You can access this server',
201             'by navigating to localhost:%s in a browser window.'
202             % python_utils.UNICODE(PORT_NUMBER_FOR_GAE_SERVER)])
203 
204     python_utils.PRINT('Done!')
205 
206     for process in background_processes:
207         process.wait()
208 
209 
210 if __name__ == '__main__':
211     main()
212
```
--- 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/scripts/start.py b/scripts/start.py
--- a/scripts/start.py
+++ b/scripts/start.py
@@ -132,11 +132,6 @@
     # spam people accidentally.
     background_processes = []
     if not parsed_args.prod_env:
-        background_processes.append(subprocess.Popen([
-            common.NODE_BIN_PATH,
-            os.path.join(common.NODE_MODULES_PATH, 'gulp', 'bin', 'gulp.js'),
-            'watch']))
-
         # In prod mode webpack is launched through scripts/build.py
         python_utils.PRINT('Compiling webpack...')
         background_processes.append(subprocess.Popen([

{"golden_diff": "diff --git a/scripts/start.py b/scripts/start.py\n--- a/scripts/start.py\n+++ b/scripts/start.py\n@@ -132,11 +132,6 @@\n     # spam people accidentally.\n     background_processes = []\n     if not parsed_args.prod_env:\n-        background_processes.append(subprocess.Popen([\n-            common.NODE_BIN_PATH,\n-            os.path.join(common.NODE_MODULES_PATH, 'gulp', 'bin', 'gulp.js'),\n-            'watch']))\n-\n         # In prod mode webpack is launched through scripts/build.py\n         python_utils.PRINT('Compiling webpack...')\n         background_processes.append(subprocess.Popen([\n", "issue": "Remove gulp from setup entirely.\nTo continue consolidating our setup process to a python stack, gulp needs to be removed. Currently gulp only provides a watch functionality that starts build processes if some directories are changed. Our dependency on npm already includes access to npm-watch, which can be used to replace gulp.\nRemove gulp from setup entirely.\nTo continue consolidating our setup process to a python stack, gulp needs to be removed. Currently gulp only provides a watch functionality that starts build processes if some directories are changed. Our dependency on npm already includes access to npm-watch, which can be used to replace gulp.\n", "before_files": [{"content": "# Copyright 2019 The Oppia Authors. All Rights Reserved.\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\n\"\"\"This script starts up a development server running Oppia. It installs any\nmissing third-party dependencies and starts up a local GAE development\nserver.\n\"\"\"\n\nfrom __future__ import absolute_import  # pylint: disable=import-only-modules\nfrom __future__ import unicode_literals  # pylint: disable=import-only-modules\n\nimport argparse\nimport atexit\nimport fileinput\nimport os\nimport re\nimport subprocess\nimport time\n\n# Install third party libraries before importing other files.\nfrom . import install_third_party_libs\ninstall_third_party_libs.main()\n\n# pylint: disable=wrong-import-position\nimport python_utils  # isort:skip\n\nfrom . import build  # isort:skip\nfrom . import common  # isort:skip\n# pylint: enable=wrong-import-position\n\n_PARSER = argparse.ArgumentParser(description=\"\"\"\nRun the script from the oppia root folder:\n    python -m scripts.start\nNote that the root folder MUST be named 'oppia'.\n\"\"\")\n\n_PARSER.add_argument(\n    '--save_datastore',\n    help='optional; if specified, does not clear the datastore.',\n    action='store_true')\n_PARSER.add_argument(\n    '--enable_console',\n    help='optional; if specified, enables console.',\n    action='store_true')\n_PARSER.add_argument(\n    '--prod_env',\n    help='optional; if specified, runs Oppia in a production environment.',\n    action='store_true')\n_PARSER.add_argument(\n    '--no_browser',\n    help='optional; if specified, does not open a browser.',\n    action='store_true')\n_PARSER.add_argument(\n    '--no_auto_restart',\n    help=(\n        'optional; if specified, does not automatically restart when files are '\n        'changed.'),\n    action='store_true')\n\nPORT_NUMBER_FOR_GAE_SERVER = 8181\n\n\ndef cleanup():\n    \"\"\"Function for waiting for the servers to go down.\"\"\"\n    common.print_each_string_after_two_new_lines([\n        'INFORMATION',\n        'Cleaning up the servers.'])\n    while common.is_port_open(PORT_NUMBER_FOR_GAE_SERVER):\n        time.sleep(1)\n\n\ndef main(args=None):\n    \"\"\"Starts up a development server running Oppia.\"\"\"\n    parsed_args = _PARSER.parse_args(args=args)\n\n    # Runs cleanup function on exit.\n    atexit.register(cleanup)\n\n    # Check that there isn't a server already running.\n    if common.is_port_open(PORT_NUMBER_FOR_GAE_SERVER):\n        common.print_each_string_after_two_new_lines([\n            'WARNING',\n            'Could not start new server. There is already an existing server',\n            'running at port %s.'\n            % python_utils.UNICODE(PORT_NUMBER_FOR_GAE_SERVER)])\n\n    clear_datastore_arg = (\n        '' if parsed_args.save_datastore else '--clear_datastore=true')\n    enable_console_arg = (\n        '--enable_console=true' if parsed_args.enable_console else '')\n    no_auto_restart = (\n        '--automatic_restart=no' if parsed_args.no_auto_restart else '')\n\n    if parsed_args.prod_env:\n        constants_env_variable = '\"DEV_MODE\": false'\n        for line in fileinput.input(\n                files=[os.path.join('assets', 'constants.ts')], inplace=True):\n            # Inside this loop the STDOUT will be redirected to the file,\n            # constants.ts. The end='' is needed to avoid double line breaks.\n            python_utils.PRINT(\n                re.sub(\n                    r'\"DEV_MODE\": .*', constants_env_variable, line), end='')\n        build.main(args=['--prod_env'])\n        app_yaml_filepath = 'app.yaml'\n    else:\n        constants_env_variable = '\"DEV_MODE\": true'\n        for line in fileinput.input(\n                files=[os.path.join('assets', 'constants.ts')], inplace=True):\n            # Inside this loop the STDOUT will be redirected to the file,\n            # constants.ts. The end='' is needed to avoid double line breaks.\n            python_utils.PRINT(\n                re.sub(\n                    r'\"DEV_MODE\": .*', constants_env_variable, line), end='')\n        build.main(args=[])\n        app_yaml_filepath = 'app_dev.yaml'\n\n    # Set up a local dev instance.\n    # TODO(sll): do this in a new shell.\n    # To turn emailing on, add the option '--enable_sendmail=yes' and change the\n    # relevant settings in feconf.py. Be careful with this -- you do not want to\n    # spam people accidentally.\n    background_processes = []\n    if not parsed_args.prod_env:\n        background_processes.append(subprocess.Popen([\n            common.NODE_BIN_PATH,\n            os.path.join(common.NODE_MODULES_PATH, 'gulp', 'bin', 'gulp.js'),\n            'watch']))\n\n        # In prod mode webpack is launched through scripts/build.py\n        python_utils.PRINT('Compiling webpack...')\n        background_processes.append(subprocess.Popen([\n            common.NODE_BIN_PATH,\n            os.path.join(\n                common.NODE_MODULES_PATH, 'webpack', 'bin', 'webpack.js'),\n            '--config', 'webpack.dev.config.ts', '--watch']))\n        # Give webpack few seconds to do the initial compilation.\n        time.sleep(10)\n\n    python_utils.PRINT('Starting GAE development server')\n    background_processes.append(subprocess.Popen(\n        'python %s/dev_appserver.py %s %s %s --admin_host 0.0.0.0 --admin_port '\n        '8000 --host 0.0.0.0 --port %s --skip_sdk_update_check true %s' % (\n            common.GOOGLE_APP_ENGINE_HOME, clear_datastore_arg,\n            enable_console_arg, no_auto_restart,\n            python_utils.UNICODE(PORT_NUMBER_FOR_GAE_SERVER),\n            app_yaml_filepath), shell=True))\n\n    # Wait for the servers to come up.\n    while not common.is_port_open(PORT_NUMBER_FOR_GAE_SERVER):\n        time.sleep(1)\n\n    # Launch a browser window.\n    if common.is_linux_os() and not parsed_args.no_browser:\n        detect_virtualbox_pattern = re.compile('.*VBOX.*')\n        if list(filter(\n                detect_virtualbox_pattern.match,\n                os.listdir('/dev/disk/by-id/'))):\n            common.print_each_string_after_two_new_lines([\n                'INFORMATION',\n                'Setting up a local development server. You can access this '\n                'server',\n                'by navigating to localhost:%s in a browser window.'\n                % python_utils.UNICODE(PORT_NUMBER_FOR_GAE_SERVER)])\n        else:\n            common.print_each_string_after_two_new_lines([\n                'INFORMATION',\n                'Setting up a local development server at localhost:%s. '\n                % python_utils.UNICODE(PORT_NUMBER_FOR_GAE_SERVER),\n                'Opening a default browser window pointing to this server'])\n            time.sleep(5)\n            background_processes.append(\n                subprocess.Popen([\n                    'xdg-open', 'http://localhost:%s/'\n                    % python_utils.UNICODE(PORT_NUMBER_FOR_GAE_SERVER)]))\n    elif common.is_mac_os() and not parsed_args.no_browser:\n        common.print_each_string_after_two_new_lines([\n            'INFORMATION',\n            'Setting up a local development server at localhost:%s. '\n            % python_utils.UNICODE(PORT_NUMBER_FOR_GAE_SERVER),\n            'Opening a default browser window pointing to this server.'])\n        time.sleep(5)\n        background_processes.append(\n            subprocess.Popen([\n                'open', 'http://localhost:%s/'\n                % python_utils.UNICODE(PORT_NUMBER_FOR_GAE_SERVER)]))\n    else:\n        common.print_each_string_after_two_new_lines([\n            'INFORMATION',\n            'Setting up a local development server. You can access this server',\n            'by navigating to localhost:%s in a browser window.'\n            % python_utils.UNICODE(PORT_NUMBER_FOR_GAE_SERVER)])\n\n    python_utils.PRINT('Done!')\n\n    for process in background_processes:\n        process.wait()\n\n\nif __name__ == '__main__':\n    main()\n", "path": "scripts/start.py"}], "after_files": [{"content": "# Copyright 2019 The Oppia Authors. All Rights Reserved.\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\n\"\"\"This script starts up a development server running Oppia. It installs any\nmissing third-party dependencies and starts up a local GAE development\nserver.\n\"\"\"\n\nfrom __future__ import absolute_import  # pylint: disable=import-only-modules\nfrom __future__ import unicode_literals  # pylint: disable=import-only-modules\n\nimport argparse\nimport atexit\nimport fileinput\nimport os\nimport re\nimport subprocess\nimport time\n\n# Install third party libraries before importing other files.\nfrom . import install_third_party_libs\ninstall_third_party_libs.main()\n\n# pylint: disable=wrong-import-position\nimport python_utils  # isort:skip\n\nfrom . import build  # isort:skip\nfrom . import common  # isort:skip\n# pylint: enable=wrong-import-position\n\n_PARSER = argparse.ArgumentParser(description=\"\"\"\nRun the script from the oppia root folder:\n    python -m scripts.start\nNote that the root folder MUST be named 'oppia'.\n\"\"\")\n\n_PARSER.add_argument(\n    '--save_datastore',\n    help='optional; if specified, does not clear the datastore.',\n    action='store_true')\n_PARSER.add_argument(\n    '--enable_console',\n    help='optional; if specified, enables console.',\n    action='store_true')\n_PARSER.add_argument(\n    '--prod_env',\n    help='optional; if specified, runs Oppia in a production environment.',\n    action='store_true')\n_PARSER.add_argument(\n    '--no_browser',\n    help='optional; if specified, does not open a browser.',\n    action='store_true')\n_PARSER.add_argument(\n    '--no_auto_restart',\n    help=(\n        'optional; if specified, does not automatically restart when files are '\n        'changed.'),\n    action='store_true')\n\nPORT_NUMBER_FOR_GAE_SERVER = 8181\n\n\ndef cleanup():\n    \"\"\"Function for waiting for the servers to go down.\"\"\"\n    common.print_each_string_after_two_new_lines([\n        'INFORMATION',\n        'Cleaning up the servers.'])\n    while common.is_port_open(PORT_NUMBER_FOR_GAE_SERVER):\n        time.sleep(1)\n\n\ndef main(args=None):\n    \"\"\"Starts up a development server running Oppia.\"\"\"\n    parsed_args = _PARSER.parse_args(args=args)\n\n    # Runs cleanup function on exit.\n    atexit.register(cleanup)\n\n    # Check that there isn't a server already running.\n    if common.is_port_open(PORT_NUMBER_FOR_GAE_SERVER):\n        common.print_each_string_after_two_new_lines([\n            'WARNING',\n            'Could not start new server. There is already an existing server',\n            'running at port %s.'\n            % python_utils.UNICODE(PORT_NUMBER_FOR_GAE_SERVER)])\n\n    clear_datastore_arg = (\n        '' if parsed_args.save_datastore else '--clear_datastore=true')\n    enable_console_arg = (\n        '--enable_console=true' if parsed_args.enable_console else '')\n    no_auto_restart = (\n        '--automatic_restart=no' if parsed_args.no_auto_restart else '')\n\n    if parsed_args.prod_env:\n        constants_env_variable = '\"DEV_MODE\": false'\n        for line in fileinput.input(\n                files=[os.path.join('assets', 'constants.ts')], inplace=True):\n            # Inside this loop the STDOUT will be redirected to the file,\n            # constants.ts. The end='' is needed to avoid double line breaks.\n            python_utils.PRINT(\n                re.sub(\n                    r'\"DEV_MODE\": .*', constants_env_variable, line), end='')\n        build.main(args=['--prod_env'])\n        app_yaml_filepath = 'app.yaml'\n    else:\n        constants_env_variable = '\"DEV_MODE\": true'\n        for line in fileinput.input(\n                files=[os.path.join('assets', 'constants.ts')], inplace=True):\n            # Inside this loop the STDOUT will be redirected to the file,\n            # constants.ts. The end='' is needed to avoid double line breaks.\n            python_utils.PRINT(\n                re.sub(\n                    r'\"DEV_MODE\": .*', constants_env_variable, line), end='')\n        build.main(args=[])\n        app_yaml_filepath = 'app_dev.yaml'\n\n    # Set up a local dev instance.\n    # TODO(sll): do this in a new shell.\n    # To turn emailing on, add the option '--enable_sendmail=yes' and change the\n    # relevant settings in feconf.py. Be careful with this -- you do not want to\n    # spam people accidentally.\n    background_processes = []\n    if not parsed_args.prod_env:\n        # In prod mode webpack is launched through scripts/build.py\n        python_utils.PRINT('Compiling webpack...')\n        background_processes.append(subprocess.Popen([\n            common.NODE_BIN_PATH,\n            os.path.join(\n                common.NODE_MODULES_PATH, 'webpack', 'bin', 'webpack.js'),\n            '--config', 'webpack.dev.config.ts', '--watch']))\n        # Give webpack few seconds to do the initial compilation.\n        time.sleep(10)\n\n    python_utils.PRINT('Starting GAE development server')\n    background_processes.append(subprocess.Popen(\n        'python %s/dev_appserver.py %s %s %s --admin_host 0.0.0.0 --admin_port '\n        '8000 --host 0.0.0.0 --port %s --skip_sdk_update_check true %s' % (\n            common.GOOGLE_APP_ENGINE_HOME, clear_datastore_arg,\n            enable_console_arg, no_auto_restart,\n            python_utils.UNICODE(PORT_NUMBER_FOR_GAE_SERVER),\n            app_yaml_filepath), shell=True))\n\n    # Wait for the servers to come up.\n    while not common.is_port_open(PORT_NUMBER_FOR_GAE_SERVER):\n        time.sleep(1)\n\n    # Launch a browser window.\n    if common.is_linux_os() and not parsed_args.no_browser:\n        detect_virtualbox_pattern = re.compile('.*VBOX.*')\n        if list(filter(\n                detect_virtualbox_pattern.match,\n                os.listdir('/dev/disk/by-id/'))):\n            common.print_each_string_after_two_new_lines([\n                'INFORMATION',\n                'Setting up a local development server. You can access this '\n                'server',\n                'by navigating to localhost:%s in a browser window.'\n                % python_utils.UNICODE(PORT_NUMBER_FOR_GAE_SERVER)])\n        else:\n            common.print_each_string_after_two_new_lines([\n                'INFORMATION',\n                'Setting up a local development server at localhost:%s. '\n                % python_utils.UNICODE(PORT_NUMBER_FOR_GAE_SERVER),\n                'Opening a default browser window pointing to this server'])\n            time.sleep(5)\n            background_processes.append(\n                subprocess.Popen([\n                    'xdg-open', 'http://localhost:%s/'\n                    % python_utils.UNICODE(PORT_NUMBER_FOR_GAE_SERVER)]))\n    elif common.is_mac_os() and not parsed_args.no_browser:\n        common.print_each_string_after_two_new_lines([\n            'INFORMATION',\n            'Setting up a local development server at localhost:%s. '\n            % python_utils.UNICODE(PORT_NUMBER_FOR_GAE_SERVER),\n            'Opening a default browser window pointing to this server.'])\n        time.sleep(5)\n        background_processes.append(\n            subprocess.Popen([\n                'open', 'http://localhost:%s/'\n                % python_utils.UNICODE(PORT_NUMBER_FOR_GAE_SERVER)]))\n    else:\n        common.print_each_string_after_two_new_lines([\n            'INFORMATION',\n            'Setting up a local development server. You can access this server',\n            'by navigating to localhost:%s in a browser window.'\n            % python_utils.UNICODE(PORT_NUMBER_FOR_GAE_SERVER)])\n\n    python_utils.PRINT('Done!')\n\n    for process in background_processes:\n        process.wait()\n\n\nif __name__ == '__main__':\n    main()\n", "path": "scripts/start.py"}]}