We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
MacOS 10.13 OSError: [Errno 24] Too many open files
```shell
    return [i for i in os.listdir(path) if os.path.isdir(os.path.join(path, i)) and not i.startswith('_')]
OSError: [Errno 24] Too many open files: '/Users/abcdefg/.pyenv/versions/3.6.3/envs/weixin3/lib/python3.6/site-packages/faker/providers/address'
```



--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `faker/utils/loading.py`
Content:
```
1 import os
2 from importlib import import_module
3 import pkgutil
4 
5 
6 def list_module(module):
7     path = os.path.dirname(module.__file__)
8     modules = [name for finder, name, is_pkg in pkgutil.iter_modules([path]) if is_pkg]
9     if len(modules) > 0:
10         return modules
11     return [i for i in os.listdir(path) if os.path.isdir(os.path.join(path, i)) and not i.startswith('_')]
12 
13 
14 def find_available_locales(providers):
15     available_locales = set()
16 
17     for provider_path in providers:
18 
19         provider_module = import_module(provider_path)
20         if getattr(provider_module, 'localized', False):
21             langs = list_module(provider_module)
22             available_locales.update(langs)
23     return available_locales
24 
25 
26 def find_available_providers(modules):
27     available_providers = set()
28     for providers_mod in modules:
29         providers = ['.'.join([providers_mod.__package__, mod]) for mod in list_module(providers_mod)]
30         available_providers.update(providers)
31     return sorted(available_providers)
32
```
--- 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/faker/utils/loading.py b/faker/utils/loading.py
--- a/faker/utils/loading.py
+++ b/faker/utils/loading.py
@@ -6,9 +6,7 @@
 def list_module(module):
     path = os.path.dirname(module.__file__)
     modules = [name for finder, name, is_pkg in pkgutil.iter_modules([path]) if is_pkg]
-    if len(modules) > 0:
-        return modules
-    return [i for i in os.listdir(path) if os.path.isdir(os.path.join(path, i)) and not i.startswith('_')]
+    return modules
 
 
 def find_available_locales(providers):

{"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@@ -6,9 +6,7 @@\n def list_module(module):\n     path = os.path.dirname(module.__file__)\n     modules = [name for finder, name, is_pkg in pkgutil.iter_modules([path]) if is_pkg]\n-    if len(modules) > 0:\n-        return modules\n-    return [i for i in os.listdir(path) if os.path.isdir(os.path.join(path, i)) and not i.startswith('_')]\n+    return modules\n \n \n def find_available_locales(providers):\n", "issue": "MacOS 10.13 OSError: [Errno 24] Too many open files\n```shell\r\n    return [i for i in os.listdir(path) if os.path.isdir(os.path.join(path, i)) and not i.startswith('_')]\r\nOSError: [Errno 24] Too many open files: '/Users/abcdefg/.pyenv/versions/3.6.3/envs/weixin3/lib/python3.6/site-packages/faker/providers/address'\r\n```\r\n\r\n\n", "before_files": [{"content": "import os\nfrom importlib import import_module\nimport pkgutil\n\n\ndef list_module(module):\n    path = os.path.dirname(module.__file__)\n    modules = [name for finder, name, is_pkg in pkgutil.iter_modules([path]) if is_pkg]\n    if len(modules) > 0:\n        return modules\n    return [i for i in os.listdir(path) if os.path.isdir(os.path.join(path, i)) and not i.startswith('_')]\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 = ['.'.join([providers_mod.__package__, mod]) for mod in list_module(providers_mod)]\n        available_providers.update(providers)\n    return sorted(available_providers)\n", "path": "faker/utils/loading.py"}], "after_files": [{"content": "import os\nfrom importlib import import_module\nimport pkgutil\n\n\ndef list_module(module):\n    path = os.path.dirname(module.__file__)\n    modules = [name for finder, name, 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 = ['.'.join([providers_mod.__package__, mod]) for mod in list_module(providers_mod)]\n        available_providers.update(providers)\n    return sorted(available_providers)\n", "path": "faker/utils/loading.py"}]}