def set_options_from_dict(self, data_dict, filename=None):
if filename is not None:<EOL><INDENT>filename = os.path.dirname(filename)<EOL><DEDENT>for k in data_dict:<EOL><INDENT>if not isinstance(data_dict[k], dict):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>for sk in data_dict[k]:<EOL><INDENT>if self.gc[(self.gc["<STR_LIT>"] == k) &<EOL>(self.gc["<STR_LIT>"] == sk)].shape[<NUM_LIT:0>] == <NUM_LIT:0>:<EOL><INDENT>continue<EOL><DEDENT>if isinstance(data_dict[k][sk], six.string_types):<EOL><INDENT>data_dict[k][sk] = str(data_dict[k][sk])<EOL><DEDENT>_type = self.gc[(self.gc["<STR_LIT>"] == k) &<EOL>(self.gc["<STR_LIT>"] == sk)][["<STR_LIT:type>"]].values[<NUM_LIT:0>]<EOL>data_dict[k][sk] = ev.cast(data_dict[k][sk], _type)<EOL>if self.get_option(k, sk, True) != data_dict[k][sk]:<EOL><INDENT>try:<EOL><INDENT>self.set_option(k, sk, data_dict[k][sk])<EOL><DEDENT>except IOError:<EOL><INDENT>if filename is None:<EOL><INDENT>raise IOError('<STR_LIT>'.format(k, sk))<EOL><DEDENT>npat = os.path.join(filename, data_dict[k][sk])<EOL>self.set_option(k, sk, os.path.normpath(npat))<EOL><DEDENT>except ValueError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT><DEDENT>
Load options from a dictionary.

        :param dict data_dict: Dictionary with the options to load.
        :param str filename: If provided, assume that non-absolute
            paths provided are in reference to the file.