We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Current `tox` configuration ends up testing old code
For example:

``` bash
$ rm -r .tox/
$ tox -e system-tests --notest
GLOB sdist-make: /home/tseaver/projects/agendaless/Google/src/google-cloud-python/setup.py
system-tests create: /home/tseaver/projects/agendaless/Google/src/google-cloud-python/.tox/system-tests
system-tests inst: /home/tseaver/projects/agendaless/Google/src/google-cloud-python/.tox/dist/google-cloud-0.20.0.zip
system-tests installed: -f file:///home/tseaver/.pip/wheels,enum34==1.1.6,future==0.15.2,futures==3.0.5,gapic-google-logging-v2==0.10.1,gapic-google-pubsub-v1==0.10.1,google-cloud==0.20.0,google-cloud-bigquery==0.20.0,google-cloud-bigtable==0.20.0,google-cloud-core==0.20.0,google-cloud-datastore==0.20.0,google-cloud-dns==0.20.0,google-cloud-error-reporting==0.20.0,google-cloud-happybase==0.20.0,google-cloud-language==0.20.0,google-cloud-logging==0.20.0,google-cloud-monitoring==0.20.0,google-cloud-pubsub==0.20.0,google-cloud-resource-manager==0.20.0,google-cloud-storage==0.20.0,google-cloud-translate==0.20.0,google-cloud-vision==0.20.0,google-gax==0.14.1,googleapis-common-protos==1.3.5,grpc-google-iam-v1==0.10.1,grpc-google-logging-v2==0.10.1,grpc-google-pubsub-v1==0.10.1,grpcio==1.0.0,httplib2==0.9.2,oauth2client==3.0.0,ply==3.8,protobuf==3.1.0.post1,pyasn1==0.1.9,pyasn1-modules==0.0.8,rsa==3.4.2,six==1.10.0
___________________________________ summary ____________________________________
  system-tests: skipped tests
  congratulations :)
$ diff -ru .tox/system-tests/lib/python2.7/site-packages/google/cloud/storage/ storage/google/cloud/storage/ --exclude="*.pyc"
diff -ru '--exclude=*.pyc' .tox/system-tests/lib/python2.7/site-packages/google/cloud/storage/blob.py storage/google/cloud/storage/blob.py
--- .tox/system-tests/lib/python2.7/site-packages/google/cloud/storage/blob.py  2016-10-05 18:15:48.724796000 -0400
+++ storage/google/cloud/storage/blob.py    2016-10-05 18:02:55.872830411 -0400
@@ -655,6 +655,32 @@
         self.acl.all().grant_read()
         self.acl.save(client=client)

+    def compose(self, sources, client=None):
+        """Concatenate source blobs into this one.
+
+        :type sources: list of :class:`Blob`
+        :param sources: blobs whose contents will be composed into this blob.
+
+        :type client: :class:`~google.cloud.storage.client.Client` or
+                      ``NoneType``
+        :param client: Optional. The client to use.  If not passed, falls back
+                       to the ``client`` stored on the blob's bucket.
+
+        :raises: :exc:`ValueError` if this blob does not have its
+                 :attr:`content_type` set.
+        """
+        if self.content_type is None:
+            raise ValueError("Destination 'content_type' not set.")
+        client = self._require_client(client)
+        request = {
+            'sourceObjects': [{'name': source.name} for source in sources],
+            'destination': self._properties.copy(),
+        }
+        api_response = client.connection.api_request(
+            method='POST', path=self.path + '/compose', data=request,
+            _target_object=self)
+        self._set_properties(api_response)
+
     cache_control = _scalar_property('cacheControl')
     """HTTP 'Cache-Control' header for this object.
```

Somehow, the tarball / wheel is being cached.


--- 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/pycodestyle_on_repo.py`
Content:
```
1 # Copyright 2016 Google Inc.
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 """Custom script to run pycodestyle on google-cloud codebase.
16 
17 This runs pycodestyle as a script via subprocess but only runs it on the
18 .py files that are checked in to the repository.
19 """
20 
21 
22 import os
23 import subprocess
24 import sys
25 
26 from script_utils import get_affected_files
27 
28 
29 def main():
30     """Run pycodestyle on all Python files in the repository."""
31     git_root = subprocess.check_output(
32         ['git', 'rev-parse', '--show-toplevel']).strip()
33     os.chdir(git_root)
34     candidates, _ = get_affected_files()
35     python_files = [
36         candidate for candidate in candidates if candidate.endswith('.py')]
37 
38     pycodestyle_command = ['pycodestyle'] + python_files
39     status_code = subprocess.call(pycodestyle_command)
40     sys.exit(status_code)
41 
42 
43 if __name__ == '__main__':
44     main()
45
```
--- 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/pycodestyle_on_repo.py b/scripts/pycodestyle_on_repo.py
--- a/scripts/pycodestyle_on_repo.py
+++ b/scripts/pycodestyle_on_repo.py
@@ -19,6 +19,8 @@
 """
 
 
+from __future__ import print_function
+
 import os
 import subprocess
 import sys
@@ -35,9 +37,12 @@
     python_files = [
         candidate for candidate in candidates if candidate.endswith('.py')]
 
-    pycodestyle_command = ['pycodestyle'] + python_files
-    status_code = subprocess.call(pycodestyle_command)
-    sys.exit(status_code)
+    if not python_files:
+        print('No Python files to lint, exiting.')
+    else:
+        pycodestyle_command = ['pycodestyle'] + python_files
+        status_code = subprocess.call(pycodestyle_command)
+        sys.exit(status_code)
 
 
 if __name__ == '__main__':

{"golden_diff": "diff --git a/scripts/pycodestyle_on_repo.py b/scripts/pycodestyle_on_repo.py\n--- a/scripts/pycodestyle_on_repo.py\n+++ b/scripts/pycodestyle_on_repo.py\n@@ -19,6 +19,8 @@\n \"\"\"\n \n \n+from __future__ import print_function\n+\n import os\n import subprocess\n import sys\n@@ -35,9 +37,12 @@\n     python_files = [\n         candidate for candidate in candidates if candidate.endswith('.py')]\n \n-    pycodestyle_command = ['pycodestyle'] + python_files\n-    status_code = subprocess.call(pycodestyle_command)\n-    sys.exit(status_code)\n+    if not python_files:\n+        print('No Python files to lint, exiting.')\n+    else:\n+        pycodestyle_command = ['pycodestyle'] + python_files\n+        status_code = subprocess.call(pycodestyle_command)\n+        sys.exit(status_code)\n \n \n if __name__ == '__main__':\n", "issue": "Current `tox` configuration ends up testing old code\nFor example:\n\n``` bash\n$ rm -r .tox/\n$ tox -e system-tests --notest\nGLOB sdist-make: /home/tseaver/projects/agendaless/Google/src/google-cloud-python/setup.py\nsystem-tests create: /home/tseaver/projects/agendaless/Google/src/google-cloud-python/.tox/system-tests\nsystem-tests inst: /home/tseaver/projects/agendaless/Google/src/google-cloud-python/.tox/dist/google-cloud-0.20.0.zip\nsystem-tests installed: -f file:///home/tseaver/.pip/wheels,enum34==1.1.6,future==0.15.2,futures==3.0.5,gapic-google-logging-v2==0.10.1,gapic-google-pubsub-v1==0.10.1,google-cloud==0.20.0,google-cloud-bigquery==0.20.0,google-cloud-bigtable==0.20.0,google-cloud-core==0.20.0,google-cloud-datastore==0.20.0,google-cloud-dns==0.20.0,google-cloud-error-reporting==0.20.0,google-cloud-happybase==0.20.0,google-cloud-language==0.20.0,google-cloud-logging==0.20.0,google-cloud-monitoring==0.20.0,google-cloud-pubsub==0.20.0,google-cloud-resource-manager==0.20.0,google-cloud-storage==0.20.0,google-cloud-translate==0.20.0,google-cloud-vision==0.20.0,google-gax==0.14.1,googleapis-common-protos==1.3.5,grpc-google-iam-v1==0.10.1,grpc-google-logging-v2==0.10.1,grpc-google-pubsub-v1==0.10.1,grpcio==1.0.0,httplib2==0.9.2,oauth2client==3.0.0,ply==3.8,protobuf==3.1.0.post1,pyasn1==0.1.9,pyasn1-modules==0.0.8,rsa==3.4.2,six==1.10.0\n___________________________________ summary ____________________________________\n  system-tests: skipped tests\n  congratulations :)\n$ diff -ru .tox/system-tests/lib/python2.7/site-packages/google/cloud/storage/ storage/google/cloud/storage/ --exclude=\"*.pyc\"\ndiff -ru '--exclude=*.pyc' .tox/system-tests/lib/python2.7/site-packages/google/cloud/storage/blob.py storage/google/cloud/storage/blob.py\n--- .tox/system-tests/lib/python2.7/site-packages/google/cloud/storage/blob.py  2016-10-05 18:15:48.724796000 -0400\n+++ storage/google/cloud/storage/blob.py    2016-10-05 18:02:55.872830411 -0400\n@@ -655,6 +655,32 @@\n         self.acl.all().grant_read()\n         self.acl.save(client=client)\n\n+    def compose(self, sources, client=None):\n+        \"\"\"Concatenate source blobs into this one.\n+\n+        :type sources: list of :class:`Blob`\n+        :param sources: blobs whose contents will be composed into this blob.\n+\n+        :type client: :class:`~google.cloud.storage.client.Client` or\n+                      ``NoneType``\n+        :param client: Optional. The client to use.  If not passed, falls back\n+                       to the ``client`` stored on the blob's bucket.\n+\n+        :raises: :exc:`ValueError` if this blob does not have its\n+                 :attr:`content_type` set.\n+        \"\"\"\n+        if self.content_type is None:\n+            raise ValueError(\"Destination 'content_type' not set.\")\n+        client = self._require_client(client)\n+        request = {\n+            'sourceObjects': [{'name': source.name} for source in sources],\n+            'destination': self._properties.copy(),\n+        }\n+        api_response = client.connection.api_request(\n+            method='POST', path=self.path + '/compose', data=request,\n+            _target_object=self)\n+        self._set_properties(api_response)\n+\n     cache_control = _scalar_property('cacheControl')\n     \"\"\"HTTP 'Cache-Control' header for this object.\n```\n\nSomehow, the tarball / wheel is being cached.\n\n", "before_files": [{"content": "# Copyright 2016 Google Inc.\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\"\"\"Custom script to run pycodestyle on google-cloud codebase.\n\nThis runs pycodestyle as a script via subprocess but only runs it on the\n.py files that are checked in to the repository.\n\"\"\"\n\n\nimport os\nimport subprocess\nimport sys\n\nfrom script_utils import get_affected_files\n\n\ndef main():\n    \"\"\"Run pycodestyle on all Python files in the repository.\"\"\"\n    git_root = subprocess.check_output(\n        ['git', 'rev-parse', '--show-toplevel']).strip()\n    os.chdir(git_root)\n    candidates, _ = get_affected_files()\n    python_files = [\n        candidate for candidate in candidates if candidate.endswith('.py')]\n\n    pycodestyle_command = ['pycodestyle'] + python_files\n    status_code = subprocess.call(pycodestyle_command)\n    sys.exit(status_code)\n\n\nif __name__ == '__main__':\n    main()\n", "path": "scripts/pycodestyle_on_repo.py"}], "after_files": [{"content": "# Copyright 2016 Google Inc.\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\"\"\"Custom script to run pycodestyle on google-cloud codebase.\n\nThis runs pycodestyle as a script via subprocess but only runs it on the\n.py files that are checked in to the repository.\n\"\"\"\n\n\nfrom __future__ import print_function\n\nimport os\nimport subprocess\nimport sys\n\nfrom script_utils import get_affected_files\n\n\ndef main():\n    \"\"\"Run pycodestyle on all Python files in the repository.\"\"\"\n    git_root = subprocess.check_output(\n        ['git', 'rev-parse', '--show-toplevel']).strip()\n    os.chdir(git_root)\n    candidates, _ = get_affected_files()\n    python_files = [\n        candidate for candidate in candidates if candidate.endswith('.py')]\n\n    if not python_files:\n        print('No Python files to lint, exiting.')\n    else:\n        pycodestyle_command = ['pycodestyle'] + python_files\n        status_code = subprocess.call(pycodestyle_command)\n        sys.exit(status_code)\n\n\nif __name__ == '__main__':\n    main()\n", "path": "scripts/pycodestyle_on_repo.py"}]}