We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
YAML fails reading files with tuples
Example file:

```
foo: !!python/tuple
- 1
- 2
- 3
```

Error:

```
ConstructorError: could not determine a constructor for the tag 'tag:yaml.org,2002:python/tuple'·
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `visidata/loaders/yaml.py`
Content:
```
1 from itertools import chain
2 
3 from visidata import VisiData, Progress, JsonSheet, vd
4 
5 
6 @VisiData.api
7 def open_yml(vd, p):
8     return YamlSheet(p.name, source=p)
9 
10 VisiData.open_yaml = VisiData.open_yml
11 
12 class YamlSheet(JsonSheet):
13     def iterload(self):
14         yaml = vd.importExternal('yaml', 'PyYAML')
15         with self.source.open_text() as fp:
16             documents = yaml.safe_load_all(fp)
17 
18             self.columns = []
19             self._knownKeys.clear()
20 
21             # Peek at the document stream to determine how to best DWIM.
22             #
23             # This code is a bit verbose because it avoids slurping the generator
24             # all at once into memory.
25             try:
26                 first = next(documents)
27             except StopIteration:
28                 # Empty file‽
29                 yield None
30                 return
31 
32             try:
33                 second = next(documents)
34             except StopIteration:
35                 if isinstance(first, list):
36                     # A file with a single YAML list: yield one row per list item.
37                     yield from Progress(first)
38                 else:
39                     # A file with a single YAML non-list value, e.g a dict.
40                     yield first
41             else:
42                 # A file containing multiple YAML documents: yield one row per document.
43                 yield from Progress(chain([first, second], documents), total=0)
44
```
--- 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/visidata/loaders/yaml.py b/visidata/loaders/yaml.py
--- a/visidata/loaders/yaml.py
+++ b/visidata/loaders/yaml.py
@@ -12,8 +12,18 @@
 class YamlSheet(JsonSheet):
     def iterload(self):
         yaml = vd.importExternal('yaml', 'PyYAML')
+
+        class PrettySafeLoader(yaml.SafeLoader):
+            def construct_python_tuple(self, node):
+                return tuple(self.construct_sequence(node))
+
+        PrettySafeLoader.add_constructor(
+            u'tag:yaml.org,2002:python/tuple',
+            PrettySafeLoader.construct_python_tuple
+        )
+
         with self.source.open_text() as fp:
-            documents = yaml.safe_load_all(fp)
+            documents = yaml.load_all(fp, PrettySafeLoader)
 
             self.columns = []
             self._knownKeys.clear()

{"golden_diff": "diff --git a/visidata/loaders/yaml.py b/visidata/loaders/yaml.py\n--- a/visidata/loaders/yaml.py\n+++ b/visidata/loaders/yaml.py\n@@ -12,8 +12,18 @@\n class YamlSheet(JsonSheet):\n     def iterload(self):\n         yaml = vd.importExternal('yaml', 'PyYAML')\n+\n+        class PrettySafeLoader(yaml.SafeLoader):\n+            def construct_python_tuple(self, node):\n+                return tuple(self.construct_sequence(node))\n+\n+        PrettySafeLoader.add_constructor(\n+            u'tag:yaml.org,2002:python/tuple',\n+            PrettySafeLoader.construct_python_tuple\n+        )\n+\n         with self.source.open_text() as fp:\n-            documents = yaml.safe_load_all(fp)\n+            documents = yaml.load_all(fp, PrettySafeLoader)\n \n             self.columns = []\n             self._knownKeys.clear()\n", "issue": "YAML fails reading files with tuples\nExample file:\r\n\r\n```\r\nfoo: !!python/tuple\r\n- 1\r\n- 2\r\n- 3\r\n```\r\n\r\nError:\r\n\r\n```\r\nConstructorError: could not determine a constructor for the tag 'tag:yaml.org,2002:python/tuple'\u00b7\r\n```\n", "before_files": [{"content": "from itertools import chain\n\nfrom visidata import VisiData, Progress, JsonSheet, vd\n\n\n@VisiData.api\ndef open_yml(vd, p):\n    return YamlSheet(p.name, source=p)\n\nVisiData.open_yaml = VisiData.open_yml\n\nclass YamlSheet(JsonSheet):\n    def iterload(self):\n        yaml = vd.importExternal('yaml', 'PyYAML')\n        with self.source.open_text() as fp:\n            documents = yaml.safe_load_all(fp)\n\n            self.columns = []\n            self._knownKeys.clear()\n\n            # Peek at the document stream to determine how to best DWIM.\n            #\n            # This code is a bit verbose because it avoids slurping the generator\n            # all at once into memory.\n            try:\n                first = next(documents)\n            except StopIteration:\n                # Empty file\u203d\n                yield None\n                return\n\n            try:\n                second = next(documents)\n            except StopIteration:\n                if isinstance(first, list):\n                    # A file with a single YAML list: yield one row per list item.\n                    yield from Progress(first)\n                else:\n                    # A file with a single YAML non-list value, e.g a dict.\n                    yield first\n            else:\n                # A file containing multiple YAML documents: yield one row per document.\n                yield from Progress(chain([first, second], documents), total=0)\n", "path": "visidata/loaders/yaml.py"}], "after_files": [{"content": "from itertools import chain\n\nfrom visidata import VisiData, Progress, JsonSheet, vd\n\n\n@VisiData.api\ndef open_yml(vd, p):\n    return YamlSheet(p.name, source=p)\n\nVisiData.open_yaml = VisiData.open_yml\n\nclass YamlSheet(JsonSheet):\n    def iterload(self):\n        yaml = vd.importExternal('yaml', 'PyYAML')\n\n        class PrettySafeLoader(yaml.SafeLoader):\n            def construct_python_tuple(self, node):\n                return tuple(self.construct_sequence(node))\n\n        PrettySafeLoader.add_constructor(\n            u'tag:yaml.org,2002:python/tuple',\n            PrettySafeLoader.construct_python_tuple\n        )\n\n        with self.source.open_text() as fp:\n            documents = yaml.load_all(fp, PrettySafeLoader)\n\n            self.columns = []\n            self._knownKeys.clear()\n\n            # Peek at the document stream to determine how to best DWIM.\n            #\n            # This code is a bit verbose because it avoids slurping the generator\n            # all at once into memory.\n            try:\n                first = next(documents)\n            except StopIteration:\n                # Empty file\u203d\n                yield None\n                return\n\n            try:\n                second = next(documents)\n            except StopIteration:\n                if isinstance(first, list):\n                    # A file with a single YAML list: yield one row per list item.\n                    yield from Progress(first)\n                else:\n                    # A file with a single YAML non-list value, e.g a dict.\n                    yield first\n            else:\n                # A file containing multiple YAML documents: yield one row per document.\n                yield from Progress(chain([first, second], documents), total=0)\n", "path": "visidata/loaders/yaml.py"}]}