parameters: (self, key=None, default=None, kwargs=None)
return_statement: return weakref.WeakKeyDictionary.setdefault(self, key, default)
docstring: Sets the default value if key is not in dict, and returns the value.
docstring_summary: Sets the default value if key is not in dict, and returns the value.
docstring_tokens: Sets the default value if key is not in dict and returns the value .
function: def setdefault(self, key=None, default=None, kwargs=None):
      """Sets the default value if key is not in dict, and returns the value."""
      if key is None:
        key = self._key()
      kwargs = kwargs or {}
  
      if default is None and key not in self:
        default = self.default_factory(**kwargs)
      return weakref.WeakKeyDictionary.setdefault(self, key, default)
function_tokens: def setdefault ( self , key = None , default = None , kwargs = None ) : if key is None : key = self . _key ( ) kwargs = kwargs or { } if default is None and key not in self : default = self . default_factory ( * * kwargs ) return weakref . WeakKeyDictionary . setdefault ( self , key , default )