def _CreateTask(task_type, ee_object, description, config): """Creates an export task. Args: task_type: The type of the task to create. One of Task.Type. ee_object: The object to export. description: Human-readable name of the task. config: Custom config fields for the task. Returns: An unstarted export Task. """ full_config = { 'type': task_type, 'json': ee_object.serialize(), 'description': description, 'state': Task.State.UNSUBMITTED, } if config: full_config.update(config) return Task(data.newTaskId()[0], full_config)