def relative_distance_boolean(a_str, b_str, threshold=0.6):
 if (threshold == 0):
  return True
 elif (threshold == 1.0):
  return (a_str == b_str)
 if (len(b_str) < len(a_str)):
  (a_str, b_str) = (b_str, a_str)
 alen = len(a_str)
 blen = len(b_str)
 if ((blen == 0) or (alen == 0)):
  return (alen == blen)
 if ((blen == alen) and (a_str == b_str) and (threshold <= 1.0)):
  return True
 if (threshold > upper_bound_similarity(a_str, b_str)):
  return False
 else:
  return (threshold <= difflib.SequenceMatcher(None, a_str, b_str).quick_ratio())

def relative_distance_boolean ( a_str , b_str , threshold = 0.6 ) : if ( threshold == 0 ) : return True elif ( threshold == 1.0 ) : return ( a_str == b_str ) if ( len ( b_str ) < len ( a_str ) ) : ( a_str , b_str ) = ( b_str , a_str ) alen = len ( a_str ) blen = len ( b_str ) if ( ( blen == 0 ) or ( alen == 0 ) ) : return ( alen == blen ) if ( ( blen == alen ) and ( a_str == b_str ) and ( threshold <= 1.0 ) ) : return True if ( threshold > upper_bound_similarity ( a_str , b_str ) ) : return False else : return ( threshold <= difflib . SequenceMatcher ( None , a_str , b_str ) . quick_ratio ( ) )
indicates if the strings to compare are similar enough .