from typing import Iterable
from typing import Callable
from typing import Optional
from typing import Any


def safe_find(records: Iterable, filter_func: Callable) -> Optional[Any]:
    """
    Wrapper around the filter function, to return only the first record when
    there is a match, or None instead.

    Args:
        records: List to iterate over
        filter_func: Function that will be appliead on each record
    Returns:
        First occurrence found or None
    Examples:
        >>> safe_find([{'a': 'T', 'b': 'H'}, {'a': 'F'}], lambda rec: rec.get('a') == 'F')
        {'a': 'F'}
        >>> safe_find([1, 2, 3], lambda rec: rec > 0)
        1
        >>> safe_find([{'a': 'T'}], lambda rec: rec.get('a') == 'F') is None
        True
    """
    try:
        return next(filter(filter_func, records))
    except StopIteration:
        return None