We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
test: s3: use moto to test multipart objects
Currently, we are unable to use it because of [this bug](https://github.com/spulec/moto/issues/2154). When it is fixed, we should switch to it from using actual s3 for unit testing. Related to https://github.com/iterative/dvc/pull/1867


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `setup.py`
Content:
```
1 from setuptools import setup, find_packages
2 from setuptools.command.build_py import build_py as _build_py
3 import os
4 import sys
5 
6 
7 # https://packaging.python.org/guides/single-sourcing-package-version/
8 pkg_dir = os.path.dirname(__file__)
9 
10 # This will define __version__ implicitly
11 with open(os.path.join(pkg_dir, "dvc", "version.py")) as fobj:
12     exec(fobj.read())
13 
14 version = __version__  # noqa: F821
15 
16 
17 # To achieve consistency between the build version and the one provided
18 # by your package during runtime, you need to **pin** the build version.
19 #
20 # This custom class will replace the version.py module with a **static**
21 # `__version__` that your package can read at runtime, assuring consistancy.
22 #
23 # References:
24 #   - https://docs.python.org/3.7/distutils/extending.html
25 #   - https://github.com/python/mypy
26 class build_py(_build_py):
27     def pin_version(self):
28         path = os.path.join(self.build_lib, "dvc")
29         self.mkpath(path)
30         with open(os.path.join(path, "version.py"), "w") as fobj:
31             fobj.write("# AUTOGENERATED at build time by setup.py\n")
32             fobj.write('__version__ = "{}"\n'.format(version))
33 
34     def run(self):
35         self.execute(self.pin_version, ())
36         _build_py.run(self)
37 
38 
39 install_requires = [
40     "ply>=3.9",  # See https://github.com/pyinstaller/pyinstaller/issues/1945
41     "configparser>=3.5.0",
42     "zc.lockfile>=1.2.1",
43     "future>=0.16.0",
44     "colorama>=0.3.9",
45     "configobj>=5.0.6",
46     "gitpython>=2.1.8",
47     "setuptools>=34.0.0",
48     "nanotime>=0.5.2",
49     "pyasn1>=0.4.1",
50     "schema>=0.6.7",
51     "jsonpath-ng>=1.4.3",
52     "requests>=2.22.0",
53     "grandalf==0.6",
54     "asciimatics>=1.10.0",
55     "distro>=1.3.0",
56     "appdirs>=1.4.3",
57     "treelib>=1.5.5",
58     "inflect>=2.1.0",
59     "humanize>=0.5.1",
60     "ruamel.yaml>=0.15.91",
61     "psutil==5.6.2",
62     "funcy>=1.12",
63     "pathspec>=0.5.9",
64     "shortuuid>=0.5.0",
65     "win-unicode-console>=0.5; sys_platform == 'win32'",
66 ]
67 
68 if sys.version_info[0] == 2:
69     install_requires.append("networkx>=2.1,<2.3")
70 else:
71     install_requires.append("networkx>=2.1")
72 
73 # Extra dependencies for remote integrations
74 gs = ["google-cloud-storage==1.13.0"]
75 s3 = ["boto3==1.9.115"]
76 azure = ["azure-storage-blob==2.0.1"]
77 oss = ["oss2==2.6.1"]
78 ssh = ["paramiko>=2.5.0"]
79 all_remotes = gs + s3 + azure + ssh + oss
80 
81 # Extra dependecies to run tests
82 tests_requirements = [
83     "PyInstaller==3.4",
84     "wheel>=0.31.1",
85     "pydot>=1.2.4",
86     # Test requirements:
87     "pytest>=4.6.0",
88     "pytest-timeout>=1.3.3",
89     "pytest-cov>=2.6.1",
90     "pytest-xdist>=1.26.1",
91     "pytest-mock>=1.10.4",
92     "flaky>=3.5.3",
93     "mock>=3.0.0",
94     "xmltodict>=0.11.0",
95     "awscli>=1.16.125",
96     "google-compute-engine",
97     "pywin32; sys_platform == 'win32'",
98     "Pygments",  # required by collective.checkdocs,
99     "collective.checkdocs",
100     "flake8",
101     "flake8-docstrings",
102     "pydocstyle<4.0",
103     "jaraco.windows==3.9.2",
104     "mock-ssh-server>=0.5.0",
105 ]
106 
107 if (sys.version_info) >= (3, 6):
108     tests_requirements.append("black==19.3b0")
109 
110 setup(
111     name="dvc",
112     version=version,
113     description="Git for data scientists - manage your code and data together",
114     long_description=open("README.rst", "r").read(),
115     author="Dmitry Petrov",
116     author_email="dmitry@dataversioncontrol.com",
117     download_url="https://github.com/iterative/dvc",
118     license="Apache License 2.0",
119     install_requires=install_requires,
120     extras_require={
121         "all": all_remotes,
122         "gs": gs,
123         "s3": s3,
124         "azure": azure,
125         "oss": oss,
126         "ssh": ssh,
127         # NOTE: https://github.com/inveniosoftware/troubleshooting/issues/1
128         ":python_version=='2.7'": ["futures", "pathlib2"],
129         "tests": tests_requirements,
130     },
131     keywords="data science, data version control, machine learning",
132     python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
133     classifiers=[
134         "Development Status :: 4 - Beta",
135         "Programming Language :: Python :: 2",
136         "Programming Language :: Python :: 2.7",
137         "Programming Language :: Python :: 3",
138         "Programming Language :: Python :: 3.5",
139         "Programming Language :: Python :: 3.6",
140         "Programming Language :: Python :: 3.7",
141     ],
142     packages=find_packages(exclude=["tests"]),
143     include_package_data=True,
144     url="http://dataversioncontrol.com",
145     entry_points={"console_scripts": ["dvc = dvc.main:main"]},
146     cmdclass={"build_py": build_py},
147     zip_safe=False,
148 )
149
```
--- 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/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -102,6 +102,7 @@
     "pydocstyle<4.0",
     "jaraco.windows==3.9.2",
     "mock-ssh-server>=0.5.0",
+    "moto",
 ]
 
 if (sys.version_info) >= (3, 6):

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -102,6 +102,7 @@\n     \"pydocstyle<4.0\",\n     \"jaraco.windows==3.9.2\",\n     \"mock-ssh-server>=0.5.0\",\n+    \"moto\",\n ]\n \n if (sys.version_info) >= (3, 6):\n", "issue": "test: s3: use moto to test multipart objects\nCurrently, we are unable to use it because of [this bug](https://github.com/spulec/moto/issues/2154). When it is fixed, we should switch to it from using actual s3 for unit testing. Related to https://github.com/iterative/dvc/pull/1867\r\n\n", "before_files": [{"content": "from setuptools import setup, find_packages\nfrom setuptools.command.build_py import build_py as _build_py\nimport os\nimport sys\n\n\n# https://packaging.python.org/guides/single-sourcing-package-version/\npkg_dir = os.path.dirname(__file__)\n\n# This will define __version__ implicitly\nwith open(os.path.join(pkg_dir, \"dvc\", \"version.py\")) as fobj:\n    exec(fobj.read())\n\nversion = __version__  # noqa: F821\n\n\n# To achieve consistency between the build version and the one provided\n# by your package during runtime, you need to **pin** the build version.\n#\n# This custom class will replace the version.py module with a **static**\n# `__version__` that your package can read at runtime, assuring consistancy.\n#\n# References:\n#   - https://docs.python.org/3.7/distutils/extending.html\n#   - https://github.com/python/mypy\nclass build_py(_build_py):\n    def pin_version(self):\n        path = os.path.join(self.build_lib, \"dvc\")\n        self.mkpath(path)\n        with open(os.path.join(path, \"version.py\"), \"w\") as fobj:\n            fobj.write(\"# AUTOGENERATED at build time by setup.py\\n\")\n            fobj.write('__version__ = \"{}\"\\n'.format(version))\n\n    def run(self):\n        self.execute(self.pin_version, ())\n        _build_py.run(self)\n\n\ninstall_requires = [\n    \"ply>=3.9\",  # See https://github.com/pyinstaller/pyinstaller/issues/1945\n    \"configparser>=3.5.0\",\n    \"zc.lockfile>=1.2.1\",\n    \"future>=0.16.0\",\n    \"colorama>=0.3.9\",\n    \"configobj>=5.0.6\",\n    \"gitpython>=2.1.8\",\n    \"setuptools>=34.0.0\",\n    \"nanotime>=0.5.2\",\n    \"pyasn1>=0.4.1\",\n    \"schema>=0.6.7\",\n    \"jsonpath-ng>=1.4.3\",\n    \"requests>=2.22.0\",\n    \"grandalf==0.6\",\n    \"asciimatics>=1.10.0\",\n    \"distro>=1.3.0\",\n    \"appdirs>=1.4.3\",\n    \"treelib>=1.5.5\",\n    \"inflect>=2.1.0\",\n    \"humanize>=0.5.1\",\n    \"ruamel.yaml>=0.15.91\",\n    \"psutil==5.6.2\",\n    \"funcy>=1.12\",\n    \"pathspec>=0.5.9\",\n    \"shortuuid>=0.5.0\",\n    \"win-unicode-console>=0.5; sys_platform == 'win32'\",\n]\n\nif sys.version_info[0] == 2:\n    install_requires.append(\"networkx>=2.1,<2.3\")\nelse:\n    install_requires.append(\"networkx>=2.1\")\n\n# Extra dependencies for remote integrations\ngs = [\"google-cloud-storage==1.13.0\"]\ns3 = [\"boto3==1.9.115\"]\nazure = [\"azure-storage-blob==2.0.1\"]\noss = [\"oss2==2.6.1\"]\nssh = [\"paramiko>=2.5.0\"]\nall_remotes = gs + s3 + azure + ssh + oss\n\n# Extra dependecies to run tests\ntests_requirements = [\n    \"PyInstaller==3.4\",\n    \"wheel>=0.31.1\",\n    \"pydot>=1.2.4\",\n    # Test requirements:\n    \"pytest>=4.6.0\",\n    \"pytest-timeout>=1.3.3\",\n    \"pytest-cov>=2.6.1\",\n    \"pytest-xdist>=1.26.1\",\n    \"pytest-mock>=1.10.4\",\n    \"flaky>=3.5.3\",\n    \"mock>=3.0.0\",\n    \"xmltodict>=0.11.0\",\n    \"awscli>=1.16.125\",\n    \"google-compute-engine\",\n    \"pywin32; sys_platform == 'win32'\",\n    \"Pygments\",  # required by collective.checkdocs,\n    \"collective.checkdocs\",\n    \"flake8\",\n    \"flake8-docstrings\",\n    \"pydocstyle<4.0\",\n    \"jaraco.windows==3.9.2\",\n    \"mock-ssh-server>=0.5.0\",\n]\n\nif (sys.version_info) >= (3, 6):\n    tests_requirements.append(\"black==19.3b0\")\n\nsetup(\n    name=\"dvc\",\n    version=version,\n    description=\"Git for data scientists - manage your code and data together\",\n    long_description=open(\"README.rst\", \"r\").read(),\n    author=\"Dmitry Petrov\",\n    author_email=\"dmitry@dataversioncontrol.com\",\n    download_url=\"https://github.com/iterative/dvc\",\n    license=\"Apache License 2.0\",\n    install_requires=install_requires,\n    extras_require={\n        \"all\": all_remotes,\n        \"gs\": gs,\n        \"s3\": s3,\n        \"azure\": azure,\n        \"oss\": oss,\n        \"ssh\": ssh,\n        # NOTE: https://github.com/inveniosoftware/troubleshooting/issues/1\n        \":python_version=='2.7'\": [\"futures\", \"pathlib2\"],\n        \"tests\": tests_requirements,\n    },\n    keywords=\"data science, data version control, machine learning\",\n    python_requires=\">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*\",\n    classifiers=[\n        \"Development Status :: 4 - Beta\",\n        \"Programming Language :: Python :: 2\",\n        \"Programming Language :: Python :: 2.7\",\n        \"Programming Language :: Python :: 3\",\n        \"Programming Language :: Python :: 3.5\",\n        \"Programming Language :: Python :: 3.6\",\n        \"Programming Language :: Python :: 3.7\",\n    ],\n    packages=find_packages(exclude=[\"tests\"]),\n    include_package_data=True,\n    url=\"http://dataversioncontrol.com\",\n    entry_points={\"console_scripts\": [\"dvc = dvc.main:main\"]},\n    cmdclass={\"build_py\": build_py},\n    zip_safe=False,\n)\n", "path": "setup.py"}], "after_files": [{"content": "from setuptools import setup, find_packages\nfrom setuptools.command.build_py import build_py as _build_py\nimport os\nimport sys\n\n\n# https://packaging.python.org/guides/single-sourcing-package-version/\npkg_dir = os.path.dirname(__file__)\n\n# This will define __version__ implicitly\nwith open(os.path.join(pkg_dir, \"dvc\", \"version.py\")) as fobj:\n    exec(fobj.read())\n\nversion = __version__  # noqa: F821\n\n\n# To achieve consistency between the build version and the one provided\n# by your package during runtime, you need to **pin** the build version.\n#\n# This custom class will replace the version.py module with a **static**\n# `__version__` that your package can read at runtime, assuring consistancy.\n#\n# References:\n#   - https://docs.python.org/3.7/distutils/extending.html\n#   - https://github.com/python/mypy\nclass build_py(_build_py):\n    def pin_version(self):\n        path = os.path.join(self.build_lib, \"dvc\")\n        self.mkpath(path)\n        with open(os.path.join(path, \"version.py\"), \"w\") as fobj:\n            fobj.write(\"# AUTOGENERATED at build time by setup.py\\n\")\n            fobj.write('__version__ = \"{}\"\\n'.format(version))\n\n    def run(self):\n        self.execute(self.pin_version, ())\n        _build_py.run(self)\n\n\ninstall_requires = [\n    \"ply>=3.9\",  # See https://github.com/pyinstaller/pyinstaller/issues/1945\n    \"configparser>=3.5.0\",\n    \"zc.lockfile>=1.2.1\",\n    \"future>=0.16.0\",\n    \"colorama>=0.3.9\",\n    \"configobj>=5.0.6\",\n    \"gitpython>=2.1.8\",\n    \"setuptools>=34.0.0\",\n    \"nanotime>=0.5.2\",\n    \"pyasn1>=0.4.1\",\n    \"schema>=0.6.7\",\n    \"jsonpath-ng>=1.4.3\",\n    \"requests>=2.22.0\",\n    \"grandalf==0.6\",\n    \"asciimatics>=1.10.0\",\n    \"distro>=1.3.0\",\n    \"appdirs>=1.4.3\",\n    \"treelib>=1.5.5\",\n    \"inflect>=2.1.0\",\n    \"humanize>=0.5.1\",\n    \"ruamel.yaml>=0.15.91\",\n    \"psutil==5.6.2\",\n    \"funcy>=1.12\",\n    \"pathspec>=0.5.9\",\n    \"shortuuid>=0.5.0\",\n    \"win-unicode-console>=0.5; sys_platform == 'win32'\",\n]\n\nif sys.version_info[0] == 2:\n    install_requires.append(\"networkx>=2.1,<2.3\")\nelse:\n    install_requires.append(\"networkx>=2.1\")\n\n# Extra dependencies for remote integrations\ngs = [\"google-cloud-storage==1.13.0\"]\ns3 = [\"boto3==1.9.115\"]\nazure = [\"azure-storage-blob==2.0.1\"]\noss = [\"oss2==2.6.1\"]\nssh = [\"paramiko>=2.5.0\"]\nall_remotes = gs + s3 + azure + ssh + oss\n\n# Extra dependecies to run tests\ntests_requirements = [\n    \"PyInstaller==3.4\",\n    \"wheel>=0.31.1\",\n    \"pydot>=1.2.4\",\n    # Test requirements:\n    \"pytest>=4.6.0\",\n    \"pytest-timeout>=1.3.3\",\n    \"pytest-cov>=2.6.1\",\n    \"pytest-xdist>=1.26.1\",\n    \"pytest-mock>=1.10.4\",\n    \"flaky>=3.5.3\",\n    \"mock>=3.0.0\",\n    \"xmltodict>=0.11.0\",\n    \"awscli>=1.16.125\",\n    \"google-compute-engine\",\n    \"pywin32; sys_platform == 'win32'\",\n    \"Pygments\",  # required by collective.checkdocs,\n    \"collective.checkdocs\",\n    \"flake8\",\n    \"flake8-docstrings\",\n    \"pydocstyle<4.0\",\n    \"jaraco.windows==3.9.2\",\n    \"mock-ssh-server>=0.5.0\",\n    \"moto\",\n]\n\nif (sys.version_info) >= (3, 6):\n    tests_requirements.append(\"black==19.3b0\")\n\nsetup(\n    name=\"dvc\",\n    version=version,\n    description=\"Git for data scientists - manage your code and data together\",\n    long_description=open(\"README.rst\", \"r\").read(),\n    author=\"Dmitry Petrov\",\n    author_email=\"dmitry@dataversioncontrol.com\",\n    download_url=\"https://github.com/iterative/dvc\",\n    license=\"Apache License 2.0\",\n    install_requires=install_requires,\n    extras_require={\n        \"all\": all_remotes,\n        \"gs\": gs,\n        \"s3\": s3,\n        \"azure\": azure,\n        \"oss\": oss,\n        \"ssh\": ssh,\n        # NOTE: https://github.com/inveniosoftware/troubleshooting/issues/1\n        \":python_version=='2.7'\": [\"futures\", \"pathlib2\"],\n        \"tests\": tests_requirements,\n    },\n    keywords=\"data science, data version control, machine learning\",\n    python_requires=\">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*\",\n    classifiers=[\n        \"Development Status :: 4 - Beta\",\n        \"Programming Language :: Python :: 2\",\n        \"Programming Language :: Python :: 2.7\",\n        \"Programming Language :: Python :: 3\",\n        \"Programming Language :: Python :: 3.5\",\n        \"Programming Language :: Python :: 3.6\",\n        \"Programming Language :: Python :: 3.7\",\n    ],\n    packages=find_packages(exclude=[\"tests\"]),\n    include_package_data=True,\n    url=\"http://dataversioncontrol.com\",\n    entry_points={\"console_scripts\": [\"dvc = dvc.main:main\"]},\n    cmdclass={\"build_py\": build_py},\n    zip_safe=False,\n)\n", "path": "setup.py"}]}