def expand(s, expansions, name):
    try:
        return s % expansions
    except __HOLE__:
        raise ValueError(
            'Format string %r for %r contains names which cannot be '
            'expanded' % (s, name))
    except:
        raise ValueError(
            'Format string %r for %r is badly formatted' % (s, name)
            )
dataset/ETHPy150Open XiaoMi/minos/supervisor/supervisor/options.py/expand