@@ -0,0 +1,701 @@
+# Copyright (c) Facebook, Inc. and its affiliates.%0A%0Aimport os%0Aimport unittest%0Afrom functools import partial%0Afrom iopath.common.file_io import LazyPath%0A%0Afrom detectron2.data.build import DatasetFromList%0A%0A%0Adef _a_slow_func(x):%0A    return %22path/%7B%7D%22.format(x)%0A%0A%0Aclass TestDatasetFromList(unittest.TestCase):%0A    def test_using_lazy_path(self):%0A        dataset = %5B%5D%0A        for i in range(10):%0A            dataset.append(%7B%22file_name%22: LazyPath(partial(_a_slow_func, i))%7D)%0A%0A        dataset = DatasetFromList(dataset)%0A        for i in range(10):%0A            path = dataset%5Bi%5D%5B%22file_name%22%5D%0A            self.assertTrue(isinstance(path, LazyPath))%0A            self.assertEqual(os.fspath(path), _a_slow_func(i))%0A

support pickle for LazyPath