code: def url2filename(url):
      """generate file/directory name from a URL"""
  
      # TODO: Not really important for now, but there should be a more
      #       sophisticated approach to replace. May be just everything that
      #       isn't alphanumeric? Or simply hash the URL?
      #       URL: Will include version eventually. Would need parsing to hash
      #       w/o any parameters. Having separate clones per requested version
      #       would defy point of cache, particularly wrt downloading content.
      #       Depends on usecase, of course, but immediate one is about container
      #       images -> not cheap.
      # make it a Path, too, so pathlib can raise if we are creating an invalid
      # path on some system we run the tests on.
      return Path(
          url.lower()
          .replace("/", "_")
          .replace(":", "_")
          .replace("?", "_")
      )
  
file_path: datalad/datalad/tests/utils_cached_dataset.py
imports: from datalad import cfg
  from datalad.core.distributed.clone import Clone
  from datalad.distribution.dataset import Dataset
  from datalad.support.annexrepo import AnnexRepo
  from datalad.tests.utils_pytest import DEFAULT_REMOTE, with_tempfile
  from datalad.utils import Path, better_wraps, ensure_list, optional_args, rmtree
label_desc: Use image node_id 1 for calling a global function with example usage: url2filename(url) and returns: Path