def _words_for_line(trigger, before, num_words=None):
 if (num_words is None):
  num_words = len(split_at_whitespace(trigger))
 word_list = split_at_whitespace(before)
 if (len(word_list) <= num_words):
  return before.strip()
 else:
  before_words = before
  for i in range((-1), (- (num_words + 1)), (-1)):
   left = before_words.rfind(word_list[i])
   before_words = before_words[:left]
  return before[len(before_words):].strip()

def _words_for_line ( trigger , before , num_words = None ) : if ( num_words is None ) : num_words = len ( split_at_whitespace ( trigger ) ) word_list = split_at_whitespace ( before ) if ( len ( word_list ) <= num_words ) : return before . strip ( ) else : before_words = before for i in range ( ( - 1 ) , ( - ( num_words + 1 ) ) , ( - 1 ) ) : left = before_words . rfind ( word_list [ i ] ) before_words = before_words [ : left ] return before [ len ( before_words ) : ] . strip ( )
gets the final num_words words from before .