/usr/lib/python2.7/dist-packages/otherstuf/counterstuf.py is in python-otherstuf 1.1.0-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | """
Sidecar to `stuf` that adds `Counter`-like
container `counterstuf`
"""
try:
from collections import Counter
except ImportError:
from stuf.collects import Counter
class counterstuf(Counter):
"""stuf-like surfacing of Counter"""
def __getattr__(self, key):
return self[key]
def __setattr__(self, key, value):
self[key] = value
def update_self(self, *args, **kwargs):
self.update(*args, **kwargs)
return self
def copy(self):
return counterstuf(Counter.copy(self))
|