text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (rdq *ResultsDefinitionQuery) WithParticipantFlowModule(opts ...func(*ParticipantFlowModuleQuery)) *ResultsDefinitionQuery {
query := &ParticipantFlowModuleQuery{config: rdq.config}
for _, opt := range opts {
opt(query)
}
rdq.withParticipantFlowModule = query
return rdq
} | [
0.5160642266273499,
-0.8263035416603088,
0.2856246829032898,
-0.08469784259796143,
0.37162336707115173,
0.6695204973220825,
0.44596683979034424,
-0.03411731868982315,
0.9322575330734253,
-0.018476305529475212,
0.4178386926651001,
-0.1545356810092926,
-0.6620289087295532,
0.0387526303529739... |
func (rdq *ResultsDefinitionQuery) WithBaselineCharacteristicsModule(opts ...func(*BaselineCharacteristicsModuleQuery)) *ResultsDefinitionQuery {
query := &BaselineCharacteristicsModuleQuery{config: rdq.config}
for _, opt := range opts {
opt(query)
}
rdq.withBaselineCharacteristicsModule = query
return rdq
} | [
-0.4353041648864746,
-0.6737422347068787,
0.42563095688819885,
-0.8333320021629333,
0.41950884461402893,
0.7289497256278992,
-0.6751349568367004,
-0.4510544240474701,
0.1572801023721695,
-0.5479245185852051,
0.30723920464515686,
1.2521302700042725,
-0.34173840284347534,
0.22164897620677948... |
func (rdq *ResultsDefinitionQuery) WithOutcomeMeasuresModule(opts ...func(*OutcomeMeasuresModuleQuery)) *ResultsDefinitionQuery {
query := &OutcomeMeasuresModuleQuery{config: rdq.config}
for _, opt := range opts {
opt(query)
}
rdq.withOutcomeMeasuresModule = query
return rdq
} | [
0.5079712271690369,
0.3563234508037567,
0.12992854416370392,
-0.21513797342777252,
-0.15177232027053833,
1.5261152982711792,
1.172687292098999,
-0.1552288979291916,
0.5466274619102478,
0.27846625447273254,
0.3102116584777832,
-0.2824929654598236,
-0.8857771158218384,
1.1070332527160645,
... |
func (rdq *ResultsDefinitionQuery) WithAdverseEventsModule(opts ...func(*AdverseEventsModuleQuery)) *ResultsDefinitionQuery {
query := &AdverseEventsModuleQuery{config: rdq.config}
for _, opt := range opts {
opt(query)
}
rdq.withAdverseEventsModule = query
return rdq
} | [
0.6988412141799927,
-0.23516851663589478,
0.618266761302948,
-0.8537817597389221,
0.4277056157588959,
0.7182927131652832,
0.036170925945043564,
-0.5893035531044006,
0.5354099273681641,
0.10289028286933899,
0.3001704216003418,
1.1089719533920288,
-0.16711531579494476,
0.8399553894996643,
... |
func (rdq *ResultsDefinitionQuery) WithMoreInfoModule(opts ...func(*MoreInfoModuleQuery)) *ResultsDefinitionQuery {
query := &MoreInfoModuleQuery{config: rdq.config}
for _, opt := range opts {
opt(query)
}
rdq.withMoreInfoModule = query
return rdq
} | [
-0.3410760164260864,
-0.19612061977386475,
0.28191420435905457,
-0.28483372926712036,
0.5196924209594727,
0.4039348065853119,
-0.4326171875,
-1.3368889093399048,
0.42886677384376526,
-0.2799115777015686,
0.14940832555294037,
0.16390150785446167,
0.3576299846172333,
0.6098511219024658,
-0... |
func (rdq *ResultsDefinitionQuery) GroupBy(field string, fields ...string) *ResultsDefinitionGroupBy {
grbuild := &ResultsDefinitionGroupBy{config: rdq.config}
grbuild.fields = append([]string{field}, fields...)
grbuild.path = func(ctx context.Context) (prev *sql.Selector, err error) {
if err := rdq.prepareQuery(c... | [
-0.01858174242079258,
0.3979828655719757,
0.43137091398239136,
0.0043393527157604694,
0.24499303102493286,
0.2279002070426941,
1.0010446310043335,
-0.44095051288604736,
-0.7166197896003723,
-0.5015919208526611,
0.04752346873283386,
0.1980193853378296,
-0.628808319568634,
0.2383577078580856... |
func (rdq *ResultsDefinitionQuery) Select(fields ...string) *ResultsDefinitionSelect {
rdq.fields = append(rdq.fields, fields...)
selbuild := &ResultsDefinitionSelect{ResultsDefinitionQuery: rdq}
selbuild.label = resultsdefinition.Label
selbuild.flds, selbuild.scan = &rdq.fields, selbuild.Scan
return selbuild
} | [
0.07703092694282532,
0.3079281747341156,
0.09430170059204102,
-0.12201818078756332,
0.19621627032756805,
0.1608639806509018,
-0.044175781309604645,
-0.7870393991470337,
0.21114908158779144,
-0.9967040419578552,
-0.186624675989151,
0.3622667193412781,
-0.25039881467819214,
-0.24424454569816... |
func (rdgb *ResultsDefinitionGroupBy) Aggregate(fns ...AggregateFunc) *ResultsDefinitionGroupBy {
rdgb.fns = append(rdgb.fns, fns...)
return rdgb
} | [
-0.3668651878833771,
1.2945640087127686,
0.4723447263240814,
0.5287456512451172,
0.9814956188201904,
-0.4292725622653961,
0.18941131234169006,
-0.46091461181640625,
-0.7665620446205139,
-0.7935066819190979,
-0.2865805923938751,
0.4914815127849579,
-0.49335649609565735,
0.6041138172149658,
... |
func (rdgb *ResultsDefinitionGroupBy) Scan(ctx context.Context, v interface{}) error {
query, err := rdgb.path(ctx)
if err != nil {
return err
}
rdgb.sql = query
return rdgb.sqlScan(ctx, v)
} | [
-0.5422661900520325,
0.8156799674034119,
0.26254674792289734,
0.8002282977104187,
-0.5094149112701416,
-0.14298297464847565,
0.47165021300315857,
-0.8925215601921082,
-0.6454781293869019,
-0.2340744137763977,
0.36324483156204224,
0.4268328547477722,
-0.37439948320388794,
0.2714926302433014... |
func (rds *ResultsDefinitionSelect) Scan(ctx context.Context, v interface{}) error {
if err := rds.prepareQuery(ctx); err != nil {
return err
}
rds.sql = rds.ResultsDefinitionQuery.sqlQuery(ctx)
return rds.sqlScan(ctx, v)
} | [
-0.8109283447265625,
0.8154827952384949,
0.24659386277198792,
0.3653806447982788,
-0.38765013217926025,
-0.5315451622009277,
-0.057900089770555496,
-1.0130462646484375,
0.3428992033004761,
-0.4932539761066437,
0.3118785619735718,
0.4865446984767914,
0.06510961800813675,
0.3674852252006531,... |
func DepthFirstSearch(g *graph.Graph, start, end *graph.Vertex) (*list.List, *list.List) {
n := g.Vertices()
visited := make(map[*graph.Vertex]bool)
prev := make(map[*graph.Vertex]*graph.Vertex)
stack, trace := list.New(), list.New()
for i := 0; i < n; i++ {
prev[g.Vertex(i)] = nil
}
stack.PushFront(start)
... | [
-0.02182016707956791,
0.7636728882789612,
0.850949764251709,
0.01245671696960926,
0.14497175812721252,
-0.5271177887916565,
0.681833803653717,
0.10676120966672897,
-0.366192489862442,
0.2795768082141876,
-0.6638527512550354,
0.6631525158882141,
-0.41125455498695374,
0.0671156495809555,
-... |
func (*Grantee) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*Grantee_UserId)(nil),
(*Grantee_GroupId)(nil),
}
} | [
-1.0555601119995117,
-0.1073492243885994,
0.37588098645210266,
0.06422799080610275,
0.5475809574127197,
0.1433718353509903,
-0.16541756689548492,
-0.3263198435306549,
0.4444846510887146,
0.4845578074455261,
0.42733123898506165,
0.2682958245277405,
-0.26281869411468506,
1.3705157041549683,
... |
func (pt *PathTracer) SampleSensorPath(
rng *rand.Rand, scene *Scene, sensor Sensor, x, y int,
sensorBundle, tracerBundle SampleBundle, record *TracerRecord) {
*record = TracerRecord{
ContributionType: TRACER_SENSOR_CONTRIBUTION,
Sensor: sensor,
X: x,
Y: y,
}
if !pt.... | [
0.23690873384475708,
-0.9922629594802856,
0.6335394382476807,
-0.23313495516777039,
-0.10438258200883865,
-0.3147423565387726,
0.967809796333313,
-0.7106183767318726,
0.6396974325180054,
0.54166579246521,
0.5342716574668884,
-0.5779238343238831,
0.08890295773744583,
0.2112577110528946,
-... |
func Namespaced(t Type, ns string) Type {
return namespacedWrapper{
ns: ns,
t: t,
}
} | [
0.6283158659934998,
-1.0703034400939941,
0.3333979845046997,
-0.5884443521499634,
-0.6702746152877808,
0.7279808521270752,
-1.673598051071167,
-0.8323172330856323,
0.20413203537464142,
-0.803181529045105,
0.013631515204906464,
1.432928442955017,
1.1489856243133545,
0.17074275016784668,
0... |
func (d namespacedWrapper) Unwrap() Type {
return unwrapMetric(d.t)
} | [
0.1389642208814621,
1.0083492994308472,
0.48962685465812683,
-0.44847020506858826,
-0.8195245862007141,
0.4986598789691925,
0.18277227878570557,
-1.3710968494415283,
-0.6388475894927979,
-0.06951256096363068,
0.6921322345733643,
0.9760448336601257,
0.8496329188346863,
0.48973846435546875,
... |
func NewRouter(c Config) (Router, error) {
c.Environment.Merge(DefaultEnvironment())
r := Router{
Interfaces: make(map[string]InterfaceConfig, len(c.Interfaces)),
Resolvers: make(map[string]ResolverConfig, len(c.Resolvers)),
Scalars: make(map[string]ScalarConfig, len(c.Scalars)),
Unions: make(map[stri... | [
-0.30572250485420227,
-0.09096527099609375,
0.19830569624900818,
-0.09708748757839203,
-0.15871673822402954,
0.6531127095222473,
0.679947018623352,
-0.11978805810213089,
-0.2605670094490051,
0.14925098419189453,
-0.5178142786026001,
-0.26347607374191284,
-0.4823550581932068,
0.780772566795... |
func hostmaster(addr string) {
defer WG.Done()
nRunning := 0 /* Number of active attempts */
nMax := *gc.Htask /* Mx number of simultanous attempts */
var c2 chan string /* C2 Channel, nil if !*gc.Cport */
var doneChan chan *Attempt /* Channel for finished attempts */
var a *Attempt ... | [
-0.04683484882116318,
-0.09595730900764465,
1.067556619644165,
-0.29679107666015625,
-0.8439628481864929,
-0.5917314887046814,
0.4240628182888031,
0.11800005286931992,
-0.20732395350933075,
-0.05062542483210564,
-0.10725820809602737,
0.2978423535823822,
-0.8330432176589966,
0.0553909800946... |
func handleFinished(a *Attempt) (abort, retry, fail, remuser, suc bool) {
/* If we have a success */
if a.Err == nil {
/* Write it to a file */
go logSuccess(a)
suc = true
if *gc.Onepw {
/* If we only need one user, exit */
abort = true
return
} else {
/* Otherwise, we're done with this user */
... | [
0.08630325645208359,
-0.0746438130736351,
0.8974884748458862,
0.288144588470459,
0.290037602186203,
0.37810736894607544,
0.2659264802932739,
-0.23328521847724915,
-0.4032192528247833,
-0.23921340703964233,
0.48050910234451294,
-0.12555713951587677,
-0.03568439558148384,
0.3423246741294861,... |
func appendLine(fname, line string) {
if 0 == len(fname) {
return
}
/* Try to open the successes file */
f, err := os.OpenFile(fname, os.O_WRONLY|os.O_APPEND|os.O_CREATE,
0644)
/* Close on return */
defer f.Close()
/* Give up if we can't */
if err != nil {
log.Printf("Unable to open file %v: %v", f, err)
... | [
0.35997700691223145,
-0.3612760603427887,
0.8021766543388367,
0.11027112603187561,
0.3967514634132385,
0.1802140474319458,
0.14899779856204987,
0.5661165118217468,
-0.19528596103191376,
-0.7280033230781555,
0.002595360856503248,
-0.2418501228094101,
-0.010676498524844646,
0.304836750030517... |
func logSuccess(a *Attempt) {
/* Print message to log */
log.Printf("[%v] SUCCESS %v@%v - %v", a.Tasknum, a.Config.User, a.Host,
a.Pass)
/* Write message to file */
go appendLine(*gc.Sfile, fmt.Sprintf("%v@%v %v\n", a.Config.User,
a.Host, a.Pass))
} | [
0.17047031223773956,
-0.21168509125709534,
0.5058071613311768,
-0.6351085901260376,
0.24475190043449402,
1.0141847133636475,
0.24617493152618408,
0.2965640127658844,
-0.9462586641311646,
0.000870860239956528,
-0.14183592796325684,
0.5615893006324768,
0.5886797904968262,
0.10935860872268677... |
func closeChannel(cname string) {
/* Get the channel to be closed */
c, ok := C2CHANS.Get(cname)
if !ok {
return
}
/* Start a goroutine to read and discard extraneous messages */
go func() {
ok := true
for ok {
_, ok = <-c.(chan string)
}
}()
/* Delete the channel */
C2CHANL.Lock()
defer C2CHANL.Un... | [
-0.23526453971862793,
-0.5673235654830933,
0.5455769300460815,
-1.172757863998413,
-0.054782040417194366,
0.659055769443512,
0.3674115240573883,
0.007807053159922361,
-0.2347039133310318,
-0.28086063265800476,
0.41937726736068726,
0.4917527735233307,
-0.7945348620414734,
0.331714928150177,... |
func (m *Mouse) IsDown(button MouseButton) bool {
return m[glfw.MouseButton(int(button))]
} | [
0.2370234876871109,
-0.9606843590736389,
0.5220817923545837,
0.7891722917556763,
0.2935447692871094,
1.0234898328781128,
-0.44084107875823975,
0.1806454211473465,
0.4606159031391144,
-0.4514203667640686,
-0.3870526850223541,
-0.12052435427904129,
-0.22995705902576447,
0.3712784945964813,
... |
func SetUpServer(ctx context.Context, t *testing.T, installConfig schedulerconfig.Install, allClients cmd.AllClient) TestSetup {
var ref *extender.SparkSchedulerExtender
var rootCtx context.Context
server := witchcraft.NewServer().
WithInstallConfigType(schedulerconfig.Install{}).
WithInstallConfig(installConfig... | [
0.27493470907211304,
-0.8931282162666321,
0.9186630845069885,
-0.1510329395532608,
0.09929799288511276,
-0.16387994587421417,
0.4090774953365326,
0.955402135848999,
0.332457959651947,
-0.09858040511608124,
-0.06824437528848648,
0.5442565083503723,
-0.4823543429374695,
0.557295560836792,
... |
func ToResource(parse resource.Quantity) *resource.Quantity {
return &parse
} | [
0.23981544375419617,
-0.7446190714836121,
0.20840848982334137,
-0.9302465915679932,
-0.2856469452381134,
-0.9823578596115112,
-0.5805894732475281,
-0.21322838962078094,
0.6134030818939209,
-0.2251894623041153,
-0.3530586063861847,
-0.7307243347167969,
-0.07415971904993057,
-1.0143023729324... |
func GetAffinityForInstanceGroup(labelKey string, instanceGroupName string) *v1.Affinity {
return &v1.Affinity{
NodeAffinity: &v1.NodeAffinity{
RequiredDuringSchedulingIgnoredDuringExecution: &v1.NodeSelector{
NodeSelectorTerms: []v1.NodeSelectorTerm{
{
MatchExpressions: []v1.NodeSelectorRequiremen... | [
-0.9635865688323975,
-0.27178457379341125,
0.1081719845533371,
-0.5076416730880737,
-0.2553904354572296,
-0.167791485786438,
-0.49477270245552063,
-0.2530580461025238,
-0.5796862244606018,
0.8426852822303772,
0.689354658126831,
1.5037224292755127,
-0.7790696620941162,
0.680801510810852,
... |
func Setup() {
// create a new instance of the logrus logger
Log = logrus.New()
// set the logger level to debug
Log.Level = logrus.DebugLevel
// set the logger output format
Log.Formatter = &logrus.JSONFormatter{
FieldMap: logrus.FieldMap{
logrus.FieldKeyTime: "timestamp",
logrus.FieldKeyLevel: "sever... | [
-0.12387747317552567,
-0.9650955200195312,
0.6455713510513306,
-1.4302128553390503,
-0.1367514431476593,
-0.31055575609207153,
-0.7569716572761536,
0.16696470975875854,
-0.2406831681728363,
-0.10124284774065018,
-0.26519766449928284,
0.646205723285675,
0.23988188803195953,
0.57281285524368... |
func (s sortableStringSlice) Len() int {
return len(s)
} | [
0.30941376090049744,
-0.30359748005867004,
-0.22233103215694427,
-0.6284234523773193,
0.2555829584598541,
-0.8006638884544373,
0.1655554622411728,
0.4558901786804199,
-0.582220196723938,
-0.2570555508136749,
-0.2890246510505676,
0.6177099943161011,
0.006961914710700512,
-0.2365765273571014... |
func (s sortableStringSlice) Less(i, j int) bool {
return strings.ToLower(s[i]) < strings.ToLower(s[j])
} | [
0.14960114657878876,
-0.5714316368103027,
0.24155156314373016,
-1.2049471139907837,
-0.5422698259353638,
-0.3031620383262634,
-1.0845091342926025,
-1.5471757650375366,
-0.777613639831543,
-0.11953040212392807,
-0.011378498747944832,
0.0922890454530716,
-0.777294933795929,
-0.01527811400592... |
func (s sortableStringSlice) Swap(i, j int) {
tmp := s[i]
s[i] = s[j]
s[j] = tmp
} | [
-1.0241682529449463,
-0.6240600347518921,
0.1364828497171402,
-0.5206747055053711,
0.050793081521987915,
-0.11359783262014389,
-0.3352867662906647,
0.058275241404771805,
-1.0644537210464478,
0.13588480651378632,
0.1903189867734909,
0.8612287044525146,
-0.12084271013736725,
-1.0558012723922... |
func getGithubUser(distroName string) (string, error) {
switch distroName {
case "doom-emacs":
return "hlissner", nil
case "emacs-live":
return "overtone", nil
case "prelude":
return "bbatsov", nil
case "spacemacs":
return "syl20bnr", nil
case "ohai-emacs":
return "bodil", nil
}
return "", errors.Ne... | [
-0.5511476397514343,
-0.026610834524035454,
0.4891413152217865,
0.2910042703151703,
-0.3230818808078766,
0.27734288573265076,
-0.21804681420326233,
-0.010766861960291862,
-0.4383281171321869,
0.01189221628010273,
-0.6181350946426392,
0.44228288531303406,
0.10117124021053314,
0.635889053344... |
func makeRepoUrl(distroUrlOrRepoName string) (string, string, error) {
distroUrl := distroUrlOrRepoName
// if distroUrl does not contain slash, get Github username
// the exact position of the slash is needed later
slashIndex := strings.Index(distroUrl, "/")
if slashIndex < 0 {
userName, err := getGithubUser(di... | [
-0.6031291484832764,
-0.549231767654419,
0.6527422666549683,
-0.5153986811637878,
-0.531978189945221,
0.3187956213951111,
0.42289552092552185,
1.0221022367477417,
-0.0211647842079401,
0.3714587688446045,
-0.2653528153896332,
0.006744658574461937,
0.20751303434371948,
0.273659884929657,
1... |
func Webhook(message string) {
endpoint := os.Getenv("SLACK_WEBHOOK")
if len(endpoint) == 0 { // If the webhook endpoint is not set, ignore
return
}
request := gorequest.New()
resp, body, err := request.Post(os.Getenv("SLACK_WEBHOOK")).
Send(`{"text":"` + message + `"}`).
End()
if err != nil { // Die if t... | [
1.1716269254684448,
0.5853354334831238,
0.7204930186271667,
0.4443700313568115,
1.1309428215026855,
0.49989375472068787,
-0.23903663456439972,
-0.050803396850824356,
-0.16938507556915283,
-0.20970988273620605,
-0.05077432096004486,
1.4712716341018677,
-0.3529500663280487,
0.559863746166229... |
func TestGen_Remote(t *testing.T) {
request := new(pb.GanRequest)
request.ModelName = "gan-mnist-generator"
request.ModelVersion = "v1"
request.Count = 2
b, err := proto.Marshal(request)
if err != nil {
t.Fatal(err)
}
req, err := jwt.Manager().NewHTTPRequest(http.MethodPost, "https://"+
filepath.Join(conf... | [
-0.4318266808986664,
0.19428595900535583,
1.0935527086257935,
0.06594205647706985,
0.11546333879232407,
0.8865814208984375,
0.1535678207874298,
-0.21411730349063873,
-0.9644491076469421,
-0.46658459305763245,
-1.2895839214324951,
0.8325096368789673,
-0.13687019050121307,
0.2450643926858902... |
func hasCycle(head *list.Element) bool {
if head == nil {
return false
}
t, h := head, head
for true {
t = t.Next()
if h.Next() != nil && h.Next().Next() != nil {
h = h.Next().Next()
}else{
return false
}
if t == nil || h == nil {
return false
}
if t == h {
return true
}
fmt.Println... | [
0.05120307207107544,
-0.1428663432598114,
1.1623120307922363,
0.5211532711982727,
-0.4266326129436493,
-0.3779020309448242,
0.14249055087566376,
0.2698410153388977,
-0.048131342977285385,
0.10020989179611206,
-0.5791284441947937,
-0.005622433964163065,
-0.2799991965293884,
1.41489779949188... |
func (this *TF2K8SVisitor) VisitArbitrary(proto *proto.Arbitrary) {
//log.Println("VisitArbitrary path:", this.keyPath)
this.handleJSON()
} | [
-0.5384935736656189,
-0.9782992005348206,
0.44612807035446167,
-0.554885983467102,
-0.047464869916439056,
-0.21752844750881195,
0.6544358134269714,
-0.6652217507362366,
-0.7928074598312378,
0.606462299823761,
-0.03696644306182861,
0.9169682264328003,
0.5327757000923157,
0.29878944158554077... |
func NewSlackBot() *Bot {
c, err := config.New()
if err != nil {
logging.Logger.Fatal(fmt.Sprintf("Error in loading configuration. Error:%s", err.Error()))
}
return &Bot{
Token: c.Communications.Slack.Token,
AllowKubectl: c.Settings.AllowKubectl,
}
} | [
0.9137194752693176,
-0.24667221307754517,
0.24076442420482635,
0.3679366409778595,
-0.6562440991401672,
0.37350937724113464,
-1.0937539339065552,
-0.7425336837768555,
-0.8849841356277466,
0.5699331760406494,
-0.6324104070663452,
0.4873200058937073,
-0.8504509329795837,
0.4266834855079651,
... |
func (b *Bot) Start() {
api := slack.New(b.Token)
authResp, err := api.AuthTest()
if err != nil {
logging.Logger.Fatal(err)
}
botID := authResp.UserID
rtm := api.NewRTM()
go rtm.ManageConnection()
for msg := range rtm.IncomingEvents {
switch ev := msg.Data.(type) {
case *slack.ConnectedEvent:
logging... | [
0.3968784809112549,
-0.2168172001838684,
0.8681302666664124,
-0.4376973807811737,
0.4461405873298645,
0.06010754406452179,
0.03415083885192871,
-0.2753957211971283,
-0.9145256876945496,
0.25719088315963745,
0.6129531264305115,
1.0663692951202393,
-0.47956809401512146,
1.0925403833389282,
... |
func NewFluxFromArray(first payload.Payload, others ...payload.Payload) Flux {
// TODO: tuning
return NewFlux(func(ctx context.Context, producer Producer) {
_ = producer.Next(first)
for _, it := range others {
_ = producer.Next(it)
}
producer.Complete()
})
} | [
0.2448257952928543,
-0.8215673565864563,
0.42672571539878845,
0.7969310283660889,
-0.5931052565574646,
-0.7154738306999207,
-0.35336434841156006,
-1.7562663555145264,
-0.13966500759124756,
-0.3149746358394623,
-0.1792302280664444,
0.23363471031188965,
0.04911882057785988,
0.782052636146545... |
func WithEnvConfig(cfg EnvConfig) Option {
return optionFunc(func(c *config) {
c.httpServer.Addr = cfg.Host + ":" + strconv.FormatUint(uint64(cfg.Port), 10)
})
} | [
0.00763230724260211,
-0.2452191263437271,
0.7120903730392456,
-0.6819060444831848,
-0.042391594499349594,
0.307082861661911,
-0.16314980387687683,
0.26235395669937134,
-0.5565567016601562,
1.078583836555481,
-1.0020231008529663,
-0.03290153667330742,
0.35397228598594666,
0.9091067314147949... |
func ReadTimeout(d time.Duration) Option {
return optionFunc(func(c *config) {
c.httpServer.ReadTimeout = d
})
} | [
0.47505030035972595,
0.4448484778404236,
0.4195643961429596,
0.191301167011261,
0.5746409893035889,
0.9641500115394592,
0.35553163290023804,
0.4374643564224243,
0.2660219073295593,
0.15550921857357025,
0.5401043891906738,
0.5642870664596558,
0.7252165675163269,
0.02474173530936241,
-0.41... |
func RegisterAfterShutdown(f func()) Option {
return optionFunc(func(c *config) {
c.afterShutdown = append(c.afterShutdown, f)
})
} | [
0.281970739364624,
0.5721949934959412,
0.2373621016740799,
0.6588844060897827,
-0.4102621078491211,
0.09372380375862122,
0.12463788688182831,
0.5994217395782471,
-0.09929845482110977,
-0.2197721302509308,
-1.0878469944000244,
-0.8159071207046509,
0.38889047503471375,
0.03180812671780586,
... |
func registerHandlers() Option {
return optionFunc(func(c *config) {
mux := http.NewServeMux()
for pattern, h := range c.handlers {
mux.Handle(pattern, h)
}
c.httpServer.Handler = mux
})
} | [
-0.3926457464694977,
0.5323147773742676,
0.35912850499153137,
0.1991748809814453,
1.3494633436203003,
0.6041304469108582,
0.017591414973139763,
0.6525962352752686,
-0.34160110354423523,
-1.1007585525512695,
-0.5207988023757935,
-0.04194934666156769,
-0.6978223919868469,
0.2840518057346344,... |
func applyEnforcePostJson() Option {
return optionFunc(func(c *config) {
for pattern, h := range c.handlers {
c.handlers[pattern] = enforcePostJson(h)
}
})
} | [
-0.2748144268989563,
-0.5425947904586792,
0.5745344758033752,
-0.14382682740688324,
0.14137189090251923,
0.623885989189148,
0.542000412940979,
0.4410693049430847,
0.19537131488323212,
-0.010056586004793644,
-1.128717064857483,
0.040323782712221146,
-0.15385787189006805,
0.9685187935829163,... |
func applyLog(logger *zap.Logger) Option {
return optionFunc(func(c *config) {
for pattern, h := range c.handlers {
c.handlers[pattern] = log(h, logger)
}
})
} | [
0.38295021653175354,
0.5835537314414978,
0.4043509364128113,
-0.07065363228321075,
0.13048724830150604,
0.6648309826850891,
1.126350998878479,
1.1443703174591064,
0.65056312084198,
-1.87553870677948,
-0.07690271735191345,
-0.5765904784202576,
0.5524613261222839,
0.9346472024917603,
0.369... |
func TimeoutHandler(d time.Duration, msg string) Option {
return optionFunc(func(c *config) {
for pattern, h := range c.handlers {
c.handlers[pattern] = http.TimeoutHandler(h, d, msg)
}
})
} | [
-0.5720354914665222,
-0.21402066946029663,
0.3819568157196045,
-1.1945792436599731,
0.11300867050886154,
0.7998933792114258,
0.4802044928073883,
0.5381091237068176,
-0.07334550470113754,
-0.1073918491601944,
-0.7279075980186462,
-0.31735363602638245,
0.16653069853782654,
0.759945809841156,... |
func NewBasicECSClient(opts awsutil.ClientOptions) (*BasicECSClient, error) {
c := &BasicECSClient{
opts: &opts,
}
if err := c.setup(); err != nil {
return nil, errors.Wrap(err, "setting up client")
}
return c, nil
} | [
-0.16871874034404755,
-0.36508917808532715,
0.4124950170516968,
-0.29415181279182434,
-0.3982650637626648,
0.04751630499958992,
-0.5482091307640076,
-1.2801157236099243,
-0.26248928904533386,
-0.5995128750801086,
-0.8306678533554077,
0.8874821066856384,
-0.023544741794466972,
-1.3500518798... |
func (c *BasicECSClient) RegisterTaskDefinition(ctx context.Context, in *ecs.RegisterTaskDefinitionInput) (*ecs.RegisterTaskDefinitionOutput, error) {
if err := c.setup(); err != nil {
return nil, errors.Wrap(err, "setting up client")
}
var out *ecs.RegisterTaskDefinitionOutput
var err error
msg := awsutil.Make... | [
-0.6782035231590271,
0.46089375019073486,
0.6245614886283875,
0.06539791822433472,
0.3709966838359833,
0.30724677443504333,
0.04238560050725937,
-0.7030600905418396,
-0.3205150067806244,
0.3301256597042084,
-1.0503047704696655,
0.8250632882118225,
-0.3355735242366791,
-0.019894983619451523... |
func (c *BasicECSClient) DescribeTaskDefinition(ctx context.Context, in *ecs.DescribeTaskDefinitionInput) (*ecs.DescribeTaskDefinitionOutput, error) {
if err := c.setup(); err != nil {
return nil, errors.Wrap(err, "setting up client")
}
var out *ecs.DescribeTaskDefinitionOutput
var err error
msg := awsutil.Make... | [
-0.5282465219497681,
0.6481050252914429,
0.6799691915512085,
-0.15703311562538147,
-0.13687895238399506,
-0.038722600787878036,
0.16855448484420776,
-0.8772508502006531,
-0.2819403111934662,
0.31123360991477966,
-0.5308325886726379,
1.1710673570632935,
-0.21674150228500366,
0.1392330378293... |
func (c *BasicECSClient) ListTaskDefinitions(ctx context.Context, in *ecs.ListTaskDefinitionsInput) (*ecs.ListTaskDefinitionsOutput, error) {
if err := c.setup(); err != nil {
return nil, errors.Wrap(err, "setting up client")
}
var out *ecs.ListTaskDefinitionsOutput
var err error
msg := awsutil.MakeAPILogMessag... | [
-0.3131644129753113,
0.462791383266449,
0.4900393486022949,
-0.08070619404315948,
-0.28180330991744995,
0.05561342090368271,
0.11938836425542831,
-1.1831811666488647,
-0.052750781178474426,
0.21303269267082214,
-1.1041203737258911,
0.9694074392318726,
-0.07293064892292023,
0.43353727459907... |
func (c *BasicECSClient) DeregisterTaskDefinition(ctx context.Context, in *ecs.DeregisterTaskDefinitionInput) (*ecs.DeregisterTaskDefinitionOutput, error) {
if err := c.setup(); err != nil {
return nil, errors.Wrap(err, "setting up client")
}
var out *ecs.DeregisterTaskDefinitionOutput
var err error
msg := awsu... | [
-0.28906315565109253,
0.2841138243675232,
0.5854614973068237,
0.028612693771719933,
-0.02720062993466854,
0.023702051490545273,
0.4806269407272339,
-0.10650559514760971,
-0.3168731927871704,
0.16599580645561218,
-0.6327092051506042,
1.1195714473724365,
-0.6324135661125183,
-0.1728634387254... |
func (c *BasicECSClient) RunTask(ctx context.Context, in *ecs.RunTaskInput) (*ecs.RunTaskOutput, error) {
if err := c.setup(); err != nil {
return nil, errors.Wrap(err, "setting up client")
}
var out *ecs.RunTaskOutput
var err error
msg := awsutil.MakeAPILogMessage("RunTask", in)
if err := utility.Retry(ctx,
... | [
-0.7229107022285461,
0.439169317483902,
0.7907545566558838,
0.1733786165714264,
-0.39687713980674744,
0.26372528076171875,
0.27200019359588623,
-0.8195381760597229,
0.1754324734210968,
-0.13316968083381653,
-0.44094517827033997,
0.8238111734390259,
-0.2345173954963684,
-0.7704830169677734,... |
func (c *BasicECSClient) DescribeTasks(ctx context.Context, in *ecs.DescribeTasksInput) (*ecs.DescribeTasksOutput, error) {
if err := c.setup(); err != nil {
return nil, errors.Wrap(err, "setting up client")
}
var out *ecs.DescribeTasksOutput
var err error
msg := awsutil.MakeAPILogMessage("DescribeTasks", in)
... | [
-0.1877448707818985,
1.3450453281402588,
0.8401039838790894,
-0.2680397033691406,
-0.10571219772100449,
0.2152063399553299,
0.14991270005702972,
-1.3357490301132202,
0.23157651722431183,
-0.06729304045438766,
-0.0775577649474144,
0.9545097351074219,
-0.5612692832946777,
-0.3297925591468811... |
func (c *BasicECSClient) ListTasks(ctx context.Context, in *ecs.ListTasksInput) (*ecs.ListTasksOutput, error) {
if err := c.setup(); err != nil {
return nil, errors.Wrap(err, "setting up client")
}
var out *ecs.ListTasksOutput
var err error
msg := awsutil.MakeAPILogMessage("ListTasks", in)
if err := utility.Re... | [
-0.0632874146103859,
0.5765922665596008,
0.8768972754478455,
-0.16714441776275635,
-0.3169655501842499,
0.1324547827243805,
0.00026959594106301665,
-1.3962130546569824,
0.7668768763542175,
0.00041832143324427307,
-0.5161852240562439,
0.8165096640586853,
-0.3111654818058014,
-0.643704533576... |
func (c *BasicECSClient) StopTask(ctx context.Context, in *ecs.StopTaskInput) (*ecs.StopTaskOutput, error) {
if err := c.setup(); err != nil {
return nil, errors.Wrap(err, "setting up client")
}
var out *ecs.StopTaskOutput
var err error
msg := awsutil.MakeAPILogMessage("StopTask", in)
if err := utility.Retry(c... | [
-0.8066390752792358,
0.30671411752700806,
0.693378210067749,
-0.03931212052702904,
-0.1180332750082016,
0.5028262138366699,
0.3715267777442932,
-0.8186774849891663,
-0.020674265921115875,
-0.17112892866134644,
-0.3612094223499298,
0.3639853298664093,
0.09762221574783325,
-0.997076869010925... |
func (c *BasicECSClient) Close(ctx context.Context) error {
c.opts.Close()
return nil
} | [
0.35900458693504333,
0.42480698227882385,
0.41545334458351135,
-0.6683752536773682,
0.5615264177322388,
0.7356625199317932,
-0.27402377128601074,
-1.8011316061019897,
-0.5083122849464417,
-0.5482954978942871,
0.6932142972946167,
0.3111434280872345,
-1.0753021240234375,
-0.12453215569257736... |
func TestMain(m *testing.M) {
fmt.Println("Running tests with file from disk...")
usingFile = true
testOpenFile()
result := m.Run()
testDbf.Close()
if result != 0 {
os.Exit(result)
}
fmt.Println("Running tests with byte stream...")
usingFile = false
testOpenStream()
result = m.Run()
os.Exit(result)
... | [
0.288818895816803,
-0.1507571041584015,
0.6836397051811218,
0.46606796979904175,
0.0006538152229040861,
0.5711331367492676,
1.3653770685195923,
0.11232816427946091,
-1.1226905584335327,
-0.5184535384178162,
0.1945299655199051,
-0.3447868525981903,
-1.6784321069717407,
0.6256341338157654,
... |
func TestFieldHeader(t *testing.T) {
want := "{Name:[73 68 0 0 0 0 0 0 0 0 0] Type:73 Pos:1 Len:4 Decimals:0 Flags:0 Next:5 Step:1 Reserved:[0 0 0 0 0 0 0 78]}"
have := fmt.Sprintf("%+v", testDbf.fields[0])
if have != want {
t.Errorf("First field from header does not match signature: Want %s, have %s", want, have)... | [
0.3187231123447418,
-0.02483685128390789,
0.4939807057380676,
0.00985223799943924,
0.8633603453636169,
0.1542728841304779,
-0.1458320915699005,
-0.29788121581077576,
-0.34759408235549927,
-0.5317527651786804,
-1.2281423807144165,
-0.22554805874824524,
-0.8554397821426392,
-0.07751748710870... |
func TestStatAndFileSize(t *testing.T) {
if !usingFile {
t.Skip("Stat and FileSize not testing when using stream")
}
stat, err := testDbf.Stat()
if err != nil {
t.Fatal(err)
}
statSize := stat.Size()
hdrSize := testDbf.header.FileSize()
if statSize != hdrSize {
t.Errorf("Calculated header size: %d, stat s... | [
0.7648538947105408,
-0.43912866711616516,
0.6703506112098694,
-0.3379814922809601,
0.09812483191490173,
0.12704700231552124,
0.5490007400512695,
-0.22731566429138184,
0.1900688260793686,
-0.7962625026702881,
0.15761598944664001,
0.3566581904888153,
-0.186534583568573,
1.1034150123596191,
... |
func TestFieldNames(t *testing.T) {
fieldnames := testDbf.FieldNames()
want := 13
if len(fieldnames) != want {
t.Errorf("Expected %d fields, have %d", want, len(fieldnames))
}
// t.Log(fieldnames)
} | [
-0.4207395613193512,
1.5017465353012085,
0.3437363803386688,
-1.0574705600738525,
1.019090175628662,
-0.19239290058612823,
0.17836055159568787,
0.24525363743305206,
0.07490859180688858,
-1.1010515689849854,
-1.2319259643554688,
0.10358744114637375,
-0.8285472989082336,
-0.4223380982875824,... |
func TestRecord(t *testing.T) {
err := testDbf.GoTo(1)
if err != nil {
t.Fatal(err)
}
// test if the record is deleted
deleted, err := testDbf.Deleted()
if err != nil {
t.Fatal(err)
}
if !deleted {
t.Fatal("Record should be deleted")
}
// read the same record using Record() and RecordAt()
recs := [2]... | [
-0.07679595053195953,
0.02152976579964161,
0.7394534349441528,
-0.5036506056785583,
0.8526077270507812,
0.22396822273731232,
0.41598421335220337,
-0.3106321096420288,
-0.6909769177436829,
-0.7120214700698853,
0.3471567928791046,
0.825715184211731,
-0.657852828502655,
0.43897923827171326,
... |
func TestField(t *testing.T) {
for _, want := range wantValues {
val, err := testDbf.Field(want.pos)
if err != nil {
t.Error(err)
}
strval := strings.TrimSpace(fmt.Sprintf("%v", val))
strtype := fmt.Sprintf("%T", val)
if want.strval != strval || want.strtype != strtype {
t.Errorf("Wanted value %s wi... | [
-0.7449315786361694,
0.234482079744339,
0.43395939469337463,
-0.845809280872345,
0.9405165910720825,
0.6343353986740112,
-0.1673622727394104,
-0.8714791536331177,
-0.9978227019309998,
-0.780776858329773,
0.0172028336673975,
0.17280970513820648,
-0.8674978017807007,
0.6716963052749634,
0.... |
func TestDbase30(t *testing.T) {
if !usingFile {
t.Skip("TestDbase30 is only tested from disk")
}
dbf, err := OpenFile(filepath.Join("testdata", "dbase_30.dbf"), new(Win1250Decoder))
if err != nil {
t.Fatal(err)
}
defer dbf.Close()
err = dbf.GoTo(13)
if err != nil {
t.Fatal(err)
}
rec, err := dbf.Re... | [
-0.11944261938333511,
0.031984373927116394,
0.8388609886169434,
-0.5606855154037476,
0.4581122100353241,
1.0204094648361206,
0.8101859092712402,
-0.13689899444580078,
-0.32959043979644775,
-0.46294498443603516,
-0.479117751121521,
0.7825700640678406,
-0.7446417808532715,
0.4056722819805145... |
func TestDbase31(t *testing.T) {
if !usingFile {
t.Skip("TestDbase31 is only tested from disk")
}
dbf, err := OpenFile(filepath.Join("testdata", "dbase_31.dbf"), new(Win1250Decoder))
if err != nil {
t.Fatal(err)
}
defer dbf.Close()
err = dbf.GoTo(28)
if err != nil {
t.Fatal(err)
}
// test value and ... | [
-0.16548648476600647,
0.09587878733873367,
0.8236067891120911,
0.2814977169036865,
0.4475645422935486,
1.1405218839645386,
0.7742953896522522,
-0.7643061280250549,
-0.2971890866756439,
-0.5381169319152832,
-0.18948467075824738,
0.39377862215042114,
-0.4655730426311493,
0.35526028275489807,... |
func TestDkeza(t *testing.T) {
if !usingFile {
t.Skip("TestDkeza is only tested from disk")
}
dbf, err := OpenFile(filepath.Join("testdata", "dkeza.dbf"), new(UTF8Decoder))
if err != nil {
t.Fatal(err)
}
defer dbf.Close()
err = dbf.GoTo(0)
if err != nil {
t.Fatal(err)
}
// test value and type of NUM... | [
-0.30681726336479187,
0.4687139093875885,
0.7255623936653137,
0.18461163341999054,
0.3637864291667938,
0.13502474129199982,
1.495665431022644,
-0.6187212467193604,
-0.5200679302215576,
-0.25874266028404236,
-0.5888709425926208,
-0.033204250037670135,
-0.8403465747833252,
0.615359365940094,... |
func BenchmarkReadRecords(b *testing.B) {
for n := 0; n < b.N; n++ {
err := func() error {
dbf, err := OpenFile(filepath.Join("testdata", "dbase_30.dbf"), new(Win1250Decoder))
if err != nil {
return err
}
defer dbf.Close()
for i := uint32(0); i < dbf.NumRecords(); i++ {
_, err := dbf.Record()
... | [
0.5222851634025574,
0.8916301727294922,
0.7632811665534973,
-0.773056149482727,
1.139998197555542,
-0.05938323959708214,
0.6811175346374512,
0.08093924820423126,
-0.870377779006958,
0.2082292139530182,
0.293411523103714,
0.5034850239753723,
-1.2856345176696777,
0.1925586462020874,
0.9340... |
func (*HealthCheckRequestOrEndpointHealthResponse) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _HealthCheckRequestOrEndpointHealthResponse_OneofMarshaler, _HealthCheckRe... | [
-0.2853246331214905,
-0.18324801325798035,
0.5686827898025513,
-0.3268457055091858,
0.8641158938407898,
-0.503294825553894,
0.3331424295902252,
-1.0986872911453247,
0.6327831149101257,
-0.9714772701263428,
0.797995924949646,
-0.5151610970497131,
-0.607771098613739,
0.09413240849971771,
0... |
func checkIfExistsGenerator(expectedID string, err error) func(string) (bool, error) {
return func(id string) (bool, error) {
if err != nil {
return false, err
}
return id == expectedID, nil
}
} | [
-0.8318031430244446,
-0.23791176080703735,
0.3027755618095398,
0.23894500732421875,
-0.3032490313053131,
0.17416132986545563,
-0.07554483413696289,
0.33715763688087463,
0.18241459131240845,
0.23028141260147095,
0.20050054788589478,
-0.038665417581796646,
0.13320370018482208,
0.951836884021... |
func checkHostGenerator(expectedUsername string, expectedID string, err error) func(string, string) (bool, error) {
return func(username string, eventID string) (bool, error) {
if err != nil {
return false, err
}
if username != expectedUsername {
return false, nil
} else if eventID != expectedID {
re... | [
-0.3876456320285797,
-0.22003421187400818,
0.5936317443847656,
0.7934603095054626,
-1.0098682641983032,
0.9726971387863159,
0.6205505132675171,
0.7121992111206055,
-0.9371844530105591,
-0.03626919165253639,
-0.18357862532138824,
-0.034781817346811295,
-0.3119778335094452,
0.742659032344818... |
func authenticateGenerator(authenticate bool, err error) func(r *http.Request) (bool, error) {
return func(r *http.Request) (bool, error) {
return authenticate, err
}
} | [
-1.55996835231781,
0.2909654974937439,
0.7249098420143127,
0.6997408270835876,
-1.4908291101455688,
0.22307699918746948,
-0.06740301847457886,
-0.015520738437771797,
0.14065685868263245,
0.22602634131908417,
-0.008645766414701939,
-0.5455169081687927,
0.21171008050441742,
0.258427590131759... |
func urlExistsGenerator(expected string, err error) func(string) (bool, error) {
return func(url string) (bool, error) {
if err != nil {
return false, err
}
return url == expected, nil
}
} | [
-0.8710757493972778,
-0.39083781838417053,
0.48165541887283325,
-0.4639935791492462,
-0.3653842806816101,
0.7793790698051453,
0.001751606003381312,
1.2059632539749146,
-0.1042805016040802,
-0.46119818091392517,
0.2773646116256714,
-0.3385962247848511,
0.4174228012561798,
0.1705737709999084... |
func noValidTokenTest(t *testing.T, r *http.Request, h http.Handler, auth *mock.Authenticator) {
original := auth.AuthenticateFn
auth.AuthenticateFn = authenticateGenerator(false, errors.New("An error"))
w := httptest.NewRecorder()
h.ServeHTTP(w, r)
test.Equals(t, http.StatusBadRequest, w.Result().StatusCode)
aut... | [
-0.36612841486930847,
0.12992480397224426,
0.4428557753562927,
0.09156911820173264,
-0.2793658375740051,
0.060556892305612564,
-0.36634859442710876,
0.2311658263206482,
-0.1424182504415512,
-1.0064350366592407,
-0.3183079659938812,
0.5650374293327332,
-0.052130404859781265,
0.3830814659595... |
func adminAccessTest(t *testing.T, r *http.Request, h http.Handler, auth *mock.Authenticator,
outputTester func(*http.Response)) {
original := auth.GetAuthInfoFn
auth.GetAuthInfoFn = getAuthInfoGenerator("", false, errors.New("An error"))
w := httptest.NewRecorder()
h.ServeHTTP(w, r)
test.Equals(t, http.StatusBa... | [
0.04576842114329338,
-0.38461872935295105,
0.5957768559455872,
-0.3460928201675415,
-0.5011342167854309,
0.5120854377746582,
0.46971550583839417,
-0.8566333651542664,
0.4148429036140442,
-0.4946187138557434,
0.1336958110332489,
0.8686699867248535,
0.1554463654756546,
0.3295711874961853,
... |
func eventDoesNotExistTest(t *testing.T, badRequest *http.Request, h http.Handler, es *mock.EventService) {
w := httptest.NewRecorder()
h.ServeHTTP(w, badRequest)
test.Equals(t, http.StatusNotFound, w.Result().StatusCode)
original := es.CheckIfExistsFn
es.CheckIfExistsFn = checkIfExistsGenerator("", errors.New("A... | [
-0.26658451557159424,
-0.13143116235733032,
0.8100101351737976,
0.17382653057575226,
1.287935495376587,
0.6502826809883118,
0.3359958827495575,
0.21981877088546753,
-0.05513957142829895,
-0.5185367465019226,
0.008332251571118832,
0.2981339991092682,
0.2735799252986908,
0.5525968670845032,
... |
func (s *Server) PrepareAgent(agent *core.Agent) (*core.RegisterAgentTicket, error) {
// generate a ticket and store in the store, for agent register
// if pending count greatter then max, just return error
n, err := s.store.CountPenddingAgents()
if err != nil {
log.Println("count pendding agents error:", err)
... | [
-0.0741196721792221,
0.02625858597457409,
0.6826842427253723,
-0.4749559760093689,
-0.27968302369117737,
0.04986556991934776,
0.1469220668077469,
0.43718957901000977,
1.100061297416687,
-0.3808489143848419,
-0.6155979037284851,
-0.49172720313072205,
-0.4359634220600128,
0.8375466465950012,... |
func (s *state) GetFramework(id string) (*mesos.FrameworkInfo, error) {
for _, fw := range s.st.GetFrameworks.Frameworks {
if fw.FrameworkInfo.ID.Value == id {
return &fw.FrameworkInfo, nil
}
}
return nil, fmt.Errorf("unable to find framework id %s", id)
} | [
-0.5291345715522766,
0.45053181052207947,
0.3318862318992615,
0.3415043354034424,
0.1006079912185669,
-1.252528190612793,
0.4585302770137787,
-1.2128472328186035,
0.13364334404468536,
-0.8939985036849976,
-0.6628746390342712,
-0.12024152278900146,
-0.10809192061424255,
0.5342825651168823,
... |
func (s *state) GetExecutor(id string) (*mesos.ExecutorInfo, error) {
for _, exec := range s.st.GetExecutors.Executors {
if exec.ExecutorInfo.ExecutorID.Value == id {
return &exec.ExecutorInfo, nil
}
}
return nil, fmt.Errorf("unable to find executor with id %s", id)
} | [
0.17812994122505188,
-0.04919370636343956,
0.4582828879356384,
-0.6191209554672241,
-0.2148074060678482,
-1.0721937417984009,
-0.628375232219696,
-0.45953604578971863,
0.30343201756477356,
-0.1890610158443451,
-0.061488907784223557,
0.23951378464698792,
0.6303165555000305,
1.03775131702423... |
func (s *state) GetTask(exID string) (*mesos.Task, error) {
// Check if task is in Launched Tasks list
for _, t := range s.st.GetTasks.LaunchedTasks {
if s.isMatchingTask(&t, exID) {
return &t, nil
}
}
// Check if task is in Queued Tasks list
for _, t := range s.st.GetTasks.QueuedTasks {
if s.isMatchingT... | [
0.6150269508361816,
0.034410260617733,
0.5442026257514954,
0.4313315451145172,
-0.2135792076587677,
-0.6130614876747131,
-0.21191644668579102,
0.43826332688331604,
0.5908737182617188,
-0.20921257138252258,
0.29158085584640503,
1.1816965341567993,
0.563241720199585,
1.0639346837997437,
-0... |
func CreateTempMP4File(name string) (*os.File, error) {
if name == "" {
return nil, fmt.Errorf("no name specified")
}
nameParts := strings.Split(name, ".")
if nameParts[len(nameParts)-1] != "mp4" {
return nil, senecaerror.NewBadStateError(fmt.Errorf("file name %q does not end in 'mp4'", name))
}
tempNameNo... | [
0.21389982104301453,
-0.7715896964073181,
0.6750668287277222,
-0.18619222939014435,
-0.32946720719337463,
-0.1612408608198166,
-0.11757797002792358,
-0.4579925537109375,
0.23704318702220917,
0.4279344379901886,
-0.15311245620250702,
-0.12253422290086746,
-1.2489954233169556,
-0.11439967900... |
func CreateLocalMP4File(name, path string) (*os.File, error) {
mp4File, err := os.Create(fmt.Sprintf("%s/%s", path, name))
if err != nil {
return nil, fmt.Errorf("error creating local file - err: %v", err)
}
return mp4File, nil
} | [
0.9188475608825684,
-1.1712744235992432,
0.5683925747871399,
-0.16146445274353027,
-0.09406714886426926,
0.3588719367980957,
-0.2906341254711151,
-0.4724801182746887,
-0.28694698214530945,
0.3533344268798828,
-0.11017973721027374,
0.7557571530342102,
-1.0721628665924072,
-0.065470598638057... |
func (c *Client) GetDevEndpoints(ctx context.Context, params *GetDevEndpointsInput, optFns ...func(*Options)) (*GetDevEndpointsOutput, error) {
if params == nil {
params = &GetDevEndpointsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetDevEndpoints", params, optFns, addOperationGetDevEndpointsMiddle... | [
-1.0171502828598022,
1.2992589473724365,
0.5721170902252197,
1.3365503549575806,
0.7556837201118469,
-0.4746047556400299,
0.23025649785995483,
-1.0819568634033203,
0.9308942556381226,
-0.0708899199962616,
-0.49450358748435974,
1.0473778247833252,
-0.408856064081192,
-0.5418277978897095,
... |
func NewGetDevEndpointsPaginator(client GetDevEndpointsAPIClient, params *GetDevEndpointsInput, optFns ...func(*GetDevEndpointsPaginatorOptions)) *GetDevEndpointsPaginator {
if params == nil {
params = &GetDevEndpointsInput{}
}
options := GetDevEndpointsPaginatorOptions{}
if params.MaxResults != nil {
options.... | [
-1.1507209539413452,
0.3659934997558594,
0.46261242032051086,
-0.08668185025453568,
-0.3419247567653656,
-0.38232120871543884,
0.18164744973182678,
0.03010263852775097,
0.3638803958892822,
-0.20170404016971588,
0.16669400036334991,
0.05488808825612068,
0.014173654839396477,
0.6858925819396... |
func (p *GetDevEndpointsPaginator) HasMorePages() bool {
return p.firstPage || p.nextToken != nil
} | [
-0.1745651513338089,
0.011585015803575516,
0.2467840164899826,
-0.5472886562347412,
0.9404940605163574,
-0.5258544087409973,
-1.6120977401733398,
-0.4310261607170105,
0.5395458936691284,
-0.555508553981781,
-0.34890758991241455,
-1.14620840549469,
0.2373940497636795,
1.0927362442016602,
... |
func (p *GetDevEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetDevEndpointsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.opti... | [
-0.6750434041023254,
0.8665115237236023,
0.6888436079025269,
0.23904526233673096,
0.28142672777175903,
-0.22507025301456451,
0.1901286244392395,
-0.5186291337013245,
0.5677568912506104,
-0.17322467267513275,
0.7277491092681885,
0.0024557122960686684,
-0.5175794959068298,
-0.023039210587739... |
func GetAll() []UnidadMgo {
var result []UnidadMgo
s, Unidads, err := MoConexion.GetColectionMgo(MoVar.ColeccionUnidad)
if err != nil {
fmt.Println(err)
}
err = Unidads.Find(nil).All(&result)
if err != nil {
fmt.Println(err)
}
s.Close()
return result
} | [
0.23705610632896423,
-0.32632339000701904,
0.7283473610877991,
0.7340209484100342,
0.8943244814872742,
0.5555668473243713,
0.07456879317760468,
0.30084022879600525,
0.09759756177663803,
0.0811813622713089,
0.2738747298717499,
1.2417070865631104,
-0.36698219180107117,
0.689094603061676,
0... |
func GetSubByField(sub string, field string, valor interface{}) UnidadMgo {
var result UnidadMgo
s, Unidads, err := MoConexion.GetColectionMgo(MoVar.ColeccionUnidad)
if err != nil {
fmt.Println(err)
}
err = Unidads.Find(nil).Select(bson.M{sub: bson.M{"$elemMatch": bson.M{field: valor}}}).One(&result)
if err !... | [
0.0004938627243973315,
0.6229256987571716,
0.718087911605835,
0.5750778317451477,
-0.43606850504875183,
0.5598722100257874,
0.6906179785728455,
0.13520653545856476,
-0.907103419303894,
0.1040939912199974,
-0.2989310324192047,
0.6777696013450623,
-0.9608491063117981,
-0.3704769015312195,
... |
func GetEspecificByFields(field string, valor interface{}) DataUnidadMgo {
var result DataUnidadMgo
s, Unidades, err := MoConexion.GetColectionMgo(MoVar.ColeccionUnidad)
if err != nil {
fmt.Println(err)
}
err = Unidades.Find(bson.M{field: valor}).One(&result)
if err != nil {
fmt.Println(err)
}
s.Close()
r... | [
-0.49579450488090515,
1.2088631391525269,
0.5330049395561218,
-0.0005068296450190246,
0.68362957239151,
0.12144070118665695,
0.29736363887786865,
0.31202223896980286,
-0.35452818870544434,
0.1589144915342331,
-0.9572468400001526,
1.0130107402801514,
-0.43224695324897766,
0.2805261909961700... |
func GetSubEspecificByFields(field string, valor interface{}) DataUnidadMgo {
var result UnidadMgo
s, Unidades, err := MoConexion.GetColectionMgo(MoVar.ColeccionUnidad)
if err != nil {
fmt.Println(err)
}
err = Unidades.Find(bson.M{field: valor}).Select(bson.M{"Datos.$": 1, "_id": 0}).One(&result)
if err != nil ... | [
-0.42436522245407104,
1.2008212804794312,
0.615785539150238,
0.1915343999862671,
0.0945032387971878,
0.11082909256219864,
0.14156362414360046,
0.6273033618927002,
-0.37348058819770813,
0.07911671698093414,
-0.8929624557495117,
1.120728611946106,
-0.4631720781326294,
-0.06496276706457138,
... |
func CargaComboMagnitudes(Magnitudes CatalogoModel.CatalogoMgo, ID string) string {
templ := ``
if ID != "" {
templ = `<option value="">--SELECCIONE--</option>`
} else {
templ = `<option value="" selected>--SELECCIONE--</option>`
}
for _, v := range Magnitudes.Valores {
if ID == v.ID.Hex() {
templ += `<... | [
-0.685788094997406,
-0.26352766156196594,
0.38979372382164,
-0.896240234375,
0.09064776450395584,
0.1324196308851242,
-1.5097647905349731,
0.6975858211517334,
-0.23474149405956268,
0.8717981576919556,
0.1536923050880432,
-0.011937406845390797,
0.1725839227437973,
0.6219127178192139,
0.06... |
func CargaComboUnidades(ID string) string {
Unidades := GetAll()
templ := ``
if ID != "" {
templ = `<option value="">--SELECCIONE--</option>`
} else {
templ = `<option value="" selected>--SELECCIONE--</option>`
}
for _, v := range Unidades {
if ID == v.ID.Hex() {
templ += `<option value="` + v.ID.Hex(... | [
-0.6080079674720764,
0.3025561571121216,
0.557527482509613,
-0.3776685893535614,
-0.16867870092391968,
-0.3559217154979706,
-0.7641334533691406,
0.8298286199569702,
0.6825776696205139,
0.668024480342865,
0.3776716887950897,
-0.13184459507465363,
0.3231457769870758,
0.6073145270347595,
0.... |
func GetNameMagnitud(ID string) string {
Magnitudes := CatalogoModel.GetEspecificByFields("Clave", int64(166))
for _, v := range Magnitudes.Valores {
if ID == v.ID.Hex() {
return v.Valor
}
}
return ""
} | [
-0.6361198425292969,
-0.12315154820680618,
0.7027583122253418,
-0.5027793645858765,
-0.8328421115875244,
0.2720482647418976,
-1.5547620058059692,
-0.5387190580368042,
-0.4587966799736023,
0.7802739143371582,
-0.33238357305526733,
0.8556858897209167,
0.2603442668914795,
0.4540688097476959,
... |
func RegresaNombreUnidad(IDUnidad bson.ObjectId) string {
var result UnidadMgo
s, Unidads, err := MoConexion.GetColectionMgo(MoVar.ColeccionUnidad)
if err != nil {
fmt.Println(err)
}
err = Unidads.Find(bson.M{"Datos._id": IDUnidad}).One(&result)
valores := result.Datos
for _, value := range valores {
if IDU... | [
-0.956641674041748,
0.009590715169906616,
0.7082459330558777,
-0.6648492813110352,
0.025055186823010445,
-0.3557182550430298,
-0.2089441567659378,
-0.7943704128265381,
0.34680330753326416,
-0.3164980709552765,
0.748418390750885,
1.1442201137542725,
-1.0604667663574219,
-0.4136658310890198,... |
func BuscarEnElastic(texto string) *elastic.SearchResult {
textoTilde, textoQuotes := MoGeneral.ConstruirCadenas(texto)
queryTilde := elastic.NewQueryStringQuery(textoTilde)
queryQuotes := elastic.NewQueryStringQuery(textoQuotes)
var docs *elastic.SearchResult
var err bool
docs, err = MoConexion.BuscaElastic(M... | [
0.03335407376289368,
-0.18919745087623596,
0.7498048543930054,
-0.8483449220657349,
-0.1116916686296463,
-0.19532980024814606,
-1.0384745597839355,
-0.7904493808746338,
-0.3292069137096405,
0.5398727655410767,
1.176121711730957,
0.3994162380695343,
-0.3283522129058838,
-0.35443004965782166... |
func ToUnix(e *errors.Error) unix.Errno {
var unixErr unix.Errno
if e != noError {
unixErr = unix.Errno(e.Errno())
}
return unixErr
} | [
-0.8738476634025574,
-0.6346275806427002,
0.3815397620201111,
-0.23793885111808777,
0.09470740705728531,
-0.006638564635068178,
-0.33772599697113037,
1.2698067426681519,
1.1909494400024414,
-0.059482283890247345,
-0.750873863697052,
0.7153715491294861,
0.534863293170929,
-0.365709930658340... |
func Equals(e *errors.Error, err error) bool {
var unixErr unix.Errno
if e != noError {
unixErr = unix.Errno(e.Errno())
}
if err == nil {
err = noError
}
return e == err || unixErr == err
} | [
-0.9354583621025085,
-0.9202063083648682,
0.30586421489715576,
-0.1360252946615219,
-0.051060039550065994,
-0.3701035678386688,
-1.5595054626464844,
0.5227019190788269,
1.1414324045181274,
-0.5816588997840881,
-0.25797057151794434,
0.894463062286377,
0.4160803258419037,
0.4962802827358246,... |
func NewFileHashStore(name string, tree_size uint32) (HashStore, error) {
f, err := os.OpenFile(name, os.O_RDWR|os.O_CREATE, 0755)
if err != nil {
return nil, err
}
store := &fileHashStore{
file_name: name,
file: f,
}
err = store.checkConsistence(tree_size)
if err != nil {
return nil, err
}
num_... | [
0.764790415763855,
-0.48778101801872253,
0.414368599653244,
0.024673016741871834,
-0.9612434506416321,
0.28898853063583374,
-0.2186870276927948,
-0.13912592828273773,
-0.5143035054206848,
-0.6040524840354919,
0.11477673798799515,
-0.7700138092041016,
-0.01972396858036518,
-0.18339526653289... |
func NewMemHashStore() HashStore {
return &memHashStore{}
} | [
1.5841329097747803,
-1.2372432947158813,
-0.022618209943175316,
0.6115913391113281,
-1.9511840343475342,
0.18608105182647705,
-0.9855057597160339,
-0.7118138074874878,
0.24294857680797577,
-1.0354846715927124,
-0.4919453561306,
-0.7168329954147339,
-0.9788990020751953,
0.07465686649084091,... |
func (p *Pair) String() string {
return fmt.Sprintf("%s: %s", p.Key, p.Value)
} | [
-0.7282381057739258,
-0.8216559290885925,
0.4372398853302002,
-0.9903084635734558,
-1.2185004949569702,
1.2671300172805786,
-0.0573996976017952,
0.03170113265514374,
-1.1286906003952026,
0.41800668835639954,
0.3690411448478699,
0.4255571961402893,
-0.3967595100402832,
-0.5134517550468445,
... |
func (p *Pair) setFormatString(formatStr string) {
components := strings.Split(formatStr, ",")
for i, c := range components {
components[i] = strings.TrimSpace(c)
}
p.Format = components
} | [
-0.670480489730835,
-0.8087300658226013,
0.3266493082046509,
-0.6366373896598816,
-0.3042057752609253,
0.03021940588951111,
-0.5809939503669739,
0.160628542304039,
0.33016204833984375,
0.026492537930607796,
0.454253613948822,
0.15433156490325928,
-0.14731422066688538,
0.22879481315612793,
... |
func (p *Pair) FormatHas(fkey string) bool {
if fkey == "" {
return false
}
for _, formatKey := range p.Format {
if formatKey == fkey {
return true
}
}
return false
} | [
-0.5000369548797607,
-0.0749879777431488,
0.5578895807266235,
0.3699328899383545,
-0.5099602937698364,
-0.3664880692958832,
-0.9044021368026733,
-0.3041134774684906,
0.042215485125780106,
0.26243579387664795,
0.962290346622467,
-0.05706636235117912,
-0.4842270314693451,
1.4123735427856445,... |
func (p *Pair) IsValid() bool {
return p.KeyIsValid() && p.ValueIsValid()
} | [
-0.8985519409179688,
-0.45382967591285706,
0.5613676905632019,
0.1674956977367401,
-0.9845789074897766,
0.8542456030845642,
-0.6784434914588928,
0.8398174047470093,
0.09292665123939514,
-0.11606185138225555,
0.4837587773799896,
0.15793877840042114,
-0.6724023818969727,
0.14468201994895935,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.