Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def fcn_sw(data, sf, time, hypno):
"""Replace Visbrain built-in slow-wave detection by YASA algorithm.
"""
# On N2 / N3 sleep only
# Note that if you want to apply the detection on N3 sleep only, you should
# use sw_detect(..., include=(3))
sw = sw_detect(data, sf, hypno=hypno)
return (sw[['Start', 'End']].values * sf).astype(int)