Check and interpret the "##CHROM" line and return samples

def _handle_sample_line(self, parsed_samples=None):
        """"Check and interpret the "##CHROM" line and return samples"""
        if not self._line or not self._line.startswith("#CHROM"):
            raise exceptions.IncorrectVCFFormat('Missing line starting with "#CHROM"')
        # check for space before INFO
        line = self._line.rstrip()
        pos = line.find("FORMAT") if ("FORMAT" in line) else line.find("INFO")
        if pos == -1:
            raise exceptions.IncorrectVCFFormat('Ill-formatted line starting with "#CHROM"')
        if " " in line[:pos]:
            warnings.warn(
                (
                    "Found space in #CHROM line, splitting at whitespace "
                    "instead of tab; this VCF file is ill-formatted"
                ),
                SpaceInChromLine,
            )
            arr = self._line.rstrip().split()
        else:
            arr = self._line.rstrip().split("\t")

        self._check_samples_line(arr)
        return header.SamplesInfos(arr[len(REQUIRE_SAMPLE_HEADER) :], parsed_samples)