Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def find_alignments(self, extract_id):
all_matched_segments, all_unmatched_segments = [], []
for interval in self.unmatched_intervals:
matched_segments = find_matched_intervals(
interval=interval, extractor=self.extractors[extract_id])
if matched_segments:
all_matched_segments.extend(matched_segments)
unmatched_segments = self.find_unmatched_segments(
interval=interval, matched_segments=matched_segments)
for segment in (unmatched_segments
if unmatched_segments is not None else []):
all_unmatched_segments.append(segment)
else:
all_unmatched_segments.extend(
interval if hasattr(interval, "__iter__") else [interval])
if all_matched_segments:
# unmatched segments