# HG changeset patch # User jpayne # Date 1714967230 14400 # Node ID 832f269deeb0bfb03ed5141bc630ff096a065ed0 # Parent 5eb2d5e3bf22da456232c74bb8b71a5251246f9d planemo upload for repository https://toolrepo.galaxytrakr.org/view/jpayne/bioproject_to_srr_2/556cac4fb538 diff -r 5eb2d5e3bf22 -r 832f269deeb0 bio2srr.py --- a/bio2srr.py Sun May 05 23:32:17 2024 -0400 +++ b/bio2srr.py Sun May 05 23:47:10 2024 -0400 @@ -4,8 +4,17 @@ import sys import csv - -from itertools import batched +try: + from itertools import batched +except ImportError: + def batched(iterable, n): + "Batch data into tuples of length n. The last batch may be shorter." + # batched('ABCDEFG', 3) --> ABC DEF G + if n < 1: + raise ValueError('n must be at least one') + it = iter(iterable) + while batch := tuple(islice(it, n)): + yield batch from functools import cmp_to_key from time import sleep from xml.etree import ElementTree as xml