list2range('1,2,5-7,10') [1, 2, 5, 6, 7, 10] # from https://stackoverflow.com/a/6405711/9201239
(s)
| 46 | args = parser.parse_args() |
| 47 | |
| 48 | def list2range(s): |
| 49 | """ |
| 50 | list2range('1,2,5-7,10') |
| 51 | [1, 2, 5, 6, 7, 10] |
| 52 | # from https://stackoverflow.com/a/6405711/9201239 |
| 53 | """ |
| 54 | return sum(((list(range(*[int(j) + k for k,j in enumerate(i.split('-'))])) |
| 55 | if '-' in i else [int(i)]) for i in s.split(',')), []) |
| 56 | |
| 57 | def unpack(args, idx, row): |
| 58 | #pprint(row) |
no outgoing calls
no test coverage detected