Object.assign() polyfill.
192846
function _assign(target) {
    var sources = [], len = arguments.length - 1;
    while ( len-- > 0 ) sources[ len ] = arguments[ len + 1 ];


    sources.forEach(function (source) {
        Object.keys(source || {}).forEach(
            function (key) { return target[key] = source[key]; }
        );
    });

    return target;
}
805167
def visit_Assign(self, node, **kwargs):
        """"""
        self.visit(node.node, **kwargs)
        self.visit(node.target, **kwargs)
1273648
def temporary_assignment(obj, attr, value):
  """"""
  original = getattr(obj, attr, None)
  setattr(obj, attr, value)
  yield
  setattr(obj, attr, original)
1218641
def assign(self, V, py):
        
        if isinstance(py, (bytes, unicode)):
            for i,C in enumerate(V['value.choices'] or self._choices):
                if py==C:
                    V['value.index'] = i
                    return

        # attempt to parse as integer
        V['value.index'] = py
1137502
function genAssignmentCode (
  value,
  assignment
) {
  var modelRs = parseModel(value);
  if (modelRs.idx === null) {
    return (value + "=" + assignment)
  } else {
    return "var $$exp = " + (modelRs.exp) + ", $$idx = " + (modelRs.idx) + ";" +
      "if (!Array.isArray($$exp)){" +
        value + "=" + assignment + "}" +
      "else{$$exp.splice($$idx, 1, " + assignment + ")}"
  }
}
31778
function _assign(target, ...sources) {

    sources.forEach(source => {
        Object.keys(source || {}).forEach(
            key => target[key] = source[key]
        );
    });

    return target;
}
946847
function set(values) {
    var s = this;

    if (arguments.length === 2) {
      values = {};
      var key = arguments[0];
      values[key] = arguments[1];
    }

    Object.assign(s, values);
    return s;
  }
15551
function assignMergeValue(object, key, value) {
    if (value !== undefined && !eq(object[key], value) || typeof key == 'number' && value === undefined && !(key in object)) {
      object[key] = value;
    }
  }
848449
def visit_Assign(self, node):
    """"""
    if len(node.targets) != 1:
      raise ValueError('no support for chained assignment')

    # Before the node gets modified, get a source code representation
    # to add as a comment later on
    if anno.hasanno(node, 'pre_anf'):
      orig_src = anno.getanno(node, 'pre_anf')
    else:
      orig_src = quoting.unquote(node)

    # Set target for the RHS visitor to access
    self.orig_target = ast_.copy_node(node.targets[0])

    # If we know we're going to be putting another stack on the stack,
    # we should try to make that explicit
    if isinstance(node.value, gast.Call) and \
        anno.hasanno(node.value, 'func') and \
        anno.getanno(node.value, 'func') in (utils.Stack, utils.pop_stack):
      push, pop, op_id = get_push_pop_stack()
    else:
      push, pop, op_id = get_push_pop()
    push_stack, pop_stack, op_id_stack = get_push_pop_stack()

    # Every assignment statement requires us to store the pre-value, and in the
    # adjoint restore the value, and reset the gradient
    store = template.replace(
        'push(_stack, y, op_id)',
        push=push,
        y=self.orig_target,
        _stack=self.stack,
        op_id=op_id)
    create_substack = template.replace(
        'substack = tangent.Stack()', substack=self.substack)
    store_substack = template.replace(
        'push(stack, substack, op_id)',
        push=push_stack,
        stack=self.stack,
        substack=self.substack,
        op_id=op_id_stack)
    restore = template.replace(
        'y = pop(_stack, op_id)',
        _stack=self.stack,
        pop=pop,
        y=ast_.copy_node(self.orig_target),
        op_id=op_id)
    restore_substack = template.replace(
        'substack = pop(stack, op_id)',
        pop=pop_stack,
        stack=self.stack,
        substack=self.substack,
        op_id=op_id_stack)
    reset = template.replace(
        'd[y] = init_grad(y, allow_lazy_initializer=True)',
        y=self.orig_target,
        init_grad=utils.INIT_GRAD,
        namer=self.namer,
        replace_grad=template.Replace.FULL)

    # If there are no active nodes, we don't need to find an adjoint
    # We simply store and restore the state, and reset the gradient
    if not self.is_active(node):
      return [store, node], [restore, reset]

    # We create a temporary variable for the target that the RHS can use
    self.target = create.create_temp(self.orig_target, self.namer)
    create_tmp = template.replace(
        'tmp = y', tmp=self.target, y=self.orig_target)

    # Get the primal and adjoint of the RHS expression
    try:
      fx, adjoint_rhs = self.visit(node.value)
    except ValueError as e:
      context = [t.id if hasattr(t, 'id') else t for t in node.targets]
      raise ValueError(
          'Failed to process assignment to: %s. Error: %s' % (context, e))
    if not isinstance(adjoint_rhs, list):
      adjoint_rhs = [adjoint_rhs]

    # Walk the RHS adjoint AST to find temporary adjoint variables to sum
    accumulations = []
    for n in adjoint_rhs:
      for succ in gast.walk(n):
        if anno.hasanno(succ, 'temp_adjoint_var'):
          xi = anno.getanno(succ, 'temp_adjoint_var')
          dxi_partial = ast_.copy_node(succ)
          accumulations.append(template.replace(
              'd[xi] = add_grad(d[xi], dxi_partial)',
              namer=self.namer, replace_grad=template.Replace.FULL,
              xi=xi, dxi_partial=dxi_partial, add_grad=utils.ADD_GRAD))

    # The primal consists of storing the state and then performing the
    # assignment with the new primal.
    # The primal `fx` may be optionally (but rarely) redefined when the
    # adjoint is generated, in `fx, adjoint_rhs = self.visit(node.value)`.
    # If we see that the primal value is an Assign node, or a list of nodes
    # (with at least one being an Assign) node, we allow the primal to change.
    # Otherwise, we'll build our own Assign node.
    if isinstance(fx, gast.Assign):
      assign = [fx]
    elif (isinstance(fx, list) and
          any([isinstance(ifx, gast.Assign) for ifx in fx])):
      assign = fx
    else:
      assign = template.replace(
          'y = fx', y=ast_.copy_node(self.orig_target), fx=fx)
      assign = [assign]
    primal = [store, create_substack, store_substack] + assign

    # The adjoint involves creating the temporary, restoring the store,
    # calculating the adjoint, resetting the gradient, and finally accumulating
    # the partials
    adjoint = [create_tmp, restore_substack, restore
              ] + adjoint_rhs + [reset] + accumulations

    # If the LHS is a subscript assignment with variable index, we need to
    # store and restore that as well
    if (isinstance(self.orig_target, gast.Subscript) and
        isinstance(self.orig_target.slice.value, gast.Name)):
      push, pop, op_id = get_push_pop()
      i = self.orig_target.slice.value
      push_index = template.replace(
          'push(_stack, i, op_id)',
          push=push,
          i=i,
          _stack=self.stack,
          op_id=op_id)
      pop_index = template.replace(
          'i = pop(_stack, op_id)',
          pop=pop,
          i=i,
          _stack_=self.stack,
          op_id=op_id)

      primal.insert(len(primal), push_index)
      adjoint.insert(0, pop_index)

    # Add a comment in the backwards pass, indicating which
    # lines in the forward pass generated the adjoint
    for i, adj in enumerate(adjoint):
      adjoint[i] = comments.add_comment(adj, 'Grad of: %s' % orig_src)

    return primal, adjoint
152689
def assign(A, attr, B, lock=False):
    '''
    '''
    class NoAttr(object): pass

    context = threading.Lock if lock else null_context
    with context():
        if not hasattr(A, attr):
            tmp = NoAttr
        else:
            tmp = getattr(A, attr)

        setattr(A, attr, B)

        try:
            yield B

        finally:
            if tmp is NoAttr:
                delattr(A, attr)
            else:
                setattr(A, attr, tmp)
1137192
private PolyfillInfo createPolyfillInfo(Node call, Scope scope, String name) {
    checkState(scope.isGlobal());
    checkState(call.getParent().isExprResult());
    // Make the removable and polyfill info.  Add continuations for all arguments.
    RemovableBuilder builder = new RemovableBuilder();
    for (Node n = call.getFirstChild().getNext(); n != null; n = n.getNext()) {
      builder.addContinuation(new Continuation(n, scope));
    }
    Polyfill removable = builder.buildPolyfill(call.getParent());
    int lastDot = name.lastIndexOf(".");
    if (lastDot < 0) {
      return new GlobalPolyfillInfo(removable, name);
    }
    String owner = name.substring(0, lastDot);
    String prop = name.substring(lastDot + 1);
    boolean typed = call.getJSType() != null;
    if (owner.endsWith(DOT_PROTOTYPE)) {
      owner = owner.substring(0, owner.length() - DOT_PROTOTYPE.length());
      return new PrototypePropertyPolyfillInfo(
          removable, prop, typed ? compiler.getTypeRegistry().getType(scope, owner) : null);
    }
    ObjectType ownerInstanceType =
        typed ? ObjectType.cast(compiler.getTypeRegistry().getType(scope, owner)) : null;
    JSType ownerCtorType = ownerInstanceType != null ? ownerInstanceType.getConstructor() : null;
    return new StaticPropertyPolyfillInfo(removable, prop, ownerCtorType, owner);
  }
946272
function assignRequest (target, source, obj = {}, term) {
  _.merge(target, _.omit(source, ['term']), obj)
  if (term == true) target.term = source.term
}
662370
def p_assignment(self, p):
        ''
        p[0] = Assign(p[2], p[4], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
1024471
def visit_assign(self, node):
        """"""
        lhs = " = ".join(n.accept(self) for n in node.targets)
        return "%s = %s" % (lhs, node.value.accept(self))
170937
function deepAssign(object, source) {
    for (var key in source) {
        if (source.hasOwnProperty(key)) {
            if (typeof object[key] === "object" && typeof source[key] === "object") {
                deepAssign(object[key], source[key]);
            } else {
                object[key] = source[key];
            }
        }
    }

    return object;
}
375873
def set_object(self, obj, properties):
        """"""
        self._objects.add(obj)
        properties = set(properties)
        self._properties |= properties
        pairs = self._pairs
        for p in self._properties:
            if p in properties:
                pairs.add((obj, p))
            else:
                pairs.discard((obj, p))
1181822
function Object_assign(target               // @arg Object
                       /* sources ... */) { // @var_args Object - sources objects
                                            // @ret Object - return target
                                            // @desc mixin
    // http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign
    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign

    var args = arguments;

    for (var i = 1, iz = args.length; i < iz; ++i) {
        var source = args[i];

        if (source) {
            var keys = Object.keys(source);

            for (var k = 0, kz = keys.length; k < kz; ++k) {
                var key  = keys[k];
                var desc = Object.getOwnPropertyDescriptor(source, key);

                if (desc && desc["enumerable"]) {
                    target[key] = source[key];
                }
            }
        }
    }
    return target;
}