code: def constrained(x, lb=None, ub=None):
      """Construct an array for a constrained response
  
      It's exactly like truncated, but it's interpreted by Bambi in a different way as this
      one truncates/constrains the bounds of a probability distribution, while `truncated()` is
      interpreted as the missing data mechanism.
  
      `lb` and `ub` can only be scalar values.
      """
      if not (lb is None or isinstance(lb, (int, float))):
          raise ValueError("'lb' must be None or scalar.")
  
      if not (ub is None or isinstance(ub, (int, float))):
          raise ValueError("'ub' must be None or scalar.")
      return truncated(x, lb, ub)
  
file_path: bambi/bambi/transformations.py
imports: import numpy
  import pandas
  from formulae.transforms import register_stateful_transform
label_desc: Use image node_id 4 for calling a global function with example usage: constrained(x, lb, ub) and returns: truncated