prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Support matplotlib-3.4.0rc1
  ## Description of the issue
  `matplotlib._get_data_path` no longer exists since 3.4.0rc1: https://github.com/matplotlib/matplotlib/commit/e1352c71f07aee7eab004b73dd9bda2a260ab31b.
  This is on schedule for the removal of the deprecations that occurred around the time of #5006. The missing function leads to a traceback output during build, and the whole `cwd` being crammed into `mpl-data`. Finally, `matplotlib` cannot be imported in the packaged app because it cannot find `mpl-data/matplotlibrc`.
  ## Context information (for bug reports)
  
  * Output of `pyinstaller --version`: ```4.2```
  * Version of Python: `3.8`
  * Platform: `Windows`
  * Did you also try this on another platform? Does it work there? `Surely it is a cross platform bug`
  
  
  > * try the latest development version, using the following command: 
  > 
  > ```shell
  > pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip
  > ```
  > 
  > * follow *all* the instructions in our "If Things Go Wrong" Guide
  >   (https://github.com/pyinstaller/pyinstaller/wiki/If-Things-Go-Wrong) and
  > 
  > ### Make sure [everything is packaged correctly](https://github.com/pyinstaller/pyinstaller/wiki/How-to-Report-Bugs#make-sure-everything-is-packaged-correctly)
  > 
  >   * [ ] start with clean installation
  >   * [ ] use the latest development version
  >   * [ ] Run your frozen program **from a command window (shell)** — instead of double-clicking on it
  >   * [ ] Package your program in **--onedir mode**
  >   * [ ] Package **without UPX**, say: use the option `--noupx` or set `upx=False` in your .spec-file
  >   * [ ] Repackage you application in **verbose/debug mode**. For this, pass the option `--debug` to `pyi-makespec` or `pyinstaller` or use `EXE(..., debug=1, ...)` in your .spec file.
  > 
  This part of the template is irrelevant, as the responsible code is unchanged on `develop`
  
  ### A minimal example program which shows the error
  
  ```
  pip install --pre matplotlib==3.4.0rc1 pyinstaller
  echo "import matplotlib" > test.py
  pyinstaller test.py
  ```
  
  ### Stacktrace / full error message
  Building `pyinstaller test.py`:
  ```
  20391 INFO: Loading module hook 'hook-matplotlib.py' from 'XXXXXXX'...
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
  AttributeError: module 'matplotlib' has no attribute '_get_data_path'
  
  ```
  Running `test.exe`:
  ```
  Traceback (most recent call last):
    File "test.py", line 1, in <module>
      import matplotlib
    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
    File "PyInstaller\loader\pyimod03_importers.py", line 531, in exec_module
    File "matplotlib\__init__.py", line 820, in <module>
    File "matplotlib\__init__.py", line 725, in _rc_params_in_file
    File "contextlib.py", line 113, in __enter__
    File "matplotlib\__init__.py", line 703, in _open_file_or_url
  FileNotFoundError: [Errno 2] No such file or directory: 'xxxxx\\matplotlib\\mpl-data\\matplotlibrc'
  [2688] Failed to execute script test
  
  ```
  
  ## Possible resolution
  
  Simply remove the first underscore in `matplotlib._get_data_path` in 
  
  https://github.com/pyinstaller/pyinstaller/blob/b9fcbbf86bc71addafc830debe289e7edb2a5697/PyInstaller/hooks/hook-matplotlib.py#L16
  
  This works on my system.
  
  I'm a little confused as to why the private function was being used in the first place. `matplotlib.get_data_path` has been available for some time.
  
  </issue>
  <code>
  [start of PyInstaller/hooks/hook-matplotlib.py]
  1 #-----------------------------------------------------------------------------
  2 # Copyright (c) 2013-2021, PyInstaller Development Team.
  3 #
  4 # Distributed under the terms of the GNU General Public License (version 2
  5 # or later) with exception for distributing the bootloader.
  6 #
  7 # The full license is in the file COPYING.txt, distributed with this software.
  8 #
  9 # SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception)
  10 #-----------------------------------------------------------------------------
  11 
  12 
  13 from PyInstaller.utils.hooks import exec_statement
  14 
  15 mpl_data_dir = exec_statement(
  16     "import matplotlib; print(matplotlib._get_data_path())")
  17 
  18 datas = [
  19     (mpl_data_dir, "matplotlib/mpl-data"),
  20 ]
  21
  [end of PyInstaller/hooks/hook-matplotlib.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/PyInstaller/hooks/hook-matplotlib.py b/PyInstaller/hooks/hook-matplotlib.py
  --- a/PyInstaller/hooks/hook-matplotlib.py
  +++ b/PyInstaller/hooks/hook-matplotlib.py
  @@ -13,7 +13,7 @@
   from PyInstaller.utils.hooks import exec_statement
   
   mpl_data_dir = exec_statement(
  -    "import matplotlib; print(matplotlib._get_data_path())")
  +    "import matplotlib; print(matplotlib.get_data_path())")
   
   datas = [
       (mpl_data_dir, "matplotlib/mpl-data"),
  
verification_info: {"golden_diff": "diff --git a/PyInstaller/hooks/hook-matplotlib.py b/PyInstaller/hooks/hook-matplotlib.py\n--- a/PyInstaller/hooks/hook-matplotlib.py\n+++ b/PyInstaller/hooks/hook-matplotlib.py\n@@ -13,7 +13,7 @@\n from PyInstaller.utils.hooks import exec_statement\n \n mpl_data_dir = exec_statement(\n-    \"import matplotlib; print(matplotlib._get_data_path())\")\n+    \"import matplotlib; print(matplotlib.get_data_path())\")\n \n datas = [\n     (mpl_data_dir, \"matplotlib/mpl-data\"),\n", "issue": "Support matplotlib-3.4.0rc1\n## Description of the issue\r\n`matplotlib._get_data_path` no longer exists since 3.4.0rc1: https://github.com/matplotlib/matplotlib/commit/e1352c71f07aee7eab004b73dd9bda2a260ab31b.\r\nThis is on schedule for the removal of the deprecations that occurred around the time of #5006. The missing function leads to a traceback output during build, and the whole `cwd` being crammed into `mpl-data`. Finally, `matplotlib` cannot be imported in the packaged app because it cannot find `mpl-data/matplotlibrc`.\r\n## Context information (for bug reports)\r\n\r\n* Output of `pyinstaller --version`: ```4.2```\r\n* Version of Python: `3.8`\r\n* Platform: `Windows`\r\n* Did you also try this on another platform? Does it work there? `Surely it is a cross platform bug`\r\n\r\n\r\n> * try the latest development version, using the following command: \r\n> \r\n> ```shell\r\n> pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip\r\n> ```\r\n> \r\n> * follow *all* the instructions in our \"If Things Go Wrong\" Guide\r\n>   (https://github.com/pyinstaller/pyinstaller/wiki/If-Things-Go-Wrong) and\r\n> \r\n> ### Make sure [everything is packaged correctly](https://github.com/pyinstaller/pyinstaller/wiki/How-to-Report-Bugs#make-sure-everything-is-packaged-correctly)\r\n> \r\n>   * [ ] start with clean installation\r\n>   * [ ] use the latest development version\r\n>   * [ ] Run your frozen program **from a command window (shell)** \u2014 instead of double-clicking on it\r\n>   * [ ] Package your program in **--onedir mode**\r\n>   * [ ] Package **without UPX**, say: use the option `--noupx` or set `upx=False` in your .spec-file\r\n>   * [ ] Repackage you application in **verbose/debug mode**. For this, pass the option `--debug` to `pyi-makespec` or `pyinstaller` or use `EXE(..., debug=1, ...)` in your .spec file.\r\n> \r\nThis part of the template is irrelevant, as the responsible code is unchanged on `develop`\r\n\r\n### A minimal example program which shows the error\r\n\r\n```\r\npip install --pre matplotlib==3.4.0rc1 pyinstaller\r\necho \"import matplotlib\" > test.py\r\npyinstaller test.py\r\n```\r\n\r\n### Stacktrace / full error message\r\nBuilding `pyinstaller test.py`:\r\n```\r\n20391 INFO: Loading module hook 'hook-matplotlib.py' from 'XXXXXXX'...\r\nTraceback (most recent call last):\r\n  File \"<string>\", line 1, in <module>\r\nAttributeError: module 'matplotlib' has no attribute '_get_data_path'\r\n\r\n```\r\nRunning `test.exe`:\r\n```\r\nTraceback (most recent call last):\r\n  File \"test.py\", line 1, in <module>\r\n    import matplotlib\r\n  File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load\r\n  File \"<frozen importlib._bootstrap>\", line 975, in _find_and_load_unlocked\r\n  File \"<frozen importlib._bootstrap>\", line 671, in _load_unlocked\r\n  File \"PyInstaller\\loader\\pyimod03_importers.py\", line 531, in exec_module\r\n  File \"matplotlib\\__init__.py\", line 820, in <module>\r\n  File \"matplotlib\\__init__.py\", line 725, in _rc_params_in_file\r\n  File \"contextlib.py\", line 113, in __enter__\r\n  File \"matplotlib\\__init__.py\", line 703, in _open_file_or_url\r\nFileNotFoundError: [Errno 2] No such file or directory: 'xxxxx\\\\matplotlib\\\\mpl-data\\\\matplotlibrc'\r\n[2688] Failed to execute script test\r\n\r\n```\r\n\r\n## Possible resolution\r\n\r\nSimply remove the first underscore in `matplotlib._get_data_path` in \r\n\r\nhttps://github.com/pyinstaller/pyinstaller/blob/b9fcbbf86bc71addafc830debe289e7edb2a5697/PyInstaller/hooks/hook-matplotlib.py#L16\r\n\r\nThis works on my system.\r\n\r\nI'm a little confused as to why the private function was being used in the first place. `matplotlib.get_data_path` has been available for some time.\n", "before_files": [{"content": "#-----------------------------------------------------------------------------\n# Copyright (c) 2013-2021, PyInstaller Development Team.\n#\n# Distributed under the terms of the GNU General Public License (version 2\n# or later) with exception for distributing the bootloader.\n#\n# The full license is in the file COPYING.txt, distributed with this software.\n#\n# SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception)\n#-----------------------------------------------------------------------------\n\n\nfrom PyInstaller.utils.hooks import exec_statement\n\nmpl_data_dir = exec_statement(\n    \"import matplotlib; print(matplotlib._get_data_path())\")\n\ndatas = [\n    (mpl_data_dir, \"matplotlib/mpl-data\"),\n]\n", "path": "PyInstaller/hooks/hook-matplotlib.py"}]}