def __init__(self, initializing_dictionary, default_dict_factory=None):
        """
        Initializes the OptionLoop.

        @param initializing_dictionary :
        The basis of the option loop.
        The various options to iterate are the keys of the dictionary,
        while the value(s) associated with the key are iterated over

        @param default_dict_factory :
        if not None, default dicts will be returned using this factory
        """

        assert isinstance(initializing_dictionary, dict)

        self.mydict = initializing_dictionary.copy()
        self.index = 0
        self.end_index = None
        for key, value in six.iteritems(self.mydict):
            if isinstance(value, (str, bytes)):
                self.mydict[key] = [value]
                size = 1
            else:
                try:
                    size = len(value)
                except TypeError:
                    self.mydict[key] = [value]
                    size = len([value])

            if self.end_index is None:
                self.end_index = 1
            # the maximum index is the multiplicative sum
            # of the length of all interior arrays
            self.end_index *= size
        self.default_dict_factory = default_dict_factory
        self.use_dd = default_dict_factory is not None
def __init__ ( self , initializing_dictionary , default_dict_factory = None ) : assert isinstance ( initializing_dictionary , dict ) self . mydict = initializing_dictionary . copy ( ) self . index = 0 self . end_index = None for key , value in six . iteritems ( self . mydict ) : if isinstance ( value , ( str , bytes ) ) : self . mydict [ key ] = [ value ] size = 1 else : try : size = len ( value ) except TypeError : self . mydict [ key ] = [ value ] size = len ( [ value ] ) if self . end_index is None : self . end_index = 1 self . end_index *= size self . default_dict_factory = default_dict_factory self . use_dd = default_dict_factory is not None
Initializes the OptionLoop.

        @param initializing_dictionary :
        The basis of the option loop.
        The various options to iterate are the keys of the dictionary,
        while the value(s) associated with the key are iterated over

        @param default_dict_factory :
        if not None, default dicts will be returned using this factory