def filter_a(name, value):
 if (name in ('title', 'target')):
  return True
 if (name == 'href'):
  url_components = urlparse.urlsplit(value)
  if (url_components[0] in ['http', 'https']):
   return True
  logging.error(('Found invalid URL href: %s' % value))
 return False

def filter_a ( name , value ) : if ( name in ( 'title' , 'target' ) ) : return True if ( name == 'href' ) : url_components = urlparse . urlsplit ( value ) if ( url_components [ 0 ] in [ 'http' , 'https' ] ) : return True logging . error ( ( 'Found invalid URL href: %s' % value ) ) return False
returns whether the described attribute of an anchor (a) tag should be whitelisted .