
    rh%                    f    S SK Jr  S SKrS SKrSSS jjr\S:X  a  S SKr\R                  " 5         gg)    )annotationsNc                    [         R                  " 5       nU  H,  n[        X15      (       d  M  [        X15      nX$==   S-  ss'   M.     U$ )a  
Return a collections.Counter of attribute usage for elements in a stream
or StreamIterator

>>> bach = corpus.parse('bach/bwv324.xml')
>>> bachIter = bach.parts[0].recurse().getElementsByClass(note.Note)
>>> qlCount = analysis.elements.attributeCount(bachIter, 'quarterLength')
>>> qlCount.most_common(3)
[(1.0, 12), (2.0, 11), (4.0, 2)]

* Changed in v4: Returns a collections.Counter object.
   )collectionsCounterhasattrgetattr)streamOrStreamIterattrNameposteks        S/home/james-whalen/.local/lib/python3.13/site-packages/music21/analysis/elements.pyattributeCountr      sC     (3':':'<D1$AGqLG   K    __main__)quarterLength)returnzcollections.Counter[t.Any])	
__future__r   r   typingtr   __name__music21mainTest r   r   <module>r      s3    #  * z r   