def METHOD_NAME(
    source: str, span: Tuple[int, Optional[int]]
) -> Tuple[ql_parser.SourcePoint, ql_parser.SourcePoint]:
    (start, end) = span
    source_bytes = source.encode('utf-8')
    [start_sp] = ql_parser.SourcePoint.from_offsets(source_bytes, [start])
    if end is not None:
        [end_sp] = ql_parser.SourcePoint.from_offsets(source_bytes, [end])
    else:
        end_sp = None
    return (start_sp, end_sp)