code: def add(self, key, value):
      if key in self.info:
          raise ValueError("duplicate key: %r" % key)
  
      if value is None:
          return
  
      if not isinstance(value, int):
          if not isinstance(value, str):
              # convert other objects like sys.flags to string
              value = str(value)
  
          value = value.strip()
          if not value:
              return
  
      self.info[key] = value
  
imports: import errno
  import re
  import sys
  import traceback
  import warnings
label_desc: Use image node_id 2 for calling the PythonInfo obj's underlying member method code with example usage: obj.add(key, value) without return types