parameters: (self, element)
return_statement: return PBag(newc)
docstring: Remove an element from the bag.
  
          >>> s = pbag([1, 1, 2])
          >>> s2 = s.remove(1)
          >>> s3 = s.remove(2)
          >>> s2
          pbag([1, 2])
          >>> s3
          pbag([1, 1])
docstring_summary: Remove an element from the bag.
docstring_tokens: Remove an element from the bag .
function: def remove(self, element):
          """
          Remove an element from the bag.
  
          >>> s = pbag([1, 1, 2])
          >>> s2 = s.remove(1)
          >>> s3 = s.remove(2)
          >>> s2
          pbag([1, 2])
          >>> s3
          pbag([1, 1])
          """
          if element not in self._counts:
              raise KeyError(element)
          elif self._counts[element] == 1:
              newc = self._counts.remove(element)
          else:
              newc = self._counts.set(element, self._counts[element] - 1)
          return PBag(newc)
function_tokens: def remove ( self , element ) : if element not in self . _counts : raise KeyError ( element ) elif self . _counts [ element ] == 1 : newc = self . _counts . remove ( element ) else : newc = self . _counts . set ( element , self . _counts [ element ] - 1 ) return PBag ( newc )