def quoteaddr(addr):
 m = (None, None)
 try:
  m = email.utils.parseaddr(addr)[1]
 except AttributeError:
  pass
 if (m == (None, None)):
  return ('<%s>' % addr)
 elif (m is None):
  return '<>'
 else:
  return ('<%s>' % m)

def quoteaddr ( addr ) : m = ( None , None ) try : m = email . utils . parseaddr ( addr ) [ 1 ] except AttributeError : pass if ( m == ( None , None ) ) : return ( '<%s>' % addr ) elif ( m is None ) : return '<>' else : return ( '<%s>' % m )
turn an email address .