code: def check_series_arithmetics(l, r, el, er, allow_comparison_ops=True):
      assert isinstance(l, dd.Series)
      assert isinstance(r, (dd.Series, pd.Series))
      assert isinstance(el, pd.Series)
      assert isinstance(er, pd.Series)
  
      # l, r may be repartitioned, test whether repartition keeps original data
      assert_eq(l, el)
      assert_eq(r, er)
  
      assert_eq(l + r, el + er)
      assert_eq(l * r, el * er)
      assert_eq(l - r, el - er)
      assert_eq(l / r, el / er)
      assert_eq(l // r, el // er)
      assert_eq(l**r, el**er)
      assert_eq(l % r, el % er)
  
      if allow_comparison_ops:
          # comparison is allowed if data have same index
          assert_eq(l & r, el & er)
          assert_eq(l | r, el | er)
          assert_eq(l ^ r, el ^ er)
          assert_eq(l > r, el > er)
          assert_eq(l < r, el < er)
          assert_eq(l >= r, el >= er)
          assert_eq(l <= r, el <= er)
          assert_eq(l == r, el == er)
          assert_eq(l != r, el != er)
          assert_eq(l.lt(r), el.lt(er))
          assert_eq(l.gt(r), el.gt(er))
          assert_eq(l.le(r), el.le(er))
          assert_eq(l.ge(r), el.ge(er))
          assert_eq(l.ne(r), el.ne(er))
          assert_eq(l.eq(r), el.eq(er))
  
      assert_eq(l + 2, el + 2)
      assert_eq(l * 2, el * 2)
      assert_eq(l - 2, el - 2)
      assert_eq(l / 2, el / 2)
      assert_eq(l & True, el & True)
      assert_eq(l | True, el | True)
      assert_eq(l ^ True, el ^ True)
      assert_eq(l // 2, el // 2)
      assert_eq(l**2, el**2)
      assert_eq(l % 2, el % 2)
      assert_eq(l > 2, el > 2)
      assert_eq(l < 2, el < 2)
      assert_eq(l >= 2, el >= 2)
      assert_eq(l <= 2, el <= 2)
      assert_eq(l == 2, el == 2)
      assert_eq(l != 2, el != 2)
  
      assert_eq(2 + r, 2 + er)
      assert_eq(2 * r, 2 * er)
      assert_eq(2 - r, 2 - er)
      assert_eq(2 / r, 2 / er)
      assert_eq(True & r, True & er)
      assert_eq(True | r, True | er)
      assert_eq(True ^ r, True ^ er)
      assert_eq(2 // r, 2 // er)
      assert_eq(2**r, 2**er)
      assert_eq(2 % r, 2 % er)
      assert_eq(2 > r, 2 > er)
      assert_eq(2 < r, 2 < er)
      assert_eq(2 >= r, 2 >= er)
      assert_eq(2 <= r, 2 <= er)
      assert_eq(2 == r, 2 == er)
      assert_eq(2 != r, 2 != er)
  
      assert_eq(l.lt(2), el.lt(2))
      assert_eq(l.gt(2), el.gt(2))
      assert_eq(l.le(2), el.le(2))
      assert_eq(l.ge(2), el.ge(2))
      assert_eq(l.ne(2), el.ne(2))
      assert_eq(l.eq(2), el.eq(2))
  
      assert_eq(-l, -el)
      assert_eq(abs(l), abs(el))
  
      if allow_comparison_ops:
          # comparison is allowed if data have same index
          assert_eq(~(l == r), ~(el == er))
  
imports: from __future__ import annotations
  import contextlib
  import warnings
  from datetime import datetime
  import numpy
  import pandas
  import pytest
  from pandas.api.types import is_scalar
  import dask.dataframe
  from dask.array.numpy_compat import _numpy_125
  from dask.dataframe._compat import PANDAS_GE_140, PANDAS_GE_150, PANDAS_GE_200, PANDAS_VERSION, check_numeric_only_deprecation
  from dask.dataframe.utils import assert_dask_graph, assert_eq, make_meta, pyarrow_strings_enabled
label_desc: Use image node_id 4 for calling a global function with example usage: check_series_arithmetics(l, r, el, er, allow_comparison_ops) without return types