def title_from_content(content):
 for end in (u'. ', u'?', u'!', u'<br />', u'\n', u'</p>'):
  if (end in content):
   content = (content.split(end)[0] + end)
   break
 return strip_tags(content)

def title_from_content ( content ) : for end in ( u'. ' , u'?' , u'!' , u'<br />' , u'\n' , u'</p>' ) : if ( end in content ) : content = ( content . split ( end ) [ 0 ] + end ) break return strip_tags ( content )
try and extract the first sentence from a block of test to use as a title .