text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (s *StandardProcess) cycle(mirror *ResourceMirror, skillFactor float64, fragment float64) {
/*
* The cost is ameliorated by the square root of the skill.
*/
costFactor := 1.0 / math.Sqrt(skillFactor)
/*
* How much does lack of resources hinder production?
*/
resourceFactor := s.consume(mirror, costFact... | [
-0.1940539926290512,
0.1623893529176712,
0.4519653916358948,
-0.2322603017091751,
-0.14330995082855225,
-0.2213764488697052,
0.6873554587364197,
-0.46237942576408386,
-0.39957648515701294,
0.18218372762203217,
0.48191171884536743,
0.7865284085273743,
0.2327098399400711,
-0.3167066276073456... |
func (l *Lock) Complete() {
l.Timestamp = getTime()
l.RequestID = ""
l.Retries = 0
l.Sequence = -1
} | [
-0.36332133412361145,
-0.4625602960586548,
0.23906050622463226,
0.11178041994571686,
0.3404580354690552,
0.15704920887947083,
-0.27687233686447144,
-0.2873350977897644,
0.24663881957530975,
1.0333898067474365,
-0.5945217609405518,
0.6411752700805664,
-0.2180461585521698,
0.2099722325801849... |
func (t *TestCluster) Run(name string, f func(c TestCluster)) bool {
if t.FailFast && t.hasFailure {
return t.H.Run(name, func(h *harness.H) {
func(c TestCluster) {
c.Skip("A previous test has already failed")
}(TestCluster{H: h, Cluster: t.Cluster})
})
}
t.hasFailure = !t.H.Run(name, func(h *harness.H... | [
-0.011446316726505756,
0.13025888800621033,
0.42840254306793213,
0.34089866280555725,
0.1931362897157669,
-0.26936665177345276,
0.2635399401187897,
-0.11197835206985474,
-0.8487501740455627,
-0.48209092020988464,
-0.2998162508010864,
-0.11417155712842941,
-0.45455819368362427,
0.2262772321... |
func (t *TestCluster) RunLogged(name string, f func(c TestCluster)) bool {
for _, m := range t.Machines() {
t.JournalLog(m, "=== RUN: %s/%s ===", t.H.Name(), name)
defer t.JournalLog(m, "=== DONE: %s/%s ===", t.H.Name(), name)
}
return t.Run(name, f)
} | [
-0.4427957832813263,
0.010679776780307293,
0.6224542260169983,
-0.5579473972320557,
-0.09237979352474213,
0.27573615312576294,
0.4875468909740448,
-0.13704994320869446,
-1.282962679862976,
-0.0630354955792427,
-0.7997020483016968,
0.34829533100128174,
0.32631397247314453,
0.216004148125648... |
func (t *TestCluster) RunNative(funcName string, m platform.Machine) bool {
command := fmt.Sprintf("./kolet run %q %q", t.H.Name(), funcName)
return t.Run(funcName, func(c TestCluster) {
client, err := m.SSHClient()
if err != nil {
c.Fatalf("kolet SSH client: %v", err)
}
defer client.Close()
session, er... | [
-0.19767878949642181,
-0.34933850169181824,
0.8314609527587891,
-0.2525072395801544,
-0.3790699541568756,
0.04407826066017151,
-0.3905543386936188,
-1.3129714727401733,
-1.21898353099823,
0.4477814733982086,
-0.09714383631944656,
0.2823564112186432,
-0.6666722893714905,
-0.0986072942614555... |
func (t *TestCluster) ListNativeFunctions() []string {
return t.NativeFuncs
} | [
0.09466472268104553,
-1.0576204061508179,
0.29345327615737915,
0.18625028431415558,
-0.012822344899177551,
-0.42499202489852905,
-0.7551882863044739,
-0.2121124267578125,
0.11322809755802155,
-0.025580670684576035,
-1.4541457891464233,
0.3671329617500305,
-1.0185438394546509,
-0.2693302035... |
func DropLabeledFile(machines []platform.Machine, localPath, selabel string) error {
in, err := os.Open(localPath)
if err != nil {
return err
}
defer in.Close()
for _, m := range machines {
if _, err := in.Seek(0, 0); err != nil {
return err
}
// write to a separate path first, then rename to its final... | [
0.017013562843203545,
-0.8988317251205444,
0.8237195611000061,
-0.32978180050849915,
0.4630551338195801,
0.9108494520187378,
0.32575371861457825,
0.2169400006532669,
-0.765177309513092,
1.0983598232269287,
0.2702130377292633,
-0.3609675467014313,
-0.5091211795806885,
0.18227246403694153,
... |
func DropFile(machines []platform.Machine, localPath string) error {
return DropLabeledFile(machines, localPath, "")
} | [
0.048166628926992416,
-0.019026586785912514,
0.08830458670854568,
0.3108549416065216,
0.25083792209625244,
1.7449190616607666,
0.006129376590251923,
0.47127777338027954,
-1.4716227054595947,
0.3883272409439087,
0.46666863560676575,
-0.38844743371009827,
-0.3760981261730194,
0.3341273069381... |
func (t *TestCluster) SSH(m platform.Machine, cmd string) ([]byte, error) {
var stdout, stderr []byte
var err error
f := func() {
stdout, stderr, err = m.SSH(cmd)
}
errMsg := fmt.Sprintf("ssh: %s", cmd)
// If f does not before the test timeout, the RunWithExecTimeoutCheck
// will end this goroutine and mark t... | [
0.7667292952537537,
-0.2275882065296173,
0.6049220561981201,
0.4324919283390045,
-0.6599506139755249,
0.30571410059928894,
-0.35251855850219727,
-0.10692882537841797,
-0.3237447738647461,
-0.03384612128138542,
0.7757793664932251,
1.0357294082641602,
-0.7025026679039001,
0.2889012098312378,... |
func (t *TestCluster) MustSSH(m platform.Machine, cmd string) []byte {
out, err := t.SSH(m, cmd)
if err != nil {
if t.SSHOnTestFailure() {
plog.Errorf("dropping to shell: %q failed: output %s, status %v", cmd, out, err)
if err := platform.Manhole(m); err != nil {
plog.Error(err)
}
}
t.Fatalf("%q fa... | [
-0.38374072313308716,
-0.5422918200492859,
0.6171839237213135,
0.5947404503822327,
-0.49132224917411804,
0.6919695734977722,
-0.7637192606925964,
-1.0315262079238892,
-0.27224063873291016,
0.4183588922023773,
0.0539252832531929,
0.2494126856327057,
-0.25439026951789856,
0.7391667366027832,... |
func (t *TestCluster) RunCmdSync(m platform.Machine, cmd string) {
t.LogJournal(m, "+ "+cmd)
// Pipe stdout/stderr into the systemd journal
_, err := t.SSH(m, "set -o pipefail; "+cmd+" |& logger -t kola")
if err != nil {
if t.SSHOnTestFailure() {
plog.Errorf("dropping to shell: %q failed: %v", cmd, err)
if ... | [
0.4607512950897217,
-0.07821731269359589,
0.8856164216995239,
-0.28957393765449524,
-0.3994144797325134,
-0.3799406588077545,
-0.03012187033891678,
-0.26135045289993286,
-0.3455794155597687,
-0.4919455945491791,
0.2969452142715454,
1.0220298767089844,
0.3501026928424835,
0.4757653176784515... |
func (t *TestCluster) RunCmdSyncf(m platform.Machine, f string, args ...interface{}) {
t.RunCmdSync(m, fmt.Sprintf(f, args...))
} | [
0.526053249835968,
0.4054315686225891,
0.16427552700042725,
0.14071445167064667,
0.07645275443792343,
-0.4510253369808197,
0.6857572197914124,
0.028656288981437683,
-1.8421176671981812,
-0.23178976774215698,
0.1758052259683609,
0.42518851161003113,
0.43715864419937134,
0.1583738625049591,
... |
func (t *TestCluster) AssertCmdOutputContains(m platform.Machine, cmd string, expected string) {
t.LogJournal(m, "+ "+cmd)
outputBuf := t.MustSSH(m, cmd)
output := string(outputBuf)
if !strings.Contains(output, expected) {
t.Fatalf("cmd %s did not output %s", cmd, expected)
}
} | [
1.3668748140335083,
-0.4867877662181854,
0.3965332508087158,
0.10128968209028244,
-0.8371011018753052,
0.37034985423088074,
-0.09568866342306137,
-0.25271910429000854,
-0.5328661203384399,
-0.5461351871490479,
0.7943511009216309,
0.27921539545059204,
-0.5657498240470886,
0.6118394136428833... |
func (t *TestCluster) AssertCmdOutputMatches(m platform.Machine, cmd string, expected *regexp.Regexp) {
t.LogJournal(m, "+ "+cmd)
output := t.MustSSH(m, cmd)
if !expected.Match(output) {
t.Fatalf("cmd %s output did not match regexp %s: %s", cmd, expected, string(output))
}
} | [
0.8217169642448425,
-0.5198859572410583,
0.4555681347846985,
0.08438844233751297,
-0.4580152928829193,
0.5527355670928955,
0.25351595878601074,
0.19375137984752655,
-0.29711809754371643,
-0.4883037507534027,
0.6568213701248169,
-0.06262319535017014,
-0.6567691564559937,
0.24606339633464813... |
func (t *TestCluster) LogJournal(m platform.Machine, msg string) {
t.MustSSH(m, fmt.Sprintf("logger -t kola %s", shellquote.Join(msg)))
} | [
0.6665080785751343,
-0.1270567774772644,
0.3606352210044861,
0.09487603604793549,
0.1376667469739914,
0.3673608601093292,
0.1529283970594406,
0.7400625944137573,
-0.6328439712524414,
-0.1622052788734436,
0.03877738490700722,
0.8792160749435425,
-0.9700334072113037,
1.0451921224594116,
0.... |
func (t *Treat) Description() {
fmt.Printf("Hi, i'm a size %d Pork Treat\n", t.size)
} | [
1.0096806287765503,
0.1622769683599472,
0.48871251940727234,
-0.8657179474830627,
0.21956120431423187,
-0.04252348840236664,
-0.30720168352127075,
0.3747129738330841,
-0.20448307693004608,
-0.21762336790561676,
-0.39744919538497925,
1.0181363821029663,
-0.0739751085639,
0.19619765877723694... |
func (e *DriedEar) Description() {
fmt.Printf("Hi, i'm a size %d Pork Ear\n", e.size)
} | [
0.0805162712931633,
0.5470041036605835,
0.45798972249031067,
-0.7739686369895935,
0.05636361241340637,
0.726453959941864,
-0.04006636142730713,
0.2165171355009079,
0.5083907842636108,
0.2775706946849823,
-0.0571061410009861,
1.2422585487365723,
0.48465538024902344,
0.31036195158958435,
0... |
func (c *Connector) Connect(
r *gohttp.Request,
credentialsByID connector.CredentialValuesByID,
) error {
// TODO: add logic according to
// https://github.com/cyberark/secretless-broker/blob/master/pkg/secretless/plugin/connector/README.md#http-connector
var err error
return err
} | [
-0.7479283213615417,
-0.4948287904262543,
0.4805191457271576,
0.6146950125694275,
0.1563299149274826,
0.12446361780166626,
-0.3883081376552582,
-0.1409561038017273,
-0.9214360117912292,
-0.14846587181091309,
-0.07795092463493347,
0.014738567173480988,
-0.22088295221328735,
1.13035702705383... |
func (atu *ActivityTypeUpdate) Where(ps ...predicate.ActivityType) *ActivityTypeUpdate {
atu.predicates = append(atu.predicates, ps...)
return atu
} | [
-0.00959254615008831,
-0.5068132281303406,
0.2124689221382141,
-0.14949475228786469,
-0.5987049341201782,
0.6340540051460266,
0.0716601237654686,
-0.08417937904596329,
-0.13000555336475372,
-0.06571455299854279,
0.8738656044006348,
1.1778315305709839,
-0.6050570011138916,
-0.51429152488708... |
func (atu *ActivityTypeUpdate) SetName(s string) *ActivityTypeUpdate {
atu.mutation.SetName(s)
return atu
} | [
-1.157161831855774,
0.47543036937713623,
-0.0034324510488659143,
1.4387539625167847,
-0.5647023916244507,
-0.46086710691452026,
0.8687102198600769,
0.3715619444847107,
0.3990355134010315,
0.546230673789978,
-0.7287995219230652,
-0.4655011296272278,
0.02240297570824623,
-0.13144566118717194... |
func (atu *ActivityTypeUpdate) AddActivityIDs(ids ...int) *ActivityTypeUpdate {
atu.mutation.AddActivityIDs(ids...)
return atu
} | [
-1.2889078855514526,
-0.1663045585155487,
0.18404574692249298,
1.0558277368545532,
0.01668827049434185,
-0.08610815554857254,
0.25521984696388245,
0.1362096667289734,
0.8198993802070618,
0.512039303779602,
-0.027460068464279175,
0.05970127508044243,
-0.9116709232330322,
-0.1231738701462745... |
func (atu *ActivityTypeUpdate) AddActivities(a ...*Activities) *ActivityTypeUpdate {
ids := make([]int, len(a))
for i := range a {
ids[i] = a[i].ID
}
return atu.AddActivityIDs(ids...)
} | [
-1.0603798627853394,
0.2919367849826813,
0.2256399244070053,
0.9299241304397583,
0.5942139029502869,
0.01123356819152832,
0.8432930111885071,
-0.1697121113538742,
0.9596359133720398,
-0.4756823480129242,
1.0328458547592163,
-0.21299660205841064,
-1.103846549987793,
0.4086824953556061,
-0... |
func (atu *ActivityTypeUpdate) Mutation() *ActivityTypeMutation {
return atu.mutation
} | [
-0.8249648213386536,
-0.4587784707546234,
0.022475354373455048,
0.5370654463768005,
-0.059695981442928314,
0.2828700542449951,
0.8199282288551331,
-0.06922820955514908,
1.262154221534729,
0.3417796790599823,
0.41976919770240784,
0.12624704837799072,
-0.5544806718826294,
-0.5828467607498169... |
func (atu *ActivityTypeUpdate) RemoveActivityIDs(ids ...int) *ActivityTypeUpdate {
atu.mutation.RemoveActivityIDs(ids...)
return atu
} | [
-1.273404836654663,
-0.6892102360725403,
0.12338736653327942,
0.8637571930885315,
-0.7234838008880615,
-0.44530194997787476,
0.7704252600669861,
0.5458115935325623,
0.6889687180519104,
0.9231051802635193,
-0.5530257821083069,
0.10626824200153351,
-1.4194694757461548,
-0.5197177529335022,
... |
func (atu *ActivityTypeUpdate) RemoveActivities(a ...*Activities) *ActivityTypeUpdate {
ids := make([]int, len(a))
for i := range a {
ids[i] = a[i].ID
}
return atu.RemoveActivityIDs(ids...)
} | [
-1.0187835693359375,
-0.09167362004518509,
0.3092503249645233,
0.9772691130638123,
-0.16011950373649597,
-0.4882889688014984,
1.4871991872787476,
0.2906377911567688,
0.7798142433166504,
-0.08556655794382095,
0.3558495342731476,
-0.2709677815437317,
-1.5304415225982666,
0.09827547520399094,... |
func (atu *ActivityTypeUpdate) Save(ctx context.Context) (int, error) {
if v, ok := atu.mutation.Name(); ok {
if err := activitytype.NameValidator(v); err != nil {
return 0, &ValidationError{Name: "name", err: fmt.Errorf("ent: validator failed for field \"name\": %w", err)}
}
}
var (
err error
affec... | [
-1.1671645641326904,
0.3964657783508301,
0.7932469844818115,
0.0059510995633900166,
0.0018142093904316425,
-0.9368504285812378,
1.0155973434448242,
-0.590890645980835,
-0.45082804560661316,
0.9987255930900574,
-0.3485579490661621,
-0.2086256891489029,
-0.7792776226997375,
-0.10372538864612... |
func (atu *ActivityTypeUpdate) SaveX(ctx context.Context) int {
affected, err := atu.Save(ctx)
if err != nil {
panic(err)
}
return affected
} | [
-1.1648588180541992,
1.2109200954437256,
0.5369338393211365,
0.4564073085784912,
-0.5383530259132385,
0.4621672034263611,
-0.12796276807785034,
0.44714999198913574,
1.0045095682144165,
0.5009114146232605,
-0.9852311015129089,
-0.037666141986846924,
-0.8721739053726196,
-0.3620903491973877,... |
func (atu *ActivityTypeUpdate) Exec(ctx context.Context) error {
_, err := atu.Save(ctx)
return err
} | [
-0.4822453558444977,
0.21439151465892792,
0.549322783946991,
0.5531278848648071,
0.252204567193985,
0.7977890372276306,
0.12341585010290146,
-0.10632356256246567,
0.26773592829704285,
0.8665321469306946,
-0.049976952373981476,
0.25147685408592224,
-0.4919421672821045,
-0.7218316197395325,
... |
func (atu *ActivityTypeUpdate) ExecX(ctx context.Context) {
if err := atu.Exec(ctx); err != nil {
panic(err)
}
} | [
-0.032910242676734924,
0.6705488562583923,
0.5520272254943848,
0.5978395342826843,
-0.11862906813621521,
0.883017897605896,
-0.2960512340068817,
-0.06112079322338104,
0.6065513491630554,
0.43365737795829773,
0.3338393568992615,
1.0178170204162598,
-0.055137693881988525,
-0.4426899552345276... |
func (atuo *ActivityTypeUpdateOne) SetName(s string) *ActivityTypeUpdateOne {
atuo.mutation.SetName(s)
return atuo
} | [
-1.2194113731384277,
0.4437347948551178,
0.003627118421718478,
1.5996289253234863,
-0.5357986092567444,
-0.3637661635875702,
0.8608048558235168,
0.5570150017738342,
0.3086797297000885,
0.37520524859428406,
-0.6590645909309387,
-0.5723820924758911,
-0.07493608444929123,
-0.31811773777008057... |
func (atuo *ActivityTypeUpdateOne) AddActivityIDs(ids ...int) *ActivityTypeUpdateOne {
atuo.mutation.AddActivityIDs(ids...)
return atuo
} | [
-1.369243860244751,
-0.18385647237300873,
0.22344893217086792,
1.2241164445877075,
0.015897542238235474,
0.03851217404007912,
0.26927927136421204,
0.22863662242889404,
0.741291880607605,
0.5343867540359497,
-0.10316242277622223,
-0.1340457648038864,
-1.0025182962417603,
-0.0976405739784240... |
func (atuo *ActivityTypeUpdateOne) AddActivities(a ...*Activities) *ActivityTypeUpdateOne {
ids := make([]int, len(a))
for i := range a {
ids[i] = a[i].ID
}
return atuo.AddActivityIDs(ids...)
} | [
-1.1658265590667725,
0.2773365378379822,
0.29463180899620056,
1.018170714378357,
0.6343085765838623,
0.04647042229771614,
0.929835855960846,
-0.2297976166009903,
0.9378775954246521,
-0.485241562128067,
1.0007013082504272,
-0.31296002864837646,
-1.0704575777053833,
0.4317147135734558,
-0.... |
func (atuo *ActivityTypeUpdateOne) Mutation() *ActivityTypeMutation {
return atuo.mutation
} | [
-1.0326894521713257,
-0.38500136137008667,
0.08682165294885635,
0.6302214860916138,
0.24139904975891113,
0.34525591135025024,
0.9841607213020325,
0.04010024666786194,
1.3832762241363525,
0.26239725947380066,
0.29442042112350464,
-0.08309906721115112,
-0.775577962398529,
-0.5921615958213806... |
func (atuo *ActivityTypeUpdateOne) RemoveActivityIDs(ids ...int) *ActivityTypeUpdateOne {
atuo.mutation.RemoveActivityIDs(ids...)
return atuo
} | [
-1.3520593643188477,
-0.7112323641777039,
0.18426388502120972,
1.0587209463119507,
-0.736448347568512,
-0.36721959710121155,
0.80596923828125,
0.6343421339988708,
0.6278547048568726,
0.9336599111557007,
-0.6102627515792847,
-0.01890522800385952,
-1.5204282999038696,
-0.5260313153266907,
... |
func (atuo *ActivityTypeUpdateOne) RemoveActivities(a ...*Activities) *ActivityTypeUpdateOne {
ids := make([]int, len(a))
for i := range a {
ids[i] = a[i].ID
}
return atuo.RemoveActivityIDs(ids...)
} | [
-1.1402113437652588,
-0.10595337301492691,
0.3654799163341522,
1.0552239418029785,
-0.1618458330631256,
-0.49270394444465637,
1.5484741926193237,
0.28015652298927307,
0.7909902930259705,
-0.08806564658880234,
0.3271087110042572,
-0.3467428386211395,
-1.5111750364303589,
0.1245511993765831,... |
func (atuo *ActivityTypeUpdateOne) Save(ctx context.Context) (*ActivityType, error) {
if v, ok := atuo.mutation.Name(); ok {
if err := activitytype.NameValidator(v); err != nil {
return nil, &ValidationError{Name: "name", err: fmt.Errorf("ent: validator failed for field \"name\": %w", err)}
}
}
var (
err ... | [
-0.8508939743041992,
0.1498798131942749,
0.5134491920471191,
-0.10032203793525696,
0.2072218358516693,
-0.5605388283729553,
0.7377061247825623,
-0.7697561979293823,
-0.1840871125459671,
1.0549688339233398,
-0.16753844916820526,
-0.06374815106391907,
-0.7552347779273987,
-0.3849635124206543... |
func (atuo *ActivityTypeUpdateOne) SaveX(ctx context.Context) *ActivityType {
at, err := atuo.Save(ctx)
if err != nil {
panic(err)
}
return at
} | [
-1.0086301565170288,
0.7843711376190186,
0.3944728970527649,
0.580967366695404,
-0.4922679364681244,
0.7188381552696228,
-0.4063442349433899,
0.01725686900317669,
1.3725390434265137,
0.367873877286911,
-1.0088204145431519,
-0.028953734785318375,
-0.8476016521453857,
-0.5203670859336853,
... |
func (atuo *ActivityTypeUpdateOne) Exec(ctx context.Context) error {
_, err := atuo.Save(ctx)
return err
} | [
-0.5146524906158447,
0.2884994149208069,
0.6182077527046204,
0.6479219794273376,
0.5512862801551819,
0.7730066180229187,
0.2526823878288269,
-0.08829497545957565,
0.3460085093975067,
0.7405608892440796,
-0.2773628532886505,
-0.029153011739253998,
-0.6768449544906616,
-0.5540805459022522,
... |
func (atuo *ActivityTypeUpdateOne) ExecX(ctx context.Context) {
if err := atuo.Exec(ctx); err != nil {
panic(err)
}
} | [
-0.09200412034988403,
0.7370942234992981,
0.6594294309616089,
0.7883073687553406,
0.06745767593383789,
0.941909909248352,
-0.20795102417469025,
-0.055420197546482086,
0.6365851759910583,
0.37207359075546265,
0.050289303064346313,
0.8543053269386292,
-0.10387375950813293,
-0.396939486265182... |
func NewColorLogger(w io.Writer, newLogger func(io.Writer) log.Logger, color func(keyvals ...interface{}) FgBgColor) log.Logger {
if color == nil {
panic("color func nil")
}
return &colorLogger{
w: w,
newLogger: newLogger,
color: color,
bufPool: sync.Pool{New: func() interface... | [
-0.03471168875694275,
-0.29927706718444824,
0.7347452640533447,
-0.01208607666194439,
-0.934089720249176,
-1.1237248182296753,
-0.733052670955658,
-0.3419572412967682,
-0.20779763162136078,
0.044120535254478455,
-0.4242047071456909,
0.554500162601471,
-0.21630750596523285,
1.82940351963043... |
func Get() Version {
return Version{
Version: gitVersion,
Sha: gitSha,
}
} | [
0.14409756660461426,
-0.6956688761711121,
0.1271766871213913,
-0.7503171563148499,
-0.1975797563791275,
0.2828202247619629,
-0.9535506367683411,
0.5048792362213135,
-0.264938086271286,
0.21037444472312927,
-0.85184246301651,
0.7797853946685791,
-0.09023764729499817,
-0.11649640649557114,
... |
func TestLifecycleMinimalAWS(t *testing.T) {
runLifecycleTestAWS(&LifecycleTestOptions{
t: t,
SrcDir: "minimal",
})
} | [
0.5384191274642944,
0.2965594232082367,
0.24958716332912445,
-1.2670092582702637,
-0.30039238929748535,
0.7732113003730774,
0.05880289524793625,
-0.6259773969650269,
2.5807602405548096,
-1.284318447113037,
-0.26534807682037354,
0.23705439269542694,
0.5969637036323547,
0.3083512783050537,
... |
func TestLifecyclePrivateCalico(t *testing.T) {
runLifecycleTestAWS(&LifecycleTestOptions{
t: t,
SrcDir: "privatecalico",
})
} | [
0.2760687470436096,
0.561789870262146,
0.3659866750240326,
0.0475747287273407,
-0.09733381122350693,
0.7105598449707031,
0.25738438963890076,
-0.3791668117046356,
1.4680700302124023,
-1.3105714321136475,
-0.5391337871551514,
0.1452254205942154,
0.9205397367477417,
0.6601582765579224,
0.3... |
func TestLifecyclePrivateKopeio(t *testing.T) {
runLifecycleTestAWS(&LifecycleTestOptions{
t: t,
SrcDir: "privatekopeio",
Shared: []string{"nat-a2345678", "nat-b2345678"},
})
} | [
-0.4787038266658783,
0.8130030632019043,
0.4438417851924896,
0.06184591352939606,
0.31561484932899475,
0.5642150640487671,
-0.04672306403517723,
-1.0126333236694336,
0.9257787466049194,
-0.38878482580184937,
-1.0080294609069824,
0.41904744505882263,
-0.10970687866210938,
0.1744029521942138... |
func TestLifecycleIPv6(t *testing.T) {
runLifecycleTestAWS(&LifecycleTestOptions{
t: t,
SrcDir: "minimal-ipv6",
})
} | [
0.12735264003276825,
-0.30021584033966064,
0.3127639591693878,
-0.30597928166389465,
0.07135463505983353,
0.3231618404388428,
0.417763888835907,
-0.25693896412849426,
2.2891268730163574,
-0.7352343201637268,
-0.6235014200210571,
-0.14240509271621704,
0.1352824568748474,
-0.2437960058450698... |
func TestLifecycleSharedVPC(t *testing.T) {
runLifecycleTestAWS(&LifecycleTestOptions{
t: t,
SrcDir: "shared_vpc",
})
} | [
0.8949348330497742,
0.45917314291000366,
0.5370458960533142,
-0.33302003145217896,
1.0385841131210327,
1.0030198097229004,
1.1336559057235718,
-0.41455045342445374,
1.7618780136108398,
-0.11377628147602081,
-0.6736527681350708,
0.12858660519123077,
-0.6053869724273682,
0.011932756751775742... |
func TestLifecycleComplex(t *testing.T) {
runLifecycleTestAWS(&LifecycleTestOptions{
t: t,
SrcDir: "complex",
})
} | [
0.2816897928714752,
-0.2676565647125244,
0.5785070061683655,
-0.20452803373336792,
0.1382211446762085,
1.030474066734314,
0.8264920115470886,
0.22413155436515808,
1.8876162767410278,
-0.9737470149993896,
-0.800815761089325,
-0.39362525939941406,
0.3357059061527252,
0.24829921126365662,
-... |
func TestLifecycleExternalLB(t *testing.T) {
runLifecycleTestAWS(&LifecycleTestOptions{
t: t,
SrcDir: "externallb",
})
} | [
0.4327956438064575,
0.6849988102912903,
0.6247870326042175,
0.057071588933467865,
0.10201199352741241,
1.0069971084594727,
-0.3782190680503845,
0.2686992585659027,
1.5878942012786865,
-0.404529869556427,
-0.38515084981918335,
0.17307797074317932,
-0.3425666093826294,
0.797236979007721,
-... |
func TestLifecycleSharedSubnet(t *testing.T) {
runLifecycleTestAWS(&LifecycleTestOptions{
t: t,
SrcDir: "shared_subnet",
Shared: []string{"subnet-12345678"},
})
} | [
1.0052083730697632,
0.9694274663925171,
0.6008106470108032,
0.23087114095687866,
0.7234009504318237,
1.1356114149093628,
0.6206206679344177,
-0.21113286912441254,
1.4535925388336182,
-0.8955370783805847,
-0.5465056300163269,
0.22867022454738617,
-0.059650056064128876,
0.483466774225235,
... |
func TestLifecyclePrivateSharedSubnet(t *testing.T) {
runLifecycleTestAWS(&LifecycleTestOptions{
t: t,
SrcDir: "private-shared-subnet",
Shared: []string{"subnet-12345678", "subnet-abcdef"},
})
} | [
0.27674010396003723,
1.0360658168792725,
0.5458477735519409,
0.298827588558197,
0.7534503936767578,
1.0567148923873901,
0.05620037019252777,
-0.6147252917289734,
1.667955994606018,
-1.0204757452011108,
-0.8003302812576294,
0.5375902056694031,
-0.07795494049787521,
0.6774475574493408,
-0.... |
func TestLifecyclePrivateSharedIP(t *testing.T) {
runLifecycleTestAWS(&LifecycleTestOptions{
t: t,
SrcDir: "private-shared-ip",
Shared: []string{"eipalloc-12345678"},
})
} | [
-0.23059140145778656,
0.7811354398727417,
0.4648321270942688,
-0.14233465492725372,
0.33570927381515503,
0.6759322881698608,
0.5634537935256958,
-0.026636144146323204,
2.1563949584960938,
-0.3090110719203949,
-0.6654500961303711,
-0.5500298142433167,
0.2627204656600952,
0.2620142102241516,... |
func TestLifecycleManyAddons(t *testing.T) {
runLifecycleTestAWS(&LifecycleTestOptions{
t: t,
SrcDir: "many-addons",
ClusterName: "minimal.example.com",
})
} | [
0.239885613322258,
0.42279812693595886,
0.5242372751235962,
-0.1893259435892105,
0.01463828980922699,
0.9544322490692139,
-0.5170302391052246,
-0.32443222403526306,
1.7753046751022339,
-0.3281167447566986,
-0.926543653011322,
0.306238055229187,
0.15379764139652252,
0.5139219164848328,
-0... |
func AllAWSResources(c *awsup.MockAWSCloud) map[string]interface{} {
all := make(map[string]interface{})
for k, v := range c.MockEC2.(*mockec2.MockEC2).All() {
all[k] = v
}
return all
} | [
-0.05727197229862213,
-0.22419913113117218,
0.3317350149154663,
-0.32049888372421265,
-1.1544867753982544,
-0.02486175112426281,
-0.34884944558143616,
-0.36714598536491394,
0.46964532136917114,
-0.2703034579753876,
-0.08516451716423035,
-0.10601529479026794,
0.9975591897964478,
1.330099582... |
func AllOpenstackResources(c *openstack.MockCloud) map[string]interface{} {
all := make(map[string]interface{})
for k, v := range c.MockNovaClient.All() {
all[k] = v
}
return all
} | [
-0.341814249753952,
-0.2540555000305176,
0.4695599377155304,
-0.05700322985649109,
-0.41130080819129944,
-0.1792304515838623,
-0.1251128911972046,
-0.2282559871673584,
-0.6283107399940491,
-0.2645731270313263,
-0.2363261878490448,
-0.40121686458587646,
0.16413885354995728,
1.38928639888763... |
func AllGCEResources(c *gcemock.MockGCECloud) map[string]interface{} {
all := make(map[string]interface{})
for k, v := range c.AllResources() {
all[k] = v
}
return all
} | [
-0.11156343668699265,
-0.41104525327682495,
0.4356275498867035,
-0.15817619860172272,
0.06342024356126785,
0.09387225657701492,
-0.2700191140174866,
0.0990348532795906,
-0.1493443250656128,
-0.3383609652519226,
-0.14301185309886932,
-0.6733242869377136,
-0.36463528871536255,
1.009663701057... |
func loadOverrides(filepath string) ([][]string, error) {
f, err := os.Open(filepath)
if os.IsNotExist(err) {
return nil, nil
} else if err != nil {
return nil, err
}
overrides := make([][]string, 0)
overrides = append(overrides, make([]string, 0))
scanner := bufio.NewScanner(f)
for scanner.Scan() {
line ... | [
-0.3467731177806854,
0.223842591047287,
0.8791046738624573,
-0.6630605459213257,
-0.009692215360701084,
-0.24300901591777802,
-0.09010887145996094,
-0.42316147685050964,
-0.48173683881759644,
0.261668860912323,
-0.4258408844470978,
0.12103617191314697,
-0.8720488548278809,
0.73096030950546... |
func (inj *Injector) Run() {
inj.startTime = time.Now()
//go inj.Stat.DoRun()
for shootAgain := bool(true); shootAgain == true; {
shootAgain = inj.UpdateSpeed()
time.Sleep(time.Millisecond * 1000)
}
fmt.Printf("*** Test done ***\n")
} | [
-0.30313634872436523,
0.03079947456717491,
0.6030299663543701,
0.37635478377342224,
0.43942171335220337,
0.4969503581523895,
0.76659095287323,
-0.03870218247175217,
-0.47975531220436096,
0.5952032804489136,
-0.868772029876709,
0.6539617776870728,
-1.340598702430725,
0.8047721982002258,
-... |
func (inj *Injector) UpdateSpeed() bool {
sumVusers := int64(0)
cSec := (int64)(time.Now().Sub(inj.startTime) / time.Second) //#sec after start of the test
if cSec > inj.rampDuration {
//fmt.Printf("Run lasted: %d and rampDuration %d \n", cSec, inj.rampDuration)
return false
}
for v := 0; v < len(inj.ramp); v... | [
0.07124491035938263,
-0.13128559291362762,
0.7778192162513733,
1.371194839477539,
-0.32241734862327576,
-0.03235887736082077,
1.0575156211853027,
0.5928342938423157,
0.05892927572131157,
0.6219757795333862,
-0.053139179944992065,
-0.15333129465579987,
-0.7299022674560547,
0.823731541633606... |
func functionReturningBasicError(arg int) (int, error) {
if arg == 42 {
return -1, errors.New("cant' work with 42")
}
return arg + 3, nil
} | [
-0.2524421215057373,
0.20435772836208344,
0.3611867129802704,
0.09138434380292892,
-0.44186142086982727,
0.5663498044013977,
-0.09787189215421677,
-0.2074964940547943,
-0.12613050639629364,
-0.10636398941278458,
-0.43157991766929626,
0.33624258637428284,
-0.5272265672683716,
-0.45227944850... |
func scanNumberPrefix(l *Scanner) stateFn {
accept(l, isSpace, -1)
l.accept("+-")
return scanNumber
} | [
-0.5169228911399841,
0.07394322007894516,
0.4340689480304718,
0.38056525588035583,
-1.513140320777893,
0.1571434885263443,
0.29353636503219604,
0.6502572894096375,
1.4636611938476562,
-1.0027012825012207,
-0.374702125787735,
0.35341206192970276,
0.41320180892944336,
0.6176774501800537,
0... |
func (*Span_TimeEvent) 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 _Span_TimeEvent_OneofMarshaler, _Span_TimeEvent_OneofUnmarshaler, _Span_TimeEvent_OneofSizer, []interf... | [
-0.05314479395747185,
0.6015118360519409,
0.5318719744682312,
-0.4333431124687195,
0.13314670324325562,
-0.36432531476020813,
0.4370078444480896,
-0.975394606590271,
0.6539427042007446,
-0.4496842324733734,
-0.6549045443534851,
-0.3171658217906952,
-0.1588420271873474,
0.9345813393592834,
... |
func (*AttributeValue) 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 _AttributeValue_OneofMarshaler, _AttributeValue_OneofUnmarshaler, _AttributeValue_OneofSizer, []interf... | [
-0.26378050446510315,
0.536598801612854,
0.498727947473526,
-0.6912150979042053,
-0.10224328190088272,
-0.8530645966529846,
0.7379047274589539,
-0.8442578315734863,
0.009743950329720974,
-0.7465730309486389,
-0.17893026769161224,
0.537348747253418,
0.8106347918510437,
1.1756203174591064,
... |
func WithLogger(logger *log.Logger) Option {
return func(cfg *Config) {
cfg.Logger = logger
}
} | [
0.06788533926010132,
0.23984739184379578,
0.4538465440273285,
-0.14593927562236786,
-0.3267878293991089,
-0.42363256216049194,
0.281256765127182,
0.07630348205566406,
0.5587499141693115,
-0.4494102895259857,
-0.21052676439285278,
-0.6302437782287598,
0.45285356044769287,
0.9435744285583496... |
func New(options ...Option) *Server {
cfg := &Config{
Logger: log.New(os.Stdout, "", log.Ldate|log.Ltime),
}
for _, option := range options {
option(cfg)
}
return &Server{cfg: cfg}
} | [
-0.8277602791786194,
-0.4990217387676239,
0.5882129669189453,
-0.006817204412072897,
-0.3226495683193207,
0.19212983548641205,
-0.36212092638015747,
-0.4738096594810486,
-0.41387036442756653,
-0.00786961242556572,
-0.4057074189186096,
0.8472581505775452,
-0.20232659578323364,
0.95795220136... |
func (s *Server) Serve(port int) error {
strport := strconv.Itoa(port)
listener, err := net.Listen("tcp", ":"+strport)
if err != nil {
log.Fatalf("failed to listen: %v", err)
}
grpcServer := grpc.NewServer()
s.server = grpcServer
grpc_health_v1.RegisterHealthServer(grpcServer, s)
pb.RegisterMirrorServer(grpc... | [
-0.4045153558254242,
-0.2234114706516266,
0.44764283299446106,
-1.0421959161758423,
0.6065015196800232,
0.44890567660331726,
0.28812509775161743,
-0.07510416954755783,
-0.4519447684288025,
0.07061362266540527,
-0.2845591604709625,
0.4085756540298462,
-0.8779159188270569,
0.0813367739319801... |
func (s *Server) GracefulStop() {
s.server.GracefulStop()
} | [
0.4212438762187958,
-0.07126118242740631,
0.3629664480686188,
0.1042344868183136,
0.5002536177635193,
0.38685524463653564,
0.6398286819458008,
0.42684295773506165,
-1.0159612894058228,
-0.3411136269569397,
-0.399722158908844,
0.10584157705307007,
0.13730531930923462,
0.19587035477161407,
... |
func (s *Server) Check(ctx context.Context, in *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error) {
resp := &grpc_health_v1.HealthCheckResponse{}
if len(in.Service) == 0 || in.Service == serviceName {
resp.Status = grpc_health_v1.HealthCheckResponse_SERVING
}
return resp, nil
} | [
-1.0392735004425049,
-0.03725992143154144,
0.5676074028015137,
0.48932838439941406,
0.40090128779411316,
0.39528459310531616,
0.17240417003631592,
-0.2925053536891937,
0.043214716017246246,
-0.10141617804765701,
1.0835514068603516,
0.9693359136581421,
-1.055781602859497,
0.8358782529830933... |
func (s *Server) Watch(in *grpc_health_v1.HealthCheckRequest, server grpc_health_v1.Health_WatchServer) error {
resp := &grpc_health_v1.HealthCheckResponse{Status: grpc_health_v1.HealthCheckResponse_SERVING}
return server.Send(resp)
} | [
-0.3873012661933899,
-0.7833831310272217,
0.6621032953262329,
-0.0528663694858551,
0.5680258870124817,
0.947084903717041,
0.5448106527328491,
0.06337203085422516,
-0.6087939143180847,
-0.6961529850959778,
0.16970671713352203,
1.7916291952133179,
-0.1630982905626297,
0.20218662917613983,
... |
func (s *Server) MirrorText(ctx context.Context, in *pb.MirrorTextRequest) (*pb.MirrorTextResponse, error) {
input := in.Text
// Get Unicode code points.
n := 0
rune := make([]rune, len(input))
for _, r := range input {
rune[n] = r
n++
}
rune = rune[0:n]
// Reverse
for i := 0; i < n/2; i++ {
rune[i], ru... | [
-1.1575061082839966,
0.11587546020746231,
0.2373453676700592,
-0.25768718123435974,
-0.5330423712730408,
-0.28578072786331177,
-0.13838417828083038,
0.2916273772716522,
0.19972608983516693,
0.625561535358429,
-1.0052495002746582,
0.9656441807746887,
-1.2855674028396606,
-0.344693124294281,... |
func Open(b *bolt.DB, ef EncFun, df DecFun, bf BucFun) *DB {
return &DB{
bolt: b,
encode: ef,
decode: df,
bucket: bf,
}
} | [
-0.419450968503952,
0.6705513000488281,
0.2800167202949524,
0.06005065143108368,
-0.5817189812660217,
0.20815041661262512,
0.14937946200370789,
1.0713595151901245,
-0.8213669061660767,
-0.8344841003417969,
-0.5205982327461243,
0.6322122812271118,
-0.6528334021568298,
-0.3128817677497864,
... |
func (db *DB) Bolt() *bolt.DB {
return db.bolt
} | [
0.581544816493988,
0.44644251465797424,
0.059530556201934814,
0.19221749901771545,
-0.1293611377477646,
0.31593552231788635,
-0.694657027721405,
0.3798329532146454,
0.4235876500606537,
-1.5601147413253784,
-0.0021476359106600285,
1.556345820426941,
-1.0832241773605347,
0.23121528327465057,... |
func (db *DB) Get(key interface{}, value interface{}) error {
return db.bolt.View(func(tx *bolt.Tx) error {
return db.GetTx(tx, key, value)
})
} | [
-0.3442433476448059,
1.031427264213562,
0.32091397047042847,
-0.5082195997238159,
-0.5499400496482849,
-0.8821285367012024,
-1.0039827823638916,
0.024106670171022415,
-1.1692134141921997,
0.24310719966888428,
0.43229639530181885,
0.5288315415382385,
0.13597522675991058,
-0.4306974709033966... |
func (db *DB) CountPrefix(prefix interface{}, value interface{}, count *int) error {
return db.bolt.View(func(tx *bolt.Tx) error {
return db.CountPrefixTx(tx, prefix, value, count)
})
} | [
0.21777644753456116,
0.2973701059818268,
0.3978224992752075,
0.012638725340366364,
-0.6936643719673157,
-0.29908984899520874,
-0.2938644289970398,
0.195417121052742,
-0.21463249623775482,
0.5626754760742188,
-0.8081663250923157,
-0.2114378958940506,
0.6476240754127502,
0.4411338269710541,
... |
func (db *DB) Iterate(key interface{}, value interface{}, fn func() error) error {
return db.bolt.View(func(tx *bolt.Tx) error {
return db.IterateTx(tx, key, value, fn)
})
} | [
-0.5831876993179321,
1.2586699724197388,
0.29027557373046875,
0.32000160217285156,
-0.36797764897346497,
-1.0270406007766724,
-0.5565239191055298,
-0.02113846316933632,
-1.2190890312194824,
0.27724307775497437,
0.8957815170288086,
-0.42525428533554077,
0.18064916133880615,
-0.2043019384145... |
func (db *DB) IteratePrefix(key interface{}, value interface{}, prefix interface{}, fn func() error) error {
return db.bolt.View(func(tx *bolt.Tx) error {
return db.IteratePrefixTx(tx, key, value, prefix, fn)
})
} | [
-0.7931393384933472,
0.6843900680541992,
0.38081708550453186,
0.3089713752269745,
-0.3348310887813568,
-1.1059484481811523,
-0.5638863444328308,
-0.32432112097740173,
-0.36240607500076294,
0.30579692125320435,
0.18747173249721527,
0.6500260829925537,
0.588776171207428,
0.47810307145118713,... |
func (db *DB) Update(key interface{}, value interface{}) error {
return db.bolt.Update(func(tx *bolt.Tx) error {
return db.UpdateTx(tx, key, value)
})
} | [
-0.5880605578422546,
0.7043182253837585,
0.25601598620414734,
0.35279709100723267,
-0.9418147206306458,
-0.18037521839141846,
-1.140335202217102,
-0.09431979805231094,
-0.9846373796463013,
1.1143922805786133,
-0.4126386344432831,
-0.6881204843521118,
-0.5274255871772766,
0.2070087492465973... |
func (db *DB) Insert(key interface{}, value interface{}) error {
return db.bolt.Update(func(tx *bolt.Tx) error {
return db.InsertTx(tx, key, value)
})
} | [
-0.5322216153144836,
1.5416293144226074,
0.4576556384563446,
-0.026571601629257202,
-0.6045792698860168,
-0.016569407656788826,
-0.6156148314476013,
0.4045724868774414,
-1.3178377151489258,
0.840373694896698,
-0.8133646845817566,
-0.8646347522735596,
-1.1261093616485596,
-0.014881031587719... |
func (db *DB) Upsert(key interface{}, value interface{}) error {
return db.bolt.Update(func(tx *bolt.Tx) error {
return db.UpsertTx(tx, key, value)
})
} | [
-0.507164716720581,
0.9470795392990112,
0.5373203754425049,
-0.04484692960977554,
-0.44609713554382324,
-0.4894407093524933,
-1.0304912328720093,
-0.33334264159202576,
-1.0692856311798096,
0.8576048016548157,
-0.6361823081970215,
-1.0539456605911255,
-0.7028863430023193,
0.1151057630777359... |
func (db *DB) Delete(key interface{}, value interface{}) error {
return db.bolt.Update(func(tx *bolt.Tx) error {
return db.DeleteTx(tx, key, value)
})
} | [
0.4003656506538391,
1.0411040782928467,
0.38922664523124695,
0.6193959712982178,
-0.28241920471191406,
-0.11722904443740845,
-0.9351673722267151,
0.2315169870853424,
-0.7467650771141052,
1.4359428882598877,
-0.1329253762960434,
-0.7376456260681152,
-0.9483562111854553,
-0.18582749366760254... |
func (db *DB) DeletePrefix(prefix interface{}, value interface{}) error {
return db.bolt.Update(func(tx *bolt.Tx) error {
return db.DeleteTx(tx, prefix, value)
})
} | [
-0.05729717016220093,
0.3568042814731598,
0.40728965401649475,
0.23895534873008728,
-0.6324488520622253,
-0.6647120118141174,
-0.8756641745567322,
0.08430956304073334,
0.2769410014152527,
0.1296197921037674,
-0.5954880118370056,
0.03736010566353798,
0.08382298797369003,
0.4491983950138092,... |
func (db *DB) GetTx(tx *bolt.Tx, key interface{}, value interface{}) error {
bb := db.bucket(value)
b := tx.Bucket(bb)
if b == nil {
return ErrKeyNotExists
}
kb, err := db.encode(key)
if err != nil {
return err
}
data := b.Get(kb)
if data == nil {
return ErrKeyNotExists
}
return db.decode(data, valu... | [
-0.18591496348381042,
0.7755092978477478,
0.7851707339286804,
0.2626727223396301,
-0.14888016879558563,
-0.5609258413314819,
-1.0191303491592407,
-0.3968910276889801,
-0.09231362491846085,
0.4690839648246765,
-0.810506284236908,
0.03476829454302788,
-0.18175089359283447,
-0.312134534120559... |
func (db *DB) CountPrefixTx(tx *bolt.Tx, prefix interface{}, value interface{}, count *int) error {
*count = 0
bb := db.bucket(value)
b := tx.Bucket(bb)
if b == nil {
return nil
}
pb, err := db.encode(prefix)
if err != nil {
return err
}
c := b.Cursor()
for k, _ := c.Seek(pb); k != nil && bytes.HasPrefi... | [
0.6090845465660095,
0.20253877341747284,
0.7404763102531433,
0.25105583667755127,
-0.780276358127594,
-0.25685417652130127,
-0.47500765323638916,
-0.07351978123188019,
-0.5389569997787476,
0.6777740120887756,
-0.9327757954597473,
-0.3794553875923157,
0.08883876353502274,
0.6136132478713989... |
func (db *DB) IterateTx(tx *bolt.Tx, key interface{}, value interface{}, fn func() error) error {
bb := db.bucket(value)
b := tx.Bucket(bb)
if b == nil {
return nil
}
c := b.Cursor()
for k, v := c.First(); k != nil; k, v = c.Next() {
if err := db.decode(k, key); err != nil {
return err
}
if err := db.d... | [
-0.519110918045044,
0.10622843354940414,
0.7214993834495544,
0.10722509026527405,
-0.24005483090877533,
-1.2677028179168701,
-0.5947791337966919,
-0.48918628692626953,
-0.43560490012168884,
0.3790113031864166,
-0.2863122820854187,
-0.10749242454767227,
0.16895227134227753,
-0.1899181306362... |
func (db *DB) IteratePrefixTx(tx *bolt.Tx, key interface{}, value interface{}, prefix interface{}, fn func() error) error {
bb := db.bucket(value)
b := tx.Bucket(bb)
if b == nil {
return nil
}
c := b.Cursor()
bPrefix, err := db.encode(prefix)
if err != nil {
return err
}
for k, v := c.Seek(bPrefix); k != ... | [
-0.18964636325836182,
-0.10377907007932663,
0.7386223673820496,
0.2773139476776123,
-0.34402671456336975,
-1.078171968460083,
-0.5970746278762817,
-0.3303772211074829,
-0.14966273307800293,
0.46201133728027344,
-0.1532691866159439,
0.39654824137687683,
0.30414363741874695,
0.31383150815963... |
func (db *DB) UpdateTx(tx *bolt.Tx, key interface{}, value interface{}) error {
bb, kb, vb, err := db.getBytes(key, value)
if err != nil {
return err
}
b, _ := tx.CreateBucketIfNotExists(bb)
v := b.Get(kb)
if v == nil {
return ErrKeyNotExists
}
return b.Put(kb, vb)
} | [
-0.7242337465286255,
0.3220626413822174,
0.7317813038825989,
-0.21322843432426453,
-0.4793699085712433,
0.08522596955299377,
-1.2213062047958374,
-0.42891326546669006,
-0.399666965007782,
1.0449228286743164,
-1.0218801498413086,
-0.32649537920951843,
-0.2748219966888428,
-0.094874121248722... |
func (db *DB) InsertTx(tx *bolt.Tx, key interface{}, value interface{}) error {
var err error
kb := []byte{}
bb := db.bucket(value)
b, _ := tx.CreateBucketIfNotExists(bb)
if key == nil {
ukey, _ := b.NextSequence()
kb, err = db.encode(ukey)
if err != nil {
return err
}
dv := reflect.Indirect(reflec... | [
-1.0560513734817505,
1.1231218576431274,
1.0457676649093628,
-0.2598361074924469,
-0.13161416351795197,
0.03324863687157631,
-0.2405184656381607,
0.037840716540813446,
-0.21198014914989471,
0.6540957093238831,
-0.8934968709945679,
-0.9813278317451477,
-0.7424418926239014,
0.141124799847602... |
func (db *DB) UpsertTx(tx *bolt.Tx, key interface{}, value interface{}) error {
bb, kb, vb, err := db.getBytes(key, value)
if err != nil {
return err
}
b, _ := tx.CreateBucketIfNotExists(bb)
return b.Put(kb, vb)
} | [
-0.5423678159713745,
1.2067465782165527,
0.7748757600784302,
-0.4572678506374359,
-0.349317729473114,
-0.05120641365647316,
-0.7461400628089905,
-0.41175922751426697,
-0.4220860004425049,
1.1806714534759521,
-1.0061880350112915,
-0.8714274764060974,
-0.3627554178237915,
0.17387717962265015... |
func (db *DB) DeleteTx(tx *bolt.Tx, key interface{}, value interface{}) error {
kb, err := db.encode(key)
if err != nil {
return err
}
b := tx.Bucket(db.bucket(value))
if b == nil {
return ErrKeyNotExists
}
v := b.Get(kb)
if v == nil {
return ErrKeyNotExists
}
return b.Delete(kb)
} | [
-0.026942405849695206,
0.3521186113357544,
0.629565417766571,
0.15152095258235931,
-0.5126655101776123,
-0.07919298857450485,
-0.933738112449646,
-0.3230048418045044,
0.038651660084724426,
0.6774263381958008,
-0.65970778465271,
-0.5291827321052551,
-0.03900131210684776,
0.19277505576610565... |
func (db *DB) DeletePrefixTx(tx *bolt.Tx, prefix interface{}, value interface{}) error {
pb, err := db.encode(prefix)
if err != nil {
return err
}
b := tx.Bucket(db.bucket(value))
if b == nil {
return ErrKeyNotExists
}
c := b.Cursor()
for k, _ := c.Seek(pb); k != nil && bytes.HasPrefix(k, pb); k, _ = c.Ne... | [
0.3278563320636749,
0.04762163385748863,
0.8691641688346863,
0.17604245245456696,
-0.7605040669441223,
-0.20816512405872345,
-0.986980140209198,
-0.2994372546672821,
0.039480727165937424,
0.6542022824287415,
-0.4397841989994049,
0.11928769201040268,
-0.2090759128332138,
0.40695109963417053... |
func (lp *LinePrinter) Write(p []byte) (int, error) {
lp.Lock()
defer lp.Unlock()
n, err := lp.buf.Write(p)
if err != nil {
return n, err
}
for {
line, err := lp.buf.ReadString(byte('\n'))
if err == io.EOF {
_, err = lp.buf.Write([]byte(line))
return n, err
} else if err != nil {
return n, err
... | [
-0.07513253390789032,
-0.32521942257881165,
0.6452038884162903,
0.002749794162809849,
0.7882671356201172,
-0.11296546459197998,
-0.24498187005519867,
0.0983295664191246,
-0.17131955921649933,
-0.07346825301647186,
-0.42404478788375854,
-0.18495213985443115,
-1.0693203210830688,
0.663818120... |
func (lp *LinePrinter) Close() error {
lp.Lock()
defer lp.Unlock()
line := lp.buf.String()
if len(line) > 0 {
lp.Print(line)
}
return nil
} | [
1.045882225036621,
-1.2010438442230225,
0.517457902431488,
-0.15941497683525085,
0.0388372540473938,
0.6409968137741089,
-0.446952223777771,
-0.8071705102920532,
-0.6101930141448975,
-1.107433795928955,
0.49921971559524536,
0.24235327541828156,
-2.1272640228271484,
0.8633729219436646,
0.... |
func NewFeature(geom IGeometry, properties *map[string]interface{}) IFeature {
g := &geometry{
Type: geom.GetType(),
Coordinates: geom.GetCoordinates(),
CRS: &referenceSystem{
Type: geom.GetCRS().GetType(),
Properties: newReferenceSystemProperties(geom.GetCRS().GetSrId()),
},
}
if properti... | [
0.7098523378372192,
-1.001218557357788,
0.5004216432571411,
0.3381651043891907,
0.11486096680164337,
-0.445903480052948,
-0.3778616786003113,
-0.20333024859428406,
-0.19881702959537506,
-0.6509178876876831,
-0.017877034842967987,
0.749272882938385,
-0.30189305543899536,
-0.0909069031476974... |
func DeserializeFeature(input string) (IFeature, error) {
var res *feature
err := json.Unmarshal([]byte(input), &res)
if err != nil {
return nil, err
}
if res.Properties == nil {
emptyProps := make(map[string]interface{})
res.Properties = &emptyProps
}
return res, nil
} | [
-0.4781152009963989,
-0.6369657516479492,
0.5496418476104736,
-0.2972676753997803,
-0.5012475848197937,
-1.0463230609893799,
0.2928382158279419,
0.20528994500637054,
0.15618997812271118,
-0.5593621730804443,
-1.0620861053466797,
0.021952638402581215,
-1.401435136795044,
-0.576001763343811,... |
func (f *feature) GetType() FeatureTypes {
return f.Type
} | [
0.14615674316883087,
0.34546327590942383,
0.2562161386013031,
1.648529052734375,
1.6201553344726562,
-0.38231754302978516,
0.884326159954071,
0.04363800212740898,
-0.01096789538860321,
-0.7471300363540649,
-0.581570029258728,
0.34308189153671265,
-0.3887426555156708,
0.25568872690200806,
... |
func (f *feature) GetGeometry() IGeometry {
return f.Geometry
} | [
0.6297599673271179,
-0.05362845957279205,
0.2889670133590698,
1.4706240892410278,
0.7594133019447327,
-0.41716766357421875,
1.0847864151000977,
0.11796852946281433,
-0.05932943895459175,
-0.5889312028884888,
-0.20955538749694824,
-0.16476258635520935,
0.03364687040448189,
-0.63447630405426... |
func (f *feature) GetProperties() *map[string]interface{} {
return f.Properties
} | [
-0.6551135182380676,
-0.7680050730705261,
0.21507222950458527,
0.583427906036377,
0.3887482285499573,
-0.6504549980163574,
0.17319749295711517,
0.45139169692993164,
-0.4192242920398712,
-0.9142402410507202,
-0.26516193151474,
-0.22429907321929932,
-0.03667708858847618,
0.5753292441368103,
... |
func (f *feature) Serialize() string {
stream, err := json.Marshal(f)
if err != nil {
return ""
}
return string(stream)
} | [
0.12868766486644745,
-0.10584370046854019,
0.5071669816970825,
0.23147691786289215,
0.12336260080337524,
-0.9406062364578247,
-0.20762106776237488,
-0.1675860732793808,
-0.28989943861961365,
-0.037390194833278656,
-0.25440946221351624,
0.5067128539085388,
-0.5775468349456787,
-0.0465527884... |
func NewCache(client *http.Client, promURL *url.URL, staticMetadata []*Entry) *Cache {
if client == nil {
client = http.DefaultClient
}
c := &Cache{
promURL: promURL,
client: client,
staticMetadata: map[string]*Entry{},
metadata: map[string]*cacheEntry{},
seenJobs: map[string]s... | [
0.13996082544326782,
0.10655622184276581,
0.5141643285751343,
0.3328191339969635,
-0.2183762490749359,
0.9390943050384521,
-0.10573595762252808,
-0.20575422048568726,
-0.9576010704040527,
0.8682901263237,
0.9006033539772034,
1.0256268978118896,
-0.25252005457878113,
-0.10542457550764084,
... |
func (c *Cache) Get(ctx context.Context, job, instance, metric string) (*Entry, error) {
if md, ok := c.staticMetadata[metric]; ok {
return md, nil
}
md, ok := c.metadata[metric]
if !ok || md.shouldRefetch() {
// If we are seeing the job for the first time, preemptively get a full
// list of all metadata for ... | [
0.5943848490715027,
0.27291566133499146,
0.6512369513511658,
-0.07968106865882874,
0.11491402238607407,
-0.07942661643028259,
-0.026153814047574997,
-0.6876574754714966,
-1.0233657360076904,
0.6592538356781006,
1.0954461097717285,
1.284857153892517,
0.16497793793678284,
-0.0590496063232421... |
func (c *Cache) fetchMetric(ctx context.Context, job, instance, metric string) (*cacheEntry, error) {
job, instance = escapeLval(job), escapeLval(instance)
apiResp, err := c.fetch(ctx, "metric", url.Values{
"match_target": []string{fmt.Sprintf("{job=\"%s\",instance=\"%s\"}", job, instance)},
"metric": []st... | [
0.27848559617996216,
0.5144864916801453,
0.5070573091506958,
0.15550707280635834,
-0.8652561902999878,
-0.141775980591774,
-0.29065069556236267,
-0.9719640612602234,
-0.7820718288421631,
0.46184730529785156,
0.6037895679473877,
0.43669429421424866,
-0.14008840918540955,
-0.1630998998880386... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.