code: def get_cases(labels=None, exclude=[]):
      """Get all graph instances of the given labels."""
      cases = set()
      if labels is None:
          # get all the cases
          labels = case_registry.keys()
      for lbl in labels:
          for case in case_registry[lbl]:
              if not any([l in exclude for l in case.__labels__]):
                  cases.add(case)
      return [fn() for fn in cases]
  
imports: from collections import defaultdict
  import backend
  import dgl
  import networkx
  import numpy
  import scipy.sparse
label_desc: Use image node_id 2 for calling a global function with example usage: get_cases(labels, exclude) and returns: unknown