code: def remove(self, elem):
          
          try:
              return self._collection.remove(elem)
          except KeyError:
              raise KeyError("'{}' was not found in the {}: '{}'.".format(elem, type(self).__name__, self)) from None
docs: Removes _elem_ from the collection, will raise a KeyError is _elem_ is missing
  
          # Parameters
  
          _elem_ : `object`
  
          > The object to be removed