<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 IEEEXplore ( 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> data = copy ( obj . get_data ( ) ) <EOL> phrase = "<STR_LIT>" <EOL> if phrase in str ( data ) : <EOL> if verbose >= <NUM_LIT:2> : <EOL> sys . stderr . write ( "<STR_LIT>" % ( cls . __name__ , objid , phrase , data [ data . index ( phrase ) : data . index ( phrase ) + <NUM_LIT:1000> ] ) ) <EOL> elif verbose >= <NUM_LIT:1> : <EOL> sys . stderr . write ( "<STR_LIT>" % ( cls . __name__ , objid , phrase , ) ) <EOL> evil_ids . append ( objid ) <EOL> for objid in evil_ids : <EOL> content = remove_object_by_id ( content , objid ) <EOL> return content </s>
