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_spindle(data, sf, time, hypno):
"""Replace Visbrain built-in spindles detection by YASA algorithm.
See http://visbrain.org/sleep.html#use-your-own-detections-in-sleep
"""
# Apply on the full recording
# sp = spindles_detect(data, sf)
# NREM sleep only
sp = spindles_detect(data, sf, hypno=hypno)
return (sp[['Start', 'End']].values * sf).astype(int)