code: def test_where():
      s = Series(np.random.default_rng(2).standard_normal(5))
      cond = s > 0
  
      rs = s.where(cond).dropna()
      rs2 = s[cond]
      tm.assert_series_equal(rs, rs2)
  
      rs = s.where(cond, -s)
      tm.assert_series_equal(rs, s.abs())
  
      rs = s.where(cond)
      assert s.shape == rs.shape
      assert rs is not s
  
      # test alignment
      cond = Series([True, False, False, True, False], index=s.index)
      s2 = -(s.abs())
  
      expected = s2[cond].reindex(s2.index[:3]).reindex(s2.index)
      rs = s2.where(cond[:3])
      tm.assert_series_equal(rs, expected)
  
      expected = s2.abs()
      expected.iloc[0] = s2[0]
      rs = s2.where(cond[:3], -s2)
      tm.assert_series_equal(rs, expected)
  
imports: import numpy
  import pytest
  from pandas._config import using_pyarrow_string_dtype
  from pandas.core.dtypes.common import is_integer
  import pandas
  from pandas import Series, Timestamp, date_range, isna
  import pandas._testing
label_desc: Use image node_id 5 for calling a global function with example usage: test_where() without return types