def localizeCassetteExon(upExonEnd, downExonStart, extraDomains, notAligned):
    """
    Localizes cassette exon to extracellular domain of protein

    :param upExonEnd: End index of upstream exon in protein AA sequence (float)
    :param downExonStart: Start index of downstream exon in protein AA sequence (float)
    :param extraDomains: List of lists lower bound and upper bound of extracellular/membrane domains (list[list[int, int], ...])
    :param notAligned: Exons that did not align to CDS (str)
    :return: Exons that localize to the extracellular/membrane domain (str)
    """
    exonsMatched = 'N/A'
    if extraDomains:
        for x in extraDomains:
            lowerBound = x[0]
            upperBound = x[1]
            if notAligned == 'Aligned':
                if lowerBound < int(upExonEnd) < int(downExonStart
                    ) < upperBound:
                    exonsMatched = 'Both'
            elif notAligned == 'Downstream':
                if lowerBound < int(upExonEnd) < upperBound:
                    exonsMatched = 'Upstream'
            elif notAligned == 'Upstream':
                if lowerBound < int(downExonStart) < upperBound:
                    exonsMatched = 'Downstream'
    return exonsMatched
