def first(zelf, *args, **kwargs):
    """ return the first object where the key and/or value matches. """
    key = args[0]
    try:
        value = args[1]
    except IndexError:
        value = None
    result = None
    for o in zelf.objects():
        if key not in o:
            continue
        if value and o[key] != value:
            continue
        if not result:
            result = o
        if o.get('timed', '') < result.get('timed', ''):
            result = o
    return result
