text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (m *Win32LobAppRegistryRule) SetOperator(value *Win32LobAppRuleOperator)() {
m.operator = value
} | [
0.03544289246201515,
0.9196613430976868,
0.04234035685658455,
-0.007328544743359089,
-0.3922448456287384,
1.2397547960281372,
1.1224560737609863,
1.0738706588745117,
0.32232698798179626,
0.19616903364658356,
0.17254771292209625,
-0.712694525718689,
-0.19055643677711487,
1.190165638923645,
... |
func (m *Win32LobAppRegistryRule) SetValueName(value *string)() {
m.valueName = value
} | [
-0.3948548436164856,
0.6559040546417236,
0.12486609071493149,
0.5028721690177917,
0.3628150522708893,
0.9479978084564209,
0.733947217464447,
1.4085938930511475,
-0.3262031078338623,
0.9719040989875793,
-0.6181797385215759,
-0.2491273134946823,
-0.04031314328312874,
1.0241667032241821,
0.... |
func (r *Repository) CreateInBatch(db *gorm.DB, i interface{}, batchSize int) error {
return db.Omit(clause.Associations).CreateInBatches(i, batchSize).Error
} | [
0.24886104464530945,
0.17334014177322388,
0.23699182271957397,
0.1351703405380249,
0.05367978662252426,
0.8077349066734314,
0.44166699051856995,
-0.428169846534729,
-0.29344743490219116,
0.03366024047136307,
-0.2755983769893646,
-0.236138716340065,
-0.9432757496833801,
0.3072177469730377,
... |
func (r *Repository) CreateWithAssociation(db *gorm.DB, i interface{}) error {
return db.Session(&gorm.Session{FullSaveAssociations: true}).Save(i).Error
} | [
-0.12794935703277588,
0.13988657295703888,
0.1660507321357727,
0.24048732221126556,
0.3690057396888733,
-0.13736891746520996,
0.6229572892189026,
-0.6995710730552673,
-0.05753389373421669,
1.0963915586471558,
-0.17394040524959564,
-1.4340357780456543,
0.5294324159622192,
0.2448953539133072... |
func (r *Repository) UpdateInBatch(db *gorm.DB, i interface{}, batchSize int) error {
return db.Omit(clause.Associations).CreateInBatches(i, batchSize).Error
} | [
-0.3216954171657562,
-0.36399489641189575,
0.270200252532959,
-0.14932198822498322,
-0.7569156885147095,
0.6602495908737183,
0.3929193615913391,
-0.20197735726833344,
-0.3673461079597473,
0.4775725305080414,
-0.23365843296051025,
0.3166026473045349,
-1.2282938957214355,
0.02014471963047981... |
func (r *Repository) Delete(db *gorm.DB, i interface{}) error {
return db.Omit(clause.Associations).Delete(i).Error
} | [
-0.12688492238521576,
0.9645208120346069,
0.19407658278942108,
0.4324912428855896,
0.6714842319488525,
0.8481072783470154,
0.9383920431137085,
0.09949048608541489,
0.08804268389940262,
1.0675901174545288,
0.3902752101421356,
-0.5802815556526184,
-0.9216070771217346,
-0.21835631132125854,
... |
func (r *Repository) FindOneByIDFullAssociations(db *gorm.DB, id uint64, i interface{}) error {
return r.FindOneObjectByID(db.Preload(clause.Associations), id, i)
} | [
-0.5205792784690857,
0.22153612971305847,
0.5480360388755798,
0.4195203185081482,
-0.0911095067858696,
-0.6414627432823181,
1.2205148935317993,
-1.1652604341506958,
0.08316954225301743,
0.373618483543396,
-0.4616347551345825,
-0.7646820545196533,
-1.0461559295654297,
0.2868211567401886,
... |
func (r *Repository) FindAllByIDs(db *gorm.DB, ids []uint, i interface{}) error {
return db.Where("id in (?)", ids).Find(i).Error
} | [
0.14017148315906525,
0.07732949405908585,
0.21828719973564148,
0.19734229147434235,
0.08592593669891357,
-0.24748069047927856,
-0.2918727397918701,
-0.2943311929702759,
-0.2866964638233185,
0.43181028962135315,
-0.31554117798805237,
-0.0239285659044981,
-0.7500923871994019,
1.1381002664566... |
func (r *Repository) FindAllByStrings(db *gorm.DB, field string, values []string, i interface{}) error {
return db.Where(fmt.Sprintf("%s in (?)", field), values).Find(i).Error
} | [
0.32052114605903625,
-0.23089464008808136,
0.23414623737335205,
-0.16356268525123596,
-0.2089623510837555,
0.4249597191810608,
-0.368588387966156,
-0.3550558388233185,
-1.4180659055709839,
-0.04703066498041153,
0.22230830788612366,
0.19635500013828278,
-1.0275545120239258,
0.83518886566162... |
func (r *Repository) FindAllByField(db *gorm.DB, field string, value interface{}, i interface{}) error {
return db.Where(fmt.Sprintf("%s = ?", field), value).Find(i).Error
} | [
0.39860400557518005,
0.5382397174835205,
0.4071342349052429,
0.39918479323387146,
-0.4143027067184448,
0.39902254939079285,
-0.12272265553474426,
-0.7315548658370972,
-0.986431896686554,
0.7182813286781311,
-0.359285831451416,
-0.15376070141792297,
-0.7487289309501648,
1.2813310623168945,
... |
func (r *Repository) FindAllAndPageInformation(db *gorm.DB, pageForm PageForm, entities interface{}) (*models.PageInformation, error) {
var count int64
db.Model(entities).Count(&count)
if pageForm.GetOrderBy() != "" {
db = db.Order(pageForm.GetOrderBy())
} else if pageForm.GetSort() != "" {
order := pageForm.G... | [
0.12086619436740875,
-0.4631882905960083,
0.7620048522949219,
-0.25594717264175415,
0.05594222620129585,
0.026734398677945137,
-0.6868692636489868,
0.10427016019821167,
-0.28568607568740845,
0.20086821913719177,
0.9500072002410889,
-0.7643358111381531,
0.1451306939125061,
1.496639132499694... |
func AnimateSystem(timePoints []Universe, canvasWidth int, frequency int) []image.Image {
images := make([]image.Image, 0)
for i := range timePoints {
if i%frequency == 0 {
images = append(images, DrawToCanvas(timePoints[i], canvasWidth))
}
}
return images
} | [
-1.0847184658050537,
0.8944326043128967,
0.4584425985813141,
0.37132570147514343,
0.5081995725631714,
-0.42388373613357544,
-0.051948800683021545,
-0.8256769180297852,
0.31727728247642517,
0.06982607394456863,
0.7075545787811279,
0.07737387716770172,
0.21243847906589508,
1.381208896636963,... |
func DrawToCanvas(u Universe, canvasWidth int) image.Image {
c := canvas.CreateNewCanvas(canvasWidth, canvasWidth)
c.SetFillColor(canvas.MakeColor(0, 0, 0))
c.ClearRect(0, 0, canvasWidth, canvasWidth)
c.Fill()
for i, b := range u.bodies {
c.SetFillColor(canvas.MakeColor(b.red, b.green, b.blue))
cx := (b.posit... | [
-1.0284947156906128,
0.4306538701057434,
1.0527981519699097,
-1.2039281129837036,
-0.018008701503276825,
0.7545846700668335,
0.3295188546180725,
-0.8709725737571716,
0.9931606650352478,
-0.4308529794216156,
0.5671432018280029,
0.4501231014728546,
0.4383091330528259,
0.741969108581543,
-0... |
func (Sex) EnumDescriptor() ([]byte, []int) {
return file_proto_user_proto_rawDescGZIP(), []int{0}
} | [
-0.8928692936897278,
0.6043224334716797,
0.5547181367874146,
-0.0024865204468369484,
-0.15587136149406433,
-0.014101209118962288,
0.05981016531586647,
-0.16485483944416046,
0.5394297242164612,
-0.12215197086334229,
-0.8582951426506042,
0.8659161329269409,
0.09283816069364548,
1.11348998546... |
func (*User) Descriptor() ([]byte, []int) {
return file_proto_user_proto_rawDescGZIP(), []int{0}
} | [
-0.9147977828979492,
0.24607057869434357,
0.5006446838378906,
0.6263984441757202,
-0.6478728652000427,
0.07919470965862274,
0.8606312274932861,
0.14444370567798615,
-0.2975478768348694,
-0.9260779619216919,
-1.0853402614593506,
0.08664581179618835,
0.22359634935855865,
0.9124995470046997,
... |
func (*UserList) Descriptor() ([]byte, []int) {
return file_proto_user_proto_rawDescGZIP(), []int{1}
} | [
-0.881655752658844,
0.7443240284919739,
0.2093648463487625,
0.7861437201499939,
-0.3513939082622528,
-0.2886236011981964,
0.471957266330719,
0.8455438017845154,
0.00718144653365016,
0.2278049886226654,
-1.6402041912078857,
0.18167442083358765,
-0.20255997776985168,
1.0127313137054443,
0.... |
func (*GetRequest) Descriptor() ([]byte, []int) {
return file_proto_user_proto_rawDescGZIP(), []int{2}
} | [
-0.9418925046920776,
0.9904913902282715,
0.6871427893638611,
0.6533278822898865,
0.3070124387741089,
-0.23626002669334412,
0.44062694907188416,
-0.04086335003376007,
-0.24241173267364502,
-0.32992613315582275,
-0.4122592806816101,
0.429168164730072,
-0.0435323566198349,
0.02827307581901550... |
func (*CreateRequest) Descriptor() ([]byte, []int) {
return file_proto_user_proto_rawDescGZIP(), []int{3}
} | [
-0.18676607310771942,
0.5514661073684692,
0.5902511477470398,
0.19978336989879608,
0.39038383960723877,
0.11131870746612549,
0.006732781883329153,
-0.0391489639878273,
-0.48144301772117615,
0.35581278800964355,
-0.24615535140037537,
-0.3752977252006531,
-0.34774085879325867,
0.745740532875... |
func (*UpdateRequest) Descriptor() ([]byte, []int) {
return file_proto_user_proto_rawDescGZIP(), []int{4}
} | [
-1.2432866096496582,
0.2278742790222168,
0.6662009954452515,
0.36888107657432556,
-0.32090359926223755,
0.19531461596488953,
0.006362289190292358,
0.014376705512404442,
-0.20787963271141052,
0.5231028199195862,
-0.2550984025001526,
0.38876664638519287,
0.13783250749111176,
0.39832276105880... |
func (app *application) addDefaultData(td *templateData, r *http.Request) *templateData {
if td == nil {
td = &templateData{}
}
td.CurrentYear = time.Now().Year()
// Use the PopString() method to retrieve the value for the "flash" key.
// PopString() also deletes the key and value from the session data, so it
... | [
-0.30525466799736023,
0.5204298496246338,
0.5062781572341919,
0.22015106678009033,
-0.0979151502251625,
0.1924995481967926,
-0.6106908917427063,
-0.3337906002998352,
1.0558937788009644,
-0.9031829833984375,
-0.07120008766651154,
-0.4090924561023712,
0.18291954696178436,
0.8885586261749268,... |
func NewBuilder(t *testing.T, miner address.Address) *Builder {
return NewBuilderWithDeps(t, miner, &FakeStateBuilder{}, &ZeroTimestamper{})
} | [
0.2583703100681305,
0.48376065492630005,
0.15261246263980865,
0.6795989274978638,
-0.8262097239494324,
0.024708636105060577,
0.4575159251689911,
0.3115936517715454,
1.3615399599075317,
-0.8305843472480774,
-0.20785491168498993,
0.39662742614746094,
0.15660768747329712,
1.129333734512329,
... |
func NewBuilderWithDeps(t *testing.T, miner address.Address, sb StateBuilder, stamper TimeStamper) *Builder {
if miner.Empty() {
var err error
miner, err = address.NewSecp256k1Address([]byte("miner"))
require.NoError(t, err)
}
repo := repo.NewInMemoryRepo()
bs := repo.Datastore()
ds := repo.ChainDatastore()... | [
0.047862403094768524,
0.09424776583909988,
0.7228201627731323,
-0.0384950190782547,
-0.5534266233444214,
-0.1377008557319641,
0.35661035776138306,
0.35350990295410156,
0.8687019348144531,
-0.8333821892738342,
-0.14339156448841095,
-0.01820845901966095,
0.10820435732603073,
0.72805094718933... |
func (f *Builder) AppendBlockOnBlocks(ctx context.Context, parents ...*types.BlockHeader) *types.BlockHeader {
var tip *types.TipSet
if len(parents) > 0 {
tip = testhelpers.RequireNewTipSet(f.t, parents...)
}
return f.AppendBlockOn(ctx, tip)
} | [
0.017997700721025467,
-0.3706229031085968,
0.61000657081604,
0.4577193558216095,
-0.7421552538871765,
-0.11133019626140594,
-0.8827667236328125,
-0.6020728349685669,
0.4635137617588043,
-0.18579380214214325,
-0.21733111143112183,
-0.8701468706130981,
-0.7429525256156921,
0.752108633518219,... |
func (f *Builder) AppendBlockOn(ctx context.Context, parent *types.TipSet) *types.BlockHeader {
return f.Build(ctx, parent, 1, nil).At(0)
} | [
0.09339107573032379,
-0.3356645405292511,
0.6755409836769104,
0.17278160154819489,
-0.5550817251205444,
-0.2122204601764679,
-1.400563359260559,
-0.6977153420448303,
-0.15569323301315308,
-0.23072472214698792,
-0.32265087962150574,
-0.4221295118331909,
-0.57227623462677,
0.5223203301429749... |
func (f *Builder) AppendOn(ctx context.Context, parent *types.TipSet, width int) *types.TipSet {
return f.Build(ctx, parent, width, nil)
} | [
-0.1492963284254074,
-0.029617412015795708,
0.47561317682266235,
-0.4211166203022003,
-0.9670693874359131,
-0.2821901738643646,
-0.8261843919754028,
0.05238497257232666,
0.7959073185920715,
-1.1227437257766724,
-0.043033964931964874,
-0.5629559755325317,
-0.42680326104164124,
0.58513039350... |
func (f *Builder) AppendManyBlocksOnBlocks(ctx context.Context, height int, parents ...*types.BlockHeader) *types.BlockHeader {
var tip *types.TipSet
if len(parents) > 0 {
tip = testhelpers.RequireNewTipSet(f.t, parents...)
}
return f.BuildManyOn(ctx, height, tip, nil).At(0)
} | [
-0.01660607010126114,
-0.5893352627754211,
0.6959643363952637,
0.7189317941665649,
-0.9275815486907959,
-0.3601153492927551,
-0.6273894309997559,
-0.723673939704895,
0.5399519205093384,
-0.24926117062568665,
-0.17487871646881104,
-1.0500715970993042,
-0.5624852180480957,
1.1017216444015503... |
func (f *Builder) AppendManyBlocksOn(ctx context.Context, height int, parent *types.TipSet) *types.BlockHeader {
return f.BuildManyOn(ctx, height, parent, nil).At(0)
} | [
0.2668338418006897,
-0.8178548812866211,
0.7860738635063171,
0.37139925360679626,
-0.8029939532279968,
-0.6793922781944275,
-1.0528209209442139,
-1.0103251934051514,
0.04966002330183983,
-0.22191424667835236,
-0.7586091756820679,
-0.8237848281860352,
-0.19430939853191376,
1.226237058639526... |
func (f *Builder) AppendManyOn(ctx context.Context, height int, parent *types.TipSet) *types.TipSet {
return f.BuildManyOn(ctx, height, parent, nil)
} | [
-0.5237162709236145,
0.12698014080524445,
0.6092261672019958,
0.23690682649612427,
-0.7960575222969055,
-0.42841416597366333,
-1.0194742679595947,
-0.19116508960723877,
0.8105648756027222,
-1.5182408094406128,
0.1305662840604782,
-0.4992765486240387,
-0.1319034993648529,
1.2706327438354492... |
func (f *Builder) BuildOnBlock(ctx context.Context, parent *types.BlockHeader, build func(b *BlockBuilder)) *types.BlockHeader {
var tip *types.TipSet
if parent != nil {
tip = testhelpers.RequireNewTipSet(f.t, parent)
}
return f.BuildOneOn(ctx, tip, build).At(0)
} | [
-0.8137062191963196,
-0.3254142999649048,
0.5148667097091675,
0.7509284615516663,
-0.7070043087005615,
-0.42703568935394287,
-0.07165585458278656,
-0.20280130207538605,
-0.10680083930492401,
-0.678717851638794,
-0.05735728144645691,
-0.5426118969917297,
-0.8267261981964111,
0.2650991082191... |
func (f *Builder) BuildOneOn(ctx context.Context, parent *types.TipSet, build func(b *BlockBuilder)) *types.TipSet {
return f.Build(ctx, parent, 1, singleBuilder(build))
} | [
-0.8439372181892395,
-0.42214101552963257,
0.3955172300338745,
0.6104843020439148,
-0.21292097866535187,
-0.24467018246650696,
-0.06431369483470917,
0.38099411129951477,
-0.12179393321275711,
-0.7287664413452148,
-0.42078766226768494,
-0.06612449139356613,
-0.7387629747390747,
0.0015600561... |
func (f *Builder) BuildOn(ctx context.Context, parent *types.TipSet, width int, build func(b *BlockBuilder, i int)) *types.TipSet {
return f.Build(ctx, parent, width, build)
} | [
-0.7055116295814514,
-0.6054035425186157,
0.4792287349700928,
0.4478112757205963,
-0.8057762384414673,
-0.1291733980178833,
-0.04651302471756935,
0.35471639037132263,
-0.14526091516017914,
-0.8471689224243164,
-0.35658833384513855,
-0.3091912567615509,
-0.5165499448776245,
-0.2583548426628... |
func (f *Builder) BuildManyOn(ctx context.Context, height int, parent *types.TipSet, build func(b *BlockBuilder)) *types.TipSet {
require.True(f.t, height > 0, "")
for i := 0; i < height; i++ {
parent = f.Build(ctx, parent, 1, singleBuilder(build))
}
return parent
} | [
-1.0897819995880127,
-0.12183339893817902,
0.6840457320213318,
0.9288768768310547,
-0.43249472975730896,
-0.4213084280490875,
-0.049944620579481125,
-0.036403317004442215,
-0.08232282102108002,
-1.2128242254257202,
-0.0398399643599987,
-0.4747384488582611,
-0.3601541519165039,
0.4456149041... |
func (f *Builder) Build(ctx context.Context, parent *types.TipSet, width int, build func(b *BlockBuilder, i int)) *types.TipSet {
tip := f.BuildOrphaTipset(parent, width, build)
for _, block := range tip.Blocks() {
// add block to cstore
_, err := f.cstore.Put(context.TODO(), block)
require.NoError(f.t, err)
... | [
-1.22049081325531,
-0.6388435959815979,
0.300336629152298,
0.13620691001415253,
0.026173394173383713,
-0.2422751486301422,
0.4784623384475708,
0.32061314582824707,
-0.023874817416071892,
-0.33025893568992615,
0.020535899326205254,
-0.7884679436683655,
0.2615542709827423,
-0.364654570817947... |
func (f *Builder) StateForKey(ctx context.Context, key types.TipSetKey) cid.Cid {
state, found := f.tipStateCids[key.String()]
if found {
return state
}
// No state yet computed for this tip (perhaps because the blocks in it have not previously
// been considered together as a tipset).
tip, err := f.GetTipSet(c... | [
-0.6962090730667114,
-0.07565955072641373,
0.32490217685699463,
-0.05163108557462692,
-0.738153874874115,
-0.6849905252456665,
0.4989132285118103,
-0.8341320753097534,
0.43742576241493225,
-0.16529110074043274,
0.946041464805603,
-1.1489379405975342,
0.09744896739721298,
0.0111056016758084... |
func (f *Builder) GetBlockstoreValue(ctx context.Context, c cid.Cid) (blocks.Block, error) {
return f.bs.Get(ctx, c)
} | [
0.8511523604393005,
0.2893824279308319,
0.2709265649318695,
0.8585140705108643,
-0.4969790577888489,
-0.2342757135629654,
0.08676812052726746,
-0.9508015513420105,
-0.25480833649635315,
-0.5461724996566772,
-0.22180598974227905,
0.7743148803710938,
-0.39195558428764343,
0.00200720457360148... |
func (f *Builder) ComputeState(ctx context.Context, tip *types.TipSet) (cid.Cid, []types.MessageReceipt) {
parentKey := tip.Parents()
// Load the state of the parent tipset and compute the required state (recursively).
prev := f.StateForKey(ctx, parentKey)
blockMsgInfo := f.tipMessages(tip)
state, receipt, err := ... | [
-0.9782698154449463,
0.13925562798976898,
0.3420846462249756,
-0.29894858598709106,
-0.014746039174497128,
-0.6134670972824097,
0.2613872289657593,
0.34934738278388977,
0.8579674959182739,
0.18009932339191437,
0.38752281665802,
-0.4989459812641144,
0.051748234778642654,
0.04291205480694771... |
func (f *Builder) tipMessages(tip *types.TipSet) []types.BlockMessagesInfo {
ctx := context.Background()
var blockMessageInfos []types.BlockMessagesInfo
for i := 0; i < tip.Len(); i++ {
smsgs, blsMsg, err := f.mstore.LoadMetaMessages(ctx, tip.At(i).Messages)
require.NoError(f.t, err)
var sBlsMsg []types.Chain... | [
-0.8115343451499939,
-0.2144400030374527,
0.7002909183502197,
-0.2347162514925003,
-0.187940314412117,
-0.2329883575439453,
0.04664627090096474,
-1.4660080671310425,
0.12490992248058319,
0.37574437260627747,
0.13434718549251556,
-0.3461204469203949,
-0.4830465316772461,
0.789687991142273,
... |
func singleBuilder(build func(b *BlockBuilder)) func(b *BlockBuilder, i int) {
if build == nil {
return nil
}
return func(b *BlockBuilder, i int) { build(b) }
} | [
-0.23380836844444275,
0.3334967792034149,
0.5782380104064941,
1.2868179082870483,
-0.5794246792793274,
0.23368941247463226,
1.4258742332458496,
1.3148826360702515,
0.9360616207122803,
-1.171167254447937,
-0.7808083891868591,
-0.3182697296142578,
-0.7349230051040649,
0.8560255765914917,
0... |
func (bb *BlockBuilder) SetTicket(raw []byte) {
bb.block.Ticket = &types.Ticket{VRFProof: raw}
} | [
0.6384183764457703,
0.6314764618873596,
0.31760093569755554,
0.7780744433403015,
-0.2908397614955902,
0.4015946686267853,
0.8002064824104309,
-0.1974233239889145,
-0.2128758579492569,
-0.7122412919998169,
-0.8285374045372009,
0.5837999582290649,
-0.9908905029296875,
0.7569133043289185,
-... |
func (bb *BlockBuilder) SetTimestamp(timestamp uint64) {
bb.block.Timestamp = timestamp
} | [
0.3623287081718445,
0.7684160470962524,
0.46339014172554016,
1.0729045867919922,
0.6362955570220947,
0.026212383061647415,
0.3763401210308075,
-0.025133561342954636,
0.5810229778289795,
-0.21317294239997864,
-1.1906338930130005,
0.3057611286640167,
-0.30490007996559143,
0.9347964525222778,... |
func (bb *BlockBuilder) IncHeight(nullBlocks abi.ChainEpoch) {
bb.block.Height += nullBlocks
} | [
0.4509305953979492,
0.02121640183031559,
0.4569496512413025,
0.6550778150558472,
0.2681143581867218,
0.11205615103244781,
0.1599091738462448,
-0.12609617412090302,
-0.13446788489818573,
0.19129090011119843,
-1.3559887409210205,
0.21521130204200745,
-1.5723800659179688,
0.10858406871557236,... |
func (bb *BlockBuilder) SetBlockSig(signature crypto.Signature) {
bb.block.BlockSig = &signature
} | [
0.7038326263427734,
0.39761239290237427,
0.406532347202301,
1.156905174255371,
-0.2331087291240692,
0.22796951234340668,
0.022371217608451843,
0.7439082264900208,
-0.5871661901473999,
0.7974877953529358,
-1.7107599973678589,
-0.5392979979515076,
-0.3836008906364441,
1.191659927368164,
-0... |
func (bb *BlockBuilder) AddMessages(secpmsgs []*types.SignedMessage, blsMsgs []*types.Message) {
ctx := context.Background()
meta, err := bb.messages.StoreMessages(ctx, secpmsgs, blsMsgs)
require.NoError(bb.t, err)
bb.block.Messages = meta
} | [
0.12367504835128784,
0.20705202221870422,
0.6193141937255859,
0.7556756734848022,
1.0065617561340332,
0.2831016182899475,
0.10041039437055588,
-0.3496206998825073,
-0.10015001893043518,
-0.020154206082224846,
0.322081059217453,
0.32925036549568176,
-1.6746119260787964,
1.1180695295333862,
... |
func (bb *BlockBuilder) SetStateRoot(root cid.Cid) {
bb.block.ParentStateRoot = root
} | [
0.2808458209037781,
0.006884180009365082,
0.33328044414520264,
0.4755781888961792,
-0.8560710549354553,
0.10385477542877197,
0.2779379189014435,
-0.5683100819587708,
0.6413701176643372,
0.21178245544433594,
-1.1340941190719604,
0.9684361219406128,
-0.7568193674087524,
1.1547753810882568,
... |
func (FakeStateBuilder) ComputeState(prev cid.Cid, blockmsg []types.BlockMessagesInfo) (cid.Cid, []types.MessageReceipt, error) {
receipts := []types.MessageReceipt{}
// Accumulate the cids of the previous state and of all messages in the tipset.
inputs := []cid.Cid{prev}
for _, blockMessages := range blockmsg {
... | [
-0.23368696868419647,
0.06068715453147888,
0.6152281761169434,
-0.25234851241111755,
0.2479783445596695,
-0.8793656229972839,
0.649057924747467,
0.8931847214698792,
0.2892940044403076,
0.6102847456932068,
0.4441654682159424,
-0.0410250723361969,
-0.8228572010993958,
0.5067188739776611,
-... |
func (FakeStateBuilder) Weigh(context context.Context, tip *types.TipSet) (big.Int, error) {
parentWeight := big.Zero()
if tip.Defined() {
parentWeight = tip.ParentWeight()
}
return big.Add(parentWeight, big.NewInt(int64(tip.Len()))), nil
} | [
-0.7764739990234375,
0.30677834153175354,
0.5377511382102966,
-0.049449704587459564,
-0.19845709204673767,
-0.3688192069530487,
0.3358323872089386,
-0.6068596839904785,
0.2110176682472229,
-0.1611814647912979,
-0.28773948550224304,
-1.0631096363067627,
-0.4451304078102112,
0.83571004867553... |
func (zt *ZeroTimestamper) Stamp(height abi.ChainEpoch) uint64 {
return uint64(0)
} | [
-0.4090312421321869,
-0.2385387420654297,
0.2611163258552551,
0.2929234206676483,
0.3431675136089325,
-0.259768545627594,
0.17237775027751923,
-0.27697041630744934,
0.521025538444519,
-0.634881317615509,
-0.9955781102180481,
0.10979467630386353,
-0.661242663860321,
0.8088995218276978,
-0... |
func NewClockTimestamper(chainClock clock.ChainEpochClock) *ClockTimestamper {
return &ClockTimestamper{
c: chainClock,
}
} | [
-0.4239167869091034,
0.009673023596405983,
0.3851648271083832,
-0.1518639326095581,
-0.37854135036468506,
-0.9348021745681763,
-0.4507266879081726,
-0.5352061986923218,
0.8920925855636597,
0.8789881467819214,
-1.4036009311676025,
0.05909654498100281,
-0.6408148407936096,
1.013662576675415,... |
func (ct *ClockTimestamper) Stamp(height abi.ChainEpoch) uint64 {
startTime := ct.c.StartTimeOfEpoch(height)
return uint64(startTime.Unix())
} | [
-0.496300607919693,
0.24666652083396912,
0.2730556130409241,
0.06249520555138588,
-0.15101726353168488,
-0.4601263403892517,
0.1010141670703888,
-0.6833075284957886,
0.4202728271484375,
0.042188938707113266,
-1.4461030960083008,
0.3701736330986023,
-0.8008632659912109,
0.4062088131904602,
... |
func (e *FakeStateEvaluator) RunStateTransition(ctx context.Context, ts *types.TipSet, cb vm.ExecCallBack, vmTracing bool) (rootCid cid.Cid, receiptCid cid.Cid, err error) {
key := ts.Key()
e.stLk.Lock()
workingCh, exist := e.ChsWorkingOn[key]
if exist {
e.stLk.Unlock()
select {
case <-workingCh:
e.stLk.L... | [
-1.0013525485992432,
-0.4398505389690399,
0.8648099899291992,
-0.3955003023147583,
-0.04430946335196495,
-0.4320111572742462,
0.2271745353937149,
0.17177152633666992,
0.27420637011528015,
0.16216568648815155,
-0.06168616935610771,
0.2791650593280792,
0.005452883895486593,
0.364665597677230... |
func (e *FakeChainSelector) IsHeavier(ctx context.Context, a, b *types.TipSet) (bool, error) {
aw, err := e.Weigh(ctx, a)
if err != nil {
return false, err
}
bw, err := e.Weigh(ctx, b)
if err != nil {
return false, err
}
return aw.GreaterThan(bw), nil
} | [
-0.7277188897132874,
-0.31137803196907043,
0.7432417273521423,
-0.30550044775009155,
1.5864139795303345,
-0.46293559670448303,
-0.8704808354377747,
-1.494988203048706,
-0.2359193116426468,
-0.006044390611350536,
0.16385644674301147,
0.8799108266830444,
0.09619691222906113,
0.09283534437417... |
func (e *FakeChainSelector) Weight(ctx context.Context, ts *types.TipSet) (big.Int, error) {
return e.Weigh(ctx, ts)
} | [
-1.026833415031433,
-0.2727111577987671,
0.2987658977508545,
-0.13454245030879974,
1.2429105043411255,
-0.1771053820848465,
0.2449447214603424,
-0.8602485060691833,
0.07144036144018173,
0.34808942675590515,
-0.031818076968193054,
-0.23115059733390808,
0.034666985273361206,
0.17465129494667... |
func (f *Builder) GetBlock(ctx context.Context, c cid.Cid) (*types.BlockHeader, error) {
var block types.BlockHeader
if err := f.cstore.Get(ctx, c, &block); err != nil {
return nil, err
}
return &block, nil
} | [
0.36846020817756653,
1.003594160079956,
0.5134606957435608,
0.9266611933708191,
0.605245053768158,
0.19959846138954163,
0.12005718797445297,
-1.0453871488571167,
0.28809601068496704,
-0.36028215289115906,
0.02160702832043171,
0.1635802686214447,
-0.6211663484573364,
-0.2685036361217499,
... |
func (f *Builder) GetBlocksByIds(ctx context.Context, cids []cid.Cid) ([]*types.BlockHeader, error) {
ret := make([]*types.BlockHeader, len(cids))
for i, c := range cids {
var block types.BlockHeader
if err := f.cstore.Get(ctx, c, &block); err != nil {
return nil, err
}
ret[i] = &block
}
return ret, nil
... | [
-0.08217720687389374,
-0.051259808242321014,
0.31246131658554077,
0.6009352207183838,
0.3796667456626892,
-0.7933610081672668,
-0.20449517667293549,
-1.4764105081558228,
-0.3243326246738434,
0.11948996037244797,
-0.7359166741371155,
-0.2597196400165558,
-1.0755155086517334,
-0.150965139269... |
func (f *Builder) GetTipSet(ctx context.Context, key types.TipSetKey) (*types.TipSet, error) {
var blocks []*types.BlockHeader
for _, bid := range key.Cids() {
var blk types.BlockHeader
if err := f.cstore.Get(ctx, bid, &blk); err != nil {
return nil, fmt.Errorf("no block %s", bid)
}
blocks = append(blocks,... | [
-0.7591098546981812,
-0.1877327263355255,
0.4305655360221863,
-0.15949416160583496,
0.174430713057518,
-0.6728879809379578,
-0.29251036047935486,
-0.6883431077003479,
-0.24094320833683014,
0.07461564242839813,
0.34497711062431335,
0.03272801265120506,
-0.3688350021839142,
-0.25642672181129... |
func (f *Builder) FetchTipSets(ctx context.Context, key types.TipSetKey, from peer.ID, done func(t *types.TipSet) (bool, error)) ([]*types.TipSet, error) {
var tips []*types.TipSet
for {
tip, err := f.GetTipSet(ctx, key)
if err != nil {
return nil, err
}
tips = append(tips, tip)
ok, err := done(tip)
if... | [
-1.111547827720642,
0.16773609817028046,
0.5967932939529419,
0.16217555105686188,
-0.47296544909477234,
0.4400230348110199,
-0.34653061628341675,
-0.7893071174621582,
-0.03257233649492264,
0.42269912362098694,
0.20869658887386322,
-0.18872259557247162,
0.22743836045265198,
0.31683358550071... |
func (f *Builder) FetchTipSetHeaders(ctx context.Context, key types.TipSetKey, from peer.ID, done func(t *types.TipSet) (bool, error)) ([]*types.TipSet, error) {
return f.FetchTipSets(ctx, key, from, done)
} | [
-1.4413797855377197,
-0.46793192625045776,
0.4027276337146759,
0.028356317430734634,
-0.3238391578197479,
0.36851242184638977,
-0.5354129672050476,
-1.1878701448440552,
0.008793426677584648,
0.1520678699016571,
0.3067178428173065,
-0.35891926288604736,
0.1523316353559494,
-0.50196057558059... |
func (f *Builder) GetTipSetStateRoot(key types.TipSetKey) (cid.Cid, error) {
found, ok := f.tipStateCids[key.String()]
if !ok {
return cid.Undef, errors.Errorf("no state for %s", key)
}
return found, nil
} | [
-0.3129052221775055,
-0.8281408548355103,
0.20494922995567322,
-0.15439185500144958,
-0.14841465651988983,
-0.6356275081634521,
0.2971675992012024,
-0.7122465968132019,
0.2585883140563965,
0.16581527888774872,
1.0022047758102417,
0.2890978753566742,
-0.1634366810321808,
-0.0488639771938324... |
func (f *Builder) RequireTipSet(ctx context.Context, key types.TipSetKey) *types.TipSet {
tip, err := f.GetTipSet(ctx, key)
require.NoError(f.t, err)
return tip
} | [
-1.2802720069885254,
-0.270897775888443,
0.398139625787735,
-0.21701683104038239,
-0.9493239521980286,
0.24239185452461243,
-0.02127675898373127,
-0.6302313208580017,
0.20391641557216644,
-0.1451365202665329,
0.4101562201976776,
-0.08504465222358704,
-0.5138705372810364,
0.2126568257808685... |
func (f *Builder) RequireTipSets(ctx context.Context, head types.TipSetKey, count int) []*types.TipSet {
var tips []*types.TipSet
for i := 0; i < count; i++ {
tip := f.RequireTipSet(ctx, head)
tips = append(tips, tip)
head = tip.Parents()
}
return tips
} | [
-1.4677101373672485,
-0.09169625490903854,
0.506905198097229,
0.540798544883728,
-0.8538029193878174,
0.5230951905250549,
0.14092837274074554,
-1.1982080936431885,
0.14370045065879822,
-0.33271193504333496,
-0.034633904695510864,
-0.3555715084075928,
-0.34911856055259705,
0.76390540599823,... |
func (f *Builder) LoadReceipts(ctx context.Context, c cid.Cid) ([]types.MessageReceipt, error) {
return f.mstore.LoadReceipts(ctx, c)
} | [
0.3405393064022064,
0.9101806879043579,
0.33897796273231506,
0.046671874821186066,
-0.41273561120033264,
-0.6139761805534363,
0.2433009296655655,
0.23305679857730865,
0.9952899217605591,
-0.30222517251968384,
-0.23082856833934784,
-0.710666835308075,
-0.27766358852386475,
0.425513952970504... |
func (f *Builder) LoadTxMeta(ctx context.Context, metaCid cid.Cid) (types.MessageRoot, error) {
return f.mstore.LoadTxMeta(ctx, metaCid)
} | [
0.5519213676452637,
0.5482098460197449,
0.3232998847961426,
0.03952817618846893,
-0.5577741861343384,
-0.6721130609512329,
0.26557016372680664,
-0.46528109908103943,
0.3462406396865845,
0.5991043448448181,
-0.12058915197849274,
-0.014223163016140461,
-0.7576568126678467,
0.0217805039137601... |
func (f *Builder) StoreReceipts(ctx context.Context, receipts []types.MessageReceipt) (cid.Cid, error) {
return f.mstore.StoreReceipts(ctx, receipts)
} | [
-0.0752323716878891,
0.26494452357292175,
0.21510407328605652,
0.2013544738292694,
-0.41575708985328674,
0.34199875593185425,
0.8216057419776917,
-0.18720503151416779,
1.2536205053329468,
-1.1769518852233887,
-0.2325243055820465,
-0.793312132358551,
-0.42601877450942993,
-0.396341621875762... |
func (f *Builder) StoreTxMeta(ctx context.Context, meta types.MessageRoot) (cid.Cid, error) {
return f.mstore.StoreTxMeta(ctx, meta)
} | [
0.23182512819766998,
-0.10841033607721329,
0.19778893887996674,
0.0392511822283268,
-0.5440624356269836,
-0.04083220288157463,
0.6884284615516663,
-0.21146883070468903,
0.10398972779512405,
0.024800650775432587,
-0.39880597591400146,
0.025513717904686928,
-1.008294701576233,
-0.61895054578... |
func (f *Builder) LoadMetaMessages(ctx context.Context, metaCid cid.Cid) ([]*types.SignedMessage, []*types.Message, error) {
return f.mstore.LoadMetaMessages(ctx, metaCid)
} | [
-0.2222238928079605,
0.0035472200252115726,
0.3563588261604309,
0.2273644506931305,
-0.5150565505027771,
-0.45125460624694824,
-0.007895177230238914,
-0.4440338611602783,
1.1004080772399902,
0.5266320109367371,
-0.7182371020317078,
-0.7249783873558044,
-0.8923729062080383,
0.59573668241500... |
func Abs(x int) int {
if x < 0 {
return -x
}
return x
} | [
-1.0961229801177979,
0.16803443431854248,
0.3248300552368164,
-0.18877452611923218,
-0.7153193354606628,
1.065349817276001,
-1.297670602798462,
-0.5553025007247925,
-0.3668280839920044,
-0.5725286602973938,
0.22804827988147736,
1.0209152698516846,
0.7503883242607117,
0.18345056474208832,
... |
func PrintArray(a *[]int) {
var i int
for i < len(*a) {
fmt.Printf("%v\t", (*a)[i])
i++
}
fmt.Printf("\n")
} | [
-0.5110690593719482,
-0.6715813875198364,
0.47143322229385376,
-0.646498441696167,
0.412165105342865,
0.39935144782066345,
-0.07765797525644302,
-0.08808580040931702,
-0.2687034010887146,
0.6553260684013367,
0.38963913917541504,
1.1664199829101562,
-0.08370713889598846,
1.3145461082458496,... |
func PrintArr(a []interface{}) {
var i int
for i < len(a) {
fmt.Printf("%v\t", a[i])
i++
}
fmt.Printf("\n")
} | [
-0.09766807407140732,
-0.5538292527198792,
0.4341152012348175,
-0.2560010552406311,
-0.3463209271430969,
0.7614313960075378,
-0.19621549546718597,
0.2090447098016739,
0.12590059638023376,
0.3957149386405945,
0.783583402633667,
0.8215899467468262,
0.46292078495025635,
1.787225604057312,
0... |
func PrintString(a *[]string) {
var i int
for i < len(*a) {
fmt.Printf("%v\t", (*a)[i])
i++
}
fmt.Printf("\n")
} | [
-0.3101564049720764,
-0.3294639587402344,
0.5720804333686829,
-0.5721399784088135,
0.3553028702735901,
0.41309764981269836,
-0.07708767801523209,
-0.06556707620620728,
-0.24566993117332458,
0.3098398447036743,
0.5304213762283325,
0.8883410692214966,
0.9564704895019531,
0.4331117868423462,
... |
func Max(a int, b int) int {
if a >= b {
return a
}
return b
} | [
-0.04341050237417221,
0.626177966594696,
0.29315051436424255,
0.3969419002532959,
-0.36802929639816284,
0.24109172821044922,
-1.3108296394348145,
-0.6920702457427979,
-0.5794469118118286,
0.3412635028362274,
0.4448015093803406,
1.3338794708251953,
-0.05790385231375694,
-0.30391260981559753... |
func Min(a int, b int) int {
if a <= b {
return a
}
return b
} | [
0.21286368370056152,
-0.322722852230072,
0.2785393297672272,
-0.3339882791042328,
-0.9478288888931274,
0.4491688013076782,
-1.0996440649032593,
-1.0791015625,
-0.409716933965683,
-0.20298358798027039,
0.6827148795127869,
1.0163390636444092,
-0.1833474040031433,
-0.24527470767498016,
0.28... |
func Swap(a *[]int, i int, j int) {
temp := (*a)[j]
(*a)[j] = (*a)[i]
(*a)[i] = temp
} | [
-0.9418599009513855,
-0.5805565714836121,
0.38479897379875183,
-0.6741809248924255,
-0.22127829492092133,
0.06244650110602379,
0.4183383584022522,
0.6687185764312744,
-0.05449441820383072,
0.5542700886726379,
-0.3563547730445862,
0.29157087206840515,
0.07893823832273483,
-0.742635071277618... |
func (this *Solution) Reset() []int {
return this.current
} | [
-1.3880223035812378,
-0.2601255774497986,
0.5329238772392273,
0.7308501601219177,
0.7190911173820496,
0.09895849972963333,
1.6175605058670044,
-0.5678802132606506,
-0.3992466330528259,
-0.03949810191988945,
-0.5821191072463989,
1.0753587484359741,
-0.6874311566352844,
-0.48250719904899597,... |
func (this *Solution) Shuffle() []int {
l := len(this.current)
tmp := make([]int, l)
copy(tmp, this.current)
for i:=range this.current{
index := i+rand.Int()%(l-i)
tmp[i], tmp[index] = tmp[index], tmp[i]
}
return tmp
} | [
-1.621227741241455,
-0.24591773748397827,
0.7068905830383301,
-0.7563782930374146,
-0.14708976447582245,
0.4494829475879669,
1.1147159337997437,
-0.10238472372293472,
0.6499189734458923,
-0.5585669875144958,
-0.16067633032798767,
0.16469760239124298,
-0.4928196966648102,
0.1132765635848045... |
func (app *App) ParseConfig(data []byte) *App {
var config AppConfig
err := yaml.Unmarshal(data, &config)
if err != nil {
panic(err)
}
return app.Config(config)
} | [
1.1252983808517456,
-0.15325410664081573,
0.3452962040901184,
0.5781216621398926,
-0.748694121837616,
0.3019925653934479,
-0.38678890466690063,
0.735787570476532,
0.5551862120628357,
0.24737131595611572,
-0.4173480272293091,
-0.3747728168964386,
0.390254408121109,
0.8670141100883484,
0.7... |
func (app *App) ParseConfigFile(filename string) *App {
data, err := ioutil.ReadFile(filename)
if err != nil {
panic(err)
}
return app.ParseConfig(data)
} | [
0.17906454205513,
0.24005740880966187,
0.23643159866333008,
0.8353153467178345,
-0.540826678276062,
0.6714910864830017,
0.17975957691669464,
0.29567641019821167,
-1.3685332536697388,
0.7967489957809448,
-0.24580426514148712,
-0.6721706390380859,
-0.07926888018846512,
0.6709492206573486,
... |
func (orth *Orthotope) Intersects(o *Orthotope) int32 {
inT := int32(0)
outT := int32(math.MaxInt32)
for index, p0 := range o.Point {
p1 := o.Delta[index] + p0
if orth.Delta[index] == 0 {
if orth.Point[index] < p0 || p1 < orth.Point[index] {
return -1
}
} else {
if orth.Delta[index] < 0 {
// ... | [
-0.49284231662750244,
-0.018565326929092407,
0.8912638425827026,
-0.5808103680610657,
-0.23829610645771027,
0.042196277529001236,
1.1349172592163086,
-0.20574598014354706,
-0.18498706817626953,
0.007163542788475752,
0.12926730513572693,
0.029574014246463776,
-0.17668485641479492,
-0.006869... |
func (o *Orthotope) String() string {
return fmt.Sprintf("Point %v, Delta %v", o.Point, o.Delta)
} | [
0.337457537651062,
-1.3481440544128418,
0.32346272468566895,
-0.9215365052223206,
0.21605119109153748,
0.8470293283462524,
0.7301473021507263,
-1.44239342212677,
-0.5639495849609375,
0.7194733023643494,
0.11655621975660324,
-0.10324916243553162,
0.18584489822387695,
-1.2314016819000244,
... |
func connect2Db() *sql.DB {
db, err := sql.Open("sqlite3", "sq3_database.db")
if err != nil {
panic(err)
}
if db == nil {
panic("db nil")
}
CreateTable(db)
return db
} | [
0.2257653921842575,
-0.10696762055158615,
0.6122617721557617,
1.0243884325027466,
-0.6097145676612854,
0.8367211818695068,
-0.028695864602923393,
-0.9108414649963379,
0.47714823484420776,
0.4044605493545532,
0.6705197095870972,
-0.17641983926296234,
0.0629722848534584,
-0.04645399004220962... |
func GetDetailClass(c *gin.Context) {
// Initialize database connection
db := config.DatabaseConn()
// Declare UUID parameters
UuidClassroom := c.Param("UuidClassroom")
// Declare models dto
var detailClassroom dto.Classrooms
// Custom select columns
db.Select("classrooms.uuid_classroom, classrooms.classroom... | [
-0.47013235092163086,
0.2340376228094101,
0.9364426732063293,
0.5058515071868896,
0.48839789628982544,
0.26236629486083984,
0.4840473234653473,
0.5631449818611145,
-0.5440352559089661,
0.2376704066991806,
0.21969661116600037,
-0.04119354486465454,
-0.3722696900367737,
0.8212054967880249,
... |
func CreateNewClass(c *gin.Context) {
// // Initialize database connection
db := config.DatabaseConn()
// Declare parameters
IDClassroom := uuid.Must(uuid.NewV4())
UUIDClassroom := uuid.Must(uuid.NewV4())
ClassroomName := c.Param("ClassroomName")
ClassroomTime := c.Param("ClassroomTime")
Room := c.Param("Room... | [
-1.1230076551437378,
-0.6517328023910522,
0.8961003422737122,
0.7740054726600647,
0.3473089039325714,
0.9153598546981812,
0.3179054856300354,
0.2735521197319031,
-0.8400807976722717,
0.6371524930000305,
-0.3798728287220001,
-0.9515122771263123,
-0.7357694506645203,
1.2098777294158936,
0.... |
func NewProcessor(queue <-chan Job, errorHandler JobErrorHandler, maxLimiterSize int64) *Processor {
p := &Processor{
jobQueue: queue,
jobErrorHandler: errorHandler,
limiter: make(chan empty, maxLimiterSize),
stop: make(chan empty),
}
go p.start()
return p
} | [
-0.4771791398525238,
-0.7207710146903992,
0.39308109879493713,
-0.5969938039779663,
-1.4671038389205933,
-0.3535700738430023,
-0.6339425444602966,
0.51686030626297,
0.3284345269203186,
0.03382928669452667,
-0.2365322858095169,
0.43111923336982727,
-0.40570715069770813,
0.4909372329711914,
... |
func (w Processor) NumWorkers() int64 {
return int64(len(w.limiter))
} | [
-0.34938928484916687,
0.7886000275611877,
0.22273029386997223,
-0.4640049338340759,
-0.004297763109207153,
-0.1094750389456749,
-0.2446485012769699,
0.6606995463371277,
0.432818204164505,
-0.2388821840286255,
-0.8631956577301025,
-0.2649852931499481,
-1.3107913732528687,
0.0873904600739479... |
func (w *Processor) start() {
for {
select {
case job, ok := <-w.jobQueue:
if !ok {
return
}
w.limiter <- empty{}
// Spawn a worker goroutine.
go func() {
if err := job.Run(); err != nil {
w.jobErrorHandler(err)
}
<-w.limiter
}()
case <-w.stop:
return
}
}
} | [
0.16377082467079163,
-0.42536619305610657,
0.5502297282218933,
-0.2433781623840332,
0.28841692209243774,
-0.09833905100822449,
-0.21397875249385834,
0.5768064856529236,
-0.46551138162612915,
0.2827978730201721,
-0.14227552711963654,
0.7016085982322693,
-0.11482441425323486,
0.0801841989159... |
func (w *Processor) Stop() {
close(w.stop)
} | [
-0.8961060643196106,
-0.4021883010864258,
0.21583899855613708,
-0.5502601861953735,
-0.4369789659976959,
0.7437822818756104,
0.3897102177143097,
0.3608922064304352,
-1.1245886087417603,
0.48820310831069946,
0.27012670040130615,
0.6941486597061157,
-0.668289840221405,
0.7212163805961609,
... |
func (c *Command) GenBashCompletionFileV2(filename string, includeDesc bool) error {
outFile, err := os.Create(filename)
if err != nil {
return err
}
defer outFile.Close()
return c.GenBashCompletionV2(outFile, includeDesc)
} | [
1.1605936288833618,
0.037149399518966675,
0.6340072154998779,
0.37027716636657715,
0.32198745012283325,
1.167877435684204,
0.25853559374809265,
0.9208639860153198,
-1.6440178155899048,
-0.5644674897193909,
-0.23289644718170166,
0.020062100142240524,
0.44048526883125305,
1.2366524934768677,... |
func (c *Command) GenBashCompletionV2(w io.Writer, includeDesc bool) error {
return c.genBashCompletion(w, includeDesc)
} | [
0.763465404510498,
-0.3199111819267273,
0.47628387808799744,
0.6598862409591675,
0.011136626824736595,
0.4585917294025421,
0.3415217399597168,
0.6898278594017029,
-0.5873607397079468,
-0.3864315450191498,
-0.336471825838089,
0.48355045914649963,
0.4164257049560547,
1.3262066841125488,
-0... |
func (qiwi *PersonalAPI) newRequest(apiKey, method, spath string, data map[string]interface{}) (req *http.Request, err error) {
var path = APIURL + spath
var body io.Reader
if len(data) > 0 {
s, err := json.Marshal(data)
if err != nil {
return nil, err
}
body = bytes.NewBuffer(s)
}
req, err = ht... | [
-0.7024926543235779,
-0.25789177417755127,
0.8378801941871643,
-0.02738284505903721,
-0.5572253465652466,
-0.2135130912065506,
-1.0603134632110596,
-0.13131992518901825,
0.26725953817367554,
-0.004057826474308968,
0.7930989861488342,
0.5819632411003113,
0.00680645601823926,
-0.025252619758... |
func newPersonalAPIWithHTTPClient(apiKey string, client *http.Client) *PersonalAPI {
qiwi := new(PersonalAPI)
qiwi.httpClient = client
qiwi.apiKey = apiKey
return qiwi
} | [
-0.06103081628680229,
-0.8297402858734131,
0.029843827709555626,
0.2814400792121887,
-1.3759708404541016,
0.10609278827905655,
-0.7582076191902161,
-0.2206137329339981,
0.038420628756284714,
-0.6492866277694702,
-0.5756810307502747,
0.4534820318222046,
-1.0823180675506592,
0.43273219466209... |
func (qiwi *PersonalAPI) sendRequest(apiKey, method, spath string, data map[string]interface{}) (body []byte, err error) {
req, err := qiwi.newRequest(apiKey, method, spath, data)
response, err := qiwi.httpClient.Do(req)
if err != nil && response == nil {
return nil, err
}
body, err = ioutil.ReadAll(respons... | [
-0.8458608984947205,
-0.3455715477466583,
1.010870337486267,
-0.42291203141212463,
-0.5314853191375732,
-0.1960924118757248,
-0.9517534971237183,
-0.8397958874702454,
0.37710651755332947,
0.5388651490211487,
0.4576975107192993,
0.6625441312789917,
-0.5296334624290466,
-0.009608307853341103... |
func NewQueueItemRepositoryMock() repositories.QueueItemRepository {
return &queueItemRepositoryMock{
items: make(map[string][]byte),
}
} | [
-0.9040461778640747,
-0.5134439468383789,
0.007759059313684702,
-0.3475503921508789,
0.4501636028289795,
-0.4891870617866516,
-0.8236891031265259,
0.3657984137535095,
0.26544979214668274,
-0.3678382337093353,
-0.2760164439678192,
-0.5091075301170349,
0.07784205675125122,
-0.660166501998901... |
func (b *Board) Log(content string) {
if b.LogFunc != nil {
b.LogFunc(content)
} else {
fmt.Println(content)
}
} | [
0.7991738319396973,
0.7919239401817322,
0.2275378406047821,
0.5157932639122009,
0.23015327751636505,
-0.41326701641082764,
0.5784915089607239,
0.5108980536460876,
-0.03800434246659279,
-0.4593832194805145,
-0.4724242389202118,
0.5879244208335876,
-0.3096155822277069,
0.36061716079711914,
... |
func LevelToInt(l Level) int {
return int(l) & levelMask
} | [
-0.09341098368167877,
-0.9391322731971741,
0.3094445765018463,
-0.6359309554100037,
-0.2667382061481476,
0.5754806399345398,
0.3295803666114807,
-0.42761239409446716,
-0.7081741094589233,
0.38510704040527344,
-1.4371006488800049,
-0.7164299488067627,
-0.4774746298789978,
0.4690487384796142... |
func L0Sublevel(sublevel int) Level {
if sublevel < 0 {
panic(fmt.Sprintf("invalid L0 sublevel: %d", sublevel))
}
return makeLevel(0, sublevel)
} | [
0.36071619391441345,
-0.1802157163619995,
0.4061790108680725,
-0.5731185078620911,
-1.546700119972229,
0.7841236591339111,
-0.37912389636039734,
-0.08059832453727722,
0.1727997213602066,
-0.7836998105049133,
-0.9301725625991821,
0.31542810797691345,
0.016374168917536736,
0.2481873929500579... |
func NewServer(appSender common.AppSender) *Server {
return &Server{appSender: appSender}
} | [
0.3081647753715515,
-0.8872356414794922,
0.15178529918193817,
0.6617258191108704,
-0.9133672118186951,
0.38163530826568604,
-0.7169663906097412,
-0.4677202105522156,
0.1548345685005188,
-0.14093701541423798,
0.18267270922660828,
0.12336788326501846,
-0.03056243062019348,
1.1075987815856934... |
func GetDoneChannel() *chan os.Signal {
done := make(chan os.Signal, 1)
signal.Notify(done, os.Interrupt)
return &done
} | [
-0.036332760006189346,
0.09511811286211014,
0.7271579504013062,
0.11876792460680008,
0.6931434273719788,
0.5248450636863708,
0.4809054434299469,
-0.5759480595588684,
-0.560309112071991,
-1.0838878154754639,
-0.8200693726539612,
0.5268460512161255,
-0.3226547837257385,
-0.09250349551439285,... |
func Tomorrow() time.Time {
return time.Now().AddDate(0, 0, 1)
} | [
-0.9928059577941895,
0.48509255051612854,
0.45903971791267395,
0.8690259456634521,
-1.092577338218689,
-0.028872866183519363,
-2.0593509674072266,
0.40120208263397217,
0.5826497077941895,
-0.6446039080619812,
0.10557188093662262,
-0.4936186969280243,
-0.29278144240379333,
0.595471858978271... |
func Logger(serviceName string) log.Logger {
lgr := log.NewLogfmtLogger(os.Stderr)
lgr = log.WithPrefix(lgr, "ts", log.DefaultTimestampUTC)
lgr = log.WithPrefix(lgr, "service", serviceName)
return lgr
} | [
-0.02796068973839283,
0.07687579840421677,
0.4428570568561554,
-1.4140567779541016,
-0.6920109391212463,
0.18805424869060516,
-1.6537758111953735,
0.05614768713712692,
-0.06258143484592438,
-0.5532446503639221,
0.8326060771942139,
0.735313892364502,
0.44205841422080994,
1.0624899864196777,... |
func cleanHost(in string) string {
if i := strings.IndexAny(in, " /"); i != -1 {
return in[:i]
}
return in
} | [
-0.4472551643848419,
-0.11079645156860352,
0.6250227093696594,
1.1721752882003784,
-0.339976966381073,
0.7493967413902283,
0.33367180824279785,
0.6510660648345947,
-0.4133307933807373,
0.40644481778144836,
0.15185679495334625,
-0.10195811092853546,
-1.2043064832687378,
-0.6696404814720154,... |
func removeZone(host string) string {
if !strings.HasPrefix(host, "[") {
return host
}
i := strings.LastIndex(host, "]")
if i < 0 {
return host
}
j := strings.LastIndex(host[:i], "%")
if j < 0 {
return host
}
return host[:j] + host[i:]
} | [
-0.7111627459526062,
-0.1490066647529602,
0.7503731846809387,
0.6516764163970947,
-0.6626092195510864,
-0.2783356308937073,
0.8293945789337158,
0.37027788162231445,
0.2137463092803955,
0.8280701041221619,
-0.20409132540225983,
-0.22076748311519623,
-1.709779143333435,
-1.2250192165374756,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.