MCPcopy Index your code
hub / github.com/python/cpython / _count_elements

Function _count_elements

Lib/collections/__init__.py:540–544  ·  view source on GitHub ↗

Tally elements from the iterable.

(mapping, iterable)

Source from the content-addressed store, hash-verified

538########################################################################
539
540def _count_elements(mapping, iterable):
541 'Tally elements from the iterable.'
542 mapping_get = mapping.get
543 for elem in iterable:
544 mapping[elem] = mapping_get(elem, 0) + 1
545
546try: # Load C helper function if available
547 from _collections import _count_elements

Callers 2

test_helper_functionMethod · 0.90
updateMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_helper_functionMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…