code: def test_apply_scalar_on_date_time_index_aware_series(
      by_row, expected
  ):
      # GH 25959
      # Calling apply on a localized time series should not cause an error
      series = Series(
          np.arange(10, dtype=np.float64),
          index=date_range("2020-01-01", periods=10, tz="UTC"),
      )
      result = Series(series.index).apply(lambda x: 1, by_row=by_row)
      tm.assert_equal(result, expected)
  
imports: import numpy
  import pytest
  import pandas
  from pandas import DataFrame, Index, MultiIndex, Series, concat, date_range, timedelta_range
  import pandas._testing
  from pandas.tests.apply.common import series_transform_kernels
label_desc: Use image node_id 31 for calling a global function with example usage: test_apply_scalar_on_date_time_index_aware_series(by_row, expected) without return types