<commit_before>"""PROV-JSON serializers for ProvDocument

@author: <NAME> <<EMAIL>>
@copyright: University of Southampton 2014
"""
import logging
logger = logging.getLogger(__name__)

from collections import defaultdict
import datetime
import json
from prov import Serializer, Error
from prov.constants import *
<<<<<<< HEAD
from prov.model import (Literal, Identifier, QName, Namespace, ProvDocument,
                        first, parse_xsd_datetime)
=======
from prov.model import Literal, Identifier, QualifiedName, XSDQName, Namespace, ProvDocument, ProvBundle, \
    first, parse_xsd_datetime
>>>>>>> upstream/master


class ProvJSONException(Error):
    pass


class AnonymousIDGenerator():
    def __init__(self):
        self._cache = {}
        self._count = 0

    def get_anon_id(self, obj, local_prefix="id"):
        if obj not in self._cache:
            self._count += 1
            self._cache[obj] = Identifier('_:%s%d' % (local_prefix, self._count))
        return self._cache[obj]


# Reverse map for prov.model.XSD_DATATYPE_PARSERS
LITERAL_XSDTYPE_MAP = {
    float: u"xsd:double",
    long: u"xsd:long",
    int: u"xsd:int"
    # boolean, string values are supported natively by PROV-JSON
    # datetime values are converted separately
}<commit_msg>fix: remove diff statement<commit_after>"""PROV-JSON serializers for ProvDocument

@author: <NAME> <<EMAIL>>
@copyright: University of Southampton 2014
"""
import logging
logger = logging.getLogger(__name__)

from collections import defaultdict
import datetime
import json
from prov import Serializer, Error
from prov.constants import *
from prov.model import (Literal, Identifier, QualifiedName, XSDQName, Namespace,
                        ProvDocument, ProvBundle, first, parse_xsd_datetime)


class ProvJSONException(Error):
    pass


class AnonymousIDGenerator():
    def __init__(self):
        self._cache = {}
        self._count = 0

    def get_anon_id(self, obj, local_prefix="id"):
        if obj not in self._cache:
            self._count += 1
            self._cache[obj] = Identifier('_:%s%d' % (local_prefix, self._count))
        return self._cache[obj]


# Reverse map for prov.model.XSD_DATATYPE_PARSERS
LITERAL_XSDTYPE_MAP = {
    float: u"xsd:double",
    long: u"xsd:long",
    int: u"xsd:int"
    # boolean, string values are supported natively by PROV-JSON
    # datetime values are converted separately
}
{'fraction_non_alphanumeric': 0.10366361365528726, 'fraction_numerical': 0.004995836802664446, 'mean_word_length': 3.666019417475728, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5602379', 'n_tokens_mistral': 736, 'n_tokens_neox': 700, 'n_words': 205}