code: def deal_caps(x:Collection[str]) -> Collection[str]:
      "Replace all Capitalized tokens in `x` by their lower version and add `TK_MAJ` before."
      res = []
      for t in x:
          if t == '': continue
          if t[0].isupper() and len(t) > 1 and t[1:].islower(): res.append(TK_MAJ)
          res.append(t.lower())
      return ref deal_caps(x:Collection[str]) -> Collection[str]:
      "Replace all Capitalized tokens in `x` by their lower version and add `TK_MAJ` before."
      res = []
      for t in x:
          if t == '': continue
          if t[0].isupper() and len(t) > 1 and t[1:].islower(): res.append(TK_MAJ)
          res.append(t.lower())
      return res
docs: Replace all Capitalized tokens in `x` by their lower version and add `TK_MAJ` before.