initial commit

This commit is contained in:
2025-08-19 09:13:22 -07:00
parent 28464811d6
commit 0977a3e14d
820 changed files with 1003358 additions and 2 deletions

19
mne/utils/fetching.py Normal file
View File

@@ -0,0 +1,19 @@
"""File downloading functions."""
# Authors: The MNE-Python contributors.
# License: BSD-3-Clause
# Copyright the MNE-Python contributors.
import os
def _url_to_local_path(url, path):
"""Mirror a url path in a local destination (keeping folder structure)."""
from urllib import parse, request
destination = parse.urlparse(url).path
# First char should be '/', and it needs to be discarded
if len(destination) < 2 or destination[0] != "/":
raise ValueError("Invalid URL")
destination = os.path.join(path, request.url2pathname(destination)[1:])
return destination