def read_csv(csv_name):
data = {}<EOL>if int(sys.version[<NUM_LIT:0>]) == <NUM_LIT:2>:<EOL><INDENT>str_types = (str, unicode)<EOL><DEDENT>else:<EOL><INDENT>str_types = (bytes, str)<EOL><DEDENT>if not isinstance(csv_name, str_types):<EOL><INDENT>raise exceptions.InvalidDataFormat('<STR_LIT>')<EOL><DEDENT>with open(csv_name, '<STR_LIT:r>') as csv_data:<EOL><INDENT>reader = csv.reader(csv_data, delimiter='<STR_LIT:U+002C>', quotechar='<STR_LIT:|>')<EOL>for row in reader:<EOL><INDENT>try:<EOL><INDENT>key = to_epoch(row[<NUM_LIT:0>])<EOL>value = float(row[<NUM_LIT:1>])<EOL>data[key] = value<EOL><DEDENT>except ValueError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT>return data<EOL>
Read data from a csv file into a dictionary.
:param str csv_name: path to a csv file.
:return dict: a dictionary represents the data in file.