prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  AttributeError: module 'faker.providers' has no attribute '__file__'
  I converted my python code to .exe using cx_Freeze. While opening my .exe file I am getting this error.
  
  Traceback (most recent call last):
    File "C:\Program Files\Python36\lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 14, in run
      module.run()
    File "C:\Program Files\Python36\lib\site-packages\cx_Freeze\initscripts\Console.py", line 26, in run
      exec(code, m.__dict__)
    File "DataGenerator.py", line 7, in <module>
    File "C:\Program Files\Python36\lib\site-packages\faker\__init__.py", line 4, in <module>
      from faker.factory import Factory
    File "C:\Program Files\Python36\lib\site-packages\faker\factory.py", line 10, in <module>
      from faker.config import DEFAULT_LOCALE, PROVIDERS, AVAILABLE_LOCALES
    File "C:\Program Files\Python36\lib\site-packages\faker\config.py", line 11, in <module>
      PROVIDERS = find_available_providers([import_module(path) for path in META_PROVIDERS_MODULES])
    File "C:\Program Files\Python36\lib\site-packages\faker\utils\loading.py", line 29, in find_available_providers
      providers = ['.'.join([providers_mod.__package__, mod]) for mod in list_module(providers_mod)]
    File "C:\Program Files\Python36\lib\site-packages\faker\utils\loading.py", line 7, in list_module
      path = os.path.dirname(module.__file__)
  AttributeError: module 'faker.providers' has no attribute '__file__'
  
  </issue>
  <code>
  [start of faker/utils/loading.py]
  1 import os
  2 import sys
  3 from importlib import import_module
  4 import pkgutil
  5 
  6 
  7 def get_path(module):
  8     if getattr(sys, 'frozen', False):
  9         # frozen
  10         path = os.path.dirname(sys.executable)
  11     else:
  12         # unfrozen
  13         path = os.path.dirname(os.path.realpath(module.__file__))
  14     return path
  15 
  16 
  17 def list_module(module):
  18     path = get_path(module)
  19     modules = [name for finder, name,
  20                is_pkg in pkgutil.iter_modules([path]) if is_pkg]
  21     return modules
  22 
  23 
  24 def find_available_locales(providers):
  25     available_locales = set()
  26 
  27     for provider_path in providers:
  28 
  29         provider_module = import_module(provider_path)
  30         if getattr(provider_module, 'localized', False):
  31             langs = list_module(provider_module)
  32             available_locales.update(langs)
  33     return available_locales
  34 
  35 
  36 def find_available_providers(modules):
  37     available_providers = set()
  38     for providers_mod in modules:
  39         providers = [
  40             '.'.join([providers_mod.__package__, mod])
  41             for mod in list_module(providers_mod) if mod != '__pycache__'
  42         ]
  43         available_providers.update(providers)
  44     return sorted(available_providers)
  45
  [end of faker/utils/loading.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/faker/utils/loading.py b/faker/utils/loading.py
  --- a/faker/utils/loading.py
  +++ b/faker/utils/loading.py
  @@ -7,7 +7,10 @@
   def get_path(module):
       if getattr(sys, 'frozen', False):
           # frozen
  -        path = os.path.dirname(sys.executable)
  +        base_dir = os.path.dirname(sys.executable)
  +        lib_dir = os.path.join(base_dir, "lib")
  +        module_to_rel_path = os.path.join(*module.__package__.split("."))
  +        path = os.path.join(lib_dir, module_to_rel_path)
       else:
           # unfrozen
           path = os.path.dirname(os.path.realpath(module.__file__))
  
verification_info: {"golden_diff": "diff --git a/faker/utils/loading.py b/faker/utils/loading.py\n--- a/faker/utils/loading.py\n+++ b/faker/utils/loading.py\n@@ -7,7 +7,10 @@\n def get_path(module):\n     if getattr(sys, 'frozen', False):\n         # frozen\n-        path = os.path.dirname(sys.executable)\n+        base_dir = os.path.dirname(sys.executable)\n+        lib_dir = os.path.join(base_dir, \"lib\")\n+        module_to_rel_path = os.path.join(*module.__package__.split(\".\"))\n+        path = os.path.join(lib_dir, module_to_rel_path)\n     else:\n         # unfrozen\n         path = os.path.dirname(os.path.realpath(module.__file__))\n", "issue": "AttributeError: module 'faker.providers' has no attribute '__file__'\nI converted my python code to .exe using cx_Freeze. While opening my .exe file I am getting this error.\r\n\r\nTraceback (most recent call last):\r\n  File \"C:\\Program Files\\Python36\\lib\\site-packages\\cx_Freeze\\initscripts\\__startup__.py\", line 14, in run\r\n    module.run()\r\n  File \"C:\\Program Files\\Python36\\lib\\site-packages\\cx_Freeze\\initscripts\\Console.py\", line 26, in run\r\n    exec(code, m.__dict__)\r\n  File \"DataGenerator.py\", line 7, in <module>\r\n  File \"C:\\Program Files\\Python36\\lib\\site-packages\\faker\\__init__.py\", line 4, in <module>\r\n    from faker.factory import Factory\r\n  File \"C:\\Program Files\\Python36\\lib\\site-packages\\faker\\factory.py\", line 10, in <module>\r\n    from faker.config import DEFAULT_LOCALE, PROVIDERS, AVAILABLE_LOCALES\r\n  File \"C:\\Program Files\\Python36\\lib\\site-packages\\faker\\config.py\", line 11, in <module>\r\n    PROVIDERS = find_available_providers([import_module(path) for path in META_PROVIDERS_MODULES])\r\n  File \"C:\\Program Files\\Python36\\lib\\site-packages\\faker\\utils\\loading.py\", line 29, in find_available_providers\r\n    providers = ['.'.join([providers_mod.__package__, mod]) for mod in list_module(providers_mod)]\r\n  File \"C:\\Program Files\\Python36\\lib\\site-packages\\faker\\utils\\loading.py\", line 7, in list_module\r\n    path = os.path.dirname(module.__file__)\r\nAttributeError: module 'faker.providers' has no attribute '__file__'\n", "before_files": [{"content": "import os\nimport sys\nfrom importlib import import_module\nimport pkgutil\n\n\ndef get_path(module):\n    if getattr(sys, 'frozen', False):\n        # frozen\n        path = os.path.dirname(sys.executable)\n    else:\n        # unfrozen\n        path = os.path.dirname(os.path.realpath(module.__file__))\n    return path\n\n\ndef list_module(module):\n    path = get_path(module)\n    modules = [name for finder, name,\n               is_pkg in pkgutil.iter_modules([path]) if is_pkg]\n    return modules\n\n\ndef find_available_locales(providers):\n    available_locales = set()\n\n    for provider_path in providers:\n\n        provider_module = import_module(provider_path)\n        if getattr(provider_module, 'localized', False):\n            langs = list_module(provider_module)\n            available_locales.update(langs)\n    return available_locales\n\n\ndef find_available_providers(modules):\n    available_providers = set()\n    for providers_mod in modules:\n        providers = [\n            '.'.join([providers_mod.__package__, mod])\n            for mod in list_module(providers_mod) if mod != '__pycache__'\n        ]\n        available_providers.update(providers)\n    return sorted(available_providers)\n", "path": "faker/utils/loading.py"}]}