code: def test_filter(self):
      pdf = pd.DataFrame(
          {
              "aa": ["aa", "bd", "bc", "ab", "ce"],
              "ba": [1, 2, 3, 4, 5],
              "cb": [1.0, 2.0, 3.0, 4.0, 5.0],
              "db": [1.0, np.nan, 3.0, np.nan, 5.0],
          }
      )
      pdf = pdf.set_index("aa")
      psdf = ps.from_pandas(pdf)
  
      self.assert_eq(
          psdf.filter(items=["ab", "aa"], axis=0).sort_index(),
          pdf.filter(items=["ab", "aa"], axis=0).sort_index(),
      )
  
      with option_context("compute.isin_limit", 0):
          self.assert_eq(
              psdf.filter(items=["ab", "aa"], axis=0).sort_index(),
              pdf.filter(items=["ab", "aa"], axis=0).sort_index(),
          )
  
      self.assert_eq(
          psdf.filter(items=["ba", "db"], axis=1).sort_index(),
          pdf.filter(items=["ba", "db"], axis=1).sort_index(),
      )
  
      self.assert_eq(
          psdf.filter(like="b", axis="index"),
          pdf.filter(like="b", axis="index"),
      )
      self.assert_eq(
          psdf.filter(like="c", axis="columns"),
          pdf.filter(like="c", axis="columns"),
      )
  
      self.assert_eq(
          psdf.filter(regex="b.*", axis="index"),
          pdf.filter(regex="b.*", axis="index"),
      )
      self.assert_eq(
          psdf.filter(regex="b.*", axis="columns"),
          pdf.filter(regex="b.*", axis="columns"),
      )
  
      pdf = pdf.set_index("ba", append=True)
      psdf = ps.from_pandas(pdf)
  
      self.assert_eq(
          psdf.filter(
              items=[("aa", 1), ("bd", 2)], axis=0
          ).sort_index(),
          pdf.filter(items=[("aa", 1), ("bd", 2)], axis=0).sort_index(),
      )
  
      with self.assertRaisesRegex(TypeError, "Unsupported type list"):
          psdf.filter(items=[["aa", 1], ("bd", 2)], axis=0)
  
      with self.assertRaisesRegex(
          ValueError, "The item should not be empty."
      ):
          psdf.filter(items=[(), ("bd", 2)], axis=0)
  
      self.assert_eq(
          psdf.filter(like="b", axis=0), pdf.filter(like="b", axis=0)
      )
  
      self.assert_eq(
          psdf.filter(regex="b.*", axis=0),
          pdf.filter(regex="b.*", axis=0),
      )
  
      with self.assertRaisesRegex(
          ValueError, "items should be a list-like object"
      ):
          psdf.filter(items="b")
  
      with self.assertRaisesRegex(ValueError, "No axis named"):
          psdf.filter(regex="b.*", axis=123)
  
      with self.assertRaisesRegex(
          TypeError, "Must pass either `items`, `like`"
      ):
          psdf.filter()
  
      with self.assertRaisesRegex(TypeError, "mutually exclusive"):
          psdf.filter(regex="b.*", like="aaa")
  
      # multi-index columns
      pdf = pd.DataFrame(
          {
              ("x", "aa"): ["aa", "ab", "bc", "bd", "ce"],
              ("x", "ba"): [1, 2, 3, 4, 5],
              ("y", "cb"): [1.0, 2.0, 3.0, 4.0, 5.0],
              ("z", "db"): [1.0, np.nan, 3.0, np.nan, 5.0],
          }
      )
      pdf = pdf.set_index(("x", "aa"))
      psdf = ps.from_pandas(pdf)
  
      self.assert_eq(
          psdf.filter(items=["ab", "aa"], axis=0).sort_index(),
          pdf.filter(items=["ab", "aa"], axis=0).sort_index(),
      )
      self.assert_eq(
          psdf.filter(
              items=[("x", "ba"), ("z", "db")], axis=1
          ).sort_index(),
          pdf.filter(
              items=[("x", "ba"), ("z", "db")], axis=1
          ).sort_index(),
      )
  
      self.assert_eq(
          psdf.filter(like="b", axis="index"),
          pdf.filter(like="b", axis="index"),
      )
      self.assert_eq(
          psdf.filter(like="c", axis="columns"),
          pdf.filter(like="c", axis="columns"),
      )
  
      self.assert_eq(
          psdf.filter(regex="b.*", axis="index"),
          pdf.filter(regex="b.*", axis="index"),
      )
      self.assert_eq(
          psdf.filter(regex="b.*", axis="columns"),
          pdf.filter(regex="b.*", axis="columns"),
      )
  
imports: import unittest
  import numpy
  import pandas
  from pandas.tseries.offsets import DateOffset
  from pyspark import pandas
  from pyspark.errors import PySparkValueError
  from pyspark.pandas.config import option_context
  from pyspark.testing.pandasutils import ComparisonTestBase
  from pyspark.testing.sqlutils import SQLTestUtils
label_desc: Use image node_id 9 for calling the FrameReindexingMixin obj's underlying member method code with example usage: obj.test_filter() without return types