assign : <assoc=right> ID ( '[' expr ']' )? '=' expr
512610
Expr assign() {
		Tok idTok = peek();
		if (idTok.sym != Sym.ID) {
			return ternary();
		}
		
		int begin = forward;
		// ID = expr
		if (move().sym == Sym.ASSIGN) {
			move();
			return new Assign(idTok.value(), expr(), location);
		}
		
		// array、map 赋值：ID [ expr ] = expr
		if (peek().sym == Sym.LBRACK) {
			move();
			Expr index = expr();
			match(Sym.RBRACK);
			if (peek().sym == Sym.ASSIGN) {
				move();
				return new Assign(idTok.value(), index, expr(), location);	// 右结合无限连
			}
		}
		
		resetForward(begin);
		return ternary();
	}
213758
private void collapseAssign(Node assign, Node expr, Node exprParent) {
    Node leftValue = assign.getFirstChild();
    Node rightValue = leftValue.getNext();

    if (leftValue.isDestructuringPattern()) {
      // We don't collapse expressions containing these because they can have side effects:
      //   - Reassigning RHS names. (e.g. `() => { ({c: a} = a); return a; }`).
      //   - Calling a getter defined on the RHS.
      //   - Evaluating a default value.
      // TODO(b/123102446): Check for these issues and optimize when they aren't present.
      return;
    } else if (isCollapsibleValue(leftValue, true)
        && collapseAssignEqualTo(expr, exprParent, leftValue)) {
      // Condition has side-effects.
    } else if (isCollapsibleValue(rightValue, false)
        && collapseAssignEqualTo(expr, exprParent, rightValue)) {
      // Condition has side-effects.
    } else if (rightValue.isAssign()) {
      // Recursively deal with nested assigns.
      collapseAssign(rightValue, expr, exprParent);
    }
  }
1216379
def p_exprs(p):
    
    if len(p) == 2:
        p[0] = node.expr_list([p[1]])
    elif len(p) == 4:
        p[0] = p[1]
        p[0].append(p[3])
    else:
        assert (0)
    assert isinstance(p[0], node.expr_list)
771740
def assign_from_list(obj: T,
                     fieldlist: Sequence[str],
                     valuelist: Sequence[any]) -> None:
    """"""
    if len(fieldlist) != len(valuelist):
        raise AssertionError("assign_from_list: fieldlist and valuelist of "
                             "different length")
    for i in range(len(valuelist)):
        setattr(obj, fieldlist[i], valuelist[i])
52661
def is_in_expr(expr, find):
  """"""
  return expr == find or (isinstance(expr, ExprNode) and expr.is_in(find))
997118
def assignment(self):
        
        node = self.logical_or_expr()
        if self.token.nature == Nature.ASSIGN:
            token = self.token
            self._process(Nature.ASSIGN)
            right = self.logical_or_expr()
            return Assignment(left=node, op=token, right=right)
        else:
            return node
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;
}
371974
def p_assignlist(self,t):
    ""
    if len(t)==4: t[0] = t[1] + [t[3]]
    elif len(t)==2: t[0] = [t[1]]
    else: raise NotImplementedError('unk_len', len(t)) # pragma: no cover
1134153
function _assign (target, source) {
  var s, from, key;
  var to = Object(target);
  for (s = 1; s < arguments.length; s++) {
    from = Object(arguments[s]);
    for (key in from) {
      if (own(from, key)) {
        to[key] = from[key];
      }
    }
  }
  return to
}
140588
def make_assignment(instr, queue, stack):
    
    value = make_expr(stack)

    # Make assignment targets.
    # If there are multiple assignments (e.g. 'a = b = c'),
    # each LHS expression except the last is preceded by a DUP_TOP instruction.
    # Thus, we make targets until we don't see a DUP_TOP, and then make one
    # more.
    targets = []
    while isinstance(instr, instrs.DUP_TOP):
        targets.append(make_assign_target(queue.popleft(), queue, stack))
        instr = queue.popleft()

    targets.append(make_assign_target(instr, queue, stack))

    return ast.Assign(targets=targets, value=value)
772436
def shapeExprFor(self, id_: Union[ShExJ.shapeExprLabel, START]) -> Optional[ShExJ.shapeExpr]:
        
        rval = self.schema.start if id_ is START else self.schema_id_map.get(str(id_))
        return rval
73532
private void assignAsymIds(List<List<Chain>> polys, List<List<Chain>> nonPolys, List<List<Chain>> waters) {

		for (int i=0; i<polys.size(); i++) {
			String asymId = "A";

			for (Chain poly:polys.get(i)) {
				poly.setId(asymId);
				asymId = getNextAsymId(asymId);
			}
			for (Chain nonPoly:nonPolys.get(i)) {
				nonPoly.setId(asymId);
				asymId = getNextAsymId(asymId);
			}
			for (Chain water:waters.get(i)) {
				water.setId(asymId);
				asymId = getNextAsymId(asymId);
			}
		}
	}
1208365
def _AssignVar(self, matched, value):
    
    _value = self._GetValue(value)
    if _value is not None:
        _value.AssignVar(matched.group(value))
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)
986367
def assignment_source(num_pre, num_post, LISTNAME, ITERNAME):
    
    """
    children = []
    pre = unicode(num_pre)
    post = unicode(num_post)
    # This code builds the assignment source from lib2to3 tree primitives.
    # It's not very readable, but it seems like the most correct way to do it.
    if num_pre > 0:
        pre_part = Node(syms.power, [Name(LISTNAME), Node(syms.trailer, [Leaf(token.LSQB, u"["), Node(syms.subscript, [Leaf(token.COLON, u":"), Number(pre)]), Leaf(token.RSQB, u"]")])])
        children.append(pre_part)
        children.append(Leaf(token.PLUS, u"+", prefix=u" "))
    main_part = Node(syms.power, [Leaf(token.LSQB, u"[", prefix=u" "), Name(LISTNAME), Node(syms.trailer, [Leaf(token.LSQB, u"["), Node(syms.subscript, [Number(pre) if num_pre > 0 else Leaf(1, u""), Leaf(token.COLON, u":"), Node(syms.factor, [Leaf(token.MINUS, u"-"), Number(post)]) if num_post > 0 else Leaf(1, u"")]), Leaf(token.RSQB, u"]"), Leaf(token.RSQB, u"]")])])
    children.append(main_part)
    if num_post > 0:
        children.append(Leaf(token.PLUS, u"+", prefix=u" "))
        post_part = Node(syms.power, [Name(LISTNAME, prefix=u" "), Node(syms.trailer, [Leaf(token.LSQB, u"["), Node(syms.subscript, [Node(syms.factor, [Leaf(token.MINUS, u"-"), Number(post)]), Leaf(token.COLON, u":")]), Leaf(token.RSQB, u"]")])])
        children.append(post_part)
    source = Node(syms.arith_expr, children)
    return source
304207
def assign_statement(self):
        
        left = self.variable()
        op = self.cur_token
        self.eat(TokenTypes.ASSIGN)
        right = self.expression()
        smt = None
        if Features.TYPE_ARRAY in self.features and isinstance(left, GetArrayItem):
            # Remake this as a setitem.
            smt = SetArrayItem(left.left, left.right, right)
        else:
            smt = Assign(op, left, right)
        if self.cur_token.type == TokenTypes.SEMI_COLON:
            self.eat(TokenTypes.SEMI_COLON)
        return smt
666887
function alignRight(str, len, ch) {
    return new Array(len - str.length + 1).join(ch || " ") + str;
}