<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def read_source_manifest(file_name):
 """Reads Illumina manifest."""

    alleles = {}
    open_function = open
    if file_name.endswith(".gz"):
        open_function = gzip.open
    with open_function(file_name, 'rb') as input_file:
        header_index = dict([
            (col_name, i) for i, col_name in
            enumerate(input_file.readline().rstrip("\r\n").split("\t"))
        ])
        for col_name in {"Name", "SNP", "IlmnStrand"}:
            if col_name not in header_index:
                msg = "{}: no column named {}".format(file_name, col_name)
                raise ProgramError(msg)

        for line in input_file:
            row = line.rstrip("\r\n").split("\t")
            marker_name = row[header_index["Name"]]
            the_alleles = row[header_index["SNP"]]
            strand = row[header_index["IlmnStrand"]]
            if (the_alleles == "[D/I]") or (the_alleles == "[I/D]"):
                # This is an indel, so we skip it
                continue
            top_alleles = illumina_to_snp(strand, the_alleles)
            allele1, allele2 = top_alleles.split(" ")
            alleles[marker_name] = {allele1, allele2}

    return alleles