We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Refactor logic in synth.py for excluding noxfile
As explained in a [comment](https://github.com/googleapis/python-bigquery/pull/1#discussion_r375560206), preventing the synthtool for overriding the customized `noxfile.py` can be achieved in a more straightforward way than currently used.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `synth.py`
Content:
```
1 # Copyright 2018 Google LLC
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 is used to synthesize generated parts of this library."""
16 
17 import os
18 
19 import synthtool as s
20 from synthtool import gcp
21 
22 gapic = gcp.GAPICGenerator()
23 common = gcp.CommonTemplates()
24 version = 'v2'
25 
26 library = gapic.py_library(
27     'bigquery',
28     version,
29     config_path='/google/cloud/bigquery/'
30                 'artman_bigquery_v2.yaml',
31     artman_output_name='bigquery-v2',
32     include_protos=True,
33 )
34 
35 s.move(
36     [
37         library / "google/cloud/bigquery_v2/gapic/enums.py",
38         library / "google/cloud/bigquery_v2/types.py",
39         library / "google/cloud/bigquery_v2/proto/location*",
40         library / "google/cloud/bigquery_v2/proto/encryption_config*",
41         library / "google/cloud/bigquery_v2/proto/model*",
42         library / "google/cloud/bigquery_v2/proto/standard_sql*",
43     ],
44 )
45 
46 # Fix up proto docs that are missing summary line.
47 s.replace(
48     "google/cloud/bigquery_v2/proto/model_pb2.py",
49     '"""Attributes:',
50     '"""Protocol buffer.\n\n  Attributes:',
51 )
52 s.replace(
53     "google/cloud/bigquery_v2/proto/encryption_config_pb2.py",
54     '"""Attributes:',
55     '"""Encryption configuration.\n\n  Attributes:',
56 )
57 
58 # Remove non-ascii characters from docstrings for Python 2.7.
59 # Format quoted strings as plain text.
60 s.replace("google/cloud/bigquery_v2/proto/*.py", "[“”]", '``')
61 
62 # ----------------------------------------------------------------------------
63 # Add templated files
64 # ----------------------------------------------------------------------------
65 templated_files = common.py_library(cov_level=100)
66 # we do not want to override the custom noxfile with the generated one
67 os.remove(os.path.join(templated_files, "noxfile.py"))
68 s.move(templated_files)
69 
70 s.shell.run(["nox", "-s", "blacken"], hide_output=False)
71
```
--- 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/synth.py b/synth.py
--- a/synth.py
+++ b/synth.py
@@ -14,8 +14,6 @@
 
 """This script is used to synthesize generated parts of this library."""
 
-import os
-
 import synthtool as s
 from synthtool import gcp
 
@@ -63,8 +61,6 @@
 # Add templated files
 # ----------------------------------------------------------------------------
 templated_files = common.py_library(cov_level=100)
-# we do not want to override the custom noxfile with the generated one
-os.remove(os.path.join(templated_files, "noxfile.py"))
-s.move(templated_files)
+s.move(templated_files, excludes=["noxfile.py"])
 
 s.shell.run(["nox", "-s", "blacken"], hide_output=False)

{"golden_diff": "diff --git a/synth.py b/synth.py\n--- a/synth.py\n+++ b/synth.py\n@@ -14,8 +14,6 @@\n \n \"\"\"This script is used to synthesize generated parts of this library.\"\"\"\n \n-import os\n-\n import synthtool as s\n from synthtool import gcp\n \n@@ -63,8 +61,6 @@\n # Add templated files\n # ----------------------------------------------------------------------------\n templated_files = common.py_library(cov_level=100)\n-# we do not want to override the custom noxfile with the generated one\n-os.remove(os.path.join(templated_files, \"noxfile.py\"))\n-s.move(templated_files)\n+s.move(templated_files, excludes=[\"noxfile.py\"])\n \n s.shell.run([\"nox\", \"-s\", \"blacken\"], hide_output=False)\n", "issue": "Refactor logic in synth.py for excluding noxfile\nAs explained in a [comment](https://github.com/googleapis/python-bigquery/pull/1#discussion_r375560206), preventing the synthtool for overriding the customized `noxfile.py` can be achieved in a more straightforward way than currently used.\r\n\n", "before_files": [{"content": "# Copyright 2018 Google LLC\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 is used to synthesize generated parts of this library.\"\"\"\n\nimport os\n\nimport synthtool as s\nfrom synthtool import gcp\n\ngapic = gcp.GAPICGenerator()\ncommon = gcp.CommonTemplates()\nversion = 'v2'\n\nlibrary = gapic.py_library(\n    'bigquery',\n    version,\n    config_path='/google/cloud/bigquery/'\n                'artman_bigquery_v2.yaml',\n    artman_output_name='bigquery-v2',\n    include_protos=True,\n)\n\ns.move(\n    [\n        library / \"google/cloud/bigquery_v2/gapic/enums.py\",\n        library / \"google/cloud/bigquery_v2/types.py\",\n        library / \"google/cloud/bigquery_v2/proto/location*\",\n        library / \"google/cloud/bigquery_v2/proto/encryption_config*\",\n        library / \"google/cloud/bigquery_v2/proto/model*\",\n        library / \"google/cloud/bigquery_v2/proto/standard_sql*\",\n    ],\n)\n\n# Fix up proto docs that are missing summary line.\ns.replace(\n    \"google/cloud/bigquery_v2/proto/model_pb2.py\",\n    '\"\"\"Attributes:',\n    '\"\"\"Protocol buffer.\\n\\n  Attributes:',\n)\ns.replace(\n    \"google/cloud/bigquery_v2/proto/encryption_config_pb2.py\",\n    '\"\"\"Attributes:',\n    '\"\"\"Encryption configuration.\\n\\n  Attributes:',\n)\n\n# Remove non-ascii characters from docstrings for Python 2.7.\n# Format quoted strings as plain text.\ns.replace(\"google/cloud/bigquery_v2/proto/*.py\", \"[\u201c\u201d]\", '``')\n\n# ----------------------------------------------------------------------------\n# Add templated files\n# ----------------------------------------------------------------------------\ntemplated_files = common.py_library(cov_level=100)\n# we do not want to override the custom noxfile with the generated one\nos.remove(os.path.join(templated_files, \"noxfile.py\"))\ns.move(templated_files)\n\ns.shell.run([\"nox\", \"-s\", \"blacken\"], hide_output=False)\n", "path": "synth.py"}], "after_files": [{"content": "# Copyright 2018 Google LLC\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 is used to synthesize generated parts of this library.\"\"\"\n\nimport synthtool as s\nfrom synthtool import gcp\n\ngapic = gcp.GAPICGenerator()\ncommon = gcp.CommonTemplates()\nversion = 'v2'\n\nlibrary = gapic.py_library(\n    'bigquery',\n    version,\n    config_path='/google/cloud/bigquery/'\n                'artman_bigquery_v2.yaml',\n    artman_output_name='bigquery-v2',\n    include_protos=True,\n)\n\ns.move(\n    [\n        library / \"google/cloud/bigquery_v2/gapic/enums.py\",\n        library / \"google/cloud/bigquery_v2/types.py\",\n        library / \"google/cloud/bigquery_v2/proto/location*\",\n        library / \"google/cloud/bigquery_v2/proto/encryption_config*\",\n        library / \"google/cloud/bigquery_v2/proto/model*\",\n        library / \"google/cloud/bigquery_v2/proto/standard_sql*\",\n    ],\n)\n\n# Fix up proto docs that are missing summary line.\ns.replace(\n    \"google/cloud/bigquery_v2/proto/model_pb2.py\",\n    '\"\"\"Attributes:',\n    '\"\"\"Protocol buffer.\\n\\n  Attributes:',\n)\ns.replace(\n    \"google/cloud/bigquery_v2/proto/encryption_config_pb2.py\",\n    '\"\"\"Attributes:',\n    '\"\"\"Encryption configuration.\\n\\n  Attributes:',\n)\n\n# Remove non-ascii characters from docstrings for Python 2.7.\n# Format quoted strings as plain text.\ns.replace(\"google/cloud/bigquery_v2/proto/*.py\", \"[\u201c\u201d]\", '``')\n\n# ----------------------------------------------------------------------------\n# Add templated files\n# ----------------------------------------------------------------------------\ntemplated_files = common.py_library(cov_level=100)\ns.move(templated_files, excludes=[\"noxfile.py\"])\n\ns.shell.run([\"nox\", \"-s\", \"blacken\"], hide_output=False)\n", "path": "synth.py"}]}