<commit_before>from collections import deque
from copy import deepcopy
from hashlib import sha256
from typing import Iterable, Any, List

from ledger.compact_merkle_tree import CompactMerkleTree
from ledger.serializers.compact_serializer import CompactSerializer
from ledger.serializers.json_serializer import JsonSerializer
from ledger.stores.file_hash_store import FileHashStore
from orderedset._orderedset import OrderedSet
from state.pruning_state import PruningState

from plenum.common.constants import VERSION, \
    POOL_TXN_TYPES, NODE_PRIMARY_STORAGE_SUFFIX, \
    HASH, ENC, RAW, DOMAIN_LEDGER_ID, POOL_LEDGER_ID, LedgerState
from plenum.common.exceptions import InvalidClientRequest
from plenum.common.ledger import Ledger
from plenum.common.types import Reply, RequestAck, f, \
    OPERATION, LedgerStatus
from plenum.common.util import error
from plenum.persistence.storage import initStorage, initKeyValueStorage
from plenum.persistence.util import txnsWithMerkleInfo
from plenum.server.node import Node as PlenumNode
from sovrin_client.client.wallet.wallet import Wallet
from sovrin_common.config_util import getConfig
from sovrin_common.constants import TXN_TYPE, allOpKeys, ATTRIB, GET_ATTR, \
    DATA, GET_NYM, reqOpKeys, GET_TXNS, GET_SCHEMA, GET_CLAIM_DEF, ACTION, \
    NODE_UPGRADE, COMPLETE, FAIL, CONFIG_LEDGER_ID, POOL_UPGRADE
from sovrin_common.constants import openTxns, \
    validTxnTypes, IDENTITY_TXN_TYPES, CONFIG_TXN_TYPES
from sovrin_common.txn_util import getTxnOrderedFields
from sovrin_common.types import Request, SafeRequest
from sovrin_node.persistence.attribute_store import AttributeStore
from sovrin_node.persistence.idr_cache import IdrCache
from sovrin_node.server.client_authn import TxnBasedAuthNr
from sovrin_node.server.config_req_handler import ConfigReqHandler
from sovrin_node.server.domain_req_handler import DomainReqHandler
from sovrin_node.server.node_authn import NodeAuthNr
from sovrin_node.server.pool_manager import HasPoolManager
from sovrin_node.server.upgrader import Upgrader
from stp_core.common.log import getlogger
import os


logger = getlogger()
jsonSerz = JsonSerializer()


class Node(PlenumNode, HasPoolManager):
    keygenScript = "init_sovrin_keys"
    _client_request_class = SafeRequest
    ledger_ids = PlenumNode.ledger_ids + [CONFIG_LEDGER_ID]
    _wallet_class = Wallet

    def __init__(self,
                 name,
                 nodeRegistry=None,
                 clientAuthNr=None,
                 ha=None,
                 cliname=None,
                 cliha=None,
                 basedirpath=None,
                 primaryDecider=None,
                 pluginPaths: Iterable[str] = None,
                 storage=None,
                 config=None):
        self.config = config or getConfig()

        # TODO: 3 ugly lines ahead, don't know how to avoid
        # self.stateTreeStore = None
        self.idrCache = None
        self.attributeStore = None
<commit_msg>fix dependency on a client<commit_after>from collections import deque
from copy import deepcopy
from hashlib import sha256
from typing import Iterable, Any, List

from ledger.compact_merkle_tree import CompactMerkleTree
from ledger.serializers.compact_serializer import CompactSerializer
from ledger.serializers.json_serializer import JsonSerializer
from ledger.stores.file_hash_store import FileHashStore
from orderedset._orderedset import OrderedSet
from state.pruning_state import PruningState

from plenum.common.constants import VERSION, \
    POOL_TXN_TYPES, NODE_PRIMARY_STORAGE_SUFFIX, \
    HASH, ENC, RAW, DOMAIN_LEDGER_ID, POOL_LEDGER_ID, LedgerState
from plenum.common.exceptions import InvalidClientRequest
from plenum.common.ledger import Ledger
from plenum.common.types import Reply, RequestAck, f, \
    OPERATION, LedgerStatus
from plenum.common.util import error
from plenum.persistence.storage import initStorage, initKeyValueStorage
from plenum.persistence.util import txnsWithMerkleInfo
from plenum.server.node import Node as PlenumNode
from sovrin_common.config_util import getConfig
from sovrin_common.constants import TXN_TYPE, allOpKeys, ATTRIB, GET_ATTR, \
    DATA, GET_NYM, reqOpKeys, GET_TXNS, GET_SCHEMA, GET_CLAIM_DEF, ACTION, \
    NODE_UPGRADE, COMPLETE, FAIL, CONFIG_LEDGER_ID, POOL_UPGRADE
from sovrin_common.constants import openTxns, \
    validTxnTypes, IDENTITY_TXN_TYPES, CONFIG_TXN_TYPES
from sovrin_common.txn_util import getTxnOrderedFields
from sovrin_common.types import Request, SafeRequest
from sovrin_node.persistence.attribute_store import AttributeStore
from sovrin_node.persistence.idr_cache import IdrCache
from sovrin_node.server.client_authn import TxnBasedAuthNr
from sovrin_node.server.config_req_handler import ConfigReqHandler
from sovrin_node.server.domain_req_handler import DomainReqHandler
from sovrin_node.server.node_authn import NodeAuthNr
from sovrin_node.server.pool_manager import HasPoolManager
from sovrin_node.server.upgrader import Upgrader
from stp_core.common.log import getlogger
import os


logger = getlogger()
jsonSerz = JsonSerializer()


class Node(PlenumNode, HasPoolManager):
    keygenScript = "init_sovrin_keys"
    _client_request_class = SafeRequest
    ledger_ids = PlenumNode.ledger_ids + [CONFIG_LEDGER_ID]

    def __init__(self,
                 name,
                 nodeRegistry=None,
                 clientAuthNr=None,
                 ha=None,
                 cliname=None,
                 cliha=None,
                 basedirpath=None,
                 primaryDecider=None,
                 pluginPaths: Iterable[str] = None,
                 storage=None,
                 config=None):
        self.config = config or getConfig()

        # TODO: 3 ugly lines ahead, don't know how to avoid
        # self.stateTreeStore = None
        self.idrCache = None
        self.attributeStore = None

{'fraction_non_alphanumeric': 0.05259562841530055, 'fraction_numerical': 0.001366120218579235, 'mean_word_length': 4.070995670995671, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2821014', 'n_tokens_mistral': 1796, 'n_tokens_neox': 1776, 'n_words': 440}