def infer_positional_format_args(fstr):
    # TODO: memoize
    ret, max_anon = '', 0
    # look for {: or {! or {. or {[ or {}
    start, end, prev_end = 0, 0, 0
    for match in _pos_farg_re.finditer(fstr):
        start, end, group = match.start(), match.end(), match.group()
        if prev_end < start:
            ret += fstr[prev_end:start]
        prev_end = end
        if group == '{{' or group == '}}':
            ret += group
            continue
        ret += '{%s%s' % (max_anon, group[1:])
        max_anon += 1
    ret += fstr[prev_end:]
    return ret


# This approach is hardly exhaustive but it works for most builtins
L{LocationLightning} blocks out non-IVisible stuff from
dataset/ETHPy150Open mahmoud/boltons/boltons/formatutils.py/infer_positional_format_args--crossover with--dataset/ETHPy150Open twisted/imaginary/imaginary/test/test_illumination.py/DarknessTestCase.test_nonVisibilityAffected