Lines Matching refs:elem
526 for elem in iterable:
527 mapping[elem] = mapping_get(elem, 0) + 1
552 >>> for elem in 'shazam': # update counts from an iterable
553 ... c[elem] += 1 # by adding 1 to each element's count
682 for elem, count in iterable.items():
683 self[elem] = count + self_get(elem, 0)
711 for elem, count in iterable.items():
712 self[elem] = self_get(elem, 0) - count
714 for elem in iterable:
715 self[elem] = self_get(elem, 0) - 1
726 def __delitem__(self, elem):
728 if elem in self:
729 super().__delitem__(elem)
822 for elem, count in self.items():
823 newcount = count + other[elem]
825 result[elem] = newcount
826 for elem, count in other.items():
827 if elem not in self and count > 0:
828 result[elem] = count
841 for elem, count in self.items():
842 newcount = count - other[elem]
844 result[elem] = newcount
845 for elem, count in other.items():
846 if elem not in self and count < 0:
847 result[elem] = 0 - count
860 for elem, count in self.items():
861 other_count = other[elem]
864 result[elem] = newcount
865 for elem, count in other.items():
866 if elem not in self and count > 0:
867 result[elem] = count
880 for elem, count in self.items():
881 other_count = other[elem]
884 result[elem] = newcount
890 for elem, count in self.items():
892 result[elem] = count
901 for elem, count in self.items():
903 result[elem] = 0 - count
908 nonpositive = [elem for elem, count in self.items() if not count > 0]
909 for elem in nonpositive:
910 del self[elem]
922 for elem, count in other.items():
923 self[elem] += count
935 for elem, count in other.items():
936 self[elem] -= count
948 for elem, other_count in other.items():
949 count = self[elem]
951 self[elem] = other_count
963 for elem, count in self.items():
964 other_count = other[elem]
966 self[elem] = other_count