def METHOD_NAME(file: str) -> Optional[AutoPatchRegister]:
    for file_ending, handler in AutoPatchRegister.file_endings.items():
        if file.endswith(file_ending):
            return handler
    return None