<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_task(task_id, completed=True):
 """ Get a task by task id where a task_id is required. :param task_id: task ID :type task_id: str :param completed: include completed tasks? :type completed: bool :return: a task :rtype: obj """

    tasks = get_tasks(task_id=task_id, completed=completed)

    if len(tasks) == 0:
        return None

    assert len(tasks) == 1, 'get_task should return at max 1 task for a task id'
    return tasks[0]