-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ec16803
commit abf44de
Showing
373 changed files
with
5,653 additions
and
6,329 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,7 @@ | |
"outputs": [], | ||
"source": [ | ||
"server = sy.orchestra.launch(\n", | ||
" name=\"test-datasite-1\", port=\"auto\", dev_mode=True, reset=True\n", | ||
" name=\"test-datasite-1\", port=\"auto\", dev_mode=True, reset=True,\n", | ||
")" | ||
] | ||
}, | ||
|
@@ -66,7 +66,7 @@ | |
"outputs": [], | ||
"source": [ | ||
"datasite_client.register(\n", | ||
" email=\"[email protected]\", name=\"John Doe\", password=\"pw\", password_verify=\"pw\"\n", | ||
" email=\"[email protected]\", name=\"John Doe\", password=\"pw\", password_verify=\"pw\",\n", | ||
")" | ||
] | ||
}, | ||
|
@@ -244,12 +244,10 @@ | |
"outputs": [], | ||
"source": [ | ||
"# third party\n", | ||
"from result import Err\n", | ||
"from result import Ok\n", | ||
"from result import Err, Ok\n", | ||
"\n", | ||
"# syft absolute\n", | ||
"from syft.client.api import AuthedServiceContext\n", | ||
"from syft.client.api import ServerIdentity\n", | ||
"from syft.client.api import AuthedServiceContext, ServerIdentity\n", | ||
"\n", | ||
"\n", | ||
"class CustomExactMatch(sy.CustomInputPolicy):\n", | ||
|
@@ -261,7 +259,7 @@ | |
"\n", | ||
" try:\n", | ||
" allowed_inputs = self.allowed_ids_only(\n", | ||
" allowed_inputs=self.inputs, kwargs=kwargs, context=context\n", | ||
" allowed_inputs=self.inputs, kwargs=kwargs, context=context,\n", | ||
" )\n", | ||
" results = self.retrieve_from_db(\n", | ||
" code_item_id=code_item_id,\n", | ||
|
@@ -286,7 +284,7 @@ | |
" # but we are not modifying the permissions of the private data\n", | ||
"\n", | ||
" root_context = AuthedServiceContext(\n", | ||
" server=context.server, credentials=context.server.verify_key\n", | ||
" server=context.server, credentials=context.server.verify_key,\n", | ||
" )\n", | ||
" if context.server.server_type == ServerType.DATASITE:\n", | ||
" for var_name, arg_id in allowed_inputs.items():\n", | ||
|
@@ -301,7 +299,7 @@ | |
" code_inputs[var_name] = kwarg_value.ok()\n", | ||
" else:\n", | ||
" raise Exception(\n", | ||
" f\"Invalid Server Type for Code Submission:{context.server.server_type}\"\n", | ||
" f\"Invalid Server Type for Code Submission:{context.server.server_type}\",\n", | ||
" )\n", | ||
" return Ok(code_inputs)\n", | ||
"\n", | ||
|
@@ -312,8 +310,7 @@ | |
" context,\n", | ||
" ):\n", | ||
" # syft absolute\n", | ||
" from syft import ServerType\n", | ||
" from syft import UID\n", | ||
" from syft import UID, ServerType\n", | ||
"\n", | ||
" if context.server.server_type == ServerType.DATASITE:\n", | ||
" server_identity = ServerIdentity(\n", | ||
|
@@ -324,7 +321,7 @@ | |
" allowed_inputs = allowed_inputs.get(server_identity, {})\n", | ||
" else:\n", | ||
" raise Exception(\n", | ||
" f\"Invalid Server Type for Code Submission:{context.server.server_type}\"\n", | ||
" f\"Invalid Server Type for Code Submission:{context.server.server_type}\",\n", | ||
" )\n", | ||
" filtered_kwargs = {}\n", | ||
" for key in allowed_inputs.keys():\n", | ||
|
@@ -336,7 +333,7 @@ | |
"\n", | ||
" if uid != allowed_inputs[key]:\n", | ||
" raise Exception(\n", | ||
" f\"Input with uid: {uid} for `{key}` not in allowed inputs: {allowed_inputs}\"\n", | ||
" f\"Input with uid: {uid} for `{key}` not in allowed inputs: {allowed_inputs}\",\n", | ||
" )\n", | ||
" filtered_kwargs[key] = value\n", | ||
" return filtered_kwargs\n", | ||
|
@@ -369,7 +366,7 @@ | |
" not_approved_kwargs = set(expected_input_kwargs) - set(permitted_input_kwargs)\n", | ||
" if len(not_approved_kwargs) > 0:\n", | ||
" return Err(\n", | ||
" f\"Input arguments: {not_approved_kwargs} to the function are not approved yet.\"\n", | ||
" f\"Input arguments: {not_approved_kwargs} to the function are not approved yet.\",\n", | ||
" )\n", | ||
" return Ok(True)\n", | ||
"\n", | ||
|
@@ -381,8 +378,7 @@ | |
" context,\n", | ||
"):\n", | ||
" # syft absolute\n", | ||
" from syft import ServerType\n", | ||
" from syft import UID\n", | ||
" from syft import UID, ServerType\n", | ||
" from syft.client.api import ServerIdentity\n", | ||
"\n", | ||
" if context.server.server_type == ServerType.DATASITE:\n", | ||
|
@@ -394,7 +390,7 @@ | |
" allowed_inputs = allowed_inputs.get(server_identity, {})\n", | ||
" else:\n", | ||
" raise Exception(\n", | ||
" f\"Invalid Server Type for Code Submission:{context.server.server_type}\"\n", | ||
" f\"Invalid Server Type for Code Submission:{context.server.server_type}\",\n", | ||
" )\n", | ||
" filtered_kwargs = {}\n", | ||
" for key in allowed_inputs.keys():\n", | ||
|
@@ -406,7 +402,7 @@ | |
"\n", | ||
" if uid != allowed_inputs[key]:\n", | ||
" raise Exception(\n", | ||
" f\"Input with uid: {uid} for `{key}` not in allowed inputs: {allowed_inputs}\"\n", | ||
" f\"Input with uid: {uid} for `{key}` not in allowed inputs: {allowed_inputs}\",\n", | ||
" )\n", | ||
" filtered_kwargs[key] = value\n", | ||
" return filtered_kwargs" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.