def print_threads(d):
 id = 1
 rel = {}
 for partner in d:
  messages = d[partner]
  count = len(messages)
  screen_name = ('@' + partner[0])
  name = partner[1]
  screen_name = color_func(c['MESSAGE']['partner'])(screen_name)
  name = cycle_color(name)
  thread_id = color_func(c['MESSAGE']['id'])(('thread_id:' + str(id)))
  line = ((((((((' ' * 2) + name) + ' ') + screen_name) + ' (') + str(count)) + ' message) ') + thread_id)
  printNicely(line)
  rel[id] = partner
  id += 1
 dg['thread'] = d
 return rel

def print_threads ( d ) : id = 1 rel = { } for partner in d : messages = d [ partner ] count = len ( messages ) screen_name = ( '@' + partner [ 0 ] ) name = partner [ 1 ] screen_name = color_func ( c [ 'MESSAGE' ] [ 'partner' ] ) ( screen_name ) name = cycle_color ( name ) thread_id = color_func ( c [ 'MESSAGE' ] [ 'id' ] ) ( ( 'thread_id:' + str ( id ) ) ) line = ( ( ( ( ( ( ( ( ' ' * 2 ) + name ) + ' ' ) + screen_name ) + ' (' ) + str ( count ) ) + ' message) ' ) + thread_id ) printNicely ( line ) rel [ id ] = partner id += 1 dg [ 'thread' ] = d return rel
print threads of messages .