We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Phototour dataset links are broken.
Hi there,
I was trying triplet code on the this fork https://github.com/edgarriba/examples
But dataset link are broken? @edgarriba can you prvoide updated links?

thanks,
Aytac

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `torchvision/datasets/phototour.py`
Content:
```
1 import os
2 import errno
3 import numpy as np
4 from PIL import Image
5 
6 import torch
7 import torch.utils.data as data
8 
9 from .utils import download_url, check_integrity
10 
11 
12 class PhotoTour(data.Dataset):
13     """`Learning Local Image Descriptors Data <http://phototour.cs.washington.edu/patches/default.htm>`_ Dataset.
14 
15 
16     Args:
17         root (string): Root directory where images are.
18         name (string): Name of the dataset to load.
19         transform (callable, optional): A function/transform that  takes in an PIL image
20             and returns a transformed version.
21         download (bool, optional): If true, downloads the dataset from the internet and
22             puts it in root directory. If dataset is already downloaded, it is not
23             downloaded again.
24 
25     """
26     urls = {
27         'notredame': [
28             'http://www.iis.ee.ic.ac.uk/~vbalnt/phototourism-patches/notredame.zip',
29             'notredame.zip',
30             '509eda8535847b8c0a90bbb210c83484'
31         ],
32         'yosemite': [
33             'http://www.iis.ee.ic.ac.uk/~vbalnt/phototourism-patches/yosemite.zip',
34             'yosemite.zip',
35             '533b2e8eb7ede31be40abc317b2fd4f0'
36         ],
37         'liberty': [
38             'http://www.iis.ee.ic.ac.uk/~vbalnt/phototourism-patches/liberty.zip',
39             'liberty.zip',
40             'fdd9152f138ea5ef2091746689176414'
41         ],
42     }
43     mean = {'notredame': 0.4854, 'yosemite': 0.4844, 'liberty': 0.4437}
44     std = {'notredame': 0.1864, 'yosemite': 0.1818, 'liberty': 0.2019}
45     lens = {'notredame': 468159, 'yosemite': 633587, 'liberty': 450092}
46 
47     image_ext = 'bmp'
48     info_file = 'info.txt'
49     matches_files = 'm50_100000_100000_0.txt'
50 
51     def __init__(self, root, name, train=True, transform=None, download=False):
52         self.root = os.path.expanduser(root)
53         self.name = name
54         self.data_dir = os.path.join(self.root, name)
55         self.data_down = os.path.join(self.root, '{}.zip'.format(name))
56         self.data_file = os.path.join(self.root, '{}.pt'.format(name))
57 
58         self.train = train
59         self.transform = transform
60 
61         self.mean = self.mean[name]
62         self.std = self.std[name]
63 
64         if download:
65             self.download()
66 
67         if not self._check_datafile_exists():
68             raise RuntimeError('Dataset not found.' +
69                                ' You can use download=True to download it')
70 
71         # load the serialized data
72         self.data, self.labels, self.matches = torch.load(self.data_file)
73 
74     def __getitem__(self, index):
75         """
76         Args:
77             index (int): Index
78 
79         Returns:
80             tuple: (data1, data2, matches)
81         """
82         if self.train:
83             data = self.data[index]
84             if self.transform is not None:
85                 data = self.transform(data)
86             return data
87         m = self.matches[index]
88         data1, data2 = self.data[m[0]], self.data[m[1]]
89         if self.transform is not None:
90             data1 = self.transform(data1)
91             data2 = self.transform(data2)
92         return data1, data2, m[2]
93 
94     def __len__(self):
95         if self.train:
96             return self.lens[self.name]
97         return len(self.matches)
98 
99     def _check_datafile_exists(self):
100         return os.path.exists(self.data_file)
101 
102     def _check_downloaded(self):
103         return os.path.exists(self.data_dir)
104 
105     def download(self):
106         if self._check_datafile_exists():
107             print('# Found cached data {}'.format(self.data_file))
108             return
109 
110         if not self._check_downloaded():
111             # download files
112             url = self.urls[self.name][0]
113             filename = self.urls[self.name][1]
114             md5 = self.urls[self.name][2]
115             fpath = os.path.join(self.root, filename)
116 
117             download_url(url, self.root, filename, md5)
118 
119             print('# Extracting data {}\n'.format(self.data_down))
120 
121             import zipfile
122             with zipfile.ZipFile(fpath, 'r') as z:
123                 z.extractall(self.data_dir)
124 
125             os.unlink(fpath)
126 
127         # process and save as torch files
128         print('# Caching data {}'.format(self.data_file))
129 
130         dataset = (
131             read_image_file(self.data_dir, self.image_ext, self.lens[self.name]),
132             read_info_file(self.data_dir, self.info_file),
133             read_matches_files(self.data_dir, self.matches_files)
134         )
135 
136         with open(self.data_file, 'wb') as f:
137             torch.save(dataset, f)
138 
139 
140 def read_image_file(data_dir, image_ext, n):
141     """Return a Tensor containing the patches
142     """
143     def PIL2array(_img):
144         """Convert PIL image type to numpy 2D array
145         """
146         return np.array(_img.getdata(), dtype=np.uint8).reshape(64, 64)
147 
148     def find_files(_data_dir, _image_ext):
149         """Return a list with the file names of the images containing the patches
150         """
151         files = []
152         # find those files with the specified extension
153         for file_dir in os.listdir(_data_dir):
154             if file_dir.endswith(_image_ext):
155                 files.append(os.path.join(_data_dir, file_dir))
156         return sorted(files)  # sort files in ascend order to keep relations
157 
158     patches = []
159     list_files = find_files(data_dir, image_ext)
160 
161     for fpath in list_files:
162         img = Image.open(fpath)
163         for y in range(0, 1024, 64):
164             for x in range(0, 1024, 64):
165                 patch = img.crop((x, y, x + 64, y + 64))
166                 patches.append(PIL2array(patch))
167     return torch.ByteTensor(np.array(patches[:n]))
168 
169 
170 def read_info_file(data_dir, info_file):
171     """Return a Tensor containing the list of labels
172        Read the file and keep only the ID of the 3D point.
173     """
174     labels = []
175     with open(os.path.join(data_dir, info_file), 'r') as f:
176         labels = [int(line.split()[0]) for line in f]
177     return torch.LongTensor(labels)
178 
179 
180 def read_matches_files(data_dir, matches_file):
181     """Return a Tensor containing the ground truth matches
182        Read the file and keep only 3D point ID.
183        Matches are represented with a 1, non matches with a 0.
184     """
185     matches = []
186     with open(os.path.join(data_dir, matches_file), 'r') as f:
187         for line in f:
188             l = line.split()
189             matches.append([int(l[0]), int(l[3]), int(l[1] == l[4])])
190     return torch.LongTensor(matches)
191
```
--- 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/torchvision/datasets/phototour.py b/torchvision/datasets/phototour.py
--- a/torchvision/datasets/phototour.py
+++ b/torchvision/datasets/phototour.py
@@ -25,17 +25,17 @@
     """
     urls = {
         'notredame': [
-            'http://www.iis.ee.ic.ac.uk/~vbalnt/phototourism-patches/notredame.zip',
+            'http://icvl.ee.ic.ac.uk/vbalnt/notredame.zip',
             'notredame.zip',
             '509eda8535847b8c0a90bbb210c83484'
         ],
         'yosemite': [
-            'http://www.iis.ee.ic.ac.uk/~vbalnt/phototourism-patches/yosemite.zip',
+            'http://icvl.ee.ic.ac.uk/vbalnt/yosemite.zip',
             'yosemite.zip',
             '533b2e8eb7ede31be40abc317b2fd4f0'
         ],
         'liberty': [
-            'http://www.iis.ee.ic.ac.uk/~vbalnt/phototourism-patches/liberty.zip',
+            'http://icvl.ee.ic.ac.uk/vbalnt/liberty.zip',
             'liberty.zip',
             'fdd9152f138ea5ef2091746689176414'
         ],

{"golden_diff": "diff --git a/torchvision/datasets/phototour.py b/torchvision/datasets/phototour.py\n--- a/torchvision/datasets/phototour.py\n+++ b/torchvision/datasets/phototour.py\n@@ -25,17 +25,17 @@\n     \"\"\"\n     urls = {\n         'notredame': [\n-            'http://www.iis.ee.ic.ac.uk/~vbalnt/phototourism-patches/notredame.zip',\n+            'http://icvl.ee.ic.ac.uk/vbalnt/notredame.zip',\n             'notredame.zip',\n             '509eda8535847b8c0a90bbb210c83484'\n         ],\n         'yosemite': [\n-            'http://www.iis.ee.ic.ac.uk/~vbalnt/phototourism-patches/yosemite.zip',\n+            'http://icvl.ee.ic.ac.uk/vbalnt/yosemite.zip',\n             'yosemite.zip',\n             '533b2e8eb7ede31be40abc317b2fd4f0'\n         ],\n         'liberty': [\n-            'http://www.iis.ee.ic.ac.uk/~vbalnt/phototourism-patches/liberty.zip',\n+            'http://icvl.ee.ic.ac.uk/vbalnt/liberty.zip',\n             'liberty.zip',\n             'fdd9152f138ea5ef2091746689176414'\n         ],\n", "issue": "Phototour dataset links are broken.\nHi there,\r\nI was trying triplet code on the this fork https://github.com/edgarriba/examples\r\nBut dataset link are broken? @edgarriba can you prvoide updated links?\r\n\r\nthanks,\r\nAytac\n", "before_files": [{"content": "import os\nimport errno\nimport numpy as np\nfrom PIL import Image\n\nimport torch\nimport torch.utils.data as data\n\nfrom .utils import download_url, check_integrity\n\n\nclass PhotoTour(data.Dataset):\n    \"\"\"`Learning Local Image Descriptors Data <http://phototour.cs.washington.edu/patches/default.htm>`_ Dataset.\n\n\n    Args:\n        root (string): Root directory where images are.\n        name (string): Name of the dataset to load.\n        transform (callable, optional): A function/transform that  takes in an PIL image\n            and returns a transformed version.\n        download (bool, optional): If true, downloads the dataset from the internet and\n            puts it in root directory. If dataset is already downloaded, it is not\n            downloaded again.\n\n    \"\"\"\n    urls = {\n        'notredame': [\n            'http://www.iis.ee.ic.ac.uk/~vbalnt/phototourism-patches/notredame.zip',\n            'notredame.zip',\n            '509eda8535847b8c0a90bbb210c83484'\n        ],\n        'yosemite': [\n            'http://www.iis.ee.ic.ac.uk/~vbalnt/phototourism-patches/yosemite.zip',\n            'yosemite.zip',\n            '533b2e8eb7ede31be40abc317b2fd4f0'\n        ],\n        'liberty': [\n            'http://www.iis.ee.ic.ac.uk/~vbalnt/phototourism-patches/liberty.zip',\n            'liberty.zip',\n            'fdd9152f138ea5ef2091746689176414'\n        ],\n    }\n    mean = {'notredame': 0.4854, 'yosemite': 0.4844, 'liberty': 0.4437}\n    std = {'notredame': 0.1864, 'yosemite': 0.1818, 'liberty': 0.2019}\n    lens = {'notredame': 468159, 'yosemite': 633587, 'liberty': 450092}\n\n    image_ext = 'bmp'\n    info_file = 'info.txt'\n    matches_files = 'm50_100000_100000_0.txt'\n\n    def __init__(self, root, name, train=True, transform=None, download=False):\n        self.root = os.path.expanduser(root)\n        self.name = name\n        self.data_dir = os.path.join(self.root, name)\n        self.data_down = os.path.join(self.root, '{}.zip'.format(name))\n        self.data_file = os.path.join(self.root, '{}.pt'.format(name))\n\n        self.train = train\n        self.transform = transform\n\n        self.mean = self.mean[name]\n        self.std = self.std[name]\n\n        if download:\n            self.download()\n\n        if not self._check_datafile_exists():\n            raise RuntimeError('Dataset not found.' +\n                               ' You can use download=True to download it')\n\n        # load the serialized data\n        self.data, self.labels, self.matches = torch.load(self.data_file)\n\n    def __getitem__(self, index):\n        \"\"\"\n        Args:\n            index (int): Index\n\n        Returns:\n            tuple: (data1, data2, matches)\n        \"\"\"\n        if self.train:\n            data = self.data[index]\n            if self.transform is not None:\n                data = self.transform(data)\n            return data\n        m = self.matches[index]\n        data1, data2 = self.data[m[0]], self.data[m[1]]\n        if self.transform is not None:\n            data1 = self.transform(data1)\n            data2 = self.transform(data2)\n        return data1, data2, m[2]\n\n    def __len__(self):\n        if self.train:\n            return self.lens[self.name]\n        return len(self.matches)\n\n    def _check_datafile_exists(self):\n        return os.path.exists(self.data_file)\n\n    def _check_downloaded(self):\n        return os.path.exists(self.data_dir)\n\n    def download(self):\n        if self._check_datafile_exists():\n            print('# Found cached data {}'.format(self.data_file))\n            return\n\n        if not self._check_downloaded():\n            # download files\n            url = self.urls[self.name][0]\n            filename = self.urls[self.name][1]\n            md5 = self.urls[self.name][2]\n            fpath = os.path.join(self.root, filename)\n\n            download_url(url, self.root, filename, md5)\n\n            print('# Extracting data {}\\n'.format(self.data_down))\n\n            import zipfile\n            with zipfile.ZipFile(fpath, 'r') as z:\n                z.extractall(self.data_dir)\n\n            os.unlink(fpath)\n\n        # process and save as torch files\n        print('# Caching data {}'.format(self.data_file))\n\n        dataset = (\n            read_image_file(self.data_dir, self.image_ext, self.lens[self.name]),\n            read_info_file(self.data_dir, self.info_file),\n            read_matches_files(self.data_dir, self.matches_files)\n        )\n\n        with open(self.data_file, 'wb') as f:\n            torch.save(dataset, f)\n\n\ndef read_image_file(data_dir, image_ext, n):\n    \"\"\"Return a Tensor containing the patches\n    \"\"\"\n    def PIL2array(_img):\n        \"\"\"Convert PIL image type to numpy 2D array\n        \"\"\"\n        return np.array(_img.getdata(), dtype=np.uint8).reshape(64, 64)\n\n    def find_files(_data_dir, _image_ext):\n        \"\"\"Return a list with the file names of the images containing the patches\n        \"\"\"\n        files = []\n        # find those files with the specified extension\n        for file_dir in os.listdir(_data_dir):\n            if file_dir.endswith(_image_ext):\n                files.append(os.path.join(_data_dir, file_dir))\n        return sorted(files)  # sort files in ascend order to keep relations\n\n    patches = []\n    list_files = find_files(data_dir, image_ext)\n\n    for fpath in list_files:\n        img = Image.open(fpath)\n        for y in range(0, 1024, 64):\n            for x in range(0, 1024, 64):\n                patch = img.crop((x, y, x + 64, y + 64))\n                patches.append(PIL2array(patch))\n    return torch.ByteTensor(np.array(patches[:n]))\n\n\ndef read_info_file(data_dir, info_file):\n    \"\"\"Return a Tensor containing the list of labels\n       Read the file and keep only the ID of the 3D point.\n    \"\"\"\n    labels = []\n    with open(os.path.join(data_dir, info_file), 'r') as f:\n        labels = [int(line.split()[0]) for line in f]\n    return torch.LongTensor(labels)\n\n\ndef read_matches_files(data_dir, matches_file):\n    \"\"\"Return a Tensor containing the ground truth matches\n       Read the file and keep only 3D point ID.\n       Matches are represented with a 1, non matches with a 0.\n    \"\"\"\n    matches = []\n    with open(os.path.join(data_dir, matches_file), 'r') as f:\n        for line in f:\n            l = line.split()\n            matches.append([int(l[0]), int(l[3]), int(l[1] == l[4])])\n    return torch.LongTensor(matches)\n", "path": "torchvision/datasets/phototour.py"}], "after_files": [{"content": "import os\nimport errno\nimport numpy as np\nfrom PIL import Image\n\nimport torch\nimport torch.utils.data as data\n\nfrom .utils import download_url, check_integrity\n\n\nclass PhotoTour(data.Dataset):\n    \"\"\"`Learning Local Image Descriptors Data <http://phototour.cs.washington.edu/patches/default.htm>`_ Dataset.\n\n\n    Args:\n        root (string): Root directory where images are.\n        name (string): Name of the dataset to load.\n        transform (callable, optional): A function/transform that  takes in an PIL image\n            and returns a transformed version.\n        download (bool, optional): If true, downloads the dataset from the internet and\n            puts it in root directory. If dataset is already downloaded, it is not\n            downloaded again.\n\n    \"\"\"\n    urls = {\n        'notredame': [\n            'http://icvl.ee.ic.ac.uk/vbalnt/notredame.zip',\n            'notredame.zip',\n            '509eda8535847b8c0a90bbb210c83484'\n        ],\n        'yosemite': [\n            'http://icvl.ee.ic.ac.uk/vbalnt/yosemite.zip',\n            'yosemite.zip',\n            '533b2e8eb7ede31be40abc317b2fd4f0'\n        ],\n        'liberty': [\n            'http://icvl.ee.ic.ac.uk/vbalnt/liberty.zip',\n            'liberty.zip',\n            'fdd9152f138ea5ef2091746689176414'\n        ],\n    }\n    mean = {'notredame': 0.4854, 'yosemite': 0.4844, 'liberty': 0.4437}\n    std = {'notredame': 0.1864, 'yosemite': 0.1818, 'liberty': 0.2019}\n    lens = {'notredame': 468159, 'yosemite': 633587, 'liberty': 450092}\n\n    image_ext = 'bmp'\n    info_file = 'info.txt'\n    matches_files = 'm50_100000_100000_0.txt'\n\n    def __init__(self, root, name, train=True, transform=None, download=False):\n        self.root = os.path.expanduser(root)\n        self.name = name\n        self.data_dir = os.path.join(self.root, name)\n        self.data_down = os.path.join(self.root, '{}.zip'.format(name))\n        self.data_file = os.path.join(self.root, '{}.pt'.format(name))\n\n        self.train = train\n        self.transform = transform\n\n        self.mean = self.mean[name]\n        self.std = self.std[name]\n\n        if download:\n            self.download()\n\n        if not self._check_datafile_exists():\n            raise RuntimeError('Dataset not found.' +\n                               ' You can use download=True to download it')\n\n        # load the serialized data\n        self.data, self.labels, self.matches = torch.load(self.data_file)\n\n    def __getitem__(self, index):\n        \"\"\"\n        Args:\n            index (int): Index\n\n        Returns:\n            tuple: (data1, data2, matches)\n        \"\"\"\n        if self.train:\n            data = self.data[index]\n            if self.transform is not None:\n                data = self.transform(data)\n            return data\n        m = self.matches[index]\n        data1, data2 = self.data[m[0]], self.data[m[1]]\n        if self.transform is not None:\n            data1 = self.transform(data1)\n            data2 = self.transform(data2)\n        return data1, data2, m[2]\n\n    def __len__(self):\n        if self.train:\n            return self.lens[self.name]\n        return len(self.matches)\n\n    def _check_datafile_exists(self):\n        return os.path.exists(self.data_file)\n\n    def _check_downloaded(self):\n        return os.path.exists(self.data_dir)\n\n    def download(self):\n        if self._check_datafile_exists():\n            print('# Found cached data {}'.format(self.data_file))\n            return\n\n        if not self._check_downloaded():\n            # download files\n            url = self.urls[self.name][0]\n            filename = self.urls[self.name][1]\n            md5 = self.urls[self.name][2]\n            fpath = os.path.join(self.root, filename)\n\n            download_url(url, self.root, filename, md5)\n\n            print('# Extracting data {}\\n'.format(self.data_down))\n\n            import zipfile\n            with zipfile.ZipFile(fpath, 'r') as z:\n                z.extractall(self.data_dir)\n\n            os.unlink(fpath)\n\n        # process and save as torch files\n        print('# Caching data {}'.format(self.data_file))\n\n        dataset = (\n            read_image_file(self.data_dir, self.image_ext, self.lens[self.name]),\n            read_info_file(self.data_dir, self.info_file),\n            read_matches_files(self.data_dir, self.matches_files)\n        )\n\n        with open(self.data_file, 'wb') as f:\n            torch.save(dataset, f)\n\n\ndef read_image_file(data_dir, image_ext, n):\n    \"\"\"Return a Tensor containing the patches\n    \"\"\"\n    def PIL2array(_img):\n        \"\"\"Convert PIL image type to numpy 2D array\n        \"\"\"\n        return np.array(_img.getdata(), dtype=np.uint8).reshape(64, 64)\n\n    def find_files(_data_dir, _image_ext):\n        \"\"\"Return a list with the file names of the images containing the patches\n        \"\"\"\n        files = []\n        # find those files with the specified extension\n        for file_dir in os.listdir(_data_dir):\n            if file_dir.endswith(_image_ext):\n                files.append(os.path.join(_data_dir, file_dir))\n        return sorted(files)  # sort files in ascend order to keep relations\n\n    patches = []\n    list_files = find_files(data_dir, image_ext)\n\n    for fpath in list_files:\n        img = Image.open(fpath)\n        for y in range(0, 1024, 64):\n            for x in range(0, 1024, 64):\n                patch = img.crop((x, y, x + 64, y + 64))\n                patches.append(PIL2array(patch))\n    return torch.ByteTensor(np.array(patches[:n]))\n\n\ndef read_info_file(data_dir, info_file):\n    \"\"\"Return a Tensor containing the list of labels\n       Read the file and keep only the ID of the 3D point.\n    \"\"\"\n    labels = []\n    with open(os.path.join(data_dir, info_file), 'r') as f:\n        labels = [int(line.split()[0]) for line in f]\n    return torch.LongTensor(labels)\n\n\ndef read_matches_files(data_dir, matches_file):\n    \"\"\"Return a Tensor containing the ground truth matches\n       Read the file and keep only 3D point ID.\n       Matches are represented with a 1, non matches with a 0.\n    \"\"\"\n    matches = []\n    with open(os.path.join(data_dir, matches_file), 'r') as f:\n        for line in f:\n            l = line.split()\n            matches.append([int(l[0]), int(l[3]), int(l[1] == l[4])])\n    return torch.LongTensor(matches)\n", "path": "torchvision/datasets/phototour.py"}]}