#NEWLINE# @ task_autoretry ( default_retry_delay = settings . CELERY_RETRY_DELAY , max_retries = settings . CELERY_MAX_RETRIES , throws = events . Skip ) #NEWLINE# @ events . logged ( events . NORMALIZATION ) #NEWLINE# def normalize( raw_doc , harvester_name ) : #NEWLINE# #INDENT# normalized_started = timestamp ( ) #NEWLINE# harvester = registry [ harvester_name ] #NEWLINE# normalized = null_on_error ( harvester . normalize ) ( raw_doc ) #NEWLINE# if ( not normalized ) : #NEWLINE# #INDENT# raise events . Skip ( 'Did not normalize document with id {}' . format ( raw_doc [ 'docID' ] ) ) #NEWLINE# #UNINDENT# normalized [ 'timestamps' ] = util . stamp_from_raw ( raw_doc , normalizeStarted = normalized_started ) #NEWLINE# return raw_doc