def __init__(self, doc_or_str):
    self._year_rollover = False
    if isinstance(doc_or_str, bytes):
        doc_or_str = doc_or_str.decode('utf-8')
    if (isinstance(doc_or_str, str) or ((sys.version_info.major == 2) and isinstance(doc_or_str, unicode))):
        self.from_string = True
        self._line_str = doc_or_str.rstrip()
        self._profile_doc = None
        self._reset()
    else:
        self.from_string = False
        self._profile_doc = doc_or_str
        self._parse_document()
def __init__(self, doc_or_str):
    self._year_rollover = False
    if isinstance(doc_or_str, bytes):
        doc_or_str = doc_or_str.decode('utf-8')
    if (isinstance(doc_or_str, str) or ((sys.version_info.major == 2) and isinstance(doc_or_str, unicode))):
        self.from_string = True
        self._line_str = doc_or_str.rstrip()
        self._profile_doc = None
        self._reset()
    else:
        self.from_string = False
        self._profile_doc = doc_or_str
        self._parse_document()