text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (d *Desync) readChan(wg *sync.WaitGroup) {
defer wg.Done()
for m := range d.q {
go m.send()
}
} | [
-0.7633465528488159,
-0.03968171402812004,
0.4662100076675415,
-0.43029356002807617,
0.5788312554359436,
-0.14521625638008118,
0.13866476714611053,
-0.6484820246696472,
-0.9220110177993774,
-0.3873717486858368,
0.6565996408462524,
0.5004074573516846,
0.06761649996042252,
0.3027316331863403... |
func NewSaver(c DynamoDBPuter) *Saver {
return &Saver{ddb: c}
} | [
-0.6199866533279419,
0.43724778294563293,
0.08953654021024704,
0.461778849363327,
-1.30103600025177,
-0.15853345394134521,
-0.5155064463615417,
-0.24303767085075378,
-1.0681558847427368,
-0.2286839783191681,
-1.1576423645019531,
-1.089019775390625,
-0.03069208189845085,
1.2543576955795288,... |
func (s *Saver) Save(ctx context.Context, shoutout *Shoutout) error {
item, err := dynamodbattribute.MarshalMap(shoutout)
if err != nil {
return fmt.Errorf("failed to marshal shoutout for storage: %s", err)
}
input := &dynamodb.PutItemInput{
Item: item,
TableName: aws.String(os.Getenv("TABLE_NAME")),
}... | [
-0.2081097662448883,
0.5956091284751892,
0.5768227577209473,
0.36708328127861023,
0.29452425241470337,
-0.20886003971099854,
-0.038552410900592804,
0.4986862242221832,
-0.5442693829536438,
0.8815309405326843,
-1.2293064594268799,
-0.241403266787529,
-0.1748589128255844,
0.0787728875875473,... |
func sighandler(sig uint32, info *siginfo, ctxt unsafe.Pointer, gp *g) {
_g_ := getg()
c := &sigctxt{info, ctxt}
if sig == _SIGPROF {
sigprof(uintptr(c.pc()), uintptr(c.sp()), uintptr(c.lr()), gp, _g_.m)
return
}
flags := int32(_SigThrow)
if sig < uint32(len(sigtable)) {
flags = sigtable[sig].flags
}
if... | [
0.6267126202583313,
0.005585839040577412,
0.6931156516075134,
0.18315234780311584,
0.0033630933612585068,
-0.39067691564559937,
0.4864445924758911,
-0.1599060595035553,
0.0818428322672844,
-0.19321368634700775,
0.23846572637557983,
0.3715463876724243,
-0.378724068403244,
0.4649142324924469... |
func testDataTransfer(t *testing.T, opts dataTransferOpts) {
seeder, seederTr := newClientWithTorrent(t, testingConfig(), helloWorldTorrentFile, func(tr *Torrent) {
assert.True(t, tr.haveAll())
require.NoError(t, tr.StartDataTransfer())
})
defer seeder.Close()
//create leechers
leechers := make([]*Client, opts... | [
0.5068655014038086,
-0.23801782727241516,
0.7473891973495483,
-0.46741536259651184,
0.6536777019500732,
0.7360416054725647,
0.6559540629386902,
-0.33505797386169434,
-0.7977620959281921,
-0.3105403780937195,
-0.42311152815818787,
0.08865983784198761,
-0.20936651527881622,
0.741768658161163... |
func TestTrackerAnnouncer(t *testing.T) {
cfg := testingConfig()
cfg.DisableTrackers = false
cfg.BaseDir = ".testdata/utopia"
cl, err := NewClient(cfg)
require.NoError(t, err)
dt := &dummyTracker{
myAddr: localhost + ":8081",
t: t,
//tracker will always respond with the client's ip/port pair
peer: tr... | [
-0.29075464606285095,
0.3786454200744629,
0.7980743050575256,
-0.034778840839862823,
0.6973886489868164,
0.4055805504322052,
0.667754054069519,
0.41379040479660034,
-0.8617265224456787,
-0.05108192563056946,
-0.35658860206604004,
0.07316041737794876,
-0.3295339345932007,
0.6101478934288025... |
func benchmarkTorrentDownload(b *testing.B, filename string, numSeeds int, storage func() storage.Storage) {
require.Greater(b, numSeeds, 0)
cb := func(t *Torrent) {
t.storage = storage()
t.StartDataTransfer()
}
seeders := make([]*Client, numSeeds)
seedAddrs := make([]string, len(seeders))
for i := range seed... | [
0.943205714225769,
-0.1667483001947403,
0.6044802069664001,
-0.8314462304115295,
1.038008451461792,
-0.26895809173583984,
0.8526473045349121,
-0.4981227517127991,
-1.1116626262664795,
0.4901575744152069,
0.3568841516971588,
0.003535160096362233,
-0.1825820505619049,
0.15141655504703522,
... |
func TestHalfOpenConnsLimit(t *testing.T) {
cfg := testingConfig()
cfg.DialTimeout = time.Millisecond
cfg.BaseDir = "./leecher"
cl, err := NewClient(cfg)
tr, err := cl.AddFromFile(helloWorldTorrentFile)
require.NoError(t, err)
tr.StartDataTransfer()
addInvalidPeers := func(invalidAddrPrefix string) {
peers :=... | [
-0.05887115001678467,
-0.07018246501684189,
0.835470974445343,
-0.031988900154829025,
0.4528350532054901,
0.1355033665895462,
-0.3229350447654724,
0.16902491450309753,
0.03976602107286453,
-0.2508702278137207,
-0.19946150481700897,
-0.15876048803329468,
-0.2046651542186737,
-0.282255232334... |
func TestTorrentParallelXported(t *testing.T) {
cfg := testingConfig()
cfg.BaseDir = "./leecher"
cl, err := NewClient(cfg)
defer cl.Close()
tr, err := cl.AddFromFile(helloWorldTorrentFile)
require.NoError(t, err)
require.NoError(t, tr.StartDataTransfer())
//download twice gives error
require.Error(t, tr.StartD... | [
0.8817678689956665,
-0.08247698098421097,
1.0478758811950684,
0.129756897687912,
0.8372112512588501,
1.07277250289917,
-0.07729890942573547,
0.26354095339775085,
-0.5116654634475708,
-0.01781567744910717,
-0.4298348128795624,
-0.2408246099948883,
-0.5291228890419006,
0.03164014592766762,
... |
func testMetadataExtensionMallicious(t *testing.T, uts []*utMetadata) {
seeders := make([]*Client, len(uts))
for i, ut := range uts {
seeders[i] = startClientCustomMetadata(t, ut)
}
cfg := testingConfig()
cfg.BaseDir += "/leecher"
defer os.RemoveAll(cfg.BaseDir)
leecher, err := NewClient(cfg)
require.NoError(... | [
0.6541882753372192,
0.06514289975166321,
0.6561182141304016,
-0.5459854006767273,
0.28293970227241516,
0.6382690072059631,
-0.4838331937789917,
-0.35769662261009216,
-0.17673428356647491,
0.29283252358436584,
-0.009229151532053947,
0.683894157409668,
0.06898880004882812,
0.0565557219088077... |
func (s *Suite) Add(m *Migration) {
if m == nil {
panic("nil migration")
}
if s.Stmts == nil {
s.Stmts = &Stmts{
CreateTableSQL: fmt.Sprintf(`CREATE TABLE IF NOT EXISTS "%s" ( "%s" INTEGER )`, TableName, ColumnName),
SelectVersionSQL: fmt.Sprintf(`SELECT "%s" FROM "%s" LIMIT 1`, ColumnName, TableName),
... | [
-0.8638220429420471,
0.6120297908782959,
0.69698566198349,
0.3796643912792206,
-0.07910408824682236,
0.20406942069530487,
-0.2567630410194397,
0.004043084569275379,
0.40717288851737976,
0.7954474687576294,
-0.20106489956378937,
0.09817671030759811,
-0.0813332125544548,
0.7600775361061096,
... |
func (s *Suite) AddSQL(up, down string) {
s.Add(&Migration{
Up: up,
Down: down,
})
} | [
-0.0657711923122406,
0.7602514624595642,
0.40550345182418823,
1.663497805595398,
-0.57257080078125,
1.2951219081878662,
-0.7227526307106018,
-0.20305705070495605,
0.7539111971855164,
-0.14774276316165924,
0.1519727110862732,
0.033174119889736176,
0.19037096202373505,
0.17226745188236237,
... |
func (s *Suite) Step(db *Db) (int, int, error) {
return s.Run(db, true, 1)
} | [
-1.4528707265853882,
1.4114357233047485,
0.2525057792663574,
0.6552021503448486,
-0.40537893772125244,
-0.1329946219921112,
0.902715265750885,
0.8013398051261902,
-0.46698087453842163,
-0.3586617708206177,
-1.7602308988571167,
-0.008248819969594479,
-0.2277826964855194,
1.379445195198059,
... |
func (s *Suite) Rollback(db *Db) (int, int, error) {
return s.Run(db, false, 1)
} | [
-1.0119962692260742,
0.9284795522689819,
0.5625165104866028,
0.5098875761032104,
0.12737368047237396,
0.4978294372558594,
1.6494373083114624,
1.0761253833770752,
0.022580834105610847,
0.8870291709899902,
-0.5142996311187744,
0.724551796913147,
-0.6597739458084106,
0.4777878522872925,
0.3... |
func (s *Suite) Migrate(db *Db) (int, int, error) {
return s.Run(db, true, math.MaxInt32)
} | [
-1.5141233205795288,
1.594234585762024,
0.5158466696739197,
1.0679389238357544,
0.03730321303009987,
0.2164725810289383,
0.09129726886749268,
-0.7096347808837891,
0.12461967766284943,
0.2220907062292099,
-1.0158637762069702,
-0.18785656988620758,
-0.3131404519081116,
0.8694012761116028,
... |
func (s *Suite) Reset(db *Db) (int, int, error) {
return s.Run(db, false, math.MaxInt32)
} | [
-0.9685189723968506,
1.5762850046157837,
0.32873934507369995,
0.5567110776901245,
0.05158569663763046,
-0.06567256897687912,
0.9799875020980835,
-0.349767804145813,
-0.6132526993751526,
0.44007736444473267,
-1.0508283376693726,
0.7716102004051208,
-0.23469389975070953,
0.40525001287460327,... |
func (s *Suite) Run(db *Db, up bool, maxSteps int) (int, int, error) {
s.mtx.Lock()
defer s.mtx.Unlock()
if l := len(s.Migrations); l == 0 {
return -1, 0, errors.New("cannot run suite, no migrations set")
}
err := db.Query(s.Stmts.CreateTableSQL).Run()
if err != nil {
return -1, 0, err
}
var row struct {
... | [
-1.5204956531524658,
0.6211939454078674,
0.925024688243866,
0.7349279522895813,
-0.6402916312217712,
0.39329174160957336,
0.6950598359107971,
0.8504257202148438,
-0.2706516981124878,
1.0159245729446411,
-0.6996030807495117,
-0.34775134921073914,
-0.6119557023048401,
1.3404101133346558,
-... |
func RequestDeviceAuthorization() (*mms.DeviceCode, error) {
postParams := oauth.NewAuthDevicePostParams()
response, err := mono.Get().Oauth.AuthDevicePost(postParams)
if err != nil {
return nil, errs.Wrap(err, "Could not request device authentication")
}
return response.Payload, nil
} | [
-1.830558180809021,
0.9541695713996887,
0.250693678855896,
1.2776899337768555,
-0.4446682333946228,
-1.3389395475387573,
0.11376591771841049,
-0.5860670208930969,
0.7981550693511963,
-0.8266868591308594,
-0.028929950669407845,
1.4503754377365112,
-0.8612924814224243,
0.4665018618106842,
... |
func NewTableList(text Text, font Font, gridSize float64) *tableList {
if gridSize == 0 {
gridSize = consts.DefaultMaxGridSum
}
return &tableList{
text: text,
font: font,
maxGridSum: gridSize,
}
} | [
0.5657038688659668,
0.44703570008277893,
0.3556077182292938,
0.4343542456626892,
-0.9567846059799194,
-0.1032256931066513,
-0.5215152502059937,
0.05114700645208359,
-0.07217642664909363,
0.4217472970485687,
-0.3643762171268463,
-0.13688884675502777,
-0.2240024358034134,
0.4171677231788635,... |
func (s *tableList) BindGrid(pdf MarotoGridPart) {
s.pdf = pdf
} | [
0.7020891904830933,
-0.5640040636062622,
0.2974569797515869,
0.5575210452079773,
0.05147247388958931,
0.23534290492534637,
-0.6120020151138306,
0.89948970079422,
-0.6120442748069763,
-0.3557254374027252,
0.225023090839386,
0.234092116355896,
0.038983672857284546,
1.7179300785064697,
0.44... |
func (s *tableList) SetMaxGridSum(maxGridSum float64) {
s.maxGridSum = maxGridSum
} | [
0.283371239900589,
0.5792264938354492,
0.43319299817085266,
1.1682482957839966,
-0.591055154800415,
-0.4189026951789856,
-0.5905905365943909,
-0.3405984342098236,
0.13415978848934174,
0.32761406898498535,
-0.7948094606399536,
0.32358434796333313,
-0.19264507293701172,
1.5786292552947998,
... |
func (s *tableList) Create(header []string, contents [][]string, defaultFontFamily string, prop ...props.TableList) {
if len(header) == 0 {
return
}
if len(contents) == 0 {
return
}
tableProp := props.TableList{}
if len(prop) > 0 {
tableProp = prop[0]
}
predefinedCellTextColor := tableProp.ContentProp... | [
0.06202027201652527,
-0.3571695387363434,
0.7411820292472839,
0.08923851698637009,
0.0645161047577858,
-0.23773649334907532,
-0.45811501145362854,
-0.4018079340457916,
-0.7026903629302979,
-0.2781630754470825,
0.5653310418128967,
-0.8679553866386414,
0.29211464524269104,
0.1324111372232437... |
func (oc *contractTransmitter) Transmit(ctx context.Context, reportCtx ocrtypes.ReportContext, report ocrtypes.Report, signatures []ocrtypes.AttributedOnchainSignature) error {
var rs [][32]byte
var ss [][32]byte
var vs [32]byte
for i, as := range signatures {
r, s, v, err := evmutil.SplitSignature(as.Signature)
... | [
-0.08922170847654343,
0.603562593460083,
0.9460069537162781,
-0.14377622306346893,
0.5195479989051819,
-0.10442458093166351,
-0.03330721706151962,
-0.5713161826133728,
0.4289129078388214,
0.8059829473495483,
-0.4368470013141632,
-0.7355991005897522,
-0.4574606716632843,
0.14080946147441864... |
func (oc *contractTransmitter) LatestConfigDigestAndEpoch(ctx context.Context) (ocrtypes.ConfigDigest, uint32, error) {
latestConfigDigestAndEpoch, err := callContract(ctx, oc.contractAddress, oc.contractABI, "latestConfigDigestAndEpoch", nil, oc.contractReader)
if err != nil {
return ocrtypes.ConfigDigest{}, 0, er... | [
-0.26807963848114014,
0.16650229692459106,
0.8837175369262695,
-0.46573328971862793,
-0.6816182732582092,
-0.49022722244262695,
-0.2852853834629059,
0.06977343559265137,
0.027533937245607376,
0.42886605858802795,
-0.011597712524235249,
-0.21462346613407135,
0.4010559618473053,
0.2665376067... |
func (oc *contractTransmitter) FromAccount() (ocrtypes.Account, error) {
return ocrtypes.Account(oc.transmitter.FromAddress().String()), nil
} | [
0.5425841808319092,
-0.24599488079547882,
0.41793274879455566,
-0.507770299911499,
-0.5875629782676697,
-0.7932830452919006,
0.6714932918548584,
0.05735640972852707,
1.5275444984436035,
0.09992490708827972,
-0.30118563771247864,
1.112047553062439,
0.03741065412759781,
-0.4886144995689392,
... |
func (oc *contractTransmitter) Ready() error { return nil } | [
0.40665486454963684,
-0.3179837763309479,
0.28836026787757874,
-0.5509847402572632,
-0.039283011108636856,
-0.28446319699287415,
-0.04991060867905617,
0.7249283194541931,
0.36935603618621826,
0.3234529495239258,
-1.13558030128479,
0.2508462369441986,
-0.4081628918647766,
0.5817685127258301... |
func init() {
initTld()
} | [
0.7932592034339905,
0.535178542137146,
0.25770682096481323,
0.11789380759000778,
-0.05503876507282257,
0.5016599893569946,
0.0881047248840332,
0.8113284111022949,
-0.45362868905067444,
-0.8783714175224304,
-0.3322722911834717,
1.2695143222808838,
0.6085855960845947,
0.7900230288505554,
0... |
func (d Dictionary) Search(word string) (string, error) {
value, ok := d[word]
if ok {
return value, nil
}
return word, errNotFound
} | [
-0.6013997793197632,
1.008764386177063,
0.4406363070011139,
-0.44873952865600586,
-1.1686606407165527,
0.21085724234580994,
-0.4426538348197937,
-0.6473504900932312,
-0.19008277356624603,
0.21609865128993988,
0.5347294211387634,
0.2413698434829712,
-0.35581618547439575,
0.46974071860313416... |
func (d Dictionary) Add(word, def string) error {
_, err := d.Search(word)
switch err {
case errNotFound:
d[word] = def
case nil:
return errWordExist
}
return nil
} | [
-0.3060760796070099,
0.7220553159713745,
0.7462167143821716,
0.019302500411868095,
0.21615083515644073,
0.4460284113883972,
-1.0103998184204102,
0.36120572686195374,
-0.17015619575977325,
0.7775359153747559,
0.21664567291736603,
0.9682831764221191,
-0.34014683961868286,
1.0408345460891724,... |
func (d Dictionary) Update(word, def string) error {
_, err := d.Search(word)
switch err {
case nil:
d[word] = def
case errNotFound:
return errCannotUpdate
}
return nil
} | [
-0.2665026783943176,
0.2523295283317566,
0.4921973943710327,
0.009680341929197311,
-0.535287618637085,
-0.14906273782253265,
-1.015389323234558,
0.28296342492103577,
-0.09286605566740036,
0.7028393745422363,
0.1274595856666565,
0.9744188785552979,
-0.6092005372047424,
0.44535085558891296,
... |
func (d Dictionary) Delete(word string) {
delete(d, word)
} | [
0.4704730808734894,
0.6331958174705505,
-0.028286676853895187,
-0.43291234970092773,
-0.7422363758087158,
0.2772831618785858,
-0.0847218781709671,
1.0061770677566528,
0.3142891824245453,
0.5461281538009644,
0.12697042524814606,
0.42530497908592224,
-0.58094322681427,
0.8873171210289001,
... |
func GetIPv4Addr(ifAdds map[string]string, ipAdds *map[string]string) {
tempAdds := *ipAdds
for k, v := range ifAdds {
if runtime.GOOS == "linux" {
if (strings.HasPrefix(k, "local") || strings.HasPrefix(k, "en") || strings.HasPrefix(k, "eth")) && strings.HasSuffix(k, "_0") {
tempAdds["eth_ipv4"] = v
} els... | [
-0.6282395124435425,
-0.5500321984291077,
0.7591527700424194,
-0.6850233674049377,
-0.17922258377075195,
-0.4840395450592041,
-0.800182580947876,
0.019860733300447464,
-0.6523483991622925,
0.5594103336334229,
0.573201596736908,
0.39979639649391174,
-0.3402941823005676,
0.7892149090766907,
... |
func GetLocalIpAddrs() map[string]string {
ifaces, err := net.Interfaces()
if err != nil {
log.Println(err.Error())
}
ifAdds := make(map[string]string)
ipAdds := make(map[string]string)
fmt.Printf("OS type: %s\n", runtime.GOOS)
//FoundLocalIPV4Addr := false // found local ipv4 address or not, default false
... | [
-0.7577542662620544,
-0.3084263205528259,
0.8638250827789307,
-0.5922597646713257,
-0.48718735575675964,
-0.40286150574684143,
0.09670156240463257,
-0.0821557343006134,
-0.03218318894505501,
0.486850380897522,
0.23316225409507751,
0.4834960103034973,
-0.8467788696289062,
0.8667851686477661... |
func NewParser(handler *MetricHandler) *Parser {
return &Parser{
machine: NewMachine(handler),
handler: handler,
}
} | [
1.0018242597579956,
-0.43319597840309143,
0.10780931264162064,
0.2533382773399353,
-1.2880150079727173,
1.176207184791565,
0.11115259677171707,
-0.3569422960281372,
-1.2815905809402466,
-1.0459078550338745,
0.32435882091522217,
0.35703036189079285,
0.1656247228384018,
1.1553488969802856,
... |
func NewSeriesParser(handler *MetricHandler) *Parser {
return &Parser{
machine: NewSeriesMachine(handler),
handler: handler,
}
} | [
0.5761073231697083,
-0.20010168850421906,
0.11762943118810654,
0.2960756719112396,
-1.832406759262085,
0.3453318178653717,
-0.1294109970331192,
-0.4589134156703949,
-0.6942811608314514,
-0.7284738421440125,
-0.019328411668539047,
0.7897000908851624,
0.1514611691236496,
0.3213268518447876,
... |
func (p *Parser) SetTimeFunc(f TimeFunc) {
p.handler.SetTimeFunc(f)
} | [
0.6000407934188843,
-0.36042898893356323,
0.3525927662849426,
-0.03238987550139427,
-0.030231256037950516,
0.16165636479854584,
0.9480249881744385,
0.472427099943161,
-0.9481768012046814,
0.2917085587978363,
-0.8589402437210083,
0.257729709148407,
1.3256237506866455,
0.8583971858024597,
... |
func (p *Parser) Parse(input []byte) ([]Metric, error) {
p.Lock()
defer p.Unlock()
metrics := make([]Metric, 0)
p.machine.SetData(input)
for {
err := p.machine.Next()
if err == EOF {
break
}
if err != nil {
return nil, &ParseError{
Offset: p.machine.Position(),
LineOffset: p.machine.Lin... | [
0.16294535994529724,
0.03623953461647034,
0.5996599197387695,
0.0035842102952301502,
-0.22493848204612732,
0.5865640044212341,
0.12760832905769348,
-0.40239417552948,
-1.4038299322128296,
-0.4001956880092621,
-0.2022632211446762,
-0.18925976753234863,
-0.5586035847663879,
1.173879265785217... |
func NewStreamParser(r io.Reader) *StreamParser {
handler := NewMetricHandler()
return &StreamParser{
machine: NewStreamMachine(r, handler),
handler: handler,
}
} | [
0.8519579768180847,
-0.6781824827194214,
0.2548389434814453,
0.17852166295051575,
-1.5954608917236328,
0.8940426707267761,
0.44350665807724,
-1.0805107355117798,
-0.09560225158929825,
-0.2520669996738434,
-0.49533048272132874,
0.08855536580085754,
-0.6529411673545837,
0.960067868232727,
... |
func (p *StreamParser) SetTimeFunc(f TimeFunc) {
p.handler.SetTimeFunc(f)
} | [
0.701323390007019,
-0.4823164641857147,
0.37025633454322815,
-0.03582869842648506,
-0.19983366131782532,
-0.006118245422840118,
1.0440318584442139,
0.35511600971221924,
-0.777060866355896,
0.25832295417785645,
-0.8497684597969055,
0.462549090385437,
1.0668593645095825,
1.0725793838500977,
... |
func (p *StreamParser) SetTimePrecision(u time.Duration) {
p.handler.SetTimePrecision(u)
} | [
-0.008342701010406017,
-0.8225102424621582,
0.6724528074264526,
0.09474106132984161,
-0.419233500957489,
0.36220377683639526,
-0.2234138697385788,
-0.38901740312576294,
-0.14758643507957458,
0.03887254744768143,
-0.5835698843002319,
-0.5650403499603271,
-0.30313512682914734,
1.404465436935... |
func (p *StreamParser) Next() (Metric, error) {
err := p.machine.Next()
if err == EOF {
return nil, EOF
}
if err != nil {
return nil, &ParseError{
Offset: p.machine.Position(),
LineOffset: p.machine.LineOffset(),
LineNumber: p.machine.LineNumber(),
Column: p.machine.Column(),
msg: ... | [
0.7116435766220093,
-0.3075430691242218,
0.532980740070343,
-0.36647796630859375,
-1.2584794759750366,
0.7566559910774231,
-0.28577885031700134,
-0.40609750151634216,
-1.1832656860351562,
-0.7086266279220581,
0.25248390436172485,
0.7672251462936401,
-0.005533578805625439,
0.604609549045562... |
func (p *StreamParser) Position() int {
return p.machine.Position()
} | [
0.08886582404375076,
-0.528545618057251,
0.32109975814819336,
-0.334062784910202,
-0.08130419254302979,
0.15004780888557434,
0.4869910478591919,
-0.07587059587240219,
-0.8772783875465393,
-0.7618826031684875,
-0.31208500266075134,
-0.09547159075737,
-1.273736834526062,
0.8625580668449402,
... |
func (p *StreamParser) LineOffset() int {
return p.machine.LineOffset()
} | [
0.8884137272834778,
-0.8888970613479614,
0.22839981317520142,
-0.8727455139160156,
-0.05689999833703041,
1.1271048784255981,
-0.21013414859771729,
0.3776371479034424,
-1.1295206546783447,
-0.8211551308631897,
-0.3371409773826599,
0.7549183964729309,
-0.672938883304596,
0.396737277507782,
... |
func (p *StreamParser) LineNumber() int {
return p.machine.LineNumber()
} | [
0.06925713270902634,
-0.45769596099853516,
0.27462339401245117,
0.38974764943122864,
0.16700275242328644,
0.3385775685310364,
0.3534604609012604,
0.7953836917877197,
-0.5343559980392456,
-1.9194109439849854,
-0.0293235145509243,
0.7742672562599182,
-0.18777526915073395,
1.1362348794937134,... |
func (p *StreamParser) Column() int {
return p.machine.Column()
} | [
0.5834528803825378,
-0.718663215637207,
0.31908637285232544,
-0.172097846865654,
0.17288753390312195,
-0.2414477914571762,
1.2440084218978882,
-0.18394289910793304,
-1.1435884237289429,
-0.8173893094062805,
-0.23555441200733185,
0.9425817728042603,
-0.7151681780815125,
0.7846051454544067,
... |
func (p *StreamParser) LineText() string {
return p.machine.LineText()
} | [
0.9672577381134033,
-0.906247615814209,
0.1731797754764557,
-0.04470718279480934,
-0.4529218077659607,
0.9807810187339783,
-1.0308613777160645,
-0.6883882880210876,
-0.01616411656141281,
-0.4043486714363098,
-0.3948182165622711,
0.4233360290527344,
-1.2137845754623413,
0.47992411255836487,... |
func (c *CHelper) GetContainers(processInfo []*nvml.ProcessInfo) ([]*types.Container, error) {
return nil, nil
} | [
-0.23396775126457214,
-0.7521111369132996,
0.5695284008979797,
1.0536929368972778,
1.1794542074203491,
-0.11725390702486038,
-0.09426408261060715,
-1.0379714965820312,
-0.22516822814941406,
-0.622056782245636,
-0.2292361557483673,
0.16919632256031036,
-1.1321343183517456,
1.668789148330688... |
func (s *Service) addCoinCheck(c context.Context, mid, aid, tp, multiply, maxCoin, upmid int64) (err error) {
var (
added int64
exist bool
)
if _, ok := s.businesses[tp]; !ok {
err = ecode.RequestErr
return
}
if upmid == mid {
log.Errorv(c, log.KV("log", "user can not add coin to self archive"), log.KV("... | [
-0.44939467310905457,
0.6615528464317322,
0.9149828553199768,
0.1694961041212082,
-0.36801421642303467,
0.07937592267990112,
0.41903766989707947,
-0.6728575825691223,
0.41806769371032715,
0.4253706932067871,
0.4937724471092224,
0.5809804201126099,
-0.4106944501399994,
0.580561637878418,
... |
func (c *DeviceConfig) newDeviceFinder() (*device.DeviceFinder, error) {
if c.deviceFinderPath == "" {
return nil, fmt.Errorf("--device-finder-path not specified")
}
return device.NewDeviceFinder(c.deviceFinderPath), nil
} | [
-0.5960150361061096,
-0.055568888783454895,
0.0739816278219223,
0.6464380621910095,
-0.8335471153259277,
-0.15403728187084198,
0.9959372282028198,
-0.3853030204772949,
0.10358747839927673,
-0.3494094908237457,
-0.3334222733974457,
-0.07134068012237549,
-0.05982235446572304,
1.4302136898040... |
func (p *PersonallyProcuredMove) Validate(tx *pop.Connection) (*validate.Errors, error) {
return validate.Validate(), nil
} | [
-0.1931389719247818,
0.021456964313983917,
0.4756042957305908,
0.8561223745346069,
0.7658379077911377,
-0.021989811211824417,
-0.19768670201301575,
-0.19826264679431915,
-0.2005566507577896,
-0.2075769305229187,
0.3969501852989197,
-0.07169444113969803,
-1.2509647607803345,
0.0476239658892... |
func (p *PersonallyProcuredMove) ValidateCreate(tx *pop.Connection) (*validate.Errors, error) {
return validate.NewErrors(), nil
} | [
-0.26330769062042236,
0.16948068141937256,
0.4962545335292816,
0.9694532752037048,
0.6930966973304749,
0.49012112617492676,
-0.03067038580775261,
-0.6904751658439636,
-0.9315500855445862,
0.14338424801826477,
0.32801344990730286,
-0.7523273825645447,
-0.6756494641304016,
0.589494526386261,... |
func (p *PersonallyProcuredMove) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error) {
return validate.NewErrors(), nil
} | [
-0.6696183085441589,
-0.810539186000824,
0.4826416075229645,
0.9045774936676025,
-0.02051563933491707,
0.15905128419399261,
-0.2087320238351822,
-0.14632439613342285,
0.133497416973114,
0.3541194796562195,
0.4642670750617981,
-0.3769911229610443,
-1.144091010093689,
0.14245420694351196,
... |
func GetPersonallyProcuredMovesForMoveID(db *pop.Connection, moveID uuid.UUID) (PersonallyProcuredMoves, error) {
var ppms PersonallyProcuredMoves
query := db.Where("move_id = $1", moveID)
err := query.All(&ppms)
return ppms, err
} | [
-0.5992610454559326,
-0.23028887808322906,
0.38900625705718994,
1.0049595832824707,
0.6487929821014404,
-1.0398228168487549,
-0.5611974000930786,
-0.44151124358177185,
0.4582507312297821,
0.0703531801700592,
-0.08169373869895935,
0.5328652262687683,
-0.6616919636726379,
1.125907063484192,
... |
func GetPersonallyProcuredMoveForID(db *pop.Connection, id uuid.UUID) (PersonallyProcuredMove, error) {
var ppm PersonallyProcuredMove
err := db.Find(&ppm, id)
return ppm, err
} | [
-0.4334261417388916,
-0.2568235993385315,
0.2829105854034424,
0.697110652923584,
0.4266597330570221,
-0.6450486183166504,
-0.6904280781745911,
-0.26551908254623413,
0.09081330895423889,
-0.9106088876724243,
0.33046215772628784,
0.16720348596572876,
-0.6391167640686035,
0.5109952688217163,
... |
func (s *Server) GetTeamsScoresRaw() (TeamsScoresRaw, error) {
teamsScoresRaw := TeamsScoresRaw{}
request := buildRequest(EXTENDED_INFO, EXTENDED_INFO_TEAMS_SCORES, 0)
response, err := s.queryServer(request)
if err != nil {
return teamsScoresRaw, err
}
positionInResponse = 0
// first int is EXTENDED_INFO = ... | [
-0.7664694786071777,
-0.30596473813056946,
0.9980754852294922,
-1.224104881286621,
-0.8100574612617493,
0.09759107977151871,
-0.8704947233200073,
-1.0605493783950806,
-0.4542787969112396,
-0.2843005955219269,
-0.7713775038719177,
-0.3999066650867462,
-0.25359243154525757,
-0.00525037106126... |
func (s *Server) GetTeamsScores() (TeamsScores, error) {
teamsScores := TeamsScores{}
teamsScoresRaw, err := s.GetTeamsScoresRaw()
if err != nil {
return teamsScores, err
}
teamsScores.TeamsScoresRaw = teamsScoresRaw
teamsScores.GameMode = getGameModeName(teamsScoresRaw.GameMode)
return teamsScores, nil
} | [
-0.010563792660832405,
0.30459409952163696,
0.5908796787261963,
-0.656600296497345,
0.03748900443315506,
-0.41133907437324524,
-0.8170700669288635,
-1.0465548038482666,
-0.3112141191959381,
0.02889944612979889,
-1.0830591917037964,
0.002976038260385394,
-0.44740983843803406,
0.215440079569... |
func propagateCancellation(
ctx context.Context,
allDone chan struct{},
c CancellableRoundTripper,
req *http.Request) {
// If the context is not cancellable, there is nothing interesting we can do.
cancelChan := ctx.Done()
if cancelChan == nil {
return
}
// If the user closes allDone before the context is c... | [
0.5734432339668274,
-0.34258055686950684,
0.6932243704795837,
0.6573977470397949,
-0.35568955540657043,
0.2957881987094879,
0.49810361862182617,
0.25116780400276184,
0.5409208536148071,
0.020356418564915657,
1.1030277013778687,
-0.3710682690143585,
0.25535231828689575,
0.5506306886672974,
... |
func Do(
ctx context.Context,
client *http.Client,
req *http.Request) (resp *http.Response, err error) {
// Make sure the transport supports cancellation.
c, ok := client.Transport.(CancellableRoundTripper)
if !ok {
err = fmt.Errorf(
"Transport of type %v doesn't support cancellation",
reflect.TypeOf(clie... | [
0.6507692337036133,
-0.05825423821806908,
0.8068195581436157,
-0.20333923399448395,
0.15997926890850067,
0.4109787344932556,
0.28878840804100037,
-0.7109658122062683,
-0.486613392829895,
0.08488906919956207,
0.8678983449935913,
0.3018932342529297,
0.0743805542588234,
-0.06758448481559753,
... |
func ScanForRepositories(directoryPath string) ([]string, error) {
repoFolders := make([]string, 0)
files, err := ioutil.ReadDir(directoryPath)
if err == nil {
for _, f := range files {
if f.IsDir() {
repoFolders = append(repoFolders, filepath.Join(directoryPath, f.Name()... | [
-1.1227308511734009,
0.212886780500412,
0.5051524639129639,
0.4340362548828125,
-0.3206123411655426,
-0.6593214273452759,
0.3398296535015106,
-0.3032408356666565,
0.4857983887195587,
-0.019172830507159233,
0.4400522708892822,
-0.4559639096260071,
-0.017445173114538193,
1.229798674583435,
... |
func ScanForSPARQLFiles(repositoryPath string) ([]string, error) {
sparqlFiles := make([]string, 0)
err := filepath.Walk(repositoryPath, func(path string, info os.FileInfo, err error) error {
if err == nil {
if !info.IsDir() {
match := sparqlFileRegex.MatchString(path)
... | [
0.23401746153831482,
-0.6269435286521912,
0.49732449650764465,
-0.046958573162555695,
-0.07486721873283386,
-0.02975914254784584,
0.10137604922056198,
-0.0019232850754633546,
0.25435325503349304,
0.09221688657999039,
-0.2835182249546051,
0.11949634552001953,
-0.823199987411499,
0.519119262... |
func GetDevicesInfo(mountsPath string) ([]*Device, error) {
file, err := os.Open(mountsPath)
if err != nil {
return nil, err
}
defer file.Close()
return processMounts(file)
} | [
0.571674108505249,
0.019274376332759857,
0.511644721031189,
0.15957899391651154,
0.7338682413101196,
-0.012058504857122898,
0.2959207594394684,
-0.8915365934371948,
-0.3585364818572998,
0.007728371769189835,
-0.03390398621559143,
0.02408771961927414,
0.4366985261440277,
0.6224102973937988,... |
func Remove(ri RemoveInput) (ro RemoveOutput, err error) {
// ensure home is passed
if len(ri.Home) == 0 {
err = errors.New("home undefined")
return
}
if StringInSlice(ri.Home, []string{"/", "/home"}, true) {
err = fmt.Errorf("not a good idea to use '%s' as home dir", ri.Home)
return
}
// check paths de... | [
-0.21652546525001526,
-0.11386024206876755,
0.878583550453186,
0.3326661288738251,
0.2407558262348175,
-0.6027274131774902,
0.924774169921875,
-0.0644485279917717,
-0.07329785823822021,
0.33153316378593445,
0.3310883939266205,
-0.5939918756484985,
-0.5907673239707947,
0.38663896918296814,
... |
func GetCountriesHandler(w http.ResponseWriter, r *http.Request) {
countries := repository.GetAllCountries()
sortCountries(countries, r)
json.NewEncoder(w).Encode(countries)
} | [
0.1454375684261322,
-0.12297254800796509,
0.3860834240913391,
-0.0383419468998909,
-0.37032416462898254,
0.41795745491981506,
0.051472101360559464,
-0.7033758163452148,
-0.4681456983089447,
0.11417517811059952,
0.1224999874830246,
-0.6223236322402954,
-0.06626739352941513,
0.70739251375198... |
func GetContinentCountriesHandler(w http.ResponseWriter, r *http.Request) {
params := mux.Vars(r)
continent, _ := strconv.Atoi(params["continent"])
countries := repository.GetAllCountriesByContinentID(continent)
sortCountries(countries, r)
json.NewEncoder(w).Encode(countries)
} | [
0.37674984335899353,
-0.4576992094516754,
0.45673051476478577,
0.0321618877351284,
-0.429993599653244,
0.6341410875320435,
0.20122753083705902,
-1.1930177211761475,
-0.6755288243293762,
0.20955781638622284,
0.22991548478603363,
-0.48581981658935547,
-0.3378373086452484,
0.34565016627311707... |
func GetContinentCodeCountriesHandler(w http.ResponseWriter, r *http.Request) {
params := mux.Vars(r)
countries := repository.GetAllCountriesByContinentCode(params["continent"])
sortCountries(countries, r)
json.NewEncoder(w).Encode(countries)
} | [
0.2456490397453308,
-0.34396758675575256,
0.4011572599411011,
-0.0072967493906617165,
-0.36989864706993103,
0.37626147270202637,
-0.0036965853068977594,
-0.936318576335907,
-0.5452346205711365,
0.5024821162223816,
0.07083500921726227,
-0.10202867537736893,
-0.45158934593200684,
0.717242717... |
func GetCountryHandler(w http.ResponseWriter, r *http.Request) {
params := mux.Vars(r)
id, _ := strconv.Atoi(params["id"])
json.NewEncoder(w).Encode(repository.GetCountry(id))
} | [
0.10802557319402695,
-0.2171737253665924,
0.496035635471344,
0.06464432924985886,
-0.5768168568611145,
0.10668128728866577,
0.11897826194763184,
-0.42622241377830505,
-0.35575994849205017,
0.3794662356376648,
-0.33547431230545044,
0.1642536073923111,
-0.2339254915714264,
0.0648307129740715... |
func GetCountryByCodeHandler(w http.ResponseWriter, r *http.Request) {
params := mux.Vars(r)
json.NewEncoder(w).Encode(repository.GetCountryByCode(params["code"]))
} | [
0.18969716131687164,
0.453865110874176,
0.4085974097251892,
0.19715704023838043,
-0.4331788420677185,
0.1623173952102661,
0.34119367599487305,
-0.39433082938194275,
-0.43259817361831665,
0.5390124320983887,
-0.1898609697818756,
-0.0077242301777005196,
-0.11445637047290802,
0.65774458646774... |
func NewContentHandler(e *echo.Echo, r *echo.Group, us domain.ContentUsecase) {
handler := &ContentHandler{
AUsecase: us,
}
e.GET("/contents", handler.FetchContents)
r.POST("/contents", handler.Store)
e.GET("/contents/:id", handler.GetByID)
r.DELETE("/contents/:id", handler.Delete)
} | [
-0.3478400409221649,
-0.825944721698761,
0.23484724760055542,
0.46239209175109863,
-0.514296293258667,
0.16982302069664001,
0.3120928704738617,
-0.566162109375,
-0.504302442073822,
-0.10066495090723038,
0.22454847395420074,
-0.48308539390563965,
0.5218542814254761,
0.9478355050086975,
0.... |
func (a *ContentHandler) FetchContents(c echo.Context) error {
numS := c.QueryParam("num")
num, _ := strconv.Atoi(numS)
cursor := c.QueryParam("cursor")
ctx := c.Request().Context()
listAr, nextCursor, err := a.AUsecase.Fetch(ctx, cursor, int64(num))
if err != nil {
return c.JSON(getStatusCode(err), ResponseEr... | [
-0.25201818346977234,
0.056125447154045105,
0.4532845616340637,
0.42665883898735046,
-0.9150472283363342,
-0.27071115374565125,
-0.2855701148509979,
-1.2949069738388062,
-0.06422467529773712,
0.6122974157333374,
0.2964591383934021,
-0.29769158363342285,
0.4642072021961212,
0.41823306679725... |
func (a *ContentHandler) GetByID(c echo.Context) error {
idP, err := strconv.Atoi(c.Param("id"))
if err != nil {
return c.JSON(http.StatusNotFound, domain.ErrNotFound.Error())
}
id := int64(idP)
ctx := c.Request().Context()
art, err := a.AUsecase.GetByID(ctx, id)
if err != nil {
return c.JSON(getStatusCode... | [
-0.26046285033226013,
-0.2103808969259262,
0.8931289911270142,
-0.2090253382921219,
-0.2742365598678589,
0.3496607542037964,
0.3942364752292633,
-1.0482076406478882,
0.3645245134830475,
0.40309932827949524,
-0.006196302827447653,
1.0463969707489014,
-0.07152044773101807,
0.1420356482267379... |
func (a *ContentHandler) Store(c echo.Context) (err error) {
var content domain.Content
err = c.Bind(&content)
if err != nil {
return c.JSON(http.StatusUnprocessableEntity, err.Error())
}
var ok bool
if ok, err = isRequestValid(&content); !ok {
return c.JSON(http.StatusBadRequest, err.Error())
}
ctx := c.... | [
-0.9756341576576233,
-0.3937314748764038,
0.8493387699127197,
0.23685003817081451,
-0.5340153574943542,
0.7148085236549377,
0.19093236327171326,
-0.6460720300674438,
0.054884422570466995,
-0.334353506565094,
-0.24713881313800812,
0.27638256549835205,
-0.081183522939682,
0.36416947841644287... |
func (a *ContentHandler) Delete(c echo.Context) error {
idP, err := strconv.Atoi(c.Param("id"))
if err != nil {
return c.JSON(http.StatusNotFound, domain.ErrNotFound.Error())
}
id := int64(idP)
ctx := c.Request().Context()
err = a.AUsecase.Delete(ctx, id)
if err != nil {
return c.JSON(getStatusCode(err), R... | [
-0.47947636246681213,
-0.0453050322830677,
0.9058548808097839,
0.0439806766808033,
-0.325058251619339,
0.2557465136051178,
-0.014320322312414646,
-0.7749179601669312,
0.2879483997821808,
0.6844783425331116,
0.494608998298645,
0.049441833049058914,
-0.34261444211006165,
0.000643317471258342... |
func (e S3Emitter) S3FileName(firstSeq string, lastSeq string) string {
date := time.Now().UTC().Format("2006/01/02")
if e.S3Prefix == "" {
return fmt.Sprintf("%v/%v-%v", date, firstSeq, lastSeq)
} else {
return fmt.Sprintf("%v/%v/%v-%v", e.S3Prefix, date, firstSeq, lastSeq)
}
} | [
-0.04344505816698074,
-1.0203032493591309,
0.684325098991394,
-0.4932592809200287,
-0.17794989049434662,
0.09284418821334839,
-0.7012626528739929,
0.836102306842804,
0.046108096837997437,
0.7133747339248657,
0.3050430119037628,
-0.034619346261024475,
0.720022439956665,
-0.5468870997428894,... |
func (e S3Emitter) Emit(b Buffer, t Transformer, shardID string) error {
auth, _ := aws.EnvAuth()
s3Con := s3.New(auth, aws.USEast)
s3Con.ReadTimeout = time.Second * 300
s3Con.ConnectTimeout = time.Second * 10
bucket := s3Con.Bucket(e.S3Bucket)
s3File := e.S3FileName(b.FirstSequenceNumber(), b.LastSequenceNumber(... | [
0.40469610691070557,
-0.16316263377666473,
0.7792401909828186,
-1.2190117835998535,
0.8787464499473572,
0.36021894216537476,
-0.2557491064071655,
0.291811466217041,
-0.11569694429636002,
0.8633576035499573,
-0.7983464598655701,
0.3178665339946747,
-0.5651054978370667,
-0.03101327084004879,... |
func (*Message) scanValues(columns []string) ([]interface{}, error) {
values := make([]interface{}, len(columns))
for i := range columns {
switch columns[i] {
case message.FieldID, message.FieldFrom, message.FieldSessionType, message.FieldServerMsgSeq, message.FieldMsgType, message.FieldMsgResCode, message.FieldM... | [
-0.6529157757759094,
0.4684159457683563,
0.6367878913879395,
0.45344147086143494,
0.24288950860500336,
-0.5006039142608643,
-0.6009503602981567,
-1.0444843769073486,
-0.46635740995407104,
-0.10896527767181396,
0.0848560556769371,
0.31502223014831543,
-0.5580311417579651,
1.404338002204895,... |
func (m *Message) assignValues(columns []string, values []interface{}) error {
if m, n := len(values), len(columns); m < n {
return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)
}
for i := range columns {
switch columns[i] {
case message.FieldID:
value, ok := values[i].(*sql.NullInt64)
if ... | [
-0.4950231611728668,
-0.10510565340518951,
0.7004729509353638,
-0.14124754071235657,
0.3096622824668884,
0.1301371306180954,
-0.12168228626251221,
-0.5909205079078674,
-0.483254075050354,
0.025722460821270943,
0.2783391773700714,
-0.04299144446849823,
-0.2350395768880844,
0.942260503768920... |
func (m *Message) Update() *MessageUpdateOne {
return (&MessageClient{config: m.config}).UpdateOne(m)
} | [
0.26714441180229187,
-0.10578181594610214,
0.2013687938451767,
0.3570893704891205,
0.2904278635978699,
-0.15908780694007874,
-0.20777715742588043,
-0.4731830656528473,
-0.2965071201324463,
-0.02742411382496357,
0.2197757065296173,
0.13027481734752655,
-2.1295053958892822,
0.289319336414337... |
func (m *Message) Unwrap() *Message {
_tx, ok := m.config.driver.(*txDriver)
if !ok {
panic("ent: Message is not a transactional entity")
}
m.config.driver = _tx.drv
return m
} | [
-0.2737034261226654,
0.8116815686225891,
0.3427223861217499,
-0.3861830234527588,
0.23092065751552582,
-0.5436710715293884,
0.4555221199989319,
0.22463060915470123,
-0.3523852229118347,
0.45198944211006165,
1.1340157985687256,
0.40343523025512695,
-0.20753228664398193,
-0.3009393513202667,... |
func (m *Message) String() string {
var builder strings.Builder
builder.WriteString("Message(")
builder.WriteString(fmt.Sprintf("id=%v, ", m.ID))
builder.WriteString("created=")
builder.WriteString(m.Created.Format(time.ANSIC))
builder.WriteString(", ")
builder.WriteString("updated=")
builder.WriteString(m.Upda... | [
0.13410960137844086,
-0.663597822189331,
0.6910256147384644,
-0.8146387338638306,
-0.13370005786418915,
0.2348489612340927,
0.5109161138534546,
-1.3574804067611694,
-0.5836740136146545,
0.1550786793231964,
-0.07536625862121582,
0.8501721620559692,
-0.8565536737442017,
0.24225689470767975,
... |
func NewTeacherRepository() *Teacher {
db().AutoMigrate(&model.Teacher{}, &model.User{}, &model.Class{})
return new(Teacher)
} | [
-0.6968332529067993,
-0.6282519102096558,
0.12932847440242767,
0.3487094044685364,
-0.9366018176078796,
0.15431348979473114,
0.0017592614749446511,
-0.27114322781562805,
-0.142480731010437,
0.5623061656951904,
-0.5059671998023987,
0.027243122458457947,
0.15993763506412506,
1.18341732025146... |
func (r *Teacher) DeleteInsert(teachers []*model.Teacher) error {
tx := db().Begin()
defer func() {
if r := recover(); r != nil {
tx.Rollback()
}
}()
if err := tx.Error; err != nil {
return err
}
classIDs := []uint{}
for _, teacher := range teachers {
if teacher.ClassID != nil {
classIDFound := f... | [
-1.3587329387664795,
-0.10516700893640518,
0.9864005446434021,
0.3550804555416107,
0.10436421632766724,
0.0491517148911953,
0.4794999957084656,
-0.20473407208919525,
-0.3764899969100952,
0.5531133413314819,
0.702066957950592,
-0.5421558618545532,
-1.0840816497802734,
1.2074371576309204,
... |
func (AppModuleBasic) Name() string {
return commontypes.ModuleName
} | [
-0.2583398222923279,
-0.566013514995575,
0.3473712205886841,
0.8899403810501099,
-0.04582853615283966,
1.1057353019714355,
-0.2892040014266968,
-1.2161911725997925,
-0.4164098799228668,
0.9193437099456787,
0.07825262099504471,
-0.45658546686172485,
0.21568389236927032,
0.6798304915428162,
... |
func (AppModuleBasic) DefaultGenesis(cdc codec.JSONMarshaler) json.RawMessage {
return cdc.MustMarshalJSON(commontypes.DefaultGenesisState())
} | [
-0.865189790725708,
0.4116983413696289,
0.3039720058441162,
0.18034230172634125,
0.32481837272644043,
-0.08854687213897705,
-0.451282262802124,
-0.7646193504333496,
-0.49835672974586487,
-0.1259469836950302,
-0.29040640592575073,
-0.9991508722305298,
-0.018417751416563988,
1.45232641696929... |
func (AppModuleBasic) ValidateGenesis(cdc codec.JSONMarshaler, config client.TxEncodingConfig, bz json.RawMessage) error {
var gs commontypes.GenesisState
if err := cdc.UnmarshalJSON(bz, &gs); err != nil {
return fmt.Errorf("failed to unmarshal %s genesis state: %w", commontypes.ModuleName, err)
}
return gs.Valid... | [
-0.9930909872055054,
-0.216680109500885,
0.3320329785346985,
-0.0677865743637085,
-0.2546450197696686,
0.31455445289611816,
0.5352033376693726,
-0.1522245705127716,
-0.9381319284439087,
0.20578321814537048,
-0.23932227492332458,
0.10159683227539062,
-0.31844353675842285,
0.9567013382911682... |
func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) {
} | [
0.043475545942783356,
-0.009533395059406757,
0.3355924189090729,
0.6494143605232239,
0.03553389385342598,
-0.16798387467861176,
-0.6389011144638062,
-0.4061870574951172,
0.4731890857219696,
-0.27063122391700745,
-0.8070608973503113,
0.4818088710308075,
-1.4024797677993774,
-0.1992124319076... |
func (b AppModuleBasic) GetTxCmd() *cobra.Command {
// return cli.NewTxCmd()
return nil
} | [
1.2843657732009888,
-0.5343246459960938,
0.5905418395996094,
0.6970059871673584,
0.6605256199836731,
0.15806366503238678,
-0.5964387655258179,
-0.15817996859550476,
0.009198415093123913,
-0.936506450176239,
0.16060557961463928,
0.11382467299699783,
-0.2760133743286133,
0.003881830489262938... |
func (b AppModuleBasic) GetQueryCmd() *cobra.Command {
// return cli.GetQueryCmd()
return nil
} | [
0.914932370185852,
-0.4979514181613922,
0.5145494341850281,
0.9581802487373352,
0.7660190463066101,
0.5887446403503418,
0.04902078956365585,
-0.12319648265838623,
0.3442719578742981,
-1.6407839059829712,
0.5963506102561951,
0.6829017996788025,
-0.254730224609375,
0.22831915318965912,
0.1... |
func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) {
types.RegisterInterfaces(registry)
} | [
-0.5181245803833008,
1.1885415315628052,
0.35416123270988464,
0.4435320198535919,
1.3125243186950684,
0.7630013823509216,
0.5164445638656616,
-0.43181121349334717,
0.24589195847511292,
-0.5905942916870117,
-0.8649469017982483,
0.4677768051624298,
-0.6762191653251648,
0.8450706005096436,
... |
func NewAppModule(k dnskeeper.Keeper, ck *clientkeeper.Keeper, sk *serverkeeper.Keeper) AppModule {
var (
flags uint8
hs []sdk.Handler
qs []sdk.Querier
rs []commontypes.PacketReceiver
as []commontypes.PacketAcknowledgementReceiver
)
if ck != nil {
flags |= flagClient
hs = append(hs, dnsclie... | [
0.18708637356758118,
0.16279056668281555,
0.6275022625923157,
0.012860973365604877,
-0.210974782705307,
0.9049143195152283,
-0.6407601833343506,
-0.6641096472740173,
0.3236553370952606,
0.20772899687290192,
-0.2688741087913513,
0.17132608592510223,
0.6522654294967651,
1.1348828077316284,
... |
func (AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {
// TODO
} | [
-0.26708415150642395,
0.16139832139015198,
0.2918036878108978,
0.6113804578781128,
0.41584646701812744,
0.6828469634056091,
0.37342584133148193,
0.1313086748123169,
0.08446263521909714,
-0.16089296340942383,
-0.9246959686279297,
1.0007082223892212,
-1.1477504968643188,
0.41173145174980164,... |
func (am AppModule) QuerierRoute() string {
return commontypes.QuerierRoute
} | [
1.0662363767623901,
-0.7627257108688354,
0.23716683685779572,
-0.13667376339435577,
1.115692377090454,
1.6043585538864136,
-0.5820180177688599,
-0.21128621697425842,
-0.24773366749286652,
-0.8943922519683838,
0.20363406836986542,
-0.3032512068748474,
-0.8066369295120239,
0.8991020917892456... |
func (am AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier {
return nil
} | [
0.4641342759132385,
-1.0264257192611694,
0.350080668926239,
-0.3193371593952179,
-0.26736336946487427,
0.6994062662124634,
-0.5407236814498901,
0.42255887389183044,
0.5136675834655762,
-1.044456124305725,
-0.16734395921230316,
-0.1694914847612381,
-0.4391387104988098,
1.1120593547821045,
... |
func (am AppModule) RegisterQueryService(server grpc.Server) {
// commontypes.RegisterQueryServer(server, am.keeper)
} | [
-1.0219886302947998,
-0.014862796291708946,
0.4339984357357025,
0.41576263308525085,
1.2572579383850098,
0.4201226532459259,
-0.10358525812625885,
-0.8488813042640686,
0.4895936846733093,
-0.4064197540283203,
-0.6111937761306763,
1.0731441974639893,
-0.8322493433952332,
0.7703545093536377,... |
func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONMarshaler, data json.RawMessage) []abci.ValidatorUpdate {
var genesisState commontypes.GenesisState
cdc.MustUnmarshalJSON(data, &genesisState)
am.keeper.InitGenesis(ctx, genesisState)
return []abci.ValidatorUpdate{}
} | [
-0.982532799243927,
-0.5815675258636475,
0.6380507349967957,
0.6450538635253906,
0.3223753869533539,
0.2514832615852356,
0.13144318759441376,
0.2524296045303345,
-0.32909083366394043,
0.23105080425739288,
-0.7824214696884155,
0.3520463705062866,
-0.283591628074646,
1.3664029836654663,
0.... |
func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONMarshaler) json.RawMessage {
gs := am.keeper.ExportGenesis(ctx)
return cdc.MustMarshalJSON(gs)
} | [
-1.0235093832015991,
-0.3133377134799957,
0.4485105872154236,
0.5313006639480591,
-0.28784966468811035,
0.07796813547611237,
-0.3234899938106537,
-0.8532872200012207,
0.19558283686637878,
0.6746750473976135,
-0.37955591082572937,
0.42732036113739014,
-0.002132033696398139,
1.59653282165527... |
func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) {
} | [
-0.4005165696144104,
-0.042398516088724136,
0.7209445834159851,
0.8639587759971619,
-0.04920453950762749,
0.957088828086853,
0.6464210152626038,
-0.5936022400856018,
0.9169721007347107,
-0.28026390075683594,
0.7539003491401672,
1.1459635496139526,
-0.3002046048641205,
1.055668830871582,
... |
func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate {
return []abci.ValidatorUpdate{}
} | [
-1.1583255529403687,
-0.18401165306568146,
0.6952826976776123,
0.634352445602417,
0.38140949606895447,
0.5462133288383484,
-0.2510705292224884,
-0.0492173470556736,
0.1561456024646759,
-0.47187691926956177,
0.19292117655277252,
0.5178303718566895,
-1.294069766998291,
1.134188175201416,
0... |
func (AppModule) GenerateGenesisState(simState *module.SimulationState) {
// simulation.RandomizedGenState(simState)
} | [
-0.6092718839645386,
0.5842961668968201,
0.46516239643096924,
0.3063042163848877,
0.10101180523633957,
1.0712287425994873,
0.06591473519802094,
0.2569867670536041,
0.7735973596572876,
-0.36197054386138916,
-0.9469246864318848,
-0.3149435222148895,
-0.09089724719524384,
0.8876632452011108,
... |
func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent {
return nil
} | [
0.35321885347366333,
0.007757146842777729,
0.39181822538375854,
0.5084361433982849,
-0.9767101407051086,
0.08220216631889343,
-0.2574055790901184,
-0.5001236200332642,
0.3926791846752167,
0.29786619544029236,
0.6332565546035767,
-1.306447148323059,
-1.0730030536651611,
0.28089308738708496,... |
func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange {
// return simulation.ParamChanges(r)
return nil
} | [
-0.0864100456237793,
0.012748814187943935,
0.370880663394928,
0.6067798137664795,
0.996548056602478,
0.5055466294288635,
0.09503892064094543,
-0.8349746465682983,
0.9199201464653015,
-0.08319525420665741,
-0.5103515386581421,
0.22028425335884094,
-0.4848475456237793,
1.2930852174758911,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.