changeset 1228:ea1994acc93c

flow - dropping probs
author Devel 1
date Thu, 25 Jun 2020 14:41:51 +0200
parents 940aa00f4790
children 38535d18ed51
files stress-tester/src/main/resources/flow_analyzer.py
diffstat 1 files changed, 33 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/stress-tester/src/main/resources/flow_analyzer.py	Thu Jun 25 14:41:16 2020 +0200
+++ b/stress-tester/src/main/resources/flow_analyzer.py	Thu Jun 25 14:41:51 2020 +0200
@@ -616,6 +616,39 @@
         return self.markovMapped
 
 
+def find_sub_list(haystack, needle):
+    results=[]
+    sll=len(needle)
+    for ind in (i for i,e in enumerate(haystack) if e == needle[0]):
+        if haystack[ind:ind + sll]==needle:
+            results.append(ind)
+    return results
+
+
+def replace_all_sublists(haystack, needle, replacement, locs):
+    delta = len(replacement) - len(needle)
+    off = 0
+
+    for loc in locs:
+        bgn = loc + off
+        del haystack[bgn:bgn + len(needle)]
+        for i, r in enumerate(replacement):
+            haystack.insert(bgn + i, replacement[i])
+        off += delta
+
+
+def replace_sublist(haystack, needle, replacement, bgn):
+    del haystack[bgn:bgn + len(needle)]
+    for i, r in enumerate(replacement):
+        haystack.insert(bgn + i, replacement[i])
+
+
+def expand(seqs, folds):
+    print("seqs\n", json.dumps(seqs))
+    print("folds\n", json.dumps(folds))
+    return []
+
+
 if __name__ == "__main__":
     import argparse