'A dictionary of shared locations whose keys are in the set \'prefix\',
\'purelib\', \'platlib\', \'scripts\', \'headers\', \'data\' and \'namespace\'.
The corresponding value is the absolute path of that category for
this distribution, and takes into account any paths selected by the
user at installation time (e.g. via command-line arguments). In the
case of the \'namespace\' key, this would be a list of absolute paths
for the roots of namespace packages in this distribution.
The first time this property is accessed, the relevant information is
read from the SHARED file in the .dist-info directory.'

@cached_property
def shared_locations(self):

    result = {}
    shared_path = os.path.join(self.path, u'SHARED')
    if os.path.isfile(shared_path):
        with codecs.open(shared_path, u'r', encoding=u'utf-8') as f:
            lines = f.read().splitlines()
        for line in lines:
            (key, value) = line.split(u'=', 1)
            if (key == u'namespace'):
                result.setdefault(key, []).append(value)
            else:
                result[key] = value
    return result
