lomas_server package
Subpackages
- lomas_server.admin_database package
- Submodules
- lomas_server.admin_database.admin_database module
AdminDatabase
AdminDatabase.does_dataset_exist()
AdminDatabase.does_user_exist()
AdminDatabase.get_and_set_may_user_query()
AdminDatabase.get_dataset_field()
AdminDatabase.get_dataset_metadata()
AdminDatabase.get_epsilon_or_delta()
AdminDatabase.get_initial_budget()
AdminDatabase.get_remaining_budget()
AdminDatabase.get_total_spent_budget()
AdminDatabase.get_user_previous_queries()
AdminDatabase.has_user_access_to_dataset()
AdminDatabase.prepare_save_query()
AdminDatabase.save_query()
AdminDatabase.set_may_user_query()
AdminDatabase.update_budget()
AdminDatabase.update_delta()
AdminDatabase.update_epsilon()
AdminDatabase.update_epsilon_or_delta()
dataset_must_exist()
user_must_exist()
user_must_have_access_to_dataset()
- lomas_server.admin_database.constants module
- lomas_server.admin_database.factory module
- lomas_server.admin_database.mongodb_database module
AdminMongoDatabase
AdminMongoDatabase.does_dataset_exist()
AdminMongoDatabase.does_user_exist()
AdminMongoDatabase.get_and_set_may_user_query()
AdminMongoDatabase.get_dataset_field()
AdminMongoDatabase.get_dataset_metadata()
AdminMongoDatabase.get_epsilon_or_delta()
AdminMongoDatabase.get_user_previous_queries()
AdminMongoDatabase.has_user_access_to_dataset()
AdminMongoDatabase.save_query()
AdminMongoDatabase.set_may_user_query()
AdminMongoDatabase.update_epsilon_or_delta()
check_result_acknowledged()
- lomas_server.admin_database.utils module
- lomas_server.admin_database.yaml_database module
AdminYamlDatabase
AdminYamlDatabase.does_dataset_exist()
AdminYamlDatabase.does_user_exist()
AdminYamlDatabase.get_and_set_may_user_query()
AdminYamlDatabase.get_dataset_field()
AdminYamlDatabase.get_dataset_metadata()
AdminYamlDatabase.get_epsilon_or_delta()
AdminYamlDatabase.get_user_previous_queries()
AdminYamlDatabase.has_user_access_to_dataset()
AdminYamlDatabase.save_current_database()
AdminYamlDatabase.save_query()
AdminYamlDatabase.set_may_user_query()
AdminYamlDatabase.update_epsilon_or_delta()
- Module contents
- lomas_server.administration package
- lomas_server.data_connector package
- lomas_server.dp_queries package
- Subpackages
- lomas_server.dp_queries.dp_libraries package
- Submodules
- lomas_server.dp_queries.dp_libraries.diffprivlib module
- lomas_server.dp_queries.dp_libraries.factory module
- lomas_server.dp_queries.dp_libraries.opendp module
- lomas_server.dp_queries.dp_libraries.smartnoise_sql module
- lomas_server.dp_queries.dp_libraries.smartnoise_synth module
- lomas_server.dp_queries.dp_libraries.utils module
- Module contents
- lomas_server.dp_queries.dp_libraries package
- Submodules
- lomas_server.dp_queries.dp_querier module
- lomas_server.dp_queries.dummy_dataset module
- Module contents
- Subpackages
- lomas_server.routes package
- Submodules
- lomas_server.routes.routes_admin module
- lomas_server.routes.routes_dp module
diffprivlib_query_handler()
dummy_diffprivlib_query_handler()
dummy_opendp_query_handler()
dummy_smartnoise_sql_handler()
dummy_smartnoise_synth_handler()
estimate_diffprivlib_cost()
estimate_opendp_cost()
estimate_smartnoise_sql_cost()
estimate_smartnoise_synth_cost()
opendp_query_handler()
smartnoise_sql_handler()
smartnoise_synth_handler()
- lomas_server.routes.utils module
- Module contents
- lomas_server.tests package
- Submodules
- lomas_server.tests.constants module
- lomas_server.tests.test_api module
TestRootAPIEndpoint
TestRootAPIEndpoint.setUp()
TestRootAPIEndpoint.setUpClass()
TestRootAPIEndpoint.tearDown()
TestRootAPIEndpoint.tearDownClass()
TestRootAPIEndpoint.test_config_and_internal_server_exception()
TestRootAPIEndpoint.test_dummy_opendp_query()
TestRootAPIEndpoint.test_dummy_smartnoise_sql_query()
TestRootAPIEndpoint.test_get_dataset_metadata()
TestRootAPIEndpoint.test_get_dummy_dataset()
TestRootAPIEndpoint.test_get_initial_budget()
TestRootAPIEndpoint.test_get_previous_queries()
TestRootAPIEndpoint.test_get_remaining_budget()
TestRootAPIEndpoint.test_get_total_spent_budget()
TestRootAPIEndpoint.test_opendp_cost()
TestRootAPIEndpoint.test_opendp_query()
TestRootAPIEndpoint.test_root()
TestRootAPIEndpoint.test_smartnoise_sql_cost()
TestRootAPIEndpoint.test_smartnoise_sql_query()
TestRootAPIEndpoint.test_smartnoise_sql_query_datetime()
TestRootAPIEndpoint.test_smartnoise_sql_query_on_s3_dataset()
TestRootAPIEndpoint.test_smartnoise_sql_query_parameters()
TestRootAPIEndpoint.test_state()
TestRootAPIEndpoint.test_subsequent_budget_limit_logic()
- lomas_server.tests.test_api_diffprivlib module
TestDiffPrivLibEndpoint
TestDiffPrivLibEndpoint.test_clustering_models()
TestDiffPrivLibEndpoint.test_diffprivlib_cost()
TestDiffPrivLibEndpoint.test_diffprivlib_query()
TestDiffPrivLibEndpoint.test_dimension_reduction_models()
TestDiffPrivLibEndpoint.test_dummy_diffprivlib_query()
TestDiffPrivLibEndpoint.test_linear_regression_models()
TestDiffPrivLibEndpoint.test_logistic_regression_models()
TestDiffPrivLibEndpoint.test_naives_bayes_model()
TestDiffPrivLibEndpoint.test_trees_models()
validate_pipeline()
- lomas_server.tests.test_api_smartnoise_synth module
TestSmartnoiseSynthEndpoint
TestSmartnoiseSynthEndpoint.test_dummy_smartnoise_synth_query()
TestSmartnoiseSynthEndpoint.test_smartnoise_synth_cost()
TestSmartnoiseSynthEndpoint.test_smartnoise_synth_query()
TestSmartnoiseSynthEndpoint.test_smartnoise_synth_query_aim()
TestSmartnoiseSynthEndpoint.test_smartnoise_synth_query_constraints()
TestSmartnoiseSynthEndpoint.test_smartnoise_synth_query_datetime()
TestSmartnoiseSynthEndpoint.test_smartnoise_synth_query_delta_none()
TestSmartnoiseSynthEndpoint.test_smartnoise_synth_query_dpgan()
TestSmartnoiseSynthEndpoint.test_smartnoise_synth_query_mst()
TestSmartnoiseSynthEndpoint.test_smartnoise_synth_query_mwem()
TestSmartnoiseSynthEndpoint.test_smartnoise_synth_query_pacsynth()
TestSmartnoiseSynthEndpoint.test_smartnoise_synth_query_patectgan()
TestSmartnoiseSynthEndpoint.test_smartnoise_synth_query_pategan()
TestSmartnoiseSynthEndpoint.test_smartnoise_synth_query_private_id()
TestSmartnoiseSynthEndpoint.test_smartnoise_synth_query_samples()
TestSmartnoiseSynthEndpoint.test_smartnoise_synth_query_select_cols()
get_model()
- lomas_server.tests.test_collection_models module
TestMetadataModel
TestMetadataModel.test_boolean_column()
TestMetadataModel.test_categories()
TestMetadataModel.test_categories_match_cardinality()
TestMetadataModel.test_categories_match_type()
TestMetadataModel.test_categories_required()
TestMetadataModel.test_datetime_column()
TestMetadataModel.test_float_column()
TestMetadataModel.test_int_column()
TestMetadataModel.test_lower_upper_bounded()
TestMetadataModel.test_metadata_columns_discriminator()
TestMetadataModel.test_precision()
TestMetadataModel.test_standard_metadata_fields()
- lomas_server.tests.test_dummy_generation module
TestMakeDummyDataset
TestMakeDummyDataset.metadata
TestMakeDummyDataset.test_boolean_column()
TestMakeDummyDataset.test_categorical_column()
TestMakeDummyDataset.test_datetime_column()
TestMakeDummyDataset.test_float_column()
TestMakeDummyDataset.test_int_column()
TestMakeDummyDataset.test_nullable_column()
TestMakeDummyDataset.test_seed()
- lomas_server.tests.test_mongodb_admin module
TestMongoDBAdmin
TestMongoDBAdmin.setUpClass()
TestMongoDBAdmin.tearDown()
TestMongoDBAdmin.test_add_dataset_to_user()
TestMongoDBAdmin.test_add_datasets_via_yaml()
TestMongoDBAdmin.test_add_demo_data_to_mongodb_admin()
TestMongoDBAdmin.test_add_local_dataset()
TestMongoDBAdmin.test_add_s3_dataset()
TestMongoDBAdmin.test_add_s3_datasets_via_yaml()
TestMongoDBAdmin.test_add_user()
TestMongoDBAdmin.test_add_user_wb()
TestMongoDBAdmin.test_add_users_via_yaml()
TestMongoDBAdmin.test_del_dataset()
TestMongoDBAdmin.test_del_dataset_to_user()
TestMongoDBAdmin.test_del_user()
TestMongoDBAdmin.test_drop_collection()
TestMongoDBAdmin.test_get_archives_of_user()
TestMongoDBAdmin.test_get_collection()
TestMongoDBAdmin.test_get_dataset()
TestMongoDBAdmin.test_get_list_of_datasets()
TestMongoDBAdmin.test_get_list_of_datasets_from_users()
TestMongoDBAdmin.test_get_list_of_users()
TestMongoDBAdmin.test_get_metadata_of_dataset()
TestMongoDBAdmin.test_get_user()
TestMongoDBAdmin.test_set_budget_field()
TestMongoDBAdmin.test_set_may_query()
- lomas_server.tests.test_mongodb_admin_cli module
TestMongoDBAdmin
TestMongoDBAdmin.run_cli_command()
TestMongoDBAdmin.setUpClass()
TestMongoDBAdmin.tearDown()
TestMongoDBAdmin.test_add_dataset_to_user_cli()
TestMongoDBAdmin.test_add_datasets_via_yaml_cli()
TestMongoDBAdmin.test_add_local_dataset_cli()
TestMongoDBAdmin.test_add_user_cli()
TestMongoDBAdmin.test_add_user_wb_cli()
TestMongoDBAdmin.test_add_users_via_yaml_cli()
TestMongoDBAdmin.test_del_dataset_cli()
TestMongoDBAdmin.test_del_dataset_to_user_cli()
TestMongoDBAdmin.test_del_user_cli()
TestMongoDBAdmin.test_drop_collection_cli()
TestMongoDBAdmin.test_get_archives_of_user_cli()
TestMongoDBAdmin.test_get_collection_cli()
TestMongoDBAdmin.test_get_dataset_cli()
TestMongoDBAdmin.test_get_list_of_datasets_cli()
TestMongoDBAdmin.test_get_list_of_datasets_from_user_cli()
TestMongoDBAdmin.test_get_list_of_users_cli()
TestMongoDBAdmin.test_get_metadata_of_dataset_cli()
TestMongoDBAdmin.test_get_user_cli()
TestMongoDBAdmin.test_set_budget_field_cli()
TestMongoDBAdmin.test_set_may_query_cli()
- Module contents
- lomas_server.utils package
Submodules
lomas_server.app module
- lomas_server.app.lifespan(app: FastAPI) AsyncGenerator [source]
Lifespan function for the server.
This function is executed once on server startup, yields and finishes running at server shutdown.
Server initialization is performed (config loading, etc.) and the server state is updated accordingly. This can have potential side effects on the return values of the “depends” functions, which check the server state.
lomas_server.constants module
- class lomas_server.constants.AdminDBType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
StrEnum
Types of administration databases
- MONGODB: str = 'mongodb'
- YAML: str = 'yaml'
- class lomas_server.constants.ConfigKeys(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
StrEnum
Keys of the configuration file
- DB: str = 'admin_database'
- DB_TYPE: str = 'db_type'
- DB_TYPE_MONGODB: str = 'mongodb'
- DEVELOP_MODE: str = 'develop_mode'
- DP_LIBRARY: str = 'dp_libraries'
- MONGODB_ADDR: str = 'address'
- MONGODB_PORT: str = 'port'
- RUNTIME_ARGS: str = 'runtime_args'
- SERVER: str = 'server'
- SETTINGS: str = 'settings'
- SUBMIT_LIMIT: str = 'submit_limit'
- TIME_ATTACK: str = 'time_attack'
- class lomas_server.constants.DPLibraries(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
StrEnum
Name of DP Library used in the query
- DIFFPRIVLIB = 'diffprivlib'
- OPENDP = 'opendp'
- SMARTNOISE_SQL = 'smartnoise_sql'
- SMARTNOISE_SYNTH = 'smartnoise_synth'
- class lomas_server.constants.OpenDPDatasetInputMetric(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
StrEnum
Type of opendp input metric for datasets see https://docs.opendp.org/en/stable/api/python/opendp.metrics.html see https://github.com/opendp/opendp/blob/main/rust/src/metrics/mod.rs
- CHANGE_ONE_DISTANCE = 'ChangeOneDistance'
- HAMMING_DISTANCE = 'HammingDistance'
- INSERT_DELETE_DISTANCE = 'InsertDeleteDistance'
- INT_DISTANCE = 'u32'
- SYMMETRIC_DISTANCE = 'SymmetricDistance'
- class lomas_server.constants.OpenDPMeasurement(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
StrEnum
Type of divergence for opendp measurement see https://docs.opendp.org/en/stable/api/python/opendp.measurements.html
- FIXED_SMOOTHED_MAX_DIVERGENCE = 'fixed_smoothed_max_divergence'
- MAX_DIVERGENCE = 'max_divergence'
- SMOOTHED_MAX_DIVERGENCE = 'smoothed_max_divergence'
- ZERO_CONCENTRATED_DIVERGENCE = 'zero_concentrated_divergence'
- class lomas_server.constants.PrivateDatabaseType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
StrEnum
Type of Private Database for the private data
- PATH = 'PATH_DB'
- S3 = 'S3_DB'
- class lomas_server.constants.SSynthColumnType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
StrEnum
Type of columns for SmartnoiseSynth transformer pre-processing
- CATEGORICAL = 'categorical'
- CONTINUOUS = 'continuous'
- DATETIME = 'datetime'
- PRIVATE_ID = 'private_id'
- class lomas_server.constants.SSynthGanSynthesizer(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
StrEnum
GAN Synthesizer models for smartnoise synth
- DP_CTGAN = 'dpctgan'
- DP_GAN = 'dpgan'
- PATE_CTGAN = 'patectgan'
- PATE_GAN = 'pategan'
- class lomas_server.constants.SSynthMarginalSynthesizer(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
StrEnum
Marginal Synthesizer models for smartnoise synth
- AIM = 'aim'
- MST = 'mst'
- MWEM = 'mwem'
- PAC_SYNTH = 'pacsynth'
lomas_server.mongodb_admin module
- lomas_server.mongodb_admin.add_dataset(db: Database, dataset_name: str, database_type: str, metadata_database_type: str, dataset_path: str | None = '', metadata_path: str | None = '', bucket: str | None = '', key: str | None = '', endpoint_url: str | None = '', credentials_name: str | None = '', metadata_bucket: str | None = '', metadata_key: str | None = '', metadata_endpoint_url: str | None = '', metadata_access_key_id: str | None = '', metadata_secret_access_key: str | None = '', metadata_credentials_name: str | None = '') None [source]
Set a database type to a dataset in dataset collection.
- Parameters:
db (Database) – mongo database object
dataset_name (str) – Dataset name
database_type (str) – Type of the database
metadata_database_type (str) – Metadata database type
dataset_path (str) – Path to the dataset (for local db type)
metadata_path (str) – Path to metadata (for local db type)
bucket (str) – S3 bucket name
key (str) – S3 key
endpoint_url (str) – S3 endpoint URL
credentials_name (str) – The name of the credentials in the server config to retrieve the dataset from S3 storage.
metadata_bucket (str) – Metadata S3 bucket name
metadata_key (str) – Metadata S3 key
metadata_endpoint_url (str) – Metadata S3 endpoint URL
metadata_access_key_id (str) – Metadata AWS access key ID
metadata_secret_access_key (str) – Metadata AWS secret access key
metadata_credentials_name (str) – The name of the credentials in the server config for retrieving the metadata.
- Raises:
ValueError – If the dataset already exists or if the database type is unknown.
- Returns:
None
- lomas_server.mongodb_admin.add_dataset_to_user(db: Database, user: str, dataset: str, epsilon: float, delta: float) None [source]
Add dataset with initialized budget values to list of datasets that the user has access to. Will not add if already added (no error will be raised in that case).
- Parameters:
db (Database) – mongo database object
user (str) – username of the user to check
dataset (str) – name of the dataset to add to user
epsilon (float) – epsilon value for initial budget of user
delta (float) – delta value for initial budget of user
- Raises:
ValueError – _description_
- Returns:
None
- lomas_server.mongodb_admin.add_datasets_via_yaml(db: Database, yaml_file: str | Dict, clean: bool, overwrite_datasets: bool, overwrite_metadata: bool) None [source]
Set all database types to datasets in dataset collection based on yaml file.
- Parameters:
db (Database) – mongo database object
yaml_file (Union[str, Dict]) – if str: a path to the YAML file location if Dict: a dictionnary containing the collection data
clean (bool) – Whether to clean the collection before adding.
overwrite_datasets (bool) – Whether to overwrite existing datasets.
overwrite_metadata (bool) – Whether to overwrite existing metadata.
- Raises:
ValueError – If there are errors in the YAML file format.
- Returns:
None
- lomas_server.mongodb_admin.add_user(db: Database, user: str) None [source]
Add new user in users collection with initial values for all fields set by default.
- Parameters:
db (Database) – mongo database object
user (str) – username to be added
- Raises:
ValueError – If the user already exists.
WriteConcernError – If the result is not acknowledged.
- Returns:
None
- lomas_server.mongodb_admin.add_user_with_budget(db: Database, user: str, dataset: str, epsilon: float, delta: float) None [source]
Add new user in users collection with initial values for all fields set by default.
- Parameters:
db (Database) – mongo database object
user (str) – username to be added
dataset (str) – name of the dataset to add to user
epsilon (float) – epsilon value for initial budget of user
delta (float) – delta value for initial budget of user
- Raises:
ValueError – _description_
- Returns:
None
- lomas_server.mongodb_admin.add_users_via_yaml(db: Database, yaml_file: str | Dict, clean: bool, overwrite: bool) None [source]
Add all users from yaml file to the user collection
- Parameters:
db (Database) – mongo database object
yaml_file (Union[str, Dict]) – if str: a path to the YAML file location if Dict: a dictionnary containing the collection data
clean (bool) – boolean flag True if drop current user collection False if keep current user collection
overwrite (bool) – boolean flag True if overwrite already existing users False errors if new values for already existing users
- Returns:
None
- lomas_server.mongodb_admin.check_dataset_and_metadata_exist(enforce_true: bool) Callable [source]
Creates a wrapper function that raises a ValueError if the supplied user does not already exist in the user collection.
- lomas_server.mongodb_admin.check_user_exists(enforce_true: bool) Callable [source]
Creates a wrapper function that raises a ValueError if the supplied user does (not) exist in the user collection depending on the enforce_true parameter.
- Parameters:
enforce_true (bool) – If set to True, the wrapper will enforce the user is already in the database. If set to False, it will enforce the user is NOT in the database.
- Returns:
- The wrapper function that enforces user presence
(or absence) before calling the suplied function.
- Return type:
Callable
- lomas_server.mongodb_admin.check_user_has_dataset(enforce_true: bool) Callable [source]
Creates a wrapper function that raises a ValueError if the supplied user has access (or not) to the supplied dataset depending on the enforce_true parameter.
- Parameters:
enforce_true (bool) – If set to true, the wrapper function will enforce the user has access to the dataset. If set to False, the wrapper function will enforce the user has NOT access to the specified dataset.
- Returns:
- The wrapper function that asserts user access (or not)
to the provided dataset.
- Return type:
Callable
- lomas_server.mongodb_admin.del_dataset(db: Database, dataset: str) None [source]
Delete dataset from dataset collection.
- Parameters:
db (Database) – mongo database object
dataset (str) – Dataset name to be deleted
- Returns:
None
- lomas_server.mongodb_admin.del_dataset_to_user(db: Database, user: str, dataset: str) None [source]
Remove if exists the dataset (and all related budget info) from list of datasets that user has access to.
- Parameters:
db (Database) – mongo database object
user (str) – username of the user to which to delete a dataset
dataset (str) – name of the dataset to remove from user
- Returns:
None
- lomas_server.mongodb_admin.del_user(db: Database, user: str) None [source]
Delete all related information for user from the users collection.
- Parameters:
db (Database) – mongo database object
user (str) – username to be deleted
- Returns:
None
- lomas_server.mongodb_admin.drop_collection(db: Database, collection: str) None [source]
Delete collection.
- Parameters:
db (Database) – mongo database object
collection (str) – Collection name to be deleted.
- Returns:
None
- lomas_server.mongodb_admin.get_archives_of_user(db: Database, user: str) List[dict] [source]
Show all previous queries from a user
- Parameters:
db (Database) – mongo database object
user (str) – username of the user to show archives
- Returns:
list of previous queries from the user
- Return type:
archives (List)
- lomas_server.mongodb_admin.get_collection(db: Database, collection: str) list [source]
Show a collection
- Parameters:
db (Database) – mongo database object
collection (str) – Collection name to be shown.
- Returns:
None
- lomas_server.mongodb_admin.get_dataset(db: Database, dataset: str) dict [source]
Show a dataset from dataset collection.
- Parameters:
db (Database) – mongo database object
dataset (str) – name of the dataset to show
- Returns:
informations about the dataset
- Return type:
dataset_info (dict)
- lomas_server.mongodb_admin.get_list_of_datasets(db: Database) list [source]
Get the list of all dataset is ‘datasets’ collection
- Parameters:
db (Database) – mongo database object
- Returns:
list of names of all datasets
- Return type:
dataset_names (list)
- lomas_server.mongodb_admin.get_list_of_datasets_from_user(db: Database, user: str) list [source]
Get the list of all datasets from the user
- Parameters:
db (Database) – mongo database object
user (str) – username of the user to show archives
- Returns:
list of names of all users
- Return type:
user_datasets (list)
- lomas_server.mongodb_admin.get_list_of_users(db: Database) list [source]
Get the list of all users is ‘users’ collection
- Parameters:
db (Database) – mongo database object
- Returns:
list of names of all users
- Return type:
user_names (list)
- lomas_server.mongodb_admin.get_metadata_of_dataset(db: Database, dataset: str) dict [source]
Show a metadata from metadata collection.
- Parameters:
db (Database) – mongo database object
dataset (str) – name of the dataset of the metadata to show
- Returns:
informations about the metadata
- Return type:
metadata (dict)
- lomas_server.mongodb_admin.get_user(db: Database, user: str) dict [source]
Show a user
- Parameters:
db (Database) – mongo database object
user (str) – username of the user to show
- Returns:
all information of user from ‘users’ collection
- Return type:
user (dict)
- lomas_server.mongodb_admin.set_budget_field(db: Database, user: str, dataset: str, field: str, value: float) None [source]
Set (for some reason) a budget field to a given value if given user exists and has access to given dataset.
- Parameters:
db (Database) – mongo database object
user (str) – username of the user to set budget to
dataset (str) – name of the dataset to set budget to
field (str) – one of ‘epsilon’ or ‘delta’
value (float) – value to set as epsilon or delta
- Returns:
None
- lomas_server.mongodb_admin.set_may_query(db: Database, user: str, value: bool) None [source]
Set (for some reason) the ‘may query’ field to a given value if given user exists.
- Parameters:
db (Database) – mongo database object
user (str) – username of the user to enable/disable
value (bool) – may query value (True or False)
- Returns:
None