def format_user(user, show_url=True):
 out = '\x02{}\x02'.format(user['username'])
 if user['description']:
  out += ': "{}"'.format(formatting.truncate(user['description']))
 if user['city']:
  out += ': {}'.format(user['city'])
 if user['country']:
  out += ', {}'.format(formatting.truncate(user['country']))
 out += ' - \x02{track_count:,}\x02 tracks, \x02{playlist_count:,}\x02 playlists, \x02{followers_count:,}\x02 followers, \x02{followings_count:,}\x02 followed'.format(**user)
 if show_url:
  out += ' - {}'.format(web.try_shorten(user['permalink_url']))
 return out

def format_user ( user , show_url = True ) : out = '\x02{}\x02' . format ( user [ 'username' ] ) if user [ 'description' ] : out += ': "{}"' . format ( formatting . truncate ( user [ 'description' ] ) ) if user [ 'city' ] : out += ': {}' . format ( user [ 'city' ] ) if user [ 'country' ] : out += ', {}' . format ( formatting . truncate ( user [ 'country' ] ) ) out += ' - \x02{track_count:,}\x02 tracks, \x02{playlist_count:,}\x02 playlists, \x02{followers_count:,}\x02 followers, \x02{followings_count:,}\x02 followed' . format ( ** user ) if show_url : out += ' - {}' . format ( web . try_shorten ( user [ 'permalink_url' ] ) ) return out
takes a soundcloud user item and returns a formatted string .