def try_attach_list(t: 'Token') -> typing.List['BlockTitleToken']:
     content = None
     intro = None
     lits = None
     tt = t
     first_pass3035 = True
     while True:
         if first_pass3035: first_pass3035 = False
         else: tt = tt.next0_
         if (not (tt is not None)): break
         if (tt.is_newline_before):
             btt = BlockTitleToken.try_attach(tt, False, None)
             if (btt is None):
                 continue
             if (btt.typ == BlkTyps.INDEX):
                 content = btt
                 break
             if (btt.typ == BlkTyps.INTRO):
                 tt2 = btt.end_token.next0_
                 for k in range(5):
                     li = BlockLine.create(tt2, None)
                     if (li is None):
                         break
                     if (li.has_content_item_tail
                             or li.typ == BlkTyps.INDEXITEM):
                         content = btt
                         break
                     if (li.has_verb):
                         break
                     if (li.typ != BlkTyps.UNDEFINED):
                         if ((li.begin_char - btt.end_char) < 400):
                             content = btt
                             break
                     tt2 = li.end_token.next0_
                 if (content is None):
                     intro = btt
                 break
             if (btt.typ == BlkTyps.LITERATURE):
                 if (lits is None):
                     lits = list()
                 lits.append(btt)
     if (content is None and intro is None
             and ((lits is None or len(lits) != 1))):
         return None
     res = list()
     chapter_names = TerminCollection()
     t0 = None
     if (content is not None):
         res.append(content)
         cou = 0
         err = 0
         tt = content.end_token.next0_
         first_pass3036 = True
         while True:
             if first_pass3036: first_pass3036 = False
             else: tt = tt.next0_
             if (not (tt is not None)): break
             if (not tt.is_newline_before):
                 continue
             li = BlockLine.create(tt, None)
             if (li is None):
                 break
             if (li.has_verb):
                 if (li.end_token.is_char('.')):
                     break
                 if (li.length_char > 100):
                     break
             btt = BlockTitleToken.try_attach(tt, True, None)
             if (btt is None):
                 continue
             err = 0
             if (btt.typ == BlkTyps.INTRO):
                 if (content.typ == BlkTyps.INTRO or cou > 2):
                     break
             cou += 1
             content.end_token = btt.end_token
             tt = content.end_token
             if (btt.value is not None):
                 chapter_names.add_string(btt.value, None, None, False)
         content.typ = BlkTyps.INDEX
         t0 = content.end_token.next0_
     elif (intro is not None):
         t0 = intro.begin_token
     elif (lits is not None):
         t0 = t
     else:
         return None
     first = True
     tt = t0
     first_pass3037 = True
     while True:
         if first_pass3037: first_pass3037 = False
         else: tt = tt.next0_
         if (not (tt is not None)): break
         if (not tt.is_newline_before):
             continue
         if (tt.is_value("СЛАБОЕ", None)):
             pass
         btt = BlockTitleToken.try_attach(tt, False, chapter_names)
         if (btt is None):
             continue
         if (len(res) == 104):
             pass
         tt = btt.end_token
         if (content is not None and btt.typ == BlkTyps.INDEX):
             continue
         if (len(res) > 0 and res[len(res) - 1].typ == BlkTyps.LITERATURE):
             if (btt.typ != BlkTyps.APPENDIX and btt.typ != BlkTyps.MISC
                     and btt.typ != BlkTyps.LITERATURE):
                 if (btt.typ == BlkTyps.CHAPTER
                         and (res[len(res) - 1].end_char < (math.floor(
                             (len(tt.kit.sofa.text) * 3) / 4)))):
                     pass
                 else:
                     continue
         if (first):
             if ((tt.begin_char - t0.begin_char) > 300):
                 btt0 = BlockTitleToken(
                     t0, (t0 if t0.previous is None else t0.previous))
                 btt0.typ = BlkTyps.CHAPTER
                 btt0.value = "Похоже на начало"
                 res.append(btt0)
         res.append(btt)
         tt = btt.end_token
         first = False
     i = 0
     while i < (len(res) - 1):
         if (res[i].typ == BlkTyps.LITERATURE
                 and res[i + 1].typ == res[i].typ):
             del res[i + 1]
             i -= 1
         i += 1
     return res
 def process(self, kit: 'AnalysisKit') -> None:
     ad = kit.get_analyzer_data(self)
     models = TerminCollection()
     objs_by_model = dict()
     obj_by_names = TerminCollection()
     t = kit.first_token
     first_pass3428 = True
     while True:
         if first_pass3428: first_pass3428 = False
         else: t = t.next0_
         if (not (t is not None)): break
         its = WeaponItemToken.try_parse_list(t, 10)
         if (its is None):
             continue
         rts = self.__try_attach(its, False)
         if (rts is not None):
             for rt in rts:
                 rt.referent = ad.register_referent(rt.referent)
                 kit.embed_token(rt)
                 t = (rt)
                 for s in rt.referent.slots:
                     if (s.type_name == WeaponReferent.ATTR_MODEL):
                         mod = str(s.value)
                         for k in range(2):
                             if (not str.isdigit(mod[0])):
                                 li = []
                                 wrapli2804 = RefOutArgWrapper(None)
                                 inoutres2805 = Utils.tryGetValue(
                                     objs_by_model, mod, wrapli2804)
                                 li = wrapli2804.value
                                 if (not inoutres2805):
                                     li = list()
                                     objs_by_model[mod] = li
                                 if (not rt.referent in li):
                                     li.append(rt.referent)
                                 models.add_string(mod, li, None, False)
                             if (k > 0):
                                 break
                             brand = rt.referent.get_string_value(
                                 WeaponReferent.ATTR_BRAND)
                             if (brand is None):
                                 break
                             mod = "{0} {1}".format(brand, mod)
                     elif (s.type_name == WeaponReferent.ATTR_NAME):
                         obj_by_names.add(
                             Termin._new100(str(s.value), rt.referent))
     if (len(objs_by_model) == 0 and len(obj_by_names.termins) == 0):
         return
     t = kit.first_token
     first_pass3429 = True
     while True:
         if first_pass3429: first_pass3429 = False
         else: t = t.next0_
         if (not (t is not None)): break
         br = BracketHelper.try_parse(t, BracketParseAttr.NO, 10)
         if (br is not None):
             toks = obj_by_names.try_parse(t.next0_, TerminParseAttr.NO)
             if (toks is not None
                     and toks.end_token.next0_ == br.end_token):
                 rt0 = ReferentToken(
                     Utils.asObjectOrNull(toks.termin.tag, Referent),
                     br.begin_token, br.end_token)
                 kit.embed_token(rt0)
                 t = (rt0)
                 continue
         if (not (isinstance(t, TextToken))):
             continue
         if (not t.chars.is_letter):
             continue
         tok = models.try_parse(t, TerminParseAttr.NO)
         if (tok is None):
             if (not t.chars.is_all_lower):
                 tok = obj_by_names.try_parse(t, TerminParseAttr.NO)
             if (tok is None):
                 continue
         if (not tok.is_whitespace_after):
             if (tok.end_token.next0_ is None
                     or not tok.end_token.next0_.is_char_of(",.)")):
                 if (not BracketHelper.is_bracket(tok.end_token.next0_,
                                                  False)):
                     continue
         tr = None
         li = Utils.asObjectOrNull(tok.termin.tag, list)
         if (li is not None and len(li) == 1):
             tr = li[0]
         else:
             tr = (Utils.asObjectOrNull(tok.termin.tag, Referent))
         if (tr is not None):
             tit = WeaponItemToken.try_parse(tok.begin_token.previous, None,
                                             False, True)
             if (tit is not None and tit.typ == WeaponItemToken.Typs.BRAND):
                 tr.add_slot(WeaponReferent.ATTR_BRAND, tit.value, False, 0)
                 tok.begin_token = tit.begin_token
             rt0 = ReferentToken(tr, tok.begin_token, tok.end_token)
             kit.embed_token(rt0)
             t = (rt0)
             continue