code: def constraint_check():
      """Unified check_constraint interface for both scalar and tensor"""
  
      def _check(condition, err_msg):
          if isinstance(condition, bool):
              if not condition:
                  raise ValueError(err_msg)
              return 1.0
          return npx.constraint_check(condition, err_msg)
  
      return _check
  
file_path: mxnet/python/mxnet/gluon/probability/distributions/utils.py
imports: from functools import update_wrapper
  from numbers import Number
  import numpy
  from ....None import np, npx
label_desc: Use image node_id 1 for calling a global function with example usage: constraint_check() and returns: _check, npx, int