class_docstr: Dict of split_name -> list of data files (absolute local paths or URLs).
  It has two construction methods given the user's data files patterns :
  - ``from_hf_repo``: resolve patterns inside a dataset repository
  - ``from_local_or_remote``: resolve patterns from a local path
  
  Moreover each list is a DataFilesList. It is possible to hash the dictionary
  and get a different hash if and only if at least one file changed.
  For more info, see ``DataFilesList``.
  
  This is useful for caching Dataset objects that are obtained from a list of data files.
  
  Changing the order of the keys of this dictionary also doesn't change its hash.
class_docstr_tok: ["Dict","of","split_name","-",">","list","of","data","files","(","absolute","local","paths","or","URLs",")",".","It","has","two","construction","methods","given","the","user","'s","data","files","patterns",":","-","``","from_hf_repo","``",":","resolve","patterns","inside","a","dataset","repository","-","``","from_local_or_remote","``",":","resolve","patterns","from","a","local","path","Moreover","each","list","is","a","DataFilesList",".","It","is","possible","to","hash","the","dictionary","and","get","a","different","hash","if","and","only","if","at","least","one","file","changed",".","For","more","info",",","see","``","DataFilesList","``",".","This","is","useful","for","caching","Dataset","objects","that","are","obtained","from","a","list","of","data","files",".","Changing","the","order","of","the","keys","of","this","dictionary","also","does","n't","change","its","hash","."]
code: def from_patterns(
      cls,
      patterns: Dict[str, Union[List[str], DataFilesList]],
      base_path: Optional[str] = None,
      allowed_extensions: Optional[List[str]] = None,
      download_config: Optional[DownloadConfig] = None,
  ) -> "DataFilesDict":
      out = cls()
      for key, patterns_for_key in patterns.items():
          out[key] = (
              DataFilesList.from_patterns(
                  patterns_for_key,
                  base_path=base_path,
                  allowed_extensions=allowed_extensions,
                  download_config=download_config,
              )
              if not isinstance(patterns_for_key, DataFilesList)
              else patterns_for_key
          )
      return out
  
imports: import os
  import re
  from functools import partial
  from glob import has_magic
  from pathlib import Path, PurePath
  from typing import Callable, Dict, List, Optional, Set, Tuple, Union
  import huggingface_hub
  from fsspec import get_fs_token_paths
  from fsspec.implementations.http import HTTPFileSystem
  from huggingface_hub import HfFileSystem
  from packaging import version
  from tqdm.contrib.concurrent import thread_map
  from .None import config
  from .download import DownloadConfig
  from .download.streaming_download_manager import _prepare_path_and_storage_options, xbasename, xjoin
  from .splits import Split
  from .utils import logging
  from .utils import tqdm
  from .utils.file_utils import is_local_path, is_relative_path
  from .utils.py_utils import glob_pattern_to_regex, string_to_dict
label_desc: Use image node_id 3 for calling the DataFilesDict obj's underlying member method code with example usage: obj.from_patterns(cls, patterns, base_path, allowed_extensions, download_config) and returns: out