<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def query_position(self, strand, chr, genome_coord):
 """Provides the relative position on the coding sequence for a given genomic position. Parameters chr : str chromosome, provided to check validity of query genome_coord : int 0-based position for mutation, actually used to get relative coding pos Returns ------- pos : int or None position of mutation in coding sequence, returns None if mutation does not match region found in self.exons """

        # first check if valid
        pos = None  # initialize to invalid pos
        if chr != self.chrom:
            #logger.debug('Wrong chromosome queried. You provided {0} but gene is '
                         #'on {1}.'.format(chr, self.chrom))
            # return pos
            pass

        if type(genome_coord) is list:
            # handle case for indels
            pos_left = self.query_position(strand, chr, genome_coord[0])
            pos_right = self.query_position(strand, chr, genome_coord[1])
            if pos_left is not None or pos_right is not None:
                return [pos_left, pos_right]
            else:
                return None

        # return position if contained within coding region or splice site
        for i, (estart, eend) in enumerate(self.exons):
            # in coding region
            if estart <= genome_coord < eend:
                if strand == '+':
                    prev_lens = sum(self.exon_lens[:i])  # previous exon lengths
                    pos = prev_lens + (genome_coord - estart)
                elif strand == '-':
                    prev_lens = sum(self.exon_lens[:i])  # previous exon lengths
                    pos = prev_lens + (genome_coord - estart)
                    pos = self.cds_len - pos - 1  # flip coords because neg strand
                return pos
            # in splice site
            elif (eend <= genome_coord < eend + 2) and i != self.num_exons-1:
                if strand == '+':
                    pos = self.cds_len + 2*i + (genome_coord - eend)
                elif strand == '-':
                    pos = self.cds_len + self.five_ss_len + 2*(self.num_exons-(i+2)) + (genome_coord - eend)
                return pos
            # in splice site
            elif (estart - 2 <= genome_coord < estart) and i != 0:
                if strand == '-':
                    pos = self.cds_len + 2*(self.num_exons-(i+2)) + (genome_coord - (estart - 2))
                elif strand == '+':
                    pos = self.cds_len + self.five_ss_len + 2*(i-1) + (genome_coord - (estart - 2))
                return pos

        return pos