(self, dict_or_str, val=None, warn=True)
return self
initialize one or several options.

        Arguments
        ---------
            `dict_or_str`
                a dictionary if ``val is None``, otherwise a key.
                If `val` is provided `dict_or_str` must be a valid key.
            `val`
                value for key

        Details
        -------
        Only known keys are accepted. Known keys are in `Options.defaults()`
initialize one or several options.
initialize one or several options .
def init(self, dict_or_str, val=None, warn=True):
        """initialize one or several options.

        Arguments
        ---------
            `dict_or_str`
                a dictionary if ``val is None``, otherwise a key.
                If `val` is provided `dict_or_str` must be a valid key.
            `val`
                value for key

        Details
        -------
        Only known keys are accepted. Known keys are in `Options.defaults()`

        """
        #dic = dict_or_key if val is None else {dict_or_key:val}
        dic = dict_or_str
        if val is not None:
            dic = {dict_or_str:val}

        for key, val in list(dic.items()):
            if key not in Options.defaults():
                # TODO: find a better solution?
                if warn:
                    print('Warning in cma.Options.init(): key ' +
                        str(key) + ' ignored')
            else:
                self[key] = val

        return self
def init ( self , dict_or_str , val = None , warn = True ) : #dic = dict_or_key if val is None else {dict_or_key:val} dic = dict_or_str if val is not None : dic = { dict_or_str : val } for key , val in list ( dic . items ( ) ) : if key not in Options . defaults ( ) : # TODO: find a better solution? if warn : print ( 'Warning in cma.Options.init(): key ' + str ( key ) + ' ignored' ) else : self [ key ] = val return self