#NEWLINE# def add_batch( batch , count , task_type ) : #NEWLINE# #INDENT# '\n    Updates or creates new batch after loading new dataset\n\n    :type batch: str | unicode\n    :type count: int\n    :type task_type: str | unicode\n    ' #NEWLINE# if ( batch == app . config [ 'DEFAULT_BATCH' ] ) : #NEWLINE# #INDENT# ( batch , _ ) = Batch . objects . get_or_create ( id = batch ) #NEWLINE# batch . update ( inc__tasks_count = _ ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# Batch . objects . create ( id = batch , task_type = task_type , tasks_count = count )