def find_key_value_in_dict(d, key):
    """
    Searches a dictionary (with nested lists and dictionaries)
    for the first value matching to the provided key.
    """
    for k, v in d.iteritems():
        if k == key:
            return v
        elif isinstance(v, dict):
            r = find_key_value_in_dict(v, key)
            if r is not None:
                return r
        elif isinstance(v, list):
            for item in v:
                if isinstance(item, dict):
                    r = find_key_value_in_dict(item, key)
                    if r is not None:
                        return r
    return None