text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func NewAliasCodecWithCtx(ctx *map[string]interface{}) (*AliasCodec, error) {
this := &AliasCodec{}
this.ctx = ctx
return this, nil
} | [
0.06922751665115356,
-0.6497277617454529,
0.43930068612098694,
-0.36896899342536926,
-0.7355268597602844,
1.0477919578552246,
-0.3338531255722046,
0.2992149591445923,
0.3932148218154907,
0.020046019926667213,
-0.18717992305755615,
-0.02181951142847538,
1.3874648809432983,
0.876930534839630... |
func (this *AliasCodec) Forward(src, dst []byte) (uint, uint, error) {
if len(src) == 0 {
return 0, 0, nil
}
if &src[0] == &dst[0] {
return 0, 0, errors.New("Input and output buffers cannot be equal")
}
if n := this.MaxEncodedLen(len(src)); len(dst) < n {
return 0, 0, fmt.Errorf("Output buffer is too small... | [
-0.3142707049846649,
0.539160430431366,
0.6849228739738464,
-0.6606729030609131,
-0.819518506526947,
-0.27905893325805664,
1.2459514141082764,
-0.07676613330841064,
-0.04051428288221359,
0.00212428392842412,
-0.7490688562393188,
1.0280216932296753,
0.3437155485153198,
1.1168668270111084,
... |
func (this *AliasCodec) Inverse(src, dst []byte) (uint, uint, error) {
if len(src) == 0 {
return 0, 0, nil
}
if len(src) < 2 {
return 0, 0, fmt.Errorf("Input block is too small - size: %d, required %d", len(src), 2)
}
if &src[0] == &dst[0] {
return 0, 0, errors.New("Input and output buffers cannot be equal... | [
-0.6331623792648315,
-0.12612590193748474,
0.8705547451972961,
-0.8902438879013062,
-0.9646640419960022,
-0.6138616800308228,
0.7417405247688293,
0.3284566402435303,
-0.3724033832550049,
-0.002886501606553793,
-1.141548991203308,
0.526242733001709,
-0.17549128830432892,
-0.0403948053717613... |
func (this AliasCodec) MaxEncodedLen(srcLen int) int {
return srcLen + 1024
} | [
0.5606797933578491,
-0.2425045520067215,
0.33608776330947876,
-0.060304295271635056,
-0.26573142409324646,
0.09733448177576065,
-0.5580011606216431,
0.5579655170440674,
1.3576167821884155,
-0.5443442463874817,
-1.1789435148239136,
0.5992305278778076,
0.31554749608039856,
0.8772264122962952... |
func Copy(ctx context.Context, src, dst string) (err error) {
// Check context
if err = ctx.Err(); err != nil {
return
}
// Stat src
var statSrc os.FileInfo
if statSrc, err = os.Stat(src); err != nil {
err = errors.Wrapf(err, "stating %s failed", src)
return
}
// Check context
if err = ctx.Err(); err !... | [
-0.5257521271705627,
0.2772413194179535,
1.1625853776931763,
0.03010464832186699,
-0.8079996109008789,
0.7916704416275024,
0.6819727420806885,
-0.28491511940956116,
0.07824356853961945,
0.3790150582790375,
0.4563569724559784,
-0.22445133328437805,
0.3795028030872345,
0.009220588952302933,
... |
func community_aton(community string) uint32 {
var sum uint32
var words []string
var w0 int
var w1 int
words = strings.Split(community, ":")
w0, _ = strconv.Atoi(words[0])
w1, _ = strconv.Atoi(words[1])
sum += uint32(w0) << 16
sum += uint32(w1)
return sum
} | [
0.895332932472229,
-1.3592109680175781,
0.4576893150806427,
-1.2053508758544922,
-0.3271736204624176,
-0.7360807061195374,
0.6367623805999756,
0.42161309719085693,
0.024843813851475716,
0.4869426488876343,
-0.7809358835220337,
-0.11000464856624603,
-0.4549556374549866,
-0.9899170994758606,... |
func add_cidr_mask(addr string) string {
if strings.Contains(addr, "/") {
return addr
}
if strings.Contains(addr, ":") {
return addr + "/128"
} else {
return addr + "/32"
}
} | [
-0.06820504367351532,
-0.13596844673156738,
0.6633829474449158,
-0.12389784306287766,
-0.1831478774547577,
0.5147593021392822,
-0.4629618227481842,
-0.17095573246479034,
1.1179232597351074,
0.09168819338083267,
0.6653935313224792,
-0.41962331533432007,
-0.3408745229244232,
-0.6082093119621... |
func PropertyHandler(csvctx Context, ss []string, lineno int) []error {
var p db.Property
var errlist []error
var u uint64
for i := 0; i < len(csvctx.Order); i++ {
if csvctx.Order[i] < 0 {
continue // don't try to handle it if we didn't find it
}
switch i {
case PRName:
p.Name = ss[csvctx.Order[PRNam... | [
0.0318937711417675,
-0.6728276014328003,
0.5565109252929688,
0.44058406352996826,
-0.22092844545841217,
0.10786784440279007,
-0.288756400346756,
0.11531141400337219,
0.3442189693450928,
-0.03283652663230896,
0.1839851289987564,
-0.17439135909080505,
-0.1295667290687561,
0.04440268129110336... |
func HandleRenewOptions(s string, lineno int, errlist []error) ([]db.RenewOption, []error) {
var RO []db.RenewOption
var ntuple = 2 // 3 items per entry: x, opt, amount
ss := strings.Split(s, ";")
lss := len(ss)
if lss < ntuple {
return RO, errlist
}
if len(ss)%ntuple != 0 {
errlist = append(errlist, fmt.Er... | [
0.10930255800485611,
0.12528406083583832,
1.1062886714935303,
0.5224910974502563,
0.3813468813896179,
-0.7736262679100037,
0.0952066108584404,
0.3655344247817993,
-0.5037770867347717,
0.4262535870075226,
-0.21016350388526917,
-0.5406165719032288,
-0.13920708000659943,
1.023468255996704,
... |
func HandleRentSteps(s string, lineno int, errlist []error) ([]db.RentStep, []error) {
var RS []db.RentStep
var ntuple = 2 // 2 items per entry: x, amount
ss := strings.Split(s, ";")
lss := len(ss)
if lss < ntuple {
return RS, errlist
}
if len(ss)%ntuple != 0 {
errlist = append(errlist, fmt.Errorf("argument... | [
0.20760151743888855,
-0.1606048345565796,
1.0685526132583618,
0.6850596070289612,
0.4456847608089447,
-0.3491576015949249,
0.25391411781311035,
0.2771659791469574,
-0.46884065866470337,
0.21274539828300476,
-0.040633272379636765,
-0.8433272838592529,
-0.01483148243278265,
1.671351194381713... |
func ImportPropertyFile(ctx context.Context, fname string) []error {
return ReadPropertyFile(ctx, fname, PropertyHandler)
} | [
0.3786606788635254,
-0.9950505495071411,
0.682693600654602,
1.0659464597702026,
-0.15271002054214478,
1.1368296146392822,
0.8350961208343506,
0.258503794670105,
-0.5537747144699097,
0.6869646906852722,
-0.1986815631389618,
-0.6811282634735107,
-0.44677862524986267,
-0.9220403432846069,
-... |
func (pipeline *Pipeline) startAndStitchTerminationMonitor(lastTerminateCallbackOut terminationRqRsChan, startWg *sync.WaitGroup) {
pipeline.logStarted(terminationMonitorName, 1)
startWg.Done()
go func() {
defer func() {
pipeline.logTerminated(terminationMonitorName, 1)
pipeline.logTerminated(pipelineName,... | [
-0.0675572007894516,
-0.8651043176651001,
0.34503400325775146,
-0.23921756446361542,
0.2002093344926834,
-0.708285927772522,
0.10848747193813324,
-0.20522059500217438,
-0.049439504742622375,
-0.2558037340641022,
-0.8834701776504517,
-0.05648477375507355,
0.754030168056488,
0.85983639955520... |
func eventLimiter(n int) CPULookupFunc {
lim := 0
return func(ev *trace.Event) ([]CPUID, error) {
cpus, err := UnclippedReportingCPU(ev)
if err == nil && len(cpus) > 0 {
lim++
if lim > n {
return nil, nil
}
}
if err != nil {
return nil, err
}
return cpus, nil
}
} | [
0.23175591230392456,
0.4151268005371094,
0.7222737669944763,
-0.022074544802308083,
-1.2962098121643066,
-0.24280577898025513,
0.07135304808616638,
-0.30181384086608887,
0.4910567104816437,
0.507696270942688,
0.21436834335327148,
-0.5238016843795776,
-0.02728210762143135,
0.347759038209915... |
func Sum(a, b int) int {
return a + b
} | [
-0.5762045383453369,
0.02178630232810974,
0.3101651966571808,
-0.20323531329631805,
-0.31054383516311646,
0.30108365416526794,
0.1518186628818512,
-0.8505846261978149,
-0.20721423625946045,
0.35128718614578247,
-0.6759732365608215,
1.0479425191879272,
-0.23422706127166748,
-0.7945964336395... |
func Run(h *C.char, port, threadCount, msize, listenQueue C.int,
readyToConnect *C.PyObject, beforeTest *C.PyObject,
afterTest *C.PyObject) *C.PyObject {
host := C.GoString(h)
fmt.Printf("host %s port %d th_count %d msize %d listen_queue %d",
host,
port,
threadCount,
msize,
listenQueue)
var args *C.Py... | [
-0.010316002182662487,
-0.6027532815933228,
0.6947116851806641,
-0.5072209239006042,
-0.4058338403701782,
-0.058624543249607086,
0.5615734457969666,
-0.29381558299064636,
-0.5486243367195129,
0.023034444078803062,
-1.1009379625320435,
0.2974686920642853,
-0.8598378896713257,
0.136719316244... |
func CreateUser(w http.ResponseWriter, r *http.Request) {
u := User{}
err := json.NewDecoder(r.Body).Decode(&u)
if err != nil {
http.Error(w, http.StatusText(500), http.StatusInternalServerError)
fmt.Println(err)
return
}
err = SaveUser(u.FullName, u.NickName, u.Email, u.Balance)
if err != nil {
http.E... | [
-0.7774578332901001,
-0.37835344672203064,
0.9186842441558838,
0.5123414397239685,
0.31927067041397095,
0.5367564558982849,
0.24636821448802948,
-0.490652859210968,
0.3909827768802643,
0.3246671259403229,
-0.7854731678962708,
-0.9645799994468689,
-0.48344916105270386,
0.4552971124649048,
... |
func FetchUsers(w http.ResponseWriter, r *http.Request) {
items, err := AllUsers()
if err != nil {
http.Error(w, http.StatusText(500), http.StatusInternalServerError)
return
}
json.NewEncoder(w).Encode(items)
} | [
-0.7637797594070435,
-0.7692326307296753,
0.37866267561912537,
0.6351258754730225,
-1.133396029472351,
0.32521453499794006,
-0.5350590944290161,
-0.1451302021741867,
0.0010347911156713963,
0.9057596325874329,
0.15566781163215637,
0.8072879910469055,
0.362790048122406,
1.085585355758667,
... |
func FetchUserByID(w http.ResponseWriter, r *http.Request) {
v := mux.Vars(r)
id := v["user_id"]
u, err := UserByID(id)
if err != nil {
http.Error(w, http.StatusText(500), http.StatusInternalServerError)
return
}
json.NewEncoder(w).Encode(u)
} | [
-0.017445070669054985,
-0.8898817896842957,
0.41543230414390564,
0.9427899122238159,
-0.9374487400054932,
0.01792910508811474,
0.05491238832473755,
-1.4906530380249023,
0.21146324276924133,
0.7481896281242371,
-0.39756178855895996,
0.4794206917285919,
0.4347427785396576,
1.3139655590057373... |
func NewSessionManager(conn redis.Conn) *sessionManager {
return &sessionManager{
redisConn: conn,
}
} | [
-0.6620482802391052,
-1.0966978073120117,
0.09668046236038208,
0.10286936163902283,
-0.662070095539093,
-1.1202906370162964,
-1.575415015220642,
-0.6652581095695496,
1.1983706951141357,
-0.36367055773735046,
-1.0056076049804688,
0.08560408651828766,
-0.24944056570529938,
1.5575710535049438... |
func (a *Auth) Token(w http.ResponseWriter, r *http.Request) {
defer a.log.Println("Auth token generated")
var sig string
var err error
// generate jwt token with expiry date
method := jwt.GetSigningMethod("RS256")
keyContents, err := ioutil.ReadFile("./private.pem")
if err != nil {
a.log.Println("Error readin... | [
-1.3638612031936646,
-0.6217990517616272,
0.7200610041618347,
-0.5387041568756104,
-0.6387430429458618,
-0.22278021275997162,
0.45029181241989136,
0.1762693226337433,
-0.1411367654800415,
-0.5468865036964417,
-1.2844940423965454,
0.2729547619819641,
0.917296290397644,
0.4853420853614807,
... |
func (o *CreateMoveTaskOrderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 201:
result := NewCreateMoveTaskOrderCreated()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
retur... | [
-0.5877980589866638,
-0.177768737077713,
0.9926990866661072,
0.6509218215942383,
-0.2744757831096649,
-0.5865978002548218,
0.4429640769958496,
-0.7308969497680664,
-0.06906384974718094,
1.1621118783950806,
-0.20726706087589264,
-0.6942590475082397,
-0.46403542160987854,
0.5442795157432556,... |
func NewCreateMoveTaskOrderCreated() *CreateMoveTaskOrderCreated {
return &CreateMoveTaskOrderCreated{}
} | [
0.3876468539237976,
0.11003431677818298,
0.4478784203529358,
0.8814765810966492,
-0.15505407750606537,
0.24160659313201904,
0.39688023924827576,
-0.12085684388875961,
-1.0734707117080688,
0.32973286509513855,
-0.4453577697277069,
-1.0809965133666992,
0.18317732214927673,
1.0800223350524902... |
func (o *CreateMoveTaskOrderCreated) IsSuccess() bool {
return true
} | [
-0.04942125827074051,
0.25525522232055664,
0.3955119848251343,
1.5368998050689697,
-0.5308027267456055,
0.7230873107910156,
-0.23665013909339905,
0.28049448132514954,
-0.5706438422203064,
0.3881152272224426,
-0.8501613736152649,
-0.4516993761062622,
0.6447926759719849,
1.1601622104644775,
... |
func (o *CreateMoveTaskOrderCreated) IsRedirect() bool {
return false
} | [
-0.14981785416603088,
0.17985579371452332,
0.4847966432571411,
1.4402011632919312,
-0.2465774118900299,
1.0646836757659912,
0.289852112531662,
-0.23444044589996338,
0.070576511323452,
-0.1877676099538803,
-0.3985414505004883,
-0.3500141501426697,
-0.19143927097320557,
0.8397619128227234,
... |
func (o *CreateMoveTaskOrderCreated) IsCode(code int) bool {
return code == 201
} | [
-0.30519241094589233,
0.12953461706638336,
0.25838616490364075,
1.296210765838623,
-0.24403594434261322,
0.34000587463378906,
-0.3955930769443512,
-0.1175699383020401,
-0.08062943071126938,
0.44446083903312683,
-0.13610556721687317,
-0.6750909686088562,
0.08510154485702515,
1.1809319257736... |
func (o *CreateMoveTaskOrderCreated) Code() int {
return 201
} | [
-0.6624076962471008,
0.2926214337348938,
0.2856171429157257,
1.390916109085083,
-0.35289838910102844,
0.17228074371814728,
0.4080720543861389,
0.09818579256534576,
-0.6786160469055176,
0.06680361181497574,
-0.3161982595920563,
-0.44515901803970337,
1.0576800107955933,
1.2608177661895752,
... |
func NewCreateMoveTaskOrderBadRequest() *CreateMoveTaskOrderBadRequest {
return &CreateMoveTaskOrderBadRequest{}
} | [
-0.5898579955101013,
-0.1500389575958252,
0.6186802387237549,
1.0361089706420898,
-0.5804781317710876,
-0.23619894683361053,
-0.2686482071876526,
0.09022035449743271,
-1.4439064264297485,
0.4049062728881836,
-0.4101937413215637,
0.16371972858905792,
-0.09095289558172226,
1.4589847326278687... |
func (o *CreateMoveTaskOrderBadRequest) IsSuccess() bool {
return false
} | [
-1.2343984842300415,
0.1981453001499176,
0.5610526204109192,
1.8185789585113525,
-0.15493735671043396,
0.5200263857841492,
-0.6257448792457581,
-0.16100481152534485,
-0.6294704079627991,
0.46476516127586365,
-0.4920675456523895,
0.09445301443338394,
-0.053852345794439316,
1.266499519348144... |
func (o *CreateMoveTaskOrderBadRequest) IsRedirect() bool {
return false
} | [
-1.266635775566101,
0.11422797292470932,
0.580787181854248,
1.7129894495010376,
-0.14800776541233063,
0.6106547713279724,
-0.2553066611289978,
-0.6392603516578674,
-0.0034844346810132265,
-0.09108474850654602,
-0.0685420036315918,
0.13382263481616974,
-0.4929209053516388,
0.938169598579406... |
func (o *CreateMoveTaskOrderBadRequest) IsCode(code int) bool {
return code == 400
} | [
-1.196156620979309,
0.2747804820537567,
0.5247596502304077,
1.129932165145874,
0.3167502284049988,
0.11186392605304718,
-1.0496735572814941,
-0.3210316002368927,
-0.3013121485710144,
0.6079379320144653,
-0.23638984560966492,
0.33331918716430664,
-0.6929123401641846,
1.4466215372085571,
-... |
func (o *CreateMoveTaskOrderBadRequest) Code() int {
return 400
} | [
-1.4264436960220337,
0.1094195619225502,
0.5814429521560669,
1.098591923713684,
0.018061796203255653,
-0.07351893931627274,
-0.35563957691192627,
-0.004495055880397558,
-0.7675421237945557,
0.3615497648715973,
-0.18504655361175537,
0.21409818530082703,
0.38623976707458496,
1.59934425354003... |
func NewCreateMoveTaskOrderUnauthorized() *CreateMoveTaskOrderUnauthorized {
return &CreateMoveTaskOrderUnauthorized{}
} | [
-0.5163819789886475,
-0.10104567557573318,
0.5405914783477783,
0.9300973415374756,
-0.8305399417877197,
0.17016950249671936,
0.018634315580129623,
0.5034383535385132,
-0.8609795570373535,
-0.009620841592550278,
-0.7997874617576599,
0.662958562374115,
0.14116817712783813,
0.6930212378501892... |
func (o *CreateMoveTaskOrderUnauthorized) IsSuccess() bool {
return false
} | [
-0.8258970379829407,
0.43656253814697266,
0.4635360836982727,
1.6331199407577515,
-0.6425610780715942,
0.6736662983894348,
-0.2412588745355606,
0.4505205750465393,
-0.17221632599830627,
0.23560769855976105,
-0.8223234415054321,
0.6465420126914978,
0.3239158093929291,
0.4863833785057068,
... |
func (o *CreateMoveTaskOrderUnauthorized) IsRedirect() bool {
return false
} | [
-0.7579842209815979,
0.40469327569007874,
0.4935201108455658,
1.7070114612579346,
-0.5148766040802002,
0.7172022461891174,
0.07593055814504623,
0.0029268478974699974,
0.2532287836074829,
-0.2955733835697174,
-0.26068583130836487,
0.6511330008506775,
-0.3218936622142792,
0.350364625453949,
... |
func (o *CreateMoveTaskOrderUnauthorized) IsCode(code int) bool {
return code == 401
} | [
-1.0324457883834839,
0.22193299233913422,
0.39112797379493713,
0.9967489242553711,
-0.4023530185222626,
0.27701932191848755,
-0.37535253167152405,
0.23898646235466003,
0.25728175044059753,
0.11890795826911926,
-0.25214165449142456,
0.6839355230331421,
-0.2822585999965668,
0.709786772727966... |
func (o *CreateMoveTaskOrderUnauthorized) Code() int {
return 401
} | [
-1.1930327415466309,
0.2711136043071747,
0.4102064371109009,
1.1654846668243408,
-0.7014749050140381,
0.12481825053691864,
0.3852001130580902,
0.5378893613815308,
-0.5045469999313354,
-0.14891773462295532,
-0.2323751449584961,
0.6217697858810425,
0.7352577447891235,
0.5903303027153015,
0... |
func NewCreateMoveTaskOrderForbidden() *CreateMoveTaskOrderForbidden {
return &CreateMoveTaskOrderForbidden{}
} | [
0.22683195769786835,
0.6122123003005981,
0.4750034511089325,
1.3845843076705933,
-0.6764984726905823,
0.3637140691280365,
0.46257051825523376,
-0.6365169882774353,
-1.1734131574630737,
0.025744149461388588,
-0.6618502736091614,
0.15791957080364227,
-0.11400838941335678,
0.44838935136795044... |
func (o *CreateMoveTaskOrderForbidden) IsSuccess() bool {
return false
} | [
-0.15575456619262695,
0.9923527836799622,
0.5773891806602478,
1.7364702224731445,
-0.7027931213378906,
0.8387194275856018,
0.11018749326467514,
-0.620733916759491,
-0.44888538122177124,
0.3680589497089386,
-0.5779075026512146,
0.2699338495731354,
-0.13126061856746674,
0.42680859565734863,
... |
func (o *CreateMoveTaskOrderForbidden) IsRedirect() bool {
return false
} | [
-0.13281957805156708,
1.0324318408966064,
0.49746471643447876,
1.9485094547271729,
-0.685427188873291,
1.0182244777679443,
0.44581547379493713,
-0.821291446685791,
-0.01640387438237667,
-0.16523884236812592,
-0.06876067072153091,
0.3639068901538849,
-0.5266937017440796,
0.48550939559936523... |
func (o *CreateMoveTaskOrderForbidden) IsCode(code int) bool {
return code == 403
} | [
-0.14962860941886902,
0.8881461024284363,
0.4449896812438965,
1.0766955614089966,
-0.21583211421966553,
0.41619592905044556,
0.18077649176120758,
-0.8109267354011536,
-0.2947075068950653,
0.5692200064659119,
-0.005055342335253954,
0.3808613717556,
-0.6669202446937561,
0.7897343039512634,
... |
func (o *CreateMoveTaskOrderForbidden) Code() int {
return 403
} | [
-0.47994738817214966,
1.1087638139724731,
0.44306597113609314,
1.1737078428268433,
-0.5012632012367249,
0.4538286626338959,
1.0697911977767944,
-0.5052745938301086,
-0.8662369847297668,
0.31606659293174744,
-0.17511574923992157,
0.1607198268175125,
0.2576160430908203,
0.7368888854980469,
... |
func NewCreateMoveTaskOrderNotFound() *CreateMoveTaskOrderNotFound {
return &CreateMoveTaskOrderNotFound{}
} | [
-0.32269197702407837,
-0.6904011964797974,
0.16320860385894775,
0.1793457716703415,
-0.09294875711202621,
0.4944460093975067,
0.4710162580013275,
-0.2940126061439514,
-0.8388048410415649,
0.2178967297077179,
-1.159277319908142,
-0.06239129230380058,
0.2476491779088974,
1.2069438695907593,
... |
func (o *CreateMoveTaskOrderNotFound) IsSuccess() bool {
return false
} | [
-0.6989187598228455,
-0.1398032158613205,
0.31240102648735046,
1.2035081386566162,
-0.03982851281762123,
0.7164247632026672,
0.16545884311199188,
-0.33508485555648804,
-0.07543577998876572,
0.3806414008140564,
-1.257781982421875,
-0.08643756806850433,
0.31826868653297424,
0.903860569000244... |
func (o *CreateMoveTaskOrderNotFound) IsRedirect() bool {
return false
} | [
-0.8555157780647278,
-0.12067392468452454,
0.311808705329895,
1.2233929634094238,
0.019796326756477356,
0.8430516123771667,
0.40817904472351074,
-0.8084831237792969,
0.4766855537891388,
-0.23462821543216705,
-0.6726577281951904,
-0.04212217032909393,
-0.26470494270324707,
0.950118303298950... |
func (o *CreateMoveTaskOrderNotFound) IsCode(code int) bool {
return code == 404
} | [
-0.9107246994972229,
0.03343362361192703,
0.2269214689731598,
0.6426347494125366,
0.5561674237251282,
0.5850061178207397,
0.1820092350244522,
-0.47025227546691895,
0.3436683714389801,
0.35102203488349915,
-0.6798169612884521,
-0.07137119770050049,
-0.5952473282814026,
1.1664990186691284,
... |
func (o *CreateMoveTaskOrderNotFound) Code() int {
return 404
} | [
-1.1817423105239868,
0.19215530157089233,
0.3484621047973633,
0.6113621592521667,
0.3485511243343353,
0.5198067426681519,
1.0781642198562622,
-0.161049947142601,
-0.46794643998146057,
0.3166315257549286,
-0.7751184701919556,
-0.1317664384841919,
0.561069130897522,
1.1983425617218018,
0.0... |
func NewCreateMoveTaskOrderUnprocessableEntity() *CreateMoveTaskOrderUnprocessableEntity {
return &CreateMoveTaskOrderUnprocessableEntity{}
} | [
0.018524032086133957,
-0.07126165181398392,
0.6697909235954285,
0.2736772298812866,
-0.7373535633087158,
0.08489137887954712,
0.23873227834701538,
0.49804702401161194,
-1.4662742614746094,
0.784372091293335,
-0.6674726009368896,
-0.44159793853759766,
-0.1897718757390976,
0.3786121308803558... |
func (o *CreateMoveTaskOrderUnprocessableEntity) IsSuccess() bool {
return false
} | [
-0.6530003547668457,
0.4643910527229309,
0.5935733914375305,
0.9680437445640564,
-0.32805925607681274,
0.6272937059402466,
-0.32534727454185486,
0.32854729890823364,
-0.8757661581039429,
0.973702073097229,
-0.6389835476875305,
-0.4508921802043915,
0.17349690198898315,
0.6394304037094116,
... |
func (o *CreateMoveTaskOrderUnprocessableEntity) IsRedirect() bool {
return false
} | [
-0.5306186079978943,
0.43967530131340027,
0.6827462911605835,
0.8031783103942871,
-0.2474069744348526,
0.5865199565887451,
0.0675051212310791,
-0.2489606887102127,
-0.24359074234962463,
0.3058599531650543,
-0.14375576376914978,
-0.2798423767089844,
-0.47139766812324524,
0.6476098895072937,... |
func (o *CreateMoveTaskOrderUnprocessableEntity) IsCode(code int) bool {
return code == 422
} | [
-0.90736985206604,
0.0940992534160614,
0.6418021321296692,
0.4989255368709564,
-0.18760457634925842,
-0.18282081186771393,
-0.4050336480140686,
-0.045561037957668304,
-0.6489548087120056,
0.5933182835578918,
-0.4756123721599579,
0.06932327896356583,
-0.2808205783367157,
0.8065865635871887,... |
func (o *CreateMoveTaskOrderUnprocessableEntity) Code() int {
return 422
} | [
-1.1075108051300049,
0.32504698634147644,
0.5573973655700684,
0.46305423974990845,
-0.46740496158599854,
-0.1345643550157547,
0.3094094395637512,
0.26008838415145874,
-1.2163050174713135,
0.548175573348999,
-0.3258497714996338,
0.0007569423178210855,
0.5473673939704895,
1.0222053527832031,... |
func (o *CreateMoveTaskOrderInternalServerError) IsSuccess() bool {
return false
} | [
-0.9899389743804932,
0.2827187180519104,
0.4338170886039734,
1.0925992727279663,
-0.896375834941864,
0.7220892906188965,
0.40683749318122864,
0.06981270015239716,
-0.11027643829584122,
0.376340389251709,
-0.5559202432632446,
0.44984692335128784,
-0.19533085823059082,
1.1970185041427612,
... |
func (o *CreateMoveTaskOrderInternalServerError) IsRedirect() bool {
return false
} | [
-1.0631146430969238,
0.3270179331302643,
0.49342215061187744,
0.8670685887336731,
-0.85570228099823,
0.7878510355949402,
0.5831816792488098,
-0.47793594002723694,
0.5147917866706848,
-0.09648521989583969,
-0.012142026796936989,
0.5981361269950867,
-0.8067315816879272,
0.8903589248657227,
... |
func (o *CreateMoveTaskOrderInternalServerError) IsCode(code int) bool {
return code == 500
} | [
-1.2981877326965332,
0.3410703241825104,
0.3940984606742859,
0.5229934453964233,
-0.6050825715065002,
0.43274083733558655,
0.4046888053417206,
-0.24767795205116272,
0.37669384479522705,
0.8741949200630188,
-0.08409559726715088,
0.6531167030334473,
-0.9949027895927429,
1.5310730934143066,
... |
func (o *CreateMoveTaskOrderInternalServerError) Code() int {
return 500
} | [
-1.439213752746582,
0.3846181035041809,
0.3348982334136963,
0.6328718066215515,
-0.8772395253181458,
0.45095592737197876,
0.877532422542572,
-0.20404812693595886,
-0.4253169000148773,
0.4207753539085388,
-0.04198122024536133,
0.5559550523757935,
0.09158656746149063,
1.6330009698867798,
0... |
func (m *LolClashTournament) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validatePhases(formats); err != nil {
res = append(res, err)
}
if err := m.validateRewardConfig(formats); err != nil {
res = append(res, err)
}
if err := m.validateStatus(formats); err != nil {
res = append... | [
0.7807159423828125,
-0.1943703591823578,
0.49066853523254395,
-0.8998206853866577,
-0.17414551973342896,
0.22749711573123932,
0.2530052661895752,
-0.06573707610368729,
-0.08177325874567032,
-0.18386222422122955,
-0.13538925349712372,
0.4790191650390625,
-0.5046165585517883,
-0.003007050137... |
func handleInterruption(ctx context.Context) context.Context {
ctx, cancel := context.WithCancel(ctx)
signalC := make(chan os.Signal)
signal.Notify(signalC, os.Interrupt)
go func() {
<-signalC
cancel()
<-signalC
os.Exit(1)
}()
return ctx
} | [
0.875280499458313,
-0.04563860967755318,
0.606697142124176,
0.4047437310218811,
0.218394473195076,
0.6568039655685425,
0.4613744616508484,
0.5661922693252563,
0.16099368035793304,
0.19932982325553894,
0.47098684310913086,
-1.4757038354873657,
-0.6325508952140808,
-0.34920695424079895,
0.... |
func logAnnotatedErr(ctx context.Context, err error) {
if err == nil {
return
}
log.Errorf(ctx, "Annotated error stack:\n%s",
strings.Join(errors.RenderStack(err), "\n"))
} | [
0.719726026058197,
-0.1067926213145256,
0.3354494273662567,
-0.748375654220581,
-0.11939921975135803,
0.21090085804462433,
-0.7887188196182251,
-0.1624125838279724,
0.48913803696632385,
-0.15903149545192719,
-0.422238826751709,
0.7521450519561768,
0.589887261390686,
1.404356598854065,
0.... |
func infraFailure(err error) *build.InfraFailure {
failure := &build.InfraFailure{
Text: err.Error(),
}
if errors.Unwrap(err) == context.Canceled {
failure.Type = build.InfraFailure_CANCELED
} else {
failure.Type = build.InfraFailure_BOOTSTRAPPER_ERROR
failure.BootstrapperCallStack = errors.RenderStack(err)... | [
-0.42052626609802246,
-0.13797441124916077,
0.2705414891242981,
0.8678769469261169,
-0.8582983613014221,
-0.5611511468887329,
0.2519713044166565,
-0.10505928099155426,
0.403950959444046,
-0.6911926865577698,
-0.027346638962626457,
0.043973661959171295,
-0.8982734680175781,
0.26471889019012... |
func ContainerOfRevisionSpec(revisionSpec *servingv1.RevisionSpec) *corev1.Container {
idx := ContainerIndexOfRevisionSpec(revisionSpec)
if idx == -1 {
return nil
}
return &revisionSpec.Containers[0]
} | [
0.41703659296035767,
-0.17022375762462616,
0.3149709701538086,
-0.7210493087768555,
0.03424244746565819,
-1.1481953859329224,
0.3465539515018463,
-0.8311225175857544,
0.6823163628578186,
0.07630379498004913,
1.1110011339187622,
0.6281030774116516,
0.4503902494907379,
0.44516870379447937,
... |
func ContainerIndexOfRevisionSpec(revisionSpec *servingv1.RevisionSpec) int {
switch {
case len(revisionSpec.Containers) == 1:
return 0
case len(revisionSpec.Containers) > 1:
for i := range revisionSpec.Containers {
if len(revisionSpec.Containers[i].Ports) != 0 {
return i
}
}
}
return -1
} | [
-0.01436964888125658,
-0.04686133190989494,
0.7514522671699524,
-0.6643322110176086,
0.06200775131583214,
-0.6885791420936584,
0.7091950178146362,
0.17572222650051117,
0.1679006665945053,
-0.01059083640575409,
0.4915931522846222,
0.630005955696106,
0.052716873586177826,
0.06165303289890289... |
func ContainerStatus(r *servingv1.Revision) *servingv1.ContainerStatus {
idx := ContainerIndexOfRevisionSpec(&r.Spec)
if idx < 0 || idx >= len(r.Status.ContainerStatuses) {
return nil
}
return &r.Status.ContainerStatuses[idx]
} | [
0.40907764434814453,
-0.6319937109947205,
0.3044637143611908,
-0.8368273973464966,
-0.1314084231853485,
-0.7892351746559143,
-0.25539931654930115,
-0.31418168544769287,
0.7475081086158752,
0.026092305779457092,
0.4451841115951538,
0.7288779020309448,
0.21781544387340546,
0.0001605955185368... |
func NewChoice(allowedValues ...string) Choice {
return Choice{AllowedValues: allowedValues}
} | [
-0.1106276735663414,
-0.32851362228393555,
0.13814012706279755,
0.7290703058242798,
-1.0566203594207764,
0.8528363108634949,
-0.8410755395889282,
-0.3706643283367157,
-0.05269504711031914,
-0.01828303001821041,
0.7966280579566956,
0.9014704823493958,
-0.6569210290908813,
-0.358272492885589... |
func (cv Choice) WithDefault(value string) Choice {
cv.Set(value)
return cv
} | [
0.30711087584495544,
-0.5767248272895813,
0.25425100326538086,
0.2910545766353607,
0.39725229144096375,
0.22216811776161194,
-0.21489101648330688,
-0.849399983882904,
1.0996581315994263,
0.4062948524951935,
-0.5934723615646362,
-0.8919849991798401,
0.3937024176120758,
0.24238254129886627,
... |
func (cv *Choice) ValidValuesDescription() string {
return allowedValuesToDescription(cv.AllowedValues)
} | [
0.6300786137580872,
-0.3047401010990143,
0.1879548281431198,
-0.2634436786174774,
-0.26963523030281067,
1.0208358764648438,
-0.47945839166641235,
0.3724614381790161,
0.5749031901359558,
-0.023431511595845222,
0.7305904030799866,
0.7717711925506592,
-0.14725962281227112,
0.3776637613773346,... |
func (cv *Choice) String() string {
if cv.Choice != nil {
return *cv.Choice
}
return ""
} | [
-0.08181630820035934,
-0.5357993841171265,
0.23388907313346863,
0.45271655917167664,
0.39971473813056946,
0.4156586229801178,
0.567190945148468,
-1.6020723581314087,
0.7367364168167114,
0.7646217942237854,
-0.140060693025589,
-0.19891391694545746,
-0.12641315162181854,
-0.3348316550254822,... |
func (cv *Choice) Set(value string) error {
if indexof.String(cv.AllowedValues, value) == indexof.NotFound {
return fmt.Errorf(
"invalid flag value: %s, must be one of %s",
value,
strings.Join(cv.AllowedValues, ", "),
)
}
cv.Choice = &value
return nil
} | [
-0.43304356932640076,
-0.021868404000997543,
0.2256329357624054,
-0.08611466735601425,
-0.049787480384111404,
1.1016994714736938,
0.22553449869155884,
-0.4157298803329468,
-0.33876273036003113,
0.49501630663871765,
-0.10412469506263733,
0.46605923771858215,
-0.2335154265165329,
0.169142335... |
func (f OptionFunc) Apply(ratelimiter Ratelimiter) error {
return f(ratelimiter)
} | [
1.0326192378997803,
0.5992492437362671,
0.3109929859638214,
0.6505774259567261,
-0.22354906797409058,
0.32774460315704346,
-0.076043039560318,
0.5845387578010559,
0.2902739942073822,
0.4442775249481201,
0.10381531715393066,
0.1474267840385437,
0.22313876450061798,
-0.07832249253988266,
-... |
func RunFromHook(db gorp.SqlExecutor, w *sdk.Workflow, e *sdk.WorkflowNodeRunHookEvent) (*sdk.WorkflowRun, error) {
return nil, nil
} | [
0.09890913218259811,
-0.10320574790239334,
0.4273320734500885,
-0.062326982617378235,
0.525805652141571,
0.18976899981498718,
0.05862791836261749,
-0.042127083986997604,
-0.25871285796165466,
-0.05553333833813667,
0.007681386079639196,
0.21221956610679626,
-0.11153089255094528,
1.117194175... |
func ManualRunFromNode(db gorp.SqlExecutor, w *sdk.Workflow, number int64, e *sdk.WorkflowNodeRunManual, nodeID int64) (*sdk.WorkflowRun, error) {
lastWorkflowRun, err := LoadRun(db, w.ProjectKey, w.Name, number)
if err != nil {
return nil, sdk.WrapError(err, "ManualRunFromNode> Unable to load last run")
}
if er... | [
-0.19478261470794678,
-0.10795845836400986,
0.3681873679161072,
-0.5530797243118286,
-0.012640368193387985,
-0.09329252690076828,
-0.5010574460029602,
-0.4854767918586731,
-0.3368178606033325,
-0.007602060213685036,
0.6464085578918457,
0.41001051664352417,
-0.7595832943916321,
0.7286323904... |
func ManualRun(db gorp.SqlExecutor, w *sdk.Workflow, e *sdk.WorkflowNodeRunManual) (*sdk.WorkflowRun, error) {
lastWorkflowRun, err := LoadLastRun(db, w.ProjectKey, w.Name)
if err != nil {
if err != sdk.ErrWorkflowNotFound {
return nil, sdk.WrapError(err, "ManualRun> Unable to load last run")
}
}
var number... | [
-0.5664570927619934,
0.1982908397912979,
0.5231940150260925,
-0.5608053803443909,
0.28632062673568726,
0.020102303475141525,
-0.25607097148895264,
0.17273283004760742,
-0.22009599208831787,
0.20855391025543213,
0.13490843772888184,
0.205377995967865,
-0.8166994452476501,
0.6345601081848145... |
func GetPostValues(res http.ResponseWriter, req * http.Request)(cmd usercmd.MsgType, values url.Values, uid uint64, ver int, ok bool){
qqttype, _ :=strconv.Atoi(req.Header.Get("qqt"))
switch qqttype {
case 2:
body := make([]byte, req.ContentLength)
blen, err := req.Body.Read(body)
if err != nil || blen < 8 {
... | [
-0.7492215633392334,
0.24544604122638702,
0.7044735550880432,
0.2917225658893585,
-0.2632696330547333,
0.3364042639732361,
-0.5219357013702393,
-0.6326652765274048,
-0.3895813226699829,
-0.7030150294303894,
-0.40396496653556824,
-0.11898472160100937,
-0.7538710236549377,
0.8950185775756836... |
func NewPopup(p tview.Primitive) *Popup {
_, _, width, height := p.GetRect()
popup := &Popup{
flex: tview.NewFlex().
AddItem(nil, 0, 1, false).
AddItem(tview.NewFlex().
SetDirection(tview.FlexRow).
AddItem(nil, 0, 1, false).
AddItem(p, height, 1, false).
AddItem(nil, 0, 1, false), width, 1, fa... | [
-0.48414719104766846,
0.19848927855491638,
0.7003142833709717,
-0.15200740098953247,
-1.1933716535568237,
-0.23160530626773834,
-0.15582585334777832,
0.1485726684331894,
0.5096608400344849,
0.09365974366664886,
0.2546231150627136,
-0.8029763698577881,
0.350778192281723,
-0.2899180054664612... |
func (s *IMService) CreateAutoMessage(ctx echo.Context) (err error) {
msg := &AutomaticMessage{}
if err = ctx.Bind(msg); err != nil {
return
}
if err = msg.validate(); err != nil {
return invalidParameterResp(ctx, err.Error())
}
autoMsg := &models.AutomaticMessage{
ID: common.GenUniqueID(),
Ch... | [
-0.46419015526771545,
-0.6951745748519897,
0.5819921493530273,
-0.2904796004295349,
0.0038397253956645727,
-0.045387789607048035,
-0.2278798222541809,
-0.9039435982704163,
-0.4240286946296692,
0.4346792697906494,
-0.637300968170166,
0.4023069739341736,
-1.2914680242538452,
1.40555429458618... |
func (s *IMService) UpdateAutoMessage(ctx echo.Context) (err error) {
msgID := ctx.Param("msg_id")
if msgID == "" {
return invalidParameterResp(ctx, "msg_id is empty")
}
msg := &AutomaticMessage{}
if err = ctx.Bind(msg); err != nil {
return
}
if err = msg.validate(); err != nil {
return invalidParameterR... | [
-0.579940915107727,
-0.6031296253204346,
0.5819941759109497,
-0.20981919765472412,
-0.5320876836776733,
-0.37276333570480347,
0.14851948618888855,
-0.42118769884109497,
-0.665390133857727,
0.7072675824165344,
-0.6383159160614014,
1.0759340524673462,
-1.4479162693023682,
1.0293594598770142,... |
func NewGetLinkInfoOK() *GetLinkInfoOK {
return &GetLinkInfoOK{}
} | [
0.5232573747634888,
-0.8295153975486755,
0.11911070346832275,
0.4776500165462494,
0.7041248679161072,
0.4284423589706421,
0.4803581237792969,
0.551652729511261,
-0.930708646774292,
-1.2118781805038452,
-0.4152650535106659,
-0.42438048124313354,
-0.3125689923763275,
-0.10145076364278793,
... |
func (o *GetLinkInfoOK) WithPayload(payload *GetLinkInfoOKBody) *GetLinkInfoOK {
o.Payload = payload
return o
} | [
0.6533135175704956,
-0.6816108226776123,
0.045385103672742844,
-0.17655351758003235,
0.7035572528839111,
0.2630541920661926,
0.057262808084487915,
-0.13639837503433228,
-0.025873150676488876,
-1.3287277221679688,
0.06237788125872612,
-0.37834781408309937,
-0.13797728717327118,
-0.158898741... |
func (o *GetLinkInfoOK) SetPayload(payload *GetLinkInfoOKBody) {
o.Payload = payload
} | [
0.27438557147979736,
-0.4238044023513794,
0.0746922567486763,
-0.18498878180980682,
0.7528693079948425,
0.26715782284736633,
0.1805422306060791,
-0.11110727488994598,
-0.19557702541351318,
-1.0944839715957642,
-0.0854286253452301,
-0.01620970107614994,
-0.6047455072402954,
0.36772567033767... |
func (o *GetLinkInfoOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(200)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
} | [
-0.41090092062950134,
-0.6946825385093689,
0.292440801858902,
0.2491615265607834,
1.1910558938980103,
-0.5424080491065979,
0.5517903566360474,
0.09451963007450104,
0.29645195603370667,
-0.4009280800819397,
0.41129106283187866,
-0.54289311170578,
-0.461922824382782,
-0.1383589208126068,
0... |
func NewGetLinkInfoBadRequest() *GetLinkInfoBadRequest {
return &GetLinkInfoBadRequest{}
} | [
-0.2893281877040863,
-0.7629101276397705,
0.32100921869277954,
0.5417050123214722,
0.9156038165092468,
-0.246137335896492,
-0.6329614520072937,
0.7315536141395569,
-0.6426755785942078,
-2.168828010559082,
-0.04571288079023361,
0.44369980692863464,
-0.7013519406318665,
0.24331575632095337,
... |
func (o *GetLinkInfoBadRequest) WithPayload(payload *models.Error) *GetLinkInfoBadRequest {
o.Payload = payload
return o
} | [
-0.43678683042526245,
-0.5548267960548401,
0.19951753318309784,
0.163127139210701,
0.8634046316146851,
-0.35328757762908936,
-0.9403423070907593,
-0.15369075536727905,
-0.00037854627589695156,
-2.1508772373199463,
0.7453262209892273,
0.10493540018796921,
-0.2810063064098358,
0.301334112882... |
func (o *GetLinkInfoBadRequest) SetPayload(payload *models.Error) {
o.Payload = payload
} | [
-0.7574032545089722,
-0.19215011596679688,
0.18409466743469238,
0.0729859247803688,
1.0089963674545288,
-0.36006495356559753,
-0.7961589097976685,
0.040732111781835556,
-0.33250319957733154,
-1.6494848728179932,
0.3111840486526489,
0.6629288196563721,
-0.683414101600647,
0.4853973984718323... |
func (o *GetLinkInfoBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(400)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
} | [
-0.7885680198669434,
-0.6321327090263367,
0.48992919921875,
0.4622398316860199,
1.3868722915649414,
-0.5962544679641724,
-0.28980347514152527,
-0.21783465147018433,
0.2331061065196991,
-1.1333119869232178,
0.5568992495536804,
0.021258722990751266,
-0.49947771430015564,
-0.08833672851324081... |
func NewGetLinkInfoNotFound() *GetLinkInfoNotFound {
return &GetLinkInfoNotFound{}
} | [
0.17802126705646515,
-1.4489436149597168,
0.04147651046514511,
0.1071847602725029,
0.8128681778907776,
1.0899276733398438,
0.17179696261882782,
0.31898024678230286,
-0.48250851035118103,
-1.9018536806106567,
-0.3518378734588623,
0.5465221405029297,
-0.6740409135818481,
0.0730171948671341,
... |
func (o *GetLinkInfoNotFound) WithPayload(payload *models.Error) *GetLinkInfoNotFound {
o.Payload = payload
return o
} | [
-0.09262821078300476,
-0.899691641330719,
-0.1304013878107071,
-0.48012253642082214,
0.9041587710380554,
0.46558597683906555,
-0.09444940835237503,
-0.205100879073143,
-0.011877736076712608,
-1.8994468450546265,
0.27783074975013733,
0.04239637404680252,
-0.25990450382232666,
0.197957322001... |
func (o *GetLinkInfoNotFound) SetPayload(payload *models.Error) {
o.Payload = payload
} | [
-0.46693339943885803,
-0.4980047047138214,
-0.01524959784001112,
-0.4386291205883026,
1.0232176780700684,
0.37772679328918457,
0.014421891421079636,
0.06361135840415955,
-0.18598777055740356,
-1.3841736316680908,
-0.18935328722000122,
0.4679814279079437,
-0.5511759519577026,
0.467545121908... |
func (o *GetLinkInfoNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(404)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
} | [
-0.9416313171386719,
-0.7131144404411316,
0.22290584444999695,
0.16711759567260742,
1.5862458944320679,
-0.31398266553878784,
0.5455482006072998,
0.007152081932872534,
0.22809159755706787,
-0.6244621276855469,
0.35165926814079285,
-0.22212980687618256,
-0.36588120460510254,
-0.112322866916... |
func NewResourceQuotaManager(kubeClient client.Interface) *ResourceQuotaManager {
rm := &ResourceQuotaManager{
kubeClient: kubeClient,
}
// set the synchronization handler
rm.syncHandler = rm.syncResourceQuota
return rm
} | [
0.0015999585157260299,
-0.7458032369613647,
0.1614542007446289,
-0.20471663773059845,
-0.8210944533348083,
-0.18467961251735687,
-0.31598490476608276,
-0.4488316476345062,
-0.37574490904808044,
0.04472459480166435,
-0.4913717806339264,
0.011608169414103031,
-0.3191511332988739,
0.485990762... |
func (rm *ResourceQuotaManager) Run(period time.Duration) {
rm.syncTime = time.Tick(period)
go util.Forever(func() { rm.synchronize() }, period)
} | [
-0.5388850569725037,
-0.23181088268756866,
0.33910539746284485,
-0.04660692438483238,
0.2803613245487213,
0.42078697681427,
0.440365195274353,
-0.6446408629417419,
-0.7084215879440308,
0.08429914712905884,
-0.3766176402568817,
0.3540855050086975,
0.049476101994514465,
0.4015893042087555,
... |
func (rm *ResourceQuotaManager) syncResourceQuota(quota api.ResourceQuota) (err error) {
// dirty tracks if the usage status differs from the previous sync,
// if so, we send a new usage with latest status
// if this is our first sync, it will be dirty by default, since we need track usage
dirty := quota.Status.Ha... | [
-0.13911212980747223,
-1.1147280931472778,
0.752933919429779,
-0.0038953747134655714,
-0.01753418706357479,
-0.46568578481674194,
-0.10912609100341797,
-0.6748431324958801,
-0.6345762014389038,
1.1806691884994507,
0.10605522990226746,
0.4647543430328369,
0.9611236453056335,
0.9632347822189... |
func PodCPU(pod *api.Pod) *resource.Quantity {
val := int64(0)
for j := range pod.Spec.Containers {
val = val + pod.Spec.Containers[j].Resources.Limits.Cpu().MilliValue()
}
return resource.NewMilliQuantity(int64(val), resource.DecimalSI)
} | [
-0.012798198498785496,
-0.12545180320739746,
0.5920535326004028,
-0.4876652956008911,
0.24782629311084747,
-0.12560078501701355,
-0.3159467577934265,
-0.21282683312892914,
0.2378893941640854,
-0.18774595856666565,
0.01365763321518898,
0.021679049357771873,
-0.8109368681907654,
-0.282109737... |
func PodMemory(pod *api.Pod) *resource.Quantity {
val := int64(0)
for j := range pod.Spec.Containers {
val = val + pod.Spec.Containers[j].Resources.Limits.Memory().Value()
}
return resource.NewQuantity(int64(val), resource.DecimalSI)
} | [
-0.512420654296875,
-0.7341787815093994,
0.4170352518558502,
-0.9402871131896973,
0.18845592439174652,
-0.2995253801345825,
-0.49300456047058105,
-0.9395509958267212,
0.8020104765892029,
0.1106596440076828,
-0.28944259881973267,
-0.1205001100897789,
-0.31135061383247375,
-0.609615385532379... |
func PrintVersion() {
fmt.Println(`gpress version ` + version + `🐣 GCOMPRESSION lib version 0.0.1/2
Copyright (C) 2016 by Jakub Kułak.
gpress comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. See the GNU General Public Licence for details.`... | [
0.8228265047073364,
-0.934069812297821,
0.6679280400276184,
0.5906473398208618,
0.493899941444397,
0.7321949601173401,
0.32830026745796204,
-0.4802515208721161,
-0.996998131275177,
0.6160065531730652,
-0.7787758111953735,
0.6324870586395264,
-1.1088182926177979,
-0.027996256947517395,
1.... |
func PrintHelp() {
fmt.Println(`usage: gpress [--decompress] [--verbose] --sourcefile <file>
--decompress decompress file
--help display help
--sourcefile file to be compressed or decompressed
--verbose add debug output
--version display program vers... | [
1.3259578943252563,
-0.32644838094711304,
0.7456150054931641,
0.027429424226284027,
0.788067638874054,
0.6003580093383789,
0.600238561630249,
-0.45434656739234924,
-1.2179713249206543,
0.4099820852279663,
0.27583634853363037,
0.7479872107505798,
-0.149384543299675,
0.15596681833267212,
0... |
func fib(n int64) int64 {
if n <= 0 {
return 0
}
if n <= 2 {
return 1
}
return fib(n-1) + fib(n-2)
} | [
-0.3426845967769623,
0.7232588529586792,
0.34741002321243286,
1.568961501121521,
0.2404826134443283,
0.22792218625545502,
0.18106609582901,
-0.16528864204883575,
0.34452754259109497,
-0.5867482423782349,
0.3030300438404083,
0.11590040475130081,
0.02579491026699543,
1.3710908889770508,
0.... |
func fibOptimized(n int64, memMap map[int64]int64) int64{
if memMap == nil {
memMap = map[int64]int64{}
}
if n <= 0 {
return 0
}
if n <= 2 {
return 1
}
if val,ok := memMap[n]; ok {
return val
}
memMap[n] = fibOptimized(n-1,memMap) + fibOptimized(n-2,memMap)
return memMap[n]
} | [
-0.6225493550300598,
0.518988311290741,
0.6121146082878113,
0.9037876129150391,
0.07435379177331924,
-0.6870919466018677,
0.19561181962490082,
0.02845415100455284,
0.6912992596626282,
0.11631522327661514,
-0.7819879651069641,
-0.11764500290155411,
-0.4532761573791504,
0.5598020553588867,
... |
func (db *imageDB) imageSearchHandler(w http.ResponseWriter, req *http.Request, _ httprouter.Params) {
searchTags := req.FormValue("t")
db.mu.RLock()
urls, err := db.lookupByTags(parseTags(searchTags))
db.mu.RUnlock()
if err != nil {
http.Error(w, "Lookup failed", http.StatusInternalServerError)
return
}
// ... | [
-1.1606048345565796,
0.44692763686180115,
0.4665546715259552,
-0.5793350338935852,
0.08272292464971542,
-0.09029394388198853,
-0.08179300278425217,
0.1936286985874176,
-0.5991507768630981,
0.6916369199752808,
-0.21177081763744354,
-0.6319236755371094,
-0.08042199164628983,
0.77997773885726... |
func NewTime(tt time.Time) *Time {
t := &Int64{atomic.NewInt64(tt.UnixNano())}
return &Time{v: t}
} | [
0.16679222881793976,
0.799830973148346,
0.22588591277599335,
0.20318998396396637,
-0.5672464370727539,
-0.12991300225257874,
-1.5354094505310059,
-0.8063689470291138,
0.3528177738189697,
0.20530366897583008,
-0.39075782895088196,
-0.7032461166381836,
0.13304299116134644,
0.2787019312381744... |
func (at *Time) Load() time.Time {
return time.Unix(0, at.v.Load())
} | [
-0.6073315143585205,
0.20509089529514313,
0.4503861367702484,
-0.5571269989013672,
-0.5277323126792908,
0.35752615332603455,
-0.859811544418335,
-1.1955060958862305,
-0.3330419659614563,
0.3335948586463928,
-0.9404200315475464,
-0.25964975357055664,
-0.1503254771232605,
0.35522904992103577... |
func (at *Time) Store(n time.Time) {
at.v.Store(n.UnixNano())
} | [
-0.41930869221687317,
0.8380732536315918,
0.10800381004810333,
-0.20125295221805573,
-0.08900371193885803,
0.8347293138504028,
-0.6535765528678894,
-1.2836451530456543,
0.4034903943538666,
-0.6542273759841919,
-1.596846103668213,
0.06871972233057022,
0.9253883361816406,
1.4253731966018677,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.