Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to identify if a dataset is under copyright protection.
Prompt Engineering / GenAI
if dataset.license == [1]: print("Dataset is copyrighted.")
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'public_domain' which means no copyright.
Confusing 'open_source' with copyright restriction.
✗ Incorrect
The license 'all_rights_reserved' means the dataset is copyrighted and cannot be freely used without permission.
2fill in blank
mediumComplete the code to check if a model's training data requires attribution.
Prompt Engineering / GenAI
if training_data.license == [1]: print("Attribution required for use.")
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'public_domain' which does not require attribution.
Confusing 'all_rights_reserved' with attribution requirement.
✗ Incorrect
Creative Commons BY license requires giving credit (attribution) when using the data.
3fill in blank
hardFix the error in the code to avoid using copyrighted material without permission.
Prompt Engineering / GenAI
if model.uses_data_from([1]): raise Exception("Unauthorized use of copyrighted data")
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'public_domain_sources' which is allowed.
Confusing 'licensed_datasets' with unauthorized use.
✗ Incorrect
Using proprietary datasets without permission is unauthorized and may violate copyright laws.
4fill in blank
hardFill both blanks to create a dictionary comprehension that filters datasets with open licenses and adds their names.
Prompt Engineering / GenAI
open_datasets = {dataset.[1]: dataset.[2] for dataset in datasets if dataset.license in ['public_domain', 'creative_commons']} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'size' or 'creator' instead of 'name' or 'license'.
Mixing up key and value positions.
✗ Incorrect
We use 'name' as the key and 'license' as the value to list datasets with open licenses.
5fill in blank
hardFill all three blanks to create a comprehension that selects models trained only on datasets with allowed licenses.
Prompt Engineering / GenAI
allowed_models = [model for model in models if model.training_data.[1] in [2] and not model.training_data.[3] == 'all_rights_reserved']
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'name' instead of 'license' to check licenses.
Not excluding 'all_rights_reserved' datasets.
✗ Incorrect
We check the 'license' attribute to ensure the dataset license is allowed and exclude 'all_rights_reserved'.