original_docstring: 
      Compute similarity between two rows by normalizing the attribute differences
      :param row1: The first row
      :param row2: Th second row
      :param compare_state: True if location should be considered in the comparison
      :return: a similarity score in the range [0, 1]
      
docstring: Compute similarity between two rows by normalizing the attribute differences
docstring_tokens: Compute similarity between two rows by normalizing the attribute differences
code: def row_similarity(row1, row2, compare_state):
      """
      Compute similarity between two rows by normalizing the attribute differences
      :param row1: The first row
      :param row2: Th second row
      :param compare_state: True if location should be considered in the comparison
      :return: a similarity score in the range [0, 1]
      """
      global date_range
      similarity = 0
  
      # PeriodStartDate
      date1 = datetime.combine(row1[0], datetime.min.time())
      date2 = datetime.combine(row2[0], datetime.min.time())
      date_diff = abs((date1 - date2).days)
      similarity += (date_range - date_diff)/date_range
  
      # CountValue
      count1 = float(row1[1])
      count2 = float(row2[1])
      if count1 > 0 and count2 > 0:
          similarity += min(count1/count2, count2/count1)
  
      # Fatality
      if row1[2] == row2[2]:
          similarity += 1
  
      # Admin1Name
      if compare_state and row1[3] == row2[3]:
          similarity += 1
  
      return similarity/len(row1)
code_tokens: def row_similarity ( row1 , row2 , compare_state ) : global date_range similarity = 0 date1 = datetime . combine ( row1 [ 0 ] , datetime . min . time ( ) ) date2 = datetime . combine ( row2 [ 0 ] , datetime . min . time ( ) ) date_diff = abs ( ( date1 - date2 ) . days ) similarity += ( date_range - date_diff ) / date_range count1 = float ( row1 [ 1 ] ) count2 = float ( row2 [ 1 ] ) if count1 > 0 and count2 > 0 : similarity += min ( count1 / count2 , count2 / count1 ) if row1 [ 2 ] == row2 [ 2 ] : similarity += 1 if compare_state and row1 [ 3 ] == row2 [ 3 ] : similarity += 1 return similarity / len ( row1 )
short_docstring: Compute similarity between two rows by normalizing the attribute differences
short_docstring_tokens: Compute similarity between two rows by normalizing the attribute differences
comment: """
      Compute similarity between two rows by normalizing the attribute differences
      :param row1: The first row
      :param row2: Th second row
      :param compare_state: True if location should be considered in the comparison
      :return: a similarity score in the range [0, 1]
      """$SEP$# PeriodStartDate$SEP$# CountValue$SEP$# Fatality$SEP$# Admin1Name