

@romeo.grammars.query(pattern='^select (?P<key>.+) where (?P<key2>.+) is (?P<value>.+)', form='select key1 where key2 is value', help='look for the object where a known key value pair exists')
def compound_select(key, key2, value):
    if romeo.foundation.RomeoKeyValue.exists(key2, value):
        test = romeo.foundation.RomeoKeyValue(key2, value)
        for obj in romeo.foundation.RomeoKeyValue.objects:
            if (obj.KEY != key):
                continue
            if (not test.isRelated(obj)):
                continue
            (yield obj)

dataset/ETHPy150Open OrbitzWorldwide/droned/romeo/lib/romeo/grammars/_builtins.py compound_select/original