code: def test_timedelta_index_ops_with_scalars(
      request, data, other_scalars, dtype, op
  ):
      gtdi = cudf.Index(data=data, dtype=dtype)
      ptdi = gtdi.to_pandas()
  
      if op == "add":
          expected = ptdi + other_scalars
          actual = gtdi + other_scalars
      elif op == "sub":
          expected = ptdi - other_scalars
          actual = gtdi - other_scalars
      elif op == "truediv":
          expected = ptdi / other_scalars
          actual = gtdi / other_scalars
      elif op == "floordiv":
          expected = ptdi // other_scalars
          actual = gtdi // other_scalars
  
      assert_eq(expected, actual)
  
      if op == "add":
          expected = other_scalars + ptdi
          actual = other_scalars + gtdi
      elif op == "sub":
          expected = other_scalars - ptdi
          actual = other_scalars - gtdi
      elif op == "truediv":
          expected = other_scalars / ptdi
          actual = other_scalars / gtdi
      elif op == "floordiv":
          expected = other_scalars // ptdi
          actual = other_scalars // gtdi
  
      # Division by zero for datetime or timedelta is
      # dubiously defined in both pandas (Any // 0 -> 0 in
      # pandas) and cuDF (undefined behaviour)
      request.applymarker(
          pytest.mark.xfail(
              condition=(
                  op == "floordiv"
                  and 0 in ptdi.astype("int")
                  and np.timedelta64(other_scalars).item() is not None
              ),
              reason="Related to https://github.com/rapidsai/cudf/issues/5938",
          )
      )
      assert_eq(expected, actual)
  
imports: import datetime
  import operator
  import cupy
  import numpy
  import pandas
  import pytest
  import cudf
  from cudf.testing import _utils
  from cudf.testing._utils import assert_eq, assert_exceptions_equal
label_desc: Use image node_id 20 for calling a global function with example usage: test_timedelta_index_ops_with_scalars(request, data, other_scalars, dtype, op) without return types