code: def merge_preds(
      *con_predicates: ConstructivePredicate,
  ) -> ConstructivePredicate:
      # This function is just kinda messy.  Unfortunately the neatest way
      # to do this is just to roll out each case and handle them in turn.
      base = {
          "min_value": -math.inf,
          "max_value": math.inf,
          "exclude_min": False,
          "exclude_max": False,
      }
      predicate = None
      for kw, p in con_predicates:
          predicate = p or predicate
          if "min_value" in kw:
              if kw["min_value"] > base["min_value"]:
                  base["exclude_min"] = kw.get("exclude_min", False)
                  base["min_value"] = kw["min_value"]
              elif kw["min_value"] == base["min_value"]:
                  base["exclude_min"] |= kw.get("exclude_min", False)
          if "max_value" in kw:
              if kw["max_value"] < base["max_value"]:
                  base["exclude_max"] = kw.get("exclude_max", False)
                  base["max_value"] = kw["max_value"]
              elif kw["max_value"] == base["max_value"]:
                  base["exclude_max"] |= kw.get("exclude_max", False)
  
      if not base["exclude_min"]:
          del base["exclude_min"]
          if base["min_value"] == -math.inf:
              del base["min_value"]
      if not base["exclude_max"]:
          del base["exclude_max"]
          if base["max_value"] == math.inf:
              del base["max_value"]
      return ConstructivePredicate(base, predicate)
  
imports: import ast
  import inspect
  import math
  import operator
  from decimal import Decimal
  from fractions import Fraction
  from functools import partial
  from typing import Any, Callable, Collection, Dict, NamedTuple, Optional, TypeVar
  from hypothesis.internal.compat import ceil, floor
  from hypothesis.internal.floats import next_down, next_up
  from hypothesis.internal.reflection import extract_lambda_source
label_desc: Use image node_id 3 for calling a global function with example usage: merge_preds() and returns: ConstructivePredicate