-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Andreas Dieckmann
committed
Apr 26, 2020
1 parent
bf9d6bc
commit 846d2c5
Showing
6 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
data = [(x.Start, x.End, x) for x in IN[0]] | ||
# sort by end first, then by start | ||
data.sort(key=lambda x: x[1]) | ||
data.sort(key=lambda x: x[0]) | ||
l = len(data) | ||
overlaps = [] | ||
for i in xrange(l): | ||
for j in xrange(i+1, l): | ||
x = data[i] | ||
y = data[j] | ||
# identify overlaps | ||
if (y[0]<=x[1]): overlaps.append([x[2], y[2]]) | ||
|
||
OUT = overlaps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import clr | ||
|
||
def process_input(func, input): | ||
if isinstance(input, list): return [func(x) for x in input] | ||
else: return func(input) | ||
|
||
def SyncEventWasAborted(syncevent): | ||
if syncevent.__repr__() == 'SyncEvent': return syncevent.WasAborted | ||
else: return None | ||
|
||
OUT = process_input(SyncEventWasAborted,IN[0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
data = [(x.Start, x.End, x) for x in IN[0]] | ||
# sort by end first, then by start | ||
data.sort(key=lambda x: x[1]) | ||
data.sort(key=lambda x: x[0]) | ||
l = len(data) | ||
overlaps = [] | ||
for i in xrange(l): | ||
for j in xrange(i+1, l): | ||
x = data[i] | ||
y = data[j] | ||
# identify overlaps | ||
if (y[0]<=x[1]): overlaps.append([x[2], y[2]]) | ||
|
||
OUT = overlaps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import clr | ||
|
||
def process_input(func, input): | ||
if isinstance(input, list): return [func(x) for x in input] | ||
else: return func(input) | ||
|
||
def SyncEventWasAborted(syncevent): | ||
if syncevent.__repr__() == 'SyncEvent': return syncevent.WasAborted | ||
else: return None | ||
|
||
OUT = process_input(SyncEventWasAborted,IN[0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters