<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_unique_seqid(self, alias, namespace):
 """given alias and namespace, return seq_id if exactly one distinct sequence id is found, raise KeyError if there's no match, or raise ValueError if there's more than one match. """


        recs = self.aliases.find_aliases(alias=alias, namespace=namespace)
        seq_ids = set(r["seq_id"] for r in recs)
        if len(seq_ids) == 0:
            raise KeyError("Alias {} (namespace: {})".format(alias, namespace))
        if len(seq_ids) > 1:
            # This should only happen when namespace is None
            raise KeyError("Alias {} (namespace: {}): not unique".format(alias, namespace))
        return seq_ids.pop()