def expand_item(item):
    result = []
    in_block = False
    pre_block = ''
    for count in range(0, len(item)):
        letter = item[count]
        if letter == '[':
            in_block = True
            block = ''
        elif letter == ']' and in_block:
            in_block = False
            for value in block_to_list(block):
                result.append((pre_block, value, item[count + 1:]) % '%s%s%s')
        elif in_block:
            block += letter
        elif not in_block:
            pre_block += letter
    if len(result):
        return result
    else:
        return [item]  # pragma: no cover
dataset/ETHPy150Open dwighthubbard/hostlists/hostlists/plugins/range.py/expand_item/swapped operands of `%`