def find_in_mapping(sequence, key, value):
    """
    Search a sequence of mappings for one with a matching key-value pair.

    Only searches one level deep.

    Args:
        sequence (list(dict)): Sequence of mappings.
        key: Key to match.
        value: value to match

    Returns:
        The first matching mapping, or ``None`` if no such mapping exists.
    """
    mapping = None
    for map_value in sequence:
        try:
            if map_value[key] == value:
                mapping = map_value[key]
        except (KeyError, TypeError):
            pass
    return mapping