def remove(self, k, v=None):
        """
        Remove element v from a set DS[k]; it must be a member.
        If the element v is not a member of D[k], raise a KeyError.
            
        If v is not supplied removes DS[k]; it must be an item.
        if D[k] is not an item, raise a KeyError.
        """
        if k not in self.keys():
            raise KeyError(k)
        
        if v != None:
            self[k].remove(v)
        else:
            del self[k]

        Remove element v from a set DS[k]; it must be a member.
        If the element v is not a member of D[k], raise a KeyError.
            
        If v is not supplied removes DS[k]; it must be an item.
        if D[k] is not an item, raise a KeyError.
        
recipes/Python/577702_DictSet__specialized_Pythcontainer_datatype/recipe-577702.py