def are_variants(uri, other_uri):
 if (uri.get_domain() != other_uri.get_domain()):
  return False
 if (uri.get_path() != other_uri.get_path()):
  return False
 if ((not uri.has_query_string()) and (not other_uri.has_query_string())):
  return True
 if (uri.has_query_string() and other_uri.has_query_string()):
  dc = uri.querystring
  odc = other_uri.querystring
  if (dc.keys() != odc.keys()):
   return False
  for (vself, vother) in izip_longest(chain(*dc.values()), chain(*odc.values()), fillvalue=None):
   if ((None in (vself, vother)) or (vself.isdigit() != vother.isdigit())):
    return False
  return True
 return False

def are_variants ( uri , other_uri ) : if ( uri . get_domain ( ) != other_uri . get_domain ( ) ) : return False if ( uri . get_path ( ) != other_uri . get_path ( ) ) : return False if ( ( not uri . has_query_string ( ) ) and ( not other_uri . has_query_string ( ) ) ) : return True if ( uri . has_query_string ( ) and other_uri . has_query_string ( ) ) : dc = uri . querystring odc = other_uri . querystring if ( dc . keys ( ) != odc . keys ( ) ) : return False for ( vself , vother ) in izip_longest ( chain ( * dc . values ( ) ) , chain ( * odc . values ( ) ) , fillvalue = None ) : if ( ( None in ( vself , vother ) ) or ( vself . isdigit ( ) != vother . isdigit ( ) ) ) : return False return True return False
this function analyzes if two urls are variants .