prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  YAML.load without a loader is deprecated for security purposes
  We've started seeing the following warning:
  ```
  lib/python3.6/site-packages/dynaconf/loaders/base.py:95: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  ```
  
  See here: https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation
  
  </issue>
  <code>
  [start of dynaconf/loaders/yaml_loader.py]
  1 # coding: utf-8
  2 import io
  3 from pathlib import Path
  4 from dynaconf import default_settings
  5 from dynaconf.loaders.base import BaseLoader
  6 from dynaconf.constants import YAML_EXTENSIONS
  7 from dynaconf.utils import object_merge
  8 try:
  9     import yaml
  10 except ImportError as e:  # pragma: no cover
  11     yaml = None
  12 
  13 
  14 def load(obj, env=None, silent=True, key=None, filename=None):
  15     """
  16     Reads and loads in to "obj" a single key or all keys from source file.
  17 
  18     :param obj: the settings instance
  19     :param env: settings current env default='development'
  20     :param silent: if errors should raise
  21     :param key: if defined load a single key, else load all in env
  22     :param filename: Optional custom filename to load
  23     :return: None
  24     """
  25     if yaml is None:  # pragma: no cover
  26         BaseLoader.warn_not_installed(obj, 'yaml')
  27         return
  28 
  29     loader = BaseLoader(
  30         obj=obj,
  31         env=env,
  32         identifier='yaml',
  33         extensions=YAML_EXTENSIONS,
  34         file_reader=yaml.load,
  35         string_reader=yaml.load
  36     )
  37     loader.load(filename=filename, key=key, silent=silent)
  38 
  39 
  40 def write(settings_path, settings_data, merge=True):
  41     """Write data to a settings file.
  42 
  43     :param settings_path: the filepath
  44     :param settings_data: a dictionary with data
  45     :param merge: boolean if existing file should be merged with new data
  46     """
  47     settings_path = Path(settings_path)
  48     if settings_path.exists() and merge:  # pragma: no cover
  49         object_merge(
  50             yaml.load(
  51                 io.open(
  52                     str(settings_path),
  53                     encoding=default_settings.ENCODING_FOR_DYNACONF
  54                 )
  55             ),
  56             settings_data
  57         )
  58 
  59     yaml.dump(
  60         settings_data,
  61         io.open(
  62             str(settings_path), 'w',
  63             encoding=default_settings.ENCODING_FOR_DYNACONF
  64         )
  65     )
  66
  [end of dynaconf/loaders/yaml_loader.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/dynaconf/loaders/yaml_loader.py b/dynaconf/loaders/yaml_loader.py
  --- a/dynaconf/loaders/yaml_loader.py
  +++ b/dynaconf/loaders/yaml_loader.py
  @@ -1,10 +1,13 @@
   # coding: utf-8
   import io
  +import os
   from pathlib import Path
  +from warnings import warn
   from dynaconf import default_settings
   from dynaconf.loaders.base import BaseLoader
   from dynaconf.constants import YAML_EXTENSIONS
   from dynaconf.utils import object_merge
  +
   try:
       import yaml
   except ImportError as e:  # pragma: no cover
  @@ -26,13 +29,25 @@
           BaseLoader.warn_not_installed(obj, 'yaml')
           return
   
  +    # Resolve the loaders
  +    # https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation
  +    # Possible values are `safe_load, full_load, unsafe_load, load`
  +    yaml_loader_name = os.environ.get('YAML_LOADER_FOR_DYNACONF', 'full_load')
  +    yaml_reader = getattr(yaml, yaml_loader_name, yaml.load)
  +    if yaml_reader.__name__ == 'unsafe_load':  # pragma: no cover
  +        warn(
  +            "yaml.unsafe_load is deprecated."
  +            " Please read https://msg.pyyaml.org/load for full details."
  +            " Try to use full_load or safe_load."
  +        )
  +
       loader = BaseLoader(
           obj=obj,
           env=env,
           identifier='yaml',
           extensions=YAML_EXTENSIONS,
  -        file_reader=yaml.load,
  -        string_reader=yaml.load
  +        file_reader=yaml_reader,
  +        string_reader=yaml_reader
       )
       loader.load(filename=filename, key=key, silent=silent)
  
verification_info: {"golden_diff": "diff --git a/dynaconf/loaders/yaml_loader.py b/dynaconf/loaders/yaml_loader.py\n--- a/dynaconf/loaders/yaml_loader.py\n+++ b/dynaconf/loaders/yaml_loader.py\n@@ -1,10 +1,13 @@\n # coding: utf-8\n import io\n+import os\n from pathlib import Path\n+from warnings import warn\n from dynaconf import default_settings\n from dynaconf.loaders.base import BaseLoader\n from dynaconf.constants import YAML_EXTENSIONS\n from dynaconf.utils import object_merge\n+\n try:\n     import yaml\n except ImportError as e:  # pragma: no cover\n@@ -26,13 +29,25 @@\n         BaseLoader.warn_not_installed(obj, 'yaml')\n         return\n \n+    # Resolve the loaders\n+    # https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation\n+    # Possible values are `safe_load, full_load, unsafe_load, load`\n+    yaml_loader_name = os.environ.get('YAML_LOADER_FOR_DYNACONF', 'full_load')\n+    yaml_reader = getattr(yaml, yaml_loader_name, yaml.load)\n+    if yaml_reader.__name__ == 'unsafe_load':  # pragma: no cover\n+        warn(\n+            \"yaml.unsafe_load is deprecated.\"\n+            \" Please read https://msg.pyyaml.org/load for full details.\"\n+            \" Try to use full_load or safe_load.\"\n+        )\n+\n     loader = BaseLoader(\n         obj=obj,\n         env=env,\n         identifier='yaml',\n         extensions=YAML_EXTENSIONS,\n-        file_reader=yaml.load,\n-        string_reader=yaml.load\n+        file_reader=yaml_reader,\n+        string_reader=yaml_reader\n     )\n     loader.load(filename=filename, key=key, silent=silent)\n", "issue": "YAML.load without a loader is deprecated for security purposes\nWe've started seeing the following warning:\r\n```\r\nlib/python3.6/site-packages/dynaconf/loaders/base.py:95: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.\r\n```\r\n\r\nSee here: https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation\n", "before_files": [{"content": "# coding: utf-8\nimport io\nfrom pathlib import Path\nfrom dynaconf import default_settings\nfrom dynaconf.loaders.base import BaseLoader\nfrom dynaconf.constants import YAML_EXTENSIONS\nfrom dynaconf.utils import object_merge\ntry:\n    import yaml\nexcept ImportError as e:  # pragma: no cover\n    yaml = None\n\n\ndef load(obj, env=None, silent=True, key=None, filename=None):\n    \"\"\"\n    Reads and loads in to \"obj\" a single key or all keys from source file.\n\n    :param obj: the settings instance\n    :param env: settings current env default='development'\n    :param silent: if errors should raise\n    :param key: if defined load a single key, else load all in env\n    :param filename: Optional custom filename to load\n    :return: None\n    \"\"\"\n    if yaml is None:  # pragma: no cover\n        BaseLoader.warn_not_installed(obj, 'yaml')\n        return\n\n    loader = BaseLoader(\n        obj=obj,\n        env=env,\n        identifier='yaml',\n        extensions=YAML_EXTENSIONS,\n        file_reader=yaml.load,\n        string_reader=yaml.load\n    )\n    loader.load(filename=filename, key=key, silent=silent)\n\n\ndef write(settings_path, settings_data, merge=True):\n    \"\"\"Write data to a settings file.\n\n    :param settings_path: the filepath\n    :param settings_data: a dictionary with data\n    :param merge: boolean if existing file should be merged with new data\n    \"\"\"\n    settings_path = Path(settings_path)\n    if settings_path.exists() and merge:  # pragma: no cover\n        object_merge(\n            yaml.load(\n                io.open(\n                    str(settings_path),\n                    encoding=default_settings.ENCODING_FOR_DYNACONF\n                )\n            ),\n            settings_data\n        )\n\n    yaml.dump(\n        settings_data,\n        io.open(\n            str(settings_path), 'w',\n            encoding=default_settings.ENCODING_FOR_DYNACONF\n        )\n    )\n", "path": "dynaconf/loaders/yaml_loader.py"}]}