text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func NewHTTPClient(url string, backend Backend) (*HTTPClient, error) {
b := backend
if b == nil {
b = newDefaultBackend()
}
return &HTTPClient{url: url, backend: b}, nil
} | [
-0.004914253018796444,
-0.29238462448120117,
0.298306405544281,
0.9227292537689209,
-0.12196226418018341,
-0.6923539638519287,
-0.43682700395584106,
0.3898572027683258,
-0.5780330300331116,
0.046187128871679306,
-0.4643363356590271,
0.6542361974716187,
-1.1114951372146606,
-0.2285891175270... |
func (c *HTTPClient) PushMetrics(metrics []*Metric,
timeout time.Duration) error {
if len(metrics) == 0 {
return fmt.Errorf("kairosdb: metrics missing")
}
payload, err := json.Marshal(metrics)
if err != nil {
return err
}
glog.V(4).Infof("pushing metric: %s", string(payload))
reader := ioutil.N... | [
-0.6662330031394958,
1.0614062547683716,
0.2676839530467987,
0.2962462902069092,
-0.2383255660533905,
0.5658547878265381,
-0.9683351516723633,
-0.8931308388710022,
-0.7467337250709534,
1.0597419738769531,
0.2767643332481384,
0.36080431938171387,
-0.6767456531524658,
0.3780961036682129,
0... |
func (c *HTTPClient) Query(q *Query, timeout time.Duration) (
res *QueryResponse, err error) {
if q == nil {
err = fmt.Errorf("kairosdb: nil query passed")
return
}
payload, err := json.Marshal(q)
if err != nil {
return
}
res = &QueryResponse{}
glog.V(3).Infof("querying metric: %s", string... | [
-0.20380795001983643,
0.5793970227241516,
0.42726024985313416,
-0.027983278036117554,
-0.4651123583316803,
-0.003691570833325386,
-1.2380176782608032,
-0.456053227186203,
0.0550641231238842,
0.7300224900245667,
0.5392865538597107,
0.2664541006088257,
-0.7731075882911682,
0.3975777626037597... |
func (c *HTTPClient) Delete(q *Query, timeout time.Duration) error {
if q == nil {
return fmt.Errorf("kairosdb: nil query passed")
}
payload, err := json.Marshal(q)
if err != nil {
return fmt.Errorf("error unmarshalling query:%v :: %v", q, err)
}
glog.Infof("deleting datapoints payload: %v", string... | [
-0.10608745366334915,
0.6392744779586792,
0.4231018126010895,
-0.16593462228775024,
-0.12088671326637268,
0.5636692047119141,
-1.1777551174163818,
-0.3916512429714203,
0.04238225892186165,
1.1418689489364624,
0.25184598565101624,
1.000839114189148,
-0.6293429136276245,
0.023712873458862305... |
func (c *HTTPClient) Metrics(timeout time.Duration) ([]string, error) {
// temporary struct for parsing JSON response
var respData struct {
Names []string `json:"results"`
}
err := c.backend.Call("GET", c.url+"/api/v1/metricnames", nil,
timeout, http.StatusOK, &respData)
if err != nil {
return ni... | [
-0.939371645450592,
0.19237175583839417,
0.346325546503067,
-0.19062969088554382,
-0.1265220195055008,
0.34326624870300293,
-1.003222942352295,
-0.7167960405349731,
-0.1912422627210617,
1.0443966388702393,
-0.2712503671646118,
0.5917777419090271,
-0.3699656128883362,
0.011157524771988392,
... |
func NewInMemoryDB() DB {
return &inMemDb{m: make(map[string][]byte)}
} | [
0.49431416392326355,
-0.43556463718414307,
0.1128554716706276,
-0.12144048511981964,
-1.9900740385055542,
0.07346058636903763,
-0.2506268322467804,
0.0032001626677811146,
0.13891001045703888,
0.19399411976337433,
-0.555192768573761,
0.4784793555736542,
-1.8565337657928467,
1.00717139244079... |
func (c *childQuery) position() int {
return c.posit
} | [
-0.08227654546499252,
-0.6047366261482239,
0.196829691529274,
-0.31890541315078735,
-0.05533672124147415,
0.5618422031402588,
0.6515699625015259,
-0.1514960527420044,
-0.5253289937973022,
-0.6505282521247864,
-0.5158157348632812,
-1.545652985572815,
-0.7949056029319763,
0.05229420587420463... |
func (d *descendantQuery) position() int {
return d.posit
} | [
-0.4470633566379547,
0.13718490302562714,
0.14633943140506744,
-0.030402367934584618,
-0.16425584256649017,
0.74765944480896,
0.8618057370185852,
0.20891480147838593,
-0.07426290959119797,
-0.8021172881126404,
0.12590602040290833,
-0.9691242575645447,
-0.09315752238035202,
0.03515696153044... |
func (f *functionQuery) Evaluate(t iterator) interface{} {
return f.Func(f.Input, t)
} | [
-0.925324559211731,
-0.5007439851760864,
0.24101650714874268,
-0.7577855587005615,
-0.051981568336486816,
-0.07548482716083527,
-0.4443393349647522,
-0.39938992261886597,
-1.3183974027633667,
-0.03453420102596283,
0.24809332191944122,
-0.7571291923522949,
0.3814132809638977,
-0.21028304100... |
func (h *Handler) List() ([]*corev1.Node, error) {
return h.ListAll()
} | [
-0.33645758032798767,
-0.06625177711248398,
0.17076840996742249,
-0.011643636040389538,
1.0372427701950073,
0.2636953890323639,
-0.046240564435720444,
0.9973486661911011,
-0.337525337934494,
0.20820589363574982,
-0.7553240656852722,
0.6970137357711792,
-0.3278923034667969,
0.90200901031494... |
func (h *Handler) ListByLabel(labels string) ([]*corev1.Node, error) {
listOptions := h.Options.ListOptions.DeepCopy()
listOptions.LabelSelector = labels
nodeList, err := h.clientset.CoreV1().Nodes().List(h.ctx, *listOptions)
if err != nil {
return nil, err
}
return extractList(nodeList), nil
} | [
-0.3763173520565033,
-0.334894061088562,
0.22272294759750366,
-0.4687955677509308,
0.5470619797706604,
-0.11066830903291702,
-0.3004094958305359,
-0.5308221578598022,
-0.011513421311974525,
0.7406905889511108,
-0.13865382969379425,
0.38634324073791504,
-0.8877284526824951,
-0.2439640760421... |
func (h *Handler) ListByField(field string) ([]*corev1.Node, error) {
fieldSelector, err := fields.ParseSelector(field)
if err != nil {
return nil, err
}
listOptions := h.Options.ListOptions.DeepCopy()
listOptions.FieldSelector = fieldSelector.String()
nodeList, err := h.clientset.CoreV1().Nodes().List(h.ctx, ... | [
-0.23576678335666656,
0.14299391210079193,
0.47191405296325684,
-0.8431079387664795,
0.1887127161026001,
-0.09394741803407669,
0.35945597290992737,
-0.29407286643981934,
0.08266283571720123,
0.913344144821167,
-0.8299546837806702,
0.42856016755104065,
-0.7894494533538818,
0.348269671201705... |
func (h *Handler) ListAll() ([]*corev1.Node, error) {
return h.ListByLabel("")
} | [
-0.36971235275268555,
-0.4697568714618683,
0.42479005455970764,
0.4450375735759735,
0.33916226029396057,
0.948612630367279,
-0.6704050898551941,
0.3972356617450714,
-0.5102100968360901,
0.4551130533218384,
0.07792506366968155,
1.0507770776748657,
-0.2706940770149231,
0.6339591145515442,
... |
func (p *PrimeGenerator) Handle(ctx context.Context, proc dproc.Process, msg dproc.Message) {
switch msg.Type {
default:
fmt.Println("Unknown message type: ", msg.Type)
case dproc.MessageTypeStart:
log.Printf("[%s] - Starting...", proc.Name())
log.Printf("[%s] - Finding primes...", proc.Name())
primes := pri... | [
-0.40728285908699036,
0.7262783050537109,
0.8470275402069092,
-0.8836601376533508,
0.8274517059326172,
0.17750810086727142,
0.8385802507400513,
-0.37641629576683044,
0.09560082107782364,
-0.14914274215698242,
-0.10152287036180496,
0.42320412397384644,
-0.5454289317131042,
0.736873686313629... |
func (p *PrimeExtensionProcess) Handle(ctx context.Context, proc dproc.Process, msg dproc.Message) {
switch msg.Type {
default:
log.Printf("[%s] - Unknown message type: %s", proc.Name(), msg.Type)
case dproc.MessageTypeStart:
log.Printf("[%s] - Starting...", proc.Name())
case dproc.MessageTypeStop:
log.Printf... | [
0.15158610045909882,
0.4836803376674652,
0.9721012115478516,
-0.990082323551178,
0.3239911198616028,
0.3790432810783386,
0.49922695755958557,
-0.2959955334663391,
0.525617241859436,
-0.5537704229354858,
-0.6439688801765442,
0.5122479200363159,
-0.48602139949798584,
0.3234120309352875,
0.... |
func PrimeAzimuthMapperFunc(msg ExtendedPrimeMessage) string {
return fmt.Sprintf("%.f", msg.Azimuth)
} | [
-0.5114923715591431,
-0.46184226870536804,
0.2548723816871643,
-0.30261021852493286,
-1.0166902542114258,
0.33098304271698,
0.5520918965339661,
0.297389954328537,
0.986821174621582,
-0.15652811527252197,
0.7844932079315186,
-0.29798322916030884,
-0.3045431971549988,
0.052659183740615845,
... |
func LastDigitPrimeAzimuthMapperFunc(msg ExtendedPrimeMessage) string {
return fmt.Sprintf("%d,%.f", msg.LastDigit, msg.Azimuth)
} | [
-0.5950252413749695,
-0.6882312297821045,
0.3493165373802185,
-0.9569642543792725,
-0.6085938215255737,
0.534921407699585,
0.06658311188220978,
0.033321455121040344,
1.004453420639038,
0.0399937629699707,
0.7527697682380676,
-0.43409740924835205,
-0.48851847648620605,
0.1918800175189972,
... |
func LastDigitPrimeAzimuthDeltaMapperFunc(msg ExtendedPrimeMessage) string {
return fmt.Sprintf("%d,%.f,%d", msg.LastDigit, msg.Azimuth, msg.PrimeDiff)
} | [
-0.6144782304763794,
-0.6972969174385071,
0.5130313634872437,
-1.114354133605957,
-0.8147513270378113,
0.865780234336853,
-0.07235921919345856,
-0.19813527166843414,
0.6026915311813354,
0.14157603681087494,
0.22821058332920074,
0.050326868891716,
-0.7191722393035889,
0.5905681848526001,
... |
func LastDigitPrimeDeltaMapperFunc(msg ExtendedPrimeMessage) string {
return fmt.Sprintf("%d,%d", msg.LastDigit, msg.PrimeDiff)
} | [
-0.3848417103290558,
-0.4769262373447418,
0.5740476846694946,
-1.4702770709991455,
-0.9433687329292297,
0.6443519592285156,
-0.12787148356437683,
0.3264492154121399,
1.323913812637329,
0.10731551796197891,
0.5219794511795044,
0.017775842919945717,
-0.22579523921012878,
0.465383380651474,
... |
func DeltaLastDigitAzimuthMapperFunc(msg ExtendedPrimeMessage) string {
return fmt.Sprintf("% 3d,%d,%.f", msg.PrimeDiff, msg.LastDigit, msg.Azimuth)
} | [
-0.5046423673629761,
-0.2682790458202362,
0.5246881246566772,
-0.8759232759475708,
-0.4501514434814453,
0.463749498128891,
0.4858035743236542,
-0.10465584695339203,
0.7019871473312378,
0.059088535606861115,
0.17719686031341553,
-0.20080800354480743,
-0.17473770678043365,
0.1698137074708938... |
func RevMapperFunc(msg ExtendedPrimeMessage) string {
return fmt.Sprintf("%04d", msg.Revs)
} | [
-0.7514762282371521,
-0.05911742150783539,
0.3871994912624359,
-0.9968414306640625,
-0.9744464159011841,
-0.08841671049594879,
0.14315685629844666,
0.8719823956489563,
0.9872221350669861,
-0.5058047771453857,
0.39564552903175354,
-0.04689481109380722,
0.4619642496109009,
-0.284774869680404... |
func LastDigitAzimuthPreviousAzimuthMapperFunc(msg ExtendedPrimeMessage) string {
prevAzm := msg.Azimuth - msg.DeltaAzimuth
// if prevAzm < 0 {
// prevAzm += 360
// }
return fmt.Sprintf("% 3d,%.f,%.f", msg.LastDigit, msg.Azimuth, prevAzm)
} | [
-0.22888515889644623,
-0.34417495131492615,
0.5288625359535217,
-0.7328582406044006,
-0.2424507737159729,
0.1732044219970703,
0.5311132669448853,
-0.03401496261358261,
0.45083364844322205,
-0.25228801369667053,
0.06272806227207184,
-0.08428341150283813,
-0.5223915576934814,
0.1284555643796... |
func (p *PrimeMapperProcess) Handle(ctx context.Context, proc dproc.Process, msg dproc.Message) {
switch msg.Type {
default:
log.Printf("[%s] - Unknown message type: %s", proc.Name(), msg.Type)
case dproc.MessageTypeStart:
log.Printf("[%s] - Starting...", proc.Name())
case dproc.MessageTypeStop:
log.Printf("[... | [
-0.48703497648239136,
0.2520517110824585,
0.8039461374282837,
-0.6832118630409241,
-0.011965900659561157,
0.6935828328132629,
0.3037109971046448,
-0.6127320528030396,
0.14050666987895966,
-0.47626546025276184,
-0.17820672690868378,
0.4194199740886688,
-0.4401896297931671,
0.705860197544097... |
func NewMessage(date time.Time, from, to Address, replyTo *Address, subject string, body []byte) (*Message, error) {
id, err := NewID()
return &Message{
ID: id,
Headers: NewHeaders(date, from, to, replyTo, subject, detectContentType(body)),
Body: body,
}, errors.WithMessage(err, "could not create ID")... | [
-0.10927925258874893,
0.13882963359355927,
0.5420827865600586,
-0.14441250264644623,
0.15832528471946716,
-0.129063680768013,
-1.4504317045211792,
-1.2180030345916748,
0.5678544640541077,
-0.30112552642822266,
-0.14434674382209778,
0.657089352607727,
-0.6936244368553162,
0.2959839999675751... |
func RunPrecompiledContract(p PrecompiledContract, input []byte, contract *Contract) (ret []byte, err error) {
gas := p.RequiredGas(len(input))
if contract.UseGas(gas) {
ret = p.Run(input)
return ret, nil
}
return nil, ErrOutOfGas
} | [
-0.6643421649932861,
-0.2521662712097168,
0.735543429851532,
0.40318748354911804,
-0.45004895329475403,
0.18503756821155548,
0.9537003636360168,
0.534845769405365,
-0.19297237694263458,
-0.4811270236968994,
-0.39651137590408325,
-0.03570687025785446,
-1.2359590530395508,
1.0305209159851074... |
func List(c *drycc.Client, appID string, results int) (api.Gateways, int, error) {
u := fmt.Sprintf("/v2/apps/%s/gateways/", appID)
body, count, reqErr := c.LimitedRequest(u, results)
if reqErr != nil && !drycc.IsErrAPIMismatch(reqErr) {
return []api.Gateway{}, -1, reqErr
}
var gateways []api.Gateway
if err :... | [
0.20544525980949402,
-0.13493134081363678,
0.6395317912101746,
-0.20415455102920532,
-0.05381016805768013,
-1.1816375255584717,
-0.34360194206237793,
-0.23544234037399292,
0.3382895588874817,
0.893645167350769,
-0.627011239528656,
0.3314337730407715,
-0.5710145235061646,
1.1179801225662231... |
func New(c *drycc.Client, appID string, name string, port int, protocol string) error {
u := fmt.Sprintf("/v2/apps/%s/gateways/", appID)
req := api.GatewayCreateRequest{Name: name, Port: port, Protocol: protocol}
body, err := json.Marshal(req)
if err != nil {
return err
}
res, reqErr := c.Request("POST", u,... | [
0.33958369493484497,
0.1000799834728241,
0.40013307332992554,
-0.4054107666015625,
-0.4872615337371826,
-0.01863391324877739,
-0.7170827388763428,
-1.038533091545105,
-0.8022299408912659,
0.4635156989097595,
-0.26485350728034973,
0.7029216885566711,
-0.15095166862010956,
1.1505872011184692... |
func Delete(c *drycc.Client, appID string, name string, port int, protocol string) error {
u := fmt.Sprintf("/v2/apps/%s/gateways/", appID)
req := api.GatewayRemoveRequest{Name: name, Port: port, Protocol: protocol}
body, err := json.Marshal(req)
if err != nil {
return err
}
res, err := c.Request("DELETE", ... | [
1.29688560962677,
0.40330660343170166,
0.6386396884918213,
-0.1660887598991394,
-0.24926984310150146,
-0.22492414712905884,
-0.44343775510787964,
-0.36318013072013855,
0.2969571053981781,
1.1205703020095825,
-0.14555096626281738,
0.7964020371437073,
-1.3134006261825562,
0.43126624822616577... |
func (a *action) Authorize(authorize *mixTy.MixAuthorizeAction) (*types.Receipt, error) {
execer, symbol := mixTy.GetAssetExecSymbol(a.api.GetConfig(), authorize.AssetExec, authorize.AssetSymbol)
input, err := a.authorizePubInputs(execer, symbol, authorize.ProofInfo)
if err != nil {
return nil, err
}
//zk-proo... | [
-0.5911675691604614,
0.15793561935424805,
0.8355324864387512,
0.5486560463905334,
0.29725444316864014,
-0.9473431706428528,
0.728753924369812,
-0.07776340842247009,
0.8796672821044922,
0.6112822890281677,
0.641396701335907,
0.6780843734741211,
-0.5818503499031067,
0.6495056748390198,
0.7... |
func (e *Endpoints) String() string {
if e == nil {
return ""
}
backends := []string{}
for ip, ports := range e.Backends {
for _, port := range ports {
backends = append(backends, fmt.Sprintf("%s/%s", net.JoinHostPort(ip, strconv.Itoa(int(port.Port))), port.Protocol))
}
}
sort.Strings(backends)
retur... | [
0.27935582399368286,
-0.46127599477767944,
0.3121371865272522,
-0.4620513916015625,
0.6136267185211182,
0.25968024134635925,
0.1850123107433319,
-0.6947225332260132,
-0.3178272247314453,
1.0751384496688843,
0.3748392164707184,
0.501787543296814,
-0.5295225977897644,
-0.7982605695724487,
... |
func newEndpoints() *Endpoints {
return &Endpoints{
Backends: map[string]service.PortConfiguration{},
}
} | [
0.49387326836586,
-0.1419290453195572,
0.0018808742752298713,
0.020436817780137062,
-0.00896486360579729,
-0.5232982635498047,
-0.6690150499343872,
0.09994985163211823,
0.2745618522167206,
0.309560090303421,
-0.06673144549131393,
0.6827906370162964,
-0.9511734843254089,
0.00699603883549571... |
func (e *Endpoints) DeepEquals(o *Endpoints) bool {
switch {
case (e == nil) != (o == nil):
return false
case (e == nil) && (o == nil):
return true
}
if len(e.Backends) != len(o.Backends) {
return false
}
for ip1, ports1 := range e.Backends {
ports2, ok := o.Backends[ip1]
if !ok {
return false
}... | [
-0.5915535092353821,
0.15068617463111877,
0.7393259406089783,
0.2640596032142639,
0.8330681920051575,
-0.33937063813209534,
-0.05902337655425072,
-0.25603726506233215,
0.09224511682987213,
0.878939688205719,
-0.7070653438568115,
0.698414146900177,
-0.7983165383338928,
-0.3604016602039337,
... |
func (e *Endpoints) CIDRPrefixes() ([]*net.IPNet, error) {
prefixes := make([]string, len(e.Backends))
index := 0
for ip := range e.Backends {
prefixes[index] = ip
index++
}
valid, invalid := ip.ParseCIDRs(prefixes)
if len(invalid) > 0 {
return nil, fmt.Errorf("invalid IPs specified as backends: %+v", inva... | [
-0.11921420693397522,
0.3345775306224823,
0.43920910358428955,
0.2830241918563843,
0.6571776270866394,
-0.394207239151001,
-0.6960897445678711,
0.0319974310696125,
0.2274927794933319,
1.0899510383605957,
0.061648253351449966,
-0.7122032642364502,
-1.6952406167984009,
-0.6284511685371399,
... |
func ParseEndpointsID(svc *types.Endpoints) ServiceID {
return ServiceID{
Name: svc.ObjectMeta.Name,
Namespace: svc.ObjectMeta.Namespace,
}
} | [
0.42496824264526367,
-0.6983349919319153,
0.35853683948516846,
-0.6835272312164307,
-0.6988878846168518,
0.45625120401382446,
-0.2817517817020416,
-0.910780131816864,
0.6176897287368774,
0.7942596673965454,
-0.06211066246032715,
0.6965678930282593,
0.6016771793365479,
0.5490410327911377,
... |
func ParseEndpoints(ep *types.Endpoints) (ServiceID, *Endpoints) {
endpoints := newEndpoints()
for _, sub := range ep.Subsets {
for _, addr := range sub.Addresses {
backend, ok := endpoints.Backends[addr.IP]
if !ok {
backend = service.PortConfiguration{}
endpoints.Backends[addr.IP] = backend
}
... | [
0.5327574610710144,
-0.05571504309773445,
0.4414013922214508,
-0.6688827872276306,
0.1296236217021942,
-0.20996451377868652,
-0.17568282783031464,
0.04953872784972191,
-0.022859863936901093,
0.5716622471809387,
0.10940007865428925,
0.29421183466911316,
-0.09663988649845123,
0.5128465294837... |
func newExternalEndpoints() externalEndpoints {
return externalEndpoints{
endpoints: map[string]*Endpoints{},
}
} | [
-0.03374063968658447,
-0.17846597731113434,
0.33062079548835754,
0.4536578953266144,
-1.4104199409484863,
0.1263255774974823,
-1.4282201528549194,
1.2951260805130005,
0.3495045304298401,
0.6930171251296997,
-1.1501609086990356,
0.3315025866031647,
-0.20249348878860474,
0.0918438509106636,
... |
func (mock *IGraphMock) CheckerCalls() []struct {
Ctx context.Context
State *healthcheck.CheckState
} {
var calls []struct {
Ctx context.Context
State *healthcheck.CheckState
}
mock.lockChecker.RLock()
calls = mock.calls.Checker
mock.lockChecker.RUnlock()
return calls
} | [
-0.030509620904922485,
-0.2516659200191498,
0.39411211013793945,
1.0990203619003296,
0.32166045904159546,
0.29681646823883057,
0.332923024892807,
-1.062688946723938,
0.03882385790348053,
0.12902423739433289,
0.2000143676996231,
-0.03574470803141594,
-0.9885913729667664,
0.33465832471847534... |
func (mock *IGraphMock) CloseCalls() []struct {
Ctx context.Context
} {
var calls []struct {
Ctx context.Context
}
mock.lockClose.RLock()
calls = mock.calls.Close
mock.lockClose.RUnlock()
return calls
} | [
-0.6686099171638489,
0.42204156517982483,
0.38432207703590393,
-0.1463145762681961,
-0.15962839126586914,
0.41964128613471985,
0.2160458117723465,
-1.9199700355529785,
0.47787705063819885,
-0.09883101284503937,
0.7345873713493347,
-0.21804840862751007,
-1.5630460977554321,
-0.2243177890777... |
func (mock *IGraphMock) HealthcheckCalls() []struct {
} {
var calls []struct {
}
mock.lockHealthcheck.RLock()
calls = mock.calls.Healthcheck
mock.lockHealthcheck.RUnlock()
return calls
} | [
0.1826610565185547,
0.302630752325058,
0.3588719964027405,
0.9167881608009338,
0.6981274485588074,
-0.07239486277103424,
0.6017969250679016,
-1.525213360786438,
0.0026914800982922316,
0.6076881289482117,
0.5975569486618042,
0.1158200278878212,
-0.6682983636856079,
-0.08032162487506866,
-... |
func (mock *IGraphMock) StreamCSVRowsCalls() []struct {
Ctx context.Context
InstanceID string
FilterID string
Filters *observation.DimensionFilters
Limit *int
} {
var calls []struct {
Ctx context.Context
InstanceID string
FilterID string
Filters *observation.DimensionFilters
... | [
0.21985308825969696,
0.7406322360038757,
0.3877001106739044,
0.6387349367141724,
-0.5262113809585571,
0.24320471286773682,
0.5802638530731201,
-1.3818782567977905,
0.15982836484909058,
0.1745239496231079,
0.12222299724817276,
1.203795313835144,
-0.4958483874797821,
0.24462589621543884,
-... |
func (o *AdminListUserAchievementsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewAdminListUserAchievementsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
... | [
-0.006549304351210594,
0.08623328804969788,
0.5997827649116516,
0.36632317304611206,
-0.6210297346115112,
-0.5792354345321655,
0.07739004492759705,
-0.671966016292572,
0.7926860451698303,
0.8556973934173584,
0.344830721616745,
0.46163761615753174,
-0.2806667387485504,
0.5713370442390442,
... |
func NewAdminListUserAchievementsOK() *AdminListUserAchievementsOK {
return &AdminListUserAchievementsOK{}
} | [
0.3673200011253357,
-0.30690041184425354,
0.07601579278707504,
1.0810248851776123,
-1.332429051399231,
-0.13698020577430725,
0.862178385257721,
0.13677313923835754,
-0.4042976200580597,
0.7749876379966736,
-1.2195534706115723,
0.23586729168891907,
0.2583034336566925,
0.5512819290161133,
... |
func NewAdminListUserAchievementsBadRequest() *AdminListUserAchievementsBadRequest {
return &AdminListUserAchievementsBadRequest{}
} | [
-0.24090476334095,
0.022677484899759293,
0.32969680428504944,
0.7974815368652344,
-0.6818347573280334,
-0.2633610963821411,
-0.5527868270874023,
0.12737835943698883,
-0.15347172319889069,
0.007001584395766258,
-0.9189534187316895,
1.4671339988708496,
-0.24619922041893005,
1.039081811904907... |
func NewAdminListUserAchievementsUnauthorized() *AdminListUserAchievementsUnauthorized {
return &AdminListUserAchievementsUnauthorized{}
} | [
-0.05792287364602089,
-0.23048089444637299,
0.32063591480255127,
1.0143263339996338,
-1.5273878574371338,
-0.30652815103530884,
0.14750134944915771,
0.9322320222854614,
0.17129585146903992,
-0.031230052933096886,
-0.7706261873245239,
1.4831204414367676,
-0.24407580494880676,
0.101044148206... |
func NewAdminListUserAchievementsNotFound() *AdminListUserAchievementsNotFound {
return &AdminListUserAchievementsNotFound{}
} | [
0.48244789242744446,
-0.43420061469078064,
-0.11643994599580765,
0.6194769740104675,
-0.7239699959754944,
0.33903539180755615,
0.47439324855804443,
0.19956380128860474,
0.32988211512565613,
0.5378178954124451,
-1.0142673254013062,
1.1332817077636719,
-0.29491716623306274,
0.549649596214294... |
func (rl RateLimiter) Handle(handler http.HandlerFunc) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
policy := rl.getRatePolicy(r.URL.Path)
if policy == nil {
// letting this request pass since no policies are set
handler.ServeHTTP(w, r)
return
}
hits, err := setHit(policy,... | [
0.4582102596759796,
0.557876467704773,
0.7188912034034729,
-0.14019770920276642,
0.39511731266975403,
1.0259984731674194,
-0.4573715031147003,
-0.39303237199783325,
0.3127328157424927,
0.3081877827644348,
0.6888428330421448,
0.1174289882183075,
-0.454918771982193,
-0.04760079085826874,
0... |
func (rl RateLimiter) getRatePolicy(route string) *RatePolicy {
for _, policy := range rl.Policies {
if route == policy.Route {
return &policy
}
}
return nil
} | [
0.9272556900978088,
0.1157686710357666,
0.6515475511550903,
-0.5420096516609192,
1.1704998016357422,
0.4793054759502411,
-1.0216877460479736,
-1.0674188137054443,
0.8161033987998962,
0.7371259331703186,
0.588081955909729,
0.7684723138809204,
-1.048736333847046,
-0.8252732157707214,
-0.54... |
func setHit(policy *RatePolicy, ip string) (int, error) {
conn := cache.NewConn()
defer cache.CloseConn(conn)
key := fmt.Sprintf("%s:%s", policy.Route, ip)
res, err := redis.String(conn.Do("GET", key))
// if key exists, increment
if err != nil {
return redis.Int(conn.Do("INCR", key))
// else, set key with v... | [
-0.5885467529296875,
0.8642850518226624,
0.6409410238265991,
-1.0142173767089844,
-0.1817609667778015,
0.49364015460014343,
-0.6587184071540833,
0.06197376549243927,
-0.5918989181518555,
0.9521140456199646,
0.24237339198589325,
-0.4104035198688507,
-0.4895424544811249,
-0.4468386471271515,... |
func (s *Server) Routes() *http.ServeMux {
router := http.NewServeMux()
router.Handle("/", s.handleIndex())
return router
} | [
-1.1307066679000854,
0.38378676772117615,
0.21447546780109406,
0.13272599875926971,
0.1556292176246643,
-0.054384633898735046,
-0.3305041193962097,
-0.02322401851415634,
0.030160007998347282,
-1.5416431427001953,
-0.3687933385372162,
0.17333756387233734,
-0.1637164205312729,
0.078179717063... |
func (s *Server) Start() error {
address := s.Address
if address == "" {
address = "0.0.0.0"
}
addr := fmt.Sprintf("%s:%d", address, s.Port)
s.httpServer = &http.Server{
Addr: addr,
Handler: s.Routes(),
}
return s.httpServer.ListenAndServe()
} | [
-0.36595407128334045,
-0.7809446454048157,
0.5504792928695679,
-0.36792922019958496,
-0.06689420342445374,
0.13286364078521729,
0.04328218102455139,
1.5402113199234009,
0.14280925691127777,
-0.12893252074718475,
-0.29669538140296936,
1.5150785446166992,
-0.1378849893808365,
0.2482588738203... |
func (s *Server) Close() error {
return s.httpServer.Shutdown(context.Background())
} | [
-0.801689088344574,
-0.31396520137786865,
0.4754076898097992,
0.6618672013282776,
0.1340472400188446,
0.6609973311424255,
-0.18486791849136353,
-0.6666956543922424,
-0.546538233757019,
-0.22807186841964722,
0.8428707718849182,
0.8821332454681396,
-1.1254303455352783,
1.0012797117233276,
... |
func NewPoint(group Group) Point {
return C.EC_POINT_new(group)
} | [
0.1077614277601242,
-0.09622032195329666,
-0.022301578894257545,
0.7220830917358398,
-0.10549456626176834,
0.25113803148269653,
0.22533699870109558,
-0.6396077275276184,
-0.1182374581694603,
-0.09840293973684311,
0.1019330695271492,
0.1551438421010971,
-0.7301799654960632,
-0.0019222064875... |
func PointMul(group Group, n Bignum, P Point, m Bignum, ctx Ctx) Point {
result := NewPoint(group)
C.EC_POINT_mul(group, result, n, P, m, ctx)
return result
} | [
-0.739764928817749,
0.9018778204917908,
0.2462407648563385,
0.6213406324386597,
0.20095284283161163,
0.5275088548660278,
-0.44407474994659424,
0.009675225242972374,
0.3310588300228119,
-0.000013479590961651411,
0.12596260011196136,
-0.46013179421424866,
-0.5150260925292969,
-0.505468010902... |
func pointGetCoordinates(group Group, point Point, ctx Ctx) (x Bignum, y Bignum) {
x = NewBn()
y = NewBn()
C.EC_POINT_get_affine_coordinates_GFp(group, point, x, y, ctx)
return
} | [
0.06828253716230392,
0.7202745676040649,
0.31520065665245056,
0.8630949854850769,
0.6621196269989014,
-0.32131537795066833,
-0.09645374119281769,
-0.7642285823822021,
0.09803573787212372,
-0.6887761950492859,
0.42216986417770386,
0.18895697593688965,
-0.26852768659591675,
-0.41255065798759... |
func Bin2point(group Group, bytes []byte, ctx Ctx) *Point {
point := NewPoint(group)
ret := C.EC_POINT_oct2point(group, point, (*C.uchar)(unsafe.Pointer(&bytes[0])), C.ulong(len(bytes)), ctx)
if ret == 0 {
return nil
}
return &point
} | [
0.21112217009067535,
-0.893854022026062,
0.24366724491119385,
-0.0625886395573616,
-0.14499813318252563,
0.0579143725335598,
-0.005468363407999277,
-0.7849776148796082,
-0.05367781221866608,
0.2381266951560974,
-0.2814105153083801,
0.35465380549430847,
-1.2189079523086548,
-1.1771292686462... |
func SigSet(sig Sig, r Bignum, s Bignum) {
C.ECDSA_SIG_set0(sig, r, s)
} | [
-0.08880030363798141,
0.14555242657661438,
0.059129323810338974,
-1.077357530593872,
0.2860502302646637,
-0.2934272289276123,
0.5775002241134644,
-0.010137218050658703,
0.3883136212825775,
-0.29283055663108826,
-0.936445415019989,
0.1974041759967804,
0.6327106952667236,
0.05075305327773094... |
func (m *RuleClause) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateField(formats); err != nil {
res = append(res, err)
}
if err := m.validateOperation(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
retur... | [
0.37724941968917847,
-0.34267809987068176,
0.3067231774330139,
0.035043973475694656,
0.504387617111206,
0.04163608327507973,
0.22484362125396729,
0.0736224502325058,
-0.6853365898132324,
0.3350312411785126,
0.4394362270832062,
-0.0004850527038797736,
-1.1511294841766357,
0.8356121778488159... |
func (c *Client) CreateMesh(ctx context.Context, params *CreateMeshInput, optFns ...func(*Options)) (*CreateMeshOutput, error) {
if params == nil {
params = &CreateMeshInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateMesh", params, optFns, addOperationCreateMeshMiddlewares)
if err != nil {
retu... | [
-0.3893451392650604,
0.876244843006134,
0.5993644595146179,
0.7356193661689758,
0.6953322887420654,
0.18030188977718353,
0.23653516173362732,
-1.3491994142532349,
0.3231342136859894,
-0.5061143636703491,
-0.6896944642066956,
1.0391230583190918,
-0.6559212803840637,
-0.5751195549964905,
-... |
func drawDFA(w http.ResponseWriter, r *http.Request) {
draw(w, r, "DFA")
} | [
-1.4270023107528687,
0.5497416257858276,
0.5483459830284119,
-0.3607136905193329,
0.2190975695848465,
-0.2808344066143036,
0.5491741299629211,
-0.7988433837890625,
1.0850874185562134,
-0.48588404059410095,
0.28804031014442444,
0.5465223789215088,
0.3475421071052551,
0.5116094350814819,
-... |
func drawNFA(w http.ResponseWriter, r *http.Request) {
draw(w, r, "NFA")
} | [
-0.4937768578529358,
0.3229697644710541,
0.35171782970428467,
0.2987200617790222,
-0.18446187674999237,
-0.4317428469657898,
0.23892353475093842,
-0.5603795051574707,
0.8942743539810181,
-0.6748331785202026,
-0.33718305826187134,
0.5227662324905396,
-0.007152982987463474,
0.251246303319931... |
func draw(w http.ResponseWriter, r *http.Request, which string) {
exprlist := getexprs(r) // must load data before writing anything
nx := len(exprlist)
putheader(w, r, which+" Graph") // write page header
fmt.Fprintln(w, "<P class=xleading>")
treelist := make([]rx.Node, 0)
for i, e := range exprlist {
if nx ... | [
-0.7508592009544373,
0.37930458784103394,
0.9205688238143921,
0.0938282459974289,
-0.13618120551109314,
-0.1372193694114685,
0.3776598870754242,
-0.12326250225305557,
0.40180206298828125,
-0.41186314821243286,
0.5377621650695801,
0.2511212229728699,
0.002798940986394882,
0.3100832998752594... |
func TestGoDefaultIsOkay(t *testing.T) {
clientConf := &tls.Config{}
c := connect(t, clientConf)
ci := pullClientInfo(c)
t.Logf("%#v", ci)
if ci.Rating != okay {
t.Errorf("Go client rating: want %s, got %s", okay, ci.Rating)
}
if len(ci.GivenCipherSuites) == 0 {
t.Errorf("no cipher suites given")
}
if ci.... | [
0.09417150914669037,
1.1572901010513306,
0.46576786041259766,
-0.025499848648905754,
0.7994137406349182,
0.8720923066139221,
0.10392038524150848,
-0.010523487813770771,
-0.7445415258407593,
0.6939632892608643,
-0.7251896858215332,
-0.42820122838020325,
-0.9028978943824768,
-0.1542162299156... |
func ReverseByteSlice(s []byte) []byte {
// make a copy of s
l := len(s)
t := make([]byte, l)
for i := 0; i < l; i++ {
t[i] = s[i]
}
// reverse
for i, j := 0, len(t)-1; i < j; i, j = i+1, j-1 {
t[i], t[j] = t[j], t[i]
}
return t
} | [
-0.19011706113815308,
-0.49193882942199707,
0.6539719104766846,
-0.6914147734642029,
-0.5767874717712402,
-0.8735445737838745,
-0.28688251972198486,
0.3485566973686218,
-0.5709958672523499,
0.6783661842346191,
-1.1546458005905151,
0.3639730215072632,
-0.5658158659934998,
-0.568372070789337... |
func FormatSeq(seq []byte, width int) []byte {
var buffer bytes.Buffer
l := len(seq)
lines := int(l / width)
var start, end int
for i := 0; i <= lines; i++ {
start = i * width
end = (i + 1) * width
if end > l {
end = l
}
buffer.Write(seq[start:end])
buffer.WriteString("\n")
}
return buffer.Bytes(... | [
-0.12991179525852203,
-0.9416108131408691,
0.753162145614624,
-0.8472864627838135,
-0.8735386729240417,
-0.9666010737419128,
-0.35726475715637207,
-0.5037752389907837,
0.8760411143302917,
0.5085821151733398,
0.47297248244285583,
-0.5041189789772034,
-0.3450682759284973,
1.0166369676589966,... |
func configureAssets(app *aero.Application) {
// Script bundle
scriptBundle := js.Bundle()
// Service worker
serviceWorkerBytes, err := ioutil.ReadFile("scripts/ServiceWorker/ServiceWorker.js")
serviceWorker := string(serviceWorkerBytes)
// CSS bundle
cssBundle := css.Bundle()
if err != nil {
panic("Couldn... | [
0.044214580208063126,
-0.756622850894928,
0.806455671787262,
0.39114078879356384,
-0.29208695888519287,
0.5079350471496582,
0.18277508020401,
-0.9805508852005005,
0.5024375319480896,
-0.18062695860862732,
0.4079362750053406,
-0.17157737910747528,
0.5226133465766907,
0.5146499872207642,
-... |
func NewNodePath(relSchemaPath []string, keys map[string]interface{}, p PathStruct) NodePath {
return NodePath{relSchemaPath: relSchemaPath, keys: keys, p: p}
} | [
-0.258859783411026,
-0.5924800634384155,
0.26081565022468567,
-0.025384731590747833,
-0.6703195571899414,
0.25792190432548523,
-0.5883603096008301,
0.4966643452644348,
-0.08116760849952698,
0.33980607986450195,
-0.4879586696624756,
-0.28795769810676575,
-0.605359673500061,
0.07786037772893... |
func NewPeerTLSFromCert(url string, certificate string, serverHostOverride string, config apiconfig.Config) (*Peer, error) {
// TODO: config is declaring TLS but cert & serverHostOverride is being passed-in...
conn, err := newPeerEndorser(url, certificate, serverHostOverride, connBlocking, config)
if err != nil {
... | [
0.37141522765159607,
-0.4219112992286682,
0.4763968586921692,
0.45442885160446167,
-0.9417266845703125,
0.17784483730793,
-0.8300368785858154,
0.05701326206326485,
-0.4824948310852051,
0.21272613108158112,
-0.43527957797050476,
-0.7570911645889282,
-0.80036860704422,
0.8509507775306702,
... |
func NewPeer(url string, config apiconfig.Config) (*Peer, error) {
conn, err := newPeerEndorser(url, "", "", connBlocking, config)
if err != nil {
return nil, err
}
return NewPeerFromProcessor(url, &conn, config)
} | [
-0.5946178436279297,
-0.4312469959259033,
0.3599778413772583,
0.7228555679321289,
-0.9935137033462524,
-0.40267276763916016,
-0.24812786281108856,
0.701104998588562,
0.21526098251342773,
0.063802570104599,
-0.5070990920066833,
-0.23457519710063934,
-0.8974101543426514,
0.7600706815719604,
... |
func NewPeerFromProcessor(url string, processor apitxn.ProposalProcessor, config apiconfig.Config) (*Peer, error) {
return &Peer{url: url, processor: processor}, nil
} | [
-0.27449309825897217,
-0.6360976696014404,
0.1364913135766983,
-0.06073828414082527,
-1.4510859251022339,
-0.19067883491516113,
-1.0331653356552124,
0.6213645339012146,
-0.05393899604678154,
0.3897683918476105,
-0.5151987075805664,
-0.03295959159731865,
-0.5200061202049255,
0.6442920565605... |
func (p *Peer) Name() string {
return p.name
} | [
-0.8212066292762756,
-0.6117722988128662,
0.3821127116680145,
-0.38253650069236755,
-1.097954273223877,
0.8985711336135864,
-0.4681852161884308,
-0.14804519712924957,
-0.550064206123352,
1.2107917070388794,
-0.18262697756290436,
0.04340886324644089,
-0.9989663362503052,
-0.1146209090948104... |
func (p *Peer) SetName(name string) {
p.name = name
} | [
-0.6660625338554382,
-0.11835064738988876,
0.4182811379432678,
-0.26223430037498474,
-0.7880522608757019,
0.6736385226249695,
-0.7324727773666382,
0.37343931198120117,
-0.3200964033603668,
1.34292733669281,
-0.8584403991699219,
-0.17214806377887726,
-1.2079976797103882,
0.4913612902164459,... |
func (p *Peer) MSPID() string {
return p.mspID
} | [
1.3808228969573975,
-1.6156744956970215,
0.3884132504463196,
-0.5833799242973328,
-0.8079891204833984,
1.455383062362671,
-0.5905685424804688,
0.15109343826770782,
1.2750535011291504,
0.4696548879146576,
0.47071897983551025,
-0.8132278919219971,
-0.924217939376831,
-0.42168477177619934,
... |
func (p *Peer) SetMSPID(mspID string) {
p.mspID = mspID
} | [
1.1046212911605835,
-1.4792007207870483,
0.46782273054122925,
-0.053580012172460556,
-0.621343731880188,
1.3184547424316406,
-0.9205570220947266,
0.049795739352703094,
1.096805214881897,
0.3542315363883972,
-0.4715801179409027,
-0.674331545829773,
-1.1470826864242554,
0.34194624423980713,
... |
func (p *Peer) EnrollmentCertificate() *pem.Block {
return p.enrollmentCertificate
} | [
0.5366512537002563,
0.1646600216627121,
0.5555150508880615,
-0.06988051533699036,
-1.2516088485717773,
1.1001818180084229,
-0.11297900229692459,
-0.3987457752227783,
0.5974141955375671,
-0.8748820424079895,
-0.2719145119190216,
0.8519787788391113,
-0.5820353031158447,
0.6276363730430603,
... |
func (p *Peer) URL() string {
return p.url
} | [
-0.3163256347179413,
-0.41368669271469116,
-0.1939690262079239,
0.09183570742607117,
0.06169027462601662,
1.5300846099853516,
-0.2594374716281891,
0.8750619292259216,
-0.0037743982393294573,
0.09256303310394287,
-0.1536199450492859,
0.1953480839729309,
-1.515605092048645,
-0.47800335288047... |
func (p *Peer) ProcessTransactionProposal(proposal apitxn.TransactionProposal) (apitxn.TransactionProposalResult, error) {
return p.processor.ProcessTransactionProposal(proposal)
} | [
-1.0770680904388428,
0.14632679522037506,
0.3926107585430145,
-1.2452813386917114,
-0.4574502408504486,
-0.9328485131263733,
-0.12170051783323288,
-0.3862958550453186,
0.16789306700229645,
1.815284013748169,
0.3662779629230499,
-1.2050975561141968,
-0.4383181631565094,
-0.5015414953231812,... |
func PeersToTxnProcessors(peers []fab.Peer) []apitxn.ProposalProcessor {
tpp := make([]apitxn.ProposalProcessor, len(peers))
for i := range peers {
tpp[i] = peers[i]
}
return tpp
} | [
-1.6682263612747192,
-0.25639671087265015,
0.3621748983860016,
-1.159991979598999,
-0.10813073068857193,
-0.5954450368881226,
-0.888535737991333,
0.2238430231809616,
0.5782360434532166,
1.755490779876709,
-0.03523176908493042,
-0.5641718506813049,
-0.9021061658859253,
-0.5284440517425537,
... |
func (e *Engine) Execute(_ context.Context, _ string, _ *enginetypes.ExecConfig) (execID string, stdout io.ReadCloser, stderr io.ReadCloser, writer io.WriteCloser, err error) {
err = types.ErrEngineNotImplemented
return
} | [
-0.38194045424461365,
-1.0954031944274902,
0.7118439078330994,
0.12425035983324051,
0.12275544553995132,
0.27742868661880493,
-0.3395065367221832,
-0.1678113043308258,
-0.31987231969833374,
0.7444090247154236,
0.16103288531303406,
0.019199823960661888,
-0.21924898028373718,
-0.135276839137... |
func (e *Engine) ExecResize(_ context.Context, _ string, _, _ uint) (err error) {
err = types.ErrEngineNotImplemented
return
} | [
-0.6792492866516113,
0.7071118354797363,
0.9101434946060181,
-0.04502159357070923,
0.47465407848358154,
-0.45389994978904724,
-0.2989121079444885,
0.12077554315328598,
-0.08785071969032288,
0.1662120521068573,
-0.04548635706305504,
0.5537287592887878,
-0.271761953830719,
0.1977664381265640... |
func (e *Engine) ExecExitCode(_ context.Context, _, _ string) (execCode int, err error) {
err = types.ErrEngineNotImplemented
return
} | [
0.06582646816968918,
-0.11066868901252747,
0.8256477117538452,
0.2278071939945221,
-0.25487834215164185,
-0.6163545846939087,
0.7501027584075928,
0.3313615024089813,
-0.33722996711730957,
0.7891740202903748,
0.3771267533302307,
0.4660114347934723,
0.10892001539468765,
0.5438235998153687,
... |
func matchDestType(vl reflect.Value, dstTp reflect.Type) reflect.Value {
if vl.Type() == MapIndexValueType {
mVl := vl.Interface().(MapIndexValue)
vl := mVl.X.MapIndex(mVl.Key)
if !vl.IsValid() {
vl = reflect.Zero(mVl.X.Type().Elem())
}
return matchDestType(vl, dstTp)
}
if vl.Type() == ConstValueType {... | [
-0.27117180824279785,
-0.2539554834365845,
0.8492307662963867,
-0.4837495684623718,
-1.237069845199585,
0.32298776507377625,
-0.026572007685899734,
-0.468332439661026,
0.17303141951560974,
0.4494060277938843,
0.48932045698165894,
0.40726763010025024,
0.26576244831085205,
0.3407899439334869... |
func tempFile(prefix string) (f *os.File, err error) {
dir := os.TempDir()
nconflict := 0
for i := 0; i < 10000; i++ {
name := dir + string(os.PathSeparator) + prefix + nextSuffix()
f, err = os.OpenFile(name, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0600)
if os.IsExist(err) {
if nconflict++; nconflict > 10... | [
0.4196580946445465,
0.6967018842697144,
0.8182231783866882,
-0.7255380153656006,
0.7639967203140259,
-0.39478957653045654,
0.9860659241676331,
0.23026271164417267,
0.1675502359867096,
0.01292512472718954,
-0.3021056056022644,
-0.5506579279899597,
-0.40599820017814636,
0.10493230074644089,
... |
func getAugs(c *cli.Context) *iniparamsContainer {
j := &jsonControl{}
j.Command = c.Command.Names()[0]
if j.Command == "json" {
err := json.Unmarshal([]byte(c.String("json")), &j)
if err != nil {
fmt.Fprintf(os.Stderr, "Error: JSON Format error. Please confirm inputted JSON again.\n")
os.Exit(1)
... | [
-0.5437939167022705,
0.3452412188053131,
0.6785493493080139,
-0.6042289733886719,
-0.23422345519065857,
-0.047584351152181625,
-0.016867348924279213,
-0.7868977189064026,
-0.7260483503341675,
-0.014685645699501038,
0.6917941570281982,
0.9040552377700806,
0.18317526578903198,
0.891810119152... |
func (i *iniparamsContainer) getCfg() *iniparamsContainer {
p := &authParams{}
p.pstart = time.Now()
if cfgdata, err := ioutil.ReadFile(filepath.Join(i.CfgDir, cfgFile)); err == nil {
err = json.Unmarshal(cfgdata, &p.GislackCfg)
if err != nil {
fmt.Fprintf(os.Stderr, "Error: Format error of '%s'. ", cfg... | [
0.02913329377770424,
0.43219655752182007,
0.5698524117469788,
-0.020183958113193512,
0.41293612122535706,
-0.25888678431510925,
0.5241195559501648,
0.27236270904541016,
-1.0482676029205322,
0.22997760772705078,
0.37729719281196594,
0.7864670157432556,
-0.2796904742717743,
0.806395292282104... |
func (i *iniparamsContainer) keyChk() *iniparamsContainer {
boolkeys := []string{
"jsonparser",
"public",
"list",
"deleteall",
"anonymous",
"listasjson",
"channellist",
"filelist",
"channelhistory",
"deletefiles",
"simpleresult",
"chkgisttoken",
"filelistasjson",
"appcheck",
... | [
0.3484436273574829,
-0.007521172985434532,
0.7073855996131897,
-0.4712662398815155,
0.8750993609428406,
0.03417374938726425,
0.6849251985549927,
-0.7485418915748596,
-0.6397974491119385,
0.3324655294418335,
-0.08337724208831787,
0.7431471943855286,
-0.18245947360992432,
0.5781916975975037,... |
func WithBanner(a bool) LogBufferOption {
return func(o *logBufferOptions) {
o.addBanner = a
}
} | [
1.0851331949234009,
0.3945161998271942,
0.5919048190116882,
-0.12820881605148315,
0.15832923352718353,
0.05424853414297104,
0.3025655150413513,
-0.4349766671657562,
0.6816818118095398,
-1.1662741899490356,
-0.5481963157653809,
-0.3145259916782379,
-0.3777095377445221,
0.3955022990703583,
... |
func WithHeader(k string, v interface{}) LogBufferOption {
return func(o *logBufferOptions) {
if o.withHeaders == nil {
o.withHeaders = make(map[string]interface{})
}
o.withHeaders[k] = v
}
} | [
0.9187369346618652,
-0.42480260133743286,
0.6810177564620972,
-0.36077672243118286,
-0.8620094060897827,
-0.06010851263999939,
-0.17778702080249786,
-1.083464503288269,
0.6754460334777832,
-0.54903244972229,
-0.21038329601287842,
-0.1281072348356247,
0.017388567328453064,
-0.07733431458473... |
func WithMaxSize(s uint) LogBufferOption {
return func(o *logBufferOptions) {
o.maxSize = s
}
} | [
0.8335835337638855,
-0.414466917514801,
0.3839476406574249,
-0.24039892852306366,
-0.8785864114761353,
-0.29675230383872986,
-0.11036986857652664,
-0.23095493018627167,
1.5287615060806274,
-0.619867742061615,
-1.1413233280181885,
-0.09723257273435593,
-0.272395521402359,
0.1082377210259437... |
func WithCustomBanner(b string) LogBufferOption {
return func(o *logBufferOptions) {
o.banner = b
}
} | [
1.364414930343628,
-0.09541130065917969,
0.5022872090339661,
-0.19803296029567719,
-0.27245140075683594,
-0.16352680325508118,
-0.22431708872318268,
-0.3162252902984619,
0.8603551387786865,
-0.7009826898574829,
-1.3462252616882324,
0.34803876280784607,
-0.5636946558952332,
0.95037305355072... |
func (t *TimeIterator) NewUserCalculator() *UserCalculator {
u := &UserCalculator{
TimeIterator: t,
m: make(map[string]*ActiveCalculator),
}
return u
} | [
-0.415274441242218,
-0.9303374290466309,
0.17119605839252472,
0.2999134063720703,
-2.0486631393432617,
-0.8924371600151062,
0.6795560717582703,
-0.4791523516178131,
0.21915283799171448,
-0.19859203696250916,
-0.8979190587997437,
-0.002142035635188222,
0.2216726541519165,
0.1745616644620895... |
func (u *UserCalculator) Init() *UserCalculator {
if u.init {
return u
}
// transition to slice to avoid map iteration in Process
u.calc = make([]userCalc, 0, len(u.m))
for id, a := range u.m {
a.Init()
u.calc = append(u.calc, userCalc{ID: id, Calc: a})
}
u.Register(u)
u.init = true
return u
} | [
-0.3770836293697357,
0.4047646224498749,
0.4931891858577728,
0.24478639662265778,
-0.662895679473877,
0.2701064348220825,
0.8156183958053589,
0.10323674231767654,
0.2617028057575226,
-0.49930286407470703,
-0.733909547328949,
0.10010095685720444,
0.2887130379676819,
0.719016969203949,
-0.... |
func (u *UserCalculator) SetSpan(start, end time.Time, id string) {
if u.init {
panic("cannot call SetSpan after init")
}
// set span per UserID
c := u.m[id]
if c == nil {
c = u.NewActiveCalculator()
u.m[id] = c
}
c.SetSpan(start, end)
} | [
-0.3043413460254669,
-0.04910530894994736,
0.08660983294248581,
0.9525894522666931,
-0.9017412066459656,
0.7275108098983765,
0.9238746166229248,
-0.5042731761932373,
0.048591673374176025,
-0.7993015050888062,
-0.9798704385757446,
0.47086748480796814,
0.17480778694152832,
0.5204535722732544... |
func (u *UserCalculator) Process(int64) int64 {
if !u.init {
panic("init was never called")
}
if len(u.calc) == 0 {
return -1
}
u.changed = false
for _, c := range u.calc {
if !c.Calc.Changed() {
continue
}
u.changed = true
if c.Calc.Active() {
u.active = append(u.active, c.ID)
} else {
u.a... | [
-0.2812044024467468,
-0.010342514142394066,
0.6005648374557495,
0.012275753542780876,
-0.731835663318634,
0.0701981708407402,
0.9757069945335388,
-0.4008738100528717,
0.3563043773174286,
-0.0746503546833992,
-0.4714806377887726,
-0.12689100205898285,
-0.21192026138305664,
0.540183067321777... |
func (u *UserCalculator) Done() {} | [
0.009799131192266941,
0.38474541902542114,
0.35914555191993713,
1.333253026008606,
-0.47803544998168945,
0.8298630118370056,
1.3570910692214966,
-0.5605915784835815,
-0.01230344083160162,
-0.7030593156814575,
-1.0915982723236084,
0.235052689909935,
0.0596596859395504,
0.4949980080127716,
... |
func (u *UserCalculator) ActiveUsers() []string { return u.active } | [
-0.29766905307769775,
-1.2818751335144043,
0.14676593244075775,
0.6045858860015869,
-0.3220483660697937,
0.729515552520752,
0.5049378275871277,
0.3079468607902527,
0.2717876136302948,
-0.6005505323410034,
-0.24578247964382172,
0.689887523651123,
-0.6566509008407593,
-0.7622332572937012,
... |
func (u *UserCalculator) Changed() bool { return u.changed } | [
-0.6578019857406616,
0.01070327963680029,
0.3636648654937744,
0.7610710859298706,
-0.3304392099380493,
1.1305086612701416,
0.6435666084289551,
0.16304610669612885,
0.019702184945344925,
-0.8611901998519897,
-1.0859999656677246,
0.32596075534820557,
0.1863427609205246,
0.5975712537765503,
... |
func generate(numRows int) [][]int {
res := make([][]int, numRows)
for i := range res {
res[i] = make([]int, i + 1)
res[i][0] = 1
// 头尾赋值
res[i][i] = 1
for j := 1; j < i; j++ {
res[i][j] = res[i-1][j]+res[i-1][j-1]
}
}
return res
} | [
-1.0520906448364258,
0.7457735538482666,
0.8718132376670837,
0.0035854182206094265,
-0.12232161313295364,
-0.6698814034461975,
1.4786657094955444,
-0.06402818858623505,
0.6634576320648193,
-0.19416865706443787,
-0.9302195310592651,
-0.8607828617095947,
-0.6246620416641235,
0.19786444306373... |
func TestUnitRust(t *testing.T) {
spec.Run(t, "Rust", testRust, spec.Report(report.Terminal{}))
} | [
1.1057238578796387,
0.740218460559845,
0.4481661021709442,
-0.31156525015830994,
1.8023403882980347,
0.1491374522447586,
0.6878721117973328,
-0.3863322138786316,
0.27456703782081604,
-0.5163195729255676,
-0.6131596565246582,
1.2570586204528809,
0.06320513039827347,
-0.1409640908241272,
-... |
func NewServer(config ServerConfig) *Server {
clientPool := NewCISClientPool(config.ConnBufferSize)
return &Server{
ServerConfig: config,
websocketConnectionsHandler: websocket.NewConnectionsHandler(),
cisClientPool: clientPool,
}
} | [
0.6487639546394348,
-0.6239936351776123,
0.2092953771352768,
-0.35614874958992004,
-0.36371076107025146,
0.5460477471351624,
0.8580629229545593,
-0.1791074573993683,
0.1953710913658142,
-0.09168212860822678,
-1.4199897050857544,
0.6900394558906555,
-1.0674760341644287,
0.6136325597763062,
... |
func (s *Server) Init() {
s.initPrometheus()
go s.listen()
if s.StateFileName != "" {
simulationState, err := LoadSimulationState(filepath.Join(statesFolderName, s.StateFileName))
if err != nil {
fmt.Println("\nLoading state from filepath failed, exiting now", err)
panic(err)
}
s.SimulationState = sim... | [
-0.07698571681976318,
-0.25199535489082336,
0.7522931694984436,
-0.25690677762031555,
0.2838151752948761,
0.5967061519622803,
-0.15759199857711792,
-0.1360429972410202,
-0.15646390616893768,
-0.14477840065956116,
0.08285395056009293,
0.46450275182724,
-0.24842964112758636,
0.45109489560127... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.