code: def substructure(mol, query, largest_only=True, ignore_hydrogen=True):
      
      def subset_filter(cnt1, cnt2):
          diff = cnt2
          diff.subtract(cnt1)
          if any(v < 0 for v in diff.values()):
              return True
  
      if not (len(mol) and len(query)):
          return False  # two blank molecules are not isomorphic
      m = molutil.clone(mol)
      q = molutil.clone(query)
      if largest_only:
          m = molutil.largest_graph(m)
          q = molutil.largest_graph(q)
      if ignore_hydrogen:
          m = molutil.make_Hs_implicit(m)
          q = molutil.make_Hs_implicit(q)
      if filter_(m, q, f=subset_filter):
          gm = GraphMatcher(q.graph, m.graph, node_match=atom_match)
          return gm.subgraph_is_isomorphic()
      return False
docs: if mol is a substructure of the query, return True
      Args:
        mol: Compound
        query: Compound
        largest_only: compare only largest graph molecule