def get_class_from_frame(frame) -> type | None:
    """
    Retrieves the class object from the specified frame.

    :param frame: the frame to check
    :return: the class object from the specified frame
    """
    instance = frame.f_locals.get("self", None)
    if instance:
        # return its class
        return getattr(instance, "__class__", None)
    # return None otherwise
    return None