def _read_family(fname, all_cat, template):
detections = []<EOL>with open(fname, '<STR_LIT:r>') as f:<EOL><INDENT>for line in f:<EOL><INDENT>det_dict = {}<EOL>gen_event = False<EOL>for key_pair in line.rstrip().split('<STR_LIT:;>'):<EOL><INDENT>key = key_pair.split('<STR_LIT>')[<NUM_LIT:0>].strip()<EOL>value = key_pair.split('<STR_LIT>')[-<NUM_LIT:1>].strip()<EOL>if key == '<STR_LIT>':<EOL><INDENT>if len(all_cat) == <NUM_LIT:0>:<EOL><INDENT>gen_event = True<EOL>continue<EOL><DEDENT>el = [e for e in all_cat<EOL>if str(e.resource_id).split('<STR_LIT:/>')[-<NUM_LIT:1>] == value][<NUM_LIT:0>]<EOL>det_dict.update({'<STR_LIT>': el})<EOL><DEDENT>elif key == '<STR_LIT>':<EOL><INDENT>det_dict.update(<EOL>{'<STR_LIT>': UTCDateTime(value)})<EOL><DEDENT>elif key == '<STR_LIT>':<EOL><INDENT>det_dict.update({'<STR_LIT>': ast.literal_eval(value)})<EOL><DEDENT>elif key in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT:id>',<EOL>'<STR_LIT>']:<EOL><INDENT>det_dict.update({key: value})<EOL><DEDENT>elif key == '<STR_LIT>':<EOL><INDENT>det_dict.update({key: int(float(value))})<EOL><DEDENT>elif len(key) == <NUM_LIT:0>:<EOL><INDENT>continue<EOL><DEDENT>else:<EOL><INDENT>det_dict.update({key: float(value)})<EOL><DEDENT><DEDENT>detection = Detection(**det_dict)<EOL>if gen_event:<EOL><INDENT>detection._calculate_event(template=template)<EOL><DEDENT>detections.append(detection)<EOL><DEDENT><DEDENT>return detections<EOL>
Internal function to read csv family files.

:type fname: str
:param fname: Filename
:return: list of Detection