We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
The venv folder is not being excluded from pre-commit hooks
Hello! At first, I would like to thank you for the library.

I follow the [CONTRIBUTING.md guide](https://github.com/rochacbruno/dynaconf/blob/master/CONTRIBUTING.md) and run the `make all` command to check if everything was right before I see the code. When I do that the **reorder-python-imports** hook failed because of some reorders that he made in some files in the `venv` folder:

```bash
...
Reordering imports in venv/lib/python3.7/site-packages/pynvim/msgpack_rpc/msgpack_stream.py
Reordering imports in venv/lib/python3.7/site-packages/tqdm/contrib/itertools.py
Reordering imports in venv/lib/python3.7/site-packages/coverage/execfile.py
Reordering imports in venv/lib/python3.7/site-packages/pyflakes/test/test_undefined_names.py
Reordering imports in venv/lib/python3.7/site-packages/nltk/test/unit/test_tgrep.py
Reordering imports in venv/lib/python3.7/site-packages/future/moves/test/__init__.py
Reordering imports in venv/lib/python3.7/site-packages/pynvim/api/common.py
Reordering imports in venv/lib/python3.7/site-packages/nltk/parse/recursivedescent.py
Reordering imports in venv/lib/python3.7/site-packages/django/contrib/admin/templatetags/base.py
Reordering imports in venv/lib/python3.7/site-packages/jeepney/tests/test_bus.py
Reordering imports in venv/lib/python3.7/site-packages/pip/_vendor/cachecontrol/serialize.py
Reordering imports in venv/lib/python3.7/site-packages/sphinx/transforms/post_transforms/__init__.py
Reordering imports in venv/bin/rst2latex.py
Reordering imports in venv/lib/python3.7/site-packages/cryptography/hazmat/primitives/ciphers/modes.py
Reordering imports in venv/lib/python3.7/site-packages/setuptools/_distutils/ccompiler.py
Reordering imports in venv/lib/python3.7/site-packages/botocore/vendored/requests/packages/__init__.py
...
```

Besides, the **black** hook was taking too much time to finish and I think that this happened because he was reformating the files in the `venv` folder. Is that an expected behavior? Am I doing something wrong or missing some configuration?

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `dynaconf/loaders/base.py`
Content:
```
1 import io
2 import warnings
3 
4 from dynaconf.utils import build_env_list
5 from dynaconf.utils import ensure_a_list
6 from dynaconf.utils import upperfy
7 
8 
9 class BaseLoader:
10     """Base loader for dynaconf source files.
11 
12     :param obj: {[LazySettings]} -- [Dynaconf settings]
13     :param env: {[string]} -- [the current env to be loaded defaults to
14       [development]]
15     :param identifier: {[string]} -- [identifier ini, yaml, json, py, toml]
16     :param extensions: {[list]} -- [List of extensions with dots ['.a', '.b']]
17     :param file_reader: {[callable]} -- [reads file return dict]
18     :param string_reader: {[callable]} -- [reads string return dict]
19     """
20 
21     def __init__(
22         self, obj, env, identifier, extensions, file_reader, string_reader
23     ):
24         """Instantiates a loader for different sources"""
25         self.obj = obj
26         self.env = env or obj.current_env
27         self.identifier = identifier
28         self.extensions = extensions
29         self.file_reader = file_reader
30         self.string_reader = string_reader
31 
32     @staticmethod
33     def warn_not_installed(obj, identifier):  # pragma: no cover
34         if identifier not in obj._not_installed_warnings:
35             warnings.warn(
36                 f"{identifier} support is not installed in your environment. "
37                 f"`pip install dynaconf[{identifier}]`"
38             )
39         obj._not_installed_warnings.append(identifier)
40 
41     def load(self, filename=None, key=None, silent=True):
42         """
43         Reads and loads in to `self.obj` a single key or all keys from source
44 
45         :param filename: Optional filename to load
46         :param key: if provided load a single key
47         :param silent: if load erros should be silenced
48         """
49         filename = filename or self.obj.get(self.identifier.upper())
50         if not filename:
51             return
52 
53         if not isinstance(filename, (list, tuple)):
54             split_files = ensure_a_list(filename)
55             if all([f.endswith(self.extensions) for f in split_files]):  # noqa
56                 files = split_files  # it is a ['file.ext', ...]
57             else:  # it is a single config as string
58                 files = [filename]
59         else:  # it is already a list/tuple
60             files = filename
61 
62         source_data = self.get_source_data(files)
63 
64         if self.obj.get("ENVIRONMENTS_FOR_DYNACONF") is False:
65             self._envless_load(source_data, silent, key)
66         else:
67             self._load_all_envs(source_data, silent, key)
68 
69     def get_source_data(self, files):
70         """Reads each file and returns source data for each file
71         {"path/to/file.ext": {"key": "value"}}
72         """
73         data = {}
74         for source_file in files:
75             if source_file.endswith(self.extensions):
76                 try:
77                     with io.open(
78                         source_file,
79                         encoding=self.obj.get(
80                             "ENCODING_FOR_DYNACONF", "utf-8"
81                         ),
82                     ) as open_file:
83                         content = self.file_reader(open_file)
84                         self.obj._loaded_files.append(source_file)
85                         if content:
86                             data[source_file] = content
87                 except IOError as e:
88                     if ".local." not in source_file:
89                         warnings.warn(
90                             f"{self.identifier}_loader: {source_file} "
91                             f":{str(e)}"
92                         )
93             else:
94                 # for tests it is possible to pass string
95                 content = self.string_reader(source_file)
96                 if content:
97                     data[source_file] = content
98         return data
99 
100     def _envless_load(self, source_data, silent=True, key=None):
101         """Load all the keys from each file without env separation"""
102         for file_data in source_data.values():
103             self._set_data_to_obj(file_data, self.identifier, key=key)
104 
105     def _load_all_envs(self, source_data, silent=True, key=None):
106         """Load configs from files separating by each environment"""
107 
108         for file_data in source_data.values():
109 
110             # env name is checked in lower
111             file_data = {k.lower(): value for k, value in file_data.items()}
112 
113             # is there a `dynaconf_merge` on top level of file?
114             file_merge = file_data.get("dynaconf_merge")
115 
116             for env in build_env_list(self.obj, self.env):
117                 env = env.lower()  # lower for better comparison
118                 data = {}
119 
120                 try:
121                     data = file_data[env] or {}
122                 except KeyError:
123                     if silent:
124                         continue
125                     raise
126 
127                 if not data:
128                     continue
129 
130                 if env != self.obj.get("DEFAULT_ENV_FOR_DYNACONF").lower():
131                     identifier = f"{self.identifier}_{env}"
132                 else:
133                     identifier = self.identifier
134 
135                 self._set_data_to_obj(data, identifier, file_merge, key)
136 
137     def _set_data_to_obj(
138         self, data, identifier, file_merge=None, key=False,
139     ):
140         """Calls setttings.set to add the keys"""
141 
142         # data 1st level keys should be transformed to upper case.
143         data = {upperfy(k): v for k, v in data.items()}
144         if key:
145             key = upperfy(key)
146 
147         # is there a `dynaconf_merge` inside an `[env]`?
148         file_merge = file_merge or data.pop("DYNACONF_MERGE", False)
149 
150         if not key:
151             self.obj.update(
152                 data, loader_identifier=identifier, merge=file_merge,
153             )
154         elif key in data:
155             self.obj.set(
156                 key,
157                 data.get(key),
158                 loader_identifier=identifier,
159                 merge=file_merge,
160             )
161
```

Path: `example/issues/379_dict_like_iteration/app.py`
Content:
```
1 from dynaconf import Dynaconf
2 
3 settings = Dynaconf(settings_files=["settings.toml"],)
4 
5 assert settings.key == "value"
6 assert settings.number == 789
7 assert settings.a_dict.nested.other_level == "nested value"
8 assert settings["a_boolean"] is False
9 assert settings.get("DONTEXIST", default=1) == 1
10 
11 
12 for item in settings:
13     print(item)
14 
15 
16 for key, value in settings.items():  # dict like iteration
17     print(key, value)
18
```

Path: `example/issues/519_underscore_in_name/app.py`
Content:
```
1 import os
2 
3 from dynaconf import Dynaconf
4 
5 config = Dynaconf(settings_files=["settings.yml"], envvar_prefix="ATC",)
6 
7 # envvar set is case insensitive
8 # ATC_BLE__DEVICE_ID=x and ATC_BLE__device_id=x are the same
9 expected = os.environ.get("EXPECTED_VALUE", 0)
10 
11 # access is case insensitive
12 assert config.ble.device_id == int(expected)
13 assert config.BLE.DEVICE_ID == int(expected)
14
```
--- 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/dynaconf/loaders/base.py b/dynaconf/loaders/base.py
--- a/dynaconf/loaders/base.py
+++ b/dynaconf/loaders/base.py
@@ -135,7 +135,11 @@
                 self._set_data_to_obj(data, identifier, file_merge, key)
 
     def _set_data_to_obj(
-        self, data, identifier, file_merge=None, key=False,
+        self,
+        data,
+        identifier,
+        file_merge=None,
+        key=False,
     ):
         """Calls setttings.set to add the keys"""
 
@@ -149,7 +153,9 @@
 
         if not key:
             self.obj.update(
-                data, loader_identifier=identifier, merge=file_merge,
+                data,
+                loader_identifier=identifier,
+                merge=file_merge,
             )
         elif key in data:
             self.obj.set(
diff --git a/example/issues/379_dict_like_iteration/app.py b/example/issues/379_dict_like_iteration/app.py
--- a/example/issues/379_dict_like_iteration/app.py
+++ b/example/issues/379_dict_like_iteration/app.py
@@ -1,6 +1,8 @@
 from dynaconf import Dynaconf
 
-settings = Dynaconf(settings_files=["settings.toml"],)
+settings = Dynaconf(
+    settings_files=["settings.toml"],
+)
 
 assert settings.key == "value"
 assert settings.number == 789
diff --git a/example/issues/519_underscore_in_name/app.py b/example/issues/519_underscore_in_name/app.py
--- a/example/issues/519_underscore_in_name/app.py
+++ b/example/issues/519_underscore_in_name/app.py
@@ -2,7 +2,10 @@
 
 from dynaconf import Dynaconf
 
-config = Dynaconf(settings_files=["settings.yml"], envvar_prefix="ATC",)
+config = Dynaconf(
+    settings_files=["settings.yml"],
+    envvar_prefix="ATC",
+)
 
 # envvar set is case insensitive
 # ATC_BLE__DEVICE_ID=x and ATC_BLE__device_id=x are the same

{"golden_diff": "diff --git a/dynaconf/loaders/base.py b/dynaconf/loaders/base.py\n--- a/dynaconf/loaders/base.py\n+++ b/dynaconf/loaders/base.py\n@@ -135,7 +135,11 @@\n                 self._set_data_to_obj(data, identifier, file_merge, key)\n \n     def _set_data_to_obj(\n-        self, data, identifier, file_merge=None, key=False,\n+        self,\n+        data,\n+        identifier,\n+        file_merge=None,\n+        key=False,\n     ):\n         \"\"\"Calls setttings.set to add the keys\"\"\"\n \n@@ -149,7 +153,9 @@\n \n         if not key:\n             self.obj.update(\n-                data, loader_identifier=identifier, merge=file_merge,\n+                data,\n+                loader_identifier=identifier,\n+                merge=file_merge,\n             )\n         elif key in data:\n             self.obj.set(\ndiff --git a/example/issues/379_dict_like_iteration/app.py b/example/issues/379_dict_like_iteration/app.py\n--- a/example/issues/379_dict_like_iteration/app.py\n+++ b/example/issues/379_dict_like_iteration/app.py\n@@ -1,6 +1,8 @@\n from dynaconf import Dynaconf\n \n-settings = Dynaconf(settings_files=[\"settings.toml\"],)\n+settings = Dynaconf(\n+    settings_files=[\"settings.toml\"],\n+)\n \n assert settings.key == \"value\"\n assert settings.number == 789\ndiff --git a/example/issues/519_underscore_in_name/app.py b/example/issues/519_underscore_in_name/app.py\n--- a/example/issues/519_underscore_in_name/app.py\n+++ b/example/issues/519_underscore_in_name/app.py\n@@ -2,7 +2,10 @@\n \n from dynaconf import Dynaconf\n \n-config = Dynaconf(settings_files=[\"settings.yml\"], envvar_prefix=\"ATC\",)\n+config = Dynaconf(\n+    settings_files=[\"settings.yml\"],\n+    envvar_prefix=\"ATC\",\n+)\n \n # envvar set is case insensitive\n # ATC_BLE__DEVICE_ID=x and ATC_BLE__device_id=x are the same\n", "issue": "The venv folder is not being excluded from pre-commit hooks\nHello! At first, I would like to thank you for the library.\r\n\r\nI follow the [CONTRIBUTING.md guide](https://github.com/rochacbruno/dynaconf/blob/master/CONTRIBUTING.md) and run the `make all` command to check if everything was right before I see the code. When I do that the **reorder-python-imports** hook failed because of some reorders that he made in some files in the `venv` folder:\r\n\r\n```bash\r\n...\r\nReordering imports in venv/lib/python3.7/site-packages/pynvim/msgpack_rpc/msgpack_stream.py\r\nReordering imports in venv/lib/python3.7/site-packages/tqdm/contrib/itertools.py\r\nReordering imports in venv/lib/python3.7/site-packages/coverage/execfile.py\r\nReordering imports in venv/lib/python3.7/site-packages/pyflakes/test/test_undefined_names.py\r\nReordering imports in venv/lib/python3.7/site-packages/nltk/test/unit/test_tgrep.py\r\nReordering imports in venv/lib/python3.7/site-packages/future/moves/test/__init__.py\r\nReordering imports in venv/lib/python3.7/site-packages/pynvim/api/common.py\r\nReordering imports in venv/lib/python3.7/site-packages/nltk/parse/recursivedescent.py\r\nReordering imports in venv/lib/python3.7/site-packages/django/contrib/admin/templatetags/base.py\r\nReordering imports in venv/lib/python3.7/site-packages/jeepney/tests/test_bus.py\r\nReordering imports in venv/lib/python3.7/site-packages/pip/_vendor/cachecontrol/serialize.py\r\nReordering imports in venv/lib/python3.7/site-packages/sphinx/transforms/post_transforms/__init__.py\r\nReordering imports in venv/bin/rst2latex.py\r\nReordering imports in venv/lib/python3.7/site-packages/cryptography/hazmat/primitives/ciphers/modes.py\r\nReordering imports in venv/lib/python3.7/site-packages/setuptools/_distutils/ccompiler.py\r\nReordering imports in venv/lib/python3.7/site-packages/botocore/vendored/requests/packages/__init__.py\r\n...\r\n```\r\n\r\nBesides, the **black** hook was taking too much time to finish and I think that this happened because he was reformating the files in the `venv` folder. Is that an expected behavior? Am I doing something wrong or missing some configuration?\n", "before_files": [{"content": "import io\nimport warnings\n\nfrom dynaconf.utils import build_env_list\nfrom dynaconf.utils import ensure_a_list\nfrom dynaconf.utils import upperfy\n\n\nclass BaseLoader:\n    \"\"\"Base loader for dynaconf source files.\n\n    :param obj: {[LazySettings]} -- [Dynaconf settings]\n    :param env: {[string]} -- [the current env to be loaded defaults to\n      [development]]\n    :param identifier: {[string]} -- [identifier ini, yaml, json, py, toml]\n    :param extensions: {[list]} -- [List of extensions with dots ['.a', '.b']]\n    :param file_reader: {[callable]} -- [reads file return dict]\n    :param string_reader: {[callable]} -- [reads string return dict]\n    \"\"\"\n\n    def __init__(\n        self, obj, env, identifier, extensions, file_reader, string_reader\n    ):\n        \"\"\"Instantiates a loader for different sources\"\"\"\n        self.obj = obj\n        self.env = env or obj.current_env\n        self.identifier = identifier\n        self.extensions = extensions\n        self.file_reader = file_reader\n        self.string_reader = string_reader\n\n    @staticmethod\n    def warn_not_installed(obj, identifier):  # pragma: no cover\n        if identifier not in obj._not_installed_warnings:\n            warnings.warn(\n                f\"{identifier} support is not installed in your environment. \"\n                f\"`pip install dynaconf[{identifier}]`\"\n            )\n        obj._not_installed_warnings.append(identifier)\n\n    def load(self, filename=None, key=None, silent=True):\n        \"\"\"\n        Reads and loads in to `self.obj` a single key or all keys from source\n\n        :param filename: Optional filename to load\n        :param key: if provided load a single key\n        :param silent: if load erros should be silenced\n        \"\"\"\n        filename = filename or self.obj.get(self.identifier.upper())\n        if not filename:\n            return\n\n        if not isinstance(filename, (list, tuple)):\n            split_files = ensure_a_list(filename)\n            if all([f.endswith(self.extensions) for f in split_files]):  # noqa\n                files = split_files  # it is a ['file.ext', ...]\n            else:  # it is a single config as string\n                files = [filename]\n        else:  # it is already a list/tuple\n            files = filename\n\n        source_data = self.get_source_data(files)\n\n        if self.obj.get(\"ENVIRONMENTS_FOR_DYNACONF\") is False:\n            self._envless_load(source_data, silent, key)\n        else:\n            self._load_all_envs(source_data, silent, key)\n\n    def get_source_data(self, files):\n        \"\"\"Reads each file and returns source data for each file\n        {\"path/to/file.ext\": {\"key\": \"value\"}}\n        \"\"\"\n        data = {}\n        for source_file in files:\n            if source_file.endswith(self.extensions):\n                try:\n                    with io.open(\n                        source_file,\n                        encoding=self.obj.get(\n                            \"ENCODING_FOR_DYNACONF\", \"utf-8\"\n                        ),\n                    ) as open_file:\n                        content = self.file_reader(open_file)\n                        self.obj._loaded_files.append(source_file)\n                        if content:\n                            data[source_file] = content\n                except IOError as e:\n                    if \".local.\" not in source_file:\n                        warnings.warn(\n                            f\"{self.identifier}_loader: {source_file} \"\n                            f\":{str(e)}\"\n                        )\n            else:\n                # for tests it is possible to pass string\n                content = self.string_reader(source_file)\n                if content:\n                    data[source_file] = content\n        return data\n\n    def _envless_load(self, source_data, silent=True, key=None):\n        \"\"\"Load all the keys from each file without env separation\"\"\"\n        for file_data in source_data.values():\n            self._set_data_to_obj(file_data, self.identifier, key=key)\n\n    def _load_all_envs(self, source_data, silent=True, key=None):\n        \"\"\"Load configs from files separating by each environment\"\"\"\n\n        for file_data in source_data.values():\n\n            # env name is checked in lower\n            file_data = {k.lower(): value for k, value in file_data.items()}\n\n            # is there a `dynaconf_merge` on top level of file?\n            file_merge = file_data.get(\"dynaconf_merge\")\n\n            for env in build_env_list(self.obj, self.env):\n                env = env.lower()  # lower for better comparison\n                data = {}\n\n                try:\n                    data = file_data[env] or {}\n                except KeyError:\n                    if silent:\n                        continue\n                    raise\n\n                if not data:\n                    continue\n\n                if env != self.obj.get(\"DEFAULT_ENV_FOR_DYNACONF\").lower():\n                    identifier = f\"{self.identifier}_{env}\"\n                else:\n                    identifier = self.identifier\n\n                self._set_data_to_obj(data, identifier, file_merge, key)\n\n    def _set_data_to_obj(\n        self, data, identifier, file_merge=None, key=False,\n    ):\n        \"\"\"Calls setttings.set to add the keys\"\"\"\n\n        # data 1st level keys should be transformed to upper case.\n        data = {upperfy(k): v for k, v in data.items()}\n        if key:\n            key = upperfy(key)\n\n        # is there a `dynaconf_merge` inside an `[env]`?\n        file_merge = file_merge or data.pop(\"DYNACONF_MERGE\", False)\n\n        if not key:\n            self.obj.update(\n                data, loader_identifier=identifier, merge=file_merge,\n            )\n        elif key in data:\n            self.obj.set(\n                key,\n                data.get(key),\n                loader_identifier=identifier,\n                merge=file_merge,\n            )\n", "path": "dynaconf/loaders/base.py"}, {"content": "from dynaconf import Dynaconf\n\nsettings = Dynaconf(settings_files=[\"settings.toml\"],)\n\nassert settings.key == \"value\"\nassert settings.number == 789\nassert settings.a_dict.nested.other_level == \"nested value\"\nassert settings[\"a_boolean\"] is False\nassert settings.get(\"DONTEXIST\", default=1) == 1\n\n\nfor item in settings:\n    print(item)\n\n\nfor key, value in settings.items():  # dict like iteration\n    print(key, value)\n", "path": "example/issues/379_dict_like_iteration/app.py"}, {"content": "import os\n\nfrom dynaconf import Dynaconf\n\nconfig = Dynaconf(settings_files=[\"settings.yml\"], envvar_prefix=\"ATC\",)\n\n# envvar set is case insensitive\n# ATC_BLE__DEVICE_ID=x and ATC_BLE__device_id=x are the same\nexpected = os.environ.get(\"EXPECTED_VALUE\", 0)\n\n# access is case insensitive\nassert config.ble.device_id == int(expected)\nassert config.BLE.DEVICE_ID == int(expected)\n", "path": "example/issues/519_underscore_in_name/app.py"}], "after_files": [{"content": "import io\nimport warnings\n\nfrom dynaconf.utils import build_env_list\nfrom dynaconf.utils import ensure_a_list\nfrom dynaconf.utils import upperfy\n\n\nclass BaseLoader:\n    \"\"\"Base loader for dynaconf source files.\n\n    :param obj: {[LazySettings]} -- [Dynaconf settings]\n    :param env: {[string]} -- [the current env to be loaded defaults to\n      [development]]\n    :param identifier: {[string]} -- [identifier ini, yaml, json, py, toml]\n    :param extensions: {[list]} -- [List of extensions with dots ['.a', '.b']]\n    :param file_reader: {[callable]} -- [reads file return dict]\n    :param string_reader: {[callable]} -- [reads string return dict]\n    \"\"\"\n\n    def __init__(\n        self, obj, env, identifier, extensions, file_reader, string_reader\n    ):\n        \"\"\"Instantiates a loader for different sources\"\"\"\n        self.obj = obj\n        self.env = env or obj.current_env\n        self.identifier = identifier\n        self.extensions = extensions\n        self.file_reader = file_reader\n        self.string_reader = string_reader\n\n    @staticmethod\n    def warn_not_installed(obj, identifier):  # pragma: no cover\n        if identifier not in obj._not_installed_warnings:\n            warnings.warn(\n                f\"{identifier} support is not installed in your environment. \"\n                f\"`pip install dynaconf[{identifier}]`\"\n            )\n        obj._not_installed_warnings.append(identifier)\n\n    def load(self, filename=None, key=None, silent=True):\n        \"\"\"\n        Reads and loads in to `self.obj` a single key or all keys from source\n\n        :param filename: Optional filename to load\n        :param key: if provided load a single key\n        :param silent: if load erros should be silenced\n        \"\"\"\n        filename = filename or self.obj.get(self.identifier.upper())\n        if not filename:\n            return\n\n        if not isinstance(filename, (list, tuple)):\n            split_files = ensure_a_list(filename)\n            if all([f.endswith(self.extensions) for f in split_files]):  # noqa\n                files = split_files  # it is a ['file.ext', ...]\n            else:  # it is a single config as string\n                files = [filename]\n        else:  # it is already a list/tuple\n            files = filename\n\n        source_data = self.get_source_data(files)\n\n        if self.obj.get(\"ENVIRONMENTS_FOR_DYNACONF\") is False:\n            self._envless_load(source_data, silent, key)\n        else:\n            self._load_all_envs(source_data, silent, key)\n\n    def get_source_data(self, files):\n        \"\"\"Reads each file and returns source data for each file\n        {\"path/to/file.ext\": {\"key\": \"value\"}}\n        \"\"\"\n        data = {}\n        for source_file in files:\n            if source_file.endswith(self.extensions):\n                try:\n                    with io.open(\n                        source_file,\n                        encoding=self.obj.get(\n                            \"ENCODING_FOR_DYNACONF\", \"utf-8\"\n                        ),\n                    ) as open_file:\n                        content = self.file_reader(open_file)\n                        self.obj._loaded_files.append(source_file)\n                        if content:\n                            data[source_file] = content\n                except IOError as e:\n                    if \".local.\" not in source_file:\n                        warnings.warn(\n                            f\"{self.identifier}_loader: {source_file} \"\n                            f\":{str(e)}\"\n                        )\n            else:\n                # for tests it is possible to pass string\n                content = self.string_reader(source_file)\n                if content:\n                    data[source_file] = content\n        return data\n\n    def _envless_load(self, source_data, silent=True, key=None):\n        \"\"\"Load all the keys from each file without env separation\"\"\"\n        for file_data in source_data.values():\n            self._set_data_to_obj(file_data, self.identifier, key=key)\n\n    def _load_all_envs(self, source_data, silent=True, key=None):\n        \"\"\"Load configs from files separating by each environment\"\"\"\n\n        for file_data in source_data.values():\n\n            # env name is checked in lower\n            file_data = {k.lower(): value for k, value in file_data.items()}\n\n            # is there a `dynaconf_merge` on top level of file?\n            file_merge = file_data.get(\"dynaconf_merge\")\n\n            for env in build_env_list(self.obj, self.env):\n                env = env.lower()  # lower for better comparison\n                data = {}\n\n                try:\n                    data = file_data[env] or {}\n                except KeyError:\n                    if silent:\n                        continue\n                    raise\n\n                if not data:\n                    continue\n\n                if env != self.obj.get(\"DEFAULT_ENV_FOR_DYNACONF\").lower():\n                    identifier = f\"{self.identifier}_{env}\"\n                else:\n                    identifier = self.identifier\n\n                self._set_data_to_obj(data, identifier, file_merge, key)\n\n    def _set_data_to_obj(\n        self,\n        data,\n        identifier,\n        file_merge=None,\n        key=False,\n    ):\n        \"\"\"Calls setttings.set to add the keys\"\"\"\n\n        # data 1st level keys should be transformed to upper case.\n        data = {upperfy(k): v for k, v in data.items()}\n        if key:\n            key = upperfy(key)\n\n        # is there a `dynaconf_merge` inside an `[env]`?\n        file_merge = file_merge or data.pop(\"DYNACONF_MERGE\", False)\n\n        if not key:\n            self.obj.update(\n                data,\n                loader_identifier=identifier,\n                merge=file_merge,\n            )\n        elif key in data:\n            self.obj.set(\n                key,\n                data.get(key),\n                loader_identifier=identifier,\n                merge=file_merge,\n            )\n", "path": "dynaconf/loaders/base.py"}, {"content": "from dynaconf import Dynaconf\n\nsettings = Dynaconf(\n    settings_files=[\"settings.toml\"],\n)\n\nassert settings.key == \"value\"\nassert settings.number == 789\nassert settings.a_dict.nested.other_level == \"nested value\"\nassert settings[\"a_boolean\"] is False\nassert settings.get(\"DONTEXIST\", default=1) == 1\n\n\nfor item in settings:\n    print(item)\n\n\nfor key, value in settings.items():  # dict like iteration\n    print(key, value)\n", "path": "example/issues/379_dict_like_iteration/app.py"}, {"content": "import os\n\nfrom dynaconf import Dynaconf\n\nconfig = Dynaconf(\n    settings_files=[\"settings.yml\"],\n    envvar_prefix=\"ATC\",\n)\n\n# envvar set is case insensitive\n# ATC_BLE__DEVICE_ID=x and ATC_BLE__device_id=x are the same\nexpected = os.environ.get(\"EXPECTED_VALUE\", 0)\n\n# access is case insensitive\nassert config.ble.device_id == int(expected)\nassert config.BLE.DEVICE_ID == int(expected)\n", "path": "example/issues/519_underscore_in_name/app.py"}]}