def items_to_report_element(items, item_type):
 n = len(items)
 text = pluralize(n, item_type)
 if (n == 0):
  return text
 else:
  detail = u'\n'.join((str(x) for x in items))
  return (text, detail)

def items_to_report_element ( items , item_type ) : n = len ( items ) text = pluralize ( n , item_type ) if ( n == 0 ) : return text else : detail = u'\n' . join ( ( str ( x ) for x in items ) ) return ( text , detail )
converts an iterable of items to a pair .