code: def test_partition_to_dataframe(any_string_dtype, method, exp):
      # https://github.com/pandas-dev/pandas/issues/23558
  
      s = Series(
          ["a_b_c", "c_d_e", np.nan, "f_g_h", None],
          dtype=any_string_dtype,
      )
      result = getattr(s.str, method)("_")
      expected = DataFrame(
          exp,
          dtype=any_string_dtype,
      )
      tm.assert_frame_equal(result, expected)
  
imports: from datetime import datetime
  import re
  import numpy
  import pytest
  import pandas
  from pandas import DataFrame, Index, MultiIndex, Series, _testing
  from pandas.tests.strings import _convert_na_value, object_pyarrow_numpy
label_desc: Use image node_id 37 for calling a global function with example usage: test_partition_to_dataframe(any_string_dtype, method, exp) without return types