<jupyter_start><jupyter_text>Step 1: Create our private dataset<jupyter_code># Get canada trade data and convert into unit millions
canada_trade = (np.array(list(data['Trade Value (US$)'])) / 1000000)[0:10]
trade_partners = ((list(data['Partner'])))[0:10]
data_batch = canada_trade

entities = list()
for i in range(len(data_batch)):
    entities.append(Entity(name=trade_partners[i]))

# Upload a private dataset to the Domain object, as the root owner
private_data = sy.Tensor(data_batch).private(0, 2, entities=entities).tag("trade_flow")<jupyter_output><empty_output><jupyter_text>Step 2: Create a local Domain and publish<jupyter_code>db_engine, _ = create_memory_db_engine()
domain = Domain(name="Bob", db_engine=db_engine)

def encode_key(key: SigningKey) -> str:
    return key.encode(encoder=HexEncoder).decode("utf-8")

key = SigningKey.generate()
domain.users.signup(
    name="Bob",
    email="<EMAIL>",
    password="<PASSWORD>",
    budget=55,
    role=1,
    private_key=encode_key(key),
    verify_key=encode_key(key.verify_key),
)
g = private_data.gamma # you have to do this because only gamma tensors can be published
out = g.publish(acc=domain.acc, sigma=80, user_key=key.verify_key)
domain.acc.print_ledger(returned_epsilon_is_private=False)
domain.acc.get_remaining_budget(user_key=key.verify_key)<jupyter_output><empty_output><jupyter_text>Step 3: Send data to remote Domain, publish and compare results<jupyter_code># Send data to the domain object
data_ptr = private_data.send(canada)
# canada.store
# out = data_ptr.sum(0)
g = data_ptr.gamma
public_out2 = g.publish(client=canada, sigma=80)
# public_out2.get()
assert canada.privacy_budget == domain.acc.get_remaining_budget(user_key=key.verify_key)
canada.privacy_budget

canada.users.create(
    **{
        "name": "<NAME>",
        "email": "<EMAIL>",
        "password": "<PASSWORD>",
        "budget":10
    }
)

sheldon = sy.login(email="<EMAIL>",
                   password="<PASSWORD>",
                   port=8081)
sheldon.privacy_budget
ptr = sheldon.store[0]
out = ptr.sum(0).publish(client=sheldon, sigma=0.1)
# out.get()
# y = ptr + ptr
# y.get()
type(ptr)
out.get()<jupyter_output>[2021-08-26T01:04:58.361988+0100][ERROR][logger]][8139] UnknownPrivateException has been triggered.
[2021-08-26T01:04:58.362876+0100][CRITICAL][logger]][8139] UnknownPrivateException has been triggered.
{'fraction_non_alphanumeric': 0.14183501683501684, 'fraction_numerical': 0.03998316498316498, 'mean_word_length': 5.476839237057221, 'pattern_counts': {'":': 4, '<': 19, '<?xml version=': 0, '>': 20, '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}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '419558', 'license': 'Apache-2.0', 'n_tokens_mistral': 918, 'n_tokens_neox': 848, 'n_words': 159, 'path': 'notebooks/Experimental/Traskinator/Privacy Budget Test.ipynb', 'repo_name': 'giraugh/PySyft', 'size': '2405'}