text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (i *IndexedDB) GetJsValue() js.Value {
return i.val
} | [
-0.17910614609718323,
0.6172289848327637,
0.337078332901001,
0.4788242280483246,
-0.747043788433075,
-0.5064041614532471,
0.324485719203949,
-0.1141781136393547,
-0.29774951934814453,
-0.3897276818752289,
0.466316282749176,
1.0857512950897217,
-0.029908886179327965,
0.3905527591705322,
0... |
func NewActor(cmd *exec.Cmd, readable, writable bool) *Actor {
return &Actor{
cmd: cmd,
input: make(chan string),
output: make(chan string),
readable: readable,
writable: writable,
}
} | [
-0.29554954171180725,
-1.4161075353622437,
0.4287363588809967,
-0.004502433817833662,
-1.5299012660980225,
0.08751481771469116,
-0.13138794898986816,
-0.11799270659685135,
0.029875323176383972,
-0.07449554651975632,
0.8286364078521729,
1.4298454523086548,
-0.5349311828613281,
0.03264540433... |
func (a *Actor) Start(wg *sync.WaitGroup) {
// just use the unexported .start(wg) method in a goroutine
go a.start(wg)
} | [
-0.1573268622159958,
-0.5952580571174622,
0.2173752784729004,
0.23578551411628723,
-0.5930765271186829,
-0.28061434626579285,
0.30366891622543335,
0.818673849105835,
0.3379809856414795,
0.5787888765335083,
-0.19033603370189667,
1.602090835571289,
0.16858349740505219,
0.7186154127120972,
... |
func (a *Actor) Send(m string) { a.input <- m } | [
-0.6618199348449707,
-0.07091854512691498,
0.12996450066566467,
0.20335154235363007,
-0.6473796963691711,
0.9433141946792603,
0.5087052583694458,
-0.6029842495918274,
-0.11462779343128204,
-0.09059162437915802,
-0.28473103046417236,
0.8676640391349792,
-0.5726233720779419,
0.82767468690872... |
func (a *Actor) Read() string { return <-a.output } | [
-0.31378963589668274,
-1.1862825155258179,
0.6061282157897949,
0.15768443048000336,
-1.2194503545761108,
0.24895808100700378,
0.819652259349823,
-0.630729615688324,
0.12404504418373108,
-0.8784031271934509,
0.7395536303520203,
0.9432269930839539,
-0.6416521668434143,
-0.07270382344722748,
... |
func (a *Actor) errLog(err error) {
fmt.Fprintf(os.Stderr, "%s: %s", a.cmd.Path, err)
} | [
0.3008934259414673,
-0.8562493324279785,
0.3734916150569916,
-0.7443984746932983,
-0.74174565076828,
0.8783450126647949,
0.14153560996055603,
0.8555862307548523,
-0.31492793560028076,
0.14647966623306274,
-0.40787655115127563,
0.4554271101951599,
1.1870553493499756,
0.9878069162368774,
0... |
func (a *Actor) start(wg *sync.WaitGroup) (err error) {
var stdin io.WriteCloser
var stdout io.ReadCloser
// notify the wait group when we're done
if wg != nil {
defer wg.Done()
}
// create a pipe for STDIN
if stdin, err = a.cmd.StdinPipe(); err != nil {
a.errLog(err)
return
}
// create a pipe for STD... | [
-0.17092441022396088,
-1.1785213947296143,
0.8272826671600342,
0.12919312715530396,
-0.45520836114883423,
-0.4482365548610687,
0.60695880651474,
0.26165884733200073,
-0.7954331636428833,
0.21740089356899261,
1.014067530632019,
1.1614603996276855,
-0.1587183177471161,
0.8016384243965149,
... |
func NewStage() *Stage {
return &Stage{
wg: &sync.WaitGroup{},
}
} | [
0.24354271590709686,
-0.44707104563713074,
0.156846821308136,
0.8464806079864502,
-1.0984374284744263,
-0.566315233707428,
-0.36513492465019226,
-0.6911989450454712,
-0.4236809015274048,
-0.05478028208017349,
0.44657784700393677,
0.6126412153244019,
-0.7607059478759766,
0.8925706744194031,... |
func (s *Stage) AddActor(a ActorInterface) {
s.actors = append(s.actors, a)
} | [
-1.260023832321167,
-0.7208138704299927,
0.27146458625793457,
-0.006686805747449398,
-0.7176069021224976,
0.72133868932724,
0.9565239548683167,
0.7462455034255981,
0.9078895449638367,
-0.6174220442771912,
0.3370124101638794,
0.11266469955444336,
-0.07825658470392227,
1.5066134929656982,
... |
func (s *Stage) Start() {
for _, a := range s.actors {
s.wg.Add(1)
a.Start(s.wg)
}
} | [
-0.9613860249519348,
-0.7872126698493958,
0.21132636070251465,
0.6477233171463013,
-0.08359646052122116,
-0.3485320806503296,
1.376440167427063,
1.2460615634918213,
0.051128365099430084,
0.4671366214752197,
-0.2931934893131256,
1.7196738719940186,
0.05188754200935364,
1.5269801616668701,
... |
func (s *Stage) SendAll(msg string) {
for _, a := range s.actors {
a.Send(msg)
}
} | [
-0.6877226829528809,
-0.7359021902084351,
0.45776453614234924,
0.5971715450286865,
-0.3173830211162567,
0.3717392683029175,
0.1700686663389206,
0.9268437027931213,
-0.19910311698913574,
-0.05422836169600487,
0.4169328510761261,
1.1928374767303467,
-0.3958570659160614,
1.893246054649353,
... |
func (s *Stage) ReadAll() []string {
msgs := make([]string, len(s.actors))
for i, a := range s.actors {
msgs[i] = strings.TrimSuffix(a.Read(), "\n")
}
return msgs
} | [
-0.38422060012817383,
-1.3644235134124756,
0.7305784821510315,
0.3409683406352997,
-0.046944521367549896,
0.14132162928581238,
-0.8523334264755249,
0.12446372956037521,
-0.24262090027332306,
0.3172549605369568,
0.6455321907997131,
1.3931082487106323,
-0.3920212388038635,
1.6399661302566528... |
func (s *Stage) Stop() {
s.SendAll(stop)
s.wg.Wait()
} | [
-1.4081594944000244,
-0.5398667454719543,
0.08890651166439056,
0.34370681643486023,
-0.5171814560890198,
0.2882964611053467,
0.9649298191070557,
0.5355225801467896,
-0.8779558539390564,
0.5533257722854614,
-0.7680569291114807,
0.5805523991584778,
-0.0443173423409462,
0.9569916129112244,
... |
func NewKeeper(cdc *wire.Codec, paramsKeeper params.Keeper) Keeper {
return Keeper{
cdc: cdc,
paramsKeeper: paramsKeeper,
}
} | [
0.0945533886551857,
-0.9961440563201904,
0.2275928556919098,
0.640639066696167,
-0.8577370643615723,
0.30465859174728394,
-0.08017251640558243,
0.5031272768974304,
-0.19370654225349426,
-0.3834778666496277,
-0.46219953894615173,
0.38354501128196716,
-0.08762563019990921,
1.433866024017334,... |
func InitKeeper(cdc *wire.Codec, paramsKeeper params.Keeper) Keeper {
k := NewKeeper(cdc, paramsKeeper)
return k
} | [
0.057686466723680496,
-1.075203776359558,
0.2100212574005127,
0.7261739373207092,
-0.07769539207220078,
0.09484055638313293,
0.05130556598305702,
1.129547357559204,
-0.5602900981903076,
-0.6662974953651428,
-1.0908364057540894,
0.2916099429130554,
-0.1900271326303482,
1.7920535802841187,
... |
func (k Keeper) SetRat(ctx sdk.Context, key string, value sdk.Rat) {
k.paramsKeeper.Setter().SetRat(ctx, MakeFeeKey(key), value)
} | [
-1.1512218713760376,
-0.6468172669410706,
0.057096004486083984,
-1.3634188175201416,
0.08180413395166397,
0.7518107295036316,
-0.3629102408885956,
-0.4934532046318054,
-1.5325589179992676,
-0.028920087963342667,
-0.18778884410858154,
-0.21195204555988312,
0.47463172674179077,
0.96048653125... |
func (k Keeper) SetInt64(ctx sdk.Context, key string, value int64) {
k.paramsKeeper.Setter().SetInt64(ctx, MakeFeeKey(key), value)
} | [
-1.2990468740463257,
0.23183965682983398,
0.21948885917663574,
1.127907633781433,
0.37831729650497437,
-0.07009084522724152,
0.04494783654808998,
-0.20303533971309662,
-1.0219521522521973,
0.6034530401229858,
-0.453849196434021,
-0.3447727560997009,
-0.4336484968662262,
1.4354650974273682,... |
func (k Keeper) GetRat(ctx sdk.Context, key string) sdk.Rat {
r, err := k.paramsKeeper.Getter().GetRat(ctx, MakeFeeKey(key))
if err != nil {
panic(err)
}
return r
} | [
-0.44023117423057556,
-0.05085349828004837,
0.12737984955310822,
-1.0089747905731201,
0.41911593079566956,
0.1440921574831009,
-0.23199248313903809,
-1.0211423635482788,
-1.2625491619110107,
-0.12492268532514572,
0.5295718312263489,
0.37404534220695496,
-0.10593048483133316,
0.484995096921... |
func (k Keeper) GetInt64(ctx sdk.Context, key string) int64 {
i, err := k.paramsKeeper.Getter().GetInt64(ctx, MakeFeeKey(key))
if err != nil {
panic(err)
}
return i
} | [
-0.9207876920700073,
0.5129169225692749,
0.24637062847614288,
1.1574056148529053,
0.7280192971229553,
-0.6258468627929688,
0.49792543053627014,
-0.6017662286758423,
-0.9482113718986511,
0.28707385063171387,
0.2221185863018036,
0.05429018288850784,
-0.9612332582473755,
0.9095188975334167,
... |
func WriteFile() {
var text = "text content"
var data = []byte(text)
ioutil.WriteFile("tmp", data, 0600)
} | [
0.6329792141914368,
0.2161443829536438,
0.29951852560043335,
-0.7349548935890198,
1.1822031736373901,
0.9158456325531006,
0.1329265683889389,
0.7114447355270386,
-0.973200261592865,
-0.2312307059764862,
-0.7843537330627441,
-0.6350980997085571,
-0.39957621693611145,
0.7096742391586304,
-... |
func ReadFile() {
body, _ := ioutil.ReadFile("tmp")
var text = string(body)
println(text)
} | [
0.6218706369400024,
-0.18642455339431763,
0.5597546100616455,
-0.7091789841651917,
0.12876668572425842,
1.5207204818725586,
-0.2091497778892517,
0.11566898226737976,
-1.3483623266220093,
-0.2663026452064514,
0.3108452558517456,
0.3343051075935364,
-0.09911151975393295,
-0.19499461352825165... |
func (n *NewsArticle) Title() string {
return n.title
} | [
0.151248961687088,
0.4174005687236786,
-0.44650518894195557,
0.11212942749261856,
0.2367936670780182,
0.30908313393592834,
-0.8467003703117371,
-0.4498251974582672,
0.020490553230047226,
-0.23810018599033356,
-0.15926676988601685,
-0.8521953225135803,
-0.937717854976654,
-0.372404903173446... |
func (s *CommitmentObject) MarkDelete() {
s.deleted = true
} | [
1.093239188194275,
0.12089141458272934,
0.2544316053390503,
0.614615261554718,
1.397068738937378,
0.6919339895248413,
0.30652114748954773,
1.2132092714309692,
0.4587741196155548,
0.31213003396987915,
-0.1578012853860855,
0.34710273146629333,
-0.4230740964412689,
0.030571019276976585,
-0.... |
func (s *CommitmentObject) Reset() bool {
s.commitmentState = NewCommitmentState()
return true
} | [
-0.4241572320461273,
-0.0365372933447361,
0.5145911574363708,
-0.11591290682554245,
-0.140651673078537,
0.5867459774017334,
0.1784604787826538,
0.17451384663581848,
-0.7364928126335144,
1.1130675077438354,
-0.40659117698669434,
-0.5846573710441589,
-0.9846765995025635,
-0.9068167805671692,... |
func (s CommitmentObject) IsEmpty() bool {
temp := NewCommitmentState()
return reflect.DeepEqual(temp, s.commitmentState) || s.commitmentState == nil
} | [
-0.596599280834198,
-0.7189539074897766,
0.5052708387374878,
0.15540297329425812,
0.5438386797904968,
0.1389429122209549,
-0.02304239198565483,
0.2936072051525116,
0.09801705181598663,
0.7933205366134644,
-0.5389329195022583,
-0.04246225580573082,
-0.40367811918258667,
-0.48059505224227905... |
func (s *CommitmentIndexObject) MarkDelete() {
s.deleted = true
} | [
0.8103927373886108,
0.39201536774635315,
0.12619559466838837,
0.46624934673309326,
1.5175539255142212,
0.5977948904037476,
0.3353765606880188,
0.7428272366523743,
0.6157917976379395,
0.23891623318195343,
-0.026774968951940536,
0.4689522683620453,
-0.3891955316066742,
-0.43384087085723877,
... |
func (s *CommitmentIndexObject) Reset() bool {
s.commitmentHash = common.Hash{}
return true
} | [
-0.519374430179596,
0.3213580846786499,
0.4216654300689697,
0.23480626940727234,
-0.09764290601015091,
0.8348710536956787,
0.35109037160873413,
-0.22932688891887665,
-0.9188566207885742,
0.8168219923973083,
-0.5171679258346558,
-0.3353223502635956,
-1.0330231189727783,
-1.2165732383728027,... |
func (s CommitmentIndexObject) IsEmpty() bool {
temp := common.Hash{}
return reflect.DeepEqual(temp, s.commitmentHash)
} | [
-0.6729191541671753,
-0.21161499619483948,
0.3969423174858093,
0.5255171060562134,
0.6274566650390625,
0.7178310751914978,
0.09397899359464645,
-0.0942133292555809,
-0.20926323533058167,
0.7341457009315491,
-0.47121790051460266,
0.17533135414123535,
-0.603621244430542,
-0.8054867386817932,... |
func (s *CommitmentLengthObject) MarkDelete() {
s.deleted = true
} | [
1.368774175643921,
0.3552567660808563,
0.1930108517408371,
0.2885088622570038,
1.5158815383911133,
0.7078949809074402,
0.26652956008911133,
0.9687253832817078,
0.6170876622200012,
0.2494097799062729,
-0.4934208393096924,
0.3046196699142456,
-0.4648045003414154,
0.3262672424316406,
0.1842... |
func (s *CommitmentLengthObject) Reset() bool {
s.commitmentLength = new(big.Int).SetUint64(0)
return true
} | [
-0.5404666662216187,
0.9856693148612976,
0.47444307804107666,
-0.29034850001335144,
0.0010850741527974606,
0.9591633081436157,
0.3969680368900299,
0.13825055956840515,
-0.6611920595169067,
0.8137087225914001,
-0.4283657670021057,
-0.20842044055461884,
-1.1310362815856934,
-0.43910926580429... |
func (s CommitmentLengthObject) IsEmpty() bool {
return s.commitmentLength == nil
} | [
0.0689382255077362,
-0.09424521774053574,
0.42305171489715576,
-0.2870705723762512,
0.8089801073074341,
0.8669478893280029,
-0.24707217514514923,
-0.10653604567050934,
-0.004457864910364151,
0.7575370073318481,
-0.6465222239494324,
-0.03390271216630936,
-0.6383633017539978,
-0.306458175182... |
func formatRequest(r *http.Request) string {
// // Create return string
// var request []string
// // Add the request string
// url := fmt.Sprintf("%v %v %v", r.Method, r.URL, r.Proto)
// request = append(request, url)
// // Add the host
// request = append(request, fmt.Sprintf("Host: %v", r.Host))
// // Loop t... | [
-0.6264684796333313,
-0.9519537091255188,
0.7668861150741577,
-0.705247163772583,
-0.2938529849052429,
0.12451232969760895,
-0.7184584736824036,
-0.45569491386413574,
-0.37099647521972656,
-0.43221166729927063,
1.0993473529815674,
0.36411911249160767,
-0.8231731057167053,
0.672566652297973... |
func prettyprint(b []byte) []byte {
var out bytes.Buffer
json.Indent(&out, b, "", " ")
return out.Bytes()
} | [
0.510862410068512,
0.20332327485084534,
0.7865860462188721,
-0.5397957563400269,
-0.2701123356819153,
0.3413028120994568,
-0.5431080460548401,
-0.6718116402626038,
0.10633904486894608,
0.4284003973007202,
-0.39524006843566895,
0.421401709318161,
-0.8689293265342712,
-0.5792245864868164,
... |
func Startup() {
log.Println("[elk] config file : ", viper.ConfigFileUsed())
httpAddr = viper.GetString("elasticsearch.listen")
outputFileName := viper.GetString("elasticsearch.output")
// Catch signals to cleanup before exiting
c := make(chan os.Signal, 2)
signal.Notify(c, os.Interrupt, syscall.SIGTERM|syscal... | [
-0.2187725156545639,
-1.0508842468261719,
1.102113962173462,
0.466798335313797,
0.5332320332527161,
-0.2599206864833832,
0.20830568671226501,
0.33015012741088867,
-0.31325989961624146,
-0.09344733506441116,
0.019869547337293625,
0.6915263533592224,
0.11210953444242477,
0.43505850434303284,... |
func NewContainerFieldUpdater() DeploymentFieldUpdater {
return &containerUpdater{}
} | [
-0.5441026091575623,
-1.3302570581436157,
0.14187046885490417,
0.30913522839546204,
-1.3522062301635742,
0.1971423625946045,
-0.1679164618253708,
-0.11369216442108154,
0.018129488453269005,
0.21993227303028107,
0.055330656468868256,
-1.0243666172027588,
0.1306772530078888,
0.70915883779525... |
func (tree *Tree) insert( m int) {
if tree != nil {
if tree.LeftNode == nil {
tree.LeftNode = &Tree{nil,m,nil}
} else {
if tree.RightNode == nil {
tree.RightNode = &Tree{nil,m,nil}
} else {
if tree.LeftNode != nil {
tree.LeftNode.insert(m)
} else {
tree.RightNode.insert(m)
}
}
}
} else {
tree = &Tree{nil,m,nil}
}
} | [
-0.8572011590003967,
1.1648838520050049,
0.6040529012680054,
-1.0507293939590454,
-0.11633533984422684,
0.16586963832378387,
-0.04824334755539894,
0.7920005917549133,
-0.3161735236644745,
0.5548761487007141,
-0.9399124383926392,
-0.20998260378837585,
-1.3972899913787842,
1.4581276178359985... |
func print(tree *Tree) {
if tree != nil {
fmt.Println(" Value",tree.Value)
fmt.Printf("Tree Node Left")
print(tree.LeftNode)
fmt.Printf("Tree Node Right")
print(tree.RightNode)
} else {
fmt.Printf("Nil\n")
}
} | [
0.19436347484588623,
-0.1127166748046875,
0.6985086798667908,
-0.4448811113834381,
-0.3323756754398346,
0.34410542249679565,
-1.1048392057418823,
0.03182074800133705,
-0.0836837962269783,
0.09557272493839264,
0.05420883744955063,
0.6829496622085571,
-0.06363445520401001,
1.486488699913025,... |
func (fw *AzureSqlFirewallRuleManager) Ensure(ctx context.Context, obj runtime.Object, opts ...resourcemanager.ConfigOption) (bool, error) {
instance, err := fw.convert(obj)
if err != nil {
return false, err
}
subscriptionID := instance.Spec.SubscriptionID
groupName := instance.Spec.ResourceGroup
server := ins... | [
-0.017200874164700508,
0.3943712115287781,
0.8608313798904419,
-0.23210029304027557,
1.1086760759353638,
0.13140982389450073,
-0.23766298592090607,
-0.4041966199874878,
-0.10063216090202332,
0.22818253934383392,
-0.23574328422546387,
-0.14703938364982605,
-0.7312928438186646,
0.78851717710... |
func (fw *AzureSqlFirewallRuleManager) Delete(ctx context.Context, obj runtime.Object, opts ...resourcemanager.ConfigOption) (bool, error) {
instance, err := fw.convert(obj)
if err != nil {
return false, err
}
subscriptionID := instance.Spec.SubscriptionID
groupName := instance.Spec.ResourceGroup
server := ins... | [
0.4656442403793335,
0.7228095531463623,
1.0108208656311035,
-0.14372292160987854,
0.6145926117897034,
0.5324693918228149,
0.2722077965736389,
-0.2480354905128479,
-0.12720099091529846,
0.4656328856945038,
0.04547537490725517,
-0.3218759298324585,
-0.7836948037147522,
0.760068416595459,
-... |
func (fw *AzureSqlFirewallRuleManager) GetParents(obj runtime.Object) ([]resourcemanager.KubeParent, error) {
instance, err := fw.convert(obj)
if err != nil {
return nil, err
}
return []resourcemanager.KubeParent{
{
Key: types.NamespacedName{
Namespace: instance.Namespace,
Name: instance.Spec.S... | [
-0.039948735386133194,
0.6320879459381104,
0.49324411153793335,
-0.6100549101829529,
0.1831323355436325,
-0.12704937160015106,
-0.1163974478840828,
-0.6759511828422546,
0.25903549790382385,
0.4701545536518097,
-0.004642790649086237,
0.23657608032226562,
-0.3061665892601013,
1.1841684579849... |
func (AppModuleBasic) Name() string { return types.ModuleName } | [
-0.45558008551597595,
-0.7744801044464111,
0.3471018373966217,
0.8236920833587646,
-0.2751672863960266,
1.139162302017212,
-0.5973710417747498,
-1.264533519744873,
-0.26170867681503296,
0.945909321308136,
-0.1166713684797287,
-0.27387088537216187,
0.4173685908317566,
0.5937542915344238,
... |
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
types.RegisterLegacyAminoCodec(cdc)
} | [
0.3904978036880493,
-0.20405201613903046,
0.5275859236717224,
-0.48907706141471863,
0.056303802877664566,
0.14128521084785461,
-0.24475319683551788,
0.0062751155346632,
0.6903110146522522,
-1.4028536081314087,
-0.8004726767539978,
1.3021115064620972,
0.48452290892601013,
0.9213565587997437... |
func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwruntime.ServeMux) {
if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil {
panic(err)
}
} | [
0.07702387869358063,
0.23643699288368225,
0.4423508942127228,
-0.13582611083984375,
0.8866550326347351,
1.1779617071151733,
0.2785828411579132,
-0.6021615862846375,
-1.149851679801941,
0.20895600318908691,
-0.19563792645931244,
0.5878809690475464,
-1.585321307182312,
-0.09214897453784943,
... |
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 (am AppModule) IsOnePerModuleType() {} | [
-0.3701845109462738,
-0.11513083428144455,
0.5019823312759399,
1.3043512105941772,
0.23987531661987305,
0.3915899395942688,
0.0738028809428215,
-0.6224507689476013,
1.1763648986816406,
0.5650694966316223,
0.22690454125404358,
0.23830147087574005,
-0.9202157855033875,
1.5449190139770508,
... |
func (am AppModule) IsAppModule() {} | [
-0.5951194763183594,
-0.816601037979126,
0.39873620867729187,
1.5267648696899414,
-0.2875165045261383,
0.944718062877655,
-0.43592044711112976,
-0.05494101345539093,
1.7123934030532837,
0.5789154767990112,
0.669825553894043,
1.1523125171661377,
0.3936256766319275,
0.9344302415847778,
-1.... |
func (am AppModule) RegisterServices(registrar grpc.ServiceRegistrar) error {
types.RegisterMsgServer(registrar, am.keeper)
types.RegisterQueryServer(registrar, am.keeper)
return nil
} | [
-0.6499653458595276,
0.8990123867988586,
0.35898202657699585,
0.5487970113754272,
0.8912018537521362,
0.8779218196868896,
0.4640701711177826,
-0.5313574075698853,
0.2556628882884979,
-0.7089504599571228,
0.18709796667099,
0.5633482933044434,
-0.8314632177352905,
1.7329883575439453,
0.509... |
func NewAppModule(cdc codec.Codec, keeper keeper.Keeper) AppModule {
return AppModule{
AppModuleBasic: AppModuleBasic{cdc: cdc},
keeper: keeper,
}
} | [
0.023412859067320824,
-0.759799063205719,
0.3828866183757782,
0.7732815146446228,
-0.5722293853759766,
1.3549808263778687,
-1.4240440130233765,
-0.42321866750717163,
0.3469160795211792,
-0.031968217343091965,
-0.5708392262458801,
0.8920985460281372,
0.6313545107841492,
0.468930184841156,
... |
func (AppModule) Name() string { return types.ModuleName } | [
-0.41787388920783997,
-0.7772024273872375,
0.23767878115177155,
0.4639391601085663,
-0.2679980397224426,
1.0729248523712158,
-0.3723086714744568,
-0.7443119883537292,
0.24912092089653015,
1.2376611232757568,
0.01946939527988434,
-0.04762470722198486,
0.3576582372188568,
0.8474292755126953,... |
func (bo *localBlockOracle) BlockEligible(id mesh.LayerID, pubKey string) bool {
return bo.oc.Eligible(uint32(id), bo.committeeSize, pubKey, nil)
} | [
1.220685601234436,
0.7181424498558044,
0.4756981432437897,
-0.6804863214492798,
-0.3040618598461151,
0.17914186418056488,
-0.7172779440879822,
-0.14972753822803497,
-0.4710454046726227,
0.622299075126648,
-0.4535236358642578,
0.28120097517967224,
-1.0263445377349854,
0.7042300701141357,
... |
func (bo *blockOracle) BlockEligible(id mesh.LayerID, pubKey string) bool {
return bo.oc.Eligible(uint32(id), bo.committeeSize, pubKey)
} | [
1.1012228727340698,
0.8719508051872253,
0.4862927198410034,
-0.598175585269928,
-0.23555418848991394,
0.2747728228569031,
-0.7815070152282715,
-0.3064810037612915,
-0.525771975517273,
0.5974195003509521,
-0.4051996171474457,
0.3979484438896179,
-1.0237919092178345,
0.5344484448432922,
1.... |
func (bo *hareOracle) Eligible(id uint32, committeeSize int, pubKey string, proof []byte) bool {
//note: we don't use the proof in the oracle server. we keep it just for the future syntax
//todo: maybe replace k to be uint32 like hare wants, and don't use -1 for blocks
return bo.oc.Eligible(id, committeeSize, pubKey... | [
0.9425683617591858,
0.6824364066123962,
0.5071505308151245,
-0.1336531639099121,
-0.08803512156009674,
-0.09839123487472534,
-0.9414588809013367,
0.7097476124763489,
0.03629340976476669,
0.8358046412467957,
0.11923915147781372,
0.3953096270561218,
-0.4823892116546631,
0.35851749777793884,
... |
func (m *Memory) Store(_ context.Context, key string, value process.Context) error {
m.mx.Lock()
defer m.mx.Unlock()
m.storage[key] = value
return nil
} | [
0.303708553314209,
0.19965441524982452,
0.0024773210752755404,
-0.0421612448990345,
-0.38575002551078796,
0.2736908197402954,
0.08138790726661682,
-1.1254711151123047,
0.27444013953208923,
-0.2497892528772354,
-0.47284385561943054,
0.6419814229011536,
-1.3587756156921387,
0.292345345020294... |
func (m *Memory) Get(_ context.Context, key string) (process.Context, bool) {
m.mx.RLock()
defer m.mx.RUnlock()
value, ok := m.storage[key]
return value, ok
} | [
-0.5466973781585693,
0.2413235753774643,
0.5140126943588257,
-0.5085321664810181,
-0.16073228418827057,
-0.6674026846885681,
-0.4842657744884491,
-0.8982481956481934,
-0.43283751606941223,
0.9999111890792847,
-0.12363924831151962,
0.5727387070655823,
-0.9252163171768188,
-0.454640001058578... |
func (m *Memory) Delete(_ context.Context, key string) error {
m.mx.Lock()
defer m.mx.Unlock()
delete(m.storage, key)
return nil
} | [
0.7042839527130127,
0.6547024846076965,
0.25834405422210693,
0.6953129768371582,
0.15342403948307037,
-0.4372618496417999,
-0.26580408215522766,
-0.4470546543598175,
0.23376943171024323,
0.7545562386512756,
0.18822990357875824,
0.5157946944236755,
-1.4300819635391235,
0.2572348415851593,
... |
func NewDecider() *Decider {
return &Decider{
currentContents: entry.RaceEntry{
LeaderID: "",
HostPort: nil,
TermExpiry: time.Time{},
ElectionNumber: entry.NoElections,
Token: nil,
},
// Pick a random base-generation number so mixed-up tokens or
// colliding memory-addre... | [
0.04762226715683937,
-1.4439867734909058,
0.15318556129932404,
-0.22384732961654663,
-0.6924816966056824,
0.0683872401714325,
-0.5814535021781921,
0.3954024612903595,
-0.3430178463459015,
-0.4671389162540436,
0.1477207988500595,
0.013169721700251102,
-0.24664995074272156,
1.393999218940734... |
func (d *Decider) ReadCurrent(ctx context.Context) (*entry.RaceEntry, error) {
d.l.Lock()
defer d.l.Unlock()
ret := d.currentContents
ret.Token = &token{incarnation: d.incarnation, self: d, ts: d.writeTS}
return &ret, nil
} | [
-0.6724343299865723,
-1.284257411956787,
0.5102895498275757,
-0.6093107461929321,
-0.4505853056907654,
0.05340442806482315,
0.09368367493152618,
-0.023922717198729515,
-1.4844979047775269,
0.2170192003250122,
1.2586686611175537,
0.6423839926719666,
0.5638414025306702,
-0.2272455245256424,
... |
func Drive(driveS *drive.Service, callArgs *[]string, driveRoot *string, localList *[]string, driveList *map[string]string) error {
for i := range *localList {
//open file
fLink, err := os.Open((*localList)[i])
if err != nil {
return err
}
//trims file location to include target folder
tem... | [
-0.7886503338813782,
-0.6949830055236816,
0.8200246095657349,
0.5462630987167358,
0.6207219362258911,
0.2755672335624695,
0.7432683110237122,
-0.005204232409596443,
-0.446130633354187,
-0.5849350094795227,
0.8427630662918091,
0.018054282292723656,
-0.8607872128486633,
1.3996267318725586,
... |
func (r *VirtualGateway_VirtualGatewayListenerTlsFileCertificate) AWSCloudFormationType() string {
return "AWS::AppMesh::VirtualGateway.VirtualGatewayListenerTlsFileCertificate"
} | [
1.7284749746322632,
0.022375794127583504,
0.20772893726825714,
0.11516239494085312,
0.4235920310020447,
0.0524350181221962,
-0.01039829570800066,
0.1685306876897812,
-0.14683552086353302,
-0.07891830056905746,
0.10548011213541031,
0.25750303268432617,
0.27626824378967285,
0.864068329334259... |
func (net *Network) NewBlankNeuron() (*Neuron, NeuronIndex) {
// Pre-allocate room for 16 connections and use Linear as the default activation function
neuron := Neuron{Net: net, InputNodes: make([]NeuronIndex, 0, 16), ActivationFunction: Swish}
neuron.neuronIndex = NeuronIndex(len(net.AllNodes))
net.AllNodes = app... | [
-0.20646227896213531,
-0.6919748783111572,
0.573760449886322,
-0.33782634139060974,
0.8841947913169861,
-0.4886976182460785,
0.2379501760005951,
0.25799480080604553,
0.7745603322982788,
-0.22242210805416107,
-1.0505152940750122,
0.9256826043128967,
-0.35850197076797485,
-0.2072123587131500... |
func (net *Network) NewNeuron() (*Neuron, NeuronIndex) {
chosenActivationFunctionIndex := ActivationFunctionIndex(rand.Intn(len(ActivationFunctions)))
inputNodes := make([]NeuronIndex, 0, 16)
neuron := Neuron{
Net: net,
InputNodes: inputNodes,
ActivationFunction: chosenActivationFunction... | [
-0.47780510783195496,
-0.7087941765785217,
0.6016933917999268,
-0.17462557554244995,
0.5156673789024353,
-0.33059242367744446,
0.39915359020233154,
0.7178622484207153,
0.9210434556007385,
-0.46585339307785034,
-0.8053566813468933,
0.5122308731079102,
-0.1257506012916565,
-0.467220008373260... |
func NewUnconnectedNeuron() *Neuron {
// Pre-allocate room for 16 connections and use Linear as the default activation function
neuron := Neuron{Net: nil, InputNodes: make([]NeuronIndex, 0, 16), ActivationFunction: Linear}
neuron.neuronIndex = -1
return &neuron
} | [
0.1998780369758606,
-0.2992734909057617,
0.5337749123573303,
-0.7458398938179016,
0.7058217525482178,
-0.3731425404548645,
0.2877179682254791,
0.43975457549095154,
0.28834784030914307,
-1.1879154443740845,
-0.872261643409729,
0.27603164315223694,
-0.3641332685947418,
-0.5073061585426331,
... |
func (neuron *Neuron) Connect(net *Network) {
neuron.InputNodes = []NeuronIndex{}
neuron.Net = net
for ni := range net.AllNodes {
// Check if this network already has a pointer to this neuron
if &net.AllNodes[ni] == neuron {
// Yes, assign the index
neuron.neuronIndex = NeuronIndex(ni)
// All good, bail... | [
-0.7060976028442383,
-0.46456363797187805,
0.42964819073677063,
-0.026519211009144783,
0.8810114860534668,
0.29879987239837646,
-0.0705244317650795,
0.3494482934474945,
0.5456627607345581,
0.3048099875450134,
-0.0897933691740036,
-0.3554149270057678,
-0.5536438226699829,
0.4636416137218475... |
func (neuron *Neuron) RandomizeActivationFunction() {
chosenActivationFunctionIndex := ActivationFunctionIndex(rand.Intn(len(ActivationFunctions)))
neuron.ActivationFunction = chosenActivationFunctionIndex
} | [
-0.9498605728149414,
-0.21276287734508514,
0.1155870109796524,
0.30283236503601074,
1.0508078336715698,
-0.5915209650993347,
1.0722650289535522,
0.8679326772689819,
0.9136541485786438,
-0.2794630527496338,
-0.41046977043151855,
1.1418880224227905,
-0.3852493464946747,
-1.157434344291687,
... |
func (neuron *Neuron) SetValue(x float64) {
neuron.Value = &x
} | [
0.5071715116500854,
1.0402588844299316,
0.3718566298484802,
1.100743293762207,
0.7026374936103821,
0.48893776535987854,
-0.5926275849342346,
-0.5617668628692627,
0.0019265030277892947,
-0.1470731943845749,
-0.6408138275146484,
0.7841958403587341,
0.13769523799419403,
0.3310111165046692,
... |
func (neuron *Neuron) HasInput(e NeuronIndex) bool {
for _, ni := range neuron.InputNodes {
if ni == e {
return true
}
}
return false
} | [
-0.24386046826839447,
0.46299585700035095,
0.3849131166934967,
-0.00037326980964280665,
0.4737144410610199,
0.03284955769777298,
0.7094554901123047,
0.3308940827846527,
0.2845304310321808,
-0.016362661495804787,
-0.3624867796897888,
-0.7296990752220154,
-0.47103846073150635,
0.324216127395... |
func (neuron *Neuron) FindInput(e NeuronIndex) (int, bool) {
for i, n := range neuron.InputNodes {
if n == e {
return i, true
}
}
return -1, false
} | [
-1.2676734924316406,
0.06733608990907669,
0.723794162273407,
0.019399413838982582,
-0.24703358113765717,
0.018093565478920937,
1.2903836965560913,
0.0003396642568986863,
-0.14045916497707367,
0.6368479132652283,
-0.4310891032218933,
-0.5929571986198425,
-0.9214973449707031,
0.4907920658588... |
func (neuron *Neuron) Is(e NeuronIndex) bool {
return neuron.neuronIndex == e
} | [
-0.6291896104812622,
-0.5606623291969299,
0.12669993937015533,
0.7660813927650452,
1.0663405656814575,
0.0346669927239418,
-0.5098669528961182,
-0.10113003849983215,
1.4392530918121338,
0.2752578854560852,
0.11756002902984619,
0.8223103284835815,
-0.08752833306789398,
-0.27973467111587524,... |
func (neuron *Neuron) AddInput(ni NeuronIndex) error {
if neuron.Is(ni) {
return errors.New("adding a neuron as input to itself")
}
if neuron.HasInput(ni) {
return errors.New("neuron already exists")
}
neuron.InputNodes = append(neuron.InputNodes, ni)
return nil
} | [
-0.6852024793624878,
0.6187112331390381,
0.2755942642688751,
0.6235913038253784,
0.6991049647331238,
0.8723744750022888,
0.5169398188591003,
-0.027410058304667473,
1.0978957414627075,
-0.5079432725906372,
0.12632955610752106,
0.20833757519721985,
-1.0307272672653198,
0.3404954969882965,
... |
func (neuron *Neuron) AddInputNeuron(n *Neuron) error {
// If n.neuronIndex is known to this network, just add the NeuronIndex to neuron.InputNeurons
if neuron.Net.Exists(n.neuronIndex) {
return neuron.AddInput(n.neuronIndex)
}
// If not, add this neuron to the network first
node := *n
node.neuronIndex = Neuron... | [
-0.9351930022239685,
-0.09731794893741608,
0.5035412311553955,
-0.013719729147851467,
0.46829912066459656,
0.5935221314430237,
0.523059070110321,
0.3457822799682617,
1.3320543766021729,
-0.47570115327835083,
-0.8439992666244507,
-0.48103469610214233,
-1.2360368967056274,
-0.003926639910787... |
func (neuron *Neuron) RemoveInput(e NeuronIndex) error {
if i, found := neuron.FindInput(e); found {
// Found it, remove the neuron at index i
neuron.InputNodes = append(neuron.InputNodes[:i], neuron.InputNodes[i+1:]...)
return nil
}
return errors.New("neuron does not exist")
} | [
-0.5861958265304565,
0.4843827188014984,
0.4491959512233734,
0.07005023211240768,
0.3958800137042999,
0.4214201867580414,
1.2998818159103394,
0.730259895324707,
0.5123569369316101,
0.6505335569381714,
-0.29438161849975586,
-0.5946695804595947,
-1.3929439783096313,
-0.1817421317100525,
0.... |
func (net *Network) Exists(ni NeuronIndex) bool {
for i := range net.AllNodes {
neuronIndex := NeuronIndex(i)
if neuronIndex == ni {
return true
}
}
return false
} | [
-0.9279695153236389,
-0.4222443103790283,
0.32360562682151794,
-0.10212485492229462,
1.0955699682235718,
-0.01488906517624855,
-0.44623255729675293,
-0.0018632535357028246,
0.4643643796443939,
-0.3251543641090393,
-0.16673815250396729,
-0.5397794842720032,
-0.3238879144191742,
0.1150285452... |
func (neuron *Neuron) InputNeuronsAreGood() bool {
for _, inputNeuronIndex := range neuron.InputNodes {
if !neuron.Net.Exists(inputNeuronIndex) {
return false
}
}
return true
} | [
-0.37912577390670776,
0.4856773614883423,
0.4489755928516388,
-0.30011868476867676,
0.660168468952179,
0.4964253008365631,
0.05859214812517166,
0.23885256052017212,
-0.2492743879556656,
0.36673250794410706,
-0.14708708226680756,
0.2667258083820343,
-0.6550856232643127,
0.6649824976921082,
... |
func (neuron *Neuron) evaluate(weight float64, maxEvaluationLoops *int) (float64, bool) {
if *maxEvaluationLoops <= 0 {
return 0.0, true
}
// Assume this is the Output neuron, recursively evaluating the result
// For each input neuron, evaluate them
summed := 0.0
counter := 0
for _, inputNeuronIndex := range ... | [
-0.0538206622004509,
0.09787166863679886,
0.5902042984962463,
0.601226270198822,
0.31108951568603516,
-0.3147512674331665,
0.6950594782829285,
0.20506462454795837,
-0.18517057597637177,
0.08956341445446014,
-0.06504230946302414,
-0.7208059430122375,
-0.644109845161438,
0.4046354293823242,
... |
func (neuron *Neuron) GetActivationFunction() func(float64) float64 {
return ActivationFunctions[neuron.ActivationFunction]
} | [
0.36366066336631775,
-0.2754446566104889,
0.1478559374809265,
1.2443574666976929,
0.24725346267223358,
-1.3933382034301758,
0.6567965149879456,
0.7431195378303528,
-0.1450464129447937,
-0.0938204899430275,
-0.40771451592445374,
0.8416505455970764,
0.2079227864742279,
-0.8019506931304932,
... |
func (neuron *Neuron) In(collection []NeuronIndex) bool {
for _, existingNodeIndex := range collection {
if neuron.Is(existingNodeIndex) {
return true
}
}
return false
} | [
-0.023624926805496216,
-0.5198618173599243,
0.3531308174133301,
0.2385401874780655,
0.4158318042755127,
0.4296688437461853,
0.30866748094558716,
0.2119351029396057,
-0.4505549967288971,
0.15034529566764832,
-0.39634543657302856,
0.5652543306350708,
-0.4855678677558899,
-0.13029839098453522... |
func (neuron *Neuron) IsInput() bool {
if neuron.Net == nil {
return false
}
return neuron.Net.IsInput(neuron.neuronIndex)
} | [
-0.12908430397510529,
0.3039192855358124,
0.31973740458488464,
0.6323307156562805,
0.750782310962677,
0.2510535418987274,
0.4964185655117035,
0.4404417872428894,
1.2558445930480957,
-0.23986850678920746,
-0.23811304569244385,
-0.008317654952406883,
-1.1190894842147827,
0.22069646418094635,... |
func (neuron *Neuron) IsOutput() bool {
if neuron.Net == nil {
return false
}
return neuron.Net.OutputNode == neuron.neuronIndex
} | [
-0.2001117318868637,
-0.15517249703407288,
0.26434293389320374,
0.5792303681373596,
0.4676065444946289,
-0.45293354988098145,
0.7612162828445435,
0.37333944439888,
0.9692080020904541,
0.7299304604530334,
0.11055654287338257,
-0.26648837327957153,
-0.27085813879966736,
-0.0987209603190422,
... |
func (neuron Neuron) Copy(net *Network) Neuron {
var newNeuron Neuron
newNeuron.Net = net
newNeuron.InputNodes = neuron.InputNodes
newNeuron.ActivationFunction = neuron.ActivationFunction
newNeuron.Value = neuron.Value
newNeuron.distanceFromOutputNode = neuron.distanceFromOutputNode
newNeuron.neuronIndex = neuro... | [
-0.45738485455513,
-1.3267316818237305,
0.40036314725875854,
0.6481026411056519,
-0.7246414422988892,
1.0116500854492188,
0.2306576520204544,
-0.14171260595321655,
0.487895667552948,
0.36024776101112366,
-0.34140413999557495,
0.26116061210632324,
-0.23682978749275208,
-0.3536142110824585,
... |
func (neuron *Neuron) String() string {
nodeType := " Node"
if neuron.IsInput() {
nodeType = " Input node"
} else if neuron.IsOutput() {
nodeType = "Output node"
}
return fmt.Sprintf("%s ID %d has these input connections: %v", nodeType, neuron.neuronIndex, neuron.InputNodes)
} | [
-0.22099828720092773,
-0.86750328540802,
0.2859155237674713,
0.3678729832172394,
0.7186244130134583,
-0.030299434438347816,
0.28035297989845276,
-0.9591937065124512,
-0.27052098512649536,
0.28830766677856445,
0.3915155827999115,
0.395719438791275,
-0.6690560579299927,
-0.38797008991241455,... |
func (neuron *Neuron) InputStatement() (*jen.Statement, error) {
// If this node is a network input node, return a statement representing this input,
// like "inputData[0]"
if !neuron.IsInput() {
return jen.Empty(), errors.New(" not an input node")
}
for i, ni := range neuron.Net.InputNodes {
if ni == neuron.n... | [
-0.45667484402656555,
-0.5242316722869873,
0.31214961409568787,
0.0625883936882019,
-0.28969502449035645,
0.07325312495231628,
0.6682336926460266,
-0.14785641431808472,
0.7108640074729919,
-0.046381521970033646,
0.4431897699832916,
-0.05323188751935959,
-1.166286826133728,
-0.0749033018946... |
func TestParseURIWithValidURL(t *testing.T) {
const (
httpPort = "8086"
httpsPort = "433"
httpScheme = "http"
httpsScheme = "https"
hostname = "accounts.couchbase.com"
)
httpURL := fmt.Sprintf("%s://%s:%s", httpScheme, hostname, httpPort)
httpsURL := fmt.Sprintf("%s://%s:%s", httpsScheme, hostnam... | [
-0.5589810609817505,
0.26847296953201294,
0.8195437788963318,
-0.2655995190143585,
0.5293550491333008,
0.26193758845329285,
-0.36611831188201904,
-0.44862672686576843,
0.07983090728521347,
-0.7177083492279053,
-0.5619304180145264,
-0.12633350491523743,
-0.5928910374641418,
-0.3191396296024... |
func (ctx *Context) ReadText() (string, error) {
data, err := wsutil.ReadClientText(ctx.Conn)
if err != nil {
return "", createError(err)
}
return html.EscapeString(string(data)), nil
} | [
0.274383008480072,
0.9142829775810242,
0.4837297201156616,
0.19621580839157104,
-0.7718950510025024,
0.23502741754055023,
-0.9108625650405884,
-0.6909664869308472,
0.04803050681948662,
0.4274214804172516,
0.7839672565460205,
1.0272588729858398,
-0.5375462770462036,
-0.7995063662528992,
-... |
func (ctx *Context) ReadBinary() ([]byte, error) {
data, err := wsutil.ReadClientBinary(ctx.Conn)
if err != nil {
return nil, createError(err)
}
return data, nil
} | [
0.3168221712112427,
-0.026108765974640846,
0.8470377922058105,
0.3582802414894104,
0.32611411809921265,
-0.03910445794463158,
-0.6297542452812195,
-1.3983911275863647,
-0.5180482864379883,
-0.46179428696632385,
0.24872921407222748,
1.272220253944397,
-0.8020853400230408,
-0.023952635005116... |
func (ctx *Context) ReadJSON(t interface{}) error {
data, err := wsutil.ReadClientText(ctx.Conn)
if err != nil {
return createError(err)
}
return json.Unmarshal(data, t)
} | [
-0.9405103325843811,
-0.3433378040790558,
0.679215133190155,
-0.8606303334236145,
-0.7873372435569763,
0.1653052419424057,
0.2519393861293793,
-0.1945635825395584,
-0.19079682230949402,
0.7778139114379883,
-0.02411920763552189,
1.0209431648254395,
0.20669318735599518,
-0.31483861804008484,... |
func (ctx *Context) ReadXML(t interface{}) error {
data, err := wsutil.ReadClientText(ctx.Conn)
if err != nil {
return createError(err)
}
return xml.Unmarshal(data, t)
} | [
-0.44089093804359436,
0.5388959646224976,
0.4802798330783844,
-0.5172897577285767,
-0.96779865026474,
0.6288064122200012,
-0.5268989205360413,
-0.17748907208442688,
0.3330833911895752,
0.02276117540895939,
1.2364319562911987,
0.6830722689628601,
0.01829257793724537,
-0.8003290295600891,
... |
func (ctx *Context) ReplyText(v string) error {
return createError(wsutil.WriteServerMessage(ctx.Conn, gws.OpText, []byte(v)))
} | [
0.1365746259689331,
0.37348994612693787,
0.41985979676246643,
-0.2917158603668213,
-0.5208121538162231,
0.672956645488739,
-0.23961277306079865,
-0.619635820388794,
0.958888053894043,
0.6775943636894226,
-0.8369088768959045,
1.1536000967025757,
-1.2748242616653442,
0.050141893327236176,
... |
func (ctx *Context) ReplyBinary(v []byte) error {
return createError(wsutil.WriteServerMessage(ctx.Conn, gws.OpBinary, v))
} | [
-0.02922862395644188,
0.1482146829366684,
0.6115008592605591,
-0.13081856071949005,
0.6198427677154541,
0.23069417476654053,
0.49646511673927307,
-1.232024908065796,
0.23538397252559662,
0.33801013231277466,
-0.8878862261772156,
1.0874509811401367,
-1.2316882610321045,
0.570324182510376,
... |
func (ctx *Context) ReplyJSON(v interface{}) error {
b, err := json.Marshal(v)
if err != nil {
return err
}
return createError(wsutil.WriteServerMessage(ctx.Conn, gws.OpText, b))
} | [
-0.43956267833709717,
0.1328241229057312,
0.4886833727359772,
-1.0138829946517944,
-0.29685765504837036,
0.5090101957321167,
0.5007596015930176,
-0.709231436252594,
0.690618634223938,
1.2402167320251465,
-0.8858518600463867,
1.792590856552124,
-0.4268353283405304,
0.6920638084411621,
-1.... |
func (ctx *Context) ReplyXML(v interface{}) error {
b, err := xml.Marshal(v)
if err != nil {
return err
}
return createError(wsutil.WriteServerMessage(ctx.Conn, gws.OpText, b))
} | [
-0.025930682197213173,
0.8927866816520691,
0.34966200590133667,
-0.5044959187507629,
-0.32837411761283875,
0.5385425090789795,
-0.07522822916507721,
-0.49277812242507935,
0.9610635042190552,
0.37616705894470215,
0.008989932015538216,
1.0874731540679932,
-1.0419155359268188,
0.3948708772659... |
func (ctx *Context) Disconnect() error {
return ctx.Conn.Close()
} | [
-0.14834880828857422,
-0.01006460189819336,
0.4497595727443695,
0.12300151586532593,
-0.16616366803646088,
0.3258560001850128,
-0.5725223422050476,
-0.6106446385383606,
0.1521659940481186,
-0.10788584500551224,
0.6864619851112366,
0.09559235721826553,
-0.43727758526802063,
-0.5433872938156... |
func (ctx *Context) Log() log.Loggerer {
if ctx.logger == nil {
ctx.logger = ctx.e.Log().WithFields(log.Fields{
"reqid": ctx.Req.ID,
})
}
return ctx.logger
} | [
-0.30748364329338074,
0.2884279489517212,
0.5293891429901123,
0.030962232500314713,
0.36738523840904236,
0.11879240721464157,
-0.03551175445318222,
0.37761709094047546,
0.9319291114807129,
-1.153347134590149,
0.6255784034729004,
-0.46572110056877136,
0.08915472030639648,
0.6136436462402344... |
func (ctx *Context) Abort(httpErroCode int) {
ctx.abortCode = httpErroCode
} | [
-0.10103707760572433,
0.006116279400885105,
0.33347007632255554,
-0.5138100385665894,
0.16335085034370422,
0.45779046416282654,
0.15320710837841034,
-0.7885801196098328,
0.4764518737792969,
-0.24409569799900055,
0.9910512566566467,
0.7208930253982544,
-0.06826082617044449,
0.19978982210159... |
func NewWorkflowsClient(cc grpc.ClientConnInterface) WorkflowsClient {
return src.NewWorkflowsClient(cc)
} | [
0.3013097941875458,
-0.49745628237724304,
-0.02963479980826378,
-0.29528653621673584,
-1.0923552513122559,
-0.5487692356109619,
0.4327530562877655,
-0.773727536201477,
-0.09888583421707153,
-0.2711406946182251,
-0.8741114735603333,
0.44664856791496277,
-0.22539187967777252,
-0.379254579544... |
func RegisterWorkflowsServer(s *grpc.Server, srv WorkflowsServer) {
src.RegisterWorkflowsServer(s, srv)
} | [
-1.452923059463501,
-0.5776114463806152,
0.10513045638799667,
-0.4325551390647888,
0.2638086676597595,
-0.061696767807006836,
0.2691449224948883,
0.0046884603798389435,
0.7853630781173706,
0.02212076261639595,
-1.839432954788208,
0.8366383910179138,
-1.0560657978057861,
0.380671888589859,
... |
func (w *Web) InsertUser(c echo.Context) error {
if c.Get("user_id") != nil {
return echo.NewHTTPError(http.StatusPermanentRedirect, "user already logged in")
}
user := &models.User{}
c.Bind(user)
hash, err := utils.HashPassword(user.Password)
if err != nil {
return echo.NewHTTPError(http.StatusInternalServe... | [
-0.37934407591819763,
-0.08483810722827911,
1.033314824104309,
0.2778286635875702,
0.16691166162490845,
0.037352483719587326,
0.6410552859306335,
0.09186412394046783,
0.3391502797603607,
-0.028935039415955544,
-1.3218506574630737,
-0.4189305305480957,
-0.25454285740852356,
1.13858628273010... |
func (w *Web) LoginUser(c echo.Context) error {
if c.Get("user_id") != nil {
return echo.NewHTTPError(http.StatusPermanentRedirect, "user already logged in")
}
formUser := &models.User{}
c.Bind(formUser)
user, err := w.DB.GetUserByEmail(formUser)
if err != nil {
return err
}
if !utils.ComparePassword(formU... | [
-0.3197050988674164,
-0.8277634382247925,
0.9661135077476501,
0.15124769508838654,
-0.6274740695953369,
-0.19074933230876923,
0.15156902372837067,
-0.2609013617038727,
0.3465190827846527,
-0.14992162585258484,
-1.2825530767440796,
0.11014745384454727,
0.23816931247711182,
0.737817287445068... |
func (us *UsersService) Get(ctx context.Context, name string) (*User, *Response, error) {
u := fmt.Sprintf("users/%s.json", name)
user := new(User)
resp, err := us.client.Get(ctx, u, user)
if err != nil {
return nil, resp, err
}
return user, resp, nil
} | [
-1.178292155265808,
-0.3094172179698944,
0.7391871213912964,
-0.4161769151687622,
0.011732349172234535,
-0.3261602818965912,
-0.5129745602607727,
-1.0663608312606812,
0.08278127759695053,
-0.049556512385606766,
-0.656337320804596,
0.8474239110946655,
-0.26696595549583435,
-0.38353449106216... |
func (l *Level) Next() (*Level, error) {
var nextLevel *Level
index := l.Index + 1
if index >= len(Levels) {
return nextLevel, fmt.Errorf("No such level %d", index)
}
nextLevel = Levels[index]
return nextLevel, nil
} | [
-0.7221100926399231,
0.05704518035054207,
0.19657188653945923,
0.813419759273529,
-0.5319854021072388,
0.35233399271965027,
-0.26583537459373474,
-1.0161240100860596,
0.30121198296546936,
-0.44252240657806396,
-0.030269736424088478,
0.3725624680519104,
-0.8159372210502625,
0.30505561828613... |
func NewCronScheduler() *CronScheduler {
return &CronScheduler{
c: cron.New(),
}
} | [
0.47997990250587463,
-1.022403359413147,
-0.14701683819293976,
0.6143346428871155,
-1.3496739864349365,
-0.3674331307411194,
-0.33361098170280457,
0.6153044104576111,
-0.45687368512153625,
-0.5201703310012817,
-0.5243003368377686,
0.005529006477445364,
-0.3140566051006317,
0.93423485755920... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.