def from_dict(self, subj_files):
for group_label in subj_files:<EOL><INDENT>try:<EOL><INDENT>group_files = subj_files[group_label]<EOL>self.items.extend([self._load_image(get_abspath(imgf)) for imgf in group_files])<EOL>self.labels.extend([group_label]*len(group_files))<EOL><DEDENT>except Exception as exc:<EOL><INDENT>raise Exception('<STR_LIT>'<EOL>'<STR_LIT>'.format(group_label)) from exc<EOL><DEDENT><DEDENT>
Parameters
----------
subj_files: dict of str
    file_path -> int/str