code: def _assert_error_raised(func, error, failure_comment):
      def inner_func(*args, **kwargs):
          error_raised = False
          try:
              func(*args, **kwargs)
          except error:
              error_raised = True
          assert error_raised, failure_comment
  
      return inner_func
  
file_path: pennylane/pennylane/ops/functions/assert_valid.py
imports: from string import ascii_lowercase
  import copy
  import pickle
  import numpy
  import pennylane
  from pennylane.operation import EigvalsUndefinedError
label_desc: Use image node_id 1 for calling a global function with example usage: _assert_error_raised(func, error, failure_comment) and returns: inner_func