def METHOD_NAME(self):
    key = Key()
    decl = Declaration()
    decl.annotate("Start")
    decl.declare(key.aloha)
    decl.declare(key.hello)
    decl.declare(key.hey).set_flag(Flag.ignored)
    pattern = key.dynamic("anything")
    assert list(decl.iter_options(pattern=pattern)) == [
        key.aloha,
        key.hello,
    ]
    pattern = Pattern(key) + "he*"
    assert list(decl.iter_options(pattern=pattern)) == [key.hello]
    assert list(decl.iter_options(exclude=Flag(0))) == [
        key.aloha,
        key.hello,
        key.hey,
    ]