def METHOD_NAME(queries: List[str], batch_size: Optional[int]) -> Iterator[List[str]]:
    if batch_size is None:
        yield queries
        return
    else:
        for index in range(0, len(queries), batch_size):
            yield queries[index : index + batch_size]