<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(config):
 """Read the task.json from work_dir. Args: config (dict):
 the running config, to find work_dir. Returns: dict: the contents of task.json Raises: ScriptWorkerTaskException: on error. """

    path = os.path.join(config['work_dir'], "task.json")
    message = "Can't read task from {}!\n%(exc)s".format(path)
    contents = load_json_or_yaml(path, is_path=True, message=message)
    return contents