def task_create(context, values, session=None):
 values = values.copy()
 session = (session or get_session())
 with session.begin():
  task_info_values = _pop_task_info_values(values)
  task_ref = models.Task()
  _task_update(context, task_ref, values, session=session)
  _task_info_create(context, task_ref.id, task_info_values, session=session)
 return task_get(context, task_ref.id, session)

def task_create ( context , values , session = None ) : values = values . copy ( ) session = ( session or get_session ( ) ) with session . begin ( ) : task_info_values = _pop_task_info_values ( values ) task_ref = models . Task ( ) _task_update ( context , task_ref , values , session = session ) _task_info_create ( context , task_ref . id , task_info_values , session = session ) return task_get ( context , task_ref . id , session )
create a task object .