def interruptions(thread, chat):
    ids = threads(chat)
    first = ids.index(thread)

    for x in range(first, len(ids)):
        if ids[x] == thread:
            last = x

    if first == last:
        return 0.0

    section = ids[first:last]

    others = removeall(thread, section)
    tSize = len(section) - len(others) + 0.0
    return len(others) / tSize
 def words(self):
     wds = re.split(getwords, self.rest.strip())
     for wd in self.mentioned:
         wds = removeall(wd, wds)
     wds = removeall("", wds)
     return [w.lower() for w in wds]
def threads(chat):
    ids = [x.thread for x in chat]
    return removeall(-1, ids)  #system thread doesn't count