code: def test_path_partition_parser_hive(fs, base_dir):
      partition_parser = PathPartitionParser.of(
          base_dir=base_dir, filesystem=fs
      )
      _verify_resolved_paths_and_filesystem(partition_parser.scheme)
      base_dir = partition_parser.scheme.normalized_base_dir
  
      # parse unpartitioned paths...
      partition_kvs = partition_parser("")
      assert partition_kvs == {}
      unpartitioned_paths = [
          "",
          "foo/1",
          "bar/2",
          "baz/3",
          posixpath.join(base_dir, "test.txt"),
          posixpath.join(base_dir, "foo/test.txt"),
          posixpath.join(base_dir, "foo/bar/qux=3"),
          posixpath.join(base_dir, "test=1.txt"),
      ]
      for path in unpartitioned_paths:
          assert partition_parser(path) == {}
  
      partitioned_path = posixpath.join(base_dir, "foo=1/test.txt")
      assert partition_parser(partitioned_path) == {"foo": "1"}
      partitioned_path = posixpath.join(base_dir, " foo = 1  /test.txt")
      assert partition_parser(partitioned_path) == {" foo ": " 1  "}
      partitioned_path = posixpath.join(base_dir, "foo/bar=2/test.txt")
      assert partition_parser(partitioned_path) == {"bar": "2"}
      partitioned_path = posixpath.join(base_dir, "bar=2/foo=1/test")
      assert partition_parser(partitioned_path) == {
          "foo": "1",
          "bar": "2",
      }
      partitioned_path = posixpath.join(base_dir, "foo/bar/qux=3/")
      assert partition_parser(partitioned_path) == {"qux": "3"}
  
      partition_parser = PathPartitionParser.of(
          base_dir=base_dir,
          field_names=["foo", "bar"],
          filesystem=fs,
      )
      partitioned_path = posixpath.join(base_dir, "foo=1/bar=2/test")
      assert partition_parser(partitioned_path) == {
          "foo": "1",
          "bar": "2",
      }
      partitioned_path = posixpath.join(
          base_dir, "prefix/foo=1/padding/bar=2/test"
      )
      assert partition_parser(partitioned_path) == {
          "foo": "1",
          "bar": "2",
      }
  
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 11 for calling a global function with example usage: test_path_partition_parser_hive(fs, base_dir) without return types