<s> import http <EOL> from waterbutler . core import exceptions <EOL> def file_or_error ( article , file_id ) : <EOL> try : <EOL> return next ( <EOL> each for each in article [ '<STR_LIT>' ] <EOL> if each [ '<STR_LIT:id>' ] == int ( file_id ) <EOL> ) <EOL> except StopIteration : <EOL> raise exceptions . MetadataError ( <EOL> '<STR_LIT>' . format ( file_id ) , <EOL> code = http . client . NOT_FOUND , <EOL> ) </s>
