Creates multiple statement entries.
421122
def create_many(self, statements):
        
        Statement = self.get_model('statement')
        Tag = self.get_model('tag')

        tag_cache = {}

        for statement in statements:

            statement_data = statement.serialize()
            tag_data = statement_data.pop('tags', [])

            statement_model_object = Statement(**statement_data)

            if not statement.search_text:
                statement_model_object.search_text = self.tagger.get_bigram_pair_string(statement.text)

            if not statement.search_in_response_to and statement.in_response_to:
                statement_model_object.search_in_response_to = self.tagger.get_bigram_pair_string(statement.in_response_to)

            statement_model_object.save()

            tags_to_add = []

            for tag_name in tag_data:
                if tag_name in tag_cache:
                    tag = tag_cache[tag_name]
                else:
                    tag, _ = Tag.objects.get_or_create(name=tag_name)
                    tag_cache[tag_name] = tag
                tags_to_add.append(tag)

            statement_model_object.tags.add(*tags_to_add)
885016
function createContextPreExec(
    statementOptions, services, connectionConfig)
{
  // check for missing options
  Errors.checkArgumentExists(Util.exists(statementOptions),
      ErrorCodes.ERR_CONN_EXEC_STMT_MISSING_OPTIONS);

  // check for invalid options
  Errors.checkArgumentValid(Util.isObject(statementOptions),
      ErrorCodes.ERR_CONN_EXEC_STMT_INVALID_OPTIONS);

  // check for missing sql text
  Errors.checkArgumentExists(Util.exists(statementOptions.sqlText),
      ErrorCodes.ERR_CONN_EXEC_STMT_MISSING_SQL_TEXT);

  // check for invalid sql text
  Errors.checkArgumentValid(Util.isString(statementOptions.sqlText),
      ErrorCodes.ERR_CONN_EXEC_STMT_INVALID_SQL_TEXT);

  // check for invalid complete callback
  var complete = statementOptions.complete;
  if (Util.exists(complete))
  {
    Errors.checkArgumentValid(Util.isFunction(complete),
        ErrorCodes.ERR_CONN_EXEC_STMT_INVALID_COMPLETE);
  }

  // check for invalid streamResult
  if (Util.exists(statementOptions.streamResult))
  {
    Errors.checkArgumentValid(Util.isBoolean(statementOptions.streamResult),
        ErrorCodes.ERR_CONN_EXEC_STMT_INVALID_STREAM_RESULT);
  }

  // check for invalid fetchAsString
  var fetchAsString = statementOptions.fetchAsString;
  if (Util.exists(fetchAsString))
  {
    // check that the value is an array
    Errors.checkArgumentValid(Util.isArray(fetchAsString),
        ErrorCodes.ERR_CONN_EXEC_STMT_INVALID_FETCH_AS_STRING);

    // check that all the array elements are valid
    var invalidValueIndex = NativeTypes.findInvalidValue(fetchAsString);
    Errors.checkArgumentValid(invalidValueIndex === -1,
        ErrorCodes.ERR_CONN_EXEC_STMT_INVALID_FETCH_AS_STRING_VALUES,
        JSON.stringify(fetchAsString[invalidValueIndex]));
  }

  // if parameters are specified, make sure the specified value is an object
  if (Util.exists(statementOptions.parameters))
  {
    Errors.checkArgumentValid(Util.isObject(statementOptions.parameters),
        ErrorCodes.ERR_CONN_EXEC_STMT_INVALID_PARAMETERS);
  }

  // if binds are specified
  var binds = statementOptions.binds;
  if (Util.exists(binds))
  {
    // make sure the specified value is an array
    Errors.checkArgumentValid(Util.isArray(binds),
        ErrorCodes.ERR_CONN_EXEC_STMT_INVALID_BINDS);

    // make sure everything in the binds array is stringifiable
    for (var index = 0, length = binds.length; index < length; index++)
    {
      Errors.checkArgumentValid(JSON.stringify(binds[index]) !== undefined,
          ErrorCodes.ERR_CONN_EXEC_STMT_INVALID_BIND_VALUES, binds[index]);
    }
  }

  // if an internal option is specified, make sure it's boolean
  if (Util.exists(statementOptions.internal))
  {
    Errors.checkArgumentValid(Util.isBoolean(statementOptions.internal),
        ErrorCodes.ERR_CONN_EXEC_STMT_INVALID_INTERNAL);
  }

  // create a statement context
  var statementContext = createStatementContext();

  statementContext.sqlText       = statementOptions.sqlText;
  statementContext.complete      = complete;
  statementContext.streamResult  = statementOptions.streamResult;
  statementContext.fetchAsString = statementOptions.fetchAsString;

  // if a binds array is specified, add it to the statement context
  if (Util.exists(statementOptions.binds))
  {
    statementContext.binds = statementOptions.binds;
  }

  // if parameters are specified, add them to the statement context
  if (Util.exists(statementOptions.parameters))
  {
    statementContext.parameters = statementOptions.parameters;
  }

  // if the internal flag is specified, add it to the statement context
  if (Util.exists(statementOptions.internal))
  {
    statementContext.internal = statementOptions.internal;
  }

  // validate non-user-specified arguments
  Errors.assertInternal(Util.isObject(services));
  Errors.assertInternal(Util.isObject(connectionConfig));

  // if we're not in qa mode, use a random uuid for the statement request id
  if (!connectionConfig.isQaMode())
  {
    statementContext.requestId = uuidv4();
  }
  else // we're in qa mode
  {
    // if a request id or sequence id are specified in the statement options,
    // use them as is; this is to facilitate testing by making things more
    // deterministic
    if (Util.isString(statementOptions.requestId))
    {
      statementContext.requestId = statementOptions.requestId;
    }
  }

  return statementContext;
}
647453
private void executeJdbcStatements(Connection connection, String configName, String statements, String description) {
        Statement stmt = createStatement(configName, connection);
        try {
            log.debug("Executing statement [" + description + "]");
            
            List<String> stmtsToExecute = Stream.of(statements.split(";"))
                    .map(String::trim)
                    .filter(s -> s.length() > 0)
                    .collect(Collectors.toList());
            
            if ( log.isTraceEnabled()) {
                log.trace("These statements will be executed:");
                stmtsToExecute.forEach(s -> log.trace("Statement: [" + s + "]"));
            }
            
            for ( String currentStatement : stmtsToExecute) {
                stmt.execute(currentStatement);
                log.trace("Executing statement: " + currentStatement + " OK!");
            }
            
        } catch (SQLException e) {
            throw new ChorusException(
                    String.format("Failed while executing statement [%s] on database + %s [%s]", description, configName, e.toString(), e)
            );
        }
    }
1189940
@NonNull
  public BatchStatementBuilder addStatements(@NonNull BatchableStatement<?>... statements) {
    return addStatements(Arrays.asList(statements));
  }
590062
public void setStatements(List<AstNode> statements) {
        if (this.statements != null) {
            this.statements.clear();
        }
        for (AstNode s : statements) {
            addStatement(s);
        }
    }
1078223
def associative_create_statement(query_params={})
      filter = ActionDispatch::Http::ParameterFilter.new(Rails.application.config.filter_parameters)
      query_params.reverse_merge!(
        :controller_name => controller_name,
        :action_name => action_name,
        :user_id => user_id,
        :request_hash => @impressionist_hash,
        :session_hash => session_hash,
        :ip_address => request.remote_ip,
        :referrer => request.referer,
        :params => filter.filter(params_hash)
        )
    end
213540
function combineContiguousOutputStatements (ast) {
  traverse.traverse(ast, {
    enter: function (node, parent) {
      if (node.type !== 'BlockStatement') {
        return;
      }
      var prev = false;

      node.body = fast.reduce(node.body, function (body, statement) {
        if (
          !body.length ||
          statement.type !== 'ExpressionStatement' ||
          statement.expression.type !== 'AssignmentExpression' ||
          statement.expression.operator !== '+=' ||
          statement.expression.left.type !== 'Identifier' ||
          statement.expression.left.name !== 'html'
        ) {
          prev = false;
          body.push(statement);
          return body;
        }
        else if (!prev) {
          prev = statement;
          body.push(statement);
          return body;
        }
        prev.expression.right = {
          type: 'BinaryExpression',
          operator: '+',
          left: prev.expression.right,
          right: statement.expression.right
        };
        return body;
      }, []);
    }
  });
  return ast;
}
1045795
private static <T, ID> void addCreateTableStatements(DatabaseType databaseType, TableInfo<T, ID> tableInfo,
			List<String> statements, List<String> queriesAfter, boolean ifNotExists, boolean logDetails)
			throws SQLException {
		StringBuilder sb = new StringBuilder(256);
		if (logDetails) {
			logger.info("creating table '{}'", tableInfo.getTableName());
		}
		sb.append("CREATE TABLE ");
		if (ifNotExists && databaseType.isCreateIfNotExistsSupported()) {
			sb.append("IF NOT EXISTS ");
		}
		databaseType.appendEscapedEntityName(sb, tableInfo.getTableName());
		sb.append(" (");
		List<String> additionalArgs = new ArrayList<String>();
		List<String> statementsBefore = new ArrayList<String>();
		List<String> statementsAfter = new ArrayList<String>();
		// our statement will be set here later
		boolean first = true;
		for (FieldType fieldType : tableInfo.getFieldTypes()) {
			// skip foreign collections
			if (fieldType.isForeignCollection()) {
				continue;
			} else if (first) {
				first = false;
			} else {
				sb.append(", ");
			}
			String columnDefinition = fieldType.getColumnDefinition();
			if (columnDefinition == null) {
				// we have to call back to the database type for the specific create syntax
				databaseType.appendColumnArg(tableInfo.getTableName(), sb, fieldType, additionalArgs, statementsBefore,
						statementsAfter, queriesAfter);
			} else {
				// hand defined field
				databaseType.appendEscapedEntityName(sb, fieldType.getColumnName());
				sb.append(' ').append(columnDefinition).append(' ');
			}
		}
		// add any sql that sets any primary key fields
		databaseType.addPrimaryKeySql(tableInfo.getFieldTypes(), additionalArgs, statementsBefore, statementsAfter,
				queriesAfter);
		// add any sql that sets any unique fields
		databaseType.addUniqueComboSql(tableInfo.getFieldTypes(), additionalArgs, statementsBefore, statementsAfter,
				queriesAfter);
		for (String arg : additionalArgs) {
			// we will have spat out one argument already so we don't have to do the first dance
			sb.append(", ").append(arg);
		}
		sb.append(") ");
		databaseType.appendCreateTableSuffix(sb);
		statements.addAll(statementsBefore);
		statements.add(sb.toString());
		statements.addAll(statementsAfter);
		addCreateIndexStatements(databaseType, tableInfo, statements, ifNotExists, false, logDetails);
		addCreateIndexStatements(databaseType, tableInfo, statements, ifNotExists, true, logDetails);
	}
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
186780
def p_statements_statement(p):
    
    if len(p) == 2:
        p[0] = make_block(p[1])
    else:
        p[0] = make_block(p[1], p[2])
834441
public T withStatement(Statement statement) {
		PropertyIdValue pid = statement.getMainSnak()
				.getPropertyId();
		ArrayList<Statement> pidStatements = this.statements.get(pid);
		if (pidStatements == null) {
			pidStatements = new ArrayList<Statement>();
			this.statements.put(pid, pidStatements);
		}

		pidStatements.add(statement);
		return getThis();
	}
974644
private void prepareStatements() throws DatabaseException {
        for (PreparedStatementCveDb key : values()) {
            PreparedStatement preparedStatement = null;
            try {
                final String statementString = statementBundle.getString(key.name());
                if (key == INSERT_VULNERABILITY || key == INSERT_CPE) {
                    preparedStatement = connection.prepareStatement(statementString, new String[]{"id"});
                } else {
                    preparedStatement = connection.prepareStatement(statementString);
                }
            } catch (SQLException ex) {
                throw new DatabaseException(ex);
            } catch (MissingResourceException ex) {
                if (!ex.getMessage().contains("key MERGE_PROPERTY")) {
                    throw new DatabaseException(ex);
                }
            }
            if (preparedStatement != null) {
                preparedStatements.put(key, preparedStatement);
            }
        }
    }
160797
public static Statement newInstance(Statement stmt, Log statementLog, int queryStack) {
    InvocationHandler handler = new StatementLogger(stmt, statementLog, queryStack);
    ClassLoader cl = Statement.class.getClassLoader();
    return (Statement) Proxy.newProxyInstance(cl, new Class[]{Statement.class}, handler);
  }
806765
@NonNull
  public BatchStatementBuilder addStatement(@NonNull BatchableStatement<?> statement) {
    if (statementsCount >= 0xFFFF) {
      throw new IllegalStateException(
          "Batch statement cannot contain more than " + 0xFFFF + " statements.");
    }
    statementsCount += 1;
    statementsBuilder.add(statement);
    return this;
  }
1140997
private Statements createSequencesStatements(Iterable<Sequence> sequences) {
		Statements statements = new Statements();
		for ( Sequence sequence : sequences ) {
			addSequence( statements, sequence );
		}
		return statements;
	}
1259439
@Override
    public void add(Iterable<? extends Statement> statements, Resource... contexts) throws RepositoryException {
        Iterator <? extends Statement> iter = statements.iterator();
        while(iter.hasNext()){
            Statement st = iter.next();
            add(st, mergeResource(st.getContext(), contexts));
        }
    }
1116900
def get_statements(self):
        """"""
        statements = []
        for statement in self._parsed:
            if statement:
                sql = str(statement).strip(' \n;\t')
                if sql:
                    statements.append(sql)
        return statements