code: def _general_constraints(pattern, epsilon_var, gamma_var, beta_var):
      passed = True
      passed = passed and pattern.root_var.shape is not None
      passed = (
          passed
          and epsilon_var.val is not None
          and len(epsilon_var.val.shape) == 0
      )
      passed = passed and gamma_var.val is not None
      passed = passed and beta_var.val is not None
  
      pattern.add_attribute("epsilon_var", epsilon_var)
      pattern.add_attribute("gamma_var", gamma_var)
      pattern.add_attribute("beta_var", beta_var)
      return passed
  
file_path: coremltools/coremltools/converters/mil/experimental/passes/generic_layernorm_instancenorm_pattern_fusion.py
imports: import os
  import numpy
  from coremltools.converters.mil import Builder
  from coremltools.converters.mil.experimental.passes.generic_pass_infrastructure import register_generic_pass
  from coremltools.converters.mil.mil import get_new_symbol
label_desc: Use image node_id 7 for calling a global function with example usage: _general_constraints(pattern, epsilon_var, gamma_var, beta_var) and returns: passed