Creates a new statement matching the keyword arguments specified.
        Returns the created statement.
427729
def create(self, **kwargs):
        
        Statement = self.get_model('statement')

        if 'tags' in kwargs:
            kwargs['tags'] = list(set(kwargs['tags']))

        if 'search_text' not in kwargs:
            kwargs['search_text'] = self.tagger.get_bigram_pair_string(kwargs['text'])

        if 'search_in_response_to' not in kwargs:
            if kwargs.get('in_response_to'):
                kwargs['search_in_response_to'] = self.tagger.get_bigram_pair_string(kwargs['in_response_to'])

        inserted = self.statements.insert_one(kwargs)

        kwargs['id'] = inserted.inserted_id

        return Statement(**kwargs)
1021013
def create(self, no_data=False):
        """"""

        if self.query:
            ddl_statement = self.compile_create_as()
        else:
            ddl_statement = self.compile_create()

        if no_data:
            ddl_statement += '\nWITH NO DATA'

        return ddl_statement, self.query_values
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);
  }
997154
def create(self, name, *args, **kwargs):
        """"""
        tokens = name.split()

        if len(tokens) > 1 and (len(args) > 0 or len(kwargs) > 0):
            msg  = 'A Cmd may be created with either positional arguments '
            msg += '(passed as a string or a Python list) or keyword '
            msg += 'arguments, but not both.'
            raise TypeError(msg)

        if len(tokens) > 1:
            name = tokens[0]
            args = [ util.toNumber(t, t) for t in tokens[1:] ]

        defn = self.get(name, None)

        if defn is None:
            raise TypeError('Unrecognized command: %s' % name)

        return createCmd(defn, *args, **kwargs)
827293
@SuppressWarnings("unchecked")
	public T create(Object[] args)
	{
		for(int i=0, n=args.length; i<n; i++)
		{
			if(arguments[i] instanceof FactoryDefinition.InjectedArgument)
			{
				args[i] = arguments[i].getValue(null);
			}
		}

		try
		{
			return (T) raw.newInstance(args);
		}
		catch(IllegalArgumentException e)
		{
			throw new SerializationException("Unable to create; " + e.getMessage(), e);
		}
		catch(InstantiationException e)
		{
			throw new SerializationException("Unable to create; " + e.getMessage(), e);
		}
		catch(IllegalAccessException e)
		{
			throw new SerializationException("Unable to create; " + e.getMessage(), e);
		}
		catch(InvocationTargetException e)
		{
			throw new SerializationException("Unable to create; " + e.getCause().getMessage(), e.getCause());
		}
	}
716811
def macro_create(self, args: argparse.Namespace) -> None:
        """"""

        # Validate the macro name
        valid, errmsg = self.statement_parser.is_valid_command(args.name)
        if not valid:
            self.perror("Invalid macro name: {}".format(errmsg), traceback_war=False)
            return

        if args.name in self.get_all_commands():
            self.perror("Macro cannot have the same name as a command", traceback_war=False)
            return

        if args.name in self.aliases:
            self.perror("Macro cannot have the same name as an alias", traceback_war=False)
            return

        utils.unquote_redirection_tokens(args.command_args)

        # Build the macro value string
        value = args.command
        if args.command_args:
            value += ' ' + ' '.join(args.command_args)

        # Find all normal arguments
        arg_list = []
        normal_matches = re.finditer(MacroArg.macro_normal_arg_pattern, value)
        max_arg_num = 0
        arg_nums = set()

        while True:
            try:
                cur_match = normal_matches.__next__()

                # Get the number string between the braces
                cur_num_str = (re.findall(MacroArg.digit_pattern, cur_match.group())[0])
                cur_num = int(cur_num_str)
                if cur_num < 1:
                    self.perror("Argument numbers must be greater than 0", traceback_war=False)
                    return

                arg_nums.add(cur_num)
                if cur_num > max_arg_num:
                    max_arg_num = cur_num

                arg_list.append(MacroArg(start_index=cur_match.start(), number_str=cur_num_str, is_escaped=False))

            except StopIteration:
                break

        # Make sure the argument numbers are continuous
        if len(arg_nums) != max_arg_num:
            self.perror("Not all numbers between 1 and {} are present "
                        "in the argument placeholders".format(max_arg_num), traceback_war=False)
            return

        # Find all escaped arguments
        escaped_matches = re.finditer(MacroArg.macro_escaped_arg_pattern, value)

        while True:
            try:
                cur_match = escaped_matches.__next__()

                # Get the number string between the braces
                cur_num_str = re.findall(MacroArg.digit_pattern, cur_match.group())[0]

                arg_list.append(MacroArg(start_index=cur_match.start(), number_str=cur_num_str, is_escaped=True))
            except StopIteration:
                break

        # Set the macro
        result = "overwritten" if args.name in self.macros else "created"
        self.macros[args.name] = Macro(name=args.name, value=value, minimum_arg_count=max_arg_num, arg_list=arg_list)
        self.poutput("Macro '{}' {}".format(args.name, result))
1031342
def create(cls, expr, binds):
        
        return cls(expr=expr, binds=binds, dtype=bool_dtype)
365095
function createOnStatementRequestSuccRow(statement, context)
{
  return function(body)
  {
    // if we don't already have a result
    if (!context.result)
    {
      // build a result from the response
      context.result = new Result(
      {
        response         : body,
        statement        : statement,
        services         : context.services,
        connectionConfig : context.connectionConfig
      });

      // save the statement id
      context.statementId = context.result.getStatementId();
    }
    else
    {
      // refresh the existing result
      context.result.refresh(body);
    }

    // only update the parameters if the statement isn't a post-exec statement
    if (context.type !== statementTypes.ROW_POST_EXEC)
    {
      Parameters.update(context.result.getParametersArray());
    }
  };
}
866253
def with_args(self, *args, **kwargs):
        

        self.args = args
        self.kwargs = kwargs
        self.verify_arguments()
        return self
775644
def new_parser(self):
        

        parser = argparse.ArgumentParser(description=self.description)
        parser.add_argument(
            '--version', help='show version and exit',
            default=False, action='store_true')
        parser.add_argument(
            '--debug', help='enable debugging',
            default=False, action='store_true')
        return parser
383832
public StatementInfo prepareStatementInfo() throws SQLException {
		List<ArgumentHolder> argList = new ArrayList<ArgumentHolder>();
		String statement = buildStatementString(argList);
		return new StatementInfo(statement, argList);
	}
180530
public Sql[] generateSql(CreateSynonymStatement statement, Database database, SqlGeneratorChain chain) {
		StringBuilder sql = new StringBuilder("CREATE ");
		if (statement.isReplace() != null && statement.isReplace()) {
			sql.append("OR REPLACE ");
		}

		if (statement.isPublic() != null && statement.isPublic()) {
			sql.append("PUBLIC ");
		}

		sql.append("SYNONYM ");

		if (statement.getSynonymSchemaName() != null) {
			sql.append(statement.getSynonymSchemaName()).append(".");
		}

		sql.append(statement.getSynonymName());
		sql.append(" FOR ");

		if (statement.getObjectSchemaName() != null) {
			sql.append(statement.getObjectSchemaName()).append(".");
		}

		sql.append(statement.getObjectName());

		return new Sql[] { new UnparsedSql(sql.toString()) };
	}
640134
def new(cls, func, args, mon, count=0):
        
        try:
            with mon:
                val = func(*args)
        except StopIteration:
            res = Result(None, mon, msg='TASK_ENDED')
        except Exception:
            _etype, exc, tb = sys.exc_info()
            res = Result(exc, mon, ''.join(traceback.format_tb(tb)),
                         count=count)
        else:
            res = Result(val, mon, count=count)
        return res
75256
def create_statement(
        self, session_id: int, code: str, kind: StatementKind = None
    ) -> Statement:
        

        data = {"code": code}

        if kind is not None:
            if self.legacy_server():
                LOGGER.warning("statement kind ignored on Livy<0.5.0")
            data["kind"] = kind.value

        response = self._client.post(
            f"/sessions/{session_id}/statements", data=data
        )
        return Statement.from_json(session_id, response)
1211589
def create(cls, id=None, **kwargs):
        
        what = cls(**kwargs)
        if id:
            setattr(what, cls.primaryKey, id)
        what.save()
        return what
1319310
public static function create()
	{
		switch (func_num_args()) {
			case 0:
				return new FileDescriptorProto();
			case 1:
				return new FileDescriptorProto(func_get_arg(0));
			case 2:
				return new FileDescriptorProto(func_get_arg(0), func_get_arg(1));
			case 3:
				return new FileDescriptorProto(func_get_arg(0), func_get_arg(1), func_get_arg(2));
			case 4:
				return new FileDescriptorProto(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3));
			case 5:
				return new FileDescriptorProto(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4));
			case 6:
				return new FileDescriptorProto(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5));
			case 7:
				return new FileDescriptorProto(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5), func_get_arg(6));
			case 8:
				return new FileDescriptorProto(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5), func_get_arg(6), func_get_arg(7));
			default:
				throw new \InvalidArgumentException('More than 8 arguments supplied, please be reasonable.');
		}
	}
730152
def alias_create(self, args: argparse.Namespace) -> None:
        """"""

        # Validate the alias name
        valid, errmsg = self.statement_parser.is_valid_command(args.name)
        if not valid:
            self.perror("Invalid alias name: {}".format(errmsg), traceback_war=False)
            return

        if args.name in self.macros:
            self.perror("Alias cannot have the same name as a macro", traceback_war=False)
            return

        utils.unquote_redirection_tokens(args.command_args)

        # Build the alias value string
        value = args.command
        if args.command_args:
            value += ' ' + ' '.join(args.command_args)

        # Set the alias
        result = "overwritten" if args.name in self.aliases else "created"
        self.aliases[args.name] = value
        self.poutput("Alias '{}' {}".format(args.name, result))