

def setdefault(self, key, defval=None):
    '\n        >>> d = OrderedDict(((1, 3), (3, 2), (2, 1)))\n        >>> d.setdefault(1)\n        3\n        >>> d.setdefault(4) is None\n        True\n        >>> d\n        OrderedDict([(1, 3), (3, 2), (2, 1), (4, None)])\n        >>> d.setdefault(5, 0)\n        0\n        >>> d\n        OrderedDict([(1, 3), (3, 2), (2, 1), (4, None), (5, 0)])\n        '
    if (key in self):
        return self[key]
    else:
        self[key] = defval
        return defval

dataset/ETHPy150Open editorconfig/editorconfig-vim/plugin/editorconfig-core-py/editorconfig/odict.py OrderedDict.setdefault/original