text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (record *RecordTypeSRV) Process(a Answer) {
priority := decodePart(a.Data, 0, 2)
weight := decodePart(a.Data, 2, 4)
port := decodePart(a.Data, 4, 6)
target, _ := decodeQname(a.Data[6:])
record.Priority = priority
record.Weight = weight
record.Port = port
record.Target = target
} | [
-0.3726792633533478,
-0.3077044188976288,
0.47437137365341187,
-0.8997109532356262,
0.05264615640044212,
-0.574435830116272,
-0.318988174200058,
-0.3737539052963257,
0.9369803071022034,
0.24233675003051758,
-0.6891278028488159,
0.5744766592979431,
-0.5208772420883179,
-0.24482512474060059,... |
func (*Secp256k1) String() string { return "Secp256k1" } | [
0.7379221320152283,
-0.859137773513794,
0.19846922159194946,
0.7331540584564209,
-0.5516563057899475,
0.8855675458908081,
0.977201521396637,
-1.0456827878952026,
-0.23864194750785828,
1.1603840589523315,
-0.23114190995693207,
0.3921029269695282,
-0.5199479460716248,
-0.32817956805229187,
... |
func (*Secp256k1) ScalarLen() int { return egScalar.MarshalSize() } | [
0.5646072626113892,
-0.21768413484096527,
0.14687255024909973,
0.6050921082496643,
-0.4787300229072571,
0.03338032588362694,
0.11902247369289398,
0.2549298405647278,
0.9895632863044739,
-0.3190072774887085,
-1.106507658958435,
0.09923386573791504,
0.47639161348342896,
0.48396727442741394,
... |
func (*Secp256k1) Scalar() kyber.Scalar { return newScalar(big.NewInt(0)) } | [
0.7031196355819702,
-0.04998045414686203,
0.2892794907093048,
1.1628764867782593,
-0.5233859419822693,
0.7144113779067993,
0.5330901145935059,
-0.42459893226623535,
-0.0018581049516797066,
-0.9575151801109314,
0.25368422269821167,
0.5393553376197815,
-0.4618457853794098,
1.125890851020813,... |
func (*Secp256k1) PointLen() int { return egPoint.MarshalSize() } | [
0.3131415545940399,
0.3067159056663513,
-0.05664052814245224,
0.5861051678657532,
0.17898689210414886,
0.6330159306526184,
-0.0906854122877121,
0.7775782346725464,
0.743395209312439,
0.20988290011882782,
-0.511139988899231,
-0.5814310312271118,
0.1433519721031189,
0.13297688961029053,
-0... |
func (*Secp256k1) Point() kyber.Point {
return &secp256k1Point{newFieldZero(), newFieldZero()}
} | [
1.3276058435440063,
-0.5303714275360107,
0.1034083366394043,
1.4571304321289062,
0.9764768481254578,
0.5959187746047974,
0.9280303716659546,
-0.2154751718044281,
0.9371790885925293,
-0.5331912040710449,
0.29980313777923584,
-0.1164744570851326,
-1.0627166032791138,
0.41840848326683044,
0... |
func rotate(s []int, o int) {
var z = make([]int, o)
copy(z, s[0:o])
copy(s[0:], s[o:])
copy(s[len(s)-o:], z)
} | [
-0.21361267566680908,
0.3232266306877136,
0.4000767469406128,
-0.026120174676179886,
0.2845743000507355,
-1.4577218294143677,
0.37195926904678345,
-0.43837979435920715,
0.48810943961143494,
0.25388485193252563,
-0.9988362193107605,
0.7658326029777527,
-0.3262596130371094,
-1.87813746929168... |
func rotate2(s []int, o int) {
l := len(s) - 1
for i, j := 0, o; i < l; i++ {
s[i], s[j] = s[j], s[i] // swap i,j
if j < l {
j++
}
}
} | [
-0.4529164433479309,
-0.11299632489681244,
0.632533073425293,
-0.2335706204175949,
-0.3773574233055115,
-1.171443223953247,
0.05322302132844925,
-0.5051587820053101,
0.21225619316101074,
0.5193548798561096,
-0.7597936391830444,
1.0581138134002686,
-0.06260085105895996,
-0.9440858364105225,... |
func NewCatalog() *Catalog {
return &Catalog{}
} | [
0.768847644329071,
-0.20599065721035004,
0.09525274485349655,
0.3681187033653259,
-1.551404595375061,
0.21718959510326385,
0.041133005172014236,
0.2688003182411194,
-0.2316976636648178,
-0.9389441013336182,
0.2510155439376831,
0.8175800442695618,
0.4654218852519989,
-0.05486677959561348,
... |
func OpenCatalog(path string) (*Catalog, error) {
if _, err := os.Stat(path); err != nil {
return nil, err
}
db, err := OpenDB(path)
if err != nil {
return nil, err
}
log.WithFields(log.Fields{
"action": "catalog_open",
"path": path,
"status": "ok",
}).Debug()
cat := &Catalog{
db: db,
}
cat.Pat... | [
-0.15950864553451538,
0.12992902100086212,
0.828341007232666,
-0.7966587543487549,
-1.2929402589797974,
0.3843388557434082,
0.5815660953521729,
0.47992685437202454,
-0.025824788957834244,
-0.19483435153961182,
0.22870510816574097,
0.40099748969078064,
0.26181766390800476,
0.339850634336471... |
func (c *Catalog) Close() error {
if c.db != nil {
if err := c.db.Close(); err != nil {
return err
}
}
if c.previews != nil {
if err := c.previews.Close(); err != nil {
return err
}
}
return nil
} | [
-0.5223392844200134,
0.6577557921409607,
0.4175167381763458,
0.09105444699525833,
-0.3466337025165558,
0.6977936625480652,
-0.22981354594230652,
-0.020636389032006264,
-0.7355652451515198,
-0.27542343735694885,
0.395910382270813,
0.5375098586082458,
-0.5117989182472229,
1.7164974212646484,... |
func (c *Catalog) Load() error {
if _, err := c.GetLenses(); err != nil {
return err
}
if _, err := c.GetCameras(); err != nil {
return err
}
if _, err := c.GetStats(); err != nil {
return err
}
if _, err := c.GetPhotos(); err != nil {
return err
}
if _, err := c.GetCollections(); err != nil {
return... | [
-0.16401667892932892,
-0.12463277578353882,
0.5805076360702515,
-0.6453186869621277,
0.44835731387138367,
0.31183043122291565,
-0.236656054854393,
-0.8517346382141113,
-0.7111348509788513,
0.06023258715867996,
-0.704367458820343,
0.16655755043029785,
-0.5806220769882202,
0.3639576435089111... |
func (c *Catalog) Merge(other *Catalog) {
if other == nil {
return
}
if other.Paths != nil {
c.Paths = append(c.Paths, other.Paths...)
}
if other.Stats != nil {
stats, _ := c.GetStats()
stats.Merge(other.Stats)
}
if other.Cameras != nil {
c.Cameras = c.Cameras.Merge(other.Cameras)
}
if other.Lenses !... | [
-0.5998436212539673,
0.504523754119873,
0.9279659986495972,
0.3002568781375885,
0.47231563925743103,
0.017932362854480743,
-0.486540824174881,
-0.47364431619644165,
0.39871037006378174,
-0.9263094067573547,
-0.9632411599159241,
0.004329504910856485,
-0.3351566791534424,
1.2298227548599243,... |
func (c *Catalog) GetLenses() (NamedObjectList, error) {
if c.Lenses != nil {
return c.Lenses, nil
}
lenses, err := c.db.queryNamedObjects("select id_local, value from AgInternedExifLens")
if err != nil {
return nil, err
}
c.Lenses = lenses
return c.Lenses, nil
} | [
-0.4268191456794739,
-0.19190993905067444,
0.5567238330841064,
-0.08340764045715332,
0.5845755934715271,
-0.40125715732574463,
-0.6530235409736633,
-0.9038288593292236,
1.1297286748886108,
0.7814085483551025,
-0.915882408618927,
0.005761709064245224,
-1.202392816543579,
0.5383094549179077,... |
func (c *Catalog) GetCameras() (NamedObjectList, error) {
if c.Cameras != nil {
return c.Cameras, nil
}
cameras, err := c.db.queryNamedObjects("select id_local, value from AgInternedExifCameraModel")
if err != nil {
return nil, err
}
c.Cameras = cameras
return c.Cameras, nil
} | [
-0.257496178150177,
0.4033227562904358,
0.5725492238998413,
0.7341925501823425,
0.3870905935764313,
-0.3845857083797455,
-0.46136629581451416,
-1.1738030910491943,
0.680165708065033,
0.7564887404441833,
-1.21993887424469,
-0.06664946675300598,
-1.25202214717865,
0.7756813764572144,
0.589... |
func FindCatalogs(paths ...string) []string {
found := make([]string, 0, len(paths))
// For each path in the input
for _, path := range paths {
info, err := os.Stat(path)
if err != nil {
log.WithFields(log.Fields{
"action": "find_catalogs",
"status": "stat_error",
"path": path,
"error": "e... | [
0.29057469964027405,
0.20913031697273254,
0.6511465311050415,
1.2044254541397095,
0.3896969258785248,
0.49920591711997986,
-0.08004367351531982,
-0.3114456534385681,
-0.8591165542602539,
0.24246926605701447,
0.7143040299415588,
-0.32085704803466797,
-0.5871104001998901,
1.2140064239501953,... |
func GetConfig() Config {
var config Config
file := "./config.json"
configFile, err := os.Open(file)
if err != nil {
fmt.Println(err.Error())
}
defer configFile.Close()
jsonParser := json.NewDecoder(configFile)
jsonParser.Decode(&config)
CreateDir(config.DataDir)
return config
} | [
-0.1111321896314621,
-0.1994183510541916,
0.7189955711364746,
-0.09407968819141388,
0.0017361227655783296,
0.4726315140724182,
0.28142768144607544,
1.0206841230392456,
-0.6884772777557373,
-0.2998224198818207,
-0.9251477122306824,
0.3864220380783081,
0.4778171479701996,
0.5165536403656006,... |
func (c *FiscalYear) Table_Name() query.TableName {
return FiscalYear_TableName
} | [
1.1326563358306885,
-0.26101914048194885,
0.3454646170139313,
0.8254605531692505,
-0.21418613195419312,
-0.04479369521141052,
0.24910303950309753,
-0.010107173584401608,
-0.04894585534930229,
-0.13725902140140533,
0.6224780678749084,
-0.8632210493087769,
0.9661371111869812,
-0.053819060325... |
func (c *FiscalYear) Table_Column_Types() map[query.Column]string {
return FiscalYear_Column_Types
} | [
0.16392897069454193,
-0.4897778332233429,
0.39537790417671204,
0.7992936372756958,
0.76006680727005,
-0.10159735381603241,
0.32669004797935486,
-0.6935964822769165,
-0.5436002612113953,
-0.20436660945415497,
-1.1117045879364014,
-0.7610002756118774,
0.7641654014587402,
-0.07110517472028732... |
func (c *FiscalYear) Table_PrimaryKey() query.Column {
return FiscalYear_PrimaryKey
} | [
1.3134188652038574,
-0.04170700162649155,
0.01514396071434021,
0.7028977870941162,
0.44123655557632446,
-0.11467982828617096,
0.9951428174972534,
-0.4953365921974182,
0.5459849238395691,
-0.2088674157857895,
0.9012609720230103,
-0.9930027723312378,
0.679692804813385,
-0.09076610207557678,
... |
func (c *FiscalYear) Table_PrimaryKey_Value() int64 {
return c.FiscalYearID
} | [
0.5307709574699402,
-0.2467239499092102,
-0.02610483206808567,
0.39949265122413635,
-0.15765409171581268,
-0.3303724527359009,
0.3727095127105713,
-0.3930776119232178,
0.0004949753056280315,
-0.3315092623233795,
0.8308098316192627,
-0.8448920845985413,
0.3993385136127472,
0.419358670711517... |
func (c *FiscalYear) Table_InsertColumns() []query.Column {
return FiscalYear_InsertColumns
} | [
-0.0007353828405030072,
0.6603640913963318,
0.2920297086238861,
0.1567581444978714,
0.809429407119751,
-0.12983906269073486,
0.8985563516616821,
-0.295616090297699,
-0.21976423263549805,
-0.004727594088762999,
-0.7620307803153992,
-1.0467932224273682,
0.02193683572113514,
-0.59432142972946... |
func (c *FiscalYear) Table_UpdateColumns() []query.Column {
return FiscalYear_UpdateColumns
} | [
-0.26512259244918823,
-0.768962025642395,
0.3962513208389282,
0.550597608089447,
0.26732999086380005,
-0.19410018622875214,
0.3336048722267151,
-0.6975557804107666,
-0.03654470667243004,
0.27447736263275146,
-0.6664464473724365,
-0.32319605350494385,
0.6015483736991882,
-0.8703406453132629... |
func (c *FiscalYear) Table_SchemaName() string {
return FiscalYear_SchemaName
} | [
0.0803070068359375,
-0.283673495054245,
0.36239132285118103,
0.7165140509605408,
-0.5860118269920349,
-0.27694401144981384,
-0.38709723949432373,
0.3669276833534241,
-0.2774910628795624,
0.3713092803955078,
0.3711257874965668,
-0.8032487034797668,
0.9851776957511902,
-0.45083075761795044,
... |
func (c *FiscalYear) FromID(db db.IDB, id int64) (query.IModel, error) {
model := &FiscalYear{}
return model, nil
} | [
0.45274531841278076,
-0.3739742040634155,
-0.0745883509516716,
-0.002369533758610487,
-0.20363204181194305,
0.22285886108875275,
-0.193755641579628,
-0.7406972646713257,
0.4913318455219269,
0.11102640628814697,
-0.1788036972284317,
-0.46939724683761597,
-0.06066909059882164,
0.903258979320... |
func (c *FiscalYear) String() string {
bytes, _ := json.Marshal(c)
return string(bytes)
} | [
0.45655471086502075,
-0.9651883244514465,
0.16343021392822266,
-1.3228957653045654,
-0.30670565366744995,
0.3502720892429352,
-0.3525351285934448,
-1.9661979675292969,
0.1500307023525238,
-0.0877114087343216,
-0.2471345067024231,
0.4951930344104767,
-0.01729595847427845,
-0.129118844866752... |
func (c *FiscalYear) Update(db db.IDB) error {
var e error
var ql string
ql, _ = query.Update(c).
Set(FiscalYear_Column_FiscalYearKey, c.FiscalYearKey).
Set(FiscalYear_Column_Year, c.Year).
Set(FiscalYear_Column_DateFrom, c.DateFrom).
Set(FiscalYear_Column_DateTo, c.DateTo).
Set(FiscalYear_Column_IsDeleted... | [
-0.2870601713657379,
-0.5725913643836975,
0.17766937613487244,
-0.48803606629371643,
-0.057506442070007324,
-0.5296637415885925,
-0.03567563742399216,
-0.7925737500190735,
-0.00036202947376295924,
0.05631526932120323,
-0.02436612732708454,
-0.58575838804245,
-0.1322789192199707,
0.24948456... |
func (c *FiscalYear) Create(db db.IDB) error {
var e error
q := query.Insert(c)
if c.FiscalYearID > 0 {
q.Set(FiscalYear_Column_FiscalYearID, c.FiscalYearID)
}
q.Set(FiscalYear_Column_FiscalYearKey, c.FiscalYearKey)
q.Set(FiscalYear_Column_Year, c.Year)
q.Set(FiscalYear_Column_DateFrom, c.DateFrom)
q.Set(Fi... | [
0.012224085628986359,
0.17602749168872833,
0.4846700131893158,
-0.05069772154092789,
0.35161271691322327,
-0.17188295722007751,
0.20054753124713898,
-0.7832661271095276,
-0.40301045775413513,
-0.3320391774177551,
-0.10705305635929108,
-1.2601683139801025,
-0.1260746568441391,
0.68058764934... |
func (c *FiscalYear) Delete(db db.IDB) error {
var e error
ql, _ := query.Delete(c).
Where(
query.EQ(FiscalYear_Column_FiscalYearID, c.FiscalYearID),
).String()
_, e = db.Exec(ql)
if e != nil {
return fmt.Errorf("FiscalYear.Delete(): %w", e)
}
return e
} | [
0.6702154278755188,
0.13280096650123596,
0.13074876368045807,
0.10882047563791275,
0.4474337697029114,
-0.5641628503799438,
0.09417612105607986,
-0.789612352848053,
0.19941672682762146,
0.18359701335430145,
0.6146901249885559,
-0.7573418021202087,
-0.22561809420585632,
0.6606758832931519,
... |
func (n *Net) InputDim() int {
return n.inputDim
} | [
-0.0021436307579278946,
-0.051002226769924164,
0.46694469451904297,
0.4965035319328308,
-0.6722173690795898,
1.8104183673858643,
1.3096967935562134,
-0.25892820954322815,
0.14526641368865967,
-1.082214593887329,
0.10908403247594833,
0.51470947265625,
-0.8642489910125732,
0.4291166663169861... |
func (n *Net) OutputDim() int {
return n.outputDim
} | [
-0.404193639755249,
-0.3127414286136627,
0.35359808802604675,
0.4110336899757385,
-0.4129701852798462,
0.8830398917198181,
1.2595434188842773,
-0.47564929723739624,
-0.5405072569847107,
-0.7018656730651855,
0.19378714263439178,
-0.27264603972435,
-0.5702084302902222,
-0.05864136666059494,
... |
func (b batchPredictor) NewPredictor() Predictor {
prevOutput, tmpOutput := newPredictMemory(b.neurons)
return predictor{
neurons: b.neurons,
parameters: b.parameters,
tmpOutput: tmpOutput,
prevTmpOutput: prevOutput,
inputDim: b.inputDim,
outputDim: b.outputDim,
}
} | [
0.4818391799926758,
-0.9751710891723633,
0.4319137930870056,
0.3825828731060028,
-1.6991041898727417,
-0.3220108151435852,
-0.5428346991539001,
0.19025152921676636,
-0.7971085906028748,
0.4101809859275818,
0.14342698454856873,
0.5881360769271851,
-0.08437754958868027,
0.3675178289413452,
... |
func (p predictor) PredictBatch(RowMatrix, MutableRowMatrix) (MutableRowMatrix, error) {
panic("can't be here")
} | [
-0.007632380351424217,
0.1925174593925476,
0.30115771293640137,
1.0527945756912231,
-0.039675626903772354,
0.4898292124271393,
-0.005962691269814968,
0.2545010447502136,
-0.014891195110976696,
-0.4958820343017578,
0.005906088277697563,
0.5711058974266052,
-0.18651805818080902,
0.2285792529... |
func predict(input []float64, neurons [][]Neuron, parameters [][][]float64, prevTmpOutput, tmpOutput []float64, output []float64) {
nLayers := len(neurons)
if nLayers == 1 {
processLayer(input, neurons[0], parameters[0], output)
return
}
// first layer uses the real input as the input
tmpOutput = tmpOutput[:... | [
0.5511428713798523,
-0.14122086763381958,
0.7723328471183777,
0.22843727469444275,
-0.4019153118133545,
-0.9052358865737915,
0.6850030422210693,
0.23917901515960693,
-0.8333153128623962,
0.4562056064605713,
0.47543615102767944,
-0.3146165907382965,
-0.7044428586959839,
0.41450902819633484,... |
func NewSimpleTrainer(inputDim, outputDim, nHiddenLayers, nNeuronsPerLayer int, finalLayerActivator Activator) (*Trainer, error) {
if inputDim <= 0 {
return nil, errors.New("non-positive input dimension")
}
if outputDim <= 0 {
return nil, errors.New("non-positive output dimension")
}
if inputDim <= 0 {
retur... | [
0.11750059574842453,
-0.2930804491043091,
0.5941340923309326,
0.3671738803386688,
-0.6826720237731934,
-0.6471412181854248,
0.43289437890052795,
0.019355395808815956,
-0.3903503119945526,
-0.2086668312549591,
-0.758881151676178,
-0.405935674905777,
-0.6400167942047119,
0.15863852202892303,... |
func NewTrainer(inputDim, outputDim int, neurons [][]Neuron) (*Trainer, error) {
if len(neurons) == 0 {
return nil, errors.New("net: no neurons given")
}
for i := range neurons {
if len(neurons[i]) == 0 {
return nil, errors.New("net: layer with no neurons")
}
}
// Create the parameters, the number of par... | [
0.05772783234715462,
-0.15073926746845245,
0.632914125919342,
0.2723025977611542,
-0.3489745855331421,
-0.7991265654563904,
0.3407352864742279,
-0.19653896987438202,
-0.5831676721572876,
0.08149784058332443,
0.2835688292980194,
-0.0009813846554607153,
-0.6483170986175537,
0.534209430217742... |
func (s *Trainer) Predictor() Predictor {
return s.Net
} | [
-0.5737879276275635,
0.08270140737295151,
0.2456911951303482,
0.2854042649269104,
-0.6239737868309021,
0.4480668008327484,
0.8926990032196045,
0.26741471886634827,
0.3476882576942444,
-1.3168129920959473,
0.20938780903816223,
-0.44104811549186707,
0.7777441740036011,
-0.014120001345872879,... |
func (p *Pipeline) Err() (err error) {
p.mutex.RLock()
err = p.err
p.mutex.RUnlock()
return err
} | [
-0.0011319207260385156,
-0.1920190304517746,
0.3349432349205017,
0.1629476547241211,
-0.4165400564670563,
0.6349999308586121,
0.27767860889434814,
0.2778077721595764,
-0.4173896014690399,
-0.9987752437591553,
1.086611270904541,
0.3754417598247528,
-0.7653447985649109,
0.14828023314476013,
... |
func (p *Pipeline) SetErr(err error) bool {
p.mutex.Lock()
if p.err == nil {
p.err = err
p.mutex.Unlock()
p.cancel()
return true
}
p.mutex.Unlock()
return false
} | [
0.12916021049022675,
0.16374216973781586,
0.6867005228996277,
0.2115561068058014,
-0.7066922187805176,
0.07291321456432343,
-0.478819876909256,
0.4065386950969696,
-0.24759061634540558,
-0.11751401424407959,
0.16041406989097595,
-0.7495079040527344,
-1.0376365184783936,
0.527085542678833,
... |
func (p *Pipeline) Context() context.Context {
return p.ctx
} | [
0.4849576950073242,
-0.5916433334350586,
0.10109706968069077,
-0.4422641694545746,
0.10149870067834854,
0.793282687664032,
0.16575028002262115,
-0.1764620989561081,
0.3178480565547943,
-0.8610333800315857,
0.10695751011371613,
0.7164067625999451,
-0.01393862348049879,
-0.8826526999473572,
... |
func (p *Pipeline) Cancel() {
p.cancel()
} | [
1.477285385131836,
-0.602594256401062,
0.04339776188135147,
0.1995285600423813,
-0.15339884161949158,
0.8426490426063538,
0.24229036271572113,
0.8065182566642761,
-1.0092724561691284,
0.09935364127159119,
0.48798179626464844,
0.2530251145362854,
0.10523691028356552,
0.17331713438034058,
... |
func (p *Pipeline) Source(source interface{}) {
switch src := source.(type) {
case Source:
p.source = src
default:
p.source = reflectSource(source)
}
} | [
-0.6228253841400146,
1.141922950744629,
0.17476046085357666,
0.44444382190704346,
-0.19042368233203888,
0.6302145719528198,
0.8037180304527283,
0.6565501689910889,
0.688704788684845,
0.20841084420681,
-0.6427109837532043,
0.43190130591392517,
-0.05432126671075821,
0.7938147187232971,
0.1... |
func (p *Pipeline) Add(nodes ...Node) {
for _, node := range nodes {
if l := len(p.nodes); (l == 0) || !p.nodes[l-1].TryMerge(node) {
p.nodes = append(p.nodes, node)
}
}
} | [
-0.9386505484580994,
1.09938383102417,
0.5137638449668884,
-0.22767062485218048,
1.5145996809005737,
0.5459214448928833,
-0.6763378977775574,
0.7273543477058411,
-0.7554721236228943,
0.059588976204395294,
0.4218963086605072,
0.1026381105184555,
-0.7318605780601501,
0.26716920733451843,
-... |
func (p *Pipeline) NofBatches(n int) (nofBatches int) {
if n < 1 {
nofBatches = p.nofBatches
if nofBatches < 1 {
nofBatches = 2 * runtime.GOMAXPROCS(0)
p.nofBatches = nofBatches
}
} else {
nofBatches = n
p.nofBatches = n
}
return
} | [
0.13503199815750122,
1.7315559387207031,
0.4859803318977356,
0.6767558455467224,
0.1707085818052292,
0.34817108511924744,
1.5236995220184326,
0.10823523998260498,
-0.6478340029716492,
-1.2998632192611694,
-1.200083613395691,
-0.29520779848098755,
-1.3329734802246094,
0.5910431742668152,
... |
func (p *Pipeline) SetVariableBatchSize(batchInc, maxBatchSize int) {
p.batchInc = batchInc
p.maxBatchSize = maxBatchSize
} | [
0.2136048525571823,
-0.5352170467376709,
0.22660624980926514,
0.4625075161457062,
-0.5391557216644287,
0.2638476490974426,
-0.7153201699256897,
0.5697333216667175,
-0.918232798576355,
-0.29024389386177063,
-1.7313917875289917,
0.3824051320552826,
-0.031185803934931755,
-0.13050255179405212... |
func (p *Pipeline) RunWithContext(ctx context.Context, cancel context.CancelFunc) {
if p.err != nil {
return
}
p.ctx, p.cancel = ctx, cancel
dataSize := p.source.Prepare(p.ctx)
filteredSize := dataSize
for index := 0; index < len(p.nodes); {
if p.nodes[index].Begin(p, index, &filteredSize) {
index++
} el... | [
0.09307073801755905,
0.2804817855358124,
1.1037529706954956,
-0.4804575741291046,
-0.5543228983879089,
-0.4475824534893036,
0.22276729345321655,
-0.3578334450721741,
0.16219934821128845,
0.4620923399925232,
-0.2096148431301117,
0.7787410020828247,
-0.2925640046596527,
-0.321537047624588,
... |
func (p *Pipeline) Run() {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
p.RunWithContext(ctx, cancel)
} | [
1.040578007698059,
-0.3962450921535492,
0.4898111820220947,
0.06487246602773666,
0.00628907885402441,
0.4998002350330353,
-0.07659009099006653,
0.3382364809513092,
-0.26808664202690125,
0.2487257570028305,
-0.11260157823562622,
0.22339633107185364,
-0.18296381831169128,
-0.2189876437187194... |
func (p *Pipeline) FeedForward(index int, seqNo int, data interface{}) {
if index++; index < len(p.nodes) {
p.nodes[index].Feed(p, index, seqNo, data)
}
} | [
-0.09954908490180969,
0.8709701895713806,
0.29519832134246826,
-0.7904181480407715,
0.1535855084657669,
-0.09168154001235962,
-0.14879725873470306,
-0.19126220047473907,
-0.6937242150306702,
-0.7041102647781372,
0.2306966632604599,
1.0669621229171753,
0.5301608443260193,
-0.272018700838089... |
func (e *basicEvent) Protocol() string {
return e.EventProtocol
} | [
0.4033023715019226,
-0.1344594955444336,
0.18613117933273315,
0.012295782566070557,
0.1417439728975296,
1.3035918474197388,
0.008509603329002857,
-0.10949617624282837,
0.1392105221748352,
-0.035309650003910065,
-0.26969921588897705,
-0.1881307065486908,
-0.2703091502189636,
-0.601166665554... |
func (e *basicEvent) Format() Format {
return e.EventFormat
} | [
0.6517390608787537,
-0.7162184119224548,
0.348621666431427,
0.09053222835063934,
0.5703233480453491,
0.06814097613096237,
-0.01636837236583233,
-0.5308488011360168,
0.9958141446113586,
-0.7145959138870239,
0.727375328540802,
0.29684141278266907,
0.08573845773935318,
0.8259484767913818,
0... |
func (e *basicEvent) SetFormat(f Format) {
e.EventFormat = f
} | [
0.5003229379653931,
-0.44126394391059875,
0.28972092270851135,
0.3412070870399475,
0.14220288395881653,
0.09349231421947479,
-0.2742512822151184,
0.10290446132421494,
0.42141422629356384,
-0.8728213906288147,
-0.08516030013561249,
0.1463063359260559,
0.5163394212722778,
1.1258573532104492,... |
func (e *basicEvent) ID() string {
return e.EventID
} | [
1.037772536277771,
-1.3597708940505981,
0.441192626953125,
0.7757779955863953,
0.41410550475120544,
1.9790691137313843,
-0.10331594944000244,
0.6577162742614746,
1.116006851196289,
-0.16830115020275116,
-0.44794636964797974,
0.19316180050373077,
-0.031731199473142624,
0.40053921937942505,
... |
func (e *basicEvent) Component() string {
return e.Comp
} | [
-0.16535189747810364,
-1.608750581741333,
0.2772478759288788,
-0.2583954930305481,
0.6641618609428406,
1.1783260107040405,
0.771461009979248,
0.2024400681257248,
0.6658371090888977,
-0.5421677827835083,
0.3819882869720459,
-0.15396013855934143,
0.7531124949455261,
-0.3083554208278656,
0.... |
func (e *basicEvent) SetComponent(c string) {
e.Comp = c
} | [
0.6174123883247375,
-0.8435202836990356,
0.23768667876720428,
-0.9893287420272827,
0.6591280102729797,
1.2538084983825684,
1.0813896656036377,
0.9641373157501221,
0.1798265278339386,
-0.5709023475646973,
-0.6182347536087036,
-0.3136433959007263,
0.6134264469146729,
0.4827932119369507,
1.... |
func (e *basicEvent) SetIdentity(i string) {
e.Ident = i
} | [
-0.15304900705814362,
-0.756672203540802,
0.4170478582382202,
0.704872727394104,
1.17548668384552,
1.361838936805725,
0.9494533538818359,
0.45624324679374695,
0.40156736969947815,
0.6403538584709167,
-1.535330891609192,
-0.39443710446357727,
-0.2868875563144684,
0.1854478418827057,
0.866... |
func (e *basicEvent) Identity() string {
return e.Ident
} | [
-0.32027602195739746,
-1.3748635053634644,
0.5550147891044617,
0.8570823669433594,
0.6864737272262573,
1.6980011463165283,
0.3860725164413452,
-0.030643928796052933,
1.0837045907974243,
-0.02733345702290535,
-0.7505989074707031,
-0.411760151386261,
-0.2738057076931,
-0.30512720346450806,
... |
func (e *basicEvent) Target() (string, error) {
if e.Comp == "" {
return "", fmt.Errorf("event is not complete, component has not been set")
}
return fmt.Sprintf("choria.lifecycle.event.%s.%s", e.etype, e.Comp), nil
} | [
-0.19202680885791779,
-0.7012357711791992,
0.5491191744804382,
-0.6311111450195312,
0.5854665040969849,
0.6108298897743225,
-0.06987790018320084,
-0.0067246765829622746,
-0.0064232321456074715,
0.3377009630203247,
0.28757143020629883,
0.13735947012901306,
0.3380410969257355,
-0.73978739976... |
func (e *basicEvent) String() string {
return fmt.Sprintf("[%s] %s: %s", e.etype, e.Ident, e.Component())
} | [
0.4770817458629608,
-1.6098687648773193,
0.5939878225326538,
-0.6557084321975708,
0.3251951038837433,
0.9641975164413452,
-0.3813258707523346,
-0.21345935761928558,
-0.41854795813560486,
-0.008965003304183483,
-0.6007093191146851,
0.5574352145195007,
0.26041337847709656,
-0.765177071094512... |
func (e *basicEvent) Type() Type {
return e.dtype
} | [
0.5667378306388855,
0.1799030601978302,
0.5428688526153564,
0.5147784352302551,
0.7746638655662537,
0.30026862025260925,
0.7466588020324707,
-0.6053116917610168,
0.2878522574901581,
-0.27097174525260925,
-0.3803902566432953,
0.9630321860313416,
-0.11584164202213287,
0.6031317710876465,
0... |
func (e *basicEvent) TypeString() string {
return e.etype
} | [
-0.20444783568382263,
-0.18516068160533905,
0.4554906487464905,
0.20139583945274353,
0.8893110156059265,
1.0443544387817383,
0.22997677326202393,
-0.6953007578849792,
0.17215973138809204,
0.6572494506835938,
0.05407214164733887,
-0.22189375758171082,
-0.2957245409488678,
-0.292385548353195... |
func (e *basicEvent) TimeStamp() time.Time {
return time.Unix(e.Timestamp, 0)
} | [
1.0892056226730347,
0.5346858501434326,
0.4609895944595337,
0.4902401566505432,
1.1519464254379272,
0.40086647868156433,
0.3218686282634735,
0.14915797114372253,
0.443013995885849,
-0.10021685063838959,
-0.35723963379859924,
-0.32609185576438904,
0.6041225790977478,
-0.5064738988876343,
... |
func detectInput() (io.Reader, error) {
stats, err := os.Stdin.Stat()
if err != nil {
return nil, errors.Wrap(err, "file.Stat() in detectInput")
}
if stats.Mode()&os.ModeNamedPipe != 0 {
return os.Stdin, nil
}
if len(flag.Args()) < 1 {
return nil, errors.New("No inputs found")
}
if len(flag.Args()) > 1 {... | [
-0.27370527386665344,
-0.8133845925331116,
1.0942009687423706,
0.5145655870437622,
-0.19147396087646484,
0.8540045022964478,
0.8119530081748962,
0.07154307514429092,
-0.6507698893547058,
-0.36582663655281067,
0.8313946723937988,
-0.05956890806555748,
-1.0014784336090088,
0.2707220315933227... |
func (r *CertificateAuthority_KeyUsage) AWSCloudFormationType() string {
return "AWS::ACMPCA::CertificateAuthority.KeyUsage"
} | [
0.15175388753414154,
0.6051169037818909,
0.289931982755661,
0.12944550812244415,
0.1787130981683731,
-0.10804682224988937,
0.11382550746202469,
-0.40734004974365234,
-0.10706108063459396,
0.09493328630924225,
0.3938620388507843,
0.22681061923503876,
0.30558088421821594,
1.1836895942687988,... |
func IsValidStatus(status string) bool {
return status == StatusRunning ||
status == StatusQueued ||
status == StatusNeedsRetry ||
status == StatusPending ||
status == StatusStopped
} | [
-0.9499632120132446,
-1.0431911945343018,
0.3586300313472748,
0.049369730055332184,
-0.9708905220031738,
0.3372628688812256,
-0.7642393708229065,
0.1838258057832718,
0.906082034111023,
-0.8993862271308899,
-0.989287793636322,
-0.4170141816139221,
-0.07519235461950302,
0.7546565532684326,
... |
func NewRunID(engine *string) (string, error) {
s, err := newUUIDv4()
return fmt.Sprintf("%s-%s", *engine, s[4:]), err
} | [
-0.3195998966693878,
-0.5805482268333435,
0.2691475749015808,
-0.02669607475399971,
-0.7227069139480591,
0.32924383878707886,
-1.2827239036560059,
0.08428765088319778,
-0.2902335226535797,
0.2977868616580963,
-0.11753572523593903,
0.48444247245788574,
-0.47596317529678345,
-0.4445825517177... |
func NewDefinitionID(definition Definition) (string, error) {
uuid4, err := newUUIDv4()
if err != nil {
return "", err
}
return fmt.Sprintf("%s-%s", definition.GroupName, uuid4), nil
} | [
-0.219527930021286,
-0.39475366473197937,
-0.1243666335940361,
0.21302668750286102,
-0.5777443647384644,
-0.18597595393657684,
-0.18788836896419525,
0.25710245966911316,
-0.0687737986445427,
1.117557168006897,
0.15129491686820984,
-0.31916478276252747,
0.07098226249217987,
0.97900772094726... |
func (d *DefinitionExecutionRequest) GetExecutionRequestCommon() *ExecutionRequestCommon {
return d.ExecutionRequestCommon
} | [
-0.5161594748497009,
0.0955154299736023,
0.614234209060669,
0.9766641855239868,
0.027662748470902443,
0.1658002734184265,
0.12879498302936554,
-0.24816171824932098,
-0.6530989408493042,
0.09222448617219925,
1.5306038856506348,
0.37891969084739685,
-0.22000953555107117,
0.5772665739059448,
... |
func (d *DefinitionExecutionRequest) GetExecutionRequestCustom() *ExecutionRequestCustom {
return nil
} | [
-0.18681149184703827,
0.23065108060836792,
0.528734028339386,
0.3247149586677551,
0.12080688774585724,
-0.5957345962524414,
0.4664243757724762,
-0.23029740154743195,
0.14148865640163422,
-0.530113160610199,
0.8842859864234924,
0.7973558902740479,
0.8086168766021729,
0.5530989766120911,
-... |
func (d Definition) GetExecutableID() *string {
return &d.DefinitionID
} | [
1.0902663469314575,
0.36426469683647156,
0.46767657995224,
0.7737241983413696,
-0.043336138129234314,
0.7712658047676086,
0.3680482506752014,
0.5524702072143555,
0.4629833400249481,
-0.011660088784992695,
0.5813038349151611,
0.521917998790741,
0.1473763883113861,
0.8996714949607849,
-0.0... |
func (d Definition) GetExecutableType() *ExecutableType {
t := ExecutableTypeDefinition
return &t
} | [
1.1222217082977295,
0.3067132234573364,
0.36259958148002625,
0.9930571913719177,
0.5896506905555725,
0.011062275618314743,
0.19964444637298584,
0.14321671426296234,
-0.15148857235908508,
-0.28595903515815735,
0.11059998720884323,
0.6545273661613464,
-0.43572062253952026,
0.3893162906169891... |
func (d *Definition) WrappedCommand() (string, error) {
var result bytes.Buffer
if err := CommandTemplate.Execute(&result, d); err != nil {
return "", err
}
return result.String(), nil
} | [
-0.82771897315979,
0.25383642315864563,
0.4011601507663727,
0.003865348407998681,
0.3630562126636505,
-0.11058001965284348,
0.04410267248749733,
-0.467668741941452,
0.15923228859901428,
-0.17544294893741608,
0.029736138880252838,
0.09628215432167053,
0.5708051323890686,
0.5874993205070496,... |
func (d *Definition) IsValid() (bool, []string) {
conditions := []validationCondition{
{len(d.Image) == 0, "string [image] must be specified"},
{len(d.GroupName) == 0, "string [group_name] must be specified"},
{!validGroupName.MatchString(d.GroupName), "Group name can only contain letters, numbers, hyphens, and ... | [
-0.7513000965118408,
-0.13258565962314606,
0.6453753113746643,
-0.16289767622947693,
-0.15898999571800232,
0.0314694307744503,
0.37369227409362793,
0.2849828004837036,
-0.03351319953799248,
0.19238993525505066,
0.08350471407175064,
0.8328438997268677,
-0.17265036702156067,
1.45191848278045... |
func (d *Definition) UpdateWith(other Definition) {
if len(other.Arn) > 0 {
d.Arn = other.Arn
}
if len(other.DefinitionID) > 0 {
d.DefinitionID = other.DefinitionID
}
if len(other.Image) > 0 {
d.Image = other.Image
}
if len(other.GroupName) > 0 {
d.GroupName = other.GroupName
}
if len(other.ContainerNa... | [
-0.451072633266449,
-0.8193594217300415,
0.7222000956535339,
0.14158256351947784,
-0.4722573459148407,
-0.7559102773666382,
-0.5105000138282776,
-0.4563026428222656,
-0.2940010130405426,
0.0019530465360730886,
-0.7133710980415344,
0.004763131961226463,
0.8578110337257385,
1.067432522773742... |
func (d *Run) UpdateWith(other Run) {
if len(other.TaskArn) > 0 {
d.TaskArn = other.TaskArn
}
if len(other.RunID) > 0 {
d.RunID = other.RunID
}
if len(other.DefinitionID) > 0 {
d.DefinitionID = other.DefinitionID
}
if len(other.Alias) > 0 {
d.Alias = other.Alias
}
if len(other.Image) > 0 {
d.Image = ... | [
-0.4305676519870758,
-1.1319363117218018,
0.882075846195221,
0.07170461863279343,
-0.51405930519104,
-0.6193815469741821,
-0.3073204755783081,
-0.7859413623809814,
-0.3119589686393738,
0.055143918842077255,
-0.5857979655265808,
0.5593013167381287,
0.02790410816669464,
1.028995394706726,
... |
func (w *Worker) UpdateWith(other Worker) {
if other.CountPerInstance >= 0 {
w.CountPerInstance = other.CountPerInstance
}
} | [
-0.5398192405700684,
-0.5106298327445984,
0.6587215065956116,
-0.22093382477760315,
-0.686281144618988,
0.47454920411109924,
0.18806926906108856,
-0.9720373153686523,
-0.2759820222854614,
0.313188761472702,
-0.4715176224708557,
-0.10845476388931274,
-0.548500120639801,
0.9768751263618469,
... |
func (e *CloudTrailNotifications) Marshal() ([]byte, error) {
return json.Marshal(e)
} | [
0.6448562145233154,
0.4151251018047333,
0.31071919202804565,
-0.6642748117446899,
0.429311603307724,
0.5680910348892212,
-0.25443369150161743,
-0.4559924304485321,
-0.5691318511962891,
-0.16891805827617645,
-0.8630166053771973,
1.0285661220550537,
0.586778461933136,
0.6892602443695068,
0... |
func (w *Record) Equal(other Record) bool {
return w.EventName == other.EventName && w.EventSource == other.EventSource
} | [
0.20830006897449493,
-0.33561939001083374,
0.5222522020339966,
-0.8031148910522461,
0.010770619846880436,
0.15317390859127045,
-0.10085021704435349,
0.00478845089673996,
-0.2949286997318268,
0.4203391969203949,
-1.3549964427947998,
0.30075350403785706,
-0.47597554326057434,
0.4851607978343... |
func (w *Record) String() string {
return fmt.Sprintf("%s-%s", w.EventSource, w.EventName)
} | [
0.8078819513320923,
-0.6580972075462341,
0.26244476437568665,
-1.206827998161316,
-0.4213187098503113,
0.18828359246253967,
0.3080970048904419,
-0.2742697298526764,
-0.6125509142875671,
-0.029284514486789703,
-0.5258210897445679,
0.9858370423316956,
0.04200059920549393,
-0.339183509349823,... |
func (t TemplateExecutionRequest) GetExecutionRequestCommon() *ExecutionRequestCommon {
return t.ExecutionRequestCommon
} | [
-0.5902285575866699,
-0.21221646666526794,
0.5453352332115173,
0.34189972281455994,
-0.19186799228191376,
0.08672107756137848,
0.44624024629592896,
0.1350906789302826,
-0.9424198269844055,
-0.008523219265043736,
1.210084080696106,
0.1259148120880127,
-0.19864870607852936,
0.669567823410034... |
func (t TemplateExecutionRequest) GetExecutionRequestCustom() *ExecutionRequestCustom {
return &ExecutionRequestCustom{
TemplatePayloadKey: t.TemplatePayload,
}
} | [
-0.3992384374141693,
-0.08327746391296387,
0.2842091917991638,
-0.608433723449707,
-0.6529428958892822,
-0.7548627853393555,
-0.04533639922738075,
-0.15198905766010284,
-0.19616447389125824,
-0.3367271423339844,
0.8662293553352356,
0.7370128631591797,
0.48872682452201843,
0.371898949146270... |
func (t Template) GetExecutableResources() *ExecutableResources {
return &t.ExecutableResources
} | [
0.3393321931362152,
-0.9419052004814148,
0.1790836900472641,
0.38090166449546814,
-0.36621904373168945,
0.07110390812158585,
0.1454056054353714,
0.4250229299068451,
-0.370317280292511,
0.0018201785860583186,
-0.4882080554962158,
-1.1386340856552124,
-0.26405471563339233,
0.0909554064273834... |
func (t Template) GetExecutableCommand(req ExecutionRequest) (string, error) {
var (
err error
result bytes.Buffer
)
// Get the request's custom fields.
customFields := *req.GetExecutionRequestCustom()
executionPayload, ok := customFields[TemplatePayloadKey]
if !ok || executionPayload == nil {
return ""... | [
-0.6650335788726807,
-0.1664137840270996,
0.7800633311271667,
-0.2717440128326416,
-0.14926348626613617,
-0.3521496653556824,
-0.12762780487537384,
-0.22443251311779022,
-0.5677115321159363,
0.22067074477672577,
0.4985389709472656,
-0.1449064165353775,
-0.3795815110206604,
0.19226792454719... |
func (t Template) GetExecutableResourceName() string {
return t.TemplateID
} | [
0.30848032236099243,
-0.8919037580490112,
0.5844709873199463,
-0.2951537072658539,
-0.8977246284484863,
0.3434467911720276,
0.3754758834838867,
0.9227765798568726,
0.14154237508773804,
0.30778414011001587,
0.17434000968933105,
-1.0155463218688965,
-0.012935623526573181,
0.3474441468715668,... |
func NewTemplateID(t Template) (string, error) {
uuid4, err := newUUIDv4()
if err != nil {
return "", err
}
return fmt.Sprintf("tpl-%s", uuid4[4:]), nil
} | [
0.04876783490180969,
-0.600620448589325,
0.2656223177909851,
-0.8623402118682861,
-0.8969698548316956,
0.09636736661195755,
-0.7481124997138977,
0.16977547109127045,
0.6195880174636841,
1.0940645933151245,
-0.43178364634513855,
-0.23319664597511292,
-0.32103487849235535,
0.3731944561004638... |
func (t *Template) IsValid() (bool, []string) {
conditions := []validationCondition{
{len(t.TemplateName) == 0, "string [template_name] must be specified"},
{len(t.Schema) == 0, "schema must be specified"},
{len(t.CommandTemplate) == 0, "string [command_template] must be specified"},
{len(t.Image) == 0, "strin... | [
-0.24118730425834656,
-0.6116352081298828,
0.7035114169120789,
-0.2818392515182495,
-0.2456984966993332,
0.10716717690229416,
-0.005095850210636854,
1.0189088582992554,
0.054794128984212875,
0.25288766622543335,
-0.29763954877853394,
0.5742487907409668,
-0.8211051821708679,
1.2339305877685... |
func NewRootCmd(alauda client.APIClient) *cobra.Command {
rootCmd := &cobra.Command{
Use: "alauda",
Short: "Alauda CLI",
Long: ``,
}
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default: $HOME/.alauda.yml)")
addCommands(rootCmd, alauda)
return rootCmd
} | [
0.7538442015647888,
-0.7032927870750427,
0.4502277970314026,
0.18113957345485687,
0.247794970870018,
0.4413270950317383,
0.24800899624824524,
0.7118610143661499,
0.3106146454811096,
-0.6408581733703613,
0.318912148475647,
0.8950355648994446,
0.36773908138275146,
0.8442316055297852,
1.374... |
func initConfig() {
if cfgFile == "" {
// Use default.
cfgFile = filepath.Join(os.Getenv("HOME"), util.ConfigFileName)
}
viper.SetConfigFile(cfgFile)
viper.AutomaticEnv()
viper.SetDefault(util.SettingServer, util.DefaultAPIServer)
err := viper.ReadInConfig()
if err == nil {
fmt.Println("[alauda] Using c... | [
-0.39276230335235596,
-0.22305724024772644,
0.5150617361068726,
0.6666862964630127,
1.197338342666626,
-0.08326362073421478,
0.8545371890068054,
1.280716896057129,
-1.3396471738815308,
0.858294665813446,
-0.23139214515686035,
-0.09395186603069305,
-0.12851747870445251,
1.1429967880249023,
... |
func IsPwdMatch(user *entities.User, password string) bool {
return utils.Sha(password) == user.Password
} | [
0.1631501466035843,
-0.008308460004627705,
0.5139873027801514,
0.7953910231590271,
-0.5115708708763123,
0.5548862218856812,
-1.113457202911377,
0.037370070815086365,
1.2056951522827148,
-0.16360734403133392,
0.7005971670150757,
0.29317083954811096,
-0.12895917892456055,
0.7390722036361694,... |
func TemplatePathURL(fullPath string) (string, string) {
var templateDirectory string
configData := config.DefaultConfig
if configData.TemplatesDirectory != "" && strings.HasPrefix(fullPath, configData.TemplatesDirectory) {
templateDirectory = configData.TemplatesDirectory
} else {
return "", ""
}
finalPath ... | [
-0.6624284386634827,
-0.2763771712779999,
0.5771275758743286,
-0.18145829439163208,
-0.47607794404029846,
-0.3272453546524048,
1.1694055795669556,
0.918472945690155,
0.5002822875976562,
0.5398637652397156,
-0.6907239556312561,
-0.5147713422775269,
0.19309358298778534,
0.667267918586731,
... |
func (tc *testContext) getHTLC(index int, desc *htlcDesc) (channeldb.HTLC, error) {
signature, err := hex.DecodeString(desc.remoteSigHex)
if err != nil {
return channeldb.HTLC{}, fmt.Errorf(
"Failed to parse serialized signature: %v", err)
}
htlc := tc.htlcs[desc.index]
return channeldb.HTLC{
Signature: ... | [
1.3733903169631958,
-0.12069036066532135,
0.676228404045105,
-0.6701409816741943,
0.0021066905464977026,
-0.30717241764068604,
-0.06480026245117188,
-0.8680107593536377,
-0.0905943438410759,
-0.0868515744805336,
0.2702014744281769,
0.011203940026462078,
-0.33536988496780396,
-0.69876927137... |
func newTestContext() (tc *testContext, err error) {
tc = new(testContext)
const genesisHash = "0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206"
if tc.netParams, err = tc.createNetParams(genesisHash); err != nil {
return
}
const block1Hex = "0000002006226e46111a0b59caaf126043eb5bbf28c34f3a5e33... | [
0.18693828582763672,
-0.582484781742096,
0.7210389971733093,
-0.018813785165548325,
-0.7158003449440002,
-0.5474005937576294,
-0.07137244194746017,
-0.288639098405838,
-0.1891663670539856,
0.07736410200595856,
-0.12807214260101318,
-0.2981012761592865,
-0.04058394581079483,
0.2772297263145... |
func (tc *testContext) createNetParams(genesisHashStr string) (*chaincfg.Params, error) {
params := chaincfg.RegressionNetParams
// Ensure regression net genesis block matches the one listed in BOLT spec.
expectedGenesisHash, err := chainhash.NewHashFromStr(genesisHashStr)
if err != nil {
return nil, err
}
if ... | [
0.3125137686729431,
-0.1793079525232315,
0.2631181478500366,
-0.2735282778739929,
0.6683124899864197,
0.06745236366987228,
-0.6503360271453857,
-0.5924404263496399,
-0.8432871699333191,
0.01271015964448452,
0.01356514822691679,
0.09724713116884232,
-1.0323753356933594,
0.9879814982414246,
... |
func (tc *testContext) extractFundingInput() (*Utxo, *wire.TxOut, error) {
expectedTxHashHex := "fd2105607605d2302994ffea703b09f66b6351816ee737a93e42a841ea20bbad"
expectedTxHash, err := chainhash.NewHashFromStr(expectedTxHashHex)
if err != nil {
return nil, nil, fmt.Errorf("Failed to parse transaction hash: %v", e... | [
0.7411968111991882,
-0.34248146414756775,
0.7899277210235596,
0.20036476850509644,
-0.9050354361534119,
-0.6452918648719788,
0.9922671914100647,
0.030233098194003105,
-0.42096617817878723,
0.6132558584213257,
-0.38255035877227783,
-0.3972114622592926,
-0.06783348321914673,
0.54086941480636... |
func TestCommitmentAndHTLCTransactions(t *testing.T) {
t.Parallel()
tc, err := newTestContext()
if err != nil {
t.Fatal(err)
}
// Generate random some keys that don't actually matter but need to be set.
var (
identityKey *btcec.PublicKey
localDelayBasePoint *btcec.PublicKey
)
generateKeys := []*... | [
0.7830184102058411,
-0.07662724703550339,
0.6375419497489929,
-0.4725131094455719,
0.53634113073349,
-0.15336103737354279,
-0.0007280397112481296,
0.3062703609466553,
-0.5063056945800781,
-0.5212342739105225,
-0.22559255361557007,
-0.08378404378890991,
-0.010647643357515335,
0.404196739196... |
func htlcViewFromHTLCs(htlcs []channeldb.HTLC) *htlcView {
var theHTLCView htlcView
for _, htlc := range htlcs {
paymentDesc := &PaymentDescriptor{
RHash: htlc.RHash,
Timeout: htlc.RefundTimeout,
Amount: htlc.Amt,
}
if htlc.Incoming {
theHTLCView.theirUpdates =
append(theHTLCView.theirUpdates... | [
1.0868661403656006,
-0.5393406748771667,
0.33015331625938416,
-1.1385831832885742,
-0.7858355045318604,
-0.5385992527008057,
-0.816772997379303,
-0.20971906185150146,
0.24204322695732117,
-0.7030149698257446,
0.8771201968193054,
-0.2714895009994507,
0.3218766450881958,
0.643527090549469,
... |
func testSpendValidation(t *testing.T, tweakless bool) {
// We generate a fake output, and the corresponding txin. This output
// doesn't need to exist, as we'll only be validating spending from the
// transaction that references this.
txid, err := chainhash.NewHash(testHdSeed.CloneBytes())
if err != nil {
t.Fat... | [
0.7381248474121094,
0.04567960277199745,
0.624496579170227,
-0.43546295166015625,
0.4297790825366974,
-0.30555373430252075,
0.43334242701530457,
0.529411792755127,
-0.1799669861793518,
-0.05063796415925026,
-0.2249642312526703,
0.3621619641780853,
-0.9462453126907349,
0.5560041666030884,
... |
func TestCommitmentSpendValidation(t *testing.T) {
t.Parallel()
// In the modern network, all channels use the new tweakless format,
// but we also need to support older nodes that want to open channels
// with the legacy format, so we'll test spending in both scenarios.
for _, tweakless := range []bool{true, fal... | [
0.3360586166381836,
0.35924002528190613,
0.46823850274086,
-0.8344166874885559,
0.7602210640907288,
0.4582017958164215,
0.1353743076324463,
-0.025638915598392487,
-0.4818488657474518,
-0.03109554760158062,
-0.5484996438026428,
0.37544241547584534,
-0.8710911273956299,
0.7164315581321716,
... |
func InsertDna(mutant models.Mutant, isMutant bool) error {
_, err := coll.InsertOne(ctx, bson.M{"dna": mutant.Dna, "mutant": isMutant})
if err != nil {
log.Fatal(err.Error())
}
return nil
} | [
-1.045389175415039,
0.8963090181350708,
0.5822180509567261,
0.1529177874326706,
0.7923324108123779,
0.7801825404167175,
-0.09700974076986313,
0.7019011974334717,
0.23170000314712524,
-0.2805803120136261,
-0.33022230863571167,
0.027655499055981636,
-1.548617959022522,
0.6192321181297302,
... |
func GetHumans() int {
var total int
cur, err := coll.Find(context.TODO(), bson.D{})
if err != nil {
log.Fatal(err.Error())
}
for cur.Next(context.TODO()) {
total++
}
return total
} | [
-0.10154539346694946,
1.48759925365448,
0.8834344744682312,
-0.3319355249404907,
0.16067539155483246,
0.22273167967796326,
0.749019205570221,
-0.13108143210411072,
-0.8341771364212036,
-0.20523163676261902,
-0.5652432441711426,
0.3785412907600403,
-0.004795608576387167,
0.7684094309806824,... |
func GetMutants() int {
var total int
cur, err := coll.Find(context.TODO(), bson.D{{"mutant", true}})
if err != nil {
log.Fatal(err.Error())
}
for cur.Next(context.TODO()) {
total++
}
return total
} | [
-0.30403128266334534,
0.43000710010528564,
0.6057853698730469,
-0.2052512913942337,
0.06941027194261551,
-0.6437792778015137,
-0.3109397292137146,
0.1909918636083603,
0.05375806242227554,
-0.037280526012182236,
-0.7067283987998962,
0.25372186303138733,
-0.13397431373596191,
0.3720595538616... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.