<jupyter_start><jupyter_text>Redistributing and Reassigning a Task  To reach the tasks and assignments repositories go to tasks and assignments.      To reach the tasks and assignments entities go to tasks and assignments.   Get Task and Assignments   Get Task   Get by ID<jupyter_code>task = dl.tasks.get(task_id='<my-task-id>')<jupyter_output><empty_output><jupyter_text>Get by name – in a project<jupyter_code>project = dl.projects.get(project_name='<project_name>')
task = project.tasks.get(task_name='<my-task-name>')<jupyter_output><empty_output><jupyter_text>Get by name – in a dataset<jupyter_code>dataset = project.datasets.get(dataset_name='<dataset_name>')
task = project.tasks.get(task_name='<my-task-name>')<jupyter_output><empty_output><jupyter_text>Get list – in a project<jupyter_code>dataset = project.datasets.get(dataset_name='<dataset_name>')
task = project.tasks.get(task_name='<my-task-name>')<jupyter_output><empty_output><jupyter_text>Get list – in a dataset<jupyter_code>tasks = project.tasks.list()<jupyter_output><empty_output><jupyter_text>Get Task Items<jupyter_code>tasks = dataset.tasks.list()<jupyter_output><empty_output><jupyter_text>Get Assignments   Get by ID<jupyter_code>assignment = dl.assignments.get(assignment_id='<my-assignment-id>')<jupyter_output><empty_output><jupyter_text>Get by name – in a project<jupyter_code>project = dl.projects.get(project_name='<project_name>')
assignment = project.assignments.get(assignment_name='<my-assignment-name>')<jupyter_output><empty_output><jupyter_text>Get by name – in a dataset<jupyter_code>dataset = project.datasets.get(dataset_name='<dataset_name>')
assignment = dataset.assignments.get(assignment_name='<my-assignment-name>')<jupyter_output><empty_output><jupyter_text>Get by name – in a task<jupyter_code>task = project.tasks.get(task_name='<my-task-name>')
assignment = task.assignments.get(assignment_name='<my-assignment-name>')<jupyter_output><empty_output><jupyter_text>Get list – in a project<jupyter_code>assignments = project.assignments.list()<jupyter_output><empty_output><jupyter_text>Get list – in a dataset<jupyter_code>assignments = dataset.assignments.list()<jupyter_output><empty_output><jupyter_text>Get list – in a task<jupyter_code>assignments = task.assignments.list()<jupyter_output><empty_output><jupyter_text>Get Assignment Items<jupyter_code>assignment_items = assignment.get_items()<jupyter_output><empty_output><jupyter_text>Redistribute and Reassign the Assignment   prep<jupyter_code>import dtlpy as dl
import datetime
if dl.token_expired():
    dl.login()
project = dl.projects.get(project_name='<project_name>')
dataset = project.datasets.get(dataset_name='<dataset_name>')
task = dl.tasks.get(task_id='<my-task-id>')
assignment = task.assignments.get(assignment_name='<my-assignment-name>')<jupyter_output><empty_output><jupyter_text>Redistribute<jupyter_code># load is the workload percentage for each annotator
assignment.redistribute(dl.Workload([dl.WorkloadUnit(assignee_id='<<EMAIL>>', load=50),
                                     dl.WorkloadUnit(assignee_id='<<EMAIL>>', load=50)]))<jupyter_output><empty_output><jupyter_text>Reassign<jupyter_code>assignment.reassign(assignee_ids['<<EMAIL>>'])<jupyter_output><empty_output><jupyter_text>Delete Task and Assignments   Delete Task  Note  In case you delete a task, it will delete all its assignments as well.<jupyter_code>task.delete()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1295005807200929, 'fraction_numerical': 0.0011614401858304297, 'mean_word_length': 8.985507246376812, 'pattern_counts': {'":': 0, '<': 97, '<?xml version=': 0, '>': 97, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '18', 'dir': 'jupyter-structured-clean-dedup', 'id': '102973', 'license': 'MIT', 'n_tokens_mistral': 1226, 'n_tokens_neox': 1217, 'n_words': 180, 'path': 'tutorials/task_workflows/tasks_and_assignments/redistributing_and_reassigning_a_task/chapter.ipynb', 'repo_name': 'dataloop-ai/sdk_examples', 'size': '3489'}