class_docstr: A persistent bag/multiset type.
  
  Requires elements to be hashable, and allows duplicates, but has no
  ordering. Bags are hashable.
  
  Do not instantiate directly, instead use the factory functions :py:func:`b`
  or :py:func:`pbag` to create an instance.
  
  Some examples:
  
  >>> s = pbag([1, 2, 3, 1])
  >>> s2 = s.add(4)
  >>> s3 = s2.remove(1)
  >>> s
  pbag([1, 1, 2, 3])
  >>> s2
  pbag([1, 1, 2, 3, 4])
  >>> s3
  pbag([1, 2, 3, 4])
docstr: Check if two bags are equivalent, honoring the number of duplicates,
  and ignoring insertion order.
  
  >>> pbag([1, 1, 2]) == pbag([1, 2])
  False
  >>> pbag([2, 1, 0]) == pbag([0, 1, 2])
  True
docstr_tok: ["Check","if","two","bags","are","equivalent",",","honoring","the","number","of","duplicates",",","and","ignoring","insertion","order",".",">",">",">","pbag","(","[","1",",","1",",","2","]",")","==","pbag","(","[","1",",","2","]",")","False",">",">",">","pbag","(","[","2",",","1",",","0","]",")","==","pbag","(","[","0",",","1",",","2","]",")","True"]
code: def __eq__(self, other):
      """
      Check if two bags are equivalent, honoring the number of duplicates,
      and ignoring insertion order.
  
      >>> pbag([1, 1, 2]) == pbag([1, 2])
      False
      >>> pbag([2, 1, 0]) == pbag([0, 1, 2])
      True
      """
      if type(other) is not PBag:
          raise TypeError("Can only compare PBag with PBags")
      return self._counts == other._counts
  
imports: from collections.abc import Container, Iterable, Sized, Hashable
  from functools import reduce
  from typing import Generic, TypeVar
  from pyrsistent._pmap import pmap
label_desc: Use image node_id 10 for calling the PBag obj's underlying member method code with example usage: obj.__eq__(other) and returns: unknown