def unregister_detector(self, d):
if not isinstance(d, (Detector, str)):<EOL><INDENT>raise EthereumError("<STR_LIT>")<EOL><DEDENT>name = d<EOL>if isinstance(d, Detector):<EOL><INDENT>name = d.name<EOL><DEDENT>if name not in self.detectors:<EOL><INDENT>raise EthereumError("<STR_LIT>")<EOL><DEDENT>d = self.detectors[name]<EOL>del self.detectors[name]<EOL>self.unregister_plugin(d)<EOL>
Unregisters a detector. This will invoke detector's `on_unregister` callback.
Shall be called after `.finalize` - otherwise, finalize won't add detector's finding to `global.findings`.