code: def test_basic_getitem_with_labels(datetime_series):
      indices = datetime_series.index[[5, 10, 15]]
  
      result = datetime_series[indices]
      expected = datetime_series.reindex(indices)
      tm.assert_series_equal(result, expected)
  
      result = datetime_series[indices[0] : indices[2]]
      expected = datetime_series.loc[indices[0] : indices[2]]
      tm.assert_series_equal(result, expected)
  
imports: from datetime import timedelta
  import re
  import numpy
  import pytest
  from pandas.errors import IndexingError
  from pandas import NA, DataFrame, Index, IndexSlice, MultiIndex, NaT, Series, Timedelta, Timestamp, concat, date_range, isna, period_range, timedelta_range
  import pandas._testing
label_desc: Use image node_id 4 for calling a global function with example usage: test_basic_getitem_with_labels(datetime_series) without return types