text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func NewClient(doer network.HTTPDoer, host string) *Client {
return &Client{
doer: doer,
host: host,
}
} | [
0.15932801365852356,
-0.3746944069862366,
0.20489287376403809,
0.7733226418495178,
-0.5340530276298523,
0.36760684847831726,
0.039438363164663315,
-0.4441765546798706,
-0.8228718638420105,
-0.5785337090492249,
0.12132065743207932,
0.9626789093017578,
0.28454339504241943,
-0.165915310382843... |
func (c CoffeeMachine) GetLowRunningIngredients(threshold int) {
for _, ingredient := range c.Ingredients {
if ingredient.Quantity <= threshold {
fmt.Println(ingredient.Name + " is running low, quantity avaialble: ", ingredient.Quantity)
}
}
} | [
0.1422056406736374,
-1.3930537700653076,
0.3377388119697571,
-0.4432157874107361,
-0.04723384231328964,
-0.8104130029678345,
-1.3743997812271118,
0.04686058685183525,
-0.83367520570755,
-0.6623725295066833,
-0.7128666639328003,
1.830383062362671,
-0.21900534629821777,
0.3481796979904175,
... |
func (c *CoffeeMachine) AddIngredients(ingredientName string, quantity int) {
if _, ingredientExists := c.Ingredients[ingredientName]; ingredientExists {
c.Ingredients[ingredientName] = addQuantity(c.Ingredients[ingredientName], quantity)
} else {
c.Ingredients[ingredientName] = Ingredient{ingredientName, quantit... | [
-0.6066701412200928,
-0.350401371717453,
0.5453687310218811,
-0.817375123500824,
0.24745255708694458,
-0.41465863585472107,
-1.6068650484085083,
-0.17504972219467163,
-0.006573133170604706,
0.026507126167416573,
-0.2201593816280365,
-0.2567683458328247,
-0.8052788376808167,
0.3593438267707... |
func addQuantity(ingredient Ingredient, quantity int) Ingredient {
ingredient.Quantity = ingredient.Quantity + quantity
return ingredient
} | [
-0.5824579000473022,
-1.4909818172454834,
0.6813430190086365,
0.30099421739578247,
0.07667633146047592,
-0.43178361654281616,
-0.801581621170044,
0.14859123528003693,
0.8222578763961792,
-0.04430017247796059,
-0.22524940967559814,
-0.16583210229873657,
0.19404323399066925,
-0.3915664851665... |
func (c *Cmd) StartWithTimeout(to time.Duration, exp *regexp.Regexp) error {
c.startInNewGroup()
var err error
var opipe io.Reader
if c.Stdout != nil {
var w io.Writer
opipe, w = io.Pipe()
c.Stdout = io.MultiWriter(w, c.Stdout)
} else {
opipe, err = c.StdoutPipe()
if err != nil {
return err
}
}
... | [
0.17125475406646729,
-0.890278697013855,
0.8929294347763062,
-0.5092191100120544,
-0.36232587695121765,
-0.19914494454860687,
0.17234911024570465,
0.36247873306274414,
-0.43425822257995605,
0.19493108987808228,
0.44128769636154175,
0.47097066044807434,
-0.07062648981809616,
-0.021890696138... |
func (c *Cmd) StopWithTimeout(to time.Duration) error {
exited := make(chan bool)
go func() {
c.Wait()
exited <- true
}()
ps, err := c.expandToChildProcesses(c.Process)
if err != nil {
return err
}
//signal all (child)processes to better simulate
//shell behaviour
for _, p := range ps {
err := p.Sign... | [
-0.19986489415168762,
-0.8257743120193481,
0.8733307123184204,
-0.752414882183075,
-0.49772024154663086,
-0.2067030817270279,
-0.3196980953216553,
-0.1963111013174057,
-0.5143923759460449,
0.3633477985858917,
-0.7880383729934692,
-0.08345489203929901,
0.06149716302752495,
-0.11933274567127... |
func NewQueue(size int) Queuer {
return &queue{
size: size,
count: 0,
head: nil,
tail: nil,
}
} | [
0.20078445971012115,
-0.5296177864074707,
0.32846808433532715,
0.02589515782892704,
-0.8797702789306641,
-0.8110018968582153,
-0.22647425532341003,
-0.472265362739563,
0.262090802192688,
-0.6062896251678467,
-0.11388715356588364,
0.2752799093723297,
-0.28448250889778137,
1.2445642948150635... |
func (q *queue) Size() int {
return q.size
} | [
-0.2774433493614197,
0.030641864985227585,
0.20125950872898102,
-0.7672489881515503,
-0.37973377108573914,
0.319557249546051,
0.18990851938724518,
-0.42537739872932434,
0.10187790542840958,
-0.6976061463356018,
-0.5165820717811584,
0.5437043905258179,
-0.6783065795898438,
0.833564758300781... |
func (q *queue) Count() int {
q.Lock()
defer q.Unlock()
return q.count
} | [
0.3680446743965149,
-0.7085217237472534,
0.403266042470932,
0.05316838622093201,
-0.46080201864242554,
-0.07084495574235916,
0.07987914979457855,
-0.5452561378479004,
-0.9751182794570923,
-0.17730341851711273,
-0.5193697214126587,
-0.13287916779518127,
-0.4143194854259491,
0.90892118215560... |
func (q *queue) Copy() []interface{} {
q.Lock()
defer q.Unlock()
copy := make([]interface{}, q.count)
ptr := q.head
for i := 0; i < q.count; i++ {
copy[i] = ptr.data
ptr = ptr.next
}
return copy
} | [
-1.0429242849349976,
-0.8135468363761902,
0.7114959359169006,
0.2150477021932602,
-0.8422234058380127,
1.0118695497512817,
0.08106694370508194,
-1.1153870820999146,
0.5295034050941467,
0.6550071239471436,
-0.16608040034770966,
0.9475730061531067,
-0.6861996054649353,
0.6693060398101807,
... |
func (q *queue) Push(data interface{}) {
i := &item{
data: data,
next: nil,
}
q.Lock()
switch q.count {
case 0:
q.tail = i
q.head = q.tail
q.count++
break
case q.size:
q.tail.next = i
q.tail = q.tail.next
q.head = q.head.next
break
default:
q.tail.next = i
q.tail = q.tail.next
q.count+... | [
0.10859457403421402,
0.393414705991745,
0.2937979996204376,
-0.20406362414360046,
-0.5192090272903442,
0.35069695115089417,
0.006341473199427128,
-0.559684693813324,
0.028216950595378876,
0.040923360735177994,
-1.0062265396118164,
0.8653458952903748,
-0.5078169703483582,
0.6754677891731262... |
func (q *queue) Drain() {
q.Lock()
defer q.Unlock()
q.head = nil
q.tail = nil
q.count = 0
} | [
-0.0810590460896492,
-0.2933603823184967,
0.0882669985294342,
-1.724128246307373,
0.37375733256340027,
0.37860989570617676,
0.22762013971805573,
-0.25659456849098206,
0.16213108599185944,
-1.50139319896698,
-0.2799575924873352,
1.1988356113433838,
-0.8413271903991699,
0.7006257772445679,
... |
func (q *queue) OnPush(handler PushHandler) {
q.Lock()
defer q.Unlock()
q.pushHandler = handler
} | [
0.7642173171043396,
-0.4201851487159729,
0.2712360918521881,
0.24220263957977295,
-1.1380976438522339,
0.3492385745048523,
-0.8794118762016296,
-0.12655523419380188,
-0.07407508045434952,
-0.3052605092525482,
-0.3240266442298889,
0.9057914614677429,
0.337108314037323,
1.2056665420532227,
... |
func JWT() gin.HandlerFunc {
secretKey := global.GetSecretKey()
return func(c *gin.Context) {
token := c.GetHeader("Authorization")
claim, err := parseToken(secretKey, token)
if err != nil {
util.ResponseError(c, http.StatusUnauthorized, err.Error())
c.Abort()
}
if claim != nil {
global.Logger.Debu... | [
0.5591099858283997,
-0.30674681067466736,
0.698729395866394,
0.4905683100223541,
-0.37010979652404785,
-0.2534162700176239,
-0.4713737368583679,
-0.011215866543352604,
-0.2689552903175354,
-0.3158904016017914,
0.3632186949253082,
0.6692976355552673,
1.3541940450668335,
-0.4550491273403168,... |
func (o *ApplyProductPatchUsingPOSTReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewApplyProductPatchUsingPOSTOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
... | [
0.1179802417755127,
-1.1138564348220825,
0.8178052306175232,
0.5511775612831116,
-0.5743623971939087,
-0.3946821093559265,
0.012101915664970875,
-0.1871219277381897,
0.876307487487793,
-0.13235431909561157,
0.4062032103538513,
-0.4661339521408081,
-0.7356258034706116,
-0.3235749900341034,
... |
func NewApplyProductPatchUsingPOSTOK() *ApplyProductPatchUsingPOSTOK {
return &ApplyProductPatchUsingPOSTOK{}
} | [
0.14519751071929932,
-0.632159411907196,
0.6939199566841125,
0.7494421601295471,
-1.4350770711898804,
0.5403659343719482,
0.025593915954232216,
-0.024289041757583618,
0.5099731087684631,
-0.02612748183310032,
-0.784716784954071,
-0.5730238556861877,
0.16530735790729523,
0.6212800145149231,... |
func NewApplyProductPatchUsingPOSTCreated() *ApplyProductPatchUsingPOSTCreated {
return &ApplyProductPatchUsingPOSTCreated{}
} | [
0.9341354966163635,
-0.44682684540748596,
0.6372974514961243,
0.6868165135383606,
-0.5525219440460205,
0.6358528137207031,
-0.4034975469112396,
-0.15331988036632538,
0.7865902185440063,
-1.1906465291976929,
-0.41451597213745117,
-0.23502446711063385,
0.5404495000839233,
0.35279521346092224... |
func NewApplyProductPatchUsingPOSTUnauthorized() *ApplyProductPatchUsingPOSTUnauthorized {
return &ApplyProductPatchUsingPOSTUnauthorized{}
} | [
-0.15877491235733032,
-0.3015279769897461,
0.9661481976509094,
1.1865192651748657,
-1.2612062692642212,
0.4248613119125366,
-0.83194899559021,
0.724315345287323,
1.1975159645080566,
-1.059887409210205,
-0.6478481292724609,
1.0757659673690796,
0.14117097854614258,
-0.03126230463385582,
0.... |
func NewApplyProductPatchUsingPOSTForbidden() *ApplyProductPatchUsingPOSTForbidden {
return &ApplyProductPatchUsingPOSTForbidden{}
} | [
0.6985109448432922,
0.08578846603631973,
0.8816389441490173,
1.1676126718521118,
-1.316037654876709,
0.8326079249382019,
-0.1306075006723404,
-0.6295377016067505,
0.9795668125152588,
-0.6121745705604553,
-0.45538055896759033,
0.7051001787185669,
-0.14716477692127228,
-0.3221700191497803,
... |
func NewApplyProductPatchUsingPOSTNotFound() *ApplyProductPatchUsingPOSTNotFound {
return &ApplyProductPatchUsingPOSTNotFound{}
} | [
0.4301624298095703,
-1.078195333480835,
0.5787704586982727,
0.49955400824546814,
-0.30675581097602844,
0.9162948727607727,
-0.25729671120643616,
0.11614816635847092,
0.8618060350418091,
-0.3852393329143524,
-0.7479669451713562,
0.4911164939403534,
0.2106083184480667,
0.11890320479869843,
... |
func NewLogsListRequestPage() *LogsListRequestPage {
this := LogsListRequestPage{}
var limit int32 = 10
this.Limit = &limit
return &this
} | [
-0.44991663098335266,
-0.167509987950325,
0.43801411986351013,
-0.41634100675582886,
-0.27658456563949585,
-0.3208874762058258,
-1.050591230392456,
-0.07471522688865662,
0.6686868071556091,
-0.15113180875778198,
-0.3795074224472046,
0.06262202560901642,
-0.638913631439209,
-0.2750611901283... |
func NewLogsListRequestPageWithDefaults() *LogsListRequestPage {
this := LogsListRequestPage{}
var limit int32 = 10
this.Limit = &limit
return &this
} | [
-0.44975653290748596,
0.08527800440788269,
0.29717957973480225,
-0.11740405112504959,
0.5669630765914917,
-0.6393340229988098,
-1.5066239833831787,
-0.29050207138061523,
0.7069331407546997,
-0.5804365873336792,
-0.7282357215881348,
-0.7124176025390625,
-0.7896825671195984,
-0.0973577797412... |
func (o *LogsListRequestPage) GetCursor() string {
if o == nil || o.Cursor == nil {
var ret string
return ret
}
return *o.Cursor
} | [
0.1692717969417572,
-0.30208536982536316,
-0.07958780229091644,
0.8254860043525696,
-0.7541579008102417,
-0.2130795568227768,
0.339009553194046,
-0.34311482310295105,
0.7096229791641235,
-0.7876070141792297,
0.16207760572433472,
-1.100184440612793,
-0.5756243467330933,
1.0370206832885742,
... |
func (o *LogsListRequestPage) GetCursorOk() (*string, bool) {
if o == nil || o.Cursor == nil {
return nil, false
}
return o.Cursor, true
} | [
0.2705933749675751,
0.7803989052772522,
0.29075509309768677,
0.8844826817512512,
-0.8515950441360474,
-0.6484034061431885,
0.4537200927734375,
1.0099444389343262,
0.48333480954170227,
-0.4949519634246826,
-0.42869219183921814,
0.4701993763446808,
-0.3264295160770416,
0.6582358479499817,
... |
func (o *LogsListRequestPage) HasCursor() bool {
if o != nil && o.Cursor != nil {
return true
}
return false
} | [
0.21499726176261902,
-0.35194551944732666,
-0.005947434809058905,
0.10756924003362656,
0.05896681174635887,
-0.20095045864582062,
0.03880173712968826,
0.7226008772850037,
0.30099937319755554,
-0.9275679588317871,
-0.1268160343170166,
-0.9325151443481445,
-0.255869060754776,
0.8925486803054... |
func (o *LogsListRequestPage) SetCursor(v string) {
o.Cursor = &v
} | [
0.5023424625396729,
-0.8591563701629639,
-0.21867620944976807,
-0.05261300504207611,
-1.347957968711853,
-0.2535667419433594,
-0.5899181962013245,
-0.636787474155426,
0.35733264684677124,
-0.34539103507995605,
0.5152900218963623,
0.7602691650390625,
-0.3778085708618164,
0.10566601902246475... |
func (o *LogsListRequestPage) GetLimit() int32 {
if o == nil || o.Limit == nil {
var ret int32
return ret
}
return *o.Limit
} | [
0.5211538076400757,
0.7177010774612427,
0.5049229264259338,
0.6435476541519165,
0.3830154836177826,
0.36146530508995056,
0.9143328070640564,
-0.11054782569408417,
0.8461940288543701,
-0.800791323184967,
0.05795157700777054,
-0.6838338971138,
-1.0043284893035889,
0.17285990715026855,
1.41... |
func (o *LogsListRequestPage) GetLimitOk() (*int32, bool) {
if o == nil || o.Limit == nil {
return nil, false
}
return o.Limit, true
} | [
-0.3850477933883667,
0.3984397053718567,
0.4987172484397888,
1.4287562370300293,
0.10648708045482635,
0.13868674635887146,
0.5032433867454529,
1.096924066543579,
0.9055574536323547,
0.20309443771839142,
-0.9040277600288391,
-0.6773643493652344,
-0.26997798681259155,
-0.23239727318286896,
... |
func (o *LogsListRequestPage) HasLimit() bool {
if o != nil && o.Limit != nil {
return true
}
return false
} | [
0.6919397711753845,
0.4936039447784424,
0.6369832158088684,
0.5895328521728516,
0.8036560416221619,
-0.12217827141284943,
-0.28052636981010437,
0.8969282507896423,
0.7620367407798767,
-0.6137463450431824,
-0.5078092217445374,
-0.8251456022262573,
-0.280988872051239,
-0.4618922173976898,
... |
func (o *LogsListRequestPage) SetLimit(v int32) {
o.Limit = &v
} | [
0.2292809635400772,
0.6079398989677429,
0.1870885044336319,
-0.06440838426351547,
-0.35958796739578247,
0.7148808836936951,
-0.5573943257331848,
-1.3487133979797363,
0.1443144530057907,
0.3983791470527649,
0.0027501184958964586,
0.5579394698143005,
-0.18191270530223846,
-0.8779011964797974... |
func TestAddAndSubDegs(t *testing.T) {
for i := 0; i < 1000; i++ {
a, b := uint(prg.Uint32()), uint(prg.Uint32())
c, d := uint(prg.Uint32()), uint(prg.Uint32())
if tmp, _ := addDegs([2]uint{a, b}, [2]uint{c, d}); tmp != [2]uint{a + c, b + d} {
t.Errorf("addDegs({%d,%d},{%d,%d})=%v (Expected {%d,%d})", a, b, c... | [
0.10196953266859055,
0.755776047706604,
0.5282825827598572,
-0.7679167985916138,
0.08879325538873672,
0.6777809262275696,
0.5302646160125732,
0.2646789252758026,
-0.045961152762174606,
-0.41474223136901855,
-0.2394254356622696,
-0.23895393311977386,
0.09634990245103836,
0.34308335185050964... |
func (m *RainsMessage) Sort() {
var assertions []*AssertionSection
var shards []*ShardSection
var zones []*ZoneSection
var queries []*QuerySection
var addressAssertions []*AddressAssertionSection
var addressZones []*AddressZoneSection
var addressQueries []*AddressQuerySection
var notifications []*NotificationSe... | [
0.2025918960571289,
-0.5531270503997803,
0.7113255262374878,
-0.7720903158187866,
-0.21574091911315918,
1.0100501775741577,
0.8201637268066406,
-1.2864373922348022,
-0.29235339164733887,
-0.2852802276611328,
0.7631458044052124,
0.2551848590373993,
-0.6671225428581238,
1.4120033979415894,
... |
func (t Token) String() string {
return hex.EncodeToString(t[:])
} | [
0.3551557958126068,
-0.7251366376876831,
-0.21388354897499084,
-1.0572946071624756,
0.6204650402069092,
0.5226590037345886,
-1.1679623126983643,
0.006511962041258812,
-0.6328554749488831,
-0.09990609437227249,
-1.0150083303451538,
0.2647436559200287,
0.4120861291885376,
-0.1230469793081283... |
func Intersect(a, b Interval) bool {
//case1: both intervals are points => compare with equality
if a.Begin() == a.End() && b.Begin() == b.End() && a.Begin() != "" && b.Begin() != "" {
return a.Begin() == b.Begin()
}
//case2: at least one of them is an interval
if a.Begin() == "" {
return b.Begin() == "" || a.... | [
0.13909858465194702,
-0.5790623426437378,
1.3109408617019653,
0.18799540400505066,
-0.8916239142417908,
0.9452160000801086,
-0.7708028554916382,
-0.14794903993606567,
-0.5684353113174438,
0.8672088980674744,
0.6260142922401428,
0.15990297496318817,
-1.2910773754119873,
0.14780957996845245,... |
func (t TotalInterval) Begin() string {
return ""
} | [
0.2147950381040573,
-0.4698997139930725,
0.4633083939552307,
-1.0902544260025024,
-0.9187960028648376,
1.249975562095642,
0.6287879943847656,
-0.3551393747329712,
0.2915739119052887,
-0.09094610810279846,
0.08069457858800888,
-0.14219628274440765,
-0.6112788319587708,
0.0022370682563632727... |
func (t TotalInterval) End() string {
return ""
} | [
0.3489288091659546,
-0.6685425639152527,
0.5454790592193604,
-1.1820087432861328,
-0.4347096085548401,
1.7396575212478638,
0.09333214908838272,
-0.4295637011528015,
-0.13121791183948517,
0.6352055072784424,
-0.44644737243652344,
-0.8575563430786133,
-0.9641200304031372,
-0.1254418641328811... |
func (s StringInterval) Begin() string {
return s.Name
} | [
0.28110989928245544,
-1.0897762775421143,
0.47893935441970825,
-0.8459219932556152,
-1.5649958848953247,
0.9212658405303955,
-0.19995154440402985,
-0.7767648100852966,
0.12042874097824097,
-0.3595312833786011,
0.18670262396335602,
0.9102627635002136,
-0.23388095200061798,
-0.25463992357254... |
func (s StringInterval) End() string {
return s.Name
} | [
0.4543025493621826,
-1.1684455871582031,
0.3932074010372162,
-0.8260821104049683,
-1.2035295963287354,
1.283423662185669,
-0.6435496807098389,
-0.6127979159355164,
-0.0009441846632398665,
0.37042391300201416,
-0.5051855444908142,
0.42043352127075195,
-0.73028963804245,
-0.28901761770248413... |
func (sig Signature) GetSignatureMetaData() SignatureMetaData {
return SignatureMetaData{
PublicKeyID: sig.PublicKeyID,
ValidSince: sig.ValidSince,
ValidUntil: sig.ValidUntil,
}
} | [
-0.07771258801221848,
-0.40991923213005066,
0.2374054342508316,
0.7428451776504517,
0.0014199248980730772,
0.2929210066795349,
-0.9920950531959534,
-0.08112017810344696,
0.04563351720571518,
0.5151168704032898,
-1.6024836301803589,
-0.025660796090960503,
-0.0919775664806366,
0.116217918694... |
func (sig Signature) String() string {
data := "notYetImplementedInStringMethod"
if sig.Algorithm == Ed25519 {
if sig.Data == nil {
data = "nil"
} else {
data = hex.EncodeToString(sig.Data.([]byte))
}
}
return fmt.Sprintf("{KS=%d AT=%d VS=%d VU=%d KP=%d data=%s}",
sig.KeySpace, sig.Algorithm, sig.Vali... | [
-0.00811043195426464,
-1.092543363571167,
0.2011866420507431,
-0.5570225119590759,
-0.9740602374076843,
-0.03262970596551895,
0.08190072327852249,
-0.6452725529670715,
-0.07279851287603378,
0.6683406233787537,
-0.42362457513809204,
0.10794641077518463,
0.13219954073429108,
0.59436845779418... |
func (sig *Signature) SignData(privateKey interface{}, encoding string) error {
if privateKey == nil {
log.Warn("PrivateKey is nil")
return errors.New("privateKey is nil")
}
encoding += sig.GetSignatureMetaData().String()
data := []byte(encoding)
switch sig.Algorithm {
case Ed25519:
if pkey, ok := privateKe... | [
-1.2112576961517334,
-0.25455453991889954,
0.5974860787391663,
-0.5120130777359009,
-0.019537579268217087,
0.2204781174659729,
0.005073340144008398,
-0.14397601783275604,
0.4243941903114319,
0.3723045289516449,
-0.6239887475967407,
0.4504699110984802,
0.0171100702136755,
1.310555100440979,... |
func (sig *Signature) VerifySignature(publicKey interface{}, encoding string) bool {
if sig.Data == nil {
log.Warn("sig does not contain signature data", "sig", sig)
return false
}
if publicKey == nil {
log.Warn("PublicKey is nil")
return false
}
encoding += sig.GetSignatureMetaData().String()
data := []b... | [
-0.7737435102462769,
0.5225892663002014,
0.5689635276794434,
-0.13468807935714722,
-0.3296097218990326,
0.17645417153835297,
-0.08548158407211304,
-0.335724413394928,
0.2535083293914795,
0.308370441198349,
-1.328481674194336,
-0.16092564165592194,
-0.38047221302986145,
1.2545814514160156,
... |
func (c ConnInfo) String() string {
switch c.Type {
case TCP:
return c.TCPAddr.String()
default:
log.Warn("Unsupported network address", "typeCode", c.Type)
return ""
}
} | [
0.16542206704616547,
-0.8004313111305237,
0.30719587206840515,
-0.45430296659469604,
-0.1895468533039093,
1.0611430406570435,
0.07972773909568787,
-0.732039749622345,
-0.5828993320465088,
0.1622711420059204,
0.4978038966655731,
-0.13055212795734406,
-0.49839484691619873,
-0.420498877763748... |
func (c ConnInfo) NetworkAndAddr() string {
switch c.Type {
case TCP:
return fmt.Sprintf("%s %s", c.TCPAddr.Network(), c.String())
default:
log.Warn("Unsupported network address type", "type", c.Type)
return ""
}
} | [
-0.2408123016357422,
-1.2065064907073975,
0.4319514334201813,
-0.9259141683578491,
0.07477420568466187,
0.7051388025283813,
-0.451846718788147,
-0.4968007504940033,
0.09559544920921326,
0.23503008484840393,
0.8973171710968018,
-0.7088672518730164,
0.18741188943386078,
1.013337254524231,
... |
func (c ConnInfo) Hash() string {
return fmt.Sprintf("%v_%s", c.Type, c.String())
} | [
0.5882561802864075,
-0.7145676612854004,
0.5211540460586548,
-0.32169365882873535,
0.13767792284488678,
1.2877588272094727,
-0.8548983335494995,
-0.23885893821716309,
-1.0347331762313843,
-0.059260882437229156,
0.0843195766210556,
1.2504088878631592,
0.005777707323431969,
-0.39433935284614... |
func (c ConnInfo) Equal(conn ConnInfo) bool {
if c.Type == conn.Type {
switch c.Type {
case TCP:
return c.TCPAddr.IP.Equal(conn.TCPAddr.IP) && c.TCPAddr.Port == conn.TCPAddr.Port && c.TCPAddr.Zone == conn.TCPAddr.Zone
default:
log.Warn("Not supported network address type")
}
}
return false
} | [
-0.5308759212493896,
-0.5504259467124939,
0.5354636907577515,
-0.27858641743659973,
0.6604031324386597,
0.9909899234771729,
-0.12052908539772034,
-0.41171902418136597,
-0.480582058429718,
0.8152266144752502,
-0.5001294612884521,
-0.07221859693527222,
-0.7902698516845703,
0.3700717091560364... |
func BbFileTicket(ctx context.Context, taskId string, execution int) (int, error) {
// Find information about the task
t, err := task.FindOneIdAndExecution(taskId, execution)
if err != nil {
return http.StatusInternalServerError, err
}
if t == nil {
return http.StatusNotFound, errors.Wrapf(err, "task '%s' not ... | [
0.45554712414741516,
0.14507988095283508,
0.8698607683181763,
-0.22903649508953094,
0.2718144953250885,
-0.1341492235660553,
0.5699997544288635,
0.35321933031082153,
-1.2993940114974976,
0.25070920586586,
-0.04486272111535072,
0.45294758677482605,
0.006589985452592373,
0.8267737627029419,
... |
func fileTicketCustomHook(context context.Context, taskId string, execution int, webHook evergreen.WebHook) (*http.Response, error) {
failingTaskData := FailingTaskData{
TaskId: taskId,
Execution: execution,
}
req, err := http.NewRequest(http.MethodPost, webHook.Endpoint, nil)
if err != nil {
return nil, ... | [
0.1508665382862091,
-0.4193057119846344,
0.9615037441253662,
-0.03557433560490608,
-0.0921826884150505,
0.4320250451564789,
-0.06374303251504898,
0.17767640948295593,
-1.0066559314727783,
0.17047786712646484,
-0.3542361855506897,
0.4398404359817505,
-0.20919494330883026,
0.4954696893692016... |
func makeOperationDevicesGetDevicesDeviceidMactableCmd() (*cobra.Command, error) {
cmd := &cobra.Command{
Use: "getDevicesDeviceidMactable",
Short: ``,
RunE: runOperationDevicesGetDevicesDeviceidMactable,
}
if err := registerOperationDevicesGetDevicesDeviceidMactableParamFlags(cmd); err != nil {
return n... | [
0.33338475227355957,
0.5752414464950562,
0.45955199003219604,
0.020301159471273422,
-0.1913169026374817,
0.1747473031282425,
1.2404069900512695,
-0.49880555272102356,
-0.0979933813214302,
-0.745844841003418,
1.3329260349273682,
0.07982862740755081,
0.21799203753471375,
-0.30747804045677185... |
func runOperationDevicesGetDevicesDeviceidMactable(cmd *cobra.Command, args []string) error {
appCli, err := makeClient(cmd, args)
if err != nil {
return err
}
// retrieve flag values from cmd and fill params
params := devices.NewGetDevicesDeviceidMactableParams()
if err, _ := retrieveOperationDevicesGetDevices... | [
-0.3637138903141022,
0.3360847532749176,
0.8386427760124207,
0.06877560913562775,
0.1021173745393753,
0.20637930929660797,
1.3116647005081177,
-1.1359487771987915,
-0.3754191994667053,
-0.30980753898620605,
0.3585048019886017,
0.7424641251564026,
-0.8062418699264526,
0.3229149878025055,
... |
func registerOperationDevicesGetDevicesDeviceidMactableParamFlags(cmd *cobra.Command) error {
if err := registerOperationDevicesGetDevicesDeviceidMactableCountParamFlags("", cmd); err != nil {
return err
}
if err := registerOperationDevicesGetDevicesDeviceidMactableDeviceIDParamFlags("", cmd); err != nil {
retur... | [
-0.012597600929439068,
0.8437398076057434,
0.8950814008712769,
0.17437849938869476,
0.1433318555355072,
0.3408595025539398,
0.5847090482711792,
-0.38117459416389465,
-0.18961447477340698,
-0.41118690371513367,
0.2764856815338135,
-0.008088910952210426,
-0.35928401350975037,
1.1498624086380... |
func parseOperationDevicesGetDevicesDeviceidMactableResult(resp0 *devices.GetDevicesDeviceidMactableOK, respErr error) (string, error) {
if respErr != nil {
var iResp0 interface{} = respErr
resp0, ok := iResp0.(*devices.GetDevicesDeviceidMactableOK)
if ok {
if !swag.IsZero(resp0) && !swag.IsZero(resp0.Payloa... | [
-0.5026776194572449,
0.21712782979011536,
0.4330771863460541,
-0.16814276576042175,
-0.762492835521698,
-0.4835474193096161,
0.7088963389396667,
-1.0173007249832153,
-0.18335939943790436,
-0.029922500252723694,
0.5199328064918518,
-0.47784072160720825,
-0.46479368209838867,
0.2322312444448... |
func NewScoreListRequest(payload *score.ScoreListPayload) *scorepb.ScoreListRequest {
message := &scorepb.ScoreListRequest{
Cursor: int32(payload.Cursor),
Limit: int32(payload.Limit),
}
if payload.SortField != nil {
message.SortField = *payload.SortField
}
if payload.SortOrder != nil {
message.SortOrder =... | [
-0.7821260690689087,
-0.25925374031066895,
0.4731360673904419,
-0.09123284369707108,
-0.7067677974700928,
-0.14052076637744904,
-0.8496645092964172,
-0.7298140525817871,
0.4184175431728363,
0.8799566626548767,
-0.2932252287864685,
0.29933035373687744,
-0.46665826439857483,
1.05255436897277... |
func NewScoreListResult(message *scorepb.ScoreListResponse) *score.ScoreListResult {
result := &score.ScoreListResult{
Errcode: int(message.Errcode),
Errmsg: message.Errmsg,
}
if message.NextCursor != 0 {
nextCursorptr := int(message.NextCursor)
result.NextCursor = &nextCursorptr
}
if message.Total != 0 {... | [
-0.7102405428886414,
-0.48106804490089417,
0.29810070991516113,
-0.40931394696235657,
-0.29734304547309875,
-0.04490858316421509,
0.08565394580364227,
-0.7872319221496582,
0.3047839403152466,
0.9242004156112671,
-0.838986337184906,
-0.4049430787563324,
-1.1625500917434692,
0.75847607851028... |
func NewScoreDetailRequest(payload *score.ScoreDetailPayload) *scorepb.ScoreDetailRequest {
message := &scorepb.ScoreDetailRequest{
Id: int32(payload.ID),
}
return message
} | [
-0.23123224079608917,
0.45122745633125305,
0.46279507875442505,
-0.3203488290309906,
0.041304636746644974,
0.022550588473677635,
0.06400582939386368,
-0.8179558515548706,
0.790134608745575,
0.7227502465248108,
-0.4093458652496338,
0.7927990555763245,
-0.5036847591400146,
0.5958452820777893... |
func NewScoreDetailResult(message *scorepb.ScoreDetailResponse) *score.ScoreDetailResult {
result := &score.ScoreDetailResult{
Errcode: int(message.Errcode),
Errmsg: message.Errmsg,
}
if message.Data != nil {
result.Data = protobufScorepbGradeResultToScoreGradeResult(message.Data)
}
return result
} | [
-0.14567041397094727,
0.21141237020492554,
0.3516186475753784,
0.09042292088270187,
-0.10923194140195847,
0.00559097109362483,
0.7905343174934387,
-0.5344341397285461,
0.8568629622459412,
0.6424387097358704,
-0.7698726058006287,
0.1816408485174179,
-1.2852672338485718,
0.5205154418945312,
... |
func ValidateScoreListResponse(message *scorepb.ScoreListResponse) (err error) {
if message.Errcode < 0 {
err = goa.MergeErrors(err, goa.InvalidRangeError("message.errcode", message.Errcode, 0, true))
}
if message.Errcode > 999999 {
err = goa.MergeErrors(err, goa.InvalidRangeError("message.errcode", message.Errc... | [
-0.36128854751586914,
-0.5676015615463257,
0.1567784696817398,
-0.16756001114845276,
0.33743998408317566,
0.1822642683982849,
0.8298341631889343,
-0.6115137338638306,
0.8056067824363708,
0.5631857514381409,
-0.32178691029548645,
-0.4976183772087097,
-1.625518560409546,
0.6168736219406128,
... |
func ValidateGradeResult(message *scorepb.GradeResult) (err error) {
return
} | [
-0.38143783807754517,
0.11350098252296448,
0.40810418128967285,
0.3442818820476532,
-0.21025702357292175,
0.4390009641647339,
1.4883568286895752,
-0.5074223279953003,
-0.4538500905036926,
-0.08312368392944336,
-0.27594441175460815,
-0.6013634204864502,
-2.0577728748321533,
1.09972774982452... |
func ValidateScoreDetailResponse(message *scorepb.ScoreDetailResponse) (err error) {
if message.Errcode < 0 {
err = goa.MergeErrors(err, goa.InvalidRangeError("message.errcode", message.Errcode, 0, true))
}
if message.Errcode > 999999 {
err = goa.MergeErrors(err, goa.InvalidRangeError("message.errcode", message.... | [
0.26683202385902405,
-0.335658460855484,
0.46391358971595764,
-0.3464434742927551,
0.6153216361999512,
0.3005446195602417,
1.4376765489578247,
-0.4901988208293915,
0.9059684872627258,
0.48651808500289917,
-0.2076578587293625,
0.15568247437477112,
-0.9714699983596802,
0.3646078109741211,
... |
func svcScoreGradeResultToScorepbGradeResult(v *score.GradeResult) *scorepb.GradeResult {
if v == nil {
return nil
}
res := &scorepb.GradeResult{
Id: v.ID,
Class: v.Class,
Name: v.Name,
Score: int32(v.Score),
Subject: v.Subject,
CreatedAt: v.CreatedAt,
UpdatedAt: v.UpdatedAt,
}... | [
-0.22509834170341492,
0.57480788230896,
0.5156173706054688,
-0.03872112184762955,
-0.5065365433692932,
0.6871681213378906,
0.3693382740020752,
-1.0741559267044067,
0.4503234624862671,
0.8478967547416687,
-0.3459678590297699,
-0.1770915985107422,
-1.3880807161331177,
0.014433023519814014,
... |
func protobufScorepbGradeResultToScoreGradeResult(v *scorepb.GradeResult) *score.GradeResult {
if v == nil {
return nil
}
res := &score.GradeResult{
ID: v.Id,
Class: v.Class,
Name: v.Name,
Score: int(v.Score),
Subject: v.Subject,
CreatedAt: v.CreatedAt,
UpdatedAt: v.UpdatedAt,
... | [
-0.5084599256515503,
0.17117902636528015,
0.5426991581916809,
-0.5362567901611328,
-0.3200799822807312,
0.07479725033044815,
0.45741942524909973,
-0.3058857023715973,
-0.31944555044174194,
0.5452812314033508,
-0.6776129603385925,
-0.32726091146469116,
-1.8097519874572754,
0.089671194553375... |
func NewMigrationFeatureIndexInfoBuilder() *MigrationFeatureIndexInfoBuilder {
r := MigrationFeatureIndexInfoBuilder{
&MigrationFeatureIndexInfo{},
}
return &r
} | [
-0.42243292927742004,
-0.8116499185562134,
0.14083747565746307,
0.7226293087005615,
-0.39216378331184387,
0.5091943144798279,
-0.3953950107097626,
0.09685218334197998,
-0.3903222680091858,
-0.6910122036933899,
-0.23629119992256165,
-0.5742419958114624,
-0.08384159207344055,
0.0126311434432... |
func (rb *MigrationFeatureIndexInfoBuilder) Build() MigrationFeatureIndexInfo {
return *rb.v
} | [
-0.5197970867156982,
-0.8552323579788208,
-0.03783465921878815,
0.5342727899551392,
0.01665724441409111,
0.15761373937129974,
0.42505913972854614,
-0.20087771117687225,
-0.5292701721191406,
-0.8123623132705688,
-0.15282075107097626,
0.020711908116936684,
-0.0945756807923317,
-0.08791949599... |
func ListIngresses(t testing.TestingT, options *KubectlOptions, filters metav1.ListOptions) []extensionsv1beta1.Ingress {
ingresses, err := ListIngressesE(t, options, filters)
require.NoError(t, err)
return ingresses
} | [
-0.6805885434150696,
-0.22732411324977875,
0.4207589328289032,
0.49458304047584534,
0.18827135860919952,
0.13764791190624237,
-1.0114296674728394,
-0.270266056060791,
0.7208450436592102,
0.5021765828132629,
0.2347327321767807,
0.932394802570343,
-1.0145270824432373,
0.03508787229657173,
... |
func ListIngressesE(t testing.TestingT, options *KubectlOptions, filters metav1.ListOptions) ([]extensionsv1beta1.Ingress, error) {
clientset, err := GetKubernetesClientFromOptionsE(t, options)
if err != nil {
return nil, err
}
resp, err := clientset.ExtensionsV1beta1().Ingresses(options.Namespace).List(context.B... | [
-0.6395519971847534,
-0.2502545416355133,
0.45012199878692627,
0.6055546998977661,
0.4094844460487366,
-0.5090636014938354,
-0.7940701246261597,
-0.4082185924053192,
-0.08756238967180252,
0.8640038967132568,
0.25010979175567627,
0.931303858757019,
-1.2045336961746216,
-0.030283842235803604... |
func GetIngress(t testing.TestingT, options *KubectlOptions, ingressName string) *extensionsv1beta1.Ingress {
ingress, err := GetIngressE(t, options, ingressName)
require.NoError(t, err)
return ingress
} | [
0.33534783124923706,
0.04565511643886566,
0.42245039343833923,
1.0412925481796265,
-0.008777608163654804,
-0.021054156124591827,
-0.3029228448867798,
-0.46798279881477356,
0.4213186800479889,
-0.04292261600494385,
0.023915233090519905,
1.312646746635437,
-1.4058139324188232,
-0.69818180799... |
func GetIngressE(t testing.TestingT, options *KubectlOptions, ingressName string) (*extensionsv1beta1.Ingress, error) {
clientset, err := GetKubernetesClientFromOptionsE(t, options)
if err != nil {
return nil, err
}
return clientset.ExtensionsV1beta1().Ingresses(options.Namespace).Get(context.Background(), ingres... | [
0.2683458626270294,
0.06887995451688766,
0.4597851037979126,
0.9122312664985657,
0.3755017817020416,
-0.2724950909614563,
-0.34570255875587463,
-1.1246756315231323,
-0.10014845430850983,
0.46146607398986816,
0.6442683339118958,
1.0660611391067505,
-1.7406357526779175,
-0.5207337141036987,
... |
func IsIngressAvailable(ingress *extensionsv1beta1.Ingress) bool {
// Ingress is ready if it has at least one endpoint
endpoints := ingress.Status.LoadBalancer.Ingress
return len(endpoints) > 0
} | [
-0.8082447648048401,
-0.5405914187431335,
0.24916085600852966,
0.39144229888916016,
0.2246541827917099,
0.5454973578453064,
-1.0154235363006592,
0.3944220244884491,
0.2768048346042633,
1.0811125040054321,
-0.2985941767692566,
0.6400294899940491,
-0.5403696298599243,
0.5280606746673584,
-... |
func WaitUntilIngressAvailable(t testing.TestingT, options *KubectlOptions, ingressName string, retries int, sleepBetweenRetries time.Duration) {
statusMsg := fmt.Sprintf("Wait for ingress %s to be provisioned.", ingressName)
message := retry.DoWithRetry(
t,
statusMsg,
retries,
sleepBetweenRetries,
func() (... | [
-0.026002176105976105,
-0.8943674564361572,
0.323922723531723,
-0.33570048213005066,
-0.19743870198726654,
0.7571545243263245,
-0.940035343170166,
0.18391120433807373,
0.06569376587867737,
1.050582766532898,
-0.19007974863052368,
0.9736776947975159,
-0.7539068460464478,
-0.7843532562255859... |
func ValidateRPResources(system *actor.System, resourcePoolName string, slots int) (bool, error) {
resp := system.Ask(
GetCurrentRM(system), ValidateCommandResourcesRequest{
ResourcePool: resourcePoolName,
Slots: slots,
})
if resp.Error() != nil {
return false, resp.Error()
}
return resp.Get().(V... | [
-0.4532909095287323,
-0.22684891521930695,
0.7123726606369019,
-0.26539137959480286,
-1.0733320713043213,
0.4467911720275879,
0.43451425433158875,
-0.0380772240459919,
0.18622417747974396,
0.1178974062204361,
0.005115880630910397,
-0.8263273239135742,
-1.2448327541351318,
0.908650577068328... |
func NewRouter() *echo.Echo {
e := echo.New()
e.Use(middleware.LoggerWithConfig(middleware.LoggerConfig{
Skipper: func(c echo.Context) bool {
if c.Request().RequestURI == "/health" {
return true
}
return false
},
}))
e.Use(middleware.Recover())
e.Pre(middleware.RemoveTrailingSlash())
e.Use(middle... | [
-0.22062350809574127,
-0.6528499722480774,
0.9726985692977905,
1.0540848970413208,
-0.4797978699207306,
0.4637407660484314,
-0.000914182688575238,
-0.41400885581970215,
0.09535699337720871,
-0.30082669854164124,
0.13299398124217987,
0.5021317601203918,
0.40261393785476685,
0.86788636445999... |
func (enum SourceEnum) String() string {
return _sourceEnums[enum]
} | [
-0.9625129103660583,
-0.35854029655456543,
0.06481387466192245,
-0.8696829676628113,
-0.44995540380477905,
0.5934779644012451,
0.22601628303527832,
-0.6399518251419067,
1.101042628288269,
0.5038829445838928,
-1.0269966125488281,
0.6178011894226074,
0.05056638643145561,
-0.09004756063222885... |
func (enum SourceEnum) MarshalJSON() ([]byte, error) {
return json.Marshal(enum.String())
} | [
-1.112471580505371,
0.0050678434781730175,
0.2814852297306061,
-1.075472354888916,
-0.43073469400405884,
-0.14658957719802856,
-0.29897695779800415,
0.5802814364433289,
1.435001015663147,
0.8691092729568481,
-1.5472787618637085,
1.1830447912216187,
0.10084642469882965,
0.45677101612091064,... |
func (enum *SourceEnum) UnmarshalJSON(bytes []byte) error {
var err error
var val string
err = json.Unmarshal(bytes, &val)
if nil != err {
return err
}
for k, v := range _sourceEnums {
if v == val {
*enum = k
return nil
}
}
return fmt.Errorf("%s is not a valid type value", bytes)
} | [
-1.6852062940597534,
0.11986856907606125,
0.6804019808769226,
-1.1140333414077759,
-0.4171864986419678,
-0.04583774879574776,
0.18586577475070953,
-0.0017833798192441463,
0.7057633399963379,
0.8927969932556152,
-1.0243940353393555,
0.48352566361427307,
-0.560956597328186,
0.581278920173645... |
func sampleQuery(
paramVals func(int) []string,
constraints []stats.Constraint,
vars []string,
) string {
var (
// At least two time constraints, plus any tags.
fixedVars = make([]string, len(vars))
queryConstraints = make([]string, len(constraints))
ps = paramVals(len(constraints))
)
... | [
0.4415235221385956,
-0.24152468144893646,
0.6320342421531677,
-0.4806637763977051,
-0.9332999587059021,
-0.7841473817825317,
-0.1889226734638214,
-0.8662102818489075,
-0.3032950758934021,
0.40441036224365234,
1.085263967514038,
0.3282632529735565,
0.8139167428016663,
-0.21759526431560516,
... |
func (s *SQL) Sample(
constraints []stats.Constraint,
vars ...string,
) (stats.Result, error) {
if len(vars) < 1 {
return nil, errors.New("no vars given")
}
// Make sure all requested vars are legit. If asked for node or
// timestamp, we'll set those separately later, so set flags.
var desiredValues []string... | [
-0.17770101130008698,
0.8500188589096069,
0.6520470976829529,
0.29586660861968994,
-0.6608750820159912,
-0.8911432027816772,
-0.23963071405887604,
-0.9406620264053345,
0.006374803837388754,
0.4732874929904938,
0.9815577268600464,
0.2758843004703522,
0.10926715284585953,
0.2128363847732544,... |
func convertRow(
row *Row,
wantsNode bool,
wantsTimestamp bool,
desiredValues []string,
) *stats.Row {
var (
node string
timestamp time.Time
)
var resultValues map[string]interface{}
if len(desiredValues) > 0 {
resultValues = make(map[string]interface{})
}
for _, v := range desiredValues {
resu... | [
-0.4901730418205261,
1.07470703125,
0.3995583653450012,
-0.05042682960629463,
0.2897065281867981,
-0.8084299564361572,
-1.0108104944229126,
-0.02873484045267105,
0.33924293518066406,
-0.5572641491889954,
0.9363431930541992,
0.5747143626213074,
1.0047847032546997,
0.5906413197517395,
-0.4... |
func (u *Uploader) UploadFromReader(reader io.Reader) (*Media, error) {
var body bytes.Buffer
writer := multipart.NewWriter(&body)
filename := uuid.NewV4().String()
if f, ok := reader.(interface{ Name() string }); ok {
filename = f.Name()
}
part, err := writer.CreateFormFile("media", filepath.Base(filename))
... | [
-0.6329737901687622,
-0.7237527966499329,
0.740831732749939,
-0.029583720490336418,
-1.0437662601470947,
0.04059556871652603,
-0.2707318663597107,
-0.3735573887825012,
0.0220051072537899,
0.6627225279808044,
0.6601220369338989,
-0.6583245992660522,
-0.4024919867515564,
0.758687436580658,
... |
func (u *Uploader) UploadFromFile(filename string) (*Media, error) {
f, err := os.Open(filename)
if err != nil {
return nil, errors.Wrap(err, "cannot open file")
}
defer func() { _ = f.Close() }()
return u.UploadFromReader(f)
} | [
-0.3749888837337494,
0.06625732779502869,
0.537887454032898,
0.023973118513822556,
-0.3747164011001587,
-0.03281713277101517,
0.4392319619655609,
-0.19280269742012024,
-0.7459990382194519,
-0.15707741677761078,
0.2613949179649353,
-0.3801611363887787,
-0.9384452700614929,
0.682488083839416... |
func (u *Uploader) upload(req *http.Request) (*Media, error) {
resp, err := u.hc.Do(req)
if err != nil {
return nil, errors.Wrap(err, "http request failed")
}
defer func() { _ = resp.Body.Close() }()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, errors.Wrap(err, "unreadable http response... | [
-1.0595117807388306,
-0.14255714416503906,
0.8804565668106079,
-0.5717124342918396,
0.15188901126384735,
-0.16629289090633392,
-0.42875057458877563,
-0.5148769021034241,
-0.4049982726573944,
-0.0001971432357095182,
0.20084591209888458,
-0.06484618037939072,
-0.24336355924606323,
0.30122795... |
func New(hc *http.Client, endpoint string) *Uploader {
return &Uploader{hc: hc, endpoint: endpoint}
} | [
0.5530720949172974,
-1.0135389566421509,
0.41111433506011963,
0.279133141040802,
-0.11617933213710785,
-0.29359081387519836,
-1.3247343301773071,
-0.07426868379116058,
-1.0441677570343018,
-0.027585813775658607,
-0.18352173268795013,
0.32918134331703186,
-0.1826924830675125,
0.654252350330... |
func GetStats(c *gin.Context) {
var users []models.User
var hearts []models.Heart
if err := Db.GetCollection("user").Find(bson.M{"dirty": false}).All(&users); err != nil {
c.String(http.StatusInternalServerError, "Could not get database info")
return
}
if err := Db.GetCollection("heart").Find(nil).All(&hearts)... | [
-0.24738191068172455,
0.6572927832603455,
0.7238457202911377,
-0.17676714062690735,
0.21622812747955322,
0.41340047121047974,
0.8378986716270447,
-0.6561614274978638,
-0.24251967668533325,
0.08255204558372498,
-0.36527806520462036,
0.6327499747276306,
0.0575227253139019,
0.8348087072372437... |
func (r *BasicRequest) QueryArgs() (url.Values, error) {
return url.ParseQuery(r.Query)
} | [
-0.47127193212509155,
0.541812539100647,
0.29498377442359924,
-0.14768865704536438,
-0.22947649657726288,
0.07018738240003586,
-1.8582147359848022,
-0.18709273636341095,
-0.18750250339508057,
-0.14456312358379364,
0.3372238278388977,
-0.4168260991573334,
-0.9246518015861511,
0.431185066699... |
func (r *BasicRequest) PathArgs() (map[string]string, error) {
return r.Path, nil
} | [
-1.2126489877700806,
-0.27988487482070923,
0.5237287282943726,
0.1010260209441185,
-0.3591710329055786,
0.3902967870235443,
-0.0007879510521888733,
-0.6522136330604553,
-0.7395215034484863,
0.5538892149925232,
-0.284609854221344,
-0.8116824626922607,
-1.7458643913269043,
0.59222811460495,
... |
func (r *BasicRequest) BodyJSON() (map[string]interface{}, error) {
return ParseJSONBody(strings.NewReader(r.Body))
} | [
-0.9769509434700012,
-1.1454849243164062,
0.49333345890045166,
-0.7928858399391174,
-0.6402660012245178,
0.0200148057192564,
-0.839534342288971,
-0.6565181016921997,
0.09379436075687408,
0.567832350730896,
-1.2465705871582031,
0.06999863684177399,
-0.0313706211745739,
0.7467173337936401,
... |
func (r *BasicRequest) BodyForm() (url.Values, error) {
return url.ParseQuery(r.Body)
} | [
-0.7613375186920166,
0.323140949010849,
0.22942712903022766,
-0.21761292219161987,
0.3185395896434784,
-0.06837999820709229,
-1.4051690101623535,
-0.5859450697898865,
-0.1712767630815506,
-0.8713952898979187,
-0.8961006999015808,
-0.3480105996131897,
-0.26628240942955017,
0.870099365711212... |
func ParseJSONBody(body io.Reader) (map[string]interface{}, error) {
if body == nil {
return nil, nil
}
decoder := json.NewDecoder(body)
parsed := make(map[string]interface{})
if err := decoder.Decode(&parsed); err == io.EOF {
return nil, nil
} else if err != nil {
return nil, err
}
return parsed, nil... | [
-0.7232387065887451,
-0.32236945629119873,
0.6520017385482788,
-0.8554180860519409,
-0.9285010099411011,
-1.017663598060608,
-0.671018123626709,
-0.816335141658783,
1.0171900987625122,
0.5831412076950073,
-0.7722572684288025,
-0.24294863641262054,
-0.37929007411003113,
1.0401414632797241,
... |
func StrEmpty(v, def string) (s string) {
if s = strings.Trim(v, " "); s != "" {
return s
}
return def
} | [
0.025996331125497818,
0.3412887156009674,
0.4599418640136719,
-0.5345214605331421,
-0.21148069202899933,
-0.2515764832496643,
-0.6409304141998291,
-0.46315503120422363,
0.04314122721552849,
1.4979463815689087,
-0.24931053817272186,
0.8390130996704102,
-0.1696077287197113,
-0.86465817689895... |
func Int2Str(v interface{}) (s string) {
switch v.(type) {
case string:
s = v.(string)
case int:
s = strconv.Itoa(v.(int))
}
return
} | [
-0.6941478252410889,
-0.6151329278945923,
0.032187797129154205,
-0.4050348997116089,
-0.4332815110683441,
0.46384602785110474,
-0.4077376425266266,
-0.9461252689361572,
-0.30405017733573914,
0.7160531878471375,
0.4824611246585846,
0.031394585967063904,
-0.0385335311293602,
0.28903761506080... |
func Str2Int(v interface{}) (i int) {
switch v.(type) {
case string:
i, _ = strconv.Atoi(v.(string))
case int:
i = v.(int)
}
return
} | [
-0.7083348631858826,
-1.3398995399475098,
0.2985488176345825,
-0.7855955362319946,
-0.4815939664840698,
-0.1318056881427765,
0.338177353143692,
-0.9298089146614075,
-1.0677719116210938,
0.7134567499160767,
-0.25223758816719055,
0.3029725253582001,
-0.2865789532661438,
-0.3911987841129303,
... |
func Str2Bool(v interface{}) (t bool) {
var i = 0
switch v.(type) {
case string:
i, _ = strconv.Atoi(v.(string))
case int:
i = v.(int)
case bool:
if v.(bool) == true {
i = 1
} else {
i = 0
}
}
if i > 0 {
t = true
}
return
} | [
-1.1934579610824585,
-0.9637220501899719,
0.4962870478630066,
0.015920359641313553,
-0.3456181287765503,
0.10215159505605698,
0.4307767152786255,
-0.47409164905548096,
-0.9557310342788696,
1.0228092670440674,
-0.8188095092773438,
0.24327121675014496,
0.36192503571510315,
-0.503936111927032... |
func (tc *TokenCreate) SetName(s string) *TokenCreate {
tc.mutation.SetName(s)
return tc
} | [
-0.5772850513458252,
0.3450981080532074,
0.2798024117946625,
0.9180448055267334,
-0.6865810751914978,
-0.16421857476234436,
0.1502963900566101,
0.36051392555236816,
-0.05801206827163696,
0.20303073525428772,
-1.3028596639633179,
-0.6213178038597107,
0.529482901096344,
-0.018553806468844414... |
func (tc *TokenCreate) SetSecret(s string) *TokenCreate {
tc.mutation.SetSecret(s)
return tc
} | [
0.13431324064731598,
0.9109222888946533,
0.10402663797140121,
1.0218538045883179,
-0.22811785340309143,
0.061860982328653336,
0.22247852385044098,
-0.09427990764379501,
0.06177783012390137,
-1.1735702753067017,
-1.8319681882858276,
-0.458886057138443,
0.6971812844276428,
-0.203277558088302... |
func (tc *TokenCreate) SetPermissions(t token.Permissions) *TokenCreate {
tc.mutation.SetPermissions(t)
return tc
} | [
-0.4106201231479645,
0.844139039516449,
0.16835728287696838,
0.5547980070114136,
0.006182398647069931,
-0.3282270133495331,
0.41319769620895386,
-0.2091503143310547,
-0.11323665082454681,
-0.716099202632904,
-0.7462048530578613,
-0.9111005663871765,
0.47311317920684814,
0.18109510838985443... |
func (tc *TokenCreate) SetNillablePermissions(t *token.Permissions) *TokenCreate {
if t != nil {
tc.SetPermissions(*t)
}
return tc
} | [
0.23894734680652618,
0.9279544353485107,
0.20329822599887848,
0.058742113411426544,
-0.23389701545238495,
-0.5109999775886536,
-0.1291561722755432,
-0.5242176055908203,
-0.15101931989192963,
-0.3032240569591522,
-0.29219502210617065,
-1.1284518241882324,
-0.560458242893219,
0.1309347152709... |
func (tc *TokenCreate) SetCreatedAt(t time.Time) *TokenCreate {
tc.mutation.SetCreatedAt(t)
return tc
} | [
-0.5157517194747925,
-0.20070485770702362,
0.12207236140966415,
-0.3382870852947235,
-0.0831012949347496,
0.4159117341041565,
-0.41778093576431274,
-0.6114170551300049,
-0.3578234314918518,
-0.9069934487342834,
-1.3240036964416504,
-0.5598366260528564,
0.6624808311462402,
0.456141173839569... |
func (tc *TokenCreate) SetNillableCreatedAt(t *time.Time) *TokenCreate {
if t != nil {
tc.SetCreatedAt(*t)
}
return tc
} | [
0.27915990352630615,
0.10702352225780487,
0.21666495501995087,
-0.37391141057014465,
-0.45513758063316345,
0.7224640250205994,
-0.6170436143875122,
-0.8464348912239075,
-0.4897395074367523,
-0.9439200162887573,
-1.0145304203033447,
-0.8913251161575317,
-0.00584159791469574,
0.2976224124431... |
func (tc *TokenCreate) SetLastUsed(t time.Time) *TokenCreate {
tc.mutation.SetLastUsed(t)
return tc
} | [
-0.13747379183769226,
0.1182229146361351,
0.3917383551597595,
-0.7982913851737976,
0.5355331301689148,
0.5503150820732117,
0.10721512883901596,
0.4264408051967621,
-0.3621576130390167,
-0.3625509440898895,
-1.3382140398025513,
0.1347457319498062,
0.569943904876709,
0.039587948471307755,
... |
func (tc *TokenCreate) SetNillableLastUsed(t *time.Time) *TokenCreate {
if t != nil {
tc.SetLastUsed(*t)
}
return tc
} | [
0.2898673415184021,
0.38727453351020813,
0.2947259843349457,
-0.789734959602356,
-0.0604531355202198,
0.21759125590324402,
-0.4052213728427887,
0.07897201925516129,
-0.23562653362751007,
-0.15049535036087036,
-0.9170203804969788,
-0.6536840200424194,
0.11159814149141312,
-0.159411206841468... |
func (tc *TokenCreate) SetID(u uuid.UUID) *TokenCreate {
tc.mutation.SetID(u)
return tc
} | [
-0.4901294708251953,
0.37837734818458557,
0.20759153366088867,
1.4694448709487915,
-0.07929752767086029,
1.228009581565857,
0.4539175033569336,
0.8431145548820496,
0.8544938564300537,
-0.42887237668037415,
-1.1492433547973633,
0.07970836013555527,
0.14977526664733887,
0.21635682880878448,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.