text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (f *Field) ArgName() string {
if f.argName == "" {
f.argName = stringx.From(f.Name.ToCamel()).Untitle()
if token.IsKeyword(f.argName) {
f.argName = f.argName + "1"
}
}
return f.argName
} | [
-1.2499253749847412,
0.32151609659194946,
0.5789068341255188,
-0.013545311987400055,
0.11748521775007248,
-0.20621247589588165,
-0.42447951436042786,
1.2939344644546509,
-1.0148264169692993,
1.1452646255493164,
0.17842978239059448,
-0.36218467354774475,
-0.10098110884428024,
0.640822589397... |
func ConvertDataType(dataBaseType string, isDefaultNull bool) (string, error) {
tp, ok := commonMysqlDataTypeMap[strings.ToLower(dataBaseType)]
if !ok {
return "", fmt.Errorf("unexpected database type: %s", dataBaseType)
}
return mayConvertNullType(tp, isDefaultNull), nil
} | [
0.04330097883939743,
0.052183687686920166,
0.4304991662502289,
-0.2666613459587097,
0.13590268790721893,
-0.36067312955856323,
-0.0625588595867157,
0.15937945246696472,
0.818253755569458,
0.6533949375152588,
-0.578040599822998,
0.37616071105003357,
-0.5841952562332153,
0.9119665026664734,
... |
func NewSigninResponseBody(res *securedviews.GoaJWTView) *SigninResponseBody {
body := &SigninResponseBody{
Authorization: *res.Authorization,
}
return body
} | [
-0.18951913714408875,
-1.010422945022583,
0.02122318558394909,
0.38249629735946655,
-0.9663762450218201,
-0.18181441724300385,
0.09088747203350067,
-0.3353159427642822,
0.9635365605354309,
-0.26082074642181396,
-0.7358523011207581,
-1.0940035581588745,
-0.30227434635162354,
-0.053022909909... |
func NewSigninUnauthorizedResponseBody(res secured.Unauthorized) SigninUnauthorizedResponseBody {
body := SigninUnauthorizedResponseBody(res)
return body
} | [
-0.8506634831428528,
-1.1965669393539429,
0.3578399419784546,
0.80851149559021,
-1.0981614589691162,
-0.312629759311676,
0.4785718321800232,
0.7102231383323669,
0.9504191875457764,
-1.3873796463012695,
-0.9049198031425476,
-0.1901616007089615,
-0.5098490715026855,
-0.31625717878341675,
-... |
func NewSigninPayload() *secured.SigninPayload {
return &secured.SigninPayload{}
} | [
-0.06305785477161407,
-0.8430501818656921,
0.2858641445636749,
0.6410769820213318,
-1.858940601348877,
-0.15437817573547363,
-0.6699254512786865,
-0.2605876326560974,
-0.0066633871756494045,
-0.15915177762508392,
-0.8952966332435608,
-0.028346434235572815,
-1.2384154796600342,
-0.066016338... |
func HandleIndex(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
name := p.ByName("name")
response := snakes[name].Info
w.Header().Set("Content-Type", "application/json")
err := json.NewEncoder(w).Encode(response)
if err != nil {
fmt.Println("ERROR: response write: " + err.Error())
w.WriteHeade... | [
-0.9364439249038696,
-1.0343561172485352,
0.7691062688827515,
-0.25378066301345825,
-0.0341811403632164,
-0.1633804440498352,
0.2705705165863037,
-0.378301739692688,
-0.19551753997802734,
0.2886265814304352,
-0.4850109815597534,
-0.06239228695631027,
-0.532297670841217,
-0.0203400533646345... |
func HandleStart(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
name := p.ByName("name")
// Nothing to respond with here
fmt.Println("START: " + name)
req := GameRequest{}
b, _ := io.ReadAll(r.Body)
defer r.Body.Close()
err := json.Unmarshal(b, &req)
if err != nil {
fmt.Println("ERROR: star... | [
-0.6277755498886108,
-0.6463204026222229,
1.0716876983642578,
-0.1824669986963272,
0.2711721360683441,
-0.14211775362491608,
0.08312438428401947,
-0.5054108500480652,
-0.15054158866405487,
0.32833781838417053,
-0.0946454405784607,
0.10872705280780792,
-0.5310690402984619,
-0.01579382829368... |
func HandleMove(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
t0 := time.Now()
ctx, cancel := context.WithTimeout(r.Context(), time.Millisecond*500)
defer cancel()
name := p.ByName("name")
req := GameRequest{}
err := json.NewDecoder(r.Body).Decode(&req)
if err != nil {
fmt.Println("ERROR: mov... | [
-0.8492562770843506,
-0.3152211606502533,
1.0761244297027588,
-0.06044812873005867,
0.044745802879333496,
-0.8295453190803528,
-0.30822908878326416,
-0.7329914569854736,
-0.1107473075389862,
0.5988182425498962,
-0.0968313217163086,
-0.26215094327926636,
-1.025886058807373,
0.11855518817901... |
func HandleEnd(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
name := p.ByName("name")
req := GameRequest{}
err := json.NewDecoder(r.Body).Decode(&req)
if err != nil {
fmt.Println("ERROR: end parse: " + err.Error())
w.WriteHeader(http.StatusBadRequest)
return
}
var timeout string
if req.Y... | [
-0.6183813214302063,
0.10668378323316574,
1.0987120866775513,
0.03199151158332825,
0.18101464211940765,
-0.05951809138059616,
-0.8472501635551453,
-0.18367525935173035,
-0.7958080768585205,
0.613084614276886,
0.13726449012756348,
-0.00670116301625967,
-0.6944773197174072,
0.282174855470657... |
func (o *GetClinicsClinicGUIDServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetClinicsClinicGUIDServicesOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, e... | [
0.18186601996421814,
-0.41496649384498596,
0.3602825701236725,
-0.6552609801292419,
0.03549468144774437,
-0.8103666305541992,
-0.09379574656486511,
-1.051445722579956,
0.3480197489261627,
0.04926783964037895,
0.9122886061668396,
-0.11643744260072708,
-1.0895353555679321,
-0.653664410114288... |
func NewGetClinicsClinicGUIDServicesOK() *GetClinicsClinicGUIDServicesOK {
return &GetClinicsClinicGUIDServicesOK{}
} | [
0.9812536239624023,
-0.22070689499378204,
-0.12340841442346573,
-0.5371285676956177,
-0.28831174969673157,
-0.4007992744445801,
0.06013777107000351,
-0.6014015674591064,
-0.31769630312919617,
-0.16147422790527344,
0.2514442503452301,
0.3453400433063507,
0.4309822916984558,
-0.5678949952125... |
func (o *DataItems0) UnmarshalJSON(raw []byte) error {
// AO0
var aO0 models.MainData
if err := swag.ReadJSON(raw, &aO0); err != nil {
return err
}
o.MainData = aO0
// AO1
var aO1 models.ExtendedData
if err := swag.ReadJSON(raw, &aO1); err != nil {
return err
}
o.ExtendedData = aO1
// AO2
var aO2 mode... | [
-0.6600579619407654,
-0.18612782657146454,
0.6581647396087646,
-1.2810777425765991,
-0.8584092259407043,
0.38404950499534607,
0.6585744023323059,
0.6336243748664856,
0.337589830160141,
-0.021770820021629333,
-0.7754710912704468,
0.26885005831718445,
0.6487463712692261,
0.35816311836242676,... |
func (o DataItems0) MarshalJSON() ([]byte, error) {
_parts := make([][]byte, 0, 4)
aO0, err := swag.WriteJSON(o.MainData)
if err != nil {
return nil, err
}
_parts = append(_parts, aO0)
aO1, err := swag.WriteJSON(o.ExtendedData)
if err != nil {
return nil, err
}
_parts = append(_parts, aO1)
aO2, err := ... | [
-0.09232178330421448,
-0.4586717188358307,
0.6052443385124207,
-0.4725935757160187,
-0.6522170305252075,
0.32890522480010986,
0.24794423580169678,
0.5464155077934265,
0.38197842240333557,
-0.3568724989891052,
-0.7568953037261963,
0.8220953941345215,
0.10698768496513367,
0.8683961033821106,... |
func (o *DataItems0) Validate(formats strfmt.Registry) error {
var res []error
// validation for a type composition with models.MainData
if err := o.MainData.Validate(formats); err != nil {
res = append(res, err)
}
// validation for a type composition with models.ExtendedData
if err := o.ExtendedData.Validate(... | [
-0.5105031132698059,
-0.11168481409549713,
0.4131021499633789,
-0.21767018735408783,
0.19295796751976013,
0.41370639204978943,
0.5036182999610901,
0.5801020860671997,
-0.5694240927696228,
-0.3544785976409912,
-0.5012156963348389,
0.25798532366752625,
-0.4759773313999176,
1.0840613842010498... |
func (o *GetClinicsClinicGUIDServicesOKBody) UnmarshalJSON(raw []byte) error {
// GetClinicsClinicGUIDServicesOKBodyAO0
var getClinicsClinicGUIDServicesOKBodyAO0 models.SuccessData
if err := swag.ReadJSON(raw, &getClinicsClinicGUIDServicesOKBodyAO0); err != nil {
return err
}
o.SuccessData = getClinicsClinicGUID... | [
-0.02882516384124756,
0.12079113721847534,
0.5410447120666504,
-1.7396340370178223,
-0.8645460605621338,
-0.37329620122909546,
-0.11664879322052002,
-0.6010993719100952,
0.19702830910682678,
0.052988845854997635,
0.057505641132593155,
0.5270209908485413,
-0.18487630784511566,
0.26648008823... |
func (o GetClinicsClinicGUIDServicesOKBody) MarshalJSON() ([]byte, error) {
_parts := make([][]byte, 0, 2)
getClinicsClinicGUIDServicesOKBodyAO0, err := swag.WriteJSON(o.SuccessData)
if err != nil {
return nil, err
}
_parts = append(_parts, getClinicsClinicGUIDServicesOKBodyAO0)
var dataGetClinicsClinicGUIDSe... | [
0.5180920958518982,
-0.0486508347094059,
0.22646470367908478,
-1.1646628379821777,
-0.3868393003940582,
-0.30830782651901245,
-0.41882139444351196,
-0.7405475378036499,
0.5219377875328064,
0.11294223368167877,
0.14621978998184204,
0.8285948038101196,
-0.29572412371635437,
0.305288374423980... |
func (o *GetClinicsClinicGUIDServicesOKBody) Validate(formats strfmt.Registry) error {
var res []error
// validation for a type composition with models.SuccessData
if err := o.SuccessData.Validate(formats); err != nil {
res = append(res, err)
}
if err := o.validateData(formats); err != nil {
res = append(res... | [
0.40968742966651917,
0.5897618532180786,
0.2881961762905121,
-0.8927653431892395,
-0.16478627920150757,
-0.4424484670162201,
-0.3413141667842865,
-1.2153379917144775,
-0.3834907114505768,
0.07215773314237595,
0.5521577596664429,
0.2513653337955475,
-1.0684092044830322,
0.6860164999961853,
... |
func NewIteration() (iteration *Iteration) {
iteration = new(Iteration)
iteration.CreatedAt = time.Now()
iteration.UpdatedAt = time.Now()
return iteration
} | [
-0.7097113728523254,
-0.7717505097389221,
0.2624426484107971,
-0.16883426904678345,
-0.5595214366912842,
-0.3615961968898773,
-0.1211223304271698,
-0.8350265026092529,
-0.6787459850311279,
0.7455692291259766,
-0.24937553703784943,
-0.5284619331359863,
-0.022636739537119865,
0.6801032423973... |
func (iteration Iteration) GetCollectionName() string {
return IterationName
} | [
-0.6645711064338684,
-0.5992458462715149,
0.5951768159866333,
0.07241293042898178,
-0.6875057220458984,
0.1999461054801941,
0.9543139338493347,
-0.7050769925117493,
-0.45959219336509705,
0.5360389351844788,
0.708685040473938,
-0.13249148428440094,
0.340909868478775,
1.0779321193695068,
-... |
func (iteration Iteration) GetID() string {
return iteration.ID.Hex()
} | [
0.5084072351455688,
-0.2868195176124573,
0.2732152044773102,
-0.05952595919370651,
0.4693400263786316,
1.312954068183899,
-0.04227341338992119,
0.3591461777687073,
0.6122051477432251,
0.600309431552887,
0.18883584439754486,
-0.04163088649511337,
-0.43423429131507874,
0.8417881727218628,
... |
func (iteration *Iteration) SetID(id string) error {
iteration.ID = bson.ObjectIdHex(id)
return nil
} | [
-0.31793826818466187,
-0.3128085434436798,
0.1855504959821701,
0.20503729581832886,
-0.17724087834358215,
1.3762820959091187,
-0.06901858747005463,
0.42355847358703613,
0.5712919235229492,
0.9605929255485535,
-0.7066652178764343,
0.056359175592660904,
-0.6941813826560974,
0.748441338539123... |
func (iteration Iteration) GetName() string {
return iteration.GetCollectionName()
} | [
-0.796421229839325,
-0.5672011971473694,
0.5299369096755981,
-0.23462998867034912,
-0.18383949995040894,
0.3031530976295471,
0.6809598207473755,
-1.0721489191055298,
-0.6329506039619446,
0.9362576603889465,
-0.11866869032382965,
-0.25274163484573364,
-0.0434468612074852,
0.9047282338142395... |
func (iteration Iteration) GetReferences() []jsonapi.Reference {
return []jsonapi.Reference{
{
Type: "workitems",
Name: "workitems",
IsNotLoaded: true, // omit the data field, only generate links
},
{
Type: "iterations",
Name: "parent",
IsNotLoaded: false, // include... | [
-1.0725901126861572,
0.3230305314064026,
0.5673368573188782,
-0.553335964679718,
0.857633650302887,
0.6597295999526978,
0.06493780761957169,
-1.170758843421936,
-0.10961882025003433,
0.19504432380199432,
-0.30009856820106506,
0.5727652311325073,
-0.8062514662742615,
0.5323219895362854,
0... |
func (iteration Iteration) GetReferencedIDs() []jsonapi.ReferenceID {
result := []jsonapi.ReferenceID{
jsonapi.ReferenceID{
ID: iteration.SpaceID.Hex(),
Type: "spaces",
Name: "space",
},
jsonapi.ReferenceID{
ID: iteration.ParentIterationID.Hex(),
Type: "iterations",
Name: "parent",
},
}
... | [
-0.628567636013031,
-0.14029274880886078,
0.3874470889568329,
-0.7417039275169373,
0.3621167242527008,
0.5812240839004517,
-0.25649505853652954,
-0.887342095375061,
0.13554084300994873,
0.968363881111145,
-0.11092650145292282,
1.8165786266326904,
-0.7569664120674133,
1.5486682653427124,
... |
func (iteration Iteration) GetCustomLinks(linkURL string) jsonapi.Links {
links := jsonapi.Links {
"self": jsonapi.Link { linkURL, nil, },
}
return links
} | [
-1.2805051803588867,
-0.05591825768351555,
0.15807873010635376,
-0.29296502470970154,
-0.401719868183136,
-1.0243422985076904,
-0.19857530295848846,
-0.5271719098091125,
0.3726109266281128,
-1.1312997341156006,
-0.9722053408622742,
1.3294694423675537,
-0.7746829390525818,
0.039607342332601... |
func (iteration Iteration) GetCustomMeta(linkURL string) jsonapi.Metas {
totalWIs, closedWIs, _ := utils.DatabaseMetaService.GetIterationMeta(WorkItemName, iteration.ID)
meta := map[string]map[string]interface{} {
"workitems": map[string]interface{} {
"closed": closedWIs,
"total": totalWIs,
},
}
return me... | [
-1.0938358306884766,
0.08900582045316696,
0.5358917117118835,
-0.5107842683792114,
-0.30972084403038025,
-0.36953264474868774,
0.106284961104393,
-0.4223842918872833,
-0.3829663395881653,
0.6628769636154175,
-0.47742223739624023,
1.0703327655792236,
-0.1749548614025116,
0.3094893991947174,... |
func (ctl UserController) Users(c *gin.Context) {
users, err := microsoft.NewUser().Users(c.Param("id"), c.Query("next"))
if err != nil {
c.JSON(rootCtl.wrap(http.StatusInternalServerError, err.Error()))
}
c.JSON(rootCtl.wrap(http.StatusOK, users))
} | [
-1.5756887197494507,
0.2974647879600525,
0.3348723351955414,
-0.44676700234413147,
-0.008184099569916725,
-0.09022638946771622,
0.09620027989149094,
-0.8974748849868774,
-0.14464083313941956,
-0.10123559832572937,
-0.13900087773799896,
0.3498007357120514,
0.16023626923561096,
0.50298541784... |
func (ctl UserController) Create(c *gin.Context) {
var createRequest microsoft.CreateUserRequest
if err := c.ShouldBindJSON(&createRequest); err != nil {
c.JSON(rootCtl.wrap(http.StatusUnprocessableEntity, err.Error()))
return
}
if err := microsoft.NewUser().Create(c.Param("id"), createRequest); err != nil {
... | [
-0.8977249264717102,
-0.11525776982307434,
0.5013561248779297,
0.7705127596855164,
0.07036291062831879,
0.6557384729385376,
0.07873976230621338,
-1.2212140560150146,
-0.17669454216957092,
0.21695828437805176,
-0.741317629814148,
-0.549447238445282,
-0.40838268399238586,
1.1771366596221924,... |
func GetAllUser(w http.ResponseWriter, r *http.Request) {
usermanagement, err := getAllusermanagement()
if err != nil {
log.Fatalf("Unable to get all user. %v", err)
}
json.NewEncoder(w).Encode(usermanagement)
} | [
-0.8535604476928711,
-0.4182804822921753,
0.6816979646682739,
1.3550444841384888,
-0.40966925024986267,
0.03571221977472305,
-0.51761394739151,
-0.5772688388824463,
0.7249407768249512,
-0.38019847869873047,
-0.529360830783844,
1.1084271669387817,
0.26896601915359497,
0.8409636616706848,
... |
func (TestInfo_Trend) EnumDescriptor() ([]byte, []int) {
return file_summary_proto_rawDescGZIP(), []int{1, 0}
} | [
-0.5595934987068176,
-0.0986364409327507,
0.29949840903282166,
-0.31234505772590637,
0.5085522532463074,
0.02951250784099102,
1.1913654804229736,
-0.11003124713897705,
0.40789228677749634,
-0.17979049682617188,
-0.36565321683883667,
0.45040011405944824,
-0.5702769756317139,
1.0311412811279... |
func (DashboardTabSummary_TabStatus) EnumDescriptor() ([]byte, []int) {
return file_summary_proto_rawDescGZIP(), []int{4, 0}
} | [
0.10298136621713638,
0.11771788448095322,
0.3699643909931183,
0.004870002157986164,
0.18682576715946198,
0.1977866142988205,
0.3719441592693329,
-0.07760047912597656,
-0.6910578012466431,
0.15570977330207825,
-0.45623236894607544,
0.1576513648033142,
0.35048267245292664,
-0.368459045886993... |
func (*FailingTestSummary) Descriptor() ([]byte, []int) {
return file_summary_proto_rawDescGZIP(), []int{0}
} | [
-0.4070284068584442,
0.7830076217651367,
0.06712131947278976,
0.5566591620445251,
-0.04180493205785751,
0.4468781650066376,
0.14185957610607147,
-0.5871819257736206,
-0.0933789610862732,
0.6681801676750183,
-0.46805036067962646,
0.11809476464986801,
-0.43559563159942627,
0.6781541705131531... |
func (*TestInfo) Descriptor() ([]byte, []int) {
return file_summary_proto_rawDescGZIP(), []int{1}
} | [
-0.2289176881313324,
0.2565852403640747,
0.3502216041088104,
0.01454476173967123,
-0.20771461725234985,
-0.06888698041439056,
0.977994441986084,
0.12157198041677475,
-0.7685012817382812,
-0.3449372351169586,
-0.47106313705444336,
-0.2268231213092804,
-0.40151891112327576,
0.587897241115570... |
func (*HealthinessInfo) Descriptor() ([]byte, []int) {
return file_summary_proto_rawDescGZIP(), []int{2}
} | [
0.12356939166784286,
0.30332979559898376,
0.331680566072464,
-0.22049309313297272,
0.13756069540977478,
0.2449912577867508,
0.2713173031806946,
-0.30730584263801575,
-1.592679738998413,
-0.45245206356048584,
-0.6092496514320374,
0.20400184392929077,
0.0021536045242100954,
0.430047541856765... |
func (*AlertingData) Descriptor() ([]byte, []int) {
return file_summary_proto_rawDescGZIP(), []int{3}
} | [
-0.5256926417350769,
0.7845589518547058,
0.24186909198760986,
0.11975289136171341,
-0.8899475932121277,
0.9570340514183044,
0.27673476934432983,
0.0004655059310607612,
-0.6894884705543518,
0.16889432072639465,
0.06190648302435875,
1.2458940744400024,
0.06724151223897934,
0.3730483651161194... |
func (*DashboardTabSummary) Descriptor() ([]byte, []int) {
return file_summary_proto_rawDescGZIP(), []int{4}
} | [
0.06733236461877823,
1.3816441297531128,
0.2035001665353775,
0.4532279968261719,
0.10470245778560638,
-0.4672386050224304,
0.44624343514442444,
-0.6538332104682922,
-1.5304605960845947,
-0.4480331242084503,
-1.0045315027236938,
-0.011131823994219303,
0.4760056138038635,
-0.3932537138462066... |
func (x *DashboardTabSummary) GetAcceptablyFlaky() bool {
if x != nil {
return x.AcceptablyFlaky
}
return false
} | [
0.2485070526599884,
1.2048869132995605,
0.42454400658607483,
0.2588585317134857,
-1.1047279834747314,
0.11662465333938599,
0.683148205280304,
0.08168341219425201,
-0.4792288541793823,
-0.5328856110572815,
-0.5097085237503052,
0.27969658374786377,
0.07858926802873611,
0.8197045922279358,
... |
func (*DashboardTabSummaryMetrics) Descriptor() ([]byte, []int) {
return file_summary_proto_rawDescGZIP(), []int{5}
} | [
-0.02078877203166485,
1.0682859420776367,
0.09535688906908035,
-0.05341757833957672,
0.1893589198589325,
-0.3759137988090515,
0.649802565574646,
-0.9916572570800781,
-0.9412623643875122,
-0.4017760753631592,
-0.4620881676673889,
0.13263538479804993,
-0.12933509051799774,
-0.733373463153839... |
func (*DashboardSummary) Descriptor() ([]byte, []int) {
return file_summary_proto_rawDescGZIP(), []int{6}
} | [
-0.23776504397392273,
1.6644879579544067,
0.27157124876976013,
0.3195618987083435,
-0.011720020323991776,
-0.7087793946266174,
0.6635182499885559,
0.49216926097869873,
-1.1940168142318726,
-0.42817533016204834,
-0.8429316878318787,
0.16794300079345703,
-0.08613938093185425,
-0.082107812166... |
func runDirichletWinnerRandTestCase(a []float64, t *testing.T, full bool) {
var x float64
tols := []float64{1e-3, 1e-8, 1e-11} // Can't guarantee past 1e-12 or so due to base errors in GammaInc/etc
if !full {
tols = []float64{1e-8}
}
for _, tol := range tols {
r := DirichletWinner(a, tol)
x = 0.0
for _, v ... | [
-0.4263121485710144,
-0.10006770491600037,
0.6597930788993835,
-0.2761533558368683,
0.09685371816158295,
0.5543435215950012,
1.0097702741622925,
-0.10965237766504288,
0.9707927703857422,
0.2901144027709961,
-0.002751248888671398,
-0.3811049163341522,
-0.23468980193138123,
-0.04465948045253... |
func (bsp *Bsp) Header() *Header {
return &bsp.header
} | [
0.24172541499137878,
-0.5653713345527649,
0.41107678413391113,
1.4087623357772827,
-0.3583252429962158,
0.7996762990951538,
0.43716996908187866,
-0.5199599862098694,
0.7981203198432922,
-0.7841421961784363,
0.3704371154308319,
1.0069570541381836,
-0.9805207848548889,
-0.9247535467147827,
... |
func (bsp *Bsp) Lump(index LumpId) lumps.ILump {
return bsp.RawLump(index).Contents()
} | [
-1.1537150144577026,
0.21628278493881226,
0.1926383674144745,
-0.4974954426288605,
-0.48384231328964233,
0.6373642086982727,
-0.03404291346669197,
-1.033782958984375,
1.573132038116455,
-0.08473273366689682,
0.2686043977737427,
0.9909008741378784,
0.3144718408584595,
-1.128640055656433,
... |
func (bsp *Bsp) RawLump(index LumpId) *Lump {
return &bsp.lumps[int(index)]
} | [
-0.5313048958778381,
-0.09876656532287598,
0.46286678314208984,
-0.6423459053039551,
-0.6142850518226624,
0.13325713574886322,
-0.27936822175979614,
-1.1248972415924072,
0.9811812043190002,
-0.33195430040359497,
-0.17550650238990784,
0.949297308921814,
0.3208315670490265,
-1.34104490280151... |
func (bsp *Bsp) SetLump(index LumpId, lump Lump) {
bsp.lumps[int(index)] = lump
} | [
-0.6229110360145569,
-0.349019855260849,
0.3332537114620209,
0.07458511739969254,
0.7633002996444702,
0.7303386330604553,
-0.1674509048461914,
-0.5767027139663696,
0.5378661155700684,
0.12848587334156036,
-0.7223737239837646,
1.3365360498428345,
-0.40833592414855957,
-0.4260651171207428,
... |
func NewCookie(name string) *Cookie {
return &Cookie{
name: &name,
}
} | [
0.3817563056945801,
-0.5342452526092529,
0.14244982600212097,
0.44522878527641296,
-1.540710210800171,
-0.07964610308408737,
-0.4621071517467499,
-0.6844078302383423,
-0.5197493433952332,
0.39837318658828735,
-0.4503215253353119,
0.3067893087863922,
-0.10445763915777206,
-0.261567533016204... |
func (cookie *Cookie) Value(value string) *Cookie {
cookie.value = &value
return cookie
} | [
-0.1586027592420578,
-0.044889163225889206,
0.2516782283782959,
-0.3746562898159027,
-0.46265849471092224,
0.2841629981994629,
0.28911280632019043,
-0.6176363825798035,
0.5548438429832458,
0.25427496433258057,
-0.395518034696579,
0.8578863143920898,
0.453391969203949,
0.31334465742111206,
... |
func (cookie *Cookie) Path(path string) *Cookie {
cookie.path = &path
return cookie
} | [
0.03271258994936943,
-0.5531741976737976,
0.17887291312217712,
-0.17530205845832825,
-0.9890827536582947,
0.46574968099594116,
1.187962293624878,
-0.459500253200531,
0.21953998506069183,
0.34779614210128784,
-0.3429710268974304,
0.5428590774536133,
-0.09862478822469711,
0.1783158779144287,... |
func (cookie *Cookie) Domain(domain string) *Cookie {
cookie.domain = &domain
return cookie
} | [
-0.017137646675109863,
0.3019507825374603,
0.3120550513267517,
0.4625641703605652,
-0.39332741498947144,
-0.311026930809021,
0.06710709631443024,
-0.1904800981283188,
0.4790111482143402,
-0.237849161028862,
-0.4104180335998535,
1.9030364751815796,
0.9479348063468933,
0.8258711695671082,
... |
func (cookie *Cookie) Expires(expires time.Time) *Cookie {
cookie.expires = &expires
return cookie
} | [
-0.6609165072441101,
-0.4353850185871124,
0.38799408078193665,
-0.5805593729019165,
-0.3174113929271698,
-0.5220410823822021,
-1.0661605596542358,
-0.009114754386246204,
1.032839059829712,
0.2015131115913391,
-0.39499908685684204,
0.5889893770217896,
0.6606582999229431,
0.3640642762184143,... |
func (cookie *Cookie) MaxAge(maxAge int) *Cookie {
cookie.maxAge = &maxAge
return cookie
} | [
-0.6989263892173767,
0.2890186309814453,
0.595495879650116,
-0.053218211978673935,
-1.0938153266906738,
0.15106748044490814,
-0.4313400983810425,
0.42883771657943726,
0.41342464089393616,
0.34328457713127136,
0.5148708820343018,
0.020050451159477234,
-0.36027467250823975,
0.393472015857696... |
func (cookie *Cookie) Secure(secure bool) *Cookie {
cookie.secure = &secure
return cookie
} | [
-0.22238542139530182,
0.39586538076400757,
0.4845448136329651,
0.8230716586112976,
-0.3487667739391327,
-0.22168788313865662,
-0.020804166793823242,
-0.27539822459220886,
-0.1773482859134674,
-0.3911765217781067,
-0.5117077231407166,
0.39679068326950073,
0.1775856912136078,
0.0359823703765... |
func (cookie *Cookie) HttpOnly(httpOnly bool) *Cookie {
cookie.httpOnly = &httpOnly
return cookie
} | [
-0.46072274446487427,
0.6141429543495178,
0.44660958647727966,
0.886662483215332,
-0.30246174335479736,
1.1794637441635132,
0.20177501440048218,
0.8054116368293762,
-0.2514859139919281,
0.2654438018798828,
-0.6364877820014954,
1.291126012802124,
-0.35331687331199646,
-0.0745023563504219,
... |
func (cookie *Cookie) ToHttpCookie() *http.Cookie {
httpCookie := http.Cookie{}
if cookie.name != nil {
httpCookie.Name = *cookie.name
}
if cookie.value != nil {
httpCookie.Value = *cookie.value
}
if cookie.path != nil {
httpCookie.Path = *cookie.path
}
if cookie.domain != nil {
httpCookie.Domain = ... | [
0.4164920449256897,
-0.5835220813751221,
0.8472095727920532,
-0.5147596001625061,
-0.2574025094509125,
-0.3542739450931549,
-0.34490078687667847,
-0.3805859684944153,
-0.16253675520420074,
0.5870882868766785,
-0.5537386536598206,
0.966092586517334,
0.4940917193889618,
0.17077606916427612,
... |
func FromHTTPCookie(httpCookie *http.Cookie) *Cookie {
return NewCookie(httpCookie.Name).
Value(httpCookie.Value).
Path(httpCookie.Path).
Domain(httpCookie.Domain).
Expires(httpCookie.Expires).
MaxAge(httpCookie.MaxAge).
Secure(httpCookie.Secure).
HttpOnly(httpCookie.HttpOnly)
} | [
0.5415204763412476,
-0.40353643894195557,
0.4286588728427887,
-0.10088490694761276,
-0.9579353928565979,
0.40659141540527344,
-0.39778855443000793,
-0.8077952265739441,
-0.6192384958267212,
0.5079827308654785,
0.13651011884212494,
1.1912963390350342,
0.7619773149490356,
0.3751593828201294,... |
func compareCookies(expectedCookie *Cookie, actualCookie *http.Cookie) (bool, []string) {
cookieFound := *expectedCookie.name == actualCookie.Name
compareErrors := make([]string, 0)
if cookieFound {
compareErrors = compareValue(expectedCookie, actualCookie, compareErrors)
compareErrors = compareDomain(expectedCo... | [
-0.46327751874923706,
-0.5137288570404053,
0.7837688326835632,
-0.3475889563560486,
0.10246630012989044,
-0.11090822517871857,
0.3042321503162384,
-0.6913554668426514,
-0.08982720971107483,
0.800680935382843,
-0.02164304628968239,
0.718319833278656,
-0.4386463761329651,
0.8301050066947937,... |
func ensurePlugin(t *testing.T, name string) string {
pluginBuildLock.Lock(name)
defer pluginBuildLock.Unlock(name)
goPath := os.Getenv("GOPATH")
if goPath == "" {
goPath = "/go"
}
installPath := filepath.Join(goPath, "bin", name)
if _, err := os.Stat(installPath); err == nil {
return installPath
}
goBin... | [
-0.17576351761817932,
-0.4514344036579132,
0.7204232811927795,
0.4137491285800934,
1.0262970924377441,
0.6808745265007019,
0.5730270743370056,
0.008269631303846836,
0.26032349467277527,
0.14078056812286377,
-0.30325138568878174,
0.477880597114563,
-1.084076166152954,
-0.0927770584821701,
... |
func TestAddVpaThenAddPod(t *testing.T) {
cluster := NewClusterState()
vpa := addTestVpa(cluster)
pod := addTestPod(cluster)
assert.Equal(t, pod, vpa.Pods[testPodID])
assert.Equal(t, vpa, pod.Vpa)
} | [
-0.0020224577747285366,
-0.6163089871406555,
0.38672497868537903,
0.0978807881474495,
1.5009145736694336,
1.035720705986023,
0.2079826444387436,
-0.56229168176651,
1.2713831663131714,
0.25773945450782776,
-0.08695430308580399,
-0.21023428440093994,
-0.5532452464103699,
-0.95485520362854,
... |
func TestAddPodThenAddVpa(t *testing.T) {
cluster := NewClusterState()
pod := addTestPod(cluster)
vpa := addTestVpa(cluster)
assert.Equal(t, pod, vpa.Pods[testPodID])
assert.Equal(t, vpa, pod.Vpa)
} | [
-0.18739701807498932,
-0.6487030386924744,
0.45852965116500854,
-0.3281668424606323,
1.4620367288589478,
0.8595236539840698,
-0.010580664500594139,
-0.6367025971412659,
1.6463919878005981,
0.447272390127182,
-0.3353045880794525,
0.17080242931842804,
-0.7790938019752502,
-0.8255054950714111... |
func TestDeleteVpa(t *testing.T) {
cluster := NewClusterState()
vpa := addTestVpa(cluster)
pod := addTestPod(cluster)
cluster.DeleteVpa(vpa.ID)
assert.Nil(t, pod.Vpa)
assert.NotContains(t, cluster.Vpas, vpa.ID)
} | [
0.45824548602104187,
-0.5369303226470947,
0.2113121598958969,
0.020621437579393387,
1.1513075828552246,
0.7097814679145813,
0.24004319310188293,
-0.3448888957500458,
1.8591734170913696,
0.19759266078472137,
-0.07461006939411163,
0.256475031375885,
-1.0662744045257568,
-0.5306328535079956,
... |
func TestDeletePod(t *testing.T) {
cluster := NewClusterState()
vpa := addTestVpa(cluster)
pod := addTestPod(cluster)
assert.NoError(t, cluster.DeletePod(pod.ID))
assert.Empty(t, vpa.Pods)
} | [
0.3449137508869171,
0.0811610221862793,
0.17034022510051727,
-0.32600316405296326,
1.6665863990783691,
0.7083344459533691,
0.3807533383369446,
-0.08016707003116608,
1.468783974647522,
-0.15870800614356995,
-0.03524765372276306,
-0.00578510295599699,
-0.5806059837341309,
-1.0354496240615845... |
func TestChangePodLabels(t *testing.T) {
cluster := NewClusterState()
vpa := addTestVpa(cluster)
pod := addTestPod(cluster)
// Update Pod labels to no longer match the VPA.
cluster.AddOrUpdatePod(testPodID, emptyLabels)
assert.Empty(t, vpa.Pods)
assert.Nil(t, pod.Vpa)
} | [
-1.038707971572876,
-0.007847374305129051,
0.46717625856399536,
-0.867574155330658,
1.3683513402938843,
0.8831037878990173,
-0.47495073080062866,
-0.5154340863227844,
0.9966335892677307,
0.6142539381980896,
-0.1205345094203949,
0.17410343885421753,
-0.9005768299102783,
-0.4279882311820984,... |
func TestUpdatePodSelector(t *testing.T) {
cluster := NewClusterState()
vpa := addTestVpa(cluster)
pod := addTestPod(cluster)
// Update the VPA selector such that it still matches the Pod.
assert.NoError(t, cluster.AddOrUpdateVpa(testVpaID, "label-1 in (value-1,value-2)"))
vpa = cluster.Vpas[testVpaID]
assert.E... | [
-1.0918768644332886,
-1.009817123413086,
0.4095824658870697,
-0.3523464500904083,
0.9308099746704102,
0.2273855209350586,
-0.18285205960273743,
-0.363700807094574,
0.7810724377632141,
0.389860600233078,
-0.22551985085010529,
0.09773130714893341,
-0.5014017224311829,
-1.0634009838104248,
... |
func TestTwoVpasForPod(t *testing.T) {
cluster := NewClusterState()
cluster.AddOrUpdateVpa(VpaID{"vpa-1"}, "label-1 = value-1")
pod := addTestPod(cluster)
cluster.AddOrUpdateVpa(VpaID{"vpa-2"}, "label-1 in (value-1,value-2)")
assert.Equal(t, cluster.Vpas[VpaID{"vpa-1"}], pod.Vpa)
// Delete the VPA that currently ... | [
-0.4065844714641571,
-0.6303998827934265,
0.7175401449203491,
-0.3611353635787964,
1.1832407712936401,
0.686842143535614,
-0.01387870218604803,
-0.48478493094444275,
0.6515344381332397,
0.6814615726470947,
-0.4032043218612671,
0.5087903141975403,
0.006496361922472715,
-0.9304264783859253,
... |
func TestEmptySelector(t *testing.T) {
cluster := NewClusterState()
// Create a VPA with an empty selector (matching all pods).
assert.NoError(t, cluster.AddOrUpdateVpa(testVpaID, ""))
// Create a pod with labels.
cluster.AddOrUpdatePod(testPodID, testLabels)
// Create a pod without labels.
anotherPodID := PodID... | [
-0.7996796369552612,
-0.4956948459148407,
0.2894735038280487,
-0.7311521172523499,
1.1830857992172241,
0.28681421279907227,
-0.25512972474098206,
-0.5043853521347046,
1.1029622554779053,
-0.2609451711177826,
-0.3416556119918823,
-0.01002504862844944,
-0.3817911744117737,
-0.593114197254180... |
func (e PaymentEdges) CustomerOrErr() (*Customer, error) {
if e.loadedTypes[0] {
if e.Customer == nil {
// The edge customer was loaded in eager-loading,
// but was not found.
return nil, &NotFoundError{label: customer.Label}
}
return e.Customer, nil
}
return nil, &NotLoadedError{edge: "customer"}
} | [
-0.16543062031269073,
-0.8379708528518677,
0.44061335921287537,
-0.47090911865234375,
-0.5359141230583191,
0.3869943618774414,
-0.20773440599441528,
-0.7517627477645874,
0.3672894835472107,
0.7302792072296143,
1.4648702144622803,
0.41334906220436096,
-0.06923915445804596,
-0.12216863036155... |
func (e PaymentEdges) EmployeeOrErr() (*Employee, error) {
if e.loadedTypes[1] {
if e.Employee == nil {
// The edge employee was loaded in eager-loading,
// but was not found.
return nil, &NotFoundError{label: employee.Label}
}
return e.Employee, nil
}
return nil, &NotLoadedError{edge: "employee"}
} | [
-0.7957483530044556,
-0.6325258612632751,
0.4996747374534607,
-0.8661719560623169,
-0.1260213702917099,
0.7759756445884705,
-0.6034631729125977,
-0.4572495222091675,
0.5302257537841797,
0.7339592576026917,
1.3464527130126953,
0.3459000587463379,
-0.53630530834198,
0.09893756359815598,
-0... |
func (e PaymentEdges) PaymenttypeOrErr() (*Paymenttype, error) {
if e.loadedTypes[2] {
if e.Paymenttype == nil {
// The edge paymenttype was loaded in eager-loading,
// but was not found.
return nil, &NotFoundError{label: paymenttype.Label}
}
return e.Paymenttype, nil
}
return nil, &NotLoadedError{edg... | [
-0.4721042215824127,
0.14089839160442352,
0.5449157357215881,
-0.9420021772384644,
0.2649971842765808,
-0.146574929356575,
-0.7046298980712891,
-1.005204200744629,
1.0698741674423218,
0.8290014266967773,
1.3773502111434937,
-0.16829916834831238,
-0.07459308207035065,
0.7663251757621765,
... |
func (e PaymentEdges) RoomtypeOrErr() (*Roomtype, error) {
if e.loadedTypes[3] {
if e.Roomtype == nil {
// The edge roomtype was loaded in eager-loading,
// but was not found.
return nil, &NotFoundError{label: roomtype.Label}
}
return e.Roomtype, nil
}
return nil, &NotLoadedError{edge: "roomtype"}
} | [
-1.0420526266098022,
-0.3141873776912689,
0.5889014601707458,
-0.1591334044933319,
-0.08738617599010468,
0.14618182182312012,
-0.19071364402770996,
-0.8888808488845825,
0.5356966257095337,
1.0924080610275269,
0.9755111336708069,
-0.11269531399011612,
-0.5702975988388062,
0.8604863882064819... |
func (*Payment) scanValues() []interface{} {
return []interface{}{
&sql.NullInt64{}, // id
&sql.NullTime{}, // PAYDAY
}
} | [
-0.750910222530365,
0.9471591114997864,
0.5259600877761841,
0.910679280757904,
-0.39025455713272095,
-0.606493353843689,
-1.7050549983978271,
-0.9406793713569641,
0.6068719029426575,
-1.0621501207351685,
0.20130160450935364,
-0.4665124714374542,
0.14055456221103668,
1.4672423601150513,
-... |
func (*Payment) fkValues() []interface{} {
return []interface{}{
&sql.NullInt64{}, // customer_payment
&sql.NullInt64{}, // employee_payment
&sql.NullInt64{}, // paymenttype_payment
&sql.NullInt64{}, // roomtype_payment
}
} | [
0.09988522529602051,
0.853639543056488,
0.615959644317627,
1.168878197669983,
-0.11967823654413223,
-0.7413300275802612,
-0.44309598207473755,
-0.3419472873210907,
-0.03851108253002167,
-0.25763681530952454,
0.3744804263114929,
-0.46703004837036133,
-0.6503243446350098,
1.7076762914657593,... |
func (pa *Payment) assignValues(values ...interface{}) error {
if m, n := len(values), len(payment.Columns); m < n {
return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)
}
value, ok := values[0].(*sql.NullInt64)
if !ok {
return fmt.Errorf("unexpected type %T for field id", value)
}
pa.ID = int(... | [
-0.7231301069259644,
0.07541795074939728,
0.7595058083534241,
0.39958447217941284,
0.018662378191947937,
0.17205557227134705,
-0.07054531574249268,
-0.7597475647926331,
0.1897372007369995,
-0.19191613793373108,
0.9070839285850525,
-1.011607050895691,
-0.2320936769247055,
1.1523220539093018... |
func (pa *Payment) QueryCustomer() *CustomerQuery {
return (&PaymentClient{config: pa.config}).QueryCustomer(pa)
} | [
1.3062856197357178,
-0.16504409909248352,
0.2552230954170227,
0.4377244710922241,
-1.0348095893859863,
-0.35846415162086487,
0.21762029826641083,
-0.0027695021126419306,
0.3738855719566345,
-1.1186301708221436,
1.1225745677947998,
0.39746466279029846,
-0.4056607782840729,
-0.04169407486915... |
func (pa *Payment) QueryEmployee() *EmployeeQuery {
return (&PaymentClient{config: pa.config}).QueryEmployee(pa)
} | [
0.913224995136261,
-0.04846341535449028,
0.3239384889602661,
0.06458248943090439,
-0.9389432072639465,
0.14835160970687866,
-0.4922766089439392,
0.19884179532527924,
-0.12449872493743896,
-0.5869331359863281,
0.8857845067977905,
-0.15083882212638855,
-1.3121912479400635,
-0.117163695394992... |
func (pa *Payment) QueryPaymenttype() *PaymenttypeQuery {
return (&PaymentClient{config: pa.config}).QueryPaymenttype(pa)
} | [
0.5857405662536621,
0.8250700235366821,
0.332115113735199,
0.14445796608924866,
-0.317839652299881,
-0.8005766868591309,
-0.6461371779441833,
-0.33183637261390686,
1.0231064558029175,
-0.6431122422218323,
1.0801371335983276,
0.1309937685728073,
-0.7457809448242188,
0.5602865219116211,
-0... |
func (pa *Payment) QueryRoomtype() *RoomtypeQuery {
return (&PaymentClient{config: pa.config}).QueryRoomtype(pa)
} | [
-0.0908956527709961,
0.6304701566696167,
0.36778897047042847,
1.008299708366394,
-0.6882079839706421,
-0.5796932578086853,
-0.19658784568309784,
-0.2908659875392914,
0.5447161793708801,
-0.19893892109394073,
0.4714154005050659,
0.5194296836853027,
-0.9058254957199097,
1.0042881965637207,
... |
func (pa *Payment) Update() *PaymentUpdateOne {
return (&PaymentClient{config: pa.config}).UpdateOne(pa)
} | [
0.3481656312942505,
-0.23099033534526825,
0.1402263194322586,
0.40791720151901245,
-0.5404356122016907,
-0.27492913603782654,
-0.36976510286331177,
-0.0346655547618866,
1.1347655057907104,
-0.14465168118476868,
0.7978308796882629,
-0.4416884183883667,
-1.308321475982666,
-0.340437412261962... |
func (pa *Payment) Unwrap() *Payment {
tx, ok := pa.config.driver.(*txDriver)
if !ok {
panic("ent: Payment is not a transactional entity")
}
pa.config.driver = tx.drv
return pa
} | [
-0.2841523289680481,
0.48838651180267334,
0.301155149936676,
-0.3041313588619232,
-0.3705626428127289,
-0.3864500820636749,
-0.07491352409124374,
0.30300816893577576,
0.7091647386550903,
0.2716037929058075,
1.4797186851501465,
0.0586157962679863,
0.4205978512763977,
-0.6549033522605896,
... |
func (pa *Payment) String() string {
var builder strings.Builder
builder.WriteString("Payment(")
builder.WriteString(fmt.Sprintf("id=%v", pa.ID))
builder.WriteString(", PAYDAY=")
builder.WriteString(pa.PAYDAY.Format(time.ANSIC))
builder.WriteByte(')')
return builder.String()
} | [
-0.034370798617601395,
-0.6359294652938843,
0.3062138557434082,
-0.8028415441513062,
-0.6896541714668274,
0.40867099165916443,
-0.2968732714653015,
-1.4273313283920288,
0.3187078535556793,
0.048259131610393524,
1.0671426057815552,
-0.19651931524276733,
-0.03080378845334053,
0.0729333534836... |
func StartServer(port int) error {
ln, err := net.Listen("tcp", fmt.Sprintf(":%d", port))
if err != nil {
return err
}
defer ln.Close()
util.ColorPrinter.Cyan("[%s]: server side start listening @%d\n", util.NowTime(), port)
for {
conn, err := ln.Accept()
if err != nil {
return err
}
go HandleClient... | [
0.03673047572374344,
-0.2622275948524475,
0.7636245489120483,
-0.7771884202957153,
0.7436923384666443,
0.4859246611595154,
0.1449062079191208,
0.07910659164190292,
-0.7937201261520386,
-0.6802682876586914,
-0.6126076579093933,
0.26892003417015076,
-0.38679221272468567,
0.7417808175086975,
... |
func TestMaxConcSessConn(t *testing.T) {
sessionStorage := make(map[string]*wwr.Session)
var sessionKey string
sessionKeyLock := sync.RWMutex{}
concurrentConns := uint(4)
// Initialize server
server := setupServer(
t,
&serverImpl{
onClientConnected: func(conn wwr.Connection) {
// Created the session ... | [
-0.01802022010087967,
-0.4552189111709595,
0.8317979574203491,
0.32932528853416443,
0.4768933057785034,
-0.7605320811271667,
0.4606098532676697,
-0.7891792058944702,
0.3233761787414551,
0.14568626880645752,
-0.09169980138540268,
-0.005803849548101425,
-0.4746616780757904,
0.570647001266479... |
func (tx *Tx) Begin(ctx context.Context) (pgx.Tx, error) {
return tx.t.Begin(ctx)
} | [
-0.15804310142993927,
0.5299062132835388,
0.3997545838356018,
-0.19189850986003876,
-0.31665197014808655,
0.2196166217327118,
-0.19688425958156586,
-0.7754666209220886,
-0.09230493754148483,
0.026216762140393257,
-0.08734895288944244,
0.3852534592151642,
0.33115220069885254,
-0.73649555444... |
func (tx *Tx) Commit(ctx context.Context) error {
err := tx.t.Commit(ctx)
if tx.c != nil {
tx.c.Release()
tx.c = nil
}
return err
} | [
0.5381841659545898,
-0.24070192873477936,
0.48045670986175537,
-0.2938567101955414,
0.210880845785141,
0.44858986139297485,
0.09617097675800323,
-0.4462616741657257,
-0.639373779296875,
1.5284456014633179,
-0.04462367668747902,
-0.6195192933082581,
-0.0498349703848362,
-0.14671599864959717... |
func (tx *Tx) Rollback(ctx context.Context) error {
err := tx.t.Rollback(ctx)
if tx.c != nil {
tx.c.Release()
tx.c = nil
}
return err
} | [
0.6866439580917358,
0.3679466247558594,
0.59306401014328,
-0.544500470161438,
0.6714855432510376,
0.40270912647247314,
0.16546417772769928,
0.07211457192897797,
0.23397226631641388,
0.9692060351371765,
0.1356884390115738,
0.08632829040288925,
-0.17168977856636047,
-0.9726536273956299,
0.... |
func (tx *Tx) Prepare(ctx context.Context, name, sql string) (*pgconn.StatementDescription, error) {
return tx.t.Prepare(ctx, name, sql)
} | [
0.22363264858722687,
0.7581624984741211,
0.38498982787132263,
-0.31612440943717957,
-0.8854458928108215,
-1.1133023500442505,
-1.5192824602127075,
-1.4044207334518433,
-0.28008440136909485,
0.8959628343582153,
-0.33665427565574646,
-0.03301576152443886,
0.05508701875805855,
-0.305306404829... |
func (s *pluginCRUD) Create(arg ...crud.Arg) (crud.Arg, error) {
event := eventFromArg(arg[0])
plugin := pluginFromStuct(event)
createdPlugin, err := s.client.Plugins.Create(nil, &plugin.Plugin)
if err != nil {
return nil, err
}
return &state.Plugin{Plugin: *createdPlugin}, nil
} | [
-0.10423169285058975,
-0.2465377002954483,
0.5637471675872803,
0.3411676585674286,
0.9411110877990723,
0.5360574722290039,
0.5834762454032898,
0.06934517621994019,
0.05975573509931564,
-0.05577922984957695,
-0.20095796883106232,
0.4127630591392517,
0.1301441341638565,
-0.02253860794007778,... |
func (s *pluginCRUD) Delete(arg ...crud.Arg) (crud.Arg, error) {
event := eventFromArg(arg[0])
plugin := pluginFromStuct(event)
err := s.client.Plugins.Delete(nil, plugin.ID)
if err != nil {
return nil, err
}
return plugin, nil
} | [
0.40573588013648987,
-0.340270072221756,
0.6523830890655518,
0.20542146265506744,
0.8361402750015259,
0.11950711160898209,
0.9135520458221436,
0.3392791450023651,
0.5881844162940979,
0.2887793779373169,
-0.014001534320414066,
0.6640581488609314,
-0.635962963104248,
-0.5223274827003479,
-... |
func (s *pluginCRUD) Update(arg ...crud.Arg) (crud.Arg, error) {
event := eventFromArg(arg[0])
plugin := pluginFromStuct(event)
updatedPlugin, err := s.client.Plugins.Create(nil, &plugin.Plugin)
if err != nil {
return nil, err
}
return &state.Plugin{Plugin: *updatedPlugin}, nil
} | [
-0.4217918813228607,
-1.0381569862365723,
0.5216700434684753,
-0.2639516592025757,
0.48196953535079956,
0.5158199071884155,
0.602729856967926,
0.4040398895740509,
0.7121927738189697,
0.1349983811378479,
-0.5436228513717651,
0.6258769035339355,
-0.3678930997848511,
-0.6625546216964722,
-0... |
func RemainingOvenTime(time int) int {
return (OvenTime - time)
} | [
-0.7982818484306335,
-0.06036454811692238,
0.4979487955570221,
0.2902575433254242,
-1.0636385679244995,
0.4930763244628906,
-0.5214888453483582,
-0.3488324284553528,
0.6515398621559143,
0.40988263487815857,
-0.9415690898895264,
-1.0881054401397705,
-0.8321648240089417,
1.5956162214279175,
... |
func PreparationTime(count int) int {
return count * 2
} | [
-0.2046850025653839,
0.029245195910334587,
0.46847769618034363,
-0.10133518278598785,
-0.4533461928367615,
-0.38716354966163635,
0.09969093650579453,
0.3962526023387909,
-0.5264918804168701,
0.8337702751159668,
-0.981495201587677,
-1.506966471672058,
0.2699969708919525,
1.6434720754623413,... |
func ElapsedTime(count, time int) int {
return time + PreparationTime(count)
} | [
0.4373283386230469,
0.14325806498527527,
0.381643146276474,
-0.4142974019050598,
-0.5887886881828308,
0.49184510111808777,
-1.0727899074554443,
0.8935720920562744,
-0.3284939229488373,
0.7062907814979553,
-0.24251125752925873,
-0.7282567620277405,
-0.11196096986532211,
1.1395165920257568,
... |
func Hex2Base64Handmade(s string) string {
decoded, err := hexDecodeStr(s)
if err != nil {
log.Fatal(err)
}
return base64Encode(decoded)
} | [
0.21153827011585236,
-1.3649698495864868,
0.41077226400375366,
1.100392460823059,
0.08271907269954681,
0.24777594208717346,
-0.8996675610542297,
1.0654315948486328,
0.05536559224128723,
-0.4149608314037323,
-0.019233960658311844,
0.16675473749637604,
0.8826839327812195,
0.13510553538799286... |
func Hex2Base64(s string) string {
// The std library way, for future reference
decoded, err := hex.DecodeString(s)
if err != nil {
log.Fatal(err)
}
return base64.StdEncoding.EncodeToString(decoded)
} | [
-0.25212526321411133,
-1.3715206384658813,
0.3657994866371155,
0.8091150522232056,
-0.1785706877708435,
0.005039078649133444,
-0.878838300704956,
0.5574140548706055,
0.02271532267332077,
0.12778523564338684,
0.06608673185110092,
0.26841697096824646,
0.6232287883758545,
0.21817870438098907,... |
func hexDecodeStr(s string) ([]byte, error) {
src := []byte(s)
dst := make([]byte, len(src)/2)
if len(s)%2 != 0 {
return dst, errors.New("Not a valid hex string")
}
for i := range dst {
first, ok := unhex(src[i*2])
if !ok {
return dst, errors.New("Invalid hex char") // Would def be nicer to have the byte... | [
0.0716983824968338,
-0.11579614132642746,
0.4075731933116913,
0.08595540374517441,
-0.5770748853683472,
-0.6120867729187012,
-0.3505764305591583,
0.547278642654419,
-0.014522219076752663,
-0.536801815032959,
-0.4363926947116852,
0.09673383086919785,
-0.21744927763938904,
0.2284193485975265... |
func unhex(c byte) (byte, bool) {
switch {
case '0' <= c && c <= '9':
// why c - '0'? Because this is the value of the ascii char c,
// not c's value, the ascii numbers start with 0 at 048,
// and go up sequentially, so subtracting the character '0'
// from c will give us the numeric value of c
return c - '... | [
-0.15674671530723572,
-0.4645006060600281,
1.0026575326919556,
-0.5794912576675415,
-0.4758010804653168,
0.00604421878233552,
0.09358377009630203,
1.643718957901001,
-0.4824233949184418,
-0.12574826180934906,
-1.0118390321731567,
-0.6105279922485352,
0.2345345914363861,
0.19999712705612183... |
func base64Encode(src []byte) string {
buf := make([]byte, base64EncodedLen(len(src)))
// mehhhhh actually base64 encoding is a bit more involved
// and it feels like not a good use of time to implement it myself right now,
// I should come back to it. Basically you take 3 bytes of input,
// and then break it int... | [
0.5889527797698975,
0.05146767571568489,
0.40528759360313416,
0.9625362753868103,
-0.2609711289405823,
-0.12224647402763367,
0.10961189866065979,
-0.32789960503578186,
1.0860867500305176,
0.3664441406726837,
-0.4245951473712921,
-0.4733997583389282,
-0.5724213719367981,
-0.0617780797183513... |
func base64EncodedLen(n int) int {
return ((n + 2) / 3) * 4 // integer division
} | [
0.3026067614555359,
0.19761782884597778,
0.25787466764450073,
0.5537952780723572,
-0.32961905002593994,
0.6217564344406128,
0.09169451892375946,
-0.4637644290924072,
1.2214581966400146,
-0.8135595917701721,
-0.7061906456947327,
-0.21600455045700073,
-0.22769537568092346,
0.1976294964551925... |
func New() *Trie {
return &Trie{
root: &TrieNode{},
}
} | [
1.1561026573181152,
-0.7865633964538574,
-0.20239776372909546,
0.18702159821987152,
-0.29262858629226685,
-0.03490595892071724,
-0.18544648587703705,
0.8296952843666077,
-0.6813662648200989,
-0.4119795858860016,
-0.26131725311279297,
1.2346858978271484,
0.3103455901145935,
0.02407734841108... |
func (t *Trie) Insert(word string) {
wordLength := len(word)
current := t.root
for i := 0; i < wordLength; i++ {
index := word[i] - 'a'
if current.children[index] == nil {
current.children[index] = &TrieNode{}
}
current = current.children[index]
}
current.isWordEnd = true
} | [
-0.00037198138306848705,
1.2042869329452515,
0.4157494604587555,
-1.3711247444152832,
0.13876232504844666,
0.37444108724594116,
1.1592798233032227,
1.1929806470870972,
-0.22942042350769043,
0.9886066317558289,
-0.5219671130180359,
0.1456034928560257,
-1.7550045251846313,
0.5014696717262268... |
func (t *Trie) Contains(word string) bool {
wordLength := len(word)
current := t.root
for i := 0; i < wordLength; i++ {
index := word[i] - 'a'
if current.children[index] == nil {
return false
}
current = current.children[index]
}
return current.isWordEnd
} | [
0.14049912989139557,
-0.03508592024445534,
0.416704386472702,
-0.8761804103851318,
-0.6578134298324585,
0.26978108286857605,
0.38169705867767334,
0.2712238132953644,
0.024365918710827827,
0.547095537185669,
0.12649737298488617,
0.8152686357498169,
-1.1563955545425415,
0.7420055866241455,
... |
func (c *Controller) enqueueRobot(obj interface{}) {
var (
key string
err error
)
// generate key
if key, err = cache.MetaNamespaceKeyFunc(obj); err != nil {
utilruntime.HandleError(err)
return
}
c.workQueue.Add(key)
} | [
-0.0962313711643219,
-0.04373234882950783,
0.6945565938949585,
0.10884194821119308,
0.12430545687675476,
0.7673576474189758,
-0.4956057369709015,
-0.7028276324272156,
-0.05984122306108475,
0.5808145403862,
-1.258376955986023,
0.49033570289611816,
-0.11530404537916183,
0.4877711534500122,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.