Implement function {f(x) = 1 if x==x', f(x) = 0 if x!= x'}.
3737
def make_oracle(input_qubits, output_qubit, x_bits):
    """"""
    # Make oracle.
    # for (1, 1) it's just a Toffoli gate
    # otherwise negate the zero-bits.
    yield(cirq.X(q) for (q, bit) in zip(input_qubits, x_bits) if not bit)
    yield(cirq.TOFFOLI(input_qubits[0], input_qubits[1], output_qubit))
    yield(cirq.X(q) for (q, bit) in zip(input_qubits, x_bits) if not bit)
66525
function onetime() {
        if (called) return value;

        called = 1;
        value = fn.apply(this, arguments);
        fn = null;

        return value;
      }
1062413
function (x, min, max) {
    if (x <= min) {
      return 0;
    }
    if (x >= max) {
      return 1;
    }
    x = (x - min) / (max - min);
    return x * x * (3 - 2 * x);
  }
68534
function homomorphism(f) {
    var A = f();

    return forAll(_.Int).satisfy(function(a) {
      function g(x) { return x * 2; }

      return A.of(g).ap(A.of(a)).isEqual(A.of(g(a)));
    });
  }
1346723
function (comparatorArray) {
  return function (a, b) {
    for (var i = 0; i < comparatorArray.length; ++i) {
      var compare = comparatorArray[i](a, b);
      if (compare !== 0)
        return compare;
    }
    return 0;
  };
}
1071483
function(a, b) {
      if (typeof a === "number") {
        return a - b;
      }
      else {
        return a.map(function(x, i) { return x - b[i]; });
      }
    }
1048498
function (x, a, b) {
            if (x < a) {
                return a;
            } else if (x > b) {
                return b;
            }
            return x;
        }
386929
function (f, cont) {
    var result = f();
    if (result && typeof result.always === 'function') {
      result.always(cont);
    } else {
      cont();
    }
  }
124999
function() { 
            var l = this.coeffs.length;
            while(l--) {
                var c = this.coeffs[l];
                var equalsZero = c.equals(0);
                if(c && equalsZero) {
                    if(l === 0) break;
                    this.coeffs.pop();
                }
                else break;
            }

            return this;
        }
188566
function(fn) {
    var n = this.elements.length, k = n, i;
    do { i = k - n;
      fn(this.elements[i], i+1);
    } while (--n);
  }
231420
function bnpFromInt(x) {
  this.t = 1;
  this.s = (x<0)?-1:0;
  if(x > 0) this[0] = x;
  else if(x < -1) this[0] = x+this.DV;
  else this.t = 0;
}
574865
private function equalityFunction()
    {
        return function ($a, $b) {
            if (is_object($a)) {
                $a = \serialize($a);
                $b = \serialize($b);
            }

            return ($a === $b ? 0 : ($a < $b ? -1 : 1));
        };
    }
189404
function EE(fn, context, once) {
  this.fn = fn;
  this.context = context;
  this.once = once || false;
}
215068
function ifElse(pred, f, g) {
  if(!isPredOrFunc(pred)) {
    throw new TypeError(
      'ifElse: Pred or predicate function required for first argument'
    )
  }

  if(!(isFunction(f) && isFunction(g))) {
    throw new TypeError(
      'ifElse: Functions required for second and third arguments'
    )
  }

  return x => predOrFunc(pred, x) ? f(x) : g(x)
}
296477
function(k) {
            	if(!k)
            	    k = 0;
            	
            	return this.map(function(x, i, j) {
            	    return j - i >= k ? x : 0;
            	});
                }
991106
def obj(x):
    """"""
    
    x1 = x[0]
    x2 = x[1]
    
    f = (4 - 2.1*(x1*x1) + (x1*x1*x1*x1)/3.0)*(x1*x1) + x1*x2 + (-4 + 4*(x2*x2))*(x2*x2)
    return f
1102894
function nextFunc(f1, f2) {
    if (f1 && !f2) return f1;
    if (f2 && !f1) return f2;
    return function nextFunc$wrapper(...args) {
        if (f1.apply(this, args) !== false) {
            return f2.apply(this, args);
        }
    };
}