original_docstring: 
      Sum similarity scores for pairs of records in a given location and date range
      :param disease1_name: Name of the first disease
      :param disease2_name: Name of the second disease
      :param state: state in which to search
      :param start_date: earliest date
      :param end_date: latest date
      :return: the sum of the similarity scores
      
docstring: Sum similarity scores for pairs of records in a given location and date range
docstring_tokens: Sum similarity scores for pairs of records in a given location and date range
code: def individual_similarity_sum(disease1_name, disease2_name, state, start_date, end_date):
      """
      Sum similarity scores for pairs of records in a given location and date range
      :param disease1_name: Name of the first disease
      :param disease2_name: Name of the second disease
      :param state: state in which to search
      :param start_date: earliest date
      :param end_date: latest date
      :return: the sum of the similarity scores
      """
      cursor = db_connection.cursor()
  
      # find all records for the first condition
      query_end = ";" if state == "All" else " AND Admin1Name = '" + state + "';"
      query_disease1 = "SELECT PeriodStartDate, CountValue, Fatalities, Admin1Name FROM noncumulative_all_conditions " \
                       "WHERE ConditionName = '" + disease1_name + "' AND PeriodStartDate > " + \
                       start_date.replace('-', '') + " AND PeriodStartDate < " + end_date.replace('-', '') + query_end
      print(query_disease1)
      cursor.execute(query_disease1)
      disease1_data = cursor.fetchall()
  
      # find all records for the second condition
      query_disease2 = "SELECT PeriodStartDate, CountValue, Fatalities, Admin1Name FROM noncumulative_all_conditions " \
                       "WHERE ConditionName = '" + disease2_name + "' AND PeriodStartDate > " + \
                       start_date.replace('-', '') + " AND PeriodStartDate < " + end_date.replace('-', '') + query_end
      print(query_disease2)
      cursor.execute(query_disease2)
      disease2_data = cursor.fetchall()
  
      print(disease1_name, ':', len(disease1_data), 'rows')
      print(disease2_name, ':', len(disease2_data), 'rows')
  
      # determine which disease has more records
      if len(disease1_data) < len(disease2_data):
          shorter_list = disease1_data
          longer_list = list(disease2_data)
      else:
          shorter_list = disease2_data
          longer_list = list(disease1_data)
  
      similarity_count = len(shorter_list)
      similarity_sum = 0
  
      # compute similarity scores for pairs of records
      for shorter_item in shorter_list:
          max_similarity = 0
          max_similarity_entry = None
          for longer_item in longer_list:
              similarity = row_similarity(shorter_item, longer_item, state == "All")
              if similarity > max_similarity:
                  max_similarity = similarity
                  max_similarity_entry = longer_item
  
          similarity_sum += max_similarity
          longer_list.remove(max_similarity_entry)
  
      return similarity_count, similarity_sum
code_tokens: def individual_similarity_sum ( disease1_name , disease2_name , state , start_date , end_date ) : cursor = db_connection . cursor ( ) query_end = ";" if state == "All" else " AND Admin1Name = '" + state + "';" query_disease1 = "SELECT PeriodStartDate, CountValue, Fatalities, Admin1Name FROM noncumulative_all_conditions " "WHERE ConditionName = '" + disease1_name + "' AND PeriodStartDate > " + start_date . replace ( '-' , '' ) + " AND PeriodStartDate < " + end_date . replace ( '-' , '' ) + query_end print ( query_disease1 ) cursor . execute ( query_disease1 ) disease1_data = cursor . fetchall ( ) query_disease2 = "SELECT PeriodStartDate, CountValue, Fatalities, Admin1Name FROM noncumulative_all_conditions " "WHERE ConditionName = '" + disease2_name + "' AND PeriodStartDate > " + start_date . replace ( '-' , '' ) + " AND PeriodStartDate < " + end_date . replace ( '-' , '' ) + query_end print ( query_disease2 ) cursor . execute ( query_disease2 ) disease2_data = cursor . fetchall ( ) print ( disease1_name , ':' , len ( disease1_data ) , 'rows' ) print ( disease2_name , ':' , len ( disease2_data ) , 'rows' ) if len ( disease1_data ) < len ( disease2_data ) : shorter_list = disease1_data longer_list = list ( disease2_data ) else : shorter_list = disease2_data longer_list = list ( disease1_data ) similarity_count = len ( shorter_list ) similarity_sum = 0 for shorter_item in shorter_list : max_similarity = 0 max_similarity_entry = None for longer_item in longer_list : similarity = row_similarity ( shorter_item , longer_item , state == "All" ) if similarity > max_similarity : max_similarity = similarity max_similarity_entry = longer_item similarity_sum += max_similarity longer_list . remove ( max_similarity_entry ) return similarity_count , similarity_sum
short_docstring: Sum similarity scores for pairs of records in a given location and date range
short_docstring_tokens: Sum similarity scores for pairs of records in a given location and date range
comment: """
      Sum similarity scores for pairs of records in a given location and date range
      :param disease1_name: Name of the first disease
      :param disease2_name: Name of the second disease
      :param state: state in which to search
      :param start_date: earliest date
      :param end_date: latest date
      :return: the sum of the similarity scores
      """$SEP$# find all records for the first condition$SEP$# find all records for the second condition$SEP$# determine which disease has more records$SEP$# compute similarity scores for pairs of records