def METHOD_NAME(
    segment: BaseSegment,
    templated_file: Optional[TemplatedFile],
) -> RawFileSlices:  # pragma: no cover
    """Returns raw slices for a segment."""
    if not templated_file:
        raise ValueError(
            'raw_slices: "templated_file" parameter is required.'
        )  # pragma: no cover
    if not segment.pos_marker:
        raise ValueError(
            'raw_slices: "segment" parameter must have pos_marker set.'
        )  # pragma: no cover
    return RawFileSlices(
        *templated_file.raw_slices_spanning_source_slice(
            segment.pos_marker.source_slice
        ),
        templated_file=templated_file
    )