/usr/lib/python3/dist-packages/h5netcdf/dimensions.py is in python3-h5netcdf 0.5.0-1.
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 | from collections import MutableMapping
class Dimensions(MutableMapping):
def __init__(self, group):
self._group = group
def __getitem__(self, key):
return self._group._dim_sizes[key]
def __setitem__(self, key, value):
self._group._create_dimension(key, value)
def __delitem__(self, key):
raise NotImplementedError('cannot yet delete dimensions')
def __iter__(self):
for key in self._group._dim_sizes:
yield key
def __len__(self):
return len(self._group._dim_sizes)
def __repr__(self):
if self._group._root._closed:
return '<Closed h5netcdf.Dimensions>'
return ('<h5netcdf.Dimensions: %s>' %
', '.join('%s=%r' % (k, v) for k, v in self.items()))
|