from datetime import datetime
from typing import Callable


def between_datetimes(start: datetime, end: datetime) -> Callable[[datetime], bool]:
    """
    Filter that allows events between a start time and end time

    Args:
        - start (datetime): the start datetime
        - end (datetime): the end datetime

    Returns:
        - Callable[[datetime], bool]: a filter function
    """

    def _filter_fn(dt: datetime) -> bool:
        return dt >= start and dt <= end

    return _filter_fn