def __init__(self, filename):
        try:
            self.data = plistlib.readPlist(filename)
        except __HOLE__ as err:  # See #25.
            if str(err) == "'NoneType' object has no attribute 'groupdict'":
                raise PlistError(
                    'Unable to parse {} due to invalid ISO 8601 date.'
                    .format(filename))
            raise
        except IOError as err:
            raise PlistError('Unable to read {}: {}'.format(filename, repr(err)))

        # Required fields
        if "Creation Date" not in self.data:
            raise KeyError("Creation Date")

        # aliases and flattening
        self.data['Text'] = self.data.pop('Entry Text', "")
        for key in ['Location', 'Weather', 'Music', 'Creator']:
            if key in self.data:
                new_keys = ((k, v) for k, v in self.data[key].items()
                            if k not in self.data) # prevent overwrite
                self.data.update(new_keys)
dataset/ETHPy150Open nathangrigg/dayone_export/dayone_export/__init__.py/Entry.__init__