code: def NHot(n, *xs, simplify=True):
      
      if not isinstance(n, int):
          raise TypeError("expected n to be an int")
      if not 0 <= n <= len(xs):
          fstr = "expected 0 <= n <= {}, got {}"
          raise ValueError(fstr.format(len(xs), n))
  
      xs = [Expression.box(x).node for x in xs]
      num = len(xs)
      terms = list()
      for hot_idxs in itertools.combinations(range(num), n):
          hot_idxs = set(hot_idxs)
          _xs = [xs[i] if i in hot_idxs else exprnode.not_(xs[i])
                 for i in range(num)]
          terms.append(exprnode.and_(*_xs))
      y = exprnode.or_(*terms)
      if simplify:
          y = y.simplify()
      return _expr(y)
docs: Return an expression that means
      "exactly N input functions are true".
  
      If *simplify* is ``True``, return a simplified expression.