def add(self, k, v=None):
        """
        Add an element v to a set DS[k].
        This has no effect if the element v is already present in DS[k].
        
        When v is not supplied adds a new set at DS[k].
        Raises KeyError if k is not hashable.
        """

        if k not in self.keys():
            self[k] = set()
            
        if v != None:
            self[k].add(v)

        Add an element v to a set DS[k].
        This has no effect if the element v is already present in DS[k].
        
        When v is not supplied adds a new set at DS[k].
        Raises KeyError if k is not hashable.
        
recipes/Python/577702_DictSet__specialized_Pythcontainer_datatype/recipe-577702.py