code: def test_DataFilesDict_from_patterns_in_dataset_repository_hashing(
      hub_dataset_repo_path,
  ):
      patterns = {"train": ["**/train.txt"], "test": ["**/test.txt"]}
      data_files1 = DataFilesDict.from_patterns(
          patterns, hub_dataset_repo_path
      )
      data_files2 = DataFilesDict.from_patterns(
          patterns, hub_dataset_repo_path
      )
      assert Hasher.hash(data_files1) == Hasher.hash(data_files2)
  
      data_files2 = DataFilesDict(
          sorted(data_files1.items(), reverse=True)
      )
      assert Hasher.hash(data_files1) == Hasher.hash(data_files2)
  
      patterns2 = {
          "train": ["data/**train.txt"],
          "test": ["data/**test.txt"],
      }
      data_files2 = DataFilesDict.from_patterns(
          patterns2, hub_dataset_repo_path
      )
      assert Hasher.hash(data_files1) == Hasher.hash(data_files2)
  
      patterns2 = {
          "train": ["data/**train.txt"],
          "test": ["data/**train.txt"],
      }
      data_files2 = DataFilesDict.from_patterns(
          patterns2, hub_dataset_repo_path
      )
      assert Hasher.hash(data_files1) != Hasher.hash(data_files2)
  
      # the tmpfs used to mock the hub repo is based on a local directory
      # therefore os.stat is used to get the mtime of the data files
      with patch("os.stat", return_value=os.stat(__file__)):
          data_files2 = DataFilesDict.from_patterns(
              patterns, hub_dataset_repo_path
          )
          assert Hasher.hash(data_files1) != Hasher.hash(data_files2)
  
imports: import copy
  import os
  from pathlib import Path
  from typing import List
  from unittest.mock import patch
  import fsspec
  import pytest
  from fsspec.registry import _registry
  from fsspec.spec import AbstractFileSystem
  from datasets.data_files import DataFilesDict, DataFilesList, DataFilesPatternsDict, DataFilesPatternsList, _get_data_files_patterns, _get_metadata_files_patterns, _is_inside_unrequested_special_dir, _is_unrequested_hidden_file_or_is_inside_unrequested_hidden_dir, get_data_patterns, resolve_pattern
  from datasets.fingerprint import Hasher
label_desc: Use image node_id 39 for calling a global function with example usage: test_DataFilesDict_from_patterns_in_dataset_repository_hashing(hub_dataset_repo_path) without return types