<commit_before># stdlib
import os
from threading import Thread
from time import sleep
from typing import Any
from typing import Dict
from typing import List
from typing import Optional

# third party
from flask import current_app as app
import jwt
from nacl.signing import SigningKey
from nacl.signing import VerifyKey

import syft as sy
from syft import serialize
from syft.core.common.message import SignedImmediateSyftMessageWithReply
from syft.core.common.message import SignedImmediateSyftMessageWithoutReply
from syft.core.io.location import Location
from syft.core.io.location import SpecificLocation
from syft.core.node.common.action.exception_action import ExceptionMessage
from syft.core.node.common.action.exception_action import UnknownPrivateException
from syft.core.node.common.service.auth import AuthorizationException
from syft.core.node.common.service.child_node_lifecycle_service import (
    ChildNodeLifecycleService,
)
from syft.core.node.common.service.get_repr_service import GetReprService
from syft.core.node.common.service.heritage_update_service import HeritageUpdateService
from syft.core.node.common.service.obj_action_service import (
    ImmediateObjectActionServiceWithReply,
)
from syft.core.node.common.service.obj_action_service import (
    ImmediateObjectActionServiceWithoutReply,
)
from syft.core.node.common.service.obj_search_permission_service import (
    ImmediateObjectSearchPermissionUpdateService,
)
from syft.core.node.common.service.obj_search_service import (
    ImmediateObjectSearchService,
)
from syft.core.node.common.service.repr_service import ReprService
from syft.core.node.common.service.resolve_pointer_type_service import (
    ResolvePointerTypeService,
)

from syft.core.node.domain.domain import Domain

# grid relative
from ..database import db
from ..database.store_disk import DiskObjectStore
from ..manager.association_request_manager import AssociationRequestManager
from ..manager.environment_manager import EnvironmentManager
from ..manager.group_manager import GroupManager
from ..manager.request_manager import RequestManager
from ..manager.role_manager import RoleManager
from ..manager.setup_manager import SetupManager
from ..manager.user_manager import UserManager
from ..services.association_request import AssociationRequestService
from ..services.dataset_service import DatasetManagerService
from ..services.group_service import GroupManagerService
from ..services.infra_service import DomainInfrastructureService
from ..services.request_service import RequestService
from ..services.request_service import RequestServiceWithoutReply
from ..services.role_service import RoleManagerService
from ..services.setup_service import SetUpService
from ..services.tensor_service import RegisterTensorService
from ..services.transfer_service import TransferObjectService
from ..services.user_service import UserManagerService


class GridDomain(Domain):
    def __init__(
        self,
        name: Optional[str],
        network: Optional[Location] = None,
        domain: SpecificLocation = SpecificLocation(),
        device: Optional[Location] = None,
        vm: Optional[Location] = None,
        signing_key: Optional[SigningKey] = None,
        verify_key: Optional[VerifyKey] = None,
        root_key: Optional[VerifyKey] = None,
        db_path: Optional[str] = None,
    ):
        super().__init__(
            name=name,
            network=network,
            domain=domain,
            device=device,
            vm=vm,
            signing_key=signing_key,
            verify_key=verify_key,
            db_path=db_path,
        )

        # Database Management Instances
        self.users = UserManager(db)
        self.roles = RoleManager(db)
        self.groups = GroupManager(db)
        self.disk_store = DiskObjectStore(db)
        if not os.getenv("MEMORY_STORE", None):
            self.store = DiskObjectStore(db)
        self.environments = EnvironmentManager(db)
        self.setup = SetupManager(db)
        self.association_requests = AssociationRequestManager(db)
        self.data_requests = RequestManager(db)

        self.env_clients = {}
        self.setup_configs = {}
<commit_msg>Comment out PyGrid Domain object store so that it falls back to the PySyft one<commit_after># stdlib
import os
from threading import Thread
from time import sleep
from typing import Any
from typing import Dict
from typing import List
from typing import Optional

# third party
from flask import current_app as app
import jwt
from nacl.signing import SigningKey
from nacl.signing import VerifyKey

import syft as sy
from syft import serialize
from syft.core.common.message import SignedImmediateSyftMessageWithReply
from syft.core.common.message import SignedImmediateSyftMessageWithoutReply
from syft.core.io.location import Location
from syft.core.io.location import SpecificLocation
from syft.core.node.common.action.exception_action import ExceptionMessage
from syft.core.node.common.action.exception_action import UnknownPrivateException
from syft.core.node.common.service.auth import AuthorizationException
from syft.core.node.common.service.child_node_lifecycle_service import (
    ChildNodeLifecycleService,
)
from syft.core.node.common.service.get_repr_service import GetReprService
from syft.core.node.common.service.heritage_update_service import HeritageUpdateService
from syft.core.node.common.service.obj_action_service import (
    ImmediateObjectActionServiceWithReply,
)
from syft.core.node.common.service.obj_action_service import (
    ImmediateObjectActionServiceWithoutReply,
)
from syft.core.node.common.service.obj_search_permission_service import (
    ImmediateObjectSearchPermissionUpdateService,
)
from syft.core.node.common.service.obj_search_service import (
    ImmediateObjectSearchService,
)
from syft.core.node.common.service.repr_service import ReprService
from syft.core.node.common.service.resolve_pointer_type_service import (
    ResolvePointerTypeService,
)

from syft.core.node.domain.domain import Domain

# grid relative
from ..database import db
from ..database.store_disk import DiskObjectStore
from ..manager.association_request_manager import AssociationRequestManager
from ..manager.environment_manager import EnvironmentManager
from ..manager.group_manager import GroupManager
from ..manager.request_manager import RequestManager
from ..manager.role_manager import RoleManager
from ..manager.setup_manager import SetupManager
from ..manager.user_manager import UserManager
from ..services.association_request import AssociationRequestService
from ..services.dataset_service import DatasetManagerService
from ..services.group_service import GroupManagerService
from ..services.infra_service import DomainInfrastructureService
from ..services.request_service import RequestService
from ..services.request_service import RequestServiceWithoutReply
from ..services.role_service import RoleManagerService
from ..services.setup_service import SetUpService
from ..services.tensor_service import RegisterTensorService
from ..services.transfer_service import TransferObjectService
from ..services.user_service import UserManagerService


class GridDomain(Domain):
    def __init__(
        self,
        name: Optional[str],
        network: Optional[Location] = None,
        domain: SpecificLocation = SpecificLocation(),
        device: Optional[Location] = None,
        vm: Optional[Location] = None,
        signing_key: Optional[SigningKey] = None,
        verify_key: Optional[VerifyKey] = None,
        root_key: Optional[VerifyKey] = None,
        db_path: Optional[str] = None,
    ):
        super().__init__(
            name=name,
            network=network,
            domain=domain,
            device=device,
            vm=vm,
            signing_key=signing_key,
            verify_key=verify_key,
            db_path=db_path,
        )

        # Database Management Instances
        self.users = UserManager(db)
        self.roles = RoleManager(db)
        self.groups = GroupManager(db)
        self.disk_store = DiskObjectStore(db)
        
        # if not os.getenv("MEMORY_STORE", None):
        #     self.store = DiskObjectStore(db)

        self.environments = EnvironmentManager(db)
        self.setup = SetupManager(db)
        self.association_requests = AssociationRequestManager(db)
        self.data_requests = RequestManager(db)

        self.env_clients = {}
        self.setup_configs = {}

{'fraction_non_alphanumeric': 0.06760430209195131, 'fraction_numerical': 0.0, 'mean_word_length': 4.2073846153846155, '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': '5625121', 'n_tokens_mistral': 2229, 'n_tokens_neox': 2214, 'n_words': 556}