docstr: Run `filter_repo_objects` and check output against expected result.
docstr_tok: ["Run","`","filter_repo_objects","`","and","check","output","against","expected","result","."]
code: def _check(
      self,
      items: List[Any],
      expected_items: List[Any],
      allow_patterns: Optional[Union[List[str], str]] = None,
      ignore_patterns: Optional[Union[List[str], str]] = None,
      key: Optional[Callable[[Any], str]] = None,
  ) -> None:
      """Run `filter_repo_objects` and check output against expected result."""
      self.assertListEqual(
          list(
              filter_repo_objects(
                  items=items,
                  allow_patterns=allow_patterns,
                  ignore_patterns=ignore_patterns,
                  key=key,
              )
          ),
          expected_items,
      )
  
file_path: huggingface_hub/tests/test_utils_paths.py
imports: import unittest
  from dataclasses import dataclass
  from pathlib import Path
  from typing import Any, Callable, List, Optional, Union
  from huggingface_hub.utils import IGNORE_GIT_FOLDER_PATTERNS, filter_repo_objects
label_desc: Use image node_id 8 for calling the TestPathsUtils obj's underlying member method code with example usage: obj._check(items, expected_items, allow_patterns, ignore_patterns, key) without return types