We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Image is not supported as a dependency
Version: `0.22.0+f9b30a`

I ran this command:
```
dvc run -d 2018-12-12-13:32:56.png -o derp 'echo derp > derp'
```

Where the dependency is:
```
2018-12-12-13:32:56.png: PNG image data, 1228 x 494, 8-bit/color RGBA, non-interlaced
```

And I got this:
```
Error: Failed to run command: Dependency '2018-12-12-13:32:56.png' is not supported
```

Is this intended? Why we aren't supporting images as dependencies?

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `dvc/output/__init__.py`
Content:
```
1 import schema
2 
3 from dvc.exceptions import DvcException
4 from dvc.config import Config
5 
6 from dvc.dependency import SCHEMA, urlparse
7 from dvc.dependency.base import DependencyBase
8 from dvc.output.s3 import OutputS3
9 from dvc.output.gs import OutputGS
10 from dvc.output.local import OutputLOCAL
11 from dvc.output.hdfs import OutputHDFS
12 from dvc.output.ssh import OutputSSH
13 
14 from dvc.remote import Remote
15 
16 
17 OUTS = [OutputHDFS, OutputS3, OutputGS, OutputSSH, OutputLOCAL]
18 
19 OUTS_MAP = {'hdfs': OutputHDFS,
20             's3': OutputS3,
21             'gs': OutputGS,
22             'ssh': OutputSSH,
23             '': OutputLOCAL}
24 
25 SCHEMA[schema.Optional(OutputLOCAL.PARAM_CACHE)] = bool
26 SCHEMA[schema.Optional(OutputLOCAL.PARAM_METRIC)] = OutputLOCAL.METRIC_SCHEMA
27 
28 
29 def _get(stage, p, info, cache, metric):
30     parsed = urlparse(p)
31     if parsed.scheme == 'remote':
32         name = Config.SECTION_REMOTE_FMT.format(parsed.netloc)
33         sect = stage.project.config._config[name]
34         remote = Remote(stage.project, sect)
35         return OUTS_MAP[remote.scheme](stage,
36                                        p,
37                                        info,
38                                        cache=cache,
39                                        remote=remote,
40                                        metric=metric)
41 
42     for o in OUTS:
43         if o.supported(p):
44             return o(stage, p, info, cache=cache, remote=None, metric=metric)
45     raise DvcException('Output \'{}\' is not supported'.format(p))
46 
47 
48 def loadd_from(stage, d_list):
49     ret = []
50     for d in d_list:
51         p = d.pop(DependencyBase.PARAM_PATH)
52         cache = d.pop(OutputLOCAL.PARAM_CACHE, True)
53         metric = d.pop(OutputLOCAL.PARAM_METRIC, False)
54         ret.append(_get(stage, p, info=d, cache=cache, metric=metric))
55     return ret
56 
57 
58 def loads_from(stage, s_list, use_cache=True, metric=False):
59     ret = []
60     for s in s_list:
61         ret.append(_get(stage, s, info={}, cache=use_cache, metric=metric))
62     return ret
63
```

Path: `dvc/dependency/__init__.py`
Content:
```
1 import schema
2 
3 try:
4     from urlparse import urlparse
5 except ImportError:
6     from urllib.parse import urlparse
7 
8 from dvc.exceptions import DvcException
9 from dvc.config import Config
10 
11 from dvc.dependency.base import DependencyBase
12 from dvc.dependency.s3 import DependencyS3
13 from dvc.dependency.gs import DependencyGS
14 from dvc.dependency.local import DependencyLOCAL
15 from dvc.dependency.hdfs import DependencyHDFS
16 from dvc.dependency.ssh import DependencySSH
17 from dvc.dependency.http import DependencyHTTP
18 
19 from dvc.remote import Remote
20 from dvc.remote.local import RemoteLOCAL
21 from dvc.remote.s3 import RemoteS3
22 from dvc.remote.hdfs import RemoteHDFS
23 
24 DEPS = [
25     DependencyGS,
26     DependencyHDFS,
27     DependencyHTTP,
28     DependencyLOCAL,
29     DependencyS3,
30     DependencySSH,
31 ]
32 
33 DEP_MAP = {
34     '': DependencyLOCAL,
35     'ssh': DependencySSH,
36     's3': DependencyS3,
37     'gs': DependencyGS,
38     'hdfs': DependencyHDFS,
39     'http': DependencyHTTP,
40     'https': DependencyHTTP,
41 }
42 
43 # We are skipping RemoteHTTP.PARAM_ETAG because is the same as RemoteS3
44 SCHEMA = {
45     DependencyBase.PARAM_PATH: str,
46     schema.Optional(RemoteLOCAL.PARAM_MD5): schema.Or(str, None),
47     schema.Optional(RemoteS3.PARAM_ETAG): schema.Or(str, None),
48     schema.Optional(RemoteHDFS.PARAM_CHECKSUM): schema.Or(str, None),
49 }
50 
51 
52 def _get(stage, p, info):
53     parsed = urlparse(p)
54     if parsed.scheme == 'remote':
55         name = Config.SECTION_REMOTE_FMT.format(parsed.netloc)
56         sect = stage.project.config._config[name]
57         remote = Remote(stage.project, sect)
58         return DEP_MAP[remote.scheme](stage, p, info, remote=remote)
59 
60     for d in DEPS:
61         if d.supported(p):
62             return d(stage, p, info)
63     raise DvcException('Dependency \'{}\' is not supported'.format(p))
64 
65 
66 def loadd_from(stage, d_list):
67     ret = []
68     for d in d_list:
69         p = d.pop(DependencyBase.PARAM_PATH)
70         ret.append(_get(stage, p, d))
71     return ret
72 
73 
74 def loads_from(stage, s_list):
75     ret = []
76     for s in s_list:
77         ret.append(_get(stage, s, {}))
78     return ret
79
```

Path: `dvc/dependency/local.py`
Content:
```
1 import os
2 
3 try:
4     from urlparse import urlparse
5 except ImportError:
6     from urllib.parse import urlparse
7 
8 from dvc.dependency.base import DependencyBase
9 from dvc.dependency.base import DependencyDoesNotExistError
10 from dvc.dependency.base import DependencyIsNotFileOrDirError
11 from dvc.remote.local import RemoteLOCAL
12 
13 
14 class DependencyLOCAL(DependencyBase):
15     REGEX = r'^(?P<path>(/+|.:\\+)?[^:]*)$'
16 
17     DoesNotExistError = DependencyDoesNotExistError
18     IsNotFileOrDirError = DependencyIsNotFileOrDirError
19 
20     def __init__(self, stage, path, info=None, remote=None):
21         self.stage = stage
22         self.project = stage.project
23         self.info = info
24         if remote is not None:
25             self.remote = remote
26         else:
27             self.remote = RemoteLOCAL(stage.project, {})
28 
29         if remote:
30             path = os.path.join(remote.prefix, urlparse(path).path.lstrip('/'))
31 
32         if not os.path.isabs(path):
33             path = self.remote.ospath(path)
34             path = os.path.join(stage.cwd, path)
35         self.path = os.path.abspath(os.path.normpath(path))
36 
37         self.path_info = {'scheme': 'local',
38                           'path': self.path}
39 
40     def __str__(self):
41         return self.rel_path
42 
43     @property
44     def is_local(self):
45         assert os.path.isabs(self.path)
46         assert os.path.isabs(self.project.root_dir)
47         return self.path.startswith(self.project.root_dir)
48 
49     @property
50     def sep(self):
51         return os.sep
52 
53     @property
54     def rel_path(self):
55         return os.path.relpath(self.path)
56 
57     def changed(self):
58         if not self.exists:
59             return True
60 
61         info = self.remote.save_info(self.path_info)
62 
63         return self.info != info
64 
65     def save(self):
66         if not self.exists:
67             raise self.DoesNotExistError(self.rel_path)
68 
69         if not os.path.isfile(self.path) \
70            and not os.path.isdir(self.path):  # pragma: no cover
71             raise self.IsNotFileOrDirError(self.rel_path)
72 
73         if (os.path.isfile(self.path) and os.path.getsize(self.path) == 0) or \
74            (os.path.isdir(self.path) and len(os.listdir(self.path)) == 0):
75             msg = "File/directory '{}' is empty.".format(self.rel_path)
76             self.project.logger.warn(msg)
77 
78         self.info = self.remote.save_info(self.path_info)
79 
80     def dumpd(self):
81         if self.is_local:
82             path = self.remote.unixpath(os.path.relpath(self.path,
83                                                         self.stage.cwd))
84         else:
85             path = self.path
86 
87         info = self.info.copy()
88         info[self.PARAM_PATH] = path
89         return info
90
```
--- 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/dvc/dependency/__init__.py b/dvc/dependency/__init__.py
--- a/dvc/dependency/__init__.py
+++ b/dvc/dependency/__init__.py
@@ -5,7 +5,6 @@
 except ImportError:
     from urllib.parse import urlparse
 
-from dvc.exceptions import DvcException
 from dvc.config import Config
 
 from dvc.dependency.base import DependencyBase
@@ -25,9 +24,9 @@
     DependencyGS,
     DependencyHDFS,
     DependencyHTTP,
-    DependencyLOCAL,
     DependencyS3,
     DependencySSH,
+    # NOTE: DependencyLOCAL is the default choice
 ]
 
 DEP_MAP = {
@@ -60,7 +59,7 @@
     for d in DEPS:
         if d.supported(p):
             return d(stage, p, info)
-    raise DvcException('Dependency \'{}\' is not supported'.format(p))
+    return DependencyLOCAL(stage, p, info)
 
 
 def loadd_from(stage, d_list):
diff --git a/dvc/dependency/local.py b/dvc/dependency/local.py
--- a/dvc/dependency/local.py
+++ b/dvc/dependency/local.py
@@ -12,7 +12,7 @@
 
 
 class DependencyLOCAL(DependencyBase):
-    REGEX = r'^(?P<path>(/+|.:\\+)?[^:]*)$'
+    REGEX = r'^(?P<path>.*)$'
 
     DoesNotExistError = DependencyDoesNotExistError
     IsNotFileOrDirError = DependencyIsNotFileOrDirError
diff --git a/dvc/output/__init__.py b/dvc/output/__init__.py
--- a/dvc/output/__init__.py
+++ b/dvc/output/__init__.py
@@ -1,6 +1,5 @@
 import schema
 
-from dvc.exceptions import DvcException
 from dvc.config import Config
 
 from dvc.dependency import SCHEMA, urlparse
@@ -14,7 +13,13 @@
 from dvc.remote import Remote
 
 
-OUTS = [OutputHDFS, OutputS3, OutputGS, OutputSSH, OutputLOCAL]
+OUTS = [
+    OutputHDFS,
+    OutputS3,
+    OutputGS,
+    OutputSSH,
+    # NOTE: OutputLOCAL is the default choice
+]
 
 OUTS_MAP = {'hdfs': OutputHDFS,
             's3': OutputS3,
@@ -42,7 +47,7 @@
     for o in OUTS:
         if o.supported(p):
             return o(stage, p, info, cache=cache, remote=None, metric=metric)
-    raise DvcException('Output \'{}\' is not supported'.format(p))
+    return OutputLOCAL(stage, p, info, cache=cache, remote=None, metric=metric)
 
 
 def loadd_from(stage, d_list):

{"golden_diff": "diff --git a/dvc/dependency/__init__.py b/dvc/dependency/__init__.py\n--- a/dvc/dependency/__init__.py\n+++ b/dvc/dependency/__init__.py\n@@ -5,7 +5,6 @@\n except ImportError:\n     from urllib.parse import urlparse\n \n-from dvc.exceptions import DvcException\n from dvc.config import Config\n \n from dvc.dependency.base import DependencyBase\n@@ -25,9 +24,9 @@\n     DependencyGS,\n     DependencyHDFS,\n     DependencyHTTP,\n-    DependencyLOCAL,\n     DependencyS3,\n     DependencySSH,\n+    # NOTE: DependencyLOCAL is the default choice\n ]\n \n DEP_MAP = {\n@@ -60,7 +59,7 @@\n     for d in DEPS:\n         if d.supported(p):\n             return d(stage, p, info)\n-    raise DvcException('Dependency \\'{}\\' is not supported'.format(p))\n+    return DependencyLOCAL(stage, p, info)\n \n \n def loadd_from(stage, d_list):\ndiff --git a/dvc/dependency/local.py b/dvc/dependency/local.py\n--- a/dvc/dependency/local.py\n+++ b/dvc/dependency/local.py\n@@ -12,7 +12,7 @@\n \n \n class DependencyLOCAL(DependencyBase):\n-    REGEX = r'^(?P<path>(/+|.:\\\\+)?[^:]*)$'\n+    REGEX = r'^(?P<path>.*)$'\n \n     DoesNotExistError = DependencyDoesNotExistError\n     IsNotFileOrDirError = DependencyIsNotFileOrDirError\ndiff --git a/dvc/output/__init__.py b/dvc/output/__init__.py\n--- a/dvc/output/__init__.py\n+++ b/dvc/output/__init__.py\n@@ -1,6 +1,5 @@\n import schema\n \n-from dvc.exceptions import DvcException\n from dvc.config import Config\n \n from dvc.dependency import SCHEMA, urlparse\n@@ -14,7 +13,13 @@\n from dvc.remote import Remote\n \n \n-OUTS = [OutputHDFS, OutputS3, OutputGS, OutputSSH, OutputLOCAL]\n+OUTS = [\n+    OutputHDFS,\n+    OutputS3,\n+    OutputGS,\n+    OutputSSH,\n+    # NOTE: OutputLOCAL is the default choice\n+]\n \n OUTS_MAP = {'hdfs': OutputHDFS,\n             's3': OutputS3,\n@@ -42,7 +47,7 @@\n     for o in OUTS:\n         if o.supported(p):\n             return o(stage, p, info, cache=cache, remote=None, metric=metric)\n-    raise DvcException('Output \\'{}\\' is not supported'.format(p))\n+    return OutputLOCAL(stage, p, info, cache=cache, remote=None, metric=metric)\n \n \n def loadd_from(stage, d_list):\n", "issue": "Image is not supported as a dependency\nVersion: `0.22.0+f9b30a`\r\n\r\nI ran this command:\r\n```\r\ndvc run -d 2018-12-12-13:32:56.png -o derp 'echo derp > derp'\r\n```\r\n\r\nWhere the dependency is:\r\n```\r\n2018-12-12-13:32:56.png: PNG image data, 1228 x 494, 8-bit/color RGBA, non-interlaced\r\n```\r\n\r\nAnd I got this:\r\n```\r\nError: Failed to run command: Dependency '2018-12-12-13:32:56.png' is not supported\r\n```\r\n\r\nIs this intended? Why we aren't supporting images as dependencies?\n", "before_files": [{"content": "import schema\n\nfrom dvc.exceptions import DvcException\nfrom dvc.config import Config\n\nfrom dvc.dependency import SCHEMA, urlparse\nfrom dvc.dependency.base import DependencyBase\nfrom dvc.output.s3 import OutputS3\nfrom dvc.output.gs import OutputGS\nfrom dvc.output.local import OutputLOCAL\nfrom dvc.output.hdfs import OutputHDFS\nfrom dvc.output.ssh import OutputSSH\n\nfrom dvc.remote import Remote\n\n\nOUTS = [OutputHDFS, OutputS3, OutputGS, OutputSSH, OutputLOCAL]\n\nOUTS_MAP = {'hdfs': OutputHDFS,\n            's3': OutputS3,\n            'gs': OutputGS,\n            'ssh': OutputSSH,\n            '': OutputLOCAL}\n\nSCHEMA[schema.Optional(OutputLOCAL.PARAM_CACHE)] = bool\nSCHEMA[schema.Optional(OutputLOCAL.PARAM_METRIC)] = OutputLOCAL.METRIC_SCHEMA\n\n\ndef _get(stage, p, info, cache, metric):\n    parsed = urlparse(p)\n    if parsed.scheme == 'remote':\n        name = Config.SECTION_REMOTE_FMT.format(parsed.netloc)\n        sect = stage.project.config._config[name]\n        remote = Remote(stage.project, sect)\n        return OUTS_MAP[remote.scheme](stage,\n                                       p,\n                                       info,\n                                       cache=cache,\n                                       remote=remote,\n                                       metric=metric)\n\n    for o in OUTS:\n        if o.supported(p):\n            return o(stage, p, info, cache=cache, remote=None, metric=metric)\n    raise DvcException('Output \\'{}\\' is not supported'.format(p))\n\n\ndef loadd_from(stage, d_list):\n    ret = []\n    for d in d_list:\n        p = d.pop(DependencyBase.PARAM_PATH)\n        cache = d.pop(OutputLOCAL.PARAM_CACHE, True)\n        metric = d.pop(OutputLOCAL.PARAM_METRIC, False)\n        ret.append(_get(stage, p, info=d, cache=cache, metric=metric))\n    return ret\n\n\ndef loads_from(stage, s_list, use_cache=True, metric=False):\n    ret = []\n    for s in s_list:\n        ret.append(_get(stage, s, info={}, cache=use_cache, metric=metric))\n    return ret\n", "path": "dvc/output/__init__.py"}, {"content": "import schema\n\ntry:\n    from urlparse import urlparse\nexcept ImportError:\n    from urllib.parse import urlparse\n\nfrom dvc.exceptions import DvcException\nfrom dvc.config import Config\n\nfrom dvc.dependency.base import DependencyBase\nfrom dvc.dependency.s3 import DependencyS3\nfrom dvc.dependency.gs import DependencyGS\nfrom dvc.dependency.local import DependencyLOCAL\nfrom dvc.dependency.hdfs import DependencyHDFS\nfrom dvc.dependency.ssh import DependencySSH\nfrom dvc.dependency.http import DependencyHTTP\n\nfrom dvc.remote import Remote\nfrom dvc.remote.local import RemoteLOCAL\nfrom dvc.remote.s3 import RemoteS3\nfrom dvc.remote.hdfs import RemoteHDFS\n\nDEPS = [\n    DependencyGS,\n    DependencyHDFS,\n    DependencyHTTP,\n    DependencyLOCAL,\n    DependencyS3,\n    DependencySSH,\n]\n\nDEP_MAP = {\n    '': DependencyLOCAL,\n    'ssh': DependencySSH,\n    's3': DependencyS3,\n    'gs': DependencyGS,\n    'hdfs': DependencyHDFS,\n    'http': DependencyHTTP,\n    'https': DependencyHTTP,\n}\n\n# We are skipping RemoteHTTP.PARAM_ETAG because is the same as RemoteS3\nSCHEMA = {\n    DependencyBase.PARAM_PATH: str,\n    schema.Optional(RemoteLOCAL.PARAM_MD5): schema.Or(str, None),\n    schema.Optional(RemoteS3.PARAM_ETAG): schema.Or(str, None),\n    schema.Optional(RemoteHDFS.PARAM_CHECKSUM): schema.Or(str, None),\n}\n\n\ndef _get(stage, p, info):\n    parsed = urlparse(p)\n    if parsed.scheme == 'remote':\n        name = Config.SECTION_REMOTE_FMT.format(parsed.netloc)\n        sect = stage.project.config._config[name]\n        remote = Remote(stage.project, sect)\n        return DEP_MAP[remote.scheme](stage, p, info, remote=remote)\n\n    for d in DEPS:\n        if d.supported(p):\n            return d(stage, p, info)\n    raise DvcException('Dependency \\'{}\\' is not supported'.format(p))\n\n\ndef loadd_from(stage, d_list):\n    ret = []\n    for d in d_list:\n        p = d.pop(DependencyBase.PARAM_PATH)\n        ret.append(_get(stage, p, d))\n    return ret\n\n\ndef loads_from(stage, s_list):\n    ret = []\n    for s in s_list:\n        ret.append(_get(stage, s, {}))\n    return ret\n", "path": "dvc/dependency/__init__.py"}, {"content": "import os\n\ntry:\n    from urlparse import urlparse\nexcept ImportError:\n    from urllib.parse import urlparse\n\nfrom dvc.dependency.base import DependencyBase\nfrom dvc.dependency.base import DependencyDoesNotExistError\nfrom dvc.dependency.base import DependencyIsNotFileOrDirError\nfrom dvc.remote.local import RemoteLOCAL\n\n\nclass DependencyLOCAL(DependencyBase):\n    REGEX = r'^(?P<path>(/+|.:\\\\+)?[^:]*)$'\n\n    DoesNotExistError = DependencyDoesNotExistError\n    IsNotFileOrDirError = DependencyIsNotFileOrDirError\n\n    def __init__(self, stage, path, info=None, remote=None):\n        self.stage = stage\n        self.project = stage.project\n        self.info = info\n        if remote is not None:\n            self.remote = remote\n        else:\n            self.remote = RemoteLOCAL(stage.project, {})\n\n        if remote:\n            path = os.path.join(remote.prefix, urlparse(path).path.lstrip('/'))\n\n        if not os.path.isabs(path):\n            path = self.remote.ospath(path)\n            path = os.path.join(stage.cwd, path)\n        self.path = os.path.abspath(os.path.normpath(path))\n\n        self.path_info = {'scheme': 'local',\n                          'path': self.path}\n\n    def __str__(self):\n        return self.rel_path\n\n    @property\n    def is_local(self):\n        assert os.path.isabs(self.path)\n        assert os.path.isabs(self.project.root_dir)\n        return self.path.startswith(self.project.root_dir)\n\n    @property\n    def sep(self):\n        return os.sep\n\n    @property\n    def rel_path(self):\n        return os.path.relpath(self.path)\n\n    def changed(self):\n        if not self.exists:\n            return True\n\n        info = self.remote.save_info(self.path_info)\n\n        return self.info != info\n\n    def save(self):\n        if not self.exists:\n            raise self.DoesNotExistError(self.rel_path)\n\n        if not os.path.isfile(self.path) \\\n           and not os.path.isdir(self.path):  # pragma: no cover\n            raise self.IsNotFileOrDirError(self.rel_path)\n\n        if (os.path.isfile(self.path) and os.path.getsize(self.path) == 0) or \\\n           (os.path.isdir(self.path) and len(os.listdir(self.path)) == 0):\n            msg = \"File/directory '{}' is empty.\".format(self.rel_path)\n            self.project.logger.warn(msg)\n\n        self.info = self.remote.save_info(self.path_info)\n\n    def dumpd(self):\n        if self.is_local:\n            path = self.remote.unixpath(os.path.relpath(self.path,\n                                                        self.stage.cwd))\n        else:\n            path = self.path\n\n        info = self.info.copy()\n        info[self.PARAM_PATH] = path\n        return info\n", "path": "dvc/dependency/local.py"}], "after_files": [{"content": "import schema\n\nfrom dvc.config import Config\n\nfrom dvc.dependency import SCHEMA, urlparse\nfrom dvc.dependency.base import DependencyBase\nfrom dvc.output.s3 import OutputS3\nfrom dvc.output.gs import OutputGS\nfrom dvc.output.local import OutputLOCAL\nfrom dvc.output.hdfs import OutputHDFS\nfrom dvc.output.ssh import OutputSSH\n\nfrom dvc.remote import Remote\n\n\nOUTS = [\n    OutputHDFS,\n    OutputS3,\n    OutputGS,\n    OutputSSH,\n    # NOTE: OutputLOCAL is the default choice\n]\n\nOUTS_MAP = {'hdfs': OutputHDFS,\n            's3': OutputS3,\n            'gs': OutputGS,\n            'ssh': OutputSSH,\n            '': OutputLOCAL}\n\nSCHEMA[schema.Optional(OutputLOCAL.PARAM_CACHE)] = bool\nSCHEMA[schema.Optional(OutputLOCAL.PARAM_METRIC)] = OutputLOCAL.METRIC_SCHEMA\n\n\ndef _get(stage, p, info, cache, metric):\n    parsed = urlparse(p)\n    if parsed.scheme == 'remote':\n        name = Config.SECTION_REMOTE_FMT.format(parsed.netloc)\n        sect = stage.project.config._config[name]\n        remote = Remote(stage.project, sect)\n        return OUTS_MAP[remote.scheme](stage,\n                                       p,\n                                       info,\n                                       cache=cache,\n                                       remote=remote,\n                                       metric=metric)\n\n    for o in OUTS:\n        if o.supported(p):\n            return o(stage, p, info, cache=cache, remote=None, metric=metric)\n    return OutputLOCAL(stage, p, info, cache=cache, remote=None, metric=metric)\n\n\ndef loadd_from(stage, d_list):\n    ret = []\n    for d in d_list:\n        p = d.pop(DependencyBase.PARAM_PATH)\n        cache = d.pop(OutputLOCAL.PARAM_CACHE, True)\n        metric = d.pop(OutputLOCAL.PARAM_METRIC, False)\n        ret.append(_get(stage, p, info=d, cache=cache, metric=metric))\n    return ret\n\n\ndef loads_from(stage, s_list, use_cache=True, metric=False):\n    ret = []\n    for s in s_list:\n        ret.append(_get(stage, s, info={}, cache=use_cache, metric=metric))\n    return ret\n", "path": "dvc/output/__init__.py"}, {"content": "import schema\n\ntry:\n    from urlparse import urlparse\nexcept ImportError:\n    from urllib.parse import urlparse\n\nfrom dvc.config import Config\n\nfrom dvc.dependency.base import DependencyBase\nfrom dvc.dependency.s3 import DependencyS3\nfrom dvc.dependency.gs import DependencyGS\nfrom dvc.dependency.local import DependencyLOCAL\nfrom dvc.dependency.hdfs import DependencyHDFS\nfrom dvc.dependency.ssh import DependencySSH\nfrom dvc.dependency.http import DependencyHTTP\n\nfrom dvc.remote import Remote\nfrom dvc.remote.local import RemoteLOCAL\nfrom dvc.remote.s3 import RemoteS3\nfrom dvc.remote.hdfs import RemoteHDFS\n\nDEPS = [\n    DependencyGS,\n    DependencyHDFS,\n    DependencyHTTP,\n    DependencyS3,\n    DependencySSH,\n    # NOTE: DependencyLOCAL is the default choice\n]\n\nDEP_MAP = {\n    '': DependencyLOCAL,\n    'ssh': DependencySSH,\n    's3': DependencyS3,\n    'gs': DependencyGS,\n    'hdfs': DependencyHDFS,\n    'http': DependencyHTTP,\n    'https': DependencyHTTP,\n}\n\n# We are skipping RemoteHTTP.PARAM_ETAG because is the same as RemoteS3\nSCHEMA = {\n    DependencyBase.PARAM_PATH: str,\n    schema.Optional(RemoteLOCAL.PARAM_MD5): schema.Or(str, None),\n    schema.Optional(RemoteS3.PARAM_ETAG): schema.Or(str, None),\n    schema.Optional(RemoteHDFS.PARAM_CHECKSUM): schema.Or(str, None),\n}\n\n\ndef _get(stage, p, info):\n    parsed = urlparse(p)\n    if parsed.scheme == 'remote':\n        name = Config.SECTION_REMOTE_FMT.format(parsed.netloc)\n        sect = stage.project.config._config[name]\n        remote = Remote(stage.project, sect)\n        return DEP_MAP[remote.scheme](stage, p, info, remote=remote)\n\n    for d in DEPS:\n        if d.supported(p):\n            return d(stage, p, info)\n    return DependencyLOCAL(stage, p, info)\n\n\ndef loadd_from(stage, d_list):\n    ret = []\n    for d in d_list:\n        p = d.pop(DependencyBase.PARAM_PATH)\n        ret.append(_get(stage, p, d))\n    return ret\n\n\ndef loads_from(stage, s_list):\n    ret = []\n    for s in s_list:\n        ret.append(_get(stage, s, {}))\n    return ret\n", "path": "dvc/dependency/__init__.py"}, {"content": "import os\n\ntry:\n    from urlparse import urlparse\nexcept ImportError:\n    from urllib.parse import urlparse\n\nfrom dvc.dependency.base import DependencyBase\nfrom dvc.dependency.base import DependencyDoesNotExistError\nfrom dvc.dependency.base import DependencyIsNotFileOrDirError\nfrom dvc.remote.local import RemoteLOCAL\n\n\nclass DependencyLOCAL(DependencyBase):\n    REGEX = r'^(?P<path>.*)$'\n\n    DoesNotExistError = DependencyDoesNotExistError\n    IsNotFileOrDirError = DependencyIsNotFileOrDirError\n\n    def __init__(self, stage, path, info=None, remote=None):\n        self.stage = stage\n        self.project = stage.project\n        self.info = info\n        if remote is not None:\n            self.remote = remote\n        else:\n            self.remote = RemoteLOCAL(stage.project, {})\n\n        if remote:\n            path = os.path.join(remote.prefix, urlparse(path).path.lstrip('/'))\n\n        if not os.path.isabs(path):\n            path = self.remote.ospath(path)\n            path = os.path.join(stage.cwd, path)\n        self.path = os.path.abspath(os.path.normpath(path))\n\n        self.path_info = {'scheme': 'local',\n                          'path': self.path}\n\n    def __str__(self):\n        return self.rel_path\n\n    @property\n    def is_local(self):\n        assert os.path.isabs(self.path)\n        assert os.path.isabs(self.project.root_dir)\n        return self.path.startswith(self.project.root_dir)\n\n    @property\n    def sep(self):\n        return os.sep\n\n    @property\n    def rel_path(self):\n        return os.path.relpath(self.path)\n\n    def changed(self):\n        if not self.exists:\n            return True\n\n        info = self.remote.save_info(self.path_info)\n\n        return self.info != info\n\n    def save(self):\n        if not self.exists:\n            raise self.DoesNotExistError(self.rel_path)\n\n        if not os.path.isfile(self.path) \\\n           and not os.path.isdir(self.path):  # pragma: no cover\n            raise self.IsNotFileOrDirError(self.rel_path)\n\n        if (os.path.isfile(self.path) and os.path.getsize(self.path) == 0) or \\\n           (os.path.isdir(self.path) and len(os.listdir(self.path)) == 0):\n            msg = \"File/directory '{}' is empty.\".format(self.rel_path)\n            self.project.logger.warn(msg)\n\n        self.info = self.remote.save_info(self.path_info)\n\n    def dumpd(self):\n        if self.is_local:\n            path = self.remote.unixpath(os.path.relpath(self.path,\n                                                        self.stage.cwd))\n        else:\n            path = self.path\n\n        info = self.info.copy()\n        info[self.PARAM_PATH] = path\n        return info\n", "path": "dvc/dependency/local.py"}]}