/usr/lib/python2.7/dist-packages/sekizai/data.py is in python-django-sekizai 0.10.0-2.
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 25 26 27 28 29 30 31 | try:
from collections import MutableSequence
except ImportError:
from backport_collections import MutableSequence
class UniqueSequence(MutableSequence):
def __init__(self):
self.data = []
def __contains__(self, item):
return item in self.data
def __iter__(self):
return iter(self.data)
def __getitem__(self, item):
return self.data[item]
def __setitem__(self, key, value):
self.data[key] = value
def __delitem__(self, key):
del self.data[key]
def __len__(self):
return len(self.data)
def insert(self, index, value):
if value not in self:
self.data.insert(index, value)
|