<commit_before># stdlib
from copy import copy

# third party
import pytest
import torch as th

# syft absolute
import syft as sy

DOMAIN_PORT = 9082


@pytest.mark.security
def test_store_object_mutation() -> None:
    """Check if the store object can be mutated by another user."""

    domain = sy.login(
        port=DOMAIN_PORT, email="<EMAIL>", password="<PASSWORD>"
    )

    x = th.tensor([1, 2, 3])
    x_ptr = x.send(domain, pointable=True, tags=["visible"])

    y = th.tensor([3, 6, 9])
    y_ptr = y.send(domain, pointable=False, tags=["invisible"])
    y_ptr.id_at_location

    guest = sy.login(port=DOMAIN_PORT)
    guest_x = guest.store[x_ptr.id_at_location]

    guest_x.add_(guest_x)

    guest_y = copy(guest_x)

    guest_y.id_at_location = sy.common.UID.from_string(y_ptr.id_at_location.no_dash)

    guest_y.add_(guest_y)

    x_result = x_ptr.get(delete_obj=False)
    assert x_result == x
    y_result = y_ptr.get(delete_obj=False)
    assert y_result == y<commit_msg>tests: fix assert on mutation object check<commit_after># stdlib
from copy import copy

# third party
import pytest
import torch as th

# syft absolute
import syft as sy

DOMAIN_PORT = 9082


@pytest.mark.security
def test_store_object_mutation() -> None:
    """Check if the store object can be mutated by another user."""

    domain = sy.login(
        port=DOMAIN_PORT, email="<EMAIL>", password="<PASSWORD>"
    )

    x = th.tensor([1, 2, 3])
    x_ptr = x.send(domain, pointable=True, tags=["visible"])

    y = th.tensor([3, 6, 9])
    y_ptr = y.send(domain, pointable=False, tags=["invisible"])
    y_ptr.id_at_location

    guest = sy.login(port=DOMAIN_PORT)
    guest_x = guest.store[x_ptr.id_at_location]

    guest_x.add_(guest_x)

    guest_y = copy(guest_x)

    guest_y.id_at_location = sy.common.UID.from_string(y_ptr.id_at_location.no_dash)

    guest_y.add_(guest_y)

    x_result = x_ptr.get(delete_obj=False)
    assert all(x_result == x) is True
    y_result = y_ptr.get(delete_obj=False)
    assert all(y_result == y) is True
{'fraction_non_alphanumeric': 0.12199902008819206, 'fraction_numerical': 0.009799118079372856, 'mean_word_length': 3.6727688787185353, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '5524026', 'n_tokens_mistral': 789, 'n_tokens_neox': 767, 'n_words': 167}