Add statement lambda definitions.
197399
def stmt_lambda_proc(self, inputstring, **kwargs):
        """"""
        regexes = []
        for i in range(len(self.stmt_lambdas)):
            name = self.stmt_lambda_name(i)
            regex = compile_regex(r"\b%s\b" % (name,))
            regexes.append(regex)
        out = []
        for line in inputstring.splitlines():
            for i, regex in enumerate(regexes):
                if regex.search(line):
                    indent, line = split_leading_indent(line)
                    out.append(indent + self.stmt_lambdas[i])
            out.append(line)
        return "\n".join(out)
1167667
def add_statement(key, obj)
      if obj.is_a?(RDF::Statement)
        @source[normalize_key(key)] = obj 
        local_repository << obj
      end
    end
1104178
private function checkDefinitions(): void {
    // Add many to many stuff if necessary
    foreach($this->unchecked as $def) {
      foreach($def->many_to_many as $relation) {
        //echo "Processing many to many for {$def->name}\n";

        // Set up left keys
        $related = $this->defs[$relation->entity_left];

        if(empty($relation->id_left)) {
          //echo "Setting {$relation->alias_join} id_left to {$related->id->alias}\n";
          $relation->idLeft($related->id->alias);
        }

        if(empty($relation->key_left)) {
          //echo "Setting {$relation->alias_join} key_left to " . keyify($related->name) . "\n";
          $relation->keyLeft(keyify($related->name));
        }
        //

        // Set up right keys
        $related = $this->defs[$relation->entity_right];

        if(empty($relation->id_right)) {
          //echo "Setting {$relation->alias_join} id_right to {$related->id->alias}\n";
          $relation->idRight($related->id->alias);
        }

        if(empty($relation->key_right)) {
          //echo "Setting {$relation->alias_join} key_right to " . keyify($related->name) . "\n";
          $relation->keyRight(keyify($related->name));
        }
        //

        // Left side relations
        $related = $this->defs[$relation->entity_left];

        //echo "Adding {$related->name} hasManyThrough {$relation->alias_join} to {$relation->alias_right}\n";
        $related->hasManyThrough(pluralize($relation->alias_right), $relation->entity_join, $relation->entity_right)
          ->idLocal($relation->id_left)
          ->idForeign($relation->id_right)
          ->keyLocal($relation->key_left)
          ->keyForeign($relation->key_right)
        ;

        if(!array_key_exists($relation->alias_join, $def->has_many)) {
          //echo "Adding {$related->name} hasMany {$def->name}\n";
          $related->hasMany($relation->alias_join, $def->full_name)
            ->localKey  ($relation->id_left)
            ->foreignKey($relation->key_left)
          ;
        }

        if(!array_key_exists($relation->alias_left, $def->belongs_to)) {
          //echo "Adding {$def->name} belongsTo {$related->name}\n";
          $def->belongsTo($relation->alias_left, $related->full_name);
        }
        //

        // Right side relations
        $related = $this->defs[$relation->entity_right];

        //echo "Adding {$related->name} hasManyThrough {$relation->alias_join} to {$relation->alias_left}\n";
        $related->hasManyThrough(pluralize($relation->alias_left), $relation->entity_join, $relation->entity_left)
          ->idLocal($relation->id_right)
          ->idForeign($relation->id_left)
          ->keyLocal($relation->key_right)
          ->keyForeign($relation->key_left)
        ;

        if(!array_key_exists($relation->alias_join, $def->has_many)) {
          //echo "Adding {$related->name} hasMany {$def->name}\n";
          $related->hasMany($relation->alias_join, $def->full_name)
            ->localKey  ($relation->id_right)
            ->foreignKey($relation->key_right)
          ;
        }

        if(!array_key_exists($relation->alias_right, $def->belongs_to)) {
          //echo "Adding {$def->name} belongsTo {$related->name}\n";
          $def->belongsTo($relation->alias_right, $related->full_name);
        }
        //
      }
    }

    // Add has many stuff if necessary
    foreach($this->unchecked as $def) {
      foreach($def->has_many as $relation) {
        //echo "Processing has many for {$def->name}\n";

        $related = $this->defs[$relation->foreign_entity];

        if(empty($relation->local_key)) {
          //echo "Setting {$relation->alias} local_key to {$def->id->alias}\n";
          $relation->localKey($def->id->alias);
        }

        if(empty($relation->foreign_key)) {
          //echo "Setting {$relation->alias} foreign_key to " . keyify($related->name) . "\n";
          $relation->foreignKey(keyify($related->name));
        }
      }
    }

    // Add belongs to stuff if necessary
    foreach($this->unchecked as $def) {
      foreach($def->belongs_to as $relation) {
        //echo "Processing belongs to for {$def->name}\n";

        $related = $this->defs[$relation->foreign_entity];

        if(empty($relation->local_key)) {
          //echo "Setting {$relation->alias} local_key to " . keyify($related->name) . "\n";
          $relation->localKey(keyify($related->name));
        }

        if(empty($relation->foreign_key)) {
          //echo "Setting {$relation->alias} foreign_key to {$def->id->alias}\n";
          $relation->foreignKey($related->id->alias);
        }

        if(!array_key_exists($relation->local_key, $related->required)) {
          //echo "Adding {$def->name} column {$relation->local_key} of type {$related->id->type}\n";
          $def->required($relation->local_key, $related->id->type);
        }
      }
    }

    // We've checked everything in the queue.  Clear it out.
    $this->unchecked = [];
  }
648896
def add_definition(option, name, type, block, **opts)
      opts = {
        parent: extended_class,
        option: option,
        null:   null,
        source: name,
        type:   type,
        block:  block,
        **opts,
      }

      options = Dispatchers.call(opts)
      definition = Definition.new(options)
      definitions[definition.source] = definition
      finalize
      mixin.class_eval definition.code
    end
45613
@Override
    public <E extends Exception> void add(Iteration<? extends Statement, E> statements, Resource... contexts) throws RepositoryException, E {
        while(statements.hasNext()){
            Statement st = statements.next();
            add(st.getSubject(), st.getPredicate(), st.getObject(), mergeResource(st.getContext(), contexts));
        }
    }
400083
def add(self, statement, parameters=None):
        
        if isinstance(statement, six.string_types):
            if parameters:
                encoder = Encoder() if self._session is None else self._session.encoder
                statement = bind_params(statement, parameters, encoder)
            self._add_statement_and_params(False, statement, ())
        elif isinstance(statement, PreparedStatement):
            query_id = statement.query_id
            bound_statement = statement.bind(() if parameters is None else parameters)
            self._update_state(bound_statement)
            self._add_statement_and_params(True, query_id, bound_statement.values)
        elif isinstance(statement, BoundStatement):
            if parameters:
                raise ValueError(
                    "Parameters cannot be passed with a BoundStatement "
                    "to BatchStatement.add()")
            self._update_state(statement)
            self._add_statement_and_params(True, statement.prepared_statement.query_id, statement.values)
        else:
            # it must be a SimpleStatement
            query_string = statement.query_string
            if parameters:
                encoder = Encoder() if self._session is None else self._session.encoder
                query_string = bind_params(query_string, parameters, encoder)
            self._update_state(statement)
            self._add_statement_and_params(False, query_string, ())
        return self
968841
def add_assignment_clause(self, clause):
        
        if not isinstance(clause, AssignmentClause):
            raise StatementException("only instances of AssignmentClause can be added to statements")
        clause.set_context_id(self.context_counter)
        self.context_counter += clause.get_context_size()
        self.assignments.append(clause)
46326
def add_line(self, line, source, *lineno):
        """"""
        self.result.append(line, source, *lineno)
140737
def python(self, func, *args, **kwargs):
        """"""
        self.ops.append(lambda: func(*args, **kwargs))
1189940
@NonNull
  public BatchStatementBuilder addStatements(@NonNull BatchableStatement<?>... statements) {
    return addStatements(Arrays.asList(statements));
  }
59974
protected static Map<String, List<Statement>> addStatementToGroups(Statement statement, Map<String, List<Statement>> claims) {
		Map<String, List<Statement>> newGroups = new HashMap<>(claims);
		String pid = statement.getMainSnak().getPropertyId().getId();
		if(newGroups.containsKey(pid)) {
			List<Statement> newGroup = new ArrayList<>(newGroups.get(pid).size());
			boolean statementReplaced = false;
			for(Statement existingStatement : newGroups.get(pid)) {
				if(existingStatement.getStatementId().equals(statement.getStatementId()) &&
						!existingStatement.getStatementId().isEmpty()) {
					statementReplaced = true;
					newGroup.add(statement);
				} else {
					newGroup.add(existingStatement);
				}
			}
			if(!statementReplaced) {
				newGroup.add(statement);
			}
			newGroups.put(pid, newGroup);
		} else {
			newGroups.put(pid, Collections.singletonList(statement));
		}
		return newGroups;
	}
990759
public function addFunction(FunctionDefinition $func, $statement = null)
    {
        $funcName = strtolower($func->getInternalName());
        if (isset($this->functionDefinitions[$funcName])) {
            // @todo Cover by test
            throw new CompilerException(
                "Function '".$func->getCompleteName()."' was defined more than one time",
                $statement
            );
        }

        $this->functionDefinitions[$funcName] = $func;
    }
1302913
def assign(self, expr):
        """"""
        name = self.variable()
        self.statements.append(ast.Assign([ast.Name(name, ast.Store())], expr))
        return ast.Name(name, ast.Load())
1065013
function() {
    this.appendDummyInput()
        .appendField(Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE);
    this.appendStatementInput('STACK');
    this.appendDummyInput('STATEMENT_INPUT')
        .appendField(Blockly.Msg.PROCEDURES_ALLOW_STATEMENTS)
        .appendField(new Blockly.FieldCheckbox('TRUE'), 'STATEMENTS');
    this.setColour(Blockly.Blocks.procedures.HUE);
    this.setTooltip(Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP);
    this.contextMenu = false;
  }
1304495
def p_with_statement(self, p):
        """"""
        p[0] = self.asttypes.With(expr=p[3], statement=p[5])
        p[0].setpos(p)
443121
def add(self, value):
        """"""
        if value not in self._set:
            self._set.add(value)
            self._list.add(value)
1209380
void apply(final LambdaUnaryOpDouble lambda) {
        params.apply(new FnIntDoubleToDouble() {
            @Override
            public double call(int idx, double val) {
                return lambda.call(val);
            }
        });
    }