def query2str(items, max_length=1024):
 kvs = []
 for (k, v) in items:
  if (k != PASSWORD_FORM_FIELD):
   kvs.append((six.u('%s=%s') % (k, v)))
 return '\n'.join(kvs)[:max_length]

def query2str ( items , max_length = 1024 ) : kvs = [ ] for ( k , v ) in items : if ( k != PASSWORD_FORM_FIELD ) : kvs . append ( ( six . u ( '%s=%s' ) % ( k , v ) ) ) return '\n' . join ( kvs ) [ : max_length ]
turns a dictionary into an easy-to-read list of key-value pairs .