<commit_before>import pytest

import torch

import syft as sy
from syft import federated
from syft.frameworks.torch import pointers
from syft.frameworks.torch.federated import utils

PRINT_IN_UNITTESTS = True


def test_add_dataset():
    fed_client = federated.FederatedClient()

    dataset = "my_dataset"
    fed_client.add_dataset(dataset, "string_dataset")

    assert "string_dataset" in fed_client.datasets


def test_add_dataset_with_duplicate_key():
    fed_client = federated.FederatedClient()

    dataset = "my_dataset"
    fed_client.add_dataset(dataset, "string_dataset")

    assert "string_dataset" in fed_client.datasets

    with pytest.raises(ValueError):<commit_msg>Make model execution determinstic<commit_after>import pytest

import torch

import syft as sy
from syft import federated
from syft.frameworks.torch import pointers
from syft.frameworks.torch.federated import utils

PRINT_IN_UNITTESTS = True

# To make execution deterministic to some extent
# for more information - refer https://pytorch.org/docs/stable/notes/randomness.html
torch.manual_seed(0)
torch.cuda.manual_seed_all(0)
torch.backends.cudnn.benchmark = False
torch.backends.cudnn.deterministic = True


def test_add_dataset():
    fed_client = federated.FederatedClient()

    dataset = "my_dataset"
    fed_client.add_dataset(dataset, "string_dataset")

    assert "string_dataset" in fed_client.datasets


def test_add_dataset_with_duplicate_key():
    fed_client = federated.FederatedClient()

    dataset = "my_dataset"
    fed_client.add_dataset(dataset, "string_dataset")

    assert "string_dataset" in fed_client.datasets

    with pytest.raises(ValueError):
{'fraction_non_alphanumeric': 0.07775768535262206, 'fraction_numerical': 0.0012055455093429777, 'mean_word_length': 5.148148148148148, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '4028231', 'n_tokens_mistral': 538, 'n_tokens_neox': 527, 'n_words': 116}