code: def get_embedded_config(filename):
      
      def check_option(self, section, name):
          return (self.has_section(section) and
                 (self.has_option(section, name) or (name in self.defaults())))
  
      try:
          cp = pycbc.results.load_metadata_from_file(filename)
      except TypeError:
          cp = ConfigParser()
  
      cp.check_option = types.MethodType(check_option, cp)
  
      return cp
docs: Attempt to load config data attached to file