<s> """<STR_LIT>""" <EOL> import re <EOL> from typing import Any , List <EOL> from uuid import UUID <EOL> from changes . config import statsreporter <EOL> from changes . constants import Result <EOL> from changes . models . build import Build <EOL> def build_finished_handler ( build_id , ** kwargs ) : <EOL> for key in build_finished_metrics ( build_id ) : <EOL> statsreporter . stats ( ) . incr ( key ) <EOL> def build_finished_metrics ( build_id ) : <EOL> keys = [ ] <EOL> build = Build . query . get ( build_id ) <EOL> if build is None : <EOL> return keys <EOL> if list ( build . tags or ( ) ) != [ '<STR_LIT>' ] : <EOL> return keys <EOL> slug_mangled = re . sub ( '<STR_LIT>' , '<STR_LIT:_>' , build . project . slug ) <EOL> if build . result != Result . aborted : <EOL> keys . append ( '<STR_LIT>' . format ( slug_mangled ) ) <EOL> if build . result != Result . passed : <EOL> keys . append ( '<STR_LIT>' . format ( slug_mangled ) ) <EOL> return keys </s>
