def to_normalized(self, doc):
        # make the new dict actually contain real items
        normed = {}
        do_not_include = ['docID', 'doc', 'filetype', 'timestamps', 'source', 'versions', 'key']
        for key, value in dict(doc).items():
            if value and key not in do_not_include:
                try:
                    normed[key] = json.loads(value)
                except (ValueError, __HOLE__):
                    normed[key] = value

        if normed.get('versions'):
            normed['versions'] = list(map(str, normed['versions']))

        # No datetime means the document wasn't normalized (probably wasn't on the approved list)
        # TODO - fix odd circular import that makes us import this here
        from scrapi.base.helpers import datetime_formatter
        if normed.get('providerUpdatedDateTime'):
            normed['providerUpdatedDateTime'] = datetime_formatter(normed['providerUpdatedDateTime'].isoformat())
        else:
            return None

        return NormalizedDocument(normed, validate=False, clean=False)
dataset/ETHPy150Open CenterForOpenScience/scrapi/scrapi/processing/cassandra.py/CassandraProcessor.to_normalized