def check_data_redundancy(self, file_path='<STR_LIT>', dict_to_check={}):
count = <NUM_LIT:0><EOL>exists = os.path.isfile(file_path)<EOL>previous_dates = {}<EOL>if exists:<EOL><INDENT>with open(file_path, '<STR_LIT:r>') as input:<EOL><INDENT>input.readline()<EOL>for row in csv.reader(input):<EOL><INDENT>timestamp = calendar.timegm(time.strptime(row[<NUM_LIT:0>],<EOL>'<STR_LIT>'))<EOL>if timestamp in dict_to_check:<EOL><INDENT>del dict_to_check[timestamp]<EOL><DEDENT>count += <NUM_LIT:1><EOL><DEDENT><DEDENT>input.close()<EOL><DEDENT>return count<EOL>
Checks the given csv file against the json data scraped for the given
dict. It will remove all data retrieved that has already been recorded
so we don't write redundant data to file. Returns count of rows from
file.