Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _process_apiritif_samples(self, sample, label):
samples_processed = 0
recording = apiritif.recorder.pop_events(from_ts=self.start_time, to_ts=self.end_time)
if not recording:
return samples_processed
try:
samples = self.apiritif_extractor.parse_recording(recording, sample)
except BaseException as exc:
print("Warning: Couldn't parse recording: %s" % exc)
samples = []
for sample in samples:
samples_processed += 1
self._process_sample(sample, label)
return samples_processed