// Create creates binary memcached parser
179504
func (p *ParserFactory) Create(connection *proxylib.Connection) proxylib.Parser {
	log.Infof("ParserFactory: Create: %v", connection)
	return &Parser{connection: connection, injectQueue: make([]queuedInject, 0)}
}
38690
func (k *kubernetesClient) Create(context.ProviderCallContext, environs.CreateParams) error {
	// must raise errors.AlreadyExistsf if it's already exist.
	return k.createNamespace(k.namespace)
}
1257768
func (tsz *TarSz) Create(out io.Writer) error {
	tsz.wrapWriter()
	return tsz.Tar.Create(out)
}
669451
func Create(input []byte, cfg *Config) ([]byte, common.Address, uint64, error) {
	if cfg == nil {
		cfg = new(Config)
	}
	setDefaults(cfg)

	if cfg.State == nil {
		cfg.State, _ = state.New(common.Hash{}, state.NewDatabase(rawdb.NewMemoryDatabase()))
	}
	var (
		vmenv  = NewEnv(cfg)
		sender = vm.AccountRef(cfg.Origin)
	)

	// Call the code with the given configuration.
	code, address, leftOverGas, err := vmenv.Create(
		sender,
		input,
		cfg.GasLimit,
		cfg.Value,
	)
	return code, address, leftOverGas, err
}
1360042
func (m *Mercury) Create(ctx context.Context, key, val string, opts ...clientv3.OpOption) (*clientv3.TxnResponse, error) {
	return m.BatchCreate(ctx, map[string]string{key: val}, opts...)
}
774516
func (p *StoragePool) Create(flags StoragePoolCreateFlags) error {
	var err C.virError
	result := C.virStoragePoolCreateWrapper(p.ptr, C.uint(flags), &err)
	if result == -1 {
		return makeError(&err)
	}
	return nil
}
250922
func (d *Dir) Create(ctx context.Context, req *fuse.CreateRequest, resp *fuse.CreateResponse) (node fs.Node, handle fs.Handle, err error) {
	ctx = d.folder.fs.config.MaybeStartTrace(ctx, "Dir.Create",
		fmt.Sprintf("%s %s", d.node.GetBasename(), req.Name))
	defer func() { d.folder.fs.config.MaybeFinishTrace(ctx, err) }()

	d.folder.fs.vlog.CLogf(ctx, libkb.VLog1, "Dir Create %s", req.Name)
	defer func() { err = d.folder.processError(ctx, libkbfs.WriteMode, err) }()

	isExec := (req.Mode.Perm() & 0100) != 0
	excl := getEXCLFromCreateRequest(req)
	newNode, ei, err := d.folder.fs.config.KBFSOps().CreateFile(
		ctx, d.node, req.Name, isExec, excl)
	if err != nil {
		return nil, nil, err
	}

	child := d.makeFile(newNode)

	// Create is normally followed an Attr call. Fuse uses the same context for
	// them. If the context is cancelled after the Create call enters the
	// critical portion, and grace period has passed before Attr happens, the
	// Attr can result in EINTR which application does not expect. This caches
	// the EntryInfo for the created node and allows the subsequent Attr call to
	// use the cached EntryInfo instead of relying on a new Stat call.
	if reqID, ok := ctx.Value(CtxIDKey).(string); ok {
		child.eiCache.set(reqID, ei)
	}

	d.folder.nodesMu.Lock()
	d.folder.nodes[newNode.GetID()] = child
	d.folder.nodesMu.Unlock()
	return child, child, nil
}
1118148
func (c *FakeSSHCredentials) Create(sSHCredential *v1alpha2.SSHCredential) (result *v1alpha2.SSHCredential, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewCreateAction(sshcredentialsResource, c.ns, sSHCredential), &v1alpha2.SSHCredential{})

	if obj == nil {
		return nil, err
	}
	return obj.(*v1alpha2.SSHCredential), err
}
568490
func (c *aPIServices) Create(aPIService *v1beta1.APIService) (result *v1beta1.APIService, err error) {
	result = &v1beta1.APIService{}
	err = c.client.Post().
		Resource("apiservices").
		Body(aPIService).
		Do().
		Into(result)
	return
}
1167480
func (c *index) Create(ctx sessionctx.Context, rm kv.RetrieverMutator, indexedValues []types.Datum, h int64,
	opts ...*table.CreateIdxOpt) (int64, error) {
	writeBufs := ctx.GetSessionVars().GetWriteStmtBufs()
	skipCheck := ctx.GetSessionVars().LightningMode || ctx.GetSessionVars().StmtCtx.BatchCheck
	key, distinct, err := c.GenIndexKey(ctx.GetSessionVars().StmtCtx, indexedValues, h, writeBufs.IndexKeyBuf)
	if err != nil {
		return 0, err
	}
	// save the key buffer to reuse.
	writeBufs.IndexKeyBuf = key
	if !distinct {
		// non-unique index doesn't need store value, write a '0' to reduce space
		err = rm.Set(key, []byte{'0'})
		return 0, err
	}

	var value []byte
	if !skipCheck {
		value, err = rm.Get(key)
	}

	if skipCheck || kv.IsErrNotFound(err) {
		err = rm.Set(key, EncodeHandle(h))
		return 0, err
	}

	handle, err := DecodeHandle(value)
	if err != nil {
		return 0, err
	}
	return handle, kv.ErrKeyExists
}
979122
func (_m *SessionServiceServer) Create(_a0 context.Context, _a1 *session.SessionCreateRequest) (*session.SessionResponse, error) {
	ret := _m.Called(_a0, _a1)

	var r0 *session.SessionResponse
	if rf, ok := ret.Get(0).(func(context.Context, *session.SessionCreateRequest) *session.SessionResponse); ok {
		r0 = rf(_a0, _a1)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*session.SessionResponse)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(context.Context, *session.SessionCreateRequest) error); ok {
		r1 = rf(_a0, _a1)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
626814
func (s *KeyGen) Create(user string, details string) (err error) {
	guid := s.guidMaker.Create()
	hash := createHash(user, guid)
	row := map[string]string{
		HMFieldActive:  "true",
		HMFieldDetails: details,
	}
	_, err = s.store().Do("HMSET", redis.Args{hash}.AddFlat(row)...)
	return
}
353444
func (c *ingresses) Create(ingress *extensions.Ingress) (result *extensions.Ingress, err error) {
	result = &extensions.Ingress{}
	err = c.client.Post().
		Namespace(c.ns).
		Resource("ingresses").
		Body(ingress).
		Do().
		Into(result)
	return
}
1179170
func (instanceApi *InstanceApi) Create(instance Instance) (*Instance, error) {
	send, merr := json.Marshal(instance)
	if merr != nil {
		return nil, merr
	}
	body, err := instanceApi.entityService.Create(send, map[string]string{})
	if err != nil {
		return nil, err
	}
	return parseInstance(body), nil
}
20271
func (k *KeyPairsClient) Create(ctx context.Context, pubKey *envelope.PublicKey,
	privKey *envelope.PrivateKey, claim *envelope.Claim) (*envelope.PublicKey,
	*envelope.PrivateKey, []envelope.Claim, error) {

	req := ClaimedKeyPair{
		PublicKeySegment: apitypes.PublicKeySegment{
			PublicKey: pubKey,
			Claims:    []envelope.Claim{*claim},
		},
		PrivateKey: privKey,
	}
	resp := ClaimedKeyPair{}
	err := k.client.RoundTrip(ctx, "POST", "/keypairs", nil, &req, &resp)
	if err != nil {
		return nil, nil, nil, err
	}

	return resp.PublicKey, resp.PrivateKey, resp.Claims, nil
}
1178107
func (c *secrets) Create(secret *v1.Secret) (result *v1.Secret, err error) {
	result = &v1.Secret{}
	err = c.client.Post().
		Namespace(c.ns).
		Resource("secrets").
		Body(secret).
		Do().
		Into(result)
	return
}
784914
func (m *GormCodebaseRepository) Create(ctx context.Context, codebase *Codebase) error {
	defer goa.MeasureSince([]string{"goa", "db", "codebase", "create"}, time.Now())
	if codebase.ID == uuid.Nil {
		codebase.ID = uuid.NewV4()
	}

	if err := m.db.Create(codebase).Error; err != nil {
		// if codebase already exists in the space
		if gormsupport.IsUniqueViolation(err, "codebases_spaceid_url_idx") {
			log.Error(ctx, map[string]interface{}{
				"err":      err,
				"URL":      codebase.URL,
				"space_id": codebase.SpaceID,
			},
				"unable to create codebase because the codebase with same URL already exists in space")
			errStr := fmt.Sprintf("codebase already exists with URL = %s, space_id = %s",
				codebase.URL, codebase.SpaceID)
			return errors.NewDataConflictError(errStr)
		}
		goa.LogError(ctx, "error adding Codebase", "error", err.Error())
		return errs.WithStack(err)
	}

	return nil
}