def __init__(self, *args, **kwargs):
<EOL>if args and (args[<NUM_LIT:0>] is None or callable(args[<NUM_LIT:0>])):<EOL><INDENT>self._key = args[<NUM_LIT:0>]<EOL>args = args[<NUM_LIT:1>:]<EOL><DEDENT>else:<EOL><INDENT>self._key = None<EOL><DEDENT>if self._key is None:<EOL><INDENT>self._list = SortedList()<EOL><DEDENT>else:<EOL><INDENT>self._list = SortedListWithKey(key=self._key)<EOL><DEDENT>_dict = super(SortedDict, self)<EOL>self._dict = _dict<EOL>self._clear = _dict.clear<EOL>self._delitem = _dict.__delitem__<EOL>self._iter = _dict.__iter__<EOL>self._pop = _dict.pop<EOL>self._setdefault = _dict.setdefault<EOL>self._setitem = _dict.__setitem__<EOL>self._dict_update = _dict.update<EOL>_list = self._list<EOL>self._list_add = _list.add<EOL>self.bisect_left = _list.bisect_left<EOL>self.bisect = _list.bisect_right<EOL>self.bisect_right = _list.bisect_right<EOL>self._list_clear = _list.clear<EOL>self.index = _list.index<EOL>self._list_pop = _list.pop<EOL>self._list_remove = _list.remove<EOL>self._list_update = _list.update<EOL>self.irange = _list.irange<EOL>self.islice = _list.islice<EOL>self._reset = _list._reset  <EOL>if self._key is not None:<EOL><INDENT>self.bisect_key_left = _list.bisect_key_left<EOL>self.bisect_key_right = _list.bisect_key_right<EOL>self.bisect_key = _list.bisect_key<EOL>self.irange_key = _list.irange_key<EOL><DEDENT>self.iloc = _IlocWrapper(self)<EOL>self._update(*args, **kwargs)<EOL>
SortedDict provides the same methods as a dict.  Additionally, SortedDict
        efficiently maintains its keys in sorted order. Consequently, the keys
        method will return the keys in sorted order, the popitem method will
        remove the item with the highest key, etc.

        An optional *key* argument defines a callable that, like the `key`
        argument to Python's `sorted` function, extracts a comparison key from
        each dict key. If no function is specified, the default compares the
        dict keys directly. The `key` argument must be provided as a positional
        argument and must come before all other arguments.

        An optional *iterable* argument provides an initial series of items to
        populate the SortedDict.  Each item in the series must itself contain
        two items.  The first is used as a key in the new dictionary, and the
        second as the key's value. If a given key is seen more than once, the
        last value associated with it is retained in the new dictionary.

        If keyword arguments are given, the keywords themselves with their
        associated values are added as items to the dictionary. If a key is
        specified both in the positional argument and as a keyword argument, the
        value associated with the keyword is retained in the dictionary. For
        example, these all return a dictionary equal to ``{"one": 2, "two":
        3}``:

        * ``SortedDict(one=2, two=3)``
        * ``SortedDict({'one': 2, 'two': 3})``
        * ``SortedDict(zip(('one', 'two'), (2, 3)))``
        * ``SortedDict([['two', 3], ['one', 2]])``

        The first example only works for keys that are valid Python
        identifiers; the others work with any valid keys.