class_docstr: Filter to avoid duplicating optimization warnings.
class_docstr_tok: ["Filter","to","avoid","duplicating","optimization","warnings","."]
code: def filter(self, record):
      msg = record.getMessage()
      if msg.startswith("Optimization Warning: "):
          if msg in self.prev_msgs:
              return False
          else:
              self.prev_msgs.add(msg)
              return True
      return True
  
imports: import hashlib
  import logging
  import os
  import struct
  import subprocess
  import sys
  from collections import OrderedDict
  from collections.abc import Callable
  from functools import partial
label_desc: Use image node_id 1 for calling the NoDuplicateOptWarningFilter obj's underlying member method code with example usage: obj.filter(record) and returns: True, False, True