def csv_to_dict(file_name, file_location):
file = __os.path.join(file_location, file_name)<EOL>try:<EOL><INDENT>csv_read = open(file, "<STR_LIT:r>")<EOL><DEDENT>except Exception as e:<EOL><INDENT>LOGGER.critical('<STR_LIT>'.format(error=e))<EOL>print('<STR_LIT>'.format(error=e))<EOL>csv_read = open(file, "<STR_LIT:r>", errors='<STR_LIT:ignore>')<EOL><DEDENT>data_row = __csv.DictReader(csv_read, dialect="<STR_LIT>")<EOL>dict_key = <NUM_LIT:1><EOL>temp_dict = dict()<EOL>for row in data_row:<EOL><INDENT>temp_dict[dict_key] = row<EOL>dict_key += <NUM_LIT:1><EOL><DEDENT>csv_read.close()<EOL>return temp_dict<EOL>
Function to import a csv as a dictionary
Args:
    file_name: The name of the csv file
    file_location: The location of the file, derive from the os module

Returns: returns a dictionary