(self, diff_file, matching_string)
return count
Returns the difference between the number of string occurences in
        the added lines and deleted lines (which one is subtracted from the
        other depends on _index_for_zero_value).
Returns the difference between the number of string occurences in
        the added lines and deleted lines (which one is subtracted from the
        other depends on _index_for_zero_value).
Returns the difference between the number of string occurences in the added lines and deleted lines ( which one is subtracted from the other depends on _index_for_zero_value ) .
def _instance_difference(self, diff_file, matching_string):
        '''Returns the difference between the number of string occurences in
        the added lines and deleted lines (which one is subtracted from the
        other depends on _index_for_zero_value).'''
        count = 0
        for diff_line in diff_file:
            # If the line is unchanged, then don't examine it.
            if diff_line[self._index_for_zero_value] and diff_line[1 - self._index_for_zero_value]:
                continue
            location_found = -len(matching_string)
            while True:
                location_found = diff_line[2].find(matching_string, location_found + len(matching_string))
                if location_found == -1:
                    break
                if not diff_line[self._index_for_zero_value]:
                    count += 1
                else:
                    count -= 1
        return count
def _instance_difference ( self , diff_file , matching_string ) : count = 0 for diff_line in diff_file : # If the line is unchanged, then don't examine it. if diff_line [ self . _index_for_zero_value ] and diff_line [ 1 - self . _index_for_zero_value ] : continue location_found = - len ( matching_string ) while True : location_found = diff_line [ 2 ] . find ( matching_string , location_found + len ( matching_string ) ) if location_found == - 1 : break if not diff_line [ self . _index_for_zero_value ] : count += 1 else : count -= 1 return count