def mask_email(ref, pepno=None):
 if (ref.hasattr('refuri') and ref['refuri'].startswith('mailto:')):
  if (ref['refuri'][8:] in non_masked_addresses):
   replacement = ref[0]
  else:
   replacement_text = ref.astext().replace('@', '&#32;&#97;t&#32;')
   replacement = nodes.raw('', replacement_text, format='html')
  if (pepno is None):
   return replacement
  else:
   ref['refuri'] += ('?subject=PEP%%20%s' % pepno)
   ref[:] = [replacement]
   return ref
 else:
  return ref

def mask_email ( ref , pepno = None ) : if ( ref . hasattr ( 'refuri' ) and ref [ 'refuri' ] . startswith ( 'mailto:' ) ) : if ( ref [ 'refuri' ] [ 8 : ] in non_masked_addresses ) : replacement = ref [ 0 ] else : replacement_text = ref . astext ( ) . replace ( '@' , '&#32;&#97;t&#32;' ) replacement = nodes . raw ( '' , replacement_text , format = 'html' ) if ( pepno is None ) : return replacement else : ref [ 'refuri' ] += ( '?subject=PEP%%20%s' % pepno ) ref [ : ] = [ replacement ] return ref else : return ref
mask the email address in ref and return a replacement node .