def from_mapping(cls, mapping):
		"""Create a bag from a dict of elem->count.

		Each key in the dict is added if the value is > 0.

		Raises:
			ValueError: If any count is < 0.
		"""
		out = cls()
		for elem, count in mapping.items():
			out._set_count(elem, count)
		return out
def from_mapping ( cls , mapping ) : out = cls ( ) for elem , count in mapping . items ( ) : out . _set_count ( elem , count ) return out
Create a bag from a dict of elem->count.

		Each key in the dict is added if the value is > 0.

		Raises:
			ValueError: If any count is < 0.