text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (factory) Name() string {
return tanLogDBName
} | [
-0.6586637496948242,
-0.2395630180835724,
0.489063024520874,
0.5629474520683289,
-1.5057399272918701,
0.6041867733001709,
0.029827110469341278,
-0.4877346158027649,
-0.33831530809402466,
0.5418828725814819,
-0.69675213098526,
-0.9070919752120972,
0.7990676760673523,
0.3558938801288605,
0... |
func CreateTan(cfg config.NodeHostConfig, cb config.LogDBCallback,
dirs []string, wals []string) (*LogDB, error) {
return createTan(cfg, cb, dirs, wals, true)
} | [
-0.5434324145317078,
0.3741697669029236,
0.40233758091926575,
-0.5796233415603638,
-0.011423900723457336,
0.6439451575279236,
0.04236298054456711,
0.09741745889186859,
-0.8496136665344238,
-0.19824019074440002,
-0.21245984733104706,
-0.40203857421875,
-0.203749880194664,
0.2786960303783417... |
func CreateLogMultiplexedTan(cfg config.NodeHostConfig, cb config.LogDBCallback,
dirs []string, wals []string) (*LogDB, error) {
return createTan(cfg, cb, dirs, wals, false)
} | [
-0.328132688999176,
0.6567932963371277,
0.6535107493400574,
-0.15097419917583466,
-0.24745799601078033,
0.9691385626792908,
-0.7028382420539856,
-0.10694807022809982,
-0.42121264338493347,
-0.12519221007823944,
-0.3031846582889557,
-0.6078804731369019,
0.12111497670412064,
0.05671926960349... |
func (l *LogDB) DeleteSnapshot(shardID uint64,
replicaID uint64, index uint64) error {
panic("depreciated")
} | [
0.6140893697738647,
0.9147564768791199,
0.38081589341163635,
0.49288690090179443,
-1.022666335105896,
-0.46767061948776245,
-0.27816516160964966,
0.1811959594488144,
0.7155812978744507,
-0.2066151350736618,
0.0712365135550499,
0.2173420488834381,
0.5244183540344238,
-0.5579301714897156,
... |
func (l *LogDB) ListSnapshots(shardID uint64,
replicaID uint64, index uint64) ([]pb.Snapshot, error) {
panic("depreciated")
} | [
0.09775926172733307,
0.16947796940803528,
0.31325656175613403,
0.0644390881061554,
-0.1208190768957138,
-0.24183617532253265,
-1.2490036487579346,
-0.4333902895450592,
0.7623032331466675,
0.1283400058746338,
-0.033729393035173416,
0.5344251394271851,
-0.41463273763656616,
-0.45878842473030... |
func (l *LogDB) Name() string {
return tanLogDBName
} | [
-0.21467992663383484,
-0.451698899269104,
0.34155234694480896,
-0.0031261821277439594,
-1.3257567882537842,
0.8221644163131714,
-0.4552907347679138,
-0.29651397466659546,
-0.26128119230270386,
0.7023395299911499,
-0.8027277588844299,
-0.7344548106193542,
-0.47674760222435,
0.60565799474716... |
func (l *LogDB) Close() (err error) {
func() {
l.mu.Lock()
defer l.mu.Unlock()
err = firstError(err, l.collection.iterate(func(db *db) error {
return db.close()
}))
}()
err = firstError(err, l.bsDir.Close())
err = firstError(err, l.dir.Close())
return firstError(err, l.fileLock.Close())
} | [
-0.25561586022377014,
0.4426959753036499,
0.8298444151878357,
0.34894412755966187,
0.0780923068523407,
0.5058891177177429,
0.15422849357128143,
-1.0054421424865723,
-0.8012835383415222,
-0.5394383668899536,
0.35563337802886963,
-0.4875539243221283,
-1.0687588453292847,
1.0106191635131836,
... |
func (l *LogDB) BinaryFormat() uint32 {
return raftio.PlainLogDBBinVersion
} | [
0.724419116973877,
-0.6851040124893188,
0.36489376425743103,
-0.4306620955467224,
-0.3633885085582733,
0.5355926752090454,
0.5903374552726746,
-0.7585859894752502,
-0.40549907088279724,
-0.5723382830619812,
-0.7705497741699219,
0.5693782567977905,
-1.6297075748443604,
1.1286077499389648,
... |
func (l *LogDB) ListNodeInfo() ([]raftio.NodeInfo, error) {
files, err := l.fs.List(l.bsDirname)
if err != nil {
return nil, err
}
result := make([]raftio.NodeInfo, 0)
for _, file := range files {
shardID, replicaID, ok := parseBootstrapFilename(file)
if ok {
result = append(result, raftio.NodeInfo{ShardI... | [
0.18128879368305206,
-0.675550103187561,
0.1915290653705597,
-0.755370020866394,
0.34357887506484985,
-0.734403669834137,
-0.2200476974248886,
0.06930488348007202,
-0.5709888339042664,
0.27756914496421814,
-0.11145692318677902,
0.3567267656326294,
0.3477657437324524,
0.9822637438774109,
... |
func (l *LogDB) SaveBootstrapInfo(shardID uint64,
replicaID uint64, rec pb.Bootstrap) error {
return saveBootstrap(l.fs, l.bsDirname, l.bsDir, shardID, replicaID, rec)
} | [
-0.19609622657299042,
-0.6041589379310608,
0.3710959553718567,
-0.10097646713256836,
-0.01070009171962738,
0.014386062510311604,
-0.17320197820663452,
0.0276926439255476,
-0.15372109413146973,
0.09997262805700302,
-0.9980408549308777,
-0.14874936640262604,
-0.15657658874988556,
0.690660774... |
func (l *LogDB) GetBootstrapInfo(shardID uint64,
replicaID uint64) (pb.Bootstrap, error) {
return getBootstrap(l.fs, l.bsDirname, shardID, replicaID)
} | [
0.3884211778640747,
-0.23490816354751587,
0.5081993341445923,
0.21199822425842285,
-0.4196298122406006,
-0.6183879971504211,
-0.7344793081283569,
-0.2471258044242859,
-0.20592670142650604,
-0.12618482112884521,
0.11182274669408798,
0.7304101586341858,
0.3988132178783417,
0.3914871215820312... |
func (l *LogDB) SaveRaftState(updates []pb.Update, shardID uint64) error {
if l.collection.multiplexedLog() {
return l.concurrentSaveState(updates, shardID)
}
return l.sequentialSaveState(updates, shardID)
} | [
-0.1616547703742981,
0.01493565458804369,
0.526072084903717,
-1.18572199344635,
0.21746881306171417,
0.05998501926660538,
0.1057833731174469,
-0.23110553622245789,
0.8955662250518799,
0.5882226824760437,
-0.7941952347755432,
0.06571844965219498,
-0.8199987411499023,
0.8062060475349426,
-... |
func (l *LogDB) IterateEntries(ents []pb.Entry,
size uint64, shardID uint64, replicaID uint64, low uint64,
high uint64, maxSize uint64) ([]pb.Entry, uint64, error) {
db, err := l.getDB(shardID, replicaID)
if err != nil {
return nil, 0, err
}
return db.getEntries(shardID, replicaID, ents, size, low, high, maxSiz... | [
-0.39004984498023987,
-0.3271084725856781,
0.3442983031272888,
-0.22097043693065643,
0.5888950824737549,
-0.4070751667022705,
-0.29794982075691223,
0.1683093011379242,
-0.22190658748149872,
0.6304290890693665,
0.7194644808769226,
0.6069188714027405,
-0.49572187662124634,
0.4792413115501404... |
func (l *LogDB) ReadRaftState(shardID uint64,
replicaID uint64, lastIndex uint64) (raftio.RaftState, error) {
db, err := l.getDB(shardID, replicaID)
if err != nil {
return raftio.RaftState{}, err
}
return db.getRaftState(shardID, replicaID, lastIndex)
} | [
-0.09094921499490738,
0.1245715394616127,
0.6526533961296082,
-1.237226128578186,
-0.5411270260810852,
-0.5199096202850342,
0.17251159250736237,
-0.3888324797153473,
0.23829907178878784,
0.39103519916534424,
0.003968002740293741,
0.9376769065856934,
-0.36517849564552307,
-0.701625943183898... |
func (l *LogDB) RemoveEntriesTo(shardID uint64,
replicaID uint64, index uint64) error {
db, err := l.getDB(shardID, replicaID)
if err != nil {
return err
}
if err := db.removeEntries(shardID, replicaID, index); err != nil {
return err
}
return db.sync()
} | [
0.09548559784889221,
0.2561008632183075,
0.4942762851715088,
-1.1978685855865479,
0.42882904410362244,
-0.5581742525100708,
-0.01162585150450468,
0.5213984251022339,
-0.5419783592224121,
0.5523560643196106,
-0.2377883344888687,
0.5180599093437195,
-0.5180842876434326,
-0.18379449844360352,... |
func (l *LogDB) CompactEntriesTo(shardID uint64,
replicaID uint64, index uint64) (<-chan struct{}, error) {
ch := make(chan struct{}, 1)
ch <- struct{}{}
return ch, nil
} | [
0.9876311421394348,
0.0715293288230896,
0.3941434621810913,
-1.7054171562194824,
0.1628614217042923,
-0.3425227105617523,
0.1523590087890625,
-0.17157335579395294,
-0.8839413523674011,
0.14085452258586884,
0.2675311267375946,
1.5439491271972656,
-0.3519813120365143,
-0.31316447257995605,
... |
func (l *LogDB) SaveSnapshots(updates []pb.Update) error {
buf := make([]byte, 1024*32)
for _, ud := range updates {
if pb.IsEmptySnapshot(ud.Snapshot) {
continue
}
db, err := l.getDB(ud.ShardID, ud.ReplicaID)
if err != nil {
return err
}
wu := pb.Update{
ShardID: ud.ShardID,
ReplicaID: ud.R... | [
-0.8139610290527344,
0.45275449752807617,
0.6965963244438171,
0.10140081495046616,
0.33693933486938477,
0.48803600668907166,
-0.0668170377612114,
-0.10332076251506805,
0.1631704866886139,
0.22772018611431122,
-1.0258543491363525,
-1.0501606464385986,
-0.8276469111442566,
0.4509613513946533... |
func (l *LogDB) GetSnapshot(shardID uint64,
replicaID uint64) (pb.Snapshot, error) {
db, err := l.getDB(shardID, replicaID)
if err != nil {
return pb.Snapshot{}, err
}
return db.getSnapshot(shardID, replicaID)
} | [
0.7044253349304199,
0.5481296181678772,
0.6329527497291565,
0.18793703615665436,
-0.1507439911365509,
-0.5871772766113281,
-0.7220260500907898,
-0.13194210827350616,
0.097904272377491,
-0.10610667616128922,
0.5682514905929565,
0.7848508954048157,
-0.08678483963012695,
-0.20785515010356903,... |
func (l *LogDB) RemoveNodeData(shardID uint64, replicaID uint64) error {
db, err := l.getDB(shardID, replicaID)
if err != nil {
return err
}
if err := db.removeAll(shardID, replicaID); err != nil {
return err
}
if err := removeBootstrap(l.fs,
l.bsDirname, l.bsDir, shardID, replicaID); err != nil {
return ... | [
-0.2494143396615982,
0.5231829285621643,
0.43422824144363403,
-0.4472070038318634,
-0.7200071811676025,
-0.07972177118062973,
-0.3043632507324219,
0.5318198204040527,
-0.10713498294353485,
0.41048139333724976,
0.10596249997615814,
0.5460041165351868,
-0.25855544209480286,
0.470132052898407... |
func (l *LogDB) ImportSnapshot(snapshot pb.Snapshot, replicaID uint64) error {
bs := pb.Bootstrap{
Join: true,
Type: snapshot.Type,
}
if err := saveBootstrap(l.fs,
l.bsDirname, l.bsDir, snapshot.ShardID, replicaID, bs); err != nil {
return err
}
db, err := l.getDB(snapshot.ShardID, replicaID)
if err != ni... | [
0.3964214026927948,
0.509213924407959,
0.7456933259963989,
0.38402366638183594,
-0.6179696321487427,
-0.19599033892154694,
0.0975286066532135,
-0.2614937126636505,
0.8491767048835754,
0.4338332414627075,
-0.7184844017028809,
-0.20913946628570557,
-0.07577627152204514,
0.03491032123565674,
... |
func NewDriverHandle(
driver drivers.DriverPlugin,
taskID string,
task *structs.Task,
maxKillTimeout time.Duration,
net *drivers.DriverNetwork) *DriverHandle {
return &DriverHandle{
driver: driver,
net: net,
taskID: taskID,
killSignal: task.KillSignal,
killTimeout: helper.Min(task.Kil... | [
0.41625818610191345,
-0.5460276007652283,
0.09041047096252441,
0.3014131188392639,
0.17761969566345215,
0.22328294813632965,
-0.7253237366676331,
0.13175512850284576,
-0.029906919226050377,
0.4784800410270691,
0.2074846774339676,
-0.15981794893741608,
-0.8548125624656677,
-0.58985704183578... |
func (h *DriverHandle) SetKillSignal(signal string) {
h.killSignal = signal
} | [
-0.3874775171279907,
-1.216343879699707,
0.3263181746006012,
0.5828998684883118,
-0.11492937058210373,
0.5918209552764893,
-0.16412344574928284,
-0.200984925031662,
-0.2223605066537857,
0.45889580249786377,
-1.6720554828643799,
-0.31160488724708557,
0.2945881187915802,
-0.11686781793832779... |
func (h *DriverHandle) Exec(timeout time.Duration, cmd string, args []string) ([]byte, int, error) {
command := append([]string{cmd}, args...)
res, err := h.driver.ExecTask(h.taskID, command, timeout)
if err != nil {
return nil, 0, err
}
return res.Stdout, res.ExitResult.ExitCode, res.ExitResult.Err
} | [
0.0994710922241211,
-0.13233992457389832,
0.6144565939903259,
0.7728564739227295,
0.11970601975917816,
-0.3740119934082031,
-0.41657397150993347,
0.5499739050865173,
-1.2170567512512207,
0.8846837878227234,
-0.08037645369768143,
-0.18617546558380127,
-0.0065194000490009785,
0.0534941554069... |
func (h *DriverHandle) ExecStreaming(ctx context.Context,
command []string,
tty bool,
stream drivers.ExecTaskStream) error {
if impl, ok := h.driver.(drivers.ExecTaskStreamingRawDriver); ok {
return impl.ExecTaskStreamingRaw(ctx, h.taskID, command, tty, stream)
}
d, ok := h.driver.(drivers.ExecTaskStreamingDr... | [
-0.18102657794952393,
0.4530152380466461,
0.9652731418609619,
0.6741981506347656,
-0.06696093082427979,
-0.12557633221149445,
-0.05133059248328209,
-0.3611610233783722,
-0.024453096091747284,
0.7709810137748718,
0.633564293384552,
0.008161094971001148,
0.06713402271270752,
0.76587659120559... |
func IsMultipleOfThree(n int) bool {
// if n is negative, make it positive
if (n < 0) {
n *= -1
}
if (n == 0) {
return true
} else if (n == 1) {
return false
} else {
oddPosition := true
odds := 0
evens := 0
for n != 0 {
bi... | [
-1.3457127809524536,
1.1864627599716187,
0.8380650281906128,
-0.38975727558135986,
0.02515394799411297,
0.3731883764266968,
-0.028149090707302094,
-0.37168964743614197,
0.9948651194572449,
0.06234915927052498,
-0.8822037577629089,
-1.0366382598876953,
-0.5327739715576172,
0.463924407958984... |
func UserHomeDir(tc Context) (string, error) {
return os.UserHomeDir()
} | [
0.1755709946155548,
-0.6718923449516296,
0.33347904682159424,
0.5330721139907837,
-0.8156132698059082,
0.2962312698364258,
1.109026312828064,
-0.8658612370491028,
0.535063624382019,
0.2228485643863678,
-0.27534595131874084,
0.7055948972702026,
0.39195865392684937,
-0.11974695324897766,
-... |
func UserCacheDir(tc Context) (string, error) {
return os.UserCacheDir()
} | [
-0.734917402267456,
-0.2978333830833435,
0.3070142865180969,
0.557395339012146,
-1.5668426752090454,
0.3403322398662567,
0.2988205850124359,
-0.4608025848865509,
0.2289537787437439,
0.4417334496974945,
-0.6172187924385071,
0.2966778874397278,
0.7040467262268066,
0.15801683068275452,
-0.2... |
func UserConfigDir(tc Context) (string, error) {
return os.UserConfigDir()
} | [
-0.6354366540908813,
-0.19874072074890137,
0.26723939180374146,
0.37608250975608826,
-1.8185834884643555,
-0.2828889787197113,
0.8034455180168152,
0.3018015921115875,
-0.19875334203243256,
0.3670959174633026,
-0.7173311710357666,
-0.22955355048179626,
0.6497365832328796,
0.8507564067840576... |
func TempDir(tc Context) (string, error) {
return os.TempDir(), nil
} | [
0.3232734799385071,
-0.327875018119812,
0.2440827488899231,
-0.5492907762527466,
-0.45799413323402405,
-0.01107944268733263,
-0.1340230107307434,
-0.07656890153884888,
0.2391388863325119,
-0.6219361424446106,
0.26505911350250244,
-0.5369404554367065,
-0.12551476061344147,
0.906649768352508... |
func (r *VDRI) Read(didID string, _ ...vdriapi.ResolveOpts) (*did.Doc, error) {
// get the document from the store
var service []did.Service
var endpoint string
short := r.strip(didID)
nym, err := r.GetNym(short)
if err != nil {
return nil, fmt.Errorf("unable to get nym resolving DID: %v", err)
}
attrib, er... | [
0.3094223141670227,
-0.1850486397743225,
0.5954093933105469,
-0.6979861855506897,
-0.5484303832054138,
-0.16539642214775085,
-0.19995376467704773,
0.019454315304756165,
1.2266968488693237,
0.09270559251308441,
0.8273323178291321,
0.5430534482002258,
-0.6921781301498413,
-0.6209484338760376... |
func NewFromFile(path string) (*ExecMeta, error) {
data, err := readFile(path)
if err != nil {
return nil, err
}
buf := bytes.NewBuffer(data)
return NewFromReader(buf)
} | [
0.8189906477928162,
-0.291336327791214,
0.4512442946434021,
0.2395627349615097,
-0.9120479226112366,
0.39241352677345276,
-0.6583743691444397,
-0.10039637237787247,
-1.2732263803482056,
-0.1401158720254898,
0.2006542980670929,
0.6368904709815979,
-0.2979982793331146,
0.08061879128217697,
... |
func (m *ExecMeta) WriteToDisk(dir string) error {
path := filepath.Join(dir, MetaFileName)
buf := &bytes.Buffer{}
if err := m.Encode(buf); err != nil {
return err
}
if err := writeFile(path, buf.Bytes()); err != nil {
return err
}
return nil
} | [
-0.3090337812900543,
0.6020744442939758,
0.7706465125083923,
0.6773451566696167,
1.341420292854309,
0.25712093710899353,
0.5218622088432312,
0.3166963756084442,
-0.5966191291809082,
0.11482589691877365,
0.3489244282245636,
0.7395358681678772,
0.2487284541130066,
0.7670862078666687,
0.209... |
func (o *TriggerADSyncUsingPOSTReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewTriggerADSyncUsingPOSTOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
retu... | [
0.3508402705192566,
-0.5240533947944641,
0.6577528715133667,
0.5682628154754639,
0.005513415671885014,
-1.13905668258667,
0.030751334503293037,
0.011933489702641964,
0.4562344253063202,
0.42465052008628845,
-0.24812516570091248,
-0.45557594299316406,
-0.2861122488975525,
-0.395376026630401... |
func NewTriggerADSyncUsingPOSTOK() *TriggerADSyncUsingPOSTOK {
return &TriggerADSyncUsingPOSTOK{}
} | [
0.4406440258026123,
-0.07176894694566727,
0.18581584095954895,
0.1627785712480545,
-0.7192208766937256,
-0.4412554204463959,
0.43767884373664856,
0.4254847764968872,
-0.2270013988018036,
0.5231028199195862,
-1.3079452514648438,
-0.5767637491226196,
1.0102925300598145,
-0.5964280962944031,
... |
func NewTriggerADSyncUsingPOSTCreated() *TriggerADSyncUsingPOSTCreated {
return &TriggerADSyncUsingPOSTCreated{}
} | [
0.7950475811958313,
0.2858063578605652,
-0.057059355080127716,
0.2803243398666382,
0.05241751670837402,
-0.4301564395427704,
-0.33154964447021484,
0.22489073872566223,
-0.09020896255970001,
-0.0312538743019104,
-0.8185108304023743,
-0.0260884091258049,
1.1886706352233887,
-0.36996629834175... |
func NewTriggerADSyncUsingPOSTUnauthorized() *TriggerADSyncUsingPOSTUnauthorized {
return &TriggerADSyncUsingPOSTUnauthorized{}
} | [
-0.4267236590385437,
0.26708701252937317,
0.32150280475616455,
0.7652815580368042,
-1.1500705480575562,
-0.730536699295044,
-0.24870344996452332,
1.1244460344314575,
0.0700925663113594,
-0.4376002550125122,
-1.0270925760269165,
1.3301788568496704,
0.7332413196563721,
-1.1554073095321655,
... |
func NewTriggerADSyncUsingPOSTForbidden() *TriggerADSyncUsingPOSTForbidden {
return &TriggerADSyncUsingPOSTForbidden{}
} | [
0.5078747868537903,
0.7425870895385742,
0.1929994821548462,
0.7955425977706909,
-0.7329439520835876,
-0.3189694583415985,
-0.099800705909729,
0.009626931510865688,
-0.20727331936359406,
0.07143556326627731,
-1.0239512920379639,
0.5184925198554993,
0.8205137252807617,
-1.2297066450119019,
... |
func NewTriggerADSyncUsingPOSTNotFound() *TriggerADSyncUsingPOSTNotFound {
return &TriggerADSyncUsingPOSTNotFound{}
} | [
0.19588397443294525,
-0.83039391040802,
-0.057838570326566696,
0.1654892861843109,
-0.15417097508907318,
0.09542648494243622,
0.3187989890575409,
0.48494911193847656,
0.2349781095981598,
0.31070318818092346,
-1.051791787147522,
0.7132349014282227,
1.204215407371521,
-0.6140852570533752,
... |
func getEnVar(name string) string {
return fmt.Sprintf("%s_%s", EnVarPrefix, name)
} | [
-0.567609965801239,
-0.1697365641593933,
0.46190130710601807,
-1.032857060432434,
-0.31714361906051636,
0.26290789246559143,
-0.5998488068580627,
-0.4539012908935547,
-0.7847763299942017,
0.14130495488643646,
-0.23993656039237976,
0.5545077919960022,
0.3110809326171875,
-0.1344400346279144... |
func (env *Env) ForwardEnvVar(res http.ResponseWriter, req *http.Request) {
var envVar util.EnvVar
err := util.DecodeJSON(req.Body, &envVar)
if err != nil {
util.SendErrRes(res, err)
return
}
master, err := env.GetMaster()
if err != nil {
util.SendErrRes(res, err)
return
}
env.SendToMinion(master, "set-... | [
-0.9331417083740234,
-0.13150568306446075,
0.6389341354370117,
-1.1064486503601074,
0.024457305669784546,
0.3011205494403839,
0.8228371143341064,
-0.19389590620994568,
-0.7568880319595337,
0.5472410917282104,
-0.5643154978752136,
0.9144641160964966,
0.31326550245285034,
0.9468459486961365,... |
func (ac *ActivityCreate) SetName(s string) *ActivityCreate {
ac.mutation.SetName(s)
return ac
} | [
-0.649221658706665,
0.28673240542411804,
0.20773003995418549,
1.3580365180969238,
-0.466265469789505,
-0.0028214678168296814,
1.1238961219787598,
0.1836419701576233,
0.4138706922531128,
0.19670382142066956,
-0.7374659776687622,
-0.5514885187149048,
0.5133065581321716,
0.025576550513505936,... |
func (ac *ActivityCreate) AddTimesheetIDs(ids ...int) *ActivityCreate {
ac.mutation.AddTimesheetIDs(ids...)
return ac
} | [
-1.3118337392807007,
-0.5606593489646912,
0.060090843588113785,
-0.06840012222528458,
0.31530874967575073,
0.28019317984580994,
-0.9014135599136353,
-0.5220772624015808,
-0.1653963029384613,
0.6633791923522949,
-0.4977000653743744,
-0.801102340221405,
0.2049037665128708,
0.7128642797470093... |
func (ac *ActivityCreate) AddTimesheets(t ...*Timesheet) *ActivityCreate {
ids := make([]int, len(t))
for i := range t {
ids[i] = t[i].ID
}
return ac.AddTimesheetIDs(ids...)
} | [
-0.7875353097915649,
0.011325085535645485,
0.3522718846797943,
0.5060280561447144,
0.7518807053565979,
0.3591761589050293,
-0.47029000520706177,
-0.8977393507957458,
-0.12764883041381836,
0.39128297567367554,
-0.3808997571468353,
-1.3185428380966187,
-0.3657703399658203,
0.7719013094902039... |
func (ac *ActivityCreate) SetProjectID(id int) *ActivityCreate {
ac.mutation.SetProjectID(id)
return ac
} | [
-0.37311166524887085,
-0.028480712324380875,
0.15891596674919128,
1.5435594320297241,
-0.3875468075275421,
1.1066995859146118,
0.9727276563644409,
0.35837021470069885,
1.0316356420516968,
0.792272686958313,
-0.3519097864627838,
-0.24264584481716156,
-0.0635746568441391,
0.4600924551486969,... |
func (ac *ActivityCreate) SetProject(p *Project) *ActivityCreate {
return ac.SetProjectID(p.ID)
} | [
-0.24190281331539154,
1.0085407495498657,
0.21201945841312408,
1.4084817171096802,
0.30448487401008606,
0.6668373942375183,
0.6335033774375916,
-0.3686690926551819,
0.3012251853942871,
-0.659637451171875,
0.15783020853996277,
-0.005363862961530685,
-0.6957402229309082,
-0.4329022467136383,... |
func (ac *ActivityCreate) Mutation() *ActivityMutation {
return ac.mutation
} | [
-0.6824157238006592,
-0.4214121401309967,
0.023428842425346375,
0.7772204279899597,
0.35906997323036194,
0.3518100678920746,
1.4383673667907715,
-0.36427387595176697,
1.403978705406189,
-0.24912762641906738,
0.4726429879665375,
-0.19727389514446259,
-0.12000755965709686,
-0.500679135322570... |
func (ac *ActivityCreate) Save(ctx context.Context) (*Activity, error) {
var (
err error
node *Activity
)
if len(ac.hooks) == 0 {
if err = ac.check(); err != nil {
return nil, err
}
node, err = ac.sqlSave(ctx)
} else {
var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error)... | [
-0.6016843318939209,
0.1941847950220108,
0.536636233329773,
0.28738903999328613,
0.633364737033844,
-0.5875033736228943,
1.3774832487106323,
-1.1312663555145264,
-0.16761328279972076,
0.4923710227012634,
0.3328987956047058,
0.05675707757472992,
-0.4420013725757599,
-0.3896227777004242,
0... |
func (ac *ActivityCreate) SaveX(ctx context.Context) *Activity {
v, err := ac.Save(ctx)
if err != nil {
panic(err)
}
return v
} | [
-0.24961528182029724,
0.7614198923110962,
0.2738151252269745,
0.9063894748687744,
-0.348142147064209,
0.9443915486335754,
-0.20335698127746582,
-0.45087769627571106,
1.3143794536590576,
-0.04528673365712166,
-0.8637294769287109,
-0.2650679051876068,
-0.5661939382553101,
-0.2714691162109375... |
func (ac *ActivityCreate) check() error {
if _, ok := ac.mutation.Name(); !ok {
return &ValidationError{Name: "name", err: errors.New("ent: missing required field \"name\"")}
}
if _, ok := ac.mutation.ProjectID(); !ok {
return &ValidationError{Name: "project", err: errors.New("ent: missing required edge \"projec... | [
-0.12936699390411377,
0.3511715233325958,
0.2986886203289032,
0.19712749123573303,
0.6815369725227356,
1.134368896484375,
0.6280443072319031,
-0.3422616720199585,
-0.7497046589851379,
0.30969715118408203,
0.6137323975563049,
-0.18414893746376038,
-0.028530452400445938,
0.8313847780227661,
... |
func (acb *ActivityCreateBulk) Save(ctx context.Context) ([]*Activity, error) {
specs := make([]*sqlgraph.CreateSpec, len(acb.builders))
nodes := make([]*Activity, len(acb.builders))
mutators := make([]Mutator, len(acb.builders))
for i := range acb.builders {
func(i int, root context.Context) {
builder := acb.... | [
-0.5947088599205017,
0.20064537227153778,
0.6846316456794739,
0.9192444086074829,
0.9413084983825684,
-0.7522377967834473,
1.239005446434021,
-0.9097542762756348,
0.1459953486919403,
0.5513936281204224,
-0.10689349472522736,
0.43838879466056824,
-0.34615573287010193,
-0.26460304856300354,
... |
func (acb *ActivityCreateBulk) SaveX(ctx context.Context) []*Activity {
v, err := acb.Save(ctx)
if err != nil {
panic(err)
}
return v
} | [
-0.6548673510551453,
1.017405390739441,
0.4683612287044525,
1.5161339044570923,
0.35975635051727295,
0.5632421970367432,
-0.12427014857530594,
-0.40477779507637024,
1.4075959920883179,
0.385333776473999,
-1.1977453231811523,
0.2076709121465683,
-0.6980577707290649,
0.3075147867202759,
-0... |
func (t *Tree) Delete(data int) error {
if t.Root == nil {
return errors.New("can not delete from an empty tree")
}
fakeParent := &Node{Right: t.Root}
err := t.Root.deleteNode(data, fakeParent)
if err != nil {
return err
}
if fakeParent.Right == nil {
t.Root = nil
}
return nil
} | [
0.4873174726963043,
1.0751053094863892,
0.6217508912086487,
-0.1092943474650383,
0.11904782056808472,
0.1154022067785263,
-0.15507176518440247,
0.0036532480735331774,
0.26234257221221924,
0.5051234364509583,
-0.6455181837081909,
0.20893782377243042,
-0.7303088307380676,
0.987444281578064,
... |
func (node *Node) findMaxNode(parent *Node) (*Node, *Node) {
if node == nil {
return nil, parent
}
if node.Right == nil {
return node, parent
}
return node.Right.findMaxNode(node)
} | [
-0.04588215798139572,
0.09584483504295349,
0.7445648908615112,
0.5163989663124084,
-0.5124769806861877,
-0.3953510522842407,
-0.6290666460990906,
-0.19021642208099365,
0.047652967274188995,
0.6559094786643982,
-0.010328497737646103,
-0.07160371541976929,
-0.42150449752807617,
1.84159183502... |
func (node *Node) replaceNode(parent, replacement *Node) error {
if node == nil {
return errors.New("replaceNode() not allowed on a nil node")
}
if node == parent.Left {
parent.Left = replacement
} else {
parent.Right = replacement
}
return nil
} | [
0.6312277913093567,
0.703970730304718,
0.4972167909145355,
-0.4718036949634552,
0.0852910652756691,
-0.11090228706598282,
-0.20088164508342743,
1.6775710582733154,
0.1536523401737213,
0.032169509679079056,
-0.2190311700105667,
0.3965970575809479,
-0.5268135070800781,
1.1657648086547852,
... |
func (node *Node) deleteNode(data int, parent *Node) error {
if node == nil {
return errors.New("value to be deleted does not exist in the tree")
}
switch {
case data < node.Data:
return node.Left.deleteNode(data, node)
case data > node.Data:
return node.Right.deleteNode(data, node)
default:
if node.Le... | [
0.3662275969982147,
0.694229781627655,
0.8533416986465454,
-0.4372578561306,
-0.03917192667722702,
-0.26841795444488525,
-0.6187039017677307,
0.8715439438819885,
0.6547449231147766,
-0.10407756268978119,
0.28469347953796387,
0.45976927876472473,
-0.45264625549316406,
0.9989166259765625,
... |
func io(output update.OutputT, chs serverChannelsT) update.IoResultT {
result := update.IoResultT{}
if output.MsgToPrint != "" {
fmt.Println(output.MsgToPrint)
}
if len(output.ResponseToClient.Content) != 0 {
output.ResponseToClient.Ch <- output.ResponseToClient.Content
}
if len(output.ResponseToWatcher.Msg) ... | [
-0.24132706224918365,
-0.9304453730583191,
0.5216760039329529,
-0.464377760887146,
-0.4887785315513611,
-0.19729836285114288,
0.45591890811920166,
-1.256197214126587,
-0.5590023994445801,
-0.011366874910891056,
0.30234038829803467,
-0.12308662384748459,
-0.3548848330974579,
0.1411599963903... |
func makeWatcherInputHandler(serCh serverChannelsT) handlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
if len(serCh.watcherInput) == maxBufferSize {
w.WriteHeader(http.StatusServiceUnavailable)
w.Write([]byte("Server too busy."))
return
}
body, err := ioutil.ReadAll(r.Body)
replyChan ... | [
-0.3644793629646301,
-0.4298960268497467,
0.7674421668052673,
-1.044578194618225,
-1.1643822193145752,
0.5912001132965088,
0.9910855293273926,
-0.6944486498832703,
0.15113861858844757,
-0.13589495420455933,
-0.6000241637229919,
0.3640488386154175,
-0.5193286538124084,
-0.5640726685523987,
... |
func makeClientRequestHandler(serCh serverChannelsT) handlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
if len(serCh.clientRequest) == maxBufferSize {
w.WriteHeader(http.StatusServiceUnavailable)
w.Write([]byte("Server too busy."))
return
}
replyChan := make(chan []byte)
serCh.clientR... | [
0.060813646763563156,
-0.041213613003492355,
0.5346748232841492,
-0.8430262804031372,
-1.114585041999817,
0.3997379243373871,
0.5936344861984253,
-0.6533240079879761,
0.17099736630916595,
-0.526721715927124,
-0.2212885320186615,
0.06891834735870361,
-0.365127295255661,
-0.6485396027565002,... |
func server(serCh serverChannelsT) {
mux := goji.NewMux()
mux.HandleFunc(pat.Get("/files"), makeClientRequestHandler(serCh))
mux.HandleFunc(pat.Post("/"), makeWatcherInputHandler(serCh))
http.ListenAndServe("localhost:3000", mux)
} | [
-0.10704343765974045,
-0.19724318385124207,
0.4901484251022339,
0.10329500585794449,
0.8675655126571655,
0.7232097387313843,
0.4272685945034027,
0.4256823658943176,
-1.0751664638519287,
-0.4209645986557007,
-0.6754547357559204,
0.10475557297468185,
-0.10588838160037994,
0.14700178802013397... |
func registerAll(m map[string]setupFunc, app *kingpin.Application, name string) {
cmd := app.Command(name, "All in one command.")
storagePath := cmd.Flag("storage.path", "Directory to read storage from.").
Default("./data").String()
configFile := cmd.Flag("config.file", "Config file to use.").
Default("conprof.... | [
0.15551024675369263,
-0.20594558119773865,
0.7466267943382263,
1.0792843103408813,
0.45955517888069153,
0.09037081152200699,
0.018096275627613068,
0.19549141824245453,
-0.43436989188194275,
0.3749687075614929,
-0.3261749744415283,
0.8163790106773376,
0.18672019243240356,
1.0481376647949219... |
func NormalizeCurrencyCode(currencyCode string) string {
return strings.ToUpper(currencyCode)
} | [
0.0319993756711483,
-0.02001786231994629,
0.45423802733421326,
-0.6301714181900024,
-0.6670122146606445,
-0.0030577091965824366,
0.0337129607796669,
0.7137008309364319,
0.9276028871536255,
0.9705615639686584,
0.5284976959228516,
-0.22467775642871857,
-1.3476240634918213,
-0.078358322381973... |
func send(w http.ResponseWriter, ch chan int){
for {
select {
case value := <-ch:
if (value == 1){
w.Write([]byte("hello http1"))
if f, ok := w.(http.Flusher); ok {
f.Flush()
}
} else {
w.Write([]byte("hello http2"))
if f, ok := w.(http.Flusher); ok {
f.Flush()
... | [
-0.680010974407196,
0.1694227010011673,
0.5796410441398621,
0.4544724225997925,
0.18110781908035278,
0.18747086822986603,
-0.6231145858764648,
-1.4665617942810059,
-0.8693232536315918,
0.030723288655281067,
-0.592631995677948,
0.09635152667760849,
-0.04564832150936127,
1.0836132764816284,
... |
func Constructor() MedianFinder {
return MedianFinder{}
} | [
-0.1350128948688507,
-1.0157002210617065,
-0.0056755635887384415,
0.9523708820343018,
-0.8462363481521606,
0.8901215195655823,
0.6569274067878723,
0.8114689588546753,
0.5973746180534363,
-0.9636586904525757,
0.5073058009147644,
-0.506622314453125,
-0.17256376147270203,
0.15052904188632965,... |
func main() {
medianFinder := Constructor()
medianFinder.AddNum(40)
medianFinder.AddNum(12)
medianFinder.AddNum(16)
medianFinder.AddNum(14)
medianFinder.AddNum(35)
medianFinder.AddNum(19)
medianFinder.AddNum(34)
medianFinder.AddNum(35)
medianFinder.AddNum(28)
medianFinder.AddNum(35)
medianFinder.AddNum(26)
... | [
-0.3681582510471344,
-0.727461576461792,
0.8424047827720642,
0.5442846417427063,
-0.03607810661196709,
0.11018014699220657,
0.26439234614372253,
1.143076777458191,
0.3604568541049957,
-0.3229101002216339,
-0.328427255153656,
0.29036203026771545,
-0.40217867493629456,
0.34076082706451416,
... |
func GetHello(host string) error {
hostURL, err := url.Parse(host)
if err != nil {
return err
}
requestURL, err := hostURL.Parse("/hello")
if err != nil {
return err
}
resp, err := client.Get(requestURL.String())
if err != nil {
return err
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusO... | [
0.40724650025367737,
1.0744333267211914,
1.000853419303894,
0.8741104602813721,
0.7047667503356934,
0.1140066608786583,
-0.5847054719924927,
0.49154412746429443,
-0.9912072420120239,
-0.43718981742858887,
-0.7120047211647034,
0.9424967765808105,
0.1915089339017868,
0.14122924208641052,
0... |
func (o *PostClustersUUIDCertificatesPemkeyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPostClustersUUIDCertificatesPemkeyOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
r... | [
0.1773228794336319,
-0.22951234877109528,
0.3429616093635559,
0.7699909806251526,
-0.4520622789859772,
-0.6943340301513672,
0.18129444122314453,
0.3558855652809143,
0.20727235078811646,
0.7903011441230774,
-0.13708756864070892,
-0.7803857326507568,
-1.2368242740631104,
-0.8691130876541138,... |
func NewPostClustersUUIDCertificatesPemkeyOK() *PostClustersUUIDCertificatesPemkeyOK {
return &PostClustersUUIDCertificatesPemkeyOK{}
} | [
0.532383918762207,
0.630059540271759,
0.17463810741901398,
1.2010595798492432,
-0.7269717454910278,
0.0455414354801178,
0.03794104978442192,
1.646242618560791,
-0.2294512689113617,
1.2797218561172485,
-1.4247682094573975,
-0.5711100697517395,
-0.3931155800819397,
-0.8447191715240479,
-0.... |
func NewPostClustersUUIDCertificatesPemkeyDefault(code int) *PostClustersUUIDCertificatesPemkeyDefault {
return &PostClustersUUIDCertificatesPemkeyDefault{
_statusCode: code,
}
} | [
0.6358791589736938,
0.6429715752601624,
-0.09399571269750595,
0.6131526827812195,
-0.17042294144630432,
-0.31077754497528076,
-0.45672300457954407,
1.4743988513946533,
-0.24251976609230042,
1.0902847051620483,
-1.4031165838241577,
-0.2356913834810257,
-1.2675285339355469,
-0.72903662919998... |
func (o *PostClustersUUIDCertificatesPemkeyDefault) Code() int {
return o._statusCode
} | [
0.20074373483657837,
0.6896877288818359,
-0.11742118746042252,
1.0320625305175781,
0.0011557112447917461,
-0.34409353137016296,
0.05875692889094353,
1.1714589595794678,
-0.436452180147171,
1.0124293565750122,
-0.8797789812088013,
-0.3024110198020935,
-1.4331530332565308,
-0.198673024773597... |
func ApplyConfigMapHash(c client.Client, pod *corev1.PodTemplateSpec, annotationName string, namespace string, configMapName string, keys ...string) error {
cm := &corev1.ConfigMap{}
// fetch secret
if err := c.Get(context.Background(), client.ObjectKey{Namespace: namespace, Name: configMapName}, cm); err != nil ... | [
-0.4919690787792206,
-0.4119552969932556,
0.4603135585784912,
0.04602034017443657,
0.006173786707222462,
0.2939831614494324,
-0.6720654368400574,
0.5550104379653931,
-0.46208006143569946,
0.45267945528030396,
-0.6521568298339844,
0.04913236200809479,
-0.6333889365196228,
0.4093183577060699... |
func ApplySecretHash(c client.Client, pod *corev1.PodTemplateSpec, annotationName string, namespace string, secretName string, keys ...string) error {
secret := &corev1.Secret{}
// fetch secret
if err := c.Get(context.Background(), client.ObjectKey{Namespace: namespace, Name: secretName}, secret); err != nil {
... | [
0.547796368598938,
-0.22824887931346893,
0.6344146132469177,
0.2117740362882614,
0.1237252876162529,
0.48083069920539856,
-0.8543553948402405,
0.1786697506904602,
-0.38811546564102173,
0.3430890738964081,
-0.6467036604881287,
0.4925141930580139,
0.05700846016407013,
0.3320566415786743,
1... |
func ReadOrder(ctx context.Context, id string) (*Order, error) {
const uri = "/api/orders/{id}"
resp, err := Request(ctx).SetPathParams(map[string]string{
"id": id,
}).Get(uri)
if err != nil {
return nil, err
}
var order Order
if err := UnmarshalResponse(resp, &order); err != nil {
return nil, err
}
re... | [
-0.9216406345367432,
-0.4177606999874115,
0.1687277853488922,
0.1566336452960968,
0.14668118953704834,
-0.4812794029712677,
-1.3683462142944336,
-0.4597301781177521,
0.20676569640636444,
-0.4643530547618866,
0.23131918907165527,
0.6072981357574463,
-0.4996773302555084,
-0.04533421620726585... |
func compare(t *testing.T, have, want []string) {
wantMap := make(map[string]bool)
for _, w := range want {
wantMap[w] = true
}
for _, h := range have {
if !wantMap[h] {
t.Errorf("Extracted extra value: have: %v, want: %v", h, nil)
}
delete(wantMap, h)
}
for w := range wantMap {
t.Errorf("Failed ... | [
-0.20155178010463715,
-0.18273572623729706,
0.7519651055335999,
-0.6239904761314392,
-0.09826024621725082,
0.030727867037057877,
-0.7641682028770447,
0.35377636551856995,
-0.43170779943466187,
-0.015054957941174507,
0.360296368598938,
0.5785300731658936,
-0.0638156607747078,
0.550550758838... |
func (mc MssqlController) InitializeMSSQL() {
MSSQLDB.Server = os.Getenv(`MSSQL_SERVER`)
MSSQLDB.DB = os.Getenv(`MSSQL_DATABASE`)
MSSQLDB.Table = os.Getenv(`MSSQL_TABLE`)
MSSQLDB.User = os.Getenv(`MSSQL_USER`)
MSSQLDB.Password = os.Getenv(`MSSQL_PASSWORD`)
dataSourceName := fmt.Sprintf("server=%s;database=%s;user... | [
0.3642965257167816,
-0.01772943139076233,
0.8206111192703247,
0.08272010087966919,
-0.3221367299556732,
0.10042525827884674,
0.25178056955337524,
0.1092243418097496,
0.2531220614910126,
-0.002072051167488098,
-1.1122715473175049,
0.39493870735168457,
0.14287544786930084,
0.8022797703742981... |
func getInsertValues(r *sqlError) (values string) {
values = fmt.Sprintf(
" VALUES ('%s','%s')",
r.Error,
r.CreatedBy)
return values
} | [
-0.10113392770290375,
0.676023006439209,
0.4260641634464264,
-0.35203856229782104,
0.4468850791454315,
-0.7108245491981506,
-0.25431564450263977,
-0.3273465931415558,
-0.6959837675094604,
0.01759088598191738,
0.4225713908672333,
0.04172880947589874,
-0.40388622879981995,
0.9363877177238464... |
func AuditingPolicyConfig(r types.Resource) map[string]interface{} {
return map[string]interface{}{
tfStorageEndpoint: convert.ToString(r.Properties, armStorageEndpoint),
tfStorageAccountAccessKey: convert.ToString(r.Properties, armStorageAccountAccessKey),
tfStorageAccountAccessKey... | [
0.039389997720718384,
-0.686651885509491,
0.2897191047668457,
-1.212626576423645,
0.09847404062747955,
0.3082399070262909,
-0.4281041622161865,
-0.022406958043575287,
0.23426339030265808,
0.48731541633605957,
-0.1860440969467163,
-0.267027884721756,
0.9445533752441406,
0.5523978471755981,
... |
func main() {
var num = 0// creates num aas int
var total = 0// creates total aas int
var factorial = 0// creates factorial aas int
//factorial := big.NewInt(0) creates big int
fmt.Println("Please Enter a number:")//input number
fmt.Scanf("%d", &num)//scans number
if num <= 0{
fmt.Println("Numb... | [
-0.20280951261520386,
0.29891759157180786,
0.889268159866333,
0.4142119586467743,
-0.33839383721351624,
-0.08345016837120056,
1.2141270637512207,
-0.3751599192619324,
0.2655952274799347,
-0.5999935865402222,
0.14272227883338928,
0.7881922721862793,
0.46981069445610046,
0.345088928937912,
... |
func GetMessageRegistryFile(
c common.Client,
uri string,
) (*MessageRegistryFile, error) {
resp, err := c.Get(uri)
if err != nil {
return nil, err
}
defer resp.Body.Close()
var t MessageRegistryFile
err = json.NewDecoder(resp.Body).Decode(&t)
if err != nil {
return nil, err
}
return &t, nil
} | [
-0.03183010220527649,
0.9988575577735901,
0.43614163994789124,
-0.8781318664550781,
0.3239257037639618,
-0.6184563040733337,
0.7200356125831604,
0.09928126633167267,
-1.3193283081054688,
0.15445619821548462,
-0.1224580705165863,
0.5074107050895691,
-0.9577150940895081,
0.23350661993026733,... |
func ListReferencedMessageRegistryFiles(
c common.Client,
link string,
) ([]*MessageRegistryFile, error) {
var result []*MessageRegistryFile
links, err := common.GetCollection(c, link)
if err != nil {
return result, err
}
collectionError := common.NewCollectionError()
for _, sLink := range links.ItemLinks {
... | [
-0.15309706330299377,
0.3057258427143097,
0.3461248576641083,
-0.6138050556182861,
0.8942442536354065,
-0.6962472200393677,
0.7888466119766235,
0.11526153236627579,
0.0740857869386673,
0.37404218316078186,
-0.15628498792648315,
0.5668032765388489,
-1.0857408046722412,
1.3927743434906006,
... |
func InspectStorageAccount(storageAccountOutputName string, storageContainerOutputName string, resourceGroupOutputName string) func(t *testing.T, output infratests.TerraformOutput) {
return func(t *testing.T, output infratests.TerraformOutput) {
resourceGroupName := output[resourceGroupOutputName].(string)
storage... | [
0.2323066145181656,
-1.2917966842651367,
0.7509211301803589,
0.17789840698242188,
0.37412336468696594,
-0.6970675587654114,
1.4449225664138794,
-0.8519713282585144,
0.5132969617843628,
0.0309589896351099,
0.5745511651039124,
0.6217719316482544,
0.32637614011764526,
0.036150600761175156,
... |
func (o *ValidateCreateServiceCustomServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 204:
result := NewValidateCreateServiceCustomServiceNoContent()
if err := result.readResponse(response, consumer, o.formats); err != nil ... | [
-0.012359757907688618,
-0.9175428748130798,
0.5181227922439575,
0.603446364402771,
0.10719107836484909,
-0.6828057169914246,
0.0075286258943378925,
-0.36983561515808105,
0.3782009780406952,
-0.3633023500442505,
0.5092259049415588,
-0.22497154772281647,
-1.0230547189712524,
0.19560948014259... |
func NewValidateCreateServiceCustomServiceNoContent() *ValidateCreateServiceCustomServiceNoContent {
return &ValidateCreateServiceCustomServiceNoContent{}
} | [
0.915677547454834,
-0.23842906951904297,
-0.017942950129508972,
0.42494091391563416,
-0.8597598075866699,
0.13484551012516022,
-0.12850932776927948,
-1.3233853578567505,
-0.9021314978599548,
-0.982478678226471,
-0.24421145021915436,
-0.7192528247833252,
0.5358170866966248,
0.26864123344421... |
func NewValidateCreateServiceCustomServiceBadRequest() *ValidateCreateServiceCustomServiceBadRequest {
return &ValidateCreateServiceCustomServiceBadRequest{}
} | [
0.29159238934516907,
-0.2384801208972931,
0.5975942015647888,
1.198638916015625,
-0.5610645413398743,
0.36780548095703125,
-0.128859281539917,
-0.7941794395446777,
-0.31308287382125854,
-0.538841187953949,
0.2980303168296814,
-0.046518124639987946,
0.107891745865345,
0.7766335010528564,
... |
func New(maxDelayBetweenHits time.Duration, factors ...Factor) Streaker {
sortFactors(factors)
return Streaker{
MaxDelayBetweenHits: maxDelayBetweenHits,
Factors: factors,
}
} | [
0.34440478682518005,
-0.4456114172935486,
0.3054410517215729,
-0.30545324087142944,
-0.44480669498443604,
0.605114221572876,
-0.4626739025115967,
-0.11641720682382584,
-0.7740748524665833,
-0.8898463249206543,
-0.16860133409500122,
0.4576251804828644,
0.4428481459617615,
0.9083331227302551... |
func (s *Streaker) UpdatedFactor() (value int64) {
return s.Factor(s.Hit())
} | [
-0.40816041827201843,
-0.793350338935852,
0.1753777265548706,
-0.25386685132980347,
-0.8967830538749695,
-0.5028592944145203,
0.4018959701061249,
-0.10434900969266891,
0.1464836746454239,
-0.13055181503295898,
-0.18311749398708344,
0.3772084712982178,
0.3236721456050873,
0.552158772945404,... |
func (s Streaker) Factor(streakDuration time.Duration) (value int64) {
value = 1
for _, f := range s.Factors {
if f.After > streakDuration {
break
}
value = f.Value
}
return value
} | [
-0.3407539129257202,
-0.09668754041194916,
0.544198215007782,
-0.21016019582748413,
-0.8762233257293701,
0.02128898724913597,
0.04437857121229172,
0.0021287822164595127,
-0.1907903552055359,
-0.5176002383232117,
0.6645417213439941,
0.8873030543327332,
-0.1128096953034401,
1.079209327697754... |
func (s *Streaker) Hit() time.Duration {
now := time.Now()
if now.Sub(s.previousHit) > s.MaxDelayBetweenHits {
s.streakStart = now
}
s.previousHit = now
return now.Sub(s.streakStart)
} | [
0.3887571394443512,
0.9257808327674866,
0.48763734102249146,
-0.6908380389213562,
-0.3954760432243347,
0.5892186760902405,
0.8055093288421631,
0.3771032989025116,
-0.9002953171730042,
-0.061792753636837006,
0.7872230410575867,
0.6071977615356445,
-0.5923975110054016,
-0.5255924463272095,
... |
func Start() error {
// start the microbox server
if err := server.Setup(); err != nil {
return err
}
// run a provider setup
return provider.Setup()
} | [
-0.8697248697280884,
0.44624826312065125,
0.18000292778015137,
0.4615202844142914,
0.4170956313610077,
-0.39850735664367676,
0.13135528564453125,
1.0823330879211426,
0.5933758616447449,
0.3040087819099426,
-0.6616559624671936,
0.8834950923919678,
-0.3929827809333801,
0.49984437227249146,
... |
func (c *LocalPredictConsumer) Consume() *comet.PredictParams {
return <- c.Pipe
} | [
-0.21887542307376862,
-0.1974201798439026,
0.33316999673843384,
-0.5206036567687988,
0.03361097723245621,
0.5106178522109985,
0.12704607844352722,
0.3080849051475525,
-1.8908432722091675,
0.05343687906861305,
0.46798065304756165,
0.5997358560562134,
-0.13115905225276947,
1.782956600189209,... |
func (c *LocalResultConsumer) Consume() *comet.PredictResult {
return <- c.Pipe
} | [
0.028478115797042847,
0.028224945068359375,
0.35621577501296997,
-0.5523623824119568,
-0.20899583399295807,
-0.06770044565200806,
0.47155722975730896,
0.004403750412166119,
-1.3744912147521973,
-0.6215683221817017,
0.29067155718803406,
0.17136363685131073,
-0.5739225149154663,
0.8289666771... |
func NewFactory() exporter.Factory {
return exporter.NewFactory(
metadata.Type,
createDefaultConfig,
exporter.WithTraces(createTracesExporter, metadata.TracesStability),
exporter.WithMetrics(createMetricsExporter, metadata.MetricsStability))
} | [
0.6630355715751648,
-0.10031881928443909,
0.2723524868488312,
1.1207256317138672,
0.4310760200023651,
-0.4311821162700653,
0.15476244688034058,
-0.11082714796066284,
0.07683460414409637,
-0.028878845274448395,
0.2622895836830139,
-0.007809746544808149,
-0.03900222107768059,
0.5494921803474... |
func NewPlay(name, desc string, intialSetup Setting) *Play {
rv := Play{
phases: make([]*Phase, 1, 10),
name: name,
description: desc,
}
rv.phases[0] = newPhase(intialSetup)
return &rv
} | [
-0.41607367992401123,
-0.33150288462638855,
0.3916311264038086,
-0.05624721944332123,
0.08440161496400833,
0.03179427236318588,
-0.3989114761352539,
-0.5213403105735779,
0.5774190425872803,
0.8478785753250122,
0.24097703397274017,
0.17424912750720978,
-0.7368398904800415,
-0.44023194909095... |
func (play *Play) Completed() bool {
count := play.PhaseCount()
return play.phases[count-1].active
} | [
-0.9144669771194458,
-0.7565332651138306,
0.7434471249580383,
-0.09208724647760391,
-0.3451715111732483,
-0.05093378946185112,
0.5040512084960938,
-0.17150045931339264,
0.4434300363063812,
0.9334485530853271,
-1.1678569316864014,
-0.583849310874939,
-0.7879102230072021,
-0.4720908999443054... |
func (play Play) CurrPhase() Phase {
iPhase := len(play.phases) - 1
rv := play.phases[iPhase]
return *rv
} | [
-0.9242579340934753,
-1.2513333559036255,
0.36166509985923767,
-0.04227876663208008,
-0.8429918885231018,
-0.1880284547805786,
-0.20161931216716766,
-0.4190981686115265,
0.4884607195854187,
0.6905638575553894,
0.9804830551147461,
0.2621828317642212,
-1.3554705381393433,
0.08258029818534851... |
func (play Play) Description() string {
return play.description
} | [
-0.5439777970314026,
-0.3487741947174072,
0.2542462646961212,
0.8448737859725952,
-0.28775322437286377,
1.0216401815414429,
0.7684678435325623,
-0.7373488545417786,
0.8481464385986328,
0.48891007900238037,
0.41503602266311646,
0.7391644716262817,
-0.779820442199707,
0.02239925041794777,
... |
func (play Play) Name() string {
return play.name
} | [
-0.915003776550293,
-1.0341756343841553,
0.5207042694091797,
0.6309044361114502,
-1.1203128099441528,
0.5894671678543091,
0.9424580335617065,
-1.3312346935272217,
0.22616389393806458,
0.8974020481109619,
-0.36835724115371704,
0.46301236748695374,
-0.15915922820568085,
0.02523401379585266,
... |
func (play Play) PhaseCount() int {
return len(play.phases)
} | [
0.19992952048778534,
-0.5556352734565735,
0.5763745307922363,
-0.5707446336746216,
-0.00797148235142231,
0.26407140493392944,
0.6186179518699646,
1.0411362648010254,
0.46953684091567993,
0.46529579162597656,
-0.5229148864746094,
-0.2553918659687042,
-0.39190706610679626,
0.1669620871543884... |
func (play *Play) Add(order int, threat ...IAction) {
//TODO: order validation
iPhase := len(play.phases) - 1
phase := play.phases[iPhase]
for _, t := range threat {
phase.addThreat(t, order)
}
} | [
-0.8655562996864319,
-0.5391029715538025,
0.4301612377166748,
0.7585682272911072,
1.1806504726409912,
-0.00914539024233818,
-0.1914495974779129,
-0.9392098188400269,
0.7967916131019592,
0.6951316595077515,
-0.29601868987083435,
0.1807500422000885,
-1.0560036897659302,
-0.18162834644317627,... |
func (play *Play) Done() {
count := play.PhaseCount()
play.phases[count-1].active = false
} | [
-0.35566800832748413,
-0.11145962029695511,
0.5913832187652588,
-0.3731262981891632,
0.5355210900306702,
0.8167537450790405,
0.8518714904785156,
-0.36742040514945984,
-0.016332650557160378,
1.0268707275390625,
-0.8773664236068726,
0.0990905687212944,
-1.1036261320114136,
-0.361006796360015... |
func (play Play) GetPhase(phaseNum int) Phase {
//TODO: validate index
rv := play.phases[phaseNum-1]
return *rv
} | [
-1.2102882862091064,
0.11204135417938232,
0.5684384703636169,
0.21891704201698303,
0.5290426015853882,
-1.2423003911972046,
0.4129062294960022,
-0.9668468832969666,
0.9955820441246033,
-0.10081173479557037,
0.44298145174980164,
-0.08393103629350662,
-1.7443500757217407,
-0.2829859852790832... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.