<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def process_next_position(data, cgi_input, header, reference, var_only):
 """ Determine appropriate processing to get data, then convert it to VCF There are two types of lines in the var file: - "full position": single allele (hemizygous) or all-allele line All alleles at this position are represented in this line. This is handled with "process_full_position". - "split position": each of two alleles is reported separately. There will be at least two lines, one for each allele (but potentially more). This is handled with "process_split_position". Because the number of lines used for separately reported alleles is unknown, process_split_position will always read ahead to the next "full position" and return that as well. So the returned line formats are consistent, process_next_position returns an array, even if there's only one line. """

    if data[2] == "all" or data[1] == "1":
        # The output from process_full_position is an array, so it can be
        # treated in the same manner as process_split_position output.
        out = process_full_position(data=data, header=header, var_only=var_only)
    else:
        assert data[2] == "1"
        # The output from process_split_position is a generator, and may end
        # up calling itself recursively.
        out = process_split_position(
            data=data, cgi_input=cgi_input, header=header, reference=reference, var_only=var_only)
    if out:

        # ChrM is skipped because Complete Genomics is using a different
        # reference than UCSC's reference. Their documentation states:
        #   The version we use, "build 37," consists of the assembled nuclear
        #   chromosomes from GRCh37 (not unplaced or alternate loci), plus the
        #   Cambridge Reference Sequence for the mitochondrion (NC_012920.1).
        #   This assembly (though with an alternate mitochondrial sequence) is
        #   also known as UCSC hg19.
        vcf_lines = [vcf_line(input_data=l, reference=reference) for l in out
                     if l['chrom'] != 'chrM']
        return [vl for vl in vcf_lines if not
               (var_only and vl.rstrip().endswith('./.'))]