code: def test_path_partition_filter_hive(fs, base_dir):
      pass_through = PathPartitionFilter.of(
          None, base_dir=base_dir, filesystem=fs
      )
      _verify_resolved_paths_and_filesystem(pass_through.parser.scheme)
      paths = pass_through([])
      assert paths == []
      paths = pass_through(["foo/1", "bar/2", "baz/3"])
      assert paths == ["foo/1", "bar/2", "baz/3"]
  
      filter_unpartitioned = PathPartitionFilter.of(
          base_dir=base_dir,
          filesystem=fs,
          filter_fn=lambda d: bool(d),
      )
      _verify_resolved_paths_and_filesystem(
          filter_unpartitioned.parser.scheme
      )
      base_dir = filter_unpartitioned.parser.scheme.normalized_base_dir
      test_paths = [
          posixpath.join(base_dir, "test.txt"),
          posixpath.join(base_dir, "foo/test.txt"),
          posixpath.join(base_dir, "foo=1/test.txt"),
          posixpath.join(base_dir, "foo/bar=2/test.txt"),
          posixpath.join(base_dir, "foo=1/bar=2/test"),
          posixpath.join(base_dir, "foo/bar/qux=3/"),
          posixpath.join(base_dir, "foo/bar/qux=3"),
          posixpath.join(base_dir, "test=1.txt"),
      ]
      if base_dir:
          test_paths.extend(["test.txt", "foo=1/test.txt"])
      paths = filter_unpartitioned(test_paths)
      assert paths == [
          posixpath.join(base_dir, "foo=1/test.txt"),
          posixpath.join(base_dir, "foo/bar=2/test.txt"),
          posixpath.join(base_dir, "foo=1/bar=2/test"),
          posixpath.join(base_dir, "foo/bar/qux=3/"),
      ]
  
      filter_values = PathPartitionFilter.of(
          base_dir=base_dir,
          filesystem=fs,
          filter_fn=lambda d: d
          and (
              d.get("qux") == "3"
              or (d.get("foo") == "1" and d.get("bar") == "2")
          ),
      )
      _verify_resolved_paths_and_filesystem(filter_values.parser.scheme)
      paths = filter_values(test_paths)
      assert paths == [
          posixpath.join(base_dir, "foo=1/bar=2/test"),
          posixpath.join(base_dir, "foo/bar/qux=3/"),
      ]
  
      filter_field_name_values = PathPartitionFilter.of(
          base_dir=base_dir,
          field_names=["foo", "bar"],
          filesystem=fs,
          filter_fn=lambda d: d
          and d.get("foo") == "1"
          and d.get("bar") == "2",
      )
      test_paths = [
          posixpath.join(base_dir, "foo=1/bar=2/test"),
          posixpath.join(base_dir, "prefix/foo=1/padding/bar=2/test"),
      ]
      paths = filter_field_name_values(test_paths)
      assert paths == test_paths
  
imports: import json
  import os
  import posixpath
  from typing import Any, Callable, Dict, Iterator, List, Optional, Union
  import pandas
  import pyarrow
  import pyarrow
  import pytest
  from pyarrow.fs import FileType
  from pytest_lazyfixture import lazy_fixture
  import ray
  from ray.data.block import Block
  from ray.data.dataset import Dataset
  from ray.data.datasource import FileBasedDatasource, PathPartitionParser
  from ray.data.datasource.file_based_datasource import FileExtensionFilter, _resolve_paths_and_filesystem
  from ray.data.datasource.partitioning import Partitioning, PartitionStyle, PathPartitionFilter
  from ray.data.tests.conftest import *
  from ray.tests.conftest import *
label_desc: Use image node_id 13 for calling a global function with example usage: test_path_partition_filter_hive(fs, base_dir) without return types