prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Provide example hooks in pip installations
  ### Steps to reproduce
  1. `pip install Weblate`
  2. `ls path/to/site-packages/weblate`
  
  ### Actual behaviour
  Example hooks are missing. We have to download the examples manually and copy them where we want on the server.
  
  ### Expected behaviour
  Example hooks should be in site-packages, packaged as data inside Weblate package. This would allow to use examples, even when Weblate is installed using pip.
  
  --- 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 #!/usr/bin/env python
  2 # -*- coding: utf-8 -*-
  3 #
  4 # Copyright © 2012 - 2017 Michal Čihař <michal@cihar.com>
  5 #
  6 # This file is part of Weblate <https://weblate.org/>
  7 #
  8 # This program is free software: you can redistribute it and/or modify
  9 # it under the terms of the GNU General Public License as published by
  10 # the Free Software Foundation, either version 3 of the License, or
  11 # (at your option) any later version.
  12 #
  13 # This program is distributed in the hope that it will be useful,
  14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16 # GNU General Public License for more details.
  17 #
  18 # You should have received a copy of the GNU General Public License
  19 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
  20 #
  21 
  22 import os
  23 import sys
  24 from setuptools import setup
  25 
  26 # allow setup.py to be run from any path
  27 os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
  28 
  29 with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
  30     README = readme.read()
  31 
  32 with open('requirements.txt') as requirements:
  33     REQUIRES = requirements.read().splitlines()
  34 
  35 setup(
  36     name='Weblate',
  37     version='2.14',
  38     packages=[
  39         'weblate',
  40         'weblate.api',
  41         'weblate.api.migrations',
  42         'weblate.accounts',
  43         'weblate.accounts.management',
  44         'weblate.accounts.management.commands',
  45         'weblate.accounts.migrations',
  46         'weblate.accounts.templatetags',
  47         'weblate.accounts.tests',
  48         'weblate.billing',
  49         'weblate.billing.management',
  50         'weblate.billing.management.commands',
  51         'weblate.billing.migrations',
  52         'weblate.lang',
  53         'weblate.lang.management',
  54         'weblate.lang.management.commands',
  55         'weblate.lang.migrations',
  56         'weblate.trans',
  57         'weblate.trans.autofixes',
  58         'weblate.trans.checks',
  59         'weblate.trans.machine',
  60         'weblate.trans.management',
  61         'weblate.trans.management.commands',
  62         'weblate.trans.migrations',
  63         'weblate.trans.models',
  64         'weblate.trans.templatetags',
  65         'weblate.trans.tests',
  66         'weblate.trans.views',
  67     ],
  68     include_package_data=True,
  69     license='GPLv3+',
  70     description=(
  71         'A web-based translation tool with tight version control integration'
  72     ),
  73     long_description=README,
  74     keywords='i18n l10n gettext git mercurial translate',
  75     url='https://weblate.org/',
  76     download_url='https://weblate.org/download/',
  77     bugtrack_url='https://github.com/WeblateOrg/weblate/issues',
  78     author='Michal Čihař',
  79     author_email='michal@cihar.com',
  80     install_requires=REQUIRES,
  81     zip_safe=False,
  82     extras_require={
  83         'Mercurial': ['Mercurial>=2.8'],
  84         'Unicode': ['pyuca>=1.1', 'python-bidi>=0.4.0', 'chardet'],
  85         'Avatars': [
  86             'pyLibravatar',
  87             'pydns' if sys.version_info[0] == 2 else 'py3dns'
  88         ],
  89         'Android': ['Babel'],
  90         'YAML': ['PyYAML>=3.0'],
  91         'OCR': ['tesserocr>=1.2'],
  92     },
  93     classifiers=[
  94         'Environment :: Web Environment',
  95         'Framework :: Django',
  96         'Intended Audience :: Developers',
  97         'Intended Audience :: System Administrators',
  98         'License :: OSI Approved :: '
  99         'GNU General Public License v3 or later (GPLv3+)',
  100         'Operating System :: OS Independent',
  101         'Development Status :: 5 - Production/Stable',
  102         'Programming Language :: Python',
  103         'Programming Language :: Python :: 2',
  104         'Programming Language :: Python :: 2.7',
  105         'Programming Language :: Python :: 3',
  106         'Programming Language :: Python :: 3.4',
  107         'Programming Language :: Python :: 3.5',
  108         'Topic :: Software Development :: Internationalization',
  109         'Topic :: Software Development :: Localization',
  110         'Topic :: Internet :: WWW/HTTP',
  111         'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
  112     ],
  113     entry_points={
  114         'console_scripts': [
  115             'weblate = weblate.runner:main',
  116         ],
  117     },
  118     tests_require=(
  119         'selenium',
  120         'httpretty',
  121     ),
  122     test_suite='runtests.runtests',
  123 )
  124
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/setup.py b/setup.py
  --- a/setup.py
  +++ b/setup.py
  @@ -32,6 +32,11 @@
   with open('requirements.txt') as requirements:
       REQUIRES = requirements.read().splitlines()
   
  +DATA_FILES = [
  +    ('share/weblate/' + root, [os.path.join(root, f) for f in files])
  +    for root, dirs, files in os.walk('examples')
  +]
  +
   setup(
       name='Weblate',
       version='2.14',
  @@ -120,4 +125,5 @@
           'httpretty',
       ),
       test_suite='runtests.runtests',
  +    data_files=DATA_FILES,
   )
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -32,6 +32,11 @@\n with open('requirements.txt') as requirements:\n     REQUIRES = requirements.read().splitlines()\n \n+DATA_FILES = [\n+    ('share/weblate/' + root, [os.path.join(root, f) for f in files])\n+    for root, dirs, files in os.walk('examples')\n+]\n+\n setup(\n     name='Weblate',\n     version='2.14',\n@@ -120,4 +125,5 @@\n         'httpretty',\n     ),\n     test_suite='runtests.runtests',\n+    data_files=DATA_FILES,\n )\n", "issue": "Provide example hooks in pip installations\n### Steps to reproduce\r\n1. `pip install Weblate`\r\n2. `ls path/to/site-packages/weblate`\r\n\r\n### Actual behaviour\r\nExample hooks are missing. We have to download the examples manually and copy them where we want on the server.\r\n\r\n### Expected behaviour\r\nExample hooks should be in site-packages, packaged as data inside Weblate package. This would allow to use examples, even when Weblate is installed using pip.\n", "before_files": [{"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright \u00a9 2012 - 2017 Michal \u010ciha\u0159 <michal@cihar.com>\n#\n# This file is part of Weblate <https://weblate.org/>\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <https://www.gnu.org/licenses/>.\n#\n\nimport os\nimport sys\nfrom setuptools import setup\n\n# allow setup.py to be run from any path\nos.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))\n\nwith open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:\n    README = readme.read()\n\nwith open('requirements.txt') as requirements:\n    REQUIRES = requirements.read().splitlines()\n\nsetup(\n    name='Weblate',\n    version='2.14',\n    packages=[\n        'weblate',\n        'weblate.api',\n        'weblate.api.migrations',\n        'weblate.accounts',\n        'weblate.accounts.management',\n        'weblate.accounts.management.commands',\n        'weblate.accounts.migrations',\n        'weblate.accounts.templatetags',\n        'weblate.accounts.tests',\n        'weblate.billing',\n        'weblate.billing.management',\n        'weblate.billing.management.commands',\n        'weblate.billing.migrations',\n        'weblate.lang',\n        'weblate.lang.management',\n        'weblate.lang.management.commands',\n        'weblate.lang.migrations',\n        'weblate.trans',\n        'weblate.trans.autofixes',\n        'weblate.trans.checks',\n        'weblate.trans.machine',\n        'weblate.trans.management',\n        'weblate.trans.management.commands',\n        'weblate.trans.migrations',\n        'weblate.trans.models',\n        'weblate.trans.templatetags',\n        'weblate.trans.tests',\n        'weblate.trans.views',\n    ],\n    include_package_data=True,\n    license='GPLv3+',\n    description=(\n        'A web-based translation tool with tight version control integration'\n    ),\n    long_description=README,\n    keywords='i18n l10n gettext git mercurial translate',\n    url='https://weblate.org/',\n    download_url='https://weblate.org/download/',\n    bugtrack_url='https://github.com/WeblateOrg/weblate/issues',\n    author='Michal \u010ciha\u0159',\n    author_email='michal@cihar.com',\n    install_requires=REQUIRES,\n    zip_safe=False,\n    extras_require={\n        'Mercurial': ['Mercurial>=2.8'],\n        'Unicode': ['pyuca>=1.1', 'python-bidi>=0.4.0', 'chardet'],\n        'Avatars': [\n            'pyLibravatar',\n            'pydns' if sys.version_info[0] == 2 else 'py3dns'\n        ],\n        'Android': ['Babel'],\n        'YAML': ['PyYAML>=3.0'],\n        'OCR': ['tesserocr>=1.2'],\n    },\n    classifiers=[\n        'Environment :: Web Environment',\n        'Framework :: Django',\n        'Intended Audience :: Developers',\n        'Intended Audience :: System Administrators',\n        'License :: OSI Approved :: '\n        'GNU General Public License v3 or later (GPLv3+)',\n        'Operating System :: OS Independent',\n        'Development Status :: 5 - Production/Stable',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 2',\n        'Programming Language :: Python :: 2.7',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.4',\n        'Programming Language :: Python :: 3.5',\n        'Topic :: Software Development :: Internationalization',\n        'Topic :: Software Development :: Localization',\n        'Topic :: Internet :: WWW/HTTP',\n        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',\n    ],\n    entry_points={\n        'console_scripts': [\n            'weblate = weblate.runner:main',\n        ],\n    },\n    tests_require=(\n        'selenium',\n        'httpretty',\n    ),\n    test_suite='runtests.runtests',\n)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright \u00a9 2012 - 2017 Michal \u010ciha\u0159 <michal@cihar.com>\n#\n# This file is part of Weblate <https://weblate.org/>\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <https://www.gnu.org/licenses/>.\n#\n\nimport os\nimport sys\nfrom setuptools import setup\n\n# allow setup.py to be run from any path\nos.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))\n\nwith open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:\n    README = readme.read()\n\nwith open('requirements.txt') as requirements:\n    REQUIRES = requirements.read().splitlines()\n\nDATA_FILES = [\n    ('share/weblate/' + root, [os.path.join(root, f) for f in files])\n    for root, dirs, files in os.walk('examples')\n]\n\nsetup(\n    name='Weblate',\n    version='2.14',\n    packages=[\n        'weblate',\n        'weblate.api',\n        'weblate.api.migrations',\n        'weblate.accounts',\n        'weblate.accounts.management',\n        'weblate.accounts.management.commands',\n        'weblate.accounts.migrations',\n        'weblate.accounts.templatetags',\n        'weblate.accounts.tests',\n        'weblate.billing',\n        'weblate.billing.management',\n        'weblate.billing.management.commands',\n        'weblate.billing.migrations',\n        'weblate.lang',\n        'weblate.lang.management',\n        'weblate.lang.management.commands',\n        'weblate.lang.migrations',\n        'weblate.trans',\n        'weblate.trans.autofixes',\n        'weblate.trans.checks',\n        'weblate.trans.machine',\n        'weblate.trans.management',\n        'weblate.trans.management.commands',\n        'weblate.trans.migrations',\n        'weblate.trans.models',\n        'weblate.trans.templatetags',\n        'weblate.trans.tests',\n        'weblate.trans.views',\n    ],\n    include_package_data=True,\n    license='GPLv3+',\n    description=(\n        'A web-based translation tool with tight version control integration'\n    ),\n    long_description=README,\n    keywords='i18n l10n gettext git mercurial translate',\n    url='https://weblate.org/',\n    download_url='https://weblate.org/download/',\n    bugtrack_url='https://github.com/WeblateOrg/weblate/issues',\n    author='Michal \u010ciha\u0159',\n    author_email='michal@cihar.com',\n    install_requires=REQUIRES,\n    zip_safe=False,\n    extras_require={\n        'Mercurial': ['Mercurial>=2.8'],\n        'Unicode': ['pyuca>=1.1', 'python-bidi>=0.4.0', 'chardet'],\n        'Avatars': [\n            'pyLibravatar',\n            'pydns' if sys.version_info[0] == 2 else 'py3dns'\n        ],\n        'Android': ['Babel'],\n        'YAML': ['PyYAML>=3.0'],\n        'OCR': ['tesserocr>=1.2'],\n    },\n    classifiers=[\n        'Environment :: Web Environment',\n        'Framework :: Django',\n        'Intended Audience :: Developers',\n        'Intended Audience :: System Administrators',\n        'License :: OSI Approved :: '\n        'GNU General Public License v3 or later (GPLv3+)',\n        'Operating System :: OS Independent',\n        'Development Status :: 5 - Production/Stable',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 2',\n        'Programming Language :: Python :: 2.7',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.4',\n        'Programming Language :: Python :: 3.5',\n        'Topic :: Software Development :: Internationalization',\n        'Topic :: Software Development :: Localization',\n        'Topic :: Internet :: WWW/HTTP',\n        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',\n    ],\n    entry_points={\n        'console_scripts': [\n            'weblate = weblate.runner:main',\n        ],\n    },\n    tests_require=(\n        'selenium',\n        'httpretty',\n    ),\n    test_suite='runtests.runtests',\n    data_files=DATA_FILES,\n)\n", "path": "setup.py"}]}