<s> from copy import copy <EOL> import sys <EOL> from . . parser import parse_content <EOL> from . . eraser import remove_object_by_id <EOL> from . . plugin import Plugin <EOL> class ScienceMagazine ( Plugin ) : <EOL> """<STR_LIT>""" <EOL> @ classmethod <EOL> def scrub ( cls , content , verbose = <NUM_LIT:0> ) : <EOL> evil_ids = [ ] <EOL> pdf = parse_content ( content ) <EOL> xref = pdf . xrefs [ <NUM_LIT:0> ] <EOL> objids = xref . get_objids ( ) <EOL> for objid in objids : <EOL> obj = pdf . getobj ( objid ) <EOL> if hasattr ( obj , "<STR_LIT>" ) : <EOL> if ( "<STR_LIT>" in obj . attrs ) and str ( obj . attrs [ "<STR_LIT>" ] ) == "<STR_LIT>" : <EOL> if "<STR_LIT>" in obj . attrs and str ( obj . attrs [ "<STR_LIT>" ] ) == "<STR_LIT>" : <EOL> evil_ids . append ( objid ) <EOL> if len ( evil_ids ) > <NUM_LIT:1> : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> for objid in evil_ids : <EOL> content = remove_object_by_id ( content , objid ) <EOL> return content </s>
