def test_copysign():
    a = np.array([-1, 1, -1])
    b = np.array([1, -1, 1])

    assert_array_equal(_copysign(a, b), b)
    assert_array_equal(_copysign(b, a), a)
Test numpy.copysign() replacement
dataset/ETHPy150Open mne-tools/mne-python/mne/tests/test_fixes.py/test_copysign