def match(self, from_elem, to_elems):
        mresult = get_null_matches(from_elem, to_elems, self.factor)

        if from_elem.parent is None:
            return mresult

        ptitle = from_elem.parent.title.strip()
        pnumber = from_elem.parent.number.strip()

        for to_elem in to_elems:
            conf = 0.0
            parent = to_elem.parent
            if parent is None:
                continue

            pttitle = parent.title.strip()
            ptnumber = parent.number.strip()
            if pnumber != '' and pnumber == ptnumber:
                conf += 0.5

            ratio = SequenceMatcher(None, ptitle, pttitle).ratio()
            if ratio >= RATIO_THRESHOLD:
                new_conf = RATIO_THRESHOLD + (ratio - RATIO_THRESHOLD)
                if pnumber == '':
                    conf += new_conf
                else:
                    conf += new_conf/2.0
            mresult.to_elems[to_elem.pk][1] = conf

        return mresult
dataset/ETHPy150Open bartdag/recodoc2/recodoc2/apps/doc/parser/doc_diff.py/SectionParentMatcher.match/original