def __getitem__(self, seq):
        if not hasattr(seq, 'annotationType'): # don't cache annotations
            try: # look in our sequence cache
                return self._cache[seq.pathForward]
            except AttributeError:
                raise KeyError('key must be a sequence interval!')
            except KeyError:
                pass
        seqID = self.getSeqID(seq) # use seq id to look up...
        try:
            nlmsaID, nsID, offset = self.seqIDdict[seqID]
        except KeyError:
            raise KeyError('seq not found in this alignment')
        v = nlmsaID, self.seqlist[nsID], offset
        if not hasattr(seq, 'annotationType'): # don't cache annotations
            self._cache[seq.pathForward] = _NLMSASeqDict_ValueWrapper(*v)
        return v
Check to make sure a portal is okay for external linking.
dataset/ETHPy150Open cjlee112/pygr/pygr/nlmsa_utils.py/NLMSASeqDict.__getitem__--crossover with--dataset/ETHPy150Open erkyrath/tworld/lib/tweblib/handlers.py/MyHandlerMixin.check_external_portal