def find_value_in_context(key, context):
    """
    Finds and returns the first value for key-value pair with 'key' in the given
    context. If not present, returns None
    """
    while key not in context:
        if context.has_key('context'):
            context = context['context']
        else:
            return None
    return context[key]