/usr/lib/python3/dist-packages/h5netcdf/utils.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 | from collections import Mapping
import numpy as np
class Frozen(Mapping):
"""Wrapper around an object implementing the mapping interface to make it
immutable. If you really want to modify the mapping, the mutable version is
saved under the `_mapping` attribute.
"""
def __init__(self, mapping):
self._mapping = mapping
def __getitem__(self, key):
return self._mapping[key]
def __iter__(self):
return iter(self._mapping)
def __len__(self):
return len(self._mapping)
def __contains__(self, key):
return key in self._mapping
def __repr__(self):
return '%s(%r)' % (type(self).__name__, self._mapping)
|