text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func New() *LoopCondition {
return &LoopCondition{
falseExpression: &ast.BinaryExpr{
X: ast.NewIdent("0"),
OpPos: 0,
Op: token.NEQ,
Y: ast.NewIdent("0"),
},
}
} | [
-0.21987056732177734,
-1.3471113443374634,
0.26948419213294983,
-0.5536006093025208,
-1.6814526319503784,
0.785035252571106,
-0.2538895606994629,
-0.594763457775116,
-1.2970744371414185,
0.2930937707424164,
-0.5736503005027771,
0.6180951595306396,
0.28244081139564514,
0.7925424575805664,
... |
func NewDeleteExecutionNoContent() *DeleteExecutionNoContent {
return &DeleteExecutionNoContent{}
} | [
-0.18112701177597046,
-0.14012253284454346,
-0.1912313997745514,
0.6616947650909424,
-0.7664868235588074,
-1.0641283988952637,
0.34427410364151,
-1.238172173500061,
0.10177049785852432,
-0.7510753273963928,
-0.15151232481002808,
-0.2870764136314392,
0.22028116881847382,
0.44421055912971497... |
func (o *DeleteExecutionNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(204)
} | [
-0.5658794641494751,
-0.5302771329879761,
0.21445806324481964,
0.5641198754310608,
0.7618631720542908,
-0.9806191921234131,
0.5095595121383667,
-0.27285152673721313,
0.16596288979053497,
-0.09594913572072983,
0.2705889940261841,
-0.29080235958099365,
-1.0582195520401,
0.569461464881897,
... |
func (t *TempDirGenerator) NewTempDir() (string, error) {
t.lock.Lock()
defer t.lock.Unlock()
dir, err := ioutil.TempDir("", "stereoscope-cache")
if err != nil {
return "", fmt.Errorf("could not create temp dir: %w", err)
}
t.tempDir = append(t.tempDir, dir)
return dir, nil
} | [
-0.9273418188095093,
-0.3399425446987152,
0.4505811929702759,
-0.28705349564552307,
-0.41137564182281494,
-0.031755249947309494,
0.2608513832092285,
-0.2863151729106903,
0.12067077308893204,
-0.22455701231956482,
-0.05211733281612396,
-0.46112242341041565,
-0.5043154358863831,
1.0400621891... |
func SumarLista(sumFunc sumador, numeros ...int) (int, error) {
//Si no me ingresan nada, devuelvo el error
if len(numeros) == 0 {
return 0, sinNumerosError{}
}
var res int
numbersQty := len(numeros)
bufferSize := len(numeros) / 2
//Me fijo la cantidad de iteraciones que tengo que hacer. Esto es porque si ... | [
0.23565492033958435,
0.35818612575531006,
0.9545423984527588,
0.38349226117134094,
0.4556660056114197,
-0.09784745424985886,
0.6479603052139282,
0.06128234416246414,
0.06596555560827255,
0.12880045175552368,
-0.9518711566925049,
0.24753454327583313,
-1.0909744501113892,
0.31131190061569214... |
func (fn ReadAdmissionregistrationV1beta1ValidatingWebhookConfigurationHandlerFunc) Handle(params ReadAdmissionregistrationV1beta1ValidatingWebhookConfigurationParams) middleware.Responder {
return fn(params)
} | [
-0.04743187129497528,
-0.08487704396247864,
0.47640785574913025,
0.4870567321777344,
-0.07205210626125336,
0.2204614132642746,
0.5515361428260803,
0.48385855555534363,
-0.32403355836868286,
0.591930627822876,
0.9339601397514343,
-0.060946911573410034,
-0.8304337859153748,
0.698625147342681... |
func NewReadAdmissionregistrationV1beta1ValidatingWebhookConfiguration(ctx *middleware.Context, handler ReadAdmissionregistrationV1beta1ValidatingWebhookConfigurationHandler) *ReadAdmissionregistrationV1beta1ValidatingWebhookConfiguration {
return &ReadAdmissionregistrationV1beta1ValidatingWebhookConfiguration{Context... | [
-0.44194844365119934,
-0.256332665681839,
0.516089677810669,
-0.2701830267906189,
-0.3095661997795105,
-0.26326820254325867,
0.3109258711338043,
0.11094394326210022,
-0.6506231427192688,
0.7481212615966797,
0.24165980517864227,
0.1993083953857422,
-0.5207111239433289,
1.412865161895752,
... |
func Middleware(h http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
tracer := opentracing.GlobalTracer()
operationName := fmt.Sprintf("%s %s%s", req.Method, req.Host, req.URL.Path)
var span opentracing.Span
var ctx context.Context
if spanCtx, err := tracer... | [
-0.010837665759027004,
0.39594656229019165,
1.0506478548049927,
0.130893275141716,
-0.14159536361694336,
0.01448772195726633,
0.2335955649614334,
-0.3758583664894104,
0.42538172006607056,
0.0025639778468757868,
-0.011867671273648739,
0.011815371923148632,
-0.520229697227478,
0.471346586942... |
func (c *HTTPClient) ThrottleDeadline() time.Time {
c.l.Lock()
defer c.l.Unlock()
return c.throttleDeadline
} | [
0.4897867739200592,
0.0294874869287014,
0.46378687024116516,
-0.42053183913230896,
0.4428844451904297,
0.7433341145515442,
-0.8215161561965942,
-0.5062504410743713,
-0.6657318472862244,
0.10596868395805359,
-0.7067195177078247,
0.3178868889808655,
-0.8959046006202698,
-0.15495476126670837,... |
func (c *HTTPClient) Do(ctx context.Context, method string, path string, params map[string]string, data interface{}, result interface{}) (statusCode int, err error) {
c.l.Lock()
defer c.l.Unlock()
req, err := c.prepareRequest(method, path, params, data)
if err != nil {
return 0, err
}
return c.do(ctx, req, re... | [
-0.5866313576698303,
0.6080628633499146,
0.698585033416748,
0.03760971501469612,
0.29474616050720215,
-0.06994875520467758,
-0.29084399342536926,
-0.4754028022289276,
-0.7619566321372986,
0.2830963432788849,
-0.22165244817733765,
0.504256546497345,
-0.3506472706794739,
0.2215939611196518,
... |
func (c *HTTPClient) DoUnauthenticated(ctx context.Context, method string, path string, params map[string]string, data interface{}, result interface{}) (statusCode int, err error) {
c.l.Lock()
defer c.l.Unlock()
req, err := c.prepareRequest(method, path, params, data)
if err != nil {
return 0, err
}
return c.... | [
-1.5890214443206787,
-0.014178059063851833,
0.5750692486763,
-0.30990827083587646,
0.3827405869960785,
-0.08928584307432175,
0.3867602050304413,
0.11771653592586517,
-0.08740026503801346,
0.14562715590000153,
-0.9345518350601196,
0.7092331647872925,
-0.15460453927516937,
-0.530552327632904... |
func (c *HTTPClient) DoTLSInsecure(ctx context.Context, method string, path string, params map[string]string, data interface{}, result interface{}) (statusCode int, err error) {
c.l.Lock()
defer c.l.Unlock()
req, err := c.prepareRequest(method, path, params, data)
if err != nil {
return 0, err
}
return c.do(c... | [
-0.7608481049537659,
0.5890311002731323,
0.8987802267074585,
-0.057769469916820526,
-0.24911029636859894,
-0.9857235550880432,
-0.5304404497146606,
-1.0540691614151,
0.11578254401683807,
0.15745188295841217,
-1.0587704181671143,
0.478505939245224,
-0.8486642241477966,
-0.7673449516296387,
... |
func (c *HTTPClient) DoWithBody(ctx context.Context, path string, contentType string, body io.Reader) (int, error) {
c.l.Lock()
defer c.l.Unlock()
u, err := c.baseURL.Parse(path)
if err != nil {
return 0, err
}
req, err := http.NewRequestWithContext(ctx, http.MethodPost, u.String(), body)
if err != nil {
r... | [
-0.809785783290863,
-0.06928235292434692,
0.9540936350822449,
-0.0968547984957695,
0.6093345284461975,
0.022388119250535965,
0.3186909556388855,
-0.8823814392089844,
-0.34285491704940796,
0.344310462474823,
-0.05987372621893883,
0.4074718952178955,
-0.7372129559516907,
0.4090178906917572,
... |
func (c *HTTPClient) PostAuth(ctx context.Context, path string, data interface{}, username string, password string, result interface{}) (statusCode int, err error) {
c.l.Lock()
defer c.l.Unlock()
req, err := c.prepareRequest("POST", path, nil, data)
if err != nil {
return 0, err
}
req.SetBasicAuth(username, p... | [
-1.1754639148712158,
0.12054844200611115,
0.6013267040252686,
0.713192880153656,
-0.47333312034606934,
-0.05396336317062378,
0.5489314794540405,
0.1044141948223114,
-0.4194159209728241,
-0.4139598309993744,
-1.0992976427078247,
0.44874340295791626,
-1.3641917705535889,
-0.18885363638401031... |
func (c *HTTPClient) Iter(ctx context.Context, resource string, params map[string]string) ([]json.RawMessage, error) {
if params == nil {
params = make(map[string]string)
}
if _, ok := params["page_size"]; !ok {
params["page_size"] = "10000"
}
result := make([]json.RawMessage, 0)
next := fmt.Sprintf("v1/%s/... | [
-0.6444084048271179,
0.022927263751626015,
0.7827780246734619,
-0.36418551206588745,
0.36526569724082947,
-0.10878057777881622,
-0.10232310742139816,
-0.6046060919761658,
-0.3315700590610504,
0.6587487459182739,
0.5513179898262024,
0.23835904896259308,
0.002848351374268532,
1.1537621021270... |
func (c *HTTPClient) GetJWT(ctx context.Context) (types.JWT, error) {
if c.jwt.Refresh != "" {
body, err := json.Marshal(map[string]string{
"refresh": c.jwt.Refresh,
})
if err != nil {
return types.JWT{}, fmt.Errorf("marshal body: %w", err)
}
token, err := c.getJWT(ctx, "v1/jwt-refresh/", body)
// ... | [
-0.4230688512325287,
0.03844057023525238,
0.6695588827133179,
0.8293218612670898,
-0.22184042632579803,
-0.5505393743515015,
-0.3788199722766876,
-1.5761182308197021,
0.30438780784606934,
-0.3093926012516022,
0.1477726548910141,
1.190621256828308,
0.3214997351169586,
0.32257792353630066,
... |
func (c *HTTPClient) VerifyAndGetJWT(ctx context.Context, agentID string) (string, error) {
var res struct {
ID string
}
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
defer cancel()
// Low cost API endpoint, used to test our JWT.
path := fmt.Sprintf("v1/agent/%s/?fields=id", agentID)
// We rely on... | [
1.0611145496368408,
-0.47928208112716675,
0.38543999195098877,
0.19809402525424957,
-0.3214423656463623,
-0.869503915309906,
-0.6938772201538086,
-0.6563873291015625,
1.1237064599990845,
-0.013615867123007774,
-0.30049794912338257,
0.9970430135726929,
-0.3029928505420685,
0.776123821735382... |
func NewCommsNotification()(*CommsNotification) {
m := &CommsNotification{
}
m.SetAdditionalData(make(map[string]interface{}));
return m
} | [
-0.07682154327630997,
-0.13590703904628754,
-0.05941585823893547,
-0.32516375184059143,
-1.0061196088790894,
-0.4002898931503296,
-0.44272294640541077,
-0.3071098327636719,
-0.007035145536065102,
-0.4555685222148895,
-1.1467963457107544,
-0.49526676535606384,
-0.6463768482208252,
0.5834389... |
func CreateCommsNotificationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewCommsNotification(), nil
} | [
0.8086210489273071,
-0.23007269203662872,
0.3617391288280487,
-0.1723531037569046,
-0.6968448162078857,
0.31411996483802795,
0.41503867506980896,
-0.42248159646987915,
0.13997609913349152,
-0.35244131088256836,
-0.3712986409664154,
0.08361668139696121,
-0.273918092250824,
0.671160519123077... |
func (m *CommsNotification) GetAdditionalData()(map[string]interface{}) {
return m.additionalData
} | [
0.7511938214302063,
-0.15518489480018616,
0.21497870981693268,
-0.5234501957893372,
-0.5549100041389465,
1.032665729522705,
-0.4188045561313629,
-0.25246313214302063,
0.5890750288963318,
-0.9124215841293335,
-0.5699805617332458,
0.9566013216972351,
-0.34187373518943787,
0.8850796818733215,... |
func (m *CommsNotification) GetChangeType()(*ChangeType) {
return m.changeType
} | [
0.6736833453178406,
0.37292489409446716,
0.1598987579345703,
0.557335376739502,
1.3191019296646118,
-0.016386745497584343,
0.3960682451725006,
0.1014607772231102,
-0.0801958218216896,
0.14725342392921448,
-0.44351476430892944,
1.20962393283844,
-0.593230664730072,
1.1092208623886108,
0.3... |
func (m *CommsNotification) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error))
res["changeType"] = i2ae4187f7daee263371cb1c... | [
-0.020780708640813828,
0.28348445892333984,
0.5065538287162781,
-1.344423532485962,
0.3065910339355469,
-0.4934120774269104,
0.3671392500400543,
-0.026450417935848236,
-0.8513219952583313,
-0.7046987414360046,
-1.0259263515472412,
0.008507106453180313,
-0.7958104610443115,
-0.0706462934613... |
func (m *CommsNotification) GetResourceUrl()(*string) {
return m.resourceUrl
} | [
0.7190816402435303,
0.3810330331325531,
0.2864604592323303,
0.588249683380127,
0.9834108948707581,
0.5552718043327332,
0.6762169003486633,
0.3141782879829407,
0.40733540058135986,
0.016869641840457916,
-0.2804175317287445,
-0.4238801598548889,
-0.5343402028083801,
0.28902843594551086,
-0... |
func (m *CommsNotification) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
if m.GetChangeType() != nil {
cast := (*m.GetChangeType()).String()
err := writer.WriteStringValue("changeType", &cast)
if err != nil {
ret... | [
-0.48801347613334656,
0.3083541989326477,
0.37300729751586914,
-0.7021097540855408,
0.8679095506668091,
-0.1850026249885559,
0.6709992289543152,
-0.44140201807022095,
-0.26669543981552124,
0.1396205723285675,
-0.5342172980308533,
-0.06454136967658997,
-0.608662486076355,
0.6511913537979126... |
func (m *CommsNotification) SetAdditionalData(value map[string]interface{})() {
m.additionalData = value
} | [
0.6681898236274719,
0.27645158767700195,
-0.07797997444868088,
-0.8199245929718018,
-0.3305153250694275,
1.2120963335037231,
-0.031234605237841606,
-0.4603591561317444,
0.14268210530281067,
-0.6746965050697327,
-0.6659151911735535,
0.6856986284255981,
-0.13638520240783691,
1.57584345340728... |
func (m *CommsNotification) SetChangeType(value *ChangeType)() {
m.changeType = value
} | [
0.2770596742630005,
0.6077388525009155,
0.1721743494272232,
0.04075394570827484,
0.7223089933395386,
0.09535089135169983,
0.477949321269989,
-0.5023409128189087,
-0.7135117053985596,
0.5046833157539368,
-1.2342729568481445,
0.12112239748239517,
-0.26925522089004517,
1.7842077016830444,
-... |
func (m *CommsNotification) SetResourceUrl(value *string)() {
m.resourceUrl = value
} | [
0.20841071009635925,
0.6287897825241089,
0.08413218706846237,
0.3017766773700714,
0.557702898979187,
0.8987290859222412,
0.999937891960144,
0.012824522331357002,
-0.20916634798049927,
0.5287846326828003,
-0.8171104192733765,
-0.8473080992698669,
-0.06776197254657745,
0.7103995084762573,
... |
func (o *GetServerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetServerOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
default:
... | [
-0.18457931280136108,
-0.8719611167907715,
0.6375302076339722,
0.5507364273071289,
0.16934703290462494,
-0.7859534025192261,
0.10958919674158096,
-0.1875046193599701,
0.6322287917137146,
0.32616597414016724,
0.4883121848106384,
-0.15962456166744232,
-1.261601209640503,
-0.285383939743042,
... |
func NewGetServerOK() *GetServerOK {
return &GetServerOK{}
} | [
0.29235318303108215,
-0.6070103645324707,
-0.03189611807465553,
1.4720090627670288,
-0.3572419583797455,
-0.17740792036056519,
0.8646571636199951,
1.0888183116912842,
-0.002648554276674986,
0.4412078261375427,
-1.4082496166229248,
0.3452729880809784,
-0.451410174369812,
0.6553919315338135,... |
func NewStatHandler(scope Scope, handler http.Handler) http.Handler {
return &httpHandler{
scope: scope,
delegate: handler,
timer: scope.NewTimer(requestTimer),
codes: map[int]Counter{},
}
} | [
0.34652969241142273,
-0.5947829484939575,
0.3317793607711792,
-0.7523707151412964,
-0.8873776197433472,
0.08920744806528091,
-0.3424483835697174,
-0.6935760378837585,
0.3440592288970947,
-0.07775041460990906,
-0.15094520151615143,
0.9685524702072144,
-0.0016988679999485612,
0.8162512779235... |
func main() {
var cmd string
if len(os.Args) > 1 {
cmd = os.Args[1]
} else {
fmt.Println("please add cmd parameter after script")
os.Exit(1)
}
switch cmd {
case "connect":
connect.Handler()
case "scan":
scan.Handler()
case "send":
send.Handler()
case "status":
status.Handler()
case "proxy":
p... | [
-0.21433228254318237,
-0.4875255823135376,
0.8267225027084351,
1.3209477663040161,
0.14371243119239807,
0.534755527973175,
0.7299168705940247,
0.011570659466087818,
-0.5809381604194641,
-0.34084832668304443,
-0.15324926376342773,
0.018736932426691055,
-0.17807717621326447,
0.15290452539920... |
func (post *Post) Validate() map[string]string {
// if user.Name == "" && len(user.Name) < 5 {
// return err("The Name you entered was too short")
// }
return map[string]string{"Message": "", "IsValid": "1"}
} | [
0.13686387240886688,
0.24316126108169556,
0.38218948245048523,
0.07755768299102783,
-0.7764497995376587,
0.30853399634361267,
-0.6601980328559875,
-0.5647649168968201,
-0.4573279023170471,
-0.4430137574672699,
-0.2863960266113281,
-0.6375217437744141,
-0.43055129051208496,
0.69020164012908... |
func Server(searcher zoekt.Searcher) http.Handler {
RegisterGob()
server := rpc.NewServer()
if err := server.Register(&srv.Searcher{Searcher: searcher}); err != nil {
// this should never fail, so we panic.
panic("unexpected error registering rpc server: " + err.Error())
}
return server
} | [
-0.5881587266921997,
-0.4358266294002533,
0.20786361396312714,
0.24371781945228577,
0.6777158975601196,
0.6273248791694641,
-0.15613988041877747,
-0.14106863737106323,
-0.27175816893577576,
0.024251002818346024,
-0.7050908207893372,
0.15059520304203033,
-1.9793874025344849,
0.6642606854438... |
func Client(address string) zoekt.Searcher {
return ClientAtPath(address, DefaultRPCPath)
} | [
0.16014938056468964,
-0.07419123500585556,
-0.032297879457473755,
-0.14728736877441406,
-0.35617730021476746,
-0.09597140550613403,
0.4884258508682251,
-0.675053596496582,
-0.463983416557312,
-0.7830840349197388,
-0.3098262846469879,
0.29506802558898926,
0.07872146368026733,
-0.38390052318... |
func ClientAtPath(address, path string) zoekt.Searcher {
RegisterGob()
return &client{addr: address, path: path}
} | [
0.1937781423330307,
-0.5441397428512573,
0.1194298043847084,
-1.0969312191009521,
-0.742777943611145,
0.22493988275527954,
0.13840879499912262,
-1.424370288848877,
-0.8719887137413025,
0.021402813494205475,
-0.27072301506996155,
0.6488873362541199,
-0.36815276741981506,
-1.1904760599136353... |
func (c *client) getRPCClient(ctx context.Context, gen int) (*rpc.Client, int, error) {
// coarse lock so we only dial once
c.mu.Lock()
defer c.mu.Unlock()
if gen != c.gen {
return c.cl, c.gen, nil
}
var timeout time.Duration
if deadline, ok := ctx.Deadline(); ok {
timeout = time.Until(deadline)
}
cl, err ... | [
-0.330215185880661,
-0.3578881323337555,
0.9065824747085571,
-0.22855713963508606,
-0.24199749529361725,
0.3622232675552368,
0.5933560729026794,
-1.1919331550598145,
-0.6350733041763306,
-0.5561856627464294,
-0.09860364347696304,
0.29056793451309204,
-0.593121349811554,
0.04210339486598968... |
func RegisterGob() {
once.Do(func() {
gob.Register(&query.And{})
gob.Register(&query.BranchRepos{})
gob.Register(&query.BranchesRepos{})
gob.Register(&query.Branch{})
gob.Register(&query.Const{})
gob.Register(&query.GobCache{})
gob.Register(&query.Language{})
gob.Register(&query.Not{})
gob.Register(&... | [
-0.41173794865608215,
0.8523033261299133,
0.7926518321037292,
0.02002790756523609,
1.382888674736023,
0.6378846168518066,
-0.7786856889724731,
-0.474530965089798,
-0.6679935455322266,
0.5435556769371033,
-0.7048271298408508,
0.06209191679954529,
-0.7035567760467529,
0.6691519021987915,
-... |
func TestTableExists(t *testing.T) {
input := &dynamodb.CreateTableInput{
AttributeDefinitions: []*dynamodb.AttributeDefinition{
{
AttributeName: aws.String("id"),
AttributeType: aws.String("S"),
},
},
KeySchema: []*dynamodb.KeySchemaElement{
{
AttributeName: aws.String("id"),
KeyType: ... | [
0.1953956037759781,
0.05935150384902954,
0.4771050214767456,
-0.09133454412221909,
1.3814443349838257,
0.6906164884567261,
0.46223634481430054,
0.2917933166027069,
-0.2814081311225891,
-0.3535110652446747,
0.021505970507860184,
-0.19798016548156738,
-0.08317331969738007,
0.5295003056526184... |
func TestTableCreation(t *testing.T) {
common.InitConfig()
db := GetInstance()
// A map of table name to creation function,
// as in database.go
var tableMap = map[string]func() error{
paymentsTable: db.createPaymentsTable,
}
// Loop through our creation funcs, execute and test
for _, createFunc := range t... | [
0.33917486667633057,
0.7192929983139038,
0.3744259476661682,
0.49293553829193115,
0.968845009803772,
0.17166215181350708,
0.7048931121826172,
-0.8199527263641357,
-0.6807873249053955,
-0.9165087342262268,
-0.04867547005414963,
-1.015275478363037,
0.6589803695678711,
0.7917382717132568,
-... |
func (s *Server) UpdateContainerResources(ctx context.Context, req *pb.UpdateContainerResourcesRequest) (resp *pb.UpdateContainerResourcesResponse, err error) {
c, err := s.GetContainerFromShortID(req.GetContainerId())
if err != nil {
return nil, err
}
state := c.State()
if !(state.Status == oci.ContainerStateRu... | [
-1.1414954662322998,
-0.6745636463165283,
0.3773546814918518,
-0.4389267861843109,
0.12169305235147476,
-1.0645369291305542,
0.22483082115650177,
-0.3999614715576172,
0.3698251247406006,
0.09275403618812561,
-0.07064543664455414,
-0.2403988242149353,
-0.9563325643539429,
0.3429168462753296... |
func toOCIResources(r *pb.LinuxContainerResources) *rspec.LinuxResources {
var swap int64
memory := r.GetMemoryLimitInBytes()
if cgroupHasMemorySwap() {
swap = memory
}
return &rspec.LinuxResources{
CPU: &rspec.LinuxCPU{
Shares: proto.Uint64(uint64(r.GetCpuShares())),
Quota: proto.Int64(r.GetCpuQuota())... | [
0.5311643481254578,
-0.017631707713007927,
0.24543967843055725,
-0.5236420035362244,
0.2001776546239853,
-0.6955132484436035,
0.6224246621131897,
-0.23912955820560455,
-0.045534707605838776,
0.5217968225479126,
0.4128139913082123,
-0.3625181317329407,
-0.4826318621635437,
-0.15421913564205... |
func reset_usb(vid, pid int) error {
return nil
} | [
-0.027470827102661133,
-0.3706304430961609,
0.23218350112438202,
1.8931338787078857,
0.8197385668754578,
-0.6033746600151062,
0.9064397215843201,
0.36923161149024963,
-0.20079171657562256,
-0.11579172313213348,
-0.4570656716823578,
1.444930076599121,
-1.4180155992507935,
-0.657397985458374... |
func (m VoiceChatCaptureDevicePermissionStatus) Validate(formats strfmt.Registry) error {
var res []error
// value enum
if err := m.validateVoiceChatCaptureDevicePermissionStatusEnum("", "body", m); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
} | [
-0.12009253352880478,
-0.09253548830747604,
0.03082505241036415,
-0.028675848618149757,
-0.5871500968933105,
0.0708681046962738,
-0.13488249480724335,
-0.4699438512325287,
0.4362017512321472,
1.0126949548721313,
0.0822109580039978,
-0.07345441728830338,
-0.21061353385448456,
0.445871531963... |
func GeneratorForFlags(f *flag.FlagSet) *crdgenerator.Generator {
g := &crdgenerator.Generator{}
f.StringVar(&g.RootPath, "root-path", "", "working dir, must have PROJECT file under the path or parent path if domain not set")
f.StringVar(&g.OutputDir, "output-dir", "", "output directory, default to 'config/crds' und... | [
0.3410557210445404,
-0.004632424563169479,
0.38411885499954224,
-0.5574727654457092,
0.1438811868429184,
0.3946599066257477,
-0.1449834406375885,
-0.2833562195301056,
-0.953334629535675,
-0.7206848859786987,
0.9679716229438782,
-0.2618047893047333,
-0.21487045288085938,
1.1719669103622437,... |
func Github(t string) func(c *Conn) (*api.Secret, error) {
return func(c *Conn) (*api.Secret, error) {
return c.Client.Write("/auth/github/login", map[string]interface{}{
"token": t,
})
}
} | [
-0.6112753748893738,
0.42401355504989624,
0.6400406956672668,
0.24224142730236053,
0.4627198874950409,
0.1844421923160553,
-0.6964279413223267,
0.5049682855606079,
0.047431062906980515,
-0.5118848085403442,
-0.712006688117981,
0.8595008254051208,
0.33078527450561523,
-1.08133065700531,
0... |
func (ss *StringSet) Set(value string) error {
*ss = append(*ss, value)
return nil
} | [
-0.07003530114889145,
0.08470898121595383,
-0.006460085045546293,
-1.1768221855163574,
-0.5091764330863953,
-0.09681921452283859,
-0.49080702662467957,
-0.9944146871566772,
-0.07667498290538788,
-0.2210383266210556,
-0.14243337512016296,
1.1658241748809814,
-0.47428011894226074,
0.70371210... |
func (d *Dao) DeviceAuthOnline(token *model.AuthToken) (*model.Device, error) {
var (
device model.Device
change = mgo.Change{
Update: bson.M{"$set": bson.M{"online": true}},
Upsert: false,
ReturnNew: true,
}
)
session := d.MongoSession.Copy()
defer session.Close()
_, err := d.GetCollection(s... | [
-0.748406171798706,
-0.2045099139213562,
0.5951030254364014,
0.4263705015182495,
-0.8626116514205933,
0.007665013894438744,
0.08467872440814972,
0.641072154045105,
0.3922521471977234,
0.47432857751846313,
-0.724373996257782,
0.39381831884384155,
-0.2676270306110382,
-0.4629570543766022,
... |
func (d *Dao) DeviceOffline(mid int64) error {
var (
update = bson.M{"$set": bson.M{"online": false}}
)
session := d.MongoSession.Copy()
defer session.Close()
return d.GetCollection(session, deviceCollection).Update(bson.M{"_id": mid}, update)
} | [
-0.8872562646865845,
0.07661948353052139,
0.4679509103298187,
-0.192919060587883,
-0.9322131872177124,
0.6262492537498474,
0.7829594612121582,
0.3169109523296356,
0.2329062521457672,
0.7095709443092346,
-0.7196241617202759,
-0.5490516424179077,
-0.8231477737426758,
0.12764370441436768,
0... |
func (d *Dao) NewMessage(message *model.Message) (err error) {
session := d.MongoSession.Copy()
defer session.Close()
message.ID = d.idWorker.GetID()
message.CreateTime = time.Now()
if err != nil {
return err
}
err = d.GetCollection(session, messageCollection).Insert(message)
if err != nil {
return err
}
... | [
-0.2832234501838684,
0.6306292414665222,
0.7394521236419678,
0.5125916600227356,
-0.10027805715799332,
0.7715654373168945,
0.1722727119922638,
-0.31669992208480835,
-0.08948183804750443,
0.5118108987808228,
-0.6702680587768555,
-0.4236292839050293,
-0.9366885423660278,
0.8132107853889465,
... |
func (d *Dao) MessageStats() (err error) {
q1 := bson.M{
"$match": bson.M{
"received": bson.M{"$gt": 0},
},
}
q2 := bson.M{
"$group": bson.M{
"_id": "$seq",
"count": bson.M{"$sum": 1},
},
}
q3 := bson.M{
"$project": bson.M{
"_id": 1,
"count": 1,
},
}
var res []model.MessageAggregat... | [
-0.2668198049068451,
0.33282166719436646,
0.8344718217849731,
-0.8004260659217834,
-0.20301030576229095,
0.3021705746650696,
0.4272686839103699,
-0.9521668553352356,
-0.634463906288147,
0.8376283049583435,
0.11432947218418121,
-0.15549036860466003,
-0.27818557620048523,
0.6638996601104736,... |
func (d *Dao) MessageAddSnFile(messageID int64, fileList []string) (message *model.Message, err error) {
var (
change = mgo.Change{
Update: bson.M{"$push": bson.M{"snfile": fileList}},
Upsert: false,
ReturnNew: true,
}
)
session := d.MongoSession.Copy()
defer session.Close()
_, err = d.GetCollec... | [
-0.0860234871506691,
0.5779117345809937,
0.633857786655426,
0.23629197478294373,
-0.12419964373111725,
0.016392597928643227,
-0.48274028301239014,
-0.3755280375480652,
0.08024293929338455,
0.5607778429985046,
-0.6372402906417847,
-0.3698069751262665,
-1.0168484449386597,
1.3557988405227661... |
func (d *Dao) GetCollection(session *mgo.Session, collectionName string) *mgo.Collection {
return session.DB(dbname).C(collectionName)
} | [
0.16284926235675812,
-0.006980576552450657,
0.3619827628135681,
0.05589914321899414,
0.07036931812763214,
-0.47596248984336853,
-0.24076835811138153,
-0.6071234345436096,
0.49947601556777954,
0.13269884884357452,
0.3199598491191864,
0.6041717529296875,
0.4471331238746643,
0.345085680484771... |
func (d *Dao) GetMessageByID(id int64) (message *model.Message, err error) {
session := d.MongoSession.Copy()
defer session.Close()
err = d.GetCollection(session, messageCollection).Find(bson.M{"_id": id}).One(&message)
return
} | [
-0.0872553139925003,
0.16775023937225342,
0.33720332384109497,
0.3085572123527527,
0.6814054250717163,
-0.053326744586229324,
0.03307358920574188,
-1.433239459991455,
0.15542741119861603,
0.3966744840145111,
-0.07477066665887833,
-0.08096977323293686,
-0.6248893141746521,
0.965378701686859... |
func (d *Dao) GetOfflineMessageByMID(mid int64) (msgIDList []int64, err error) {
session := d.MongoSession.Copy()
defer session.Close()
omCol := d.GetCollection(session, offlineMessageCollection)
err = omCol.Find(bson.M{"deviceId": mid, "online": 0, "received": bson.M{"$eq": 0}}).Select(bson.M{"msgId": 1}).Distinct... | [
0.14119493961334229,
-0.4863068461418152,
0.6208473443984985,
-0.04714769497513771,
-0.58631831407547,
-0.17359739542007446,
0.01793338917195797,
-0.41874417662620544,
0.963965892791748,
0.7493236064910889,
-0.031143344938755035,
0.29398274421691895,
-1.4988173246383667,
1.5995824337005615... |
func (d *Dao) MessageReceived(c context.Context, mid int64, msgID int64) error {
d.MessageSeqAdd(c, msgID)
session := d.MongoSession.Copy()
defer session.Close()
collection := d.GetCollection(session, offlineMessageCollection)
_, err := collection.UpdateAll(bson.M{"deviceId": mid, "msgId": msgID}, bson.M{"$inc": b... | [
-0.28939640522003174,
-0.21494990587234497,
0.3729192912578583,
-0.7837788462638855,
-0.2687879800796509,
0.09699481725692749,
0.14657077193260193,
0.9032884240150452,
0.4451078772544861,
-0.209136500954628,
-0.13311950862407684,
-0.3135252296924591,
-0.19477543234825134,
0.465713083744049... |
func AllowMethod(w http.ResponseWriter, m string, ms ...string) bool {
for _, meth := range ms {
if m == meth {
return true
}
}
w.Header().Set("Allow", strings.Join(ms, ","))
http.Error(w, "Method Not Allowed", http.StatusMethodNotAllowed)
return false
} | [
-0.12033477425575256,
0.3906663954257965,
0.6797422766685486,
0.36848512291908264,
-0.7633612155914307,
0.8006821274757385,
0.12127386033535004,
-0.3905566334724426,
-0.8371546268463135,
0.12119248509407043,
1.2563302516937256,
0.024241752922534943,
-0.6137773990631104,
0.5138612389564514,... |
func (s *Service) getCache(c context.Context, plat int8, build int, ver, ip, mobiApp, device, language, entrance string, isNew bool) (res []*region.Region, version string, err error) {
if language == "" {
language = _initlanguage
}
var (
rs = s.cache[fmt.Sprintf(_initRegionKey, plat, language)]
child... | [
-0.3324647843837738,
-0.6639226078987122,
0.659740149974823,
0.7532880306243896,
-0.2512812316417694,
-0.09892777353525162,
0.28749507665634155,
-0.3062104880809784,
0.2307305932044983,
0.9522854089736938,
0.23464412987232208,
0.5557476878166199,
-0.6063442230224609,
0.2233383059501648,
... |
func (s *Service) NewRegionList(c context.Context, plat int8, build int, ver, mobiApp, device, language string) (res []*region.Region, version string, err error) {
ip := metadata.String(c, metadata.RemoteIP)
var (
hantlanguage = "hant"
)
if ok := model.IsOverseas(plat); ok && language != _initlanguage && language... | [
-0.5799582600593567,
-1.2108408212661743,
0.6268784999847412,
0.30361175537109375,
-0.2766399383544922,
-0.23298202455043793,
-0.032886240631341934,
0.1296437382698059,
-0.3272572457790375,
0.9327760934829712,
-0.4712470769882202,
0.4231891334056854,
-0.4045459032058716,
0.4654558598995209... |
func nodes(app *mvc.Application) {
// Create our movie repository with some (memory) data from the database.
repo := repositories.NewNodeRepository()
// Create our movie service, we will bind it to the movie app's dependencies.
nodeService := services.NewNodeService(repo)
app.Register(cfg)
app.Register(nodeServic... | [
0.004314956720918417,
0.9524052739143372,
0.4073909521102905,
-0.4862213432788849,
0.6665354371070862,
-0.1771029382944107,
-0.44262072443962097,
0.16998150944709778,
-0.05069538578391075,
0.28832149505615234,
-0.30685874819755554,
1.1584149599075317,
0.5540494918823242,
0.5898157358169556... |
func wrapPgStmt(stmt, idColumn, lastId string) string {
if idColumn != "" {
var where string
if lastId != "" {
where = fmt.Sprintf("WHERE %s > $1", idColumn)
}
// NB: If the statement had a LIMIT, the results are going to be bogus, since
// ORDER BY happens after the LIMIT. TODO: This can be solved by sma... | [
-1.011718511581421,
0.1747107058763504,
0.6136351227760315,
-0.24115289747714996,
-0.046335816383361816,
-0.4615201950073242,
-1.2522732019424438,
-0.99819415807724,
-0.6397372484207153,
0.772492527961731,
1.5434415340423584,
0.3060073256492615,
0.09418971836566925,
-0.5553182363510132,
... |
func NewResponse(i int64, r string, e Error) Response {
return Response{
ID: i,
JSONRpc: JSONRPCVersion,
Result: r,
Error: e,
}
} | [
-0.18251724541187286,
-1.0674219131469727,
0.2857527732849121,
0.45945796370506287,
-0.2747988998889923,
-0.8333662152290344,
-0.7292525172233582,
-0.9168819189071655,
0.5473546385765076,
0.47189176082611084,
-0.7133224606513977,
-0.639861524105072,
-1.1788742542266846,
-0.4292645454406738... |
func (s *S7Server) StartTo(Address string) (err error) {
address := C.CString(Address)
defer func() {
C.free(unsafe.Pointer(address))
}()
var code C.int = C.Srv_StartTo(s.server, address)
err = Srv_ErrorText(code)
return
} | [
-0.4132347106933594,
0.6763326525688171,
0.5373871326446533,
-0.749478280544281,
-0.6488876938819885,
-0.6955623626708984,
0.9621001482009888,
0.06989936530590057,
0.5545127391815186,
-0.02079843357205391,
-0.9908024668693542,
1.7952039241790771,
-0.3904843330383301,
0.21020381152629852,
... |
func (s *S7Server) RegisterArea(AreaCode SrvAreaType, Index uint16, pUsrData []byte) (err error) {
var code C.int = C.Srv_RegisterArea(
s.server, C.int(AreaCode), C.uint16_t(Index), unsafe.Pointer(&pUsrData[0]), C.int(len(pUsrData)))
err = Srv_ErrorText(code)
return
} | [
-1.7260158061981201,
0.6477289795875549,
0.6555725336074829,
-0.802374005317688,
0.34490546584129333,
-0.2339925616979599,
-0.11111301183700562,
0.07338781654834747,
0.789124608039856,
0.08394382148981094,
-0.05437972769141197,
0.6806786060333252,
-0.7023537755012512,
0.8774755597114563,
... |
func (s *S7Server) UnregisterArea(AreaCode SrvAreaType, Index uint16) (err error) {
var code C.int = C.Srv_UnregisterArea(s.server, C.int(AreaCode), C.uint16_t(Index))
err = Srv_ErrorText(code)
return
} | [
-1.501705288887024,
0.580051839351654,
0.4413262605667114,
-0.9601077437400818,
-0.17229849100112915,
-0.6996007561683655,
1.0285052061080933,
0.48656997084617615,
0.9938347339630127,
0.8734856247901917,
0.0671672374010086,
0.6276146769523621,
-0.7795516848564148,
0.9579960703849792,
1.1... |
func (s *S7Server) LockArea(AreaCode SrvAreaType, Index uint16) (err error) {
var code C.int = C.Srv_LockArea(s.server, C.int(AreaCode), C.uint16_t(Index))
err = Srv_ErrorText(code)
return
} | [
-1.1725746393203735,
-0.10785666853189468,
0.5436286330223083,
-0.3154732584953308,
-0.28850695490837097,
-0.028675071895122528,
0.776129424571991,
-0.61557537317276,
1.4403551816940308,
0.46561291813850403,
0.009395803324878216,
0.8192281723022461,
-0.8565747737884521,
0.9072466492652893,... |
func (s *S7Server) UnlockArea(AreaCode SrvAreaType, Index uint16) (err error) {
var code C.int = C.Srv_UnlockArea(s.server, C.int(AreaCode), C.uint16_t(Index))
err = Srv_ErrorText(code)
return
} | [
-1.0348451137542725,
0.1036800891160965,
0.5261119604110718,
-0.5956487655639648,
-0.524196445941925,
-0.8081767559051514,
1.1137109994888306,
0.02397869899868965,
1.020314335823059,
0.5450018048286438,
0.10279850661754608,
0.4331524670124054,
-0.8602759838104248,
0.22523380815982819,
1.... |
func (s *S7Server) GetStatus() (ServerStatus S7ServerStatus, CpuStatus S7CpuStatus, ClientsCount int32, err error) {
var code C.int = C.Srv_GetStatus(s.server, (*C.int)(unsafe.Pointer(&ServerStatus)), (*C.int)(unsafe.Pointer(&CpuStatus)), (*C.int)(unsafe.Pointer(&ClientsCount)))
err = Srv_ErrorText(code)
return
} | [
-0.3282303214073181,
0.18169060349464417,
0.42145299911499023,
0.33583828806877136,
-0.34899353981018066,
-0.4521920084953308,
0.286885529756546,
0.07559362798929214,
0.14314375817775726,
-0.22529172897338867,
-1.071596384048462,
1.3827797174453735,
-0.6259753108024597,
0.9029826521873474,... |
func (s *S7Server) SetCpuStatus(CpuStatus S7CpuStatus) (err error) {
var code C.int = C.Srv_SetCpuStatus(s.server, C.int(CpuStatus))
err = Srv_ErrorText(code)
return
} | [
-0.7451918125152588,
0.21074464917182922,
0.4771971106529236,
0.205244779586792,
-1.1804354190826416,
0.2936539947986603,
0.40702003240585327,
0.7121162414550781,
0.12384109944105148,
0.13520611822605133,
-1.581539273262024,
1.0292774438858032,
-0.6169003248214722,
0.8384403586387634,
0.... |
func (s *S7Server) GetMask(MaskKind MaskKind) (Mask uint32, err error) {
var code C.int = C.Srv_GetMask(s.server, C.int(MaskKind), (*C.longword)(unsafe.Pointer(&Mask)))
err = Srv_ErrorText(code)
return
} | [
-0.9219521880149841,
1.0973258018493652,
0.5181034803390503,
0.9411094784736633,
0.03849479928612709,
-0.7630946636199951,
0.5153774619102478,
-1.1980845928192139,
0.5926233530044556,
-0.5099015831947327,
-0.26061487197875977,
1.588387370109558,
-1.137772798538208,
0.5661716461181641,
1.... |
func (s *S7Server) SetMask(MaskKind MaskKind, Mask uint32) (err error) {
var code C.int = C.Srv_SetMask(s.server, C.int(MaskKind), C.longword(Mask))
err = Srv_ErrorText(code)
return
} | [
-0.8300912380218506,
0.49549299478530884,
0.5014268755912781,
0.640110969543457,
0.053063418716192245,
0.05279259383678436,
0.11189381778240204,
-0.6067855954170227,
0.36704301834106445,
-0.06787968426942825,
-0.563667893409729,
1.7706596851348877,
-0.8824361562728882,
0.9379124641418457,
... |
func Srv_EventText(Event *TSrvEvent) (text string, err error) {
const length = 1024
var buff [length]byte
var code C.int = C.Srv_EventText(
(*C.TSrvEvent)(unsafe.Pointer(Event)),
(*C.char)(unsafe.Pointer(&buff[0])),
length)
err = Srv_ErrorText(code)
if err != nil {
return
}
text = string(buff[:])
return... | [
-0.1094423234462738,
0.06355006247758865,
0.7827015519142151,
-0.368047833442688,
-1.3512489795684814,
-0.7586446404457092,
0.1576814204454422,
-0.034370895475149155,
0.37290164828300476,
1.5908790826797485,
-0.8029861450195312,
-0.07031358033418655,
-0.44052839279174805,
-0.10628628730773... |
func (mnu *MetricNameUpdate) Where(ps ...predicate.MetricName) *MetricNameUpdate {
mnu.mutation.Where(ps...)
return mnu
} | [
0.4022539556026459,
-0.058678045868873596,
0.3083149790763855,
0.21823866665363312,
-0.72650146484375,
0.7143290638923645,
-0.11441126465797424,
-0.8488045930862427,
-0.8098853230476379,
-0.46658554673194885,
0.6064151525497437,
0.45836135745048523,
-0.19004209339618683,
-0.806462109088897... |
func (mnu *MetricNameUpdate) SetUpdatedAt(t time.Time) *MetricNameUpdate {
mnu.mutation.SetUpdatedAt(t)
return mnu
} | [
-0.31067371368408203,
-0.13413138687610626,
0.5883458852767944,
-0.6748588681221008,
-0.31005898118019104,
1.4124783277511597,
-0.21655191481113434,
-0.07490169256925583,
-0.012692531570792198,
-0.6652032732963562,
-0.40824055671691895,
-0.04835231974720955,
0.7583059072494507,
0.405269324... |
func (mnu *MetricNameUpdate) SetDeletedAt(t time.Time) *MetricNameUpdate {
mnu.mutation.SetDeletedAt(t)
return mnu
} | [
-0.3816567361354828,
-0.06742996722459793,
0.2489735186100006,
-0.6823741793632507,
0.13674093782901764,
0.9541894197463989,
-0.09203212708234787,
-0.5413094758987427,
-0.2798077464103699,
-0.9993211627006531,
-0.38794153928756714,
-0.008550540544092655,
0.31558364629745483,
0.574181616306... |
func (mnu *MetricNameUpdate) SetName(s string) *MetricNameUpdate {
mnu.mutation.SetName(s)
return mnu
} | [
-0.4186570346355438,
0.7886910438537598,
0.1693396270275116,
1.3143614530563354,
-0.5309064388275146,
0.20115241408348083,
0.4739341735839844,
0.21757541596889496,
-0.22198332846164703,
0.265671044588089,
-0.6649235486984253,
-0.4565770626068115,
-0.23963308334350586,
0.18531636893749237,
... |
func (mnu *MetricNameUpdate) SetHelp(s string) *MetricNameUpdate {
mnu.mutation.SetHelp(s)
return mnu
} | [
1.1088091135025024,
0.6185656189918518,
0.0655902624130249,
1.1676338911056519,
-0.06593503803014755,
0.8078049421310425,
0.7601153254508972,
-0.48846450448036194,
-0.21333929896354675,
0.1744256317615509,
-0.06683042645454407,
-0.48598599433898926,
0.3684364855289459,
-0.00510530592873692... |
func (mnu *MetricNameUpdate) SetTypeId(u uint) *MetricNameUpdate {
mnu.mutation.ResetTypeId()
mnu.mutation.SetTypeId(u)
return mnu
} | [
-0.0573258213698864,
0.2104606032371521,
0.18050147593021393,
1.2551121711730957,
-0.3338172733783722,
1.175091028213501,
0.5940892100334167,
-0.17326684296131134,
0.30610182881355286,
-0.04033225029706955,
-1.1212321519851685,
0.8819103837013245,
-0.6460533738136292,
1.1427658796310425,
... |
func (mnu *MetricNameUpdate) AddTypeId(u uint) *MetricNameUpdate {
mnu.mutation.AddTypeId(u)
return mnu
} | [
0.05410560593008995,
0.2871723175048828,
0.40004682540893555,
1.1214627027511597,
-0.49748286604881287,
1.1398693323135376,
0.20521579682826996,
-0.4356192648410797,
0.5717615485191345,
-0.15561909973621368,
-0.43657636642456055,
0.578356921672821,
-0.6687237024307251,
1.1367441415786743,
... |
func (mnu *MetricNameUpdate) AddMetricIDs(ids ...int) *MetricNameUpdate {
mnu.mutation.AddMetricIDs(ids...)
return mnu
} | [
-1.2990391254425049,
0.5810553431510925,
-0.011199220083653927,
0.5286905765533447,
-0.19583676755428314,
0.6858236193656921,
-0.43027263879776,
-0.22415128350257874,
-0.3031502366065979,
-0.02058015577495098,
-0.24296531081199646,
-0.08294367790222168,
-1.1804804801940918,
-0.047196444123... |
func (mnu *MetricNameUpdate) AddMetrics(m ...*Metric) *MetricNameUpdate {
ids := make([]int, len(m))
for i := range m {
ids[i] = m[i].ID
}
return mnu.AddMetricIDs(ids...)
} | [
-0.638785183429718,
1.001936912536621,
0.08356282114982605,
1.1821181774139404,
-0.002025665482506156,
0.9641534686088562,
-0.5146060585975647,
-0.8799902200698853,
-0.8998563885688782,
-0.44653937220573425,
1.028794288635254,
-0.4767787754535675,
-1.0886290073394775,
0.3333577811717987,
... |
func (mnu *MetricNameUpdate) AddEventIDs(ids ...int) *MetricNameUpdate {
mnu.mutation.AddEventIDs(ids...)
return mnu
} | [
-0.5436789989471436,
-0.22478583455085754,
0.1653987169265747,
0.1043991893529892,
-0.012929064221680164,
0.45604047179222107,
-0.37932631373405457,
0.2751806080341339,
0.19830134510993958,
0.23122113943099976,
0.1888066530227661,
-0.07403891533613205,
-0.6515152454376221,
0.30015048384666... |
func (mnu *MetricNameUpdate) AddEvents(e ...*Event) *MetricNameUpdate {
ids := make([]int, len(e))
for i := range e {
ids[i] = e[i].ID
}
return mnu.AddEventIDs(ids...)
} | [
-0.3669379949569702,
0.32919472455978394,
0.3505859375,
0.34214088320732117,
0.4812677204608917,
0.5581323504447937,
-0.4257873594760895,
-0.054818931967020035,
0.09623648226261139,
-0.25873953104019165,
0.823644757270813,
-0.7479970455169678,
-0.5601484775543213,
0.1539025753736496,
-0.... |
func (mnu *MetricNameUpdate) SetOwnersID(id uint) *MetricNameUpdate {
mnu.mutation.SetOwnersID(id)
return mnu
} | [
-0.23899511992931366,
-0.1777602583169937,
-0.3943343460559845,
0.553097665309906,
-0.46759143471717834,
0.4763852059841156,
0.11204686760902405,
-0.5009869337081909,
0.21546146273612976,
0.029872313141822815,
-0.3688492774963379,
0.20610101521015167,
-0.5360414981842041,
0.530381917953491... |
func (mnu *MetricNameUpdate) SetNillableOwnersID(id *uint) *MetricNameUpdate {
if id != nil {
mnu = mnu.SetOwnersID(*id)
}
return mnu
} | [
-0.03500237315893173,
0.12483333051204681,
-0.08842332661151886,
0.31127700209617615,
-0.7376478910446167,
-0.017671002075076103,
-0.346061110496521,
-0.5833808183670044,
0.2578595280647278,
-0.044853221625089645,
0.37474122643470764,
0.31995391845703125,
-0.8322346806526184,
0.46259403228... |
func (mnu *MetricNameUpdate) SetOwners(m *MetricType) *MetricNameUpdate {
return mnu.SetOwnersID(m.ID)
} | [
-0.12677119672298431,
0.771213948726654,
0.05637393146753311,
0.634543240070343,
0.07021179050207138,
0.34598228335380554,
0.23480503261089325,
-0.863385796546936,
-0.43972739577293396,
-0.5729270577430725,
0.4509900212287903,
0.2472032606601715,
-0.8184202313423157,
0.2796691060066223,
... |
func (mnu *MetricNameUpdate) Mutation() *MetricNameMutation {
return mnu.mutation
} | [
-0.17478623986244202,
-0.2786533832550049,
0.05040140077471733,
0.38159486651420593,
-0.17658944427967072,
0.8342763781547546,
0.48120617866516113,
-0.7815881967544556,
0.38744667172431946,
-0.020442821085453033,
0.38582825660705566,
-0.19112533330917358,
-0.7539442181587219,
-0.5424345135... |
func (mnu *MetricNameUpdate) ClearMetrics() *MetricNameUpdate {
mnu.mutation.ClearMetrics()
return mnu
} | [
-0.13779553771018982,
1.0202194452285767,
-0.05765879154205322,
0.4177367389202118,
-1.2237507104873657,
0.8578889966011047,
-0.3838154673576355,
-0.8450550436973572,
0.04273005947470665,
0.21262571215629578,
0.5226776003837585,
0.7442224025726318,
-0.7710993885993958,
-0.5587008595466614,... |
func (mnu *MetricNameUpdate) RemoveMetricIDs(ids ...int) *MetricNameUpdate {
mnu.mutation.RemoveMetricIDs(ids...)
return mnu
} | [
-1.3218146562576294,
0.32178860902786255,
-0.1737012267112732,
0.5670374631881714,
-0.8247034549713135,
0.2318112999200821,
0.17792315781116486,
0.2633230686187744,
-0.591781735420227,
0.5127381086349487,
-0.7877565622329712,
-0.023606155067682266,
-1.8477981090545654,
-0.43205714225769043... |
func (mnu *MetricNameUpdate) RemoveMetrics(m ...*Metric) *MetricNameUpdate {
ids := make([]int, len(m))
for i := range m {
ids[i] = m[i].ID
}
return mnu.RemoveMetricIDs(ids...)
} | [
-0.597743034362793,
0.9296513199806213,
0.02145901508629322,
1.1378705501556396,
-0.5180677175521851,
0.43334099650382996,
0.11812686175107956,
-0.37001344561576843,
-1.0602614879608154,
0.06634790450334549,
0.3618909418582916,
-0.6584928631782532,
-1.4862909317016602,
0.045252725481987,
... |
func (mnu *MetricNameUpdate) ClearEvents() *MetricNameUpdate {
mnu.mutation.ClearEvents()
return mnu
} | [
0.6330634355545044,
0.6274623870849609,
0.12332961708307266,
0.2880323827266693,
-0.5832418203353882,
0.5978183746337891,
-0.0024478998966515064,
-0.8648340702056885,
0.735546886920929,
-0.10260684043169022,
0.6935780644416809,
0.5645874738693237,
-0.44843319058418274,
-0.7883942127227783,... |
func (mnu *MetricNameUpdate) RemoveEventIDs(ids ...int) *MetricNameUpdate {
mnu.mutation.RemoveEventIDs(ids...)
return mnu
} | [
-0.5920764803886414,
-0.4909084439277649,
0.16458411514759064,
0.05035578832030296,
-0.8511099219322205,
0.07509250193834305,
0.15689904987812042,
0.8056589365005493,
0.046313293278217316,
0.6555662155151367,
-0.1339782327413559,
-0.16696365177631378,
-1.2006423473358154,
0.031405515968799... |
func (mnu *MetricNameUpdate) RemoveEvents(e ...*Event) *MetricNameUpdate {
ids := make([]int, len(e))
for i := range e {
ids[i] = e[i].ID
}
return mnu.RemoveEventIDs(ids...)
} | [
-0.2065807282924652,
0.08583217859268188,
0.4063011407852173,
0.329878568649292,
-0.13500089943408966,
0.07283426076173782,
0.33914807438850403,
0.43784666061401367,
0.13764634728431702,
0.18889689445495605,
0.23544999957084656,
-0.8097943663597107,
-0.9140629172325134,
-0.1498428285121917... |
func (mnu *MetricNameUpdate) ClearOwners() *MetricNameUpdate {
mnu.mutation.ClearOwners()
return mnu
} | [
-0.48929962515830994,
0.8862034678459167,
-0.20660249888896942,
0.67628014087677,
-0.6543421745300293,
0.383828729391098,
-0.342320054769516,
-0.8391898274421692,
0.048829153180122375,
0.20519177615642548,
1.3223226070404053,
0.8960407972335815,
-0.46402984857559204,
-0.6672251224517822,
... |
func (mnu *MetricNameUpdate) Save(ctx context.Context) (int, error) {
var (
err error
affected int
)
mnu.defaults()
if len(mnu.hooks) == 0 {
if err = mnu.check(); err != nil {
return 0, err
}
affected, err = mnu.sqlSave(ctx)
} else {
var mut Mutator = MutateFunc(func(ctx context.Context, m Muta... | [
-0.6839032769203186,
0.2785719335079193,
0.8200708627700806,
-0.33259421586990356,
0.34690847992897034,
-0.6043089032173157,
0.6138561367988586,
-1.0538866519927979,
-1.1207587718963623,
0.6848452687263489,
-0.25529399514198303,
-0.04676956310868263,
-0.8466596603393555,
0.3814440965652466... |
func (mnu *MetricNameUpdate) SaveX(ctx context.Context) int {
affected, err := mnu.Save(ctx)
if err != nil {
panic(err)
}
return affected
} | [
-0.3853822350502014,
1.2645879983901978,
0.6088317632675171,
0.28048086166381836,
-0.7509034276008606,
0.9287710785865784,
-0.5212376117706299,
0.08714832365512848,
0.3970346450805664,
0.38899436593055725,
-1.0484291315078735,
-0.172953799366951,
-0.8873412013053894,
-0.22268950939178467,
... |
func (mnu *MetricNameUpdate) Exec(ctx context.Context) error {
_, err := mnu.Save(ctx)
return err
} | [
0.2428995817899704,
0.44694122672080994,
0.5877770185470581,
0.32401204109191895,
-0.07852008193731308,
1.2333096265792847,
-0.33190831542015076,
-0.45708250999450684,
-0.5561662912368774,
0.6383259892463684,
-0.20654283463954926,
0.005694568157196045,
-0.5749785304069519,
-0.6368264555931... |
func (mnu *MetricNameUpdate) ExecX(ctx context.Context) {
if err := mnu.Exec(ctx); err != nil {
panic(err)
}
} | [
0.7654157280921936,
0.8514310121536255,
0.6361417174339294,
0.4618060290813446,
-0.5476207137107849,
1.3956007957458496,
-0.7106369733810425,
-0.375164657831192,
-0.04946986958384514,
0.17150457203388214,
0.216293603181839,
0.887191653251648,
0.009343700483441353,
-0.19278159737586975,
0... |
func (mnu *MetricNameUpdate) defaults() {
if _, ok := mnu.mutation.UpdatedAt(); !ok {
v := metricname.UpdateDefaultUpdatedAt()
mnu.mutation.SetUpdatedAt(v)
}
if _, ok := mnu.mutation.DeletedAt(); !ok {
v := metricname.UpdateDefaultDeletedAt()
mnu.mutation.SetDeletedAt(v)
}
} | [
-0.3973149359226227,
0.6265861988067627,
0.3848435580730438,
-0.18828457593917847,
0.6650635004043579,
-0.024886678904294968,
-0.5635666251182556,
-0.6041787266731262,
-0.3023369014263153,
-0.38366302847862244,
-0.07070530951023102,
-0.08354906737804413,
-0.06685228645801544,
-0.1817961782... |
func (mnu *MetricNameUpdate) check() error {
if v, ok := mnu.mutation.Name(); ok {
if err := metricname.NameValidator(v); err != nil {
return &ValidationError{Name: "name", err: fmt.Errorf("ent: validator failed for field \"name\": %w", err)}
}
}
return nil
} | [
0.006842991337180138,
0.31862857937812805,
0.4353712499141693,
0.2781734764575958,
-0.06424997001886368,
0.49882179498672485,
0.04654296860098839,
-0.6794617772102356,
-0.9819837808609009,
0.4533977508544922,
0.548409104347229,
-0.05732850357890129,
-0.23012769222259521,
0.9982795715332031... |
func (mnuo *MetricNameUpdateOne) SetUpdatedAt(t time.Time) *MetricNameUpdateOne {
mnuo.mutation.SetUpdatedAt(t)
return mnuo
} | [
-0.16305427253246307,
-0.1861112266778946,
0.5801476836204529,
-0.5642789006233215,
-0.18597085773944855,
1.566011905670166,
-0.053259771317243576,
0.17521226406097412,
-0.05759632959961891,
-0.4998512864112854,
-0.5212031006813049,
-0.2011331170797348,
0.6342043876647949,
0.30836668610572... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.