code: def test_between_time(
      self, inclusive_endpoints_fixture, frame_or_series
  ):
      rng = date_range("1/1/2000", "1/5/2000", freq="5min")
      ts = DataFrame(
          np.random.default_rng(2).standard_normal((len(rng), 2)),
          index=rng,
      )
      ts = tm.get_obj(ts, frame_or_series)
  
      stime = time(0, 0)
      etime = time(1, 0)
      inclusive = inclusive_endpoints_fixture
  
      filtered = ts.between_time(stime, etime, inclusive=inclusive)
      exp_len = 13 * 4 + 1
  
      if inclusive in ["right", "neither"]:
          exp_len -= 5
      if inclusive in ["left", "neither"]:
          exp_len -= 4
  
      assert len(filtered) == exp_len
      for rs in filtered.index:
          t = rs.time()
          if inclusive in ["left", "both"]:
              assert t >= stime
          else:
              assert t > stime
  
          if inclusive in ["right", "both"]:
              assert t <= etime
          else:
              assert t < etime
  
      result = ts.between_time("00:00", "01:00")
      expected = ts.between_time(stime, etime)
      tm.assert_equal(result, expected)
  
      # across midnight
      rng = date_range("1/1/2000", "1/5/2000", freq="5min")
      ts = DataFrame(
          np.random.default_rng(2).standard_normal((len(rng), 2)),
          index=rng,
      )
      ts = tm.get_obj(ts, frame_or_series)
      stime = time(22, 0)
      etime = time(9, 0)
  
      filtered = ts.between_time(stime, etime, inclusive=inclusive)
      exp_len = (12 * 11 + 1) * 4 + 1
      if inclusive in ["right", "neither"]:
          exp_len -= 4
      if inclusive in ["left", "neither"]:
          exp_len -= 4
  
      assert len(filtered) == exp_len
      for rs in filtered.index:
          t = rs.time()
          if inclusive in ["left", "both"]:
              assert (t >= stime) or (t <= etime)
          else:
              assert (t > stime) or (t <= etime)
  
          if inclusive in ["right", "both"]:
              assert (t <= etime) or (t >= stime)
          else:
              assert (t < etime) or (t >= stime)
  
file_path: pandas/pandas/tests/frame/methods/test_between_time.py
imports: from datetime import datetime, time
  import numpy
  import pytest
  from pandas._libs.tslibs import timezones
  import pandas.util._test_decorators
  from pandas import DataFrame, Series, date_range
  import pandas._testing
label_desc: Use image node_id 4 for calling the TestBetweenTime obj's underlying member method code with example usage: obj.test_between_time(inclusive_endpoints_fixture, frame_or_series) without return types