# Path: src/eutils/_internal/xmlfacades/base.py
# class Base(object):
#     """Root class for all xmlfacade classes.
# 
#     This class is instantiated only by subclasses.
# 
#     xmlfacades must be instantiated with an XML document, passed
#     either as XML text or as the root of a parsed XML document.
# 
#     _root_tag must be defined by the subclass. It is used to validate
#     the node type upon instantiation of the subclass.
# 
#     """
# 
#     _root_tag = None
# 
#     def __init__(self, xml):
#         if isinstance(xml, lxml.etree._Element):
#             self._xml_root = xml
#         elif isinstance(xml, str) or isinstance(xml, bytes):
#             self._xml_root = lxml.etree.XML(xml)
#         else:
#             raise EutilsError("Cannot create object from type " + type(xml).__name__)
# 
#         if self._root_tag is None:
#             raise EutilsError("_root_tag not defined for class {}".format(type(self).__name__))
#         elif self._root_tag != self._xml_root.tag:
#             raise EutilsError("XML for {} object must be a {} element (got {})".format(
#                 type(self).__name__, self._root_tag, self._xml_root.tag))


import logging
    import os
    import lxml.etree as le
from .base import Base
    from .xmlfacades.gbset import GBSet

    @property
    def locus(self):
        return self._xml_root.findtext("GBSeq_locus")

    @property
    def moltype(self):
        return self._xml_root.findtext("GBSeq_moltype")

    @property
    def organism(self):
        return self._xml_root.findtext("GBSeq_organism")

    @property
    def other_seqids(self):
        """returns a dictionary of sequence ids, like {'gi': ['319655736'], 'ref': ['NM_000551.3']}"""
        seqids = self._xml_root.xpath("GBSeq_other-seqids/GBSeqid/text()")
        return {t: l.rstrip("|").split("|")
                for t, _, l in [si.partition("|") for si in seqids]}

    @property
    def sequence(self):
        return self._xml_root.findtext("GBSeq_sequence").upper()

    @property
    def updated(self):
        return self._xml_root.findtext("GBSeq_update-date")




# Path: src/eutils/_internal/xmlfacades/base.py
# class Base(object):
#     """Root class for all xmlfacade classes.
# 
#     This class is instantiated only by subclasses.
# 
#     xmlfacades must be instantiated with an XML document, passed
#     either as XML text or as the root of a parsed XML document.
# 
#     _root_tag must be defined by the subclass. It is used to validate
#     the node type upon instantiation of the subclass.
# 
#     """
# 
#     _root_tag = None
# 
#     def __init__(self, xml):
#         if isinstance(xml, lxml.etree._Element):
#             self._xml_root = xml
#         elif isinstance(xml, str) or isinstance(xml, bytes):
#             self._xml_root = lxml.etree.XML(xml)
#         else:
#             raise EutilsError("Cannot create object from type " + type(xml).__name__)
# 
#         if self._root_tag is None:
#             raise EutilsError("_root_tag not defined for class {}".format(type(self).__name__))
#         elif self._root_tag != self._xml_root.tag:
#             raise EutilsError("XML for {} object must be a {} element (got {})".format(
#                 type(self).__name__, self._root_tag, self._xml_root.tag))


# Path: src/eutils/_internal/xmlfacades/gbseq.py
import logging
    import os
    import lxml.etree as le
from .base import Base
    from .xmlfacades.gbset import GBSet


    @property
    def locus(self):
        return self._xml_root.findtext("GBSeq_locus")

    @property
    def moltype(self):
        return self._xml_root.findtext("GBSeq_moltype")

    @property
    def organism(self):
        return self._xml_root.findtext("GBSeq_organism")

    @property
    def other_seqids(self):
        """returns a dictionary of sequence ids, like {'gi': ['319655736'], 'ref': ['NM_000551.3']}"""
        seqids = self._xml_root.xpath("GBSeq_other-seqids/GBSeqid/text()")
        return {t: l.rstrip("|").split("|")
                for t, _, l in [si.partition("|") for si in seqids]}

    @property
    def sequence(self):
        return self._xml_root.findtext("GBSeq_sequence").upper()

    @property
    def updated(self):
        return self._xml_root.findtext("GBSeq_update-date")




class GBFeatureTable(Base):