def iteritems(self, key_type=None, return_all_keys=False):
if key_type is None:<EOL><INDENT>for item in self.items_dict.items():<EOL><INDENT>yield item<EOL><DEDENT>return<EOL><DEDENT>used_keys = set()<EOL>key = str(key_type)<EOL>if key in self.__dict__:<EOL><INDENT>for key, keys in self.__dict__[key].items():<EOL><INDENT>if keys in used_keys:<EOL><INDENT>continue<EOL><DEDENT>used_keys.add(keys)<EOL>value = self.items_dict[keys]<EOL>if not return_all_keys:<EOL><INDENT>keys = tuple(k for k in keys if isinstance(k, key_type))<EOL><DEDENT>yield keys, value<EOL><DEDENT><DEDENT>
Returns an iterator over the dictionary's (key, value) pairs.
            @param key_type if specified, iterator will be returning only (key,value) pairs for this type of key.
                   Otherwise (if not specified) ((keys,...), value) 
                   i.e. (tuple of keys, values) pairs for all items in this dictionary will be generated.
            @param return_all_keys if set to True - tuple of keys is retuned instead of a key of this type.