text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (mt *EnvironmentSingle) Validate() (err error) {
if mt.Data == nil {
err = goa.MergeErrors(err, goa.MissingAttributeError(`response`, "data"))
}
if mt.Data != nil {
if err2 := mt.Data.Validate(); err2 != nil {
err = goa.MergeErrors(err, err2)
}
}
return
} | [
-0.26143619418144226,
0.48448726534843445,
0.570340633392334,
-0.40664947032928467,
0.3436886966228485,
0.7095369100570679,
0.47439253330230713,
-0.14252911508083344,
-0.37402865290641785,
0.1906246840953827,
0.6919019818305969,
0.006573509890586138,
-0.09121797978878021,
0.930730462074279... |
func (c *Client) DecodeEnvironmentSingle(resp *http.Response) (*EnvironmentSingle, error) {
var decoded EnvironmentSingle
err := c.Decoder.Decode(&decoded, resp.Body, resp.Header.Get("Content-Type"))
return &decoded, err
} | [
-0.9041064381599426,
-0.37892985343933105,
0.5324499011039734,
-0.2771400809288025,
-0.3015708923339844,
0.3471496105194092,
0.19873201847076416,
-0.6839215159416199,
0.07863233238458633,
-0.024582982063293457,
-0.41030874848365784,
-0.03596191853284836,
-0.8410317897796631,
-0.20845173299... |
func (mt *EnvironmentsList) Validate() (err error) {
if mt.Data == nil {
err = goa.MergeErrors(err, goa.MissingAttributeError(`response`, "data"))
}
for _, e := range mt.Data {
if e != nil {
if err2 := e.Validate(); err2 != nil {
err = goa.MergeErrors(err, err2)
}
}
}
return
} | [
-0.6768426299095154,
-0.2032831907272339,
0.4181305468082428,
0.2949705719947815,
0.3329295516014099,
0.08742960542440414,
0.029095493257045746,
-0.7244428992271423,
-0.4512476325035095,
0.5593999028205872,
0.7893418669700623,
-0.7071611285209656,
-0.2072310745716095,
1.3587146997451782,
... |
func (c *Client) DecodeEnvironmentsList(resp *http.Response) (*EnvironmentsList, error) {
var decoded EnvironmentsList
err := c.Decoder.Decode(&decoded, resp.Body, resp.Header.Get("Content-Type"))
return &decoded, err
} | [
-1.4701465368270874,
-0.8264753222465515,
0.5097946524620056,
0.2243918627500534,
-0.15315963327884674,
-0.04078542813658714,
-0.013810521923005581,
-1.0820053815841675,
0.728875994682312,
0.27943089604377747,
-0.9319087266921997,
-0.8343186974525452,
-0.6854128241539001,
0.431324928998947... |
func (mt *Status) Validate() (err error) {
if mt.Commit == "" {
err = goa.MergeErrors(err, goa.MissingAttributeError(`response`, "commit"))
}
if mt.BuildTime == "" {
err = goa.MergeErrors(err, goa.MissingAttributeError(`response`, "buildTime"))
}
if mt.StartTime == "" {
err = goa.MergeErrors(err, goa.Missing... | [
-0.23652726411819458,
-0.8899595141410828,
0.41787755489349365,
-0.2361558973789215,
-0.118981271982193,
0.19186969101428986,
-0.23713798820972443,
-0.2719839811325073,
-0.6776711940765381,
-0.29334524273872375,
0.1287580281496048,
-0.4029110074043274,
-0.05380936339497566,
0.9686451554298... |
func (c *Client) DecodeStatus(resp *http.Response) (*Status, error) {
var decoded Status
err := c.Decoder.Decode(&decoded, resp.Body, resp.Header.Get("Content-Type"))
return &decoded, err
} | [
-0.19725345075130463,
-1.243255853652954,
0.10266170650720596,
-0.11443056911230087,
-0.5717554688453674,
-0.3802241086959839,
-0.650863766670227,
0.13833950459957123,
0.5832163095474243,
-0.425846129655838,
-1.3619725704193115,
0.2109098881483078,
-0.2860415577888489,
0.13552135229110718,... |
func (d databaseAnalyzer) Analyzers(ctx context.Context) (AnalyzersResponseReader, error) {
url := d.db.url("_api", "analyzer")
var response struct {
shared.ResponseStruct `json:",inline"`
Analyzers connection.Array `json:"result,omitempty"`
}
resp, err := connection.CallGet(ctx, d.db.connection()... | [
-1.4102851152420044,
-0.28787872195243835,
0.14372709393501282,
-0.26997485756874084,
0.2116498053073883,
-0.7873204350471497,
-0.6923312544822693,
-0.5393117070198059,
0.2962988018989563,
-0.11891953647136688,
0.40470126271247864,
0.2275189459323883,
-0.7028025984764099,
0.181255161762237... |
func (*DeleteScanTemplate) Name() string {
return "delete-scan-template"
} | [
-0.15199494361877441,
-0.7206317186355591,
0.5134467482566833,
0.3116985261440277,
-1.292206048965454,
-0.0161602683365345,
-0.15471598505973816,
-0.13529403507709503,
0.8432255387306213,
0.8527999520301819,
-0.8367213010787964,
-0.9964373707771301,
0.32925400137901306,
0.2622194290161133,... |
func (t triangle) getArea() float64 {
tArea := 0.5 * t.base * t.height
return tArea
} | [
0.25015372037887573,
-0.5862969160079956,
0.31014639139175415,
0.15178079903125763,
0.15966551005840302,
-0.03158099949359894,
0.893182635307312,
-0.5517762303352356,
-0.4221954941749573,
0.1361156553030014,
0.7752614617347717,
-0.2943944036960602,
0.5117518305778503,
0.906340479850769,
... |
func (sq square) getArea() float64 {
sqArea := sq.sideLength * sq.sideLength
return sqArea
} | [
0.5207924842834473,
0.01959897391498089,
0.6247318387031555,
-0.4755178987979889,
0.27440959215164185,
-0.3562808930873871,
0.16015852987766266,
-0.2151913344860077,
0.9912387728691101,
-0.4673665165901184,
0.03808275982737541,
0.4985467195510864,
0.05254016071557999,
1.556807518005371,
... |
func printArea(s shape) {
fmt.Println(s.getArea())
} | [
0.20453456044197083,
-1.0367687940597534,
0.3273415267467499,
-0.24516768753528595,
0.1919707953929901,
-0.4163494408130646,
0.4637978971004486,
-0.12781940400600433,
0.5412219762802124,
-0.2569861114025116,
0.6168105602264404,
1.5352985858917236,
0.5459804534912109,
1.464261770248413,
-... |
func main() {
t := triangle{
height: 2.4,
base: 4.2,
}
// calcuate area of triangular shape
fmt.Println("Area of the triangle is:")
printArea(t)
sq := square{
sideLength: 2.5,
}
// calculate area of sqaure
fmt.Println("Area of the square is:")
printArea(sq)
} | [
0.7317005395889282,
-0.660563588142395,
0.6691208481788635,
0.07685337960720062,
0.07982660084962845,
0.35148775577545166,
0.9151870012283325,
0.21441558003425598,
0.16991767287254333,
-0.08489009737968445,
-0.9371421933174133,
0.3492516279220581,
0.7067347168922424,
0.18182390928268433,
... |
func indentTail(spaces int, s string) string {
prefix := strings.Repeat(" ", spaces)
lines := strings.Split(s, "\n")
for i, line := range lines[1:] {
lines[i+1] = prefix + line
}
return strings.Join(lines, "\n")
} | [
1.1660610437393188,
-0.3201374411582947,
0.7093271613121033,
-1.0874658823013306,
-0.7140449285507202,
-0.6504349112510681,
-0.3682859241962433,
0.3278163969516754,
0.08206575363874435,
0.02388180047273636,
-0.024556702002882957,
1.5593000650405884,
0.006585545372217894,
-0.395556837320327... |
func Init(clientid string, scope string) (string, string, error) {
if clientid == "" {
return "", "", errors.New("No Client ID Provided")
}
scopelist := []string{"", "repo", "repo:status",
"repo_deployment", "public_repo", "repo:invite",
"security_events", "admin:repo_hook", "write:repo_hook",
"read:repo_hoo... | [
-0.47382545471191406,
-0.39752525091171265,
1.128198266029358,
-0.37154000997543335,
-0.03076326660811901,
-0.11958515644073486,
0.13815221190452576,
-0.23735418915748596,
0.12920290231704712,
0.9019292593002319,
-0.27334585785865784,
1.1240644454956055,
-0.43324604630470276,
0.79821085929... |
func GetAuthToken(clientid string, devicecode string) (string, error) {
var authtoken string
client := resty.New()
resp, err := client.R().
SetQueryString("client_id="+clientid+"&device_code="+devicecode+"&grant_type=urn:ietf:params:oauth:grant-type:device_code").
SetHeader("User-Agent", "libgithubauth <https://... | [
-0.6629766225814819,
-0.03821485489606857,
0.846355676651001,
-0.2099832147359848,
-0.13548316061496735,
-0.21760092675685883,
0.48110097646713257,
0.4069978892803192,
-0.2654778063297272,
-0.051058392971754074,
0.5953323841094971,
1.2648051977157593,
-0.2823653221130371,
0.457260102033615... |
func Clear() error {
gl.Clear(gl.COLOR_BUFFER_BIT)
return checkForErrors()
} | [
0.7219311594963074,
0.5498359799385071,
0.2726498544216156,
0.5004613399505615,
-0.5610133409500122,
1.493309736251831,
0.36855611205101013,
-2.033562183380127,
-0.5070998072624207,
-0.4755244255065918,
0.36622610688209534,
0.628852367401123,
0.014443430118262768,
0.7495301961898804,
0.3... |
func SetClearColor(r uint8, g uint8, b uint8) {
gl.ClearColor(gl.Float(r)/255, gl.Float(g)/255, gl.Float(b)/255, 1.0)
} | [
1.1521577835083008,
-0.45482754707336426,
0.49253103137016296,
-0.34019362926483154,
-0.3654842972755432,
0.6644013524055481,
-0.1631172150373459,
-0.6852340698242188,
-0.3006075620651245,
0.7098631858825684,
-0.06160280480980873,
0.668291449546814,
0.17038355767726898,
0.3055446147918701,... |
func UseEffect(effect *Effect) error {
gl.UseProgram(effect.program)
effect.uniforms = make(map[string]gl.Int)
paunchEffect = effect
return checkForErrors()
} | [
-0.2315969616174698,
0.6122771501541138,
0.3543057441711426,
-0.8203983306884766,
0.11036646366119385,
-0.1700953245162964,
0.9099098443984985,
0.00803359504789114,
0.7696282863616943,
-0.23912131786346436,
-0.8596599102020264,
0.03809436783194542,
-0.5037906765937805,
0.9259809255599976,
... |
func DisableEffects() {
gl.UseProgram(0)
paunchEffect = nil
} | [
1.3762993812561035,
0.16183717548847198,
0.2407844215631485,
-0.7366901636123657,
0.08167828619480133,
0.21547546982765198,
1.3417993783950806,
0.7044978141784668,
0.5250496864318848,
-1.1514776945114136,
-1.048420786857605,
-0.32519808411598206,
-1.2909356355667114,
-0.0017323759384453297... |
func newBlockchain(opts ...emulator.Option) *emulator.Blockchain {
b, err := emulator.NewBlockchain(
append(
[]emulator.Option{
emulator.WithStorageLimitEnabled(false),
},
opts...,
)...,
)
if err != nil {
panic(err)
}
return b
} | [
0.06648989766836166,
0.3315322995185852,
0.45555973052978516,
1.1354581117630005,
-0.18529999256134033,
-0.43703073263168335,
0.12822358310222626,
-0.34619438648223877,
0.48552659153938293,
0.07044029235839844,
-0.5956025123596191,
0.219330295920372,
-0.7577711343765259,
0.2945217788219452... |
func signAndSubmit(
t *testing.T,
b *emulator.Blockchain,
tx *flow.Transaction,
signerAddresses []flow.Address,
signers []crypto.Signer,
shouldRevert bool,
) {
// sign transaction with each signer
for i := len(signerAddresses) - 1; i >= 0; i-- {
signerAddress := signerAddresses[i]
signer := signers[i]
if... | [
-0.32558149099349976,
-0.23453594744205475,
0.5725933909416199,
0.3211981952190399,
0.139129176735878,
0.0913219079375267,
-0.38763344287872314,
0.7982862591743469,
-0.4560564458370209,
0.3074606657028198,
0.19671426713466644,
-0.19211255013942719,
-0.7971770763397217,
0.868932843208313,
... |
func Submit(
t *testing.T,
b *emulator.Blockchain,
tx *flow.Transaction,
shouldRevert bool,
) {
// submit the signed transaction
err := b.AddTransaction(*tx)
require.NoError(t, err)
result, err := b.ExecuteNextTransaction()
require.NoError(t, err)
if shouldRevert {
assert.True(t, result.Reverted())
} els... | [
0.46117883920669556,
0.7128938436508179,
0.759304404258728,
0.32295501232147217,
0.42846280336380005,
0.8281762003898621,
-0.5735309720039368,
0.2437337338924408,
-0.30163219571113586,
-0.07697373628616333,
-0.30932435393333435,
0.4598948061466217,
-1.1390283107757568,
-0.33845487236976624... |
func executeScriptAndCheck(t *testing.T, b *emulator.Blockchain, script []byte, arguments [][]byte) cadence.Value {
result, err := b.ExecuteScript(script, arguments)
require.NoError(t, err)
if !assert.True(t, result.Succeeded()) {
t.Log(result.Error.Error())
}
return result.Value
} | [
-0.1818239390850067,
-0.09696080535650253,
0.5844526886940002,
0.5496699810028076,
0.36531391739845276,
0.4828875660896301,
0.5457893013954163,
-0.6735886931419373,
-0.016779493540525436,
0.5883697867393494,
0.2738233506679535,
0.42305275797843933,
-1.191899061203003,
-0.14630991220474243,... |
func CadenceUFix64(value string) cadence.Value {
newValue, err := cadence.NewUFix64(value)
if err != nil {
panic(err)
}
return newValue
} | [
-0.18642158806324005,
0.4473487138748169,
0.19196219742298126,
1.137410044670105,
-0.01854560151696205,
-0.4619131088256836,
0.6534783244132996,
-0.05032724142074585,
0.1742907613515854,
-0.11726243793964386,
-0.44519469141960144,
-0.41690582036972046,
0.31865742802619934,
-0.1886817067861... |
func assertEqual(t *testing.T, expected, actual interface{}) bool {
if assert.ObjectsAreEqual(expected, actual) {
return true
}
message := fmt.Sprintf(
"Not equal: \nexpected: %s\nactual : %s",
expected,
actual,
)
return assert.Fail(t, message)
} | [
-0.3660435378551483,
-0.12244261056184769,
0.6255350708961487,
0.46808433532714844,
0.976279616355896,
0.6640024781227112,
0.3364015817642212,
-0.6716488599777222,
-0.7847703099250793,
1.5294883251190186,
-0.37529897689819336,
-0.08511839061975479,
-0.4112757444381714,
0.3536275029182434,
... |
func (bbc *MockBlueButtonClient) getData(endpoint, patientID string) (string, error) {
fData, err := ioutil.ReadFile("../shared_files/synthetic_beneficiary_data/" + endpoint)
if err != nil {
return "", err
}
cleanData := strings.Replace(string(fData), "20000000000001", patientID, -1)
return cleanData, err
} | [
-0.09407177567481995,
0.21447238326072693,
0.6040816307067871,
-0.136044442653656,
0.7529334425926208,
0.37534868717193604,
0.1899876743555069,
0.4999435245990753,
-0.28018423914909363,
-0.13655361533164978,
0.058057717978954315,
1.13558030128479,
0.06277109682559967,
-0.3436669707298279,
... |
func NewRequestValidator(ctx *pulumi.Context,
name string, args *RequestValidatorArgs, opts ...pulumi.ResourceOption) (*RequestValidator, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.RestApi == nil {
return nil, errors.New("invalid value for required argu... | [
-0.9957044720649719,
-0.1170995682477951,
0.3758481442928314,
0.07351137697696686,
-0.8683161735534668,
0.7365789413452148,
-0.9328181147575378,
0.1583814024925232,
0.4809421896934509,
-0.7194231152534485,
-0.20218835771083832,
0.6261829137802124,
-0.6185410618782043,
0.029730670154094696,... |
func GetRequestValidator(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *RequestValidatorState, opts ...pulumi.ResourceOption) (*RequestValidator, error) {
var resource RequestValidator
err := ctx.ReadResource("aws:apigateway/requestValidator:RequestValidator", name, id, state, &resource, opts...)
if er... | [
-0.930875301361084,
-0.2027333676815033,
0.2584930658340454,
0.05343260243535042,
-0.6746264696121216,
0.4513022005558014,
-0.9594424366950989,
-0.19520485401153564,
1.1617454290390015,
-1.1662472486495972,
0.48760509490966797,
1.4379147291183472,
-0.2563149929046631,
-0.8458559513092041,
... |
func (o RequestValidatorOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *RequestValidator) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
} | [
-0.8759646415710449,
-0.8610091209411621,
0.26973217725753784,
0.21960768103599548,
-1.0032135248184204,
0.9164762496948242,
-0.349312961101532,
-0.027386074885725975,
-0.0600406676530838,
-0.40492841601371765,
0.14836542308330536,
0.4968010485172272,
0.8050851225852966,
-0.432620793581008... |
func (o RequestValidatorOutput) RestApi() pulumi.StringOutput {
return o.ApplyT(func(v *RequestValidator) pulumi.StringOutput { return v.RestApi }).(pulumi.StringOutput)
} | [
-0.09188558906316757,
-1.3442888259887695,
0.35135388374328613,
0.7215908765792847,
-0.57955002784729,
0.8787055015563965,
-0.43876299262046814,
0.06841303408145905,
0.24627536535263062,
-0.9468904137611389,
0.20711231231689453,
0.7756990790367126,
0.09353519231081009,
-1.150794267654419,
... |
func (o RequestValidatorOutput) ValidateRequestBody() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *RequestValidator) pulumi.BoolPtrOutput { return v.ValidateRequestBody }).(pulumi.BoolPtrOutput)
} | [
-0.6286646127700806,
-0.059783101081848145,
0.4109622836112976,
0.6776480078697205,
-0.03203514963388443,
0.9226458668708801,
-0.4618387520313263,
0.3401581346988678,
0.7648791074752808,
-0.2269936352968216,
0.053267646580934525,
0.1460084468126297,
-0.5729886293411255,
-0.2932119965553283... |
func (o RequestValidatorOutput) ValidateRequestParameters() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *RequestValidator) pulumi.BoolPtrOutput { return v.ValidateRequestParameters }).(pulumi.BoolPtrOutput)
} | [
-1.2276711463928223,
-0.10273454338312149,
0.5336623191833496,
0.6213540434837341,
0.19779478013515472,
1.0049476623535156,
-0.3909406363964081,
0.314231812953949,
0.07039141654968262,
0.14061658084392548,
0.2582509219646454,
0.6845356225967407,
-0.43207186460494995,
-0.27245649695396423,
... |
func getPort() string {
port := os.Getenv("PORT")
// Set a default port if there is nothing in the environment
if port == "" {
port = "4747"
fmt.Println("INFO: No PORT environment variable detected, defaulting to " + port)
}
return ":" + port
} | [
0.6838313341140747,
-0.3428272306919098,
0.6053924560546875,
0.5467381477355957,
1.1763584613800049,
0.6458672881126404,
0.14566680788993835,
-0.07960871607065201,
-0.6377789378166199,
0.16427141427993774,
0.7748115062713623,
0.5561096668243408,
-0.588850736618042,
0.4819593131542206,
1.... |
func NewRPCRequest(r io.Reader) *rpcRequest {
var buf bytes.Buffer
done := make(chan bool)
return &rpcRequest{r, &buf, done}
} | [
-0.38824453949928284,
-0.8232720494270325,
0.4174920618534088,
-0.9422081112861633,
-0.8410890102386475,
0.03010695055127144,
-0.5372172594070435,
-1.2065658569335938,
0.29276642203330994,
-0.004669171757996082,
-0.22019273042678833,
-0.0727102980017662,
-0.4847516417503357,
0.462261766195... |
func (r *rpcRequest) Read(p []byte) (n int, err error) {
return r.r.Read(p)
} | [
-0.8901100158691406,
0.040146950632333755,
0.4499174654483795,
-0.1753811538219452,
0.1507871299982071,
0.4021624028682709,
-0.3409642279148102,
-0.8925300240516663,
0.3581172525882721,
-0.170319065451622,
0.5312820076942444,
-0.020996540784835815,
-1.7479523420333862,
0.12284445762634277,... |
func (r *rpcRequest) Write(p []byte) (n int, err error) {
n, err = r.rw.Write(p)
r.done <- true
return n, err
} | [
-1.7700395584106445,
0.6165739297866821,
0.6359801888465881,
0.16302986443042755,
0.654460072517395,
0.0846954733133316,
0.3925361633300781,
-0.2647888958454132,
-0.02198408730328083,
0.16161972284317017,
-0.5664935111999512,
-0.4784235656261444,
-2.0623269081115723,
0.618522584438324,
0... |
func (r *rpcRequest) Close() error {
return nil
} | [
-0.4726582169532776,
-0.44855278730392456,
0.5323412418365479,
-0.24797610938549042,
-0.3862571716308594,
1.1610018014907837,
-0.4163680672645569,
-1.3801239728927612,
-0.29387736320495605,
-1.2145582437515259,
0.8186670541763306,
0.13525697588920593,
-1.8481991291046143,
0.843659877777099... |
func (r *rpcRequest) Call() io.Reader {
go jsonrpc.ServeConn(r)
<-r.done
return r.rw
} | [
-1.4825342893600464,
-0.3674073815345764,
0.671068012714386,
-0.5419253706932068,
-0.3511219024658203,
0.5692442655563354,
-0.9947859644889832,
-1.0686800479888916,
-1.1801985502243042,
-0.09040216356515884,
1.0388374328613281,
0.39144131541252136,
-1.5186156034469604,
0.29442980885505676,... |
func (hooks *Hooks) SetDefaults() {
if hooks.OnClientConnected == nil {
hooks.OnClientConnected = func(_ *Client) {}
}
if hooks.OnClientDisconnected == nil {
hooks.OnClientDisconnected = func(_ *Client) {}
}
if hooks.OnSignal == nil {
hooks.OnSignal = func(_ context.Context) {}
}
if hooks.OnRequest == n... | [
-0.22648946940898895,
-0.02675861306488514,
0.6529384851455688,
0.030427513644099236,
0.7861186265945435,
0.032491229474544525,
0.1013273149728775,
-0.9305319786071777,
-0.08094949275255203,
-0.06914431601762772,
-0.40539923310279846,
0.42873525619506836,
-1.0965343713760376,
1.09021818637... |
func NewServer(opts Options) *Server {
opts.SetDefaults()
sessionsEnabled := false
if opts.Hooks.OnSessionCreated != nil &&
opts.Hooks.OnSessionLookup != nil &&
opts.Hooks.OnSessionClosed != nil {
sessionsEnabled = true
}
srv := Server{
hooks: opts.Hooks,
// State
clients: make([]*Client, 0)... | [
-0.37397459149360657,
-0.5183739066123962,
0.829323410987854,
0.08206944912672043,
-0.06325916200876236,
-0.02785874716937542,
0.7333444952964783,
-0.7403026223182678,
0.9870133399963379,
0.5543261170387268,
-0.09899251908063889,
1.1245927810668945,
-0.8935536742210388,
0.35487014055252075... |
func (srv *Server) handleSessionRestore(msg *Message) error {
if !srv.sessionsEnabled {
msg.fail(Error{
"SESSIONS_DISABLED",
"Sessions are disabled on this server instance",
})
return nil
}
key := string(msg.Payload.Data)
sessionExists := srv.SessionRegistry.Exists(key)
if sessionExists {
msg.fail... | [
-0.24275217950344086,
0.08617755025625229,
0.8763120770454407,
-0.3096964955329895,
0.00739359250292182,
-0.6717663407325745,
0.09804029017686844,
-0.3566010594367981,
0.910069465637207,
0.5990356802940369,
-0.33235618472099304,
0.14815296232700348,
-1.3489686250686646,
-0.7981364727020264... |
func (srv *Server) handleSessionClosure(msg *Message) error {
if !srv.sessionsEnabled {
msg.fail(Error{
"SESSIONS_DISABLED",
"Sessions are disabled on this server instance",
})
return nil
}
if msg.Client.Session == nil {
// Send confirmation even though no session was closed
msg.fulfill(Payload{})
... | [
0.1488410383462906,
-0.05957946926355362,
0.8331036567687988,
-0.07413937151432037,
-0.15303334593772888,
-0.7649152278900146,
0.3101382255554199,
-0.4561726152896881,
0.8897685408592224,
0.3526013195514679,
0.5798661112785339,
0.31609582901000977,
-0.7315122485160828,
0.7774412631988525,
... |
func (srv *Server) handleSignal(msg *Message) {
srv.hooks.OnSignal(context.WithValue(context.Background(), Msg, *msg))
} | [
-0.14742501080036163,
0.19747760891914368,
0.4734713137149811,
0.7608019709587097,
0.16339011490345,
0.4695179760456085,
-0.0495530366897583,
-0.4221048951148987,
0.0265241339802742,
-0.18255548179149628,
-0.13557259738445282,
0.22688885033130646,
-0.8384746313095093,
1.5553725957870483,
... |
func (srv *Server) handleRequest(msg *Message) {
replyPayload, err := srv.hooks.OnRequest(
context.WithValue(context.Background(), Msg, *msg),
)
if err != nil {
msg.fail(*err)
return
}
msg.fulfill(replyPayload)
} | [
-0.2500210404396057,
0.6190539002418518,
0.7325188517570496,
-0.2563490867614746,
0.8308210372924805,
0.49830520153045654,
-0.29232364892959595,
-0.4201323390007019,
-0.03441331163048744,
-0.202927365899086,
1.362798810005188,
0.15572553873062134,
-0.9722082018852234,
0.6873675584793091,
... |
func (srv *Server) handleMetadata(resp http.ResponseWriter) {
resp.Header().Set("Content-Type", "application/json")
resp.Header().Set("Access-Control-Allow-Origin", "*")
json.NewEncoder(resp).Encode(struct {
ProtocolVersion string `json:"protocol-version"`
}{
protocolVersion,
})
} | [
-0.12214715033769608,
-1.1581112146377563,
0.641043484210968,
0.09761357307434082,
0.03658195585012436,
0.9518157243728638,
-0.09952430427074432,
0.047614701092243195,
-0.19447411596775055,
0.8980423808097839,
-0.7115438580513,
0.4852072596549988,
-0.2829347550868988,
-0.11175498366355896,... |
func (srv *Server) handleMessage(msg *Message) error {
switch msg.msgType {
case MsgSignalBinary:
fallthrough
case MsgSignalUtf8:
fallthrough
case MsgSignalUtf16:
srv.handleSignal(msg)
case MsgRequestBinary:
fallthrough
case MsgRequestUtf8:
fallthrough
case MsgRequestUtf16:
srv.handleRequest(msg)
... | [
-0.4237072467803955,
0.3789159953594208,
0.62651127576828,
0.2087874412536621,
0.0082664480432868,
0.0794086754322052,
0.32822245359420776,
-1.2055940628051758,
1.0055735111236572,
-0.40450942516326904,
0.3470146954059601,
-0.3924580216407776,
-1.1674572229385376,
1.0210933685302734,
0.4... |
func (srv *Server) ServeHTTP(
resp http.ResponseWriter,
req *http.Request,
) {
switch req.Method {
case "OPTIONS":
srv.hooks.OnOptions(resp)
return
case "WEBWIRE":
srv.handleMetadata(resp)
return
}
// Establish connection
conn, err := srv.upgrader.Upgrade(resp, req, nil)
if err != nil {
srv.errorLog... | [
0.31177711486816406,
-0.37334758043289185,
0.9510253071784973,
-0.2706200182437897,
0.28296592831611633,
-0.029331063851714134,
0.6698378324508667,
-0.8786522150039673,
-0.19591622054576874,
0.7389707565307617,
0.11581937968730927,
0.07868238538503647,
-0.7602415084838867,
0.32094529271125... |
func CheckDown(c *gin.Context) (int, interface{}) {
// Check down is forbidden if the competition isn't start.
if timer.Get().Status != "on" {
return utils.MakeErrJSON(403, 40310,
locales.I18n.T(c.GetString("lang"), "general.not_begin"),
)
}
type InputForm struct {
GameBoxID uint `binding:"required"`
}
... | [
-0.7836269736289978,
0.03126911073923111,
1.2001686096191406,
-0.06719760596752167,
0.05080866441130638,
0.19034922122955322,
0.8932969570159912,
-0.27752724289894104,
0.10672569274902344,
0.6174007058143616,
0.33658745884895325,
0.3136895000934601,
-1.221601128578186,
0.544310986995697,
... |
func (settings *Settings) Save(path string) error {
content, err := json.Marshal(settings)
if err != nil {
return err
}
return ioutil.WriteFile(path, content, 0644)
} | [
-0.7062097787857056,
0.017804384231567383,
0.3133601248264313,
-0.6545702219009399,
0.5864576101303101,
-0.3674626648426056,
0.28078824281692505,
-1.350447416305542,
-0.9913164973258972,
1.268294095993042,
-1.5436009168624878,
-0.31810298562049866,
-0.4223862290382385,
-0.09113700687885284... |
func MySets(db XODB, schema string) ([]*Set, error) {
var err error
// sql query
const sqlstr = `SELECT ` +
`DISTINCT column_name AS set_name, table_name ` +
`FROM information_schema.columns ` +
`WHERE data_type = 'set' AND table_schema = ?`
// run query
XOLog(sqlstr, schema)
q, err := db.Query(sqlstr, sc... | [
-0.5778095722198486,
0.1990300714969635,
0.6952403783798218,
-0.0684879794716835,
-0.4952022135257721,
-0.18357141315937042,
-0.5769160985946655,
-0.14010313153266907,
-0.15131139755249023,
0.3694126009941101,
-0.389357328414917,
0.23203632235527039,
-0.8173155784606934,
0.2457581162452697... |
func NewBucketNgrams(random *rand.Rand, numberOfBuckets int, queueSize int) Ngrams {
b := &bucketNgrams{
numberOfBuckets: numberOfBuckets,
buckets: make([]*bucket, numberOfBuckets),
}
for i := 0; i < numberOfBuckets; i = i + 1 {
b.buckets[i] = &bucket{
frequencies: map[string]*wordFreq{},
random:... | [
-0.45829254388809204,
0.1587708592414856,
0.5572857856750488,
-0.19309960305690765,
-0.22641225159168243,
-0.3442508280277252,
-0.0938347578048706,
-1.3135066032409668,
-0.7740564346313477,
-0.44158312678337097,
-0.47172632813453674,
0.01894814521074295,
-0.4720483422279358,
0.414206564426... |
func getBucketId(key string, numBuckets int) int {
if numBuckets == 0 {
return 0
}
var keyVal int64
for _, r := range key {
keyVal = keyVal + int64(r)
}
rand.Seed(keyVal)
return rand.Intn(numBuckets)
} | [
-0.1385851502418518,
0.3598339259624481,
0.6378015875816345,
-0.46675533056259155,
0.0031005062628537416,
0.46735021471977234,
-0.13279195129871368,
-0.32947438955307007,
0.1914186030626297,
-0.006759489420801401,
-0.03525932878255844,
0.14499802887439728,
-0.35638514161109924,
0.102051958... |
func (c *Collector) FilterInvalidObjects(objs object.UnstructuredSet) object.UnstructuredSet {
var diff object.UnstructuredSet
for _, obj := range objs {
if !c.InvalidIds.Contains(object.UnstructuredToObjMetadata(obj)) {
diff = append(diff, obj)
}
}
return diff
} | [
-0.3755059540271759,
-0.8531064987182617,
0.5549042224884033,
-0.12783050537109375,
-0.6135188341140747,
0.8600009083747864,
-0.07060100138187408,
-0.14640477299690247,
-0.16292507946491241,
-0.190737783908844,
0.22875644266605377,
0.0804041177034378,
-0.8656579852104187,
-0.28309354186058... |
func (c *Collector) FilterInvalidIds(ids object.ObjMetadataSet) object.ObjMetadataSet {
return ids.Diff(c.InvalidIds)
} | [
-0.3820820748806,
-1.2204804420471191,
0.2763543725013733,
-0.5841356515884399,
-0.9633835554122925,
0.43496572971343994,
-0.3097171485424042,
0.3173128664493561,
0.2431405931711197,
-0.5375815033912659,
0.7042292952537537,
0.7121855616569519,
-0.8583411574363708,
-0.3024943768978119,
-0... |
func NewJSONGroupWriter(outputDir string, countPerFile uint64) JSONGroupWriter {
return JSONGroupWriter{
outDir: outputDir,
count: countPerFile,
recs: make([]interface{}, countPerFile),
}
} | [
-1.0649991035461426,
-0.3095967471599579,
0.5110007524490356,
0.5075609087944031,
-1.2440636157989502,
-1.0783624649047852,
1.026654839515686,
-0.17941908538341522,
-1.175929307937622,
-0.14813604950904846,
0.5417368412017822,
0.0977768674492836,
0.16135600209236145,
0.44224613904953003,
... |
func IndexFixer(index int, listSize int) int {
index = index - 1
if index <= 0 {
index = 0
} else if index > listSize-1 {
index = listSize - 1
}
return index
} | [
-0.8167526125907898,
-0.5385769605636597,
0.44874414801597595,
0.31775015592575073,
-0.18933412432670593,
0.041131772100925446,
0.2955649197101593,
0.7485763430595398,
0.5265169143676758,
-0.43656009435653687,
-0.6755463480949402,
0.8585436940193176,
-0.968250572681427,
1.0254278182983398,... |
func CFAddParams1(ps *param.PSet) error {
ps.Add("example1",
psetter.Bool{Value: &CFValExample1},
"here is where you would describe the parameter",
param.AltNames("e1"))
return nil
} | [
0.13592031598091125,
0.5689160227775574,
0.36284780502319336,
0.18386207520961761,
0.12575367093086243,
1.0727225542068481,
-0.2668275535106659,
0.05925780534744263,
-0.46640005707740784,
1.1131218671798706,
0.26962101459503174,
0.7130939960479736,
-0.12910616397857666,
1.5661985874176025,... |
func CFAddParams2(ps *param.PSet) error {
ps.Add("example2",
psetter.Int64{Value: &CFValExample2},
"the description of the parameter",
param.AltNames("e2"))
return nil
} | [
0.26568326354026794,
-0.0733407661318779,
0.3691489100456238,
-0.2735491991043091,
-0.10214363783597946,
0.42751505970954895,
-0.611572802066803,
-0.7309355735778809,
-0.6928822994232178,
0.5595396757125854,
0.12320831418037415,
0.8477588891983032,
0.04962771385908127,
1.9333447217941284,
... |
func resetParamVals() {
paramInt1 = 0
paramInt2 = 0
paramBool1 = false
paramBool2 = false
} | [
-0.6183562278747559,
-0.6171733140945435,
0.25582292675971985,
0.6546840667724609,
0.29099103808403015,
0.7676675915718079,
-0.36618372797966003,
-0.09872610867023468,
-2.0991811752319336,
0.12766747176647186,
-0.5560990571975708,
0.7998834848403931,
-0.635225236415863,
0.28952762484550476... |
func valsCheck(t *testing.T, testID string, vals expVals) {
t.Helper()
var nameLogged bool
if paramInt1 != vals.pi1Val {
nameLogged = logName(t, nameLogged, testID)
t.Errorf("\t: unexpected values: paramInt1 = %d, should be %d\n",
paramInt1, vals.pi1Val)
}
if paramInt2 != vals.pi2Val {
nameLogged = logN... | [
-0.14910219609737396,
-0.0911826491355896,
0.6574741005897522,
0.5249903202056885,
0.26108139753341675,
1.2006511688232422,
-0.5000950694084167,
-0.06912099570035934,
-0.2863876521587372,
-0.27170610427856445,
0.1411120593547821,
0.2218884974718094,
0.21745608747005463,
0.4702608287334442,... |
func toRGBA(i image.Image) *image.RGBA {
bounds := i.Bounds()
ni := image.NewRGBA(image.Rect(0, 0, bounds.Dx(), bounds.Dy()))
draw.Draw(ni, ni.Bounds(), i, bounds.Min, draw.Src)
return ni
} | [
-0.7458893656730652,
-0.30859804153442383,
0.670038640499115,
-0.7204614877700806,
0.6918089389801025,
0.0051443977281451225,
0.9310197830200195,
-1.0775043964385986,
0.15244612097740173,
0.06652045249938965,
0.06993599236011505,
0.7738081216812134,
-0.6321610808372498,
0.45196831226348877... |
func (b Buffer) At(x, y int) Cell {
return b.CellMap[image.Pt(x, y)]
} | [
-0.7259049415588379,
-0.9725565910339355,
0.5265049338340759,
-0.6940250396728516,
0.21423575282096863,
0.3802672028541565,
-0.5217837691307068,
-1.85910964012146,
-0.5142170786857605,
-0.39712876081466675,
0.08638855069875717,
1.3269574642181396,
0.501136064529419,
-0.6384251117706299,
... |
func (b Buffer) Set(x, y int, c Cell) {
b.CellMap[image.Pt(x, y)] = c
} | [
-0.05374116823077202,
-0.5265012383460999,
0.1524578332901001,
-0.4632711112499237,
0.51786869764328,
0.8755128383636475,
-0.04719498008489609,
-1.2619274854660034,
-0.6011467576026917,
-0.19979724287986755,
-0.7135934233665466,
0.7360867261886597,
0.19056648015975952,
-0.15265071392059326... |
func (b Buffer) Bounds() image.Rectangle {
x0, y0, x1, y1 := 0, 0, 0, 0
for p := range b.CellMap {
if p.X > x1 {
x1 = p.X
}
if p.X < x0 {
x0 = p.X
}
if p.Y > y1 {
y1 = p.Y
}
if p.Y < y0 {
y0 = p.Y
}
}
return image.Rect(x0, y0, x1+1, y1+1)
} | [
-0.444121390581131,
-1.0099577903747559,
0.7884491682052612,
0.08108833432197571,
-0.13270248472690582,
0.6457031965255737,
0.0018587666563689709,
-0.4099593758583069,
0.21011491119861603,
-0.5432267189025879,
0.29300424456596375,
0.26345187425613403,
-0.5248218178749084,
0.246979698538780... |
func (b *Buffer) SetArea(r image.Rectangle) {
b.Area.Max = r.Max
b.Area.Min = r.Min
} | [
-0.7902244329452515,
-0.7283202409744263,
0.49823567271232605,
0.44427305459976196,
-0.21665944159030914,
-0.0451132170855999,
0.3775634765625,
-0.259724497795105,
0.8095507621765137,
-0.7871482968330383,
-0.5301589965820312,
0.41389864683151245,
0.15459957718849182,
1.7779217958450317,
... |
func (b *Buffer) Sync() {
b.SetArea(b.Bounds())
} | [
-0.12161272019147873,
-0.7604845762252808,
0.2576729357242584,
0.26709944009780884,
-0.4820549190044403,
0.5493599772453308,
0.20732896029949188,
-1.2570083141326904,
0.07173611223697662,
0.33544105291366577,
-0.45957642793655396,
1.6230796575546265,
0.166690856218338,
0.9744375944137573,
... |
func NewCell(ch rune, fg, bg Attribute) Cell {
return Cell{ch, fg, bg}
} | [
0.6718658804893494,
-0.7235983610153198,
0.26651233434677124,
0.31425732374191284,
-0.1608995795249939,
-0.2625257968902588,
0.3123227059841156,
-0.40173080563545227,
-0.5204880833625793,
-0.24674655497074127,
0.5604196190834045,
1.0074756145477295,
0.7640290856361389,
0.14086145162582397,... |
func (b *Buffer) Merge(bs ...Buffer) {
for _, buf := range bs {
for p, v := range buf.CellMap {
b.Set(p.X, p.Y, v)
}
b.SetArea(b.Area.Union(buf.Area))
}
} | [
-0.7742109298706055,
0.20918846130371094,
0.4601042866706848,
0.6846369504928589,
0.5540192723274231,
0.9597523212432861,
-0.2684341371059418,
-0.2600776255130768,
-0.19180884957313538,
-1.0034617185592651,
-0.659329891204834,
-0.0735606774687767,
-0.5034471750259399,
0.28311172127723694,
... |
func NewBuffer() Buffer {
return Buffer{
CellMap: make(map[image.Point]Cell),
Area: image.Rectangle{}}
} | [
-0.0192207433283329,
-0.8143157958984375,
0.24475087225437164,
0.9248154163360596,
-0.8503291606903076,
0.30468231439590454,
0.07683102041482925,
-0.5111722946166992,
0.6567649245262146,
-0.9116544127464294,
0.1725343018770218,
0.2692944407463074,
0.6176143884658813,
0.6594042778015137,
... |
func (b Buffer) Fill(ch rune, fg, bg Attribute) {
for x := b.Area.Min.X; x < b.Area.Max.X; x++ {
for y := b.Area.Min.Y; y < b.Area.Max.Y; y++ {
b.Set(x, y, Cell{ch, fg, bg})
}
}
} | [
-0.06020895764231682,
0.13995857536792755,
0.3879178464412689,
-0.33847931027412415,
0.018026797100901604,
0.2549735903739929,
0.19322656095027924,
-0.6291381120681763,
-0.6783760786056519,
-0.26780039072036743,
-0.31821128726005554,
0.8602988719940186,
0.4710690975189209,
0.82370191812515... |
func NewFilledBuffer(x0, y0, x1, y1 int, ch rune, fg, bg Attribute) Buffer {
buf := NewBuffer()
buf.Area.Min = image.Pt(x0, y0)
buf.Area.Max = image.Pt(x1, y1)
for x := buf.Area.Min.X; x < buf.Area.Max.X; x++ {
for y := buf.Area.Min.Y; y < buf.Area.Max.Y; y++ {
buf.Set(x, y, Cell{ch, fg, bg})
}
}
return b... | [
-0.111390620470047,
-0.6846478581428528,
0.3304067850112915,
-0.1401485800743103,
-0.4595634341239929,
-0.14633837342262268,
-0.12195318192243576,
-0.7588591575622559,
-0.3644697666168213,
-1.0381346940994263,
-0.42701250314712524,
0.42711496353149414,
0.14507853984832764,
0.85605138540267... |
func Parse(b []byte) ([]byte, []byte) {
if len(b) == 0 { // that's not java - it's safe for nil
return nil, nil
}
if i := bytes.Index(b, crlfcrlf); i >= 0 {
if i == 0 {
//if start from crlfcrlf - read crlfcrlf
return b[i+len(crlfcrlf):], nil
}
headers := bytes.Split(b[:i+len(crlfcrlf)], crlf)
cntlen... | [
0.49774929881095886,
-0.9226785898208618,
1.1374455690383911,
0.21430832147598267,
-0.6459848284721375,
-0.6803687214851379,
-0.09162883460521698,
-0.03958648815751076,
-0.14032919704914093,
0.06864476203918457,
-0.11702007055282593,
-0.3708004057407379,
-0.8063300251960754,
0.195674806833... |
func (s *Schema) GetPossibleTypes(def *Definition) []*Definition {
if def.Kind == Union {
var defs []*Definition
for _, t := range def.Types {
defs = append(defs, s.Types[t.Name()])
}
return defs
}
return s.possibleTypes[def.Name]
} | [
-0.6180757284164429,
0.8217153549194336,
0.4131193459033966,
1.3705946207046509,
0.7826400995254517,
-0.011417479254305363,
-0.6818211674690247,
0.14176420867443085,
0.4386273920536041,
0.23543618619441986,
-0.5082441568374634,
0.5856654644012451,
-0.6121619343757629,
1.325657844543457,
... |
func (m *SatisfyVisitModelContent) TableName() string {
return "satisfy_visit_model_content"
} | [
0.26268723607063293,
-0.11421125382184982,
0.32506123185157776,
0.793931782245636,
-0.32448458671569824,
0.6656526923179626,
0.9210752248764038,
0.3456887900829315,
-1.2223985195159912,
0.8571986556053162,
-0.3021795153617859,
-0.4118710160255432,
0.3810555636882782,
-0.45698821544647217,
... |
func appendString(x []string, y ...string) []string {
var z []string
zlen := len(x) + len(y)
// var z [zlen]string X: non-constant array bound zlen
// expand z to at least zlen
z = make([]string, zlen)
copy(z, x)
copy(z[len(x):], y)
return z
} | [
0.1897936463356018,
-0.5049574375152588,
0.6966343522071838,
0.32825979590415955,
-0.731938898563385,
0.693746030330658,
-0.432522177696228,
-1.1831814050674438,
0.20966346561908722,
0.4695259630680084,
0.20541533827781677,
0.5403035879135132,
-0.008972668088972569,
0.14706748723983765,
... |
func diff(x, y int) int {
return x - y
} | [
-0.8134633302688599,
0.14465124905109406,
0.4054660499095917,
-0.5655524134635925,
-0.5204456448554993,
1.1509768962860107,
-0.2620023787021637,
-0.7920374870300293,
-0.6469966769218445,
-0.2245013266801834,
-0.5412948727607727,
0.6603556275367737,
0.44080933928489685,
0.4507496654987335,
... |
func swap(x, y string) (string, string) {
return y, x
} | [
-1.3210843801498413,
-0.8595792651176453,
0.8018283843994141,
-0.9594729542732239,
-0.5892753005027771,
0.5579430460929871,
-1.3774563074111938,
-0.3398345410823822,
-0.4913197159767151,
-0.5887582302093506,
-0.08467845618724823,
1.2083889245986938,
0.8663503527641296,
-1.4001531600952148,... |
func calc(a int) (x, y int) {
x = a*0 + 2
y = a - 2*0
return
} | [
-0.24422094225883484,
-0.40927377343177795,
0.4306502640247345,
-0.823702335357666,
-0.09442904591560364,
-0.005654965527355671,
0.8192180395126343,
-0.03604022413492203,
0.3819132149219513,
-0.6822899580001831,
-0.40926963090896606,
0.038687482476234436,
1.19894278049469,
0.39089003205299... |
func Bool(value bool) *bool {
return &value
} | [
0.5042591094970703,
0.37418898940086365,
0.08808132261037827,
0.2912486493587494,
-0.6371901631355286,
0.5747920870780945,
0.75602126121521,
0.21957409381866455,
0.7474034428596497,
-0.49663275480270386,
-0.10718700289726257,
0.617924690246582,
0.5890490412712097,
-1.3741121292114258,
0.... |
func _(s struct{A0}) { s.A0 = x0 } | [
0.1553233116865158,
-0.24440130591392517,
0.062115125358104706,
-1.2501531839370728,
-0.8508922457695007,
-0.8609466552734375,
1.0339257717132568,
0.2903604209423065,
0.914713978767395,
-0.11695858836174011,
-1.3000108003616333,
0.46657538414001465,
1.7960313558578491,
-0.03463693708181381... |
func (o *GetEnvVarsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetEnvVarsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401... | [
-0.5863136649131775,
-0.7444829940795898,
0.8496774435043335,
0.26536649465560913,
0.12379996478557587,
-0.6857733726501465,
-0.4217761754989624,
-0.5448136925697327,
0.11506339907646179,
0.660203754901886,
0.3420884609222412,
-0.16102944314479828,
-1.0790780782699585,
0.21065014600753784,... |
func NewGetEnvVarsOK() *GetEnvVarsOK {
return &GetEnvVarsOK{}
} | [
-0.07319372147321701,
-0.10580070316791534,
0.23744390904903412,
1.1899775266647339,
-0.03692388907074928,
-0.5218719840049744,
-0.8033348321914673,
-0.04912721738219261,
-0.3570709526538849,
0.5767162442207336,
-0.5413239002227783,
-0.0017834585160017014,
-0.056225765496492386,
-0.1223050... |
func NewGetEnvVarsUnauthorized() *GetEnvVarsUnauthorized {
return &GetEnvVarsUnauthorized{}
} | [
-1.4489481449127197,
-0.6467876434326172,
0.3164829611778259,
0.6652898788452148,
-0.543268084526062,
-0.11458200961351395,
-0.25831884145736694,
1.080409288406372,
0.42618250846862793,
-0.4056340754032135,
-0.6598397493362427,
1.2097992897033691,
-0.09290210902690887,
0.08647151291370392,... |
func NewGetEnvVarsForbidden() *GetEnvVarsForbidden {
return &GetEnvVarsForbidden{}
} | [
-0.034679606556892395,
-0.032413408160209656,
0.24766656756401062,
0.6383960247039795,
-0.4312194287776947,
0.10202835500240326,
-0.16815264523029327,
-0.35030224919319153,
-0.4704573452472687,
-0.11811598390340805,
0.053064070641994476,
0.7177889347076416,
-0.5375075936317444,
-0.41835606... |
func InitBeer(service geting.Service) *cobra.Command {
beerCmd := &cobra.Command{
Use: "beers",
Short: "Print all beers",
Run: runBeers(services),
}
beerCmd.Flags().StringP(idFlag, "i", "", "Id of the beer")
beerCmd.Flags().StringP(nameFileFlag, "c", "", "Name CSV File")
return beerCmd
} | [
0.32671746611595154,
-0.6227186918258667,
0.6102049350738525,
0.7723475694656372,
-0.1494687795639038,
0.4377247393131256,
-0.09848754107952118,
0.8582413792610168,
-0.5816251635551453,
-1.0935078859329224,
-0.1150413379073143,
0.94873046875,
-0.7875849604606628,
1.4718083143234253,
0.63... |
func GetInterxRequest(r *http.Request) types.InterxRequest {
request := types.InterxRequest{}
request.Method = r.Method
request.Endpoint = fmt.Sprintf("%s", r.URL)
request.Params, _ = ioutil.ReadAll(r.Body)
return request
} | [
-0.6793166399002075,
-0.18078775703907013,
0.7250620126724243,
-0.354097455739975,
0.006379575002938509,
-0.22776322066783905,
-0.6467456817626953,
0.4038946330547333,
0.19680450856685638,
-0.23193766176700592,
0.20264485478401184,
0.8800999522209167,
-0.5207447409629822,
-0.19260008633136... |
func GetResponseFormat(request types.InterxRequest, rpcAddr string) *types.ProxyResponse {
response := new(types.ProxyResponse)
response.Timestamp = time.Now().Unix()
response.RequestHash = GetBlake2bHash(request)
response.Chainid = NodeStatus.Chainid
response.Block = NodeStatus.Block
response.Blocktime = NodeSta... | [
0.03568008914589882,
-0.482355535030365,
0.4507087171077728,
-0.5933871269226074,
0.49081555008888245,
-1.408982753753662,
-0.4820196330547333,
-0.43786555528640747,
0.11829060316085815,
-0.5730016231536865,
-0.18621861934661865,
0.3447462320327759,
-0.7373532652854919,
0.24084877967834473... |
func GetResponseSignature(response types.ProxyResponse) (string, string) {
// Get Response Hash
responseHash := GetBlake2bHash(response.Response)
// Generate json to be signed
sign := new(types.ResponseSign)
sign.Chainid = response.Chainid
sign.Block = response.Block
sign.Blocktime = response.Blocktime
sign.Ti... | [
-0.30492040514945984,
-1.6546379327774048,
0.6643044352531433,
-0.7873077392578125,
0.23748311400413513,
-0.8551259636878967,
-0.4219151735305786,
-0.36106887459754944,
0.6986339092254639,
0.46913081407546997,
-1.5279996395111084,
-0.4824873208999634,
-0.8064621090888977,
-0.25450065732002... |
func SearchCache(request types.InterxRequest, response *types.ProxyResponse) (bool, interface{}, interface{}, int) {
chainIDHash := GetBlake2bHash(response.Chainid)
endpointHash := GetBlake2bHash(request.Endpoint)
requestHash := GetBlake2bHash(request)
// GetLogger().Info(chainIDHash, endpointHash, requestHash)
r... | [
-0.6696900725364685,
-0.6171425580978394,
1.1025094985961914,
0.49723073840141296,
0.31374606490135193,
-0.6176397800445557,
-0.3088066875934601,
-0.22938916087150574,
-0.10726147145032883,
0.44129398465156555,
-0.3442980945110321,
-0.18804404139518738,
-1.2936972379684448,
-0.151531100273... |
func WrapResponse(w http.ResponseWriter, request types.InterxRequest, response types.ProxyResponse, statusCode int, saveToCache bool) {
if statusCode == 0 {
statusCode = 503 // Service Unavailable Error
}
if saveToCache {
// GetLogger().Info("[gateway] Saving in the cache")
chainIDHash := GetBlake2bHash(respo... | [
-0.5358521938323975,
-0.49517208337783813,
1.0188652276992798,
-0.22956007719039917,
0.34611496329307556,
-0.8135019540786743,
0.04661545157432556,
0.14206336438655853,
0.39572757482528687,
0.9862240552902222,
0.2150793820619583,
-0.056123338639736176,
-0.7681609988212585,
0.20958717167377... |
func ServeGRPC(r *http.Request, gwCosmosmux *runtime.ServeMux) (interface{}, interface{}, int) {
recorder := httptest.NewRecorder()
gwCosmosmux.ServeHTTP(recorder, r)
resp := recorder.Result()
result := new(interface{})
if json.NewDecoder(resp.Body).Decode(result) == nil {
if resp.StatusCode == http.StatusOK {
... | [
0.006469612009823322,
0.4445880949497223,
0.8606037497520447,
-0.16375479102134705,
0.22563490271568298,
-0.18373967707157135,
0.4815102219581604,
-0.7191566228866577,
-0.9514303207397461,
0.6019173264503479,
-0.2405388355255127,
0.2074037492275238,
-1.5167198181152344,
0.0868871659040451,... |
func (i *Info) String() string {
return fmt.Sprintf("SMBIOS %d.%d.%d (%d tables)", i.MajorVersion(), i.MinorVersion(), i.DocRev(), len(i.Tables))
} | [
0.3196106553077698,
-0.2289639115333557,
0.3591488003730774,
0.49291062355041504,
-0.885496199131012,
0.8196637630462646,
1.2233277559280396,
-0.9566879272460938,
-0.884857714176178,
0.25519657135009766,
-0.5994294881820679,
0.6474851965904236,
-0.49006226658821106,
-0.08433550596237183,
... |
func ParseInfo(entryData, tableData []byte) (*Info, error) {
info := &Info{}
var err error
info.Entry32, info.Entry64, err = ParseEntry(entryData)
if err != nil {
return nil, fmt.Errorf("error parsing entry point structure: %v", err)
}
for len(tableData) > 0 {
t, remainder, err := ParseTable(tableData)
if e... | [
0.4338475465774536,
0.12118913233280182,
0.4095790982246399,
0.5017342567443848,
-0.6616070866584778,
0.5757853388786316,
-0.12438864260911942,
0.049644261598587036,
-0.7858116030693054,
-0.08711559325456619,
-0.35560816526412964,
0.21374110877513885,
-0.1767081320285797,
0.313303291797637... |
func (i *Info) MajorVersion() uint8 {
if i.Entry64 != nil {
return i.Entry64.SMBIOSMajorVersion
}
if i.Entry32 != nil {
return i.Entry32.SMBIOSMajorVersion
}
return 0
} | [
0.3287515938282013,
-0.14358368515968323,
0.35307738184928894,
0.9517273902893066,
-0.12185898423194885,
0.9818810820579529,
0.5290552377700806,
0.5753878355026245,
0.6119005680084229,
0.03493640571832657,
0.5514973998069763,
0.24283316731452942,
-0.5150471925735474,
0.9953794479370117,
... |
func (i *Info) MinorVersion() uint8 {
if i.Entry64 != nil {
return i.Entry64.SMBIOSMinorVersion
}
if i.Entry32 != nil {
return i.Entry32.SMBIOSMinorVersion
}
return 0
} | [
0.661661684513092,
-0.7075052261352539,
0.31472164392471313,
0.8235594034194946,
0.05535925179719925,
0.3544709384441376,
0.41966575384140015,
-0.11490876972675323,
0.8361724019050598,
-0.1589861810207367,
0.06870521605014801,
0.14340080320835114,
-1.5153532028198242,
0.8298795819282532,
... |
func (i *Info) DocRev() uint8 {
if i.Entry64 != nil {
return i.Entry64.SMBIOSDocRev
}
return 0
} | [
0.03079657442867756,
0.8875494599342346,
0.6466988921165466,
1.0123369693756104,
-0.188106968998909,
0.15535739064216614,
0.9995989203453064,
0.3669579029083252,
-0.2480088472366333,
-0.006551152095198631,
0.23913349211215973,
0.7241844534873962,
-0.5465179681777954,
0.034337159246206284,
... |
func (i *Info) GetTablesByType(tt TableType) []*Table {
var res []*Table
for _, t := range i.Tables {
if t.Type == tt {
res = append(res, t)
}
}
return res
} | [
-0.22774527966976166,
0.3161872923374176,
0.4259068965911865,
0.8681219816207886,
0.018195699900388718,
-0.06517142057418823,
0.07434025406837463,
-1.4639431238174438,
-0.3592292368412018,
0.31374016404151917,
-0.3816547691822052,
0.8842188715934753,
-0.35497114062309265,
0.797901511192321... |
func (i *Info) GetBIOSInfo() (*BIOSInfo, error) {
bt := i.GetTablesByType(TableTypeBIOSInfo)
if len(bt) == 0 {
return nil, ErrTableNotFound
}
// There can only be one of these.
return ParseBIOSInfo(bt[0])
} | [
0.5711643695831299,
1.1553361415863037,
0.2970466613769531,
1.774869441986084,
0.48595550656318665,
-0.49159663915634155,
0.012285666540265083,
-1.1559053659439087,
-1.1930691003799438,
-0.611661434173584,
-0.06332319974899292,
0.09945560991764069,
-0.7600507140159607,
0.3263402283191681,
... |
func (i *Info) GetSystemInfo() (*SystemInfo, error) {
bt := i.GetTablesByType(TableTypeSystemInfo)
if len(bt) == 0 {
return nil, ErrTableNotFound
}
// There can only be one of these.
return ParseSystemInfo(bt[0])
} | [
-0.13123682141304016,
0.9316733479499817,
0.21567174792289734,
1.5954159498214722,
0.5060557723045349,
-0.6272221803665161,
0.08408555388450623,
-1.0560760498046875,
-0.8903289437294006,
-0.7696306109428406,
-0.5991163849830627,
-0.13113588094711304,
-0.40166205167770386,
0.598150610923767... |
func (i *Info) GetBaseboardInfo() ([]*BaseboardInfo, error) {
var res []*BaseboardInfo
for _, t := range i.GetTablesByType(TableTypeBaseboardInfo) {
bi, err := ParseBaseboardInfo(t)
if err != nil {
return nil, err
}
res = append(res, bi)
}
return res, nil
} | [
0.15992586314678192,
0.7568614482879639,
0.3787684440612793,
1.5937047004699707,
0.06990868598222733,
0.4747670888900757,
0.4194236993789673,
-0.2728593945503235,
-1.3833122253417969,
-0.09705659002065659,
-0.7891551852226257,
0.5555121302604675,
-0.8148685097694397,
1.3676828145980835,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.