text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (thread *Thread) Edit(ctx aero.Context, key string, value reflect.Value, newValue reflect.Value) (consumed bool, err error) {
switch key {
case "Tags":
newTags := newValue.Interface().([]string)
if len(newTags) < 1 {
return true, errors.New("Need to specify at least one tag")
}
case "Title":
newTit... | [
-0.45096641778945923,
-0.27185723185539246,
0.7060111165046692,
-0.6320614218711853,
-0.2368135154247284,
0.19434335827827454,
-0.26063409447669983,
-0.15502561628818512,
-0.9038230180740356,
0.5382448434829712,
0.3965252637863159,
0.20732183754444122,
-0.7985008955001831,
0.47545057535171... |
func (thread *Thread) OnAppend(ctx aero.Context, key string, index int, obj interface{}) {
onAppend(thread, ctx, key, index, obj)
} | [
0.04465745389461517,
-0.7168357968330383,
0.41381606459617615,
0.4290720224380493,
-1.0377599000930786,
-0.1834930181503296,
-0.9937866926193237,
-0.8078180551528931,
0.5607364773750305,
1.010876178741455,
-0.07200884073972702,
0.39611271023750305,
-0.5133445858955383,
0.2336096614599228,
... |
func (thread *Thread) OnRemove(ctx aero.Context, key string, index int, obj interface{}) {
onRemove(thread, ctx, key, index, obj)
} | [
-0.33025306463241577,
-0.48769867420196533,
0.49674466252326965,
0.26726141571998596,
-0.8831949234008789,
-0.5338438153266907,
-0.3257530927658081,
-0.5942929983139038,
0.9370550513267517,
0.6212533712387085,
-0.4107968509197235,
-0.29140713810920715,
-1.0896883010864258,
-0.6633017063140... |
func (thread *Thread) AfterEdit(ctx aero.Context) error {
thread.Edited = DateTimeUTC()
thread.html = markdown.Render(thread.Text)
return nil
} | [
0.6095495820045471,
-0.8443101048469543,
0.15306860208511353,
-0.3083130121231079,
-0.08826419711112976,
1.1451317071914673,
0.18097297847270966,
0.09216845780611038,
-0.6806086897850037,
-0.6214166283607483,
0.6252025365829468,
0.2522043287754059,
-0.4181819260120392,
0.0531490258872509,
... |
func (thread *Thread) Save() {
DB.Set("Thread", thread.ID, thread)
} | [
-0.020704662427306175,
-0.41232040524482727,
0.30529558658599854,
0.2510008215904236,
1.5632926225662231,
0.5721335411071777,
-0.14336222410202026,
0.01525489054620266,
-0.42635640501976013,
0.3819098472595215,
-1.813363790512085,
0.30420079827308655,
-1.379818320274353,
0.4278635680675506... |
func (thread *Thread) DeleteInContext(ctx aero.Context) error {
user := GetUserFromContext(ctx)
// Write log entry
logEntry := NewEditLogEntry(user.ID, "delete", "Thread", thread.ID, "", fmt.Sprint(thread), "")
logEntry.Save()
return thread.Delete()
} | [
0.74417644739151,
-0.9158197641372681,
0.7206921577453613,
0.0677061453461647,
0.4380727708339691,
0.7517520785331726,
-0.406272292137146,
-0.7690341472625732,
0.5345284342765808,
0.3004915714263916,
0.020447881892323494,
0.4393532872200012,
-1.0335038900375366,
-0.23434223234653473,
-0.... |
func (thread *Thread) Delete() error {
for _, post := range thread.Posts() {
err := post.Delete()
if err != nil {
return err
}
}
// Remove activities
for activity := range StreamActivityCreates() {
if activity.ObjectID == thread.ID && activity.ObjectType == "Thread" {
err := activity.Delete()
if... | [
0.9143223762512207,
-0.1655322164297104,
0.7367878556251526,
0.9012189507484436,
1.4399561882019043,
0.23584114015102386,
0.7581607103347778,
-0.13922761380672455,
0.18568947911262512,
0.25506824254989624,
0.0035273784305900335,
-0.1179102286696434,
-1.5107935667037964,
0.7506468892097473,... |
func GetEnforcer() *casbin.Enforcer {
return enforcer
} | [
0.33023905754089355,
-0.05889493599534035,
0.05568583309650421,
0.5176233053207397,
-0.03166481852531433,
0.4471948444843292,
0.385446697473526,
0.44494181871414185,
-0.323016881942749,
-1.0733122825622559,
-0.1357746422290802,
0.07461994886398315,
-0.9293206930160522,
1.1926885843276978,
... |
func integerBreak(n int) int {
switch n {
case 2, 3:
return n - 1
}
switch n % 3 {
case 0:
return helper343(n / 3)
case 1:
return helper343(n/3-1) * 4
default:
return helper343(n/3) * 2
}
} | [
-0.9373002052307129,
1.1606359481811523,
0.5754315257072449,
0.6779677867889404,
-0.21926777064800262,
0.5548655390739441,
-0.2220686674118042,
-0.21864239871501923,
0.43010202050209045,
-0.010503677651286125,
-0.33382534980773926,
-0.4325805902481079,
-0.6632837057113647,
0.09484511613845... |
func subscribe(ctx context.Context, ch <-chan pubsublib.MessageOrError, messageCount int, filter map[string]string) ([][]byte, error) {
storedMessages := map[string]pubsublib.Message{}
for {
if len(storedMessages) >= messageCount {
return extractBodiesFromMap(storedMessages), nil
}
select {
case <-ctx.Don... | [
-0.20833700895309448,
0.08617610484361649,
0.7240573763847351,
0.08505470305681229,
-0.3909628391265869,
-0.7123528718948364,
-0.28667256236076355,
-0.7544820308685303,
-0.4273364543914795,
0.15292857587337494,
0.0872209444642067,
0.543366014957428,
-0.6964770555496216,
0.7198715209960938,... |
func ReadMessages(ctx context.Context, subscription *pubsub.Subscription, msgCount int, filter map[string]string) ([][]byte, error) {
// Test coverage for ReadMessages is all in the form of tests for the two principal components, since the body of ReadMessages is minimal.
cctx, cancel := context.WithCancel(ctx)
defe... | [
0.2623398005962372,
0.05844873562455177,
0.7913342714309692,
-0.34923380613327026,
0.18097460269927979,
-0.7750731706619263,
-0.3602374494075775,
-0.9371651411056519,
0.1265352964401245,
-0.18318593502044678,
0.4608251452445984,
0.2546663284301758,
-0.6216599941253662,
-0.11597135663032532... |
func Init(level string) error {
log.Debug().Msgf("initializing log with level %s", level)
logLevel, err := zerolog.ParseLevel(level)
if err != nil {
return err
}
zerolog.SetGlobalLevel(logLevel)
zerolog.DisableSampling(true)
log.Logger = zerolog.New(os.Stdout).With().Timestamp().Logger()
return nil
} | [
0.43400561809539795,
-0.6298267841339111,
0.5902177691459656,
-0.5561529397964478,
-0.691704273223877,
0.5792331695556641,
0.03455645218491554,
0.441205233335495,
-0.8316234350204468,
-0.09031318873167038,
-0.003236924298107624,
0.8829746246337891,
-0.5036748051643372,
1.144190788269043,
... |
func StoreContext(ctx context.Context, lg zerolog.Logger) context.Context {
return context.WithValue(ctx, LoggerCtxKey, lg)
} | [
0.20100969076156616,
-0.27725860476493835,
0.2908294200897217,
-0.9966747164726257,
-1.1868113279342651,
0.5997719168663025,
-1.0010111331939697,
-1.0029699802398682,
1.770955204963684,
-0.8205817341804504,
-0.06776221096515656,
0.03913983330130577,
-0.28851884603500366,
0.4623421132564544... |
func GetContext(ctx context.Context) (zerolog.Logger, error) {
lg, ok := ctx.Value(LoggerCtxKey).(zerolog.Logger)
if !ok {
return zerolog.Logger{}, ErrNoLoggerInContext
}
return lg, nil
} | [
-0.21612274646759033,
-0.07095277309417725,
0.6053017377853394,
-0.09137877076864243,
-0.3810074031352997,
-0.7241451144218445,
-0.7133713960647583,
-0.43929359316825867,
1.1957587003707886,
-0.05492885783314705,
0.1352735161781311,
0.5769549012184143,
-0.7911385297775269,
0.97088450193405... |
func CleanHTTPError(error error) error {
message := fmt.Sprintf("%v", error)
regex := regexp.MustCompile("(?i): (get|post|patch) ")
array := regex.Split(message, -1)
return errors.New(array[len(array)-1])
} | [
-0.36473649740219116,
-0.48281699419021606,
0.6253148913383484,
0.5330970287322998,
-0.5040624141693115,
0.4425063729286194,
-0.01976322941482067,
0.12427707016468048,
-0.049124572426080704,
0.969137966632843,
0.34646734595298767,
0.4176952540874481,
-1.1149040460586548,
0.32340008020401,
... |
func NewRunner(pubClientFactory func() publisher.Client, mod *Wrapper) Runner {
return &runner{
done: make(chan struct{}),
mod: mod,
client: pubClientFactory(),
}
} | [
-0.03402591869235039,
-0.6097120046615601,
0.027771349996328354,
-0.4184595048427582,
-0.8263718485832214,
0.6474843621253967,
-0.24243755638599396,
-0.02634705975651741,
-0.26277074217796326,
0.02839093841612339,
-0.1933954507112503,
0.9828163385391235,
-0.6992999315261841,
-0.18846060335... |
func ParseImage(image string) (string, string) {
domain := ""
remainder := ""
i := strings.IndexRune(image, '/')
if i == -1 || (!strings.ContainsAny(image[:i], ".:") && image[:i] != "localhost") {
remainder = image
} else {
domain, remainder = image[:i], image[i+1:]
}
imageName := ""
imageVersion := "unk... | [
-0.8954206109046936,
-1.0140390396118164,
0.6384388208389282,
-0.15061932802200317,
-0.4599396884441376,
-0.15588758885860443,
-0.1478106528520584,
0.7915059924125671,
-0.2390771061182022,
0.8984142541885376,
0.08067529648542404,
0.4319543242454529,
-0.11683475226163864,
0.0054025277495384... |
func GenerateData[N Number](len int, dtype DataType) []Element[N] {
res := make([]Element[N], len)
t := int64(0)
for i := 0; i < len; i++ {
switch dtype {
case Int32:
res[i] = Element[N]{
Timestamp: t,
Value: N(int32(i)),
}
case Float32:
res[i] = Element[N]{
Timestamp: t,
Value: ... | [
-0.9550182819366455,
1.501259446144104,
0.8398275375366211,
-0.07439155131578445,
0.08023764938116074,
0.4073549509048462,
-0.3783622086048126,
-0.267717182636261,
0.6914363503456116,
-0.233261376619339,
-1.3686314821243286,
-0.07527574896812439,
0.4003521800041199,
0.3665866255760193,
0... |
func (r *rds) Connect(confs config.GlobalConfig) error {
var err error
once.Do(func() {
logger = zapLogger.GetZapLogger(confs.Debug())
r.db = redis.NewClient(&redis.Options{
DB: confs.Redis.DB,
Addr: confs.Redis.Host,
Username: confs.Redis.Username,
Password: confs.Redis.Password,
})
... | [
-1.085347056388855,
0.15156236290931702,
0.6374315619468689,
-0.20127305388450623,
-0.06172925606369972,
0.45844054222106934,
-0.43434494733810425,
-0.47237828373908997,
-0.8051193952560425,
0.6846872568130493,
-0.19774317741394043,
-0.03274422883987427,
-0.7180224657058716,
0.349234133958... |
func (r *rds) Set(ctx context.Context, key string, value interface{}, duration time.Duration) error {
p, err := json.Marshal(value)
if err != nil {
zapLogger.Prepare(logger).
Development().
Level(zap.ErrorLevel).
Commit(err.Error())
return err
}
return r.db.Set(ctx, key, p, duration).Err()
} | [
-1.3662222623825073,
0.29601332545280457,
0.407925546169281,
-0.5007314682006836,
-0.2357366383075714,
0.12221483141183853,
-1.0435428619384766,
-1.054630994796753,
-0.7821401953697205,
1.2443054914474487,
-0.4788301885128021,
0.4521642029285431,
-0.41034287214279175,
0.31531068682670593,
... |
func (r *rds) Get(ctx context.Context, key string, dest interface{}) error {
p, err := r.db.Get(ctx, key).Result()
if p == "" {
zapLogger.Prepare(logger).
Development().
Level(zap.ErrorLevel).
Commit(err.Error())
return fmt.Errorf("Value Not Found")
}
if err != nil {
zapLogger.Prepare(logger).
D... | [
-1.3943455219268799,
-0.03830568864941597,
0.9425550103187561,
-1.046718955039978,
-0.5743281841278076,
-0.6538368463516235,
-1.3468657732009888,
-0.9027898907661438,
-0.5516498684883118,
0.7800318002700806,
0.230634406208992,
0.6852666735649109,
-0.519183337688446,
-0.29346126317977905,
... |
func (r *rds) Del(ctx context.Context, key ...string) error {
_, err := r.db.Del(ctx, key...).Result()
if err != nil {
zapLogger.Prepare(logger).
Development().
Level(zap.ErrorLevel).
Commit(err.Error())
return err
}
return nil
} | [
-0.276763916015625,
0.7134890556335449,
0.5978970527648926,
-0.08692073822021484,
-0.07360699772834778,
0.24218714237213135,
-0.38744279742240906,
-1.1975229978561401,
-0.23064005374908447,
-0.09888353198766708,
-0.1956016570329666,
0.1936027705669403,
-0.7646457552909851,
-0.5123275518417... |
func (t *xfconfTable) getDefaultConfig() (map[string]map[string]interface{}, error) {
results := make(map[string]map[string]interface{}, 0)
defaultDirs := getDefaultXfconfDirs()
for _, dir := range defaultDirs {
defaultConfig, err := t.getConfigFromDirectory(dir)
if err != nil {
return nil, fmt.Errorf("error... | [
-0.45098382234573364,
0.9136389493942261,
0.7204129695892334,
1.1595758199691772,
0.668578565120697,
-0.5681142210960388,
0.4805319011211395,
0.08585364371538162,
-1.0174000263214111,
0.35297319293022156,
-0.7652928829193115,
-0.603735625743866,
-0.054994381964206696,
1.4557751417160034,
... |
func getDefaultXfconfDirs() []string {
envDefaultDirsStr := os.Getenv("XDG_CONFIG_DIRS")
if envDefaultDirsStr != "" {
dirs := strings.Split(envDefaultDirsStr, ":")
for i, d := range dirs {
dirs[i] = filepath.Join(d, xfconfChannelXmlPath)
}
return dirs
}
return []string{filepath.Join("/", "etc", "xdg", x... | [
-0.564096212387085,
0.06876792013645172,
0.46069610118865967,
0.14308790862560272,
0.6461729407310486,
-0.3707447350025177,
0.07882070541381836,
0.51377934217453,
-0.8804268836975098,
-0.07560408860445023,
-0.4593994915485382,
-0.46038544178009033,
-0.5492357015609741,
0.9074102640151978,
... |
func (t *xfconfTable) generateForUser(u *user.User, queryContext table.QueryContext, defaultConfig map[string]map[string]interface{}) ([]map[string]string, error) {
var results []map[string]string
// Fetch the user's config from the filesystem once, so we don't have to do it
// repeatedly for each constraint
userC... | [
-0.7886021733283997,
0.7571161985397339,
0.5045693516731262,
0.8291305303573608,
-0.3586552143096924,
-0.5023657083511353,
-0.09867911785840988,
-0.1800130009651184,
-0.7145839333534241,
0.1237296462059021,
-0.7435234785079956,
-0.9464327692985535,
0.10138604789972305,
0.9175180792808533,
... |
func (t *xfconfTable) getUserConfig(u *user.User) (map[string]map[string]interface{}, error) {
userConfigDir := getUserXfconfDir(u)
userConfig, err := t.getConfigFromDirectory(userConfigDir)
if err != nil {
return nil, fmt.Errorf("error getting config for user %s from directory %s: %w", u.Name, userConfigDir, err)... | [
-0.36237257719039917,
0.6073654294013977,
0.5994195342063904,
0.9530558586120605,
-0.7711121439933777,
-0.8505125045776367,
0.7130439877510071,
0.1782863736152649,
-0.7780018448829651,
0.7193344831466675,
-1.3537442684173584,
-0.1271463930606842,
0.4136263430118561,
1.1455740928649902,
0... |
func getUserXfconfDir(u *user.User) string {
userConfigDir := os.Getenv("XDG_CONFIG_HOME")
if userConfigDir != "" {
return filepath.Join(userConfigDir, xfconfChannelXmlPath)
}
return filepath.Join(u.HomeDir, ".config", xfconfChannelXmlPath)
} | [
0.5767139196395874,
0.04084667190909386,
0.4164012372493744,
0.44893595576286316,
-0.5150696635246277,
-0.6342818140983582,
0.6981487274169922,
0.04682090878486633,
-0.7084054350852966,
-0.22548191249370575,
-0.04883810877799988,
-0.3293251693248749,
0.0614595003426075,
0.8386206030845642,... |
func (t *xfconfTable) getConfigFromDirectory(dir string) (map[string]map[string]interface{}, error) {
results := make(map[string]map[string]interface{}, 0)
matches, err := filepath.Glob(filepath.Join(dir, "*.xml"))
if err != nil {
return nil, fmt.Errorf("could not glob for files in directory %s: %w", dir, err)
}... | [
-0.39608657360076904,
0.2625499367713928,
0.6737990379333496,
-0.03104422800242901,
-0.4168197810649872,
-1.2694339752197266,
-0.1612713634967804,
-0.16521039605140686,
-1.4905407428741455,
0.6317903995513916,
-0.6170246601104736,
-0.46991774439811707,
0.3913500905036926,
1.021908402442932... |
func (t *xfconfTable) getCombinedFlattenedConfig(u *user.User, userConfig map[string]map[string]interface{}, defaultConfig map[string]map[string]interface{}, dataQuery string) ([]map[string]string, error) {
var results []map[string]string
flattenOpts := []dataflatten.FlattenOpts{
dataflatten.WithLogger(t.logger),
... | [
-0.563148021697998,
0.480330228805542,
0.60509192943573,
0.001158042810857296,
-0.09821399301290512,
-0.5195925831794739,
-0.029632238671183586,
-0.008616914972662926,
-0.29471349716186523,
0.03363736718893051,
-0.5907943248748779,
0.1844104379415512,
-0.27250444889068604,
0.70191866159439... |
func deduplicate(rows []map[string]string) []map[string]string {
var deduplicated []map[string]string
seenKeys := make(map[string]bool)
for _, row := range rows {
if _, ok := seenKeys[row["fullkey"]]; !ok {
seenKeys[row["fullkey"]] = true
deduplicated = append(deduplicated, row)
}
}
return deduplicate... | [
-0.7975097894668579,
-0.09818317741155624,
0.9194760322570801,
-0.4519229829311371,
-0.4158371090888977,
-0.89692622423172,
-0.14797550439834595,
0.4821072816848755,
-0.16979601979255676,
0.9310954213142395,
-0.779484748840332,
-0.28987425565719604,
-0.21027664840221405,
0.6987580060958862... |
func (s *System) RunSpawner() {
if s.spawning {
panic("already spawning, call Wait first")
}
s.spawning = true
s.spawner.in <- true
} | [
-0.6468528509140015,
-0.1459248960018158,
0.6857079863548279,
1.2168914079666138,
-0.1939297765493393,
0.7434471845626831,
0.41320544481277466,
0.10726634413003922,
-0.2523888051509857,
-0.6495327949523926,
-0.8709269165992737,
0.15365174412727356,
-0.5007903575897217,
1.355602502822876,
... |
func (s *System) Wait() {
if !s.spawning {
panic("spawner is asleep, call RunSpawner to wake him up")
}
<-s.spawner.out
s.allocate() // so we can draw meanwhile spawning particles
s.spawning = false
} | [
0.031405575573444366,
-0.333783894777298,
0.19910208880901337,
0.025068724527955055,
0.23815231025218964,
0.8255124092102051,
0.09368235617876053,
-0.8339310884475708,
0.5185354948043823,
-0.6943926215171814,
-0.5122565627098083,
0.5281455516815186,
0.1733008325099945,
0.7882063984870911,
... |
func (s *System) Spawn() {
if s.spawning {
panic("already spawning")
}
s.clear()
s.spawn()
s.allocate()
} | [
0.11487080156803131,
0.5410469770431519,
0.13235077261924744,
0.9689813256263733,
0.7992618083953857,
0.41452881693840027,
-0.531823456287384,
-1.1412947177886963,
1.36752450466156,
-0.12387606501579285,
-0.15278500318527222,
0.6646413207054138,
0.5965314507484436,
0.5415149927139282,
0.... |
func (s *System) Drop() {
if s.spawner.in != nil {
s.spawner.in <- false
s.spawner.in = nil
}
} | [
-1.2210686206817627,
0.40064191818237305,
0.5651118159294128,
0.2397530972957611,
0.7207460999488831,
0.9223763346672058,
0.5281823873519897,
-0.19868198037147522,
-0.5230815410614014,
-0.22905868291854858,
0.03495124727487564,
0.14269039034843445,
-1.1304527521133423,
1.4821566343307495,
... |
func (s *System) Thread(threadIndex int) *Thread {
return &s.threads[threadIndex]
} | [
-0.35029008984565735,
0.19443438947200775,
-0.06985767930746078,
-0.4694902002811432,
0.7426820397377014,
0.4110499620437622,
0.4112633466720581,
-1.521682620048523,
1.0643327236175537,
-1.2054462432861328,
0.0048097907565534115,
0.96097731590271,
-0.7841103672981262,
-0.6420009136199951,
... |
func (s *System) SetThreads(count int) {
s.threadCount = count
s.threads = make([]Thread, count)
for i := range s.threads {
s.threads[i].idx = i
s.threads[i].System = s
}
s.setupSpawner()
} | [
-0.013422353193163872,
0.33550018072128296,
0.22365257143974304,
-0.020527344197034836,
0.5150665044784546,
0.3237548768520355,
0.3840180039405823,
-0.3158087730407715,
0.6374938488006592,
-0.4292346239089966,
-0.4542522430419922,
0.08147680759429932,
-0.9034978747367859,
0.58323073387146,... |
func (s *System) spawn() {
for i := range s.threads {
t := &s.threads[i]
for _, sr := range t.requests {
str := len(s.particles)
s.particles.Resize(str + sr.Amount)
for i := 0; i < sr.Amount; i++ {
r := sr.Rotation.Gen()
vel := mat.Rad(sr.Spread.Gen()+sr.Dir, sr.Velocity.Gen())
if sr.RotationR... | [
-0.3255949318408966,
-0.6471342444419861,
0.520971953868866,
-0.4060845673084259,
0.42630770802497864,
0.7319726943969727,
-0.33321046829223633,
-0.6377083659172058,
0.48344099521636963,
0.06317668408155441,
-0.2571693956851959,
0.03235214203596115,
-0.2074234038591385,
0.5806586742401123,... |
func (s *System) clear() {
s.vertex = 0
s.indice = 0
var i int
for j := range s.particles {
p := &s.particles[j]
if p.progress >= 1 {
continue
}
p.vertex = s.vertex
p.indice = s.indice
s.vertex += p.vertexes
s.indice += p.indices
s.particles[i] = *p
i++
}
s.particles = s.particles[:i]
... | [
-0.39056193828582764,
0.012761550955474377,
0.33377736806869507,
-0.7042338252067566,
-0.4137035608291626,
0.7446361780166626,
0.10823275148868561,
-0.8529825210571289,
0.2580099105834961,
0.2542129158973694,
0.12774167954921722,
1.0570744276046753,
-0.10014020651578903,
0.2659088373184204... |
func (s *System) allocate() {
s.Vertexes.Resize(s.vertex)
s.Indices.Resize(s.indice)
} | [
-0.4626694619655609,
0.8890558481216431,
0.3074581027030945,
0.26319578289985657,
0.6530786156654358,
0.0011688031954690814,
0.453460693359375,
-0.9457026124000549,
1.034724235534668,
-0.45596182346343994,
0.926978588104248,
0.366909921169281,
0.5568378567695618,
-0.04207199066877365,
-0... |
func (p *particle) update(delta float64) {
p.vel.AddE(p.vel.Scaled(p.Acceleration.Value(p.progress) * delta))
p.vel.AddE(p.pos.To(p.orig).Normalized().Scaled(p.OriginGravity * delta))
p.vel.AddE(p.Gravity.Scaled(delta))
p.vel.SubE(p.vel.Scaled(p.Friction * delta))
p.pos.AddE(p.vel.Scaled(delta))
p.twerk += p.Tw... | [
0.2934530973434448,
-0.49571284651756287,
0.6217761039733887,
-0.8951477408409119,
-0.3920181095600128,
1.1297322511672974,
0.0627707690000534,
-0.09283959865570068,
-0.49363476037979126,
-0.09820733964443207,
-0.2745392322540283,
-1.0245271921157837,
-0.7605153322219849,
0.423031508922576... |
func (t *Thread) Request(r Request) {
if t.spawning {
panic("cannot request particles when System is spawning particles, this is sync issue on your side")
}
if t.threadCount > r.threadCount {
r.setThreads(t.threadCount)
}
t.requests = append(t.requests, r)
} | [
-0.7310576438903809,
0.2605031728744507,
0.31844741106033325,
-0.0012487850617617369,
0.5632249712944031,
0.7677333354949951,
-0.2854453921318054,
-0.8255152106285095,
0.4087955951690674,
-0.3579791188240051,
0.35690128803253174,
0.8198180794715881,
-0.6095179915428162,
0.7161129713058472,... |
func (t *Thread) Update(delta float64) {
if t.spawning {
panic("cannot update when System is spawning particles, this is sync issue on your side")
}
for i := t.idx; i < len(t.particles); i += t.threadCount {
p := &t.particles[i]
p.update(delta)
// we just overwrite data
data := ggl.Data{
Indices: t.I... | [
-0.5307299494743347,
-0.4084189534187317,
0.5303305983543396,
-1.111382246017456,
-0.28982439637184143,
1.1253291368484497,
-0.45733407139778137,
-0.6667405962944031,
-0.1840314269065857,
0.1961609423160553,
-0.2937247157096863,
0.1173262745141983,
-0.6082841157913208,
0.45094287395477295,... |
func (conn *hubConnection) readLoop() {
for {
if _, _, err := conn.socket.NextReader(); err != nil {
log.Println("Error reading websocket: ", err)
conn.socket.Close()
break
}
}
} | [
0.03441767394542694,
-0.7111838459968567,
0.6685069799423218,
-0.010748349130153656,
-0.09807493537664413,
0.6258206367492676,
-0.13502469658851624,
-0.5635359883308411,
-0.30479738116264343,
0.16009140014648438,
1.180260181427002,
0.5709011554718018,
-0.3567112982273102,
0.117041125893592... |
func (a *ChainAdaptor) ValidAddress(req *proto.ValidAddressRequest) (*proto.ValidAddressReply, error) {
address, err := btcutil.DecodeAddress(req.Address, a.getClient().GetNetwork())
if err != nil {
return &proto.ValidAddressReply{
Code: proto.ReturnCode_ERROR,
Msg: err.Error(),
}, err
}
if !address.IsF... | [
-0.5517483353614807,
-0.46260762214660645,
0.846742570400238,
0.0004866319941356778,
0.09198673069477081,
-0.09159897267818451,
-0.11961008608341217,
0.016960540786385536,
1.1805883646011353,
-0.35899749398231506,
0.8439992666244507,
0.7656441330909729,
-0.43736907839775085,
0.133903652429... |
func (a *ChainAdaptor) QueryUtxoTransaction(req *proto.QueryTransactionRequest) (*proto.QueryUtxoTransactionReply, error) {
key := strings.Join([]string{req.Symbol, req.TxHash}, ":")
txCache := cache.GetTxCache()
if r, exist := txCache.Get(key); exist {
return r.(*proto.QueryUtxoTransactionReply), nil
}
txhash,... | [
-0.9302232265472412,
0.17467734217643738,
0.7340291142463684,
-0.62028968334198,
-0.27838799357414246,
-0.20404857397079468,
-0.44582599401474,
-0.7106446623802185,
0.36323004961013794,
0.4130922853946686,
-0.21146290004253387,
0.099510058760643,
-0.6531680822372437,
-0.7455564141273499,
... |
func (a *ChainAdaptor) QueryUtxoTransactionFromSignedData(req *proto.QueryTransactionFromSignedDataRequest) (*proto.QueryUtxoTransactionReply, error) {
res, err := a.decodeTx(req.SignedTxData, req.Vins, true)
if err != nil {
log.Info("QueryTransactionFromSignedData decodeTx", "err", err)
return &proto.QueryUtxoT... | [
-0.6122634410858154,
-0.2402452975511551,
0.4861634075641632,
0.14394977688789368,
-0.6200714707374573,
-0.186936154961586,
-0.7113906741142273,
-0.33293595910072327,
0.3469650447368622,
-0.07322418689727783,
-0.260395884513855,
-0.62752765417099,
-0.43424737453460693,
-0.2769991159439087,... |
func (a *ChainAdaptor) CreateUtxoTransaction(req *proto.CreateUtxoTransactionRequest) (*proto.CreateUtxoTransactionReply, error) {
vinNum := len(req.Vins)
var totalAmountIn, totalAmountOut int64
if vinNum == 0 {
err := fmt.Errorf("no Vin in req:%v", req)
return &proto.CreateUtxoTransactionReply{
Code: proto.... | [
-1.2040672302246094,
-0.08752622455358505,
1.0779800415039062,
-0.16601835191249847,
-0.018079429864883423,
-0.5087242126464844,
0.18593136966228485,
-0.15988153219223022,
0.340915709733963,
0.3803878128528595,
-0.14568163454532623,
-0.3789747953414917,
-0.05414872616529465,
-0.51450425386... |
func (a *ChainAdaptor) CreateUtxoSignedTransaction(req *proto.CreateUtxoSignedTransactionRequest) (*proto.CreateSignedTransactionReply, error) {
r := bytes.NewReader(req.TxData)
var msgTx wire.MsgTx
err := msgTx.Deserialize(r)
if err != nil {
log.Error("CreateSignedTransaction msgTx.Deserialize", "err", err)
r... | [
-0.8424549102783203,
-0.4519706964492798,
0.8263863921165466,
0.012735051102936268,
0.31978216767311096,
0.008388699032366276,
0.022403739392757416,
-0.25187698006629944,
-0.5024672746658325,
0.5996769070625305,
-0.2190186232328415,
-0.3858321011066437,
-0.5248585939407349,
0.1085534617304... |
func (a *ChainAdaptor) BroadcastTransaction(req *proto.BroadcastTransactionRequest) (*proto.BroadcastTransactionReply, error) {
r := bytes.NewReader(req.SignedTxData)
var msgTx wire.MsgTx
err := msgTx.Deserialize(r)
if err != nil {
return &proto.BroadcastTransactionReply{
Code: proto.ReturnCode_ERROR,
Msg: ... | [
-0.12885470688343048,
-0.5115925073623657,
1.0025348663330078,
-0.09051180630922318,
-0.26606300473213196,
0.34527525305747986,
0.10566404461860657,
-0.47283923625946045,
0.6911089420318604,
0.7284266948699951,
-0.16565638780593872,
0.630155086517334,
-0.7742589712142944,
-0.29110482335090... |
func NewManualConversionsTracker(additionalConversionArguments ...NamedVariable) *ManualConversionsTracker {
return &ManualConversionsTracker{
additionalConversionArguments: additionalConversionArguments,
processedPackages: make(map[string][]error),
conversionFunctions: make(map[ConversionP... | [
-0.7277964353561401,
-0.42263877391815186,
0.3559166491031647,
0.4718264639377594,
-1.5533089637756348,
0.1954994946718216,
-0.6342533826828003,
-0.7241140604019165,
-1.0822442770004272,
-0.025782709941267967,
-0.6234310865402222,
-0.15981025993824005,
-0.8532125949859619,
1.29686641693115... |
func (t *ManualConversionsTracker) findManualConversionFunctions(context *generator.Context, packagePath string) (errors []error) {
if e, present := t.processedPackages[packagePath]; present {
// already processed
return e
}
pkg, err := context.AddDirectory(packagePath)
if err != nil {
return []error{fmt.Err... | [
-0.7892856001853943,
-0.486685574054718,
0.8496732115745544,
0.7207269072532654,
-0.10983698815107346,
-0.3928390145301819,
0.08460543304681778,
-0.5992894172668457,
-0.29262474179267883,
0.6841034889221191,
0.02547394298017025,
0.01986779272556305,
-0.3927381634712219,
1.0883162021636963,... |
func (t *ManualConversionsTracker) isConversionFunction(function *types.Type) (bool, *types.Type, *types.Type) {
signature := function.Underlying.Signature
if signature.Receiver != nil {
klog.V(8).Infof("%s has a receiver", function.Name)
return false, nil, nil
}
if len(signature.Results) != 1 || signature.Res... | [
-0.8854232430458069,
-0.42772266268730164,
0.8318449258804321,
-0.0436362698674202,
-0.5916385650634766,
-0.17274577915668488,
0.1890985667705536,
-0.28682252764701843,
-0.39031586050987244,
1.1153740882873535,
-0.38423463702201843,
0.12106523662805557,
-0.7169216275215149,
0.9001090526580... |
func (t *ManualConversionsTracker) conversionFunctionName(in, out *types.Type) string {
return conversionFunctionName(in, out, t.conversionNamer, t.buffer)
} | [
-0.5089132785797119,
-0.32953405380249023,
0.41770410537719727,
0.5444855093955994,
-1.480846643447876,
-0.13579310476779938,
-0.07363639026880264,
-0.9225112199783325,
-0.5360977053642273,
0.8330731391906738,
-0.3580987751483917,
-0.10366511344909668,
0.023402627557516098,
-0.127541780471... |
func (room *Room) AddPlayer(name string) int {
if room.Summary.P1 == "" {
room.Summary.P1 = name
return 1
} else if room.Summary.P2 == "" {
room.Summary.P2 = name
return 2
} else {
errors.New("don't call AddPlayer when room full pls")
return -1
}
} | [
-1.2076979875564575,
0.33051517605781555,
0.9383781552314758,
0.5719292759895325,
-0.7033404111862183,
0.8359996676445007,
0.2586236298084259,
0.42513319849967957,
-0.2542964816093445,
0.8026400804519653,
-0.6290392279624939,
-0.5936421751976013,
-0.6471037268638611,
1.1842433214187622,
... |
func checkALPN(clientProtos []string, serverProto string) error {
if serverProto == "" {
return nil
}
if len(clientProtos) == 0 {
return errors.New("tls: server advertised unrequested ALPN extension")
}
for _, proto := range clientProtos {
if proto == serverProto {
return nil
}
}
return errors.New("tl... | [
0.4146067798137665,
-0.8958841562271118,
0.5443569421768188,
0.6692855954170227,
-0.32717201113700867,
1.3848460912704468,
-0.6349830031394958,
-0.5774586796760559,
0.44556811451911926,
0.8225688338279724,
0.0709179937839508,
1.2201346158981323,
-0.40680065751075745,
0.8342940211296082,
... |
func (c *Conn) verifyServerCertificate(certificates [][]byte) error {
certs := make([]*x509.Certificate, len(certificates))
for i, asn1Data := range certificates {
cert, err := x509.ParseCertificate(asn1Data)
if err != nil {
c.sendAlert(alertBadCertificate)
return errors.New("tls: failed to parse certificat... | [
0.13657565414905548,
0.23703621327877045,
0.4900917708873749,
0.6995934844017029,
0.012790502049028873,
-0.035105884075164795,
0.04260703921318054,
-0.2553887367248535,
-0.46694278717041016,
0.5437819957733154,
-1.1170464754104614,
0.3438352942466736,
-0.7373964190483093,
0.878372430801391... |
func clientSessionCacheKey(config *tls.Config) string {
return config.ServerName
} | [
-0.34946760535240173,
-1.1330574750900269,
0.2408563196659088,
-0.27448612451553345,
-0.9370824694633484,
0.6837691068649292,
0.6420475244522095,
-0.7171450257301331,
0.5828684568405151,
1.4788256883621216,
-1.0143404006958008,
-0.039355065673589706,
0.3742475211620331,
0.10793902724981308... |
func hostnameInSNI(name string) string {
host := name
if len(host) > 0 && host[0] == '[' && host[len(host)-1] == ']' {
host = host[1 : len(host)-1]
}
if i := strings.LastIndex(host, "%"); i > 0 {
host = host[:i]
}
if net.ParseIP(host) != nil {
return ""
}
for len(name) > 0 && name[len(name)-1] == '.' {
... | [
-0.174284428358078,
-0.5151699781417847,
0.9643751382827759,
0.421966016292572,
-0.9044967293739319,
-0.7322320342063904,
-0.47922223806381226,
-0.16870765388011932,
-0.5961661338806152,
0.8149694204330444,
0.43216967582702637,
-0.49665921926498413,
-0.6750398278236389,
-0.7550975680351257... |
func (d *Driver) GetCreateFlags() []mcnflag.Flag {
return []mcnflag.Flag{
mcnflag.Flag{
EnvVar: "XHYVE_BOOT2DOCKER_URL",
Name: "xhyve-boot2docker-url",
Usage: "The URL of the boot2docker image. Defaults to the latest available version",
Value: "",
},
mcnflag.Flag{
EnvVar: "XHYVE_CPU_COUNT",
... | [
-0.4205227792263031,
0.28188270330429077,
0.7986341714859009,
0.337240070104599,
1.0010522603988647,
-0.3452286422252655,
-0.22152213752269745,
-0.13506421446800232,
-1.5783898830413818,
-0.5193760991096497,
-1.5215792655944824,
0.4663422703742981,
-0.35900774598121643,
1.2141516208648682,... |
func (d *Driver) writeDiskImage() error { // TODO
log.Debugf("Creating hard disk image...")
magicString := "boot2docker, this is xhyve speaking"
buf := new(bytes.Buffer)
tw := tar.NewWriter(buf)
// magicString first so the automount script knows to format the disk
file := &tar.Header{Name: magicString, Size: i... | [
-0.5433856844902039,
0.5485873818397522,
1.0580517053604126,
0.3015344440937042,
0.5905686616897583,
0.15898184478282928,
0.005692657083272934,
-0.05653760954737663,
-1.025132417678833,
-0.12355614453554153,
-0.2136981040239334,
-0.45628297328948975,
0.749613881111145,
1.1826940774917603,
... |
func CreateResourceRoute(resource Resource, name string, pattern string) Route {
var handler HandlerFunc
handler = func(app *App) http.HandlerFunc {
return func(w http.ResponseWriter, request *http.Request) {
var data interface{}
var code int
var err error
switch request.Method {
case GET:
code... | [
0.05150821805000305,
-0.6652961373329163,
0.6417255401611328,
-0.548788845539093,
-0.48571839928627014,
0.1557222604751587,
-0.2768557071685791,
-0.27173468470573425,
-0.7276251912117004,
0.27856624126434326,
0.2881886065006256,
-0.2283633053302765,
0.1901296228170395,
0.6087973117828369,
... |
func (r GetNotSupported) Get(app *App, request *http.Request) (int, interface{}, error) {
return notSupported(GET)
} | [
-1.2134051322937012,
0.24405106902122498,
0.5939945578575134,
0.1232629343867302,
-0.39176538586616516,
0.14476114511489868,
-0.79603511095047,
0.5373518466949463,
-0.43241164088249207,
0.04845404997467995,
-0.30893802642822266,
0.5210021734237671,
-0.11657058447599411,
-0.1767137199640274... |
func (r PostNotSupported) Post(app *App, request *http.Request) (int, interface{}, error) {
return notSupported(POST)
} | [
-0.6588297486305237,
0.6136454343795776,
0.5654542446136475,
1.123219609260559,
-0.9213298559188843,
0.38324815034866333,
-0.6610673666000366,
0.3469410836696625,
-0.42343348264694214,
-0.44900232553482056,
-0.583501935005188,
-0.9916921854019165,
-0.549476146697998,
0.5557189583778381,
... |
func (r PutNotSupported) Put(app *App, request *http.Request) (int, interface{}, error) {
return notSupported(PUT)
} | [
-1.2443796396255493,
0.7935777902603149,
0.4582962095737457,
-0.2979813814163208,
-0.7470088005065918,
0.9761696457862854,
0.3599987328052521,
0.658804714679718,
-0.33636370301246643,
0.8023032546043396,
-0.44952380657196045,
0.003929062280803919,
-0.7947849035263062,
-0.035894520580768585... |
func (r DeleteNotSupported) Delete(app *App, request *http.Request) (int, interface{}, error) {
return notSupported(DELETE)
} | [
-0.4989631175994873,
0.5364072322845459,
0.6848048567771912,
0.9364020228385925,
-0.21260303258895874,
0.22745636105537415,
-0.19191931188106537,
0.696114718914032,
0.5232833623886108,
0.8905771970748901,
-0.12851311266422272,
-0.1951156109571457,
-0.48994195461273193,
0.22960209846496582,... |
func notSupported(method string) (int, interface{}, error) {
response := make(map[string]string)
code := http.StatusMethodNotAllowed
response["code"] = strconv.Itoa(code)
response["reason"] = http.StatusText(code)
response["message"] = fmt.Sprintf("This resource does not support HTTP %s.", method)
return code, r... | [
-1.1964577436447144,
-0.27962979674339294,
0.7912558317184448,
-0.4697204530239105,
-0.8459426164627075,
-0.1605827361345291,
0.2146458625793457,
0.3491622805595398,
-0.05418723076581955,
0.4500361382961273,
-0.6770819425582886,
-0.060661591589450836,
-0.17649546265602112,
0.31265398859977... |
func GetBuildInfo() Info {
return Info{Version: buildInfoVersion,
Repo: "https://github.com/cbuschka/versioner",
Author: "Cornelius Buschka <cbuschka@gmail.com>, https://github.com/cbuschka",
Commitish: buildInfoCommitish,
BuildTime: strings.Replace(buildInfoBuildTime, "_", " ", -1),
Arch: build... | [
0.35605505108833313,
-1.0089153051376343,
0.14394588768482208,
-0.15743692219257355,
0.06874307990074158,
0.552696704864502,
-0.38868841528892517,
-0.26446011662483215,
-0.4656432569026947,
-0.1909772902727127,
-1.322642207145691,
0.6157470345497131,
-0.39493000507354736,
0.075060643255710... |
func NewDNSProvider(credentials ...string) (caddytls.ChallengeProvider, error) {
switch len(credentials) {
case 0:
return vscale.NewDNSProvider()
case 1:
config := vscale.NewDefaultConfig()
config.Token = credentials[0]
return vscale.NewDNSProviderConfig(config)
default:
return nil, errors.New("invalid cr... | [
0.004207981750369072,
0.6889693737030029,
0.19549962878227234,
0.6465132832527161,
-1.0786051750183105,
0.008484824560582638,
-1.6279969215393066,
-0.4858776926994324,
0.6945496797561646,
0.6710105538368225,
-0.9703893065452576,
-0.46838968992233276,
-0.6028121113777161,
0.2300945669412613... |
func (d *baseDrawTarget) drawImage(dst, image *ebiten.Image, opt *ebiten.DrawImageOptions, mask core.DrawMask) {
if (mask & d.mask) != d.mask {
return
}
if d.mset {
if opt == nil {
opt = &ebiten.DrawImageOptions{}
}
// m := d.m
// pm := opt.GeoM
// m.Concat(pm)
// opt.GeoM = m
// _ = dst.DrawImage... | [
-0.721174955368042,
0.5339154601097107,
1.0388823747634888,
0.4123508930206299,
-0.2557699382305145,
0.7826101779937744,
0.16464105248451233,
-0.5530651807785034,
-0.22491227090358734,
0.10721684247255325,
0.951744794845581,
0.38620567321777344,
0.6702632308006287,
0.23398758471012115,
-... |
func NewNotifier(site database.Site, message string, subject string,
sendEmail EmailSender, sendSms SmsSender) *Notifier {
n := Notifier{Site: site, Message: message, Subject: subject,
SendEmail: sendEmail, SendSms: sendSms}
return &n
} | [
-0.27925124764442444,
-0.1472458690404892,
0.1588708758354187,
0.151373952627182,
-0.4159989356994629,
-0.4880470335483551,
-0.18925344944000244,
0.23298759758472443,
0.12681512534618378,
0.06321720778942108,
-0.5627495050430298,
0.9742889404296875,
-0.7718278765678406,
1.1761913299560547,... |
func (n *Notifier) Notify() {
var wg sync.WaitGroup
log.Println("Sending Notification of Site Contacts about", n.Subject+"...")
for _, c := range n.Site.Contacts {
if c.SmsActive || c.EmailActive {
// Notify contact
wg.Add(1)
go send(c, n.Message, n.Subject, n.SendEmail, n.SendSms, &wg)
} else {
log.... | [
-0.38563793897628784,
-0.13952332735061646,
0.015735536813735962,
0.5960891246795654,
0.348103404045105,
-0.8136709332466125,
0.9707106351852417,
-0.3818765878677368,
-0.2978113293647766,
0.08502612262964249,
-0.36976003646850586,
0.05953044071793556,
-0.09638296812772751,
1.21555984020233... |
func SendEmail(recipient string, message string, subject string) error {
// Set up authentication information.
auth := smtp.PlainAuth("", config.Settings.SMTP.EmailAddress, config.Settings.SMTP.Password,
config.Settings.SMTP.Server)
server := config.Settings.SMTP.Server + ":" + config.Settings.SMTP.Port
to := []s... | [
-0.11521848291158676,
0.4799406826496124,
0.31075599789619446,
0.48971831798553467,
-0.3262488543987274,
0.31271594762802124,
-0.44540825486183167,
0.6152951121330261,
-0.7376729846000671,
0.7245314717292786,
-0.5014557838439941,
1.5205575227737427,
-0.27564847469329834,
-0.335027456283569... |
func SendSms(smsNumber string, message string) error {
twilio := gotwilio.NewTwilioClient(config.Settings.Twilio.AccountSid, config.Settings.Twilio.AuthToken)
from := config.Settings.Twilio.Number
_, exc, err := twilio.SendSMS(from, smsNumber, message, "", "")
if err != nil {
return err
} else if exc != nil {
... | [
0.12748509645462036,
0.6675893664360046,
0.4398536682128906,
0.4449644684791565,
-0.0876387506723404,
-0.1279185563325882,
-0.149089977145195,
-0.035175565630197525,
0.7624622583389282,
0.09877372533082962,
0.08031732589006424,
0.306557297706604,
-0.40079745650291443,
-0.08364710956811905,... |
func (d *TagAny) Into(key string) *TagAny {
return Tag(key, d)
} | [
-0.6335702538490295,
0.6736758351325989,
0.19770312309265137,
-0.5135996341705322,
-0.7012885808944702,
-0.27294716238975525,
-1.3525320291519165,
0.07053515315055847,
-1.1518750190734863,
-0.9628040790557861,
-0.12776823341846466,
-0.02518031932413578,
0.22304946184158325,
0.4374835193157... |
func (d *TagAny) Leaf() interface{} {
return nvp.Leaf(d)
} | [
-0.3613491654396057,
-0.055966224521398544,
0.17836502194404602,
1.0678799152374268,
-0.6760039925575256,
0.573311984539032,
-0.6658344268798828,
-1.3803935050964355,
1.3082436323165894,
-1.09415864944458,
0.4423600733280182,
-0.3786930739879608,
0.1954541951417923,
0.8976460099220276,
-... |
func (d *TagAny) NameS() []string {
return nvp.NameS(d)
} | [
-1.4945201873779297,
0.10272779315710068,
0.3540855348110199,
0.18502917885780334,
0.13872869312763214,
-0.3667275905609131,
-2.4677350521087646,
-1.4245060682296753,
-0.09239929169416428,
0.7468401789665222,
-0.5234389305114746,
-0.3111213743686676,
0.6021113395690918,
0.9547414779663086,... |
func (d *TagAny) NamePath() string {
return nvp.NamePath(d)
} | [
-0.8248671293258667,
-0.35257720947265625,
0.12427742034196854,
0.17978635430335999,
-0.8161638975143433,
0.19507190585136414,
-1.018261194229126,
-2.044416904449463,
0.11525620520114899,
0.6826357841491699,
0.03244466334581375,
-0.8003041744232178,
0.13655593991279602,
0.7194187045097351,... |
func GetOriginalValue(key string, fallbackValue string) string {
env := os.Getenv("WRAPPED_" + strings.ToUpper(key))
if env == "" {
return fallbackValue
} else {
return env
}
} | [
0.08240491151809692,
-0.026501208543777466,
0.747205913066864,
0.37693190574645996,
-0.8438065052032471,
-0.04077120125293732,
-0.36833247542381287,
0.9225877523422241,
-0.8578312397003174,
0.25873976945877075,
0.6761298775672913,
1.6172291040420532,
-0.2862151563167572,
0.0568606890738010... |
func SaveOriginalValue(key string, value string, envVariables []string) []string {
envKey := fmt.Sprintf("WRAPPED_%s", strings.ToUpper(key))
_ = os.Setenv(envKey, value)
return append(envVariables, envKey+"="+value)
} | [
-1.3173799514770508,
-0.6377901434898376,
0.7017896175384521,
-0.5736056566238403,
-0.9097853302955627,
0.5774399638175964,
-1.1000871658325195,
0.5998486280441284,
-0.9607353806495667,
1.5711028575897217,
-0.7172579169273376,
1.0104079246520996,
-0.0006801331765018404,
0.5114739537239075,... |
func NewTestCapture() TestCapture {
c := &testCapture{}
c.ErrorFunc = func(format string, args ...interface{}) {
msg := fmt.Sprintf(format, args...)
c.lock.Lock()
defer c.lock.Unlock()
c.captured = append(c.captured, msg)
}
return c
} | [
-0.10541210323572159,
-1.3172266483306885,
0.4955792725086212,
0.17903967201709747,
-0.29023367166519165,
-0.950833261013031,
0.12490426003932953,
-1.111220121383667,
0.7268252968788147,
-0.9163216352462769,
0.20692552626132965,
0.6408789753913879,
-0.2676475942134857,
0.4596504867076874,
... |
func (c *testCapture) First() SingleCapture {
return c.Capture(0)
} | [
0.5206971168518066,
-0.16733497381210327,
0.45839494466781616,
0.6813792586326599,
1.4961093664169312,
-0.16586783528327942,
0.03157317638397217,
-0.2740464210510254,
0.735141396522522,
-0.6856176257133484,
-0.3520362377166748,
0.25910684466362,
0.19323831796646118,
0.93943190574646,
-0.... |
func (c *testCapture) Captures() []SingleCapture {
c.lock.Lock()
defer c.lock.Unlock()
copy := make([]SingleCapture, len(c.captured))
for i, cap := range c.captured {
cap := cap
copy[i] = &singleCapture{&cap}
}
return copy
} | [
-0.9898552894592285,
-1.2252566814422607,
0.44768524169921875,
0.7955791354179382,
0.6968817114830017,
0.18248912692070007,
0.11477912217378616,
-0.6128261089324951,
1.9876433610916138,
-0.542953610420227,
-0.4753357172012329,
0.33304405212402344,
0.0015475692925974727,
0.6353017091751099,... |
func (c *testCapture) Length() int {
c.lock.Lock()
defer c.lock.Unlock()
return len(c.captured)
} | [
0.0945877805352211,
-0.6415826082229614,
0.28806638717651367,
0.2241610288619995,
0.35584986209869385,
0.338565468788147,
1.1855618953704834,
0.318049818277359,
1.3656855821609497,
0.01804746873676777,
-0.8916676044464111,
0.014300442300736904,
-0.34047964215278625,
0.3706081211566925,
0... |
func (c *testCapture) Reset() {
c.lock.Lock()
defer c.lock.Unlock()
c.captured = []string{}
} | [
-0.14707764983177185,
-0.6830903887748718,
0.39922553300857544,
0.14861243963241577,
0.7835638523101807,
-0.05971508100628853,
0.7446210980415344,
-0.6347731351852417,
0.12231185287237167,
-0.17216092348098755,
-0.4549972414970398,
0.9266904592514038,
-0.9054520726203918,
-0.13628561794757... |
func (s *singleCapture) Captured() *string {
return s.captured
} | [
0.1463729441165924,
-1.499274730682373,
0.3305188715457916,
0.847969651222229,
0.5073451399803162,
0.4958719313144684,
0.5102874636650085,
-0.1929634064435959,
1.5333144664764404,
-0.3406082093715668,
-0.47597837448120117,
0.43828675150871277,
1.5321691036224365,
0.12451698631048203,
-0.... |
func (s *singleCapture) CapturedLines() []string {
if s.captured == nil {
return nil
}
return strings.FieldsFunc(*s.captured, func(r rune) bool {
return r == '\n'
})
} | [
0.5024515390396118,
-0.6101758480072021,
0.10538902133703232,
1.13543701171875,
0.33926546573638916,
-0.25755050778388977,
-0.5077877044677734,
-0.36265328526496887,
1.231293797492981,
-0.1531783640384674,
-0.46383094787597656,
0.31906262040138245,
0.6117215156555176,
0.710759162902832,
... |
func (s *singleCapture) NumCapturedLines() int {
if lines := s.CapturedLines(); lines != nil {
return len(lines)
}
return 0
} | [
0.29313454031944275,
-0.17728812992572784,
0.5527443885803223,
0.4761979877948761,
-0.2981529235839844,
0.1565895825624466,
-0.23178406059741974,
0.6623799204826355,
1.283098816871643,
-0.4905257523059845,
-1.142348289489746,
-0.15746985375881195,
0.7398446202278137,
0.7683136463165283,
... |
func (s *singleCapture) AssertNil(t Tester) {
if s.captured != nil {
t.Errorf("Expected nil; got '%v'%s", *s.captured, PrintStack(mockTesterStackDepth))
}
} | [
0.34907954931259155,
0.27774855494499207,
0.509222149848938,
0.9709028601646423,
0.6301696300506592,
-0.10199840366840363,
0.8499681949615479,
-0.13861188292503357,
1.567144513130188,
-0.11020677536725998,
-0.011100479401648045,
0.3518848121166229,
-0.4019007682800293,
1.5682369470596313,
... |
func (s *singleCapture) AssertNotNil(t Tester) {
if s.captured == nil {
t.Errorf("Expected not nil%s", PrintStack(mockTesterStackDepth))
}
} | [
0.18498723208904266,
0.19723504781723022,
0.3611120879650116,
0.6725456714630127,
0.6903570890426636,
-0.35130128264427185,
0.7429472208023071,
0.08831077814102173,
1.0282307863235474,
0.03835455700755119,
-0.481018990278244,
0.1187225878238678,
-0.4988865852355957,
1.8918671607971191,
0... |
func (s *singleCapture) AssertFirstLineEqual(t Tester, expected string) {
if s.captured == nil {
t.Errorf("Expected '%s'; got nil%s", expected, PrintStack(mockTesterStackDepth))
return
}
if lines := s.CapturedLines(); lines[0] != expected {
t.Errorf("Expected '%s'; got '%s'%s", expected, lines[0], PrintStack(... | [
0.5571958422660828,
-0.6265361905097961,
0.208820641040802,
0.5984818339347839,
1.2953739166259766,
-0.19577445089817047,
0.33519411087036133,
-0.26264458894729614,
1.1087355613708496,
-0.554450511932373,
-0.1722700148820877,
0.2979317009449005,
0.0699409618973732,
1.8313660621643066,
-0... |
func (s *singleCapture) AssertFirstLineContains(t Tester, substr string) {
if s.captured == nil {
t.Errorf("Expected string containing '%s'; got nil%s", substr, PrintStack(mockTesterStackDepth))
return
}
if lines := s.CapturedLines(); !strings.Contains(lines[0], substr) {
t.Errorf("Expected string containing ... | [
0.9498850703239441,
-0.4893985688686371,
0.3740038275718689,
0.696978747844696,
0.4935224950313568,
0.13409742712974548,
0.20289000868797302,
-0.5343546867370605,
0.8281072378158569,
-1.3157051801681519,
0.5274454355239868,
0.2368319183588028,
0.10268291085958481,
1.9618957042694092,
-0.... |
func (s *singleCapture) AssertContains(t Tester, substr string) {
if s.captured == nil {
t.Errorf("Expected string containing '%s'; got nil%s", substr, PrintStack(mockTesterStackDepth))
return
}
if !strings.Contains(*s.captured, substr) {
t.Errorf("Expected string containing '%s'; got '%s'%s", substr, *s.capt... | [
0.5882447361946106,
-0.1605607271194458,
0.45138537883758545,
0.6760030388832092,
0.5728586316108704,
0.48718035221099854,
0.49985870718955994,
-0.5134244561195374,
1.1888115406036377,
-0.9142022132873535,
0.4293230175971985,
0.6525565385818481,
-0.3223564624786377,
1.1931921243667603,
-... |
func (lts LoadTestState) IsTerminated() bool {
return lts == Succeeded || lts == Errored
} | [
-0.0199891310185194,
-0.8854848742485046,
0.44322481751441956,
-0.4617837965488434,
0.9631286859512329,
-0.10000041127204895,
-1.3819420337677002,
0.6892452836036682,
1.3668980598449707,
-0.15879808366298676,
-0.5566936731338501,
0.19860877096652985,
-0.9324860572814941,
0.3335393965244293... |
func (s ListEndpointGroupsInput) String() string {
return awsutil.Prettify(s)
} | [
0.2005442976951599,
-0.23408058285713196,
0.06087924540042877,
-1.058890461921692,
-0.8095994591712952,
1.0140842199325562,
0.3185189962387085,
-1.5743372440338135,
-0.5109236836433411,
0.00881580263376236,
0.5508145093917847,
0.44418802857398987,
-0.22355885803699493,
-0.1645035296678543,... |
func (s *ListEndpointGroupsInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "ListEndpointGroupsInput"}
if s.ListenerArn == nil {
invalidParams.Add(aws.NewErrParamRequired("ListenerArn"))
}
if s.MaxResults != nil && *s.MaxResults < 1 {
invalidParams.Add(aws.NewErrParamMinValue("MaxResult... | [
-0.37501731514930725,
0.5229694247245789,
0.37454158067703247,
-0.3748883306980133,
-0.06551048159599304,
0.1094662994146347,
-0.058839671313762665,
-0.851302981376648,
-0.8278393149375916,
-0.7086687088012695,
0.8965282440185547,
-0.7018834352493286,
-1.1049772500991821,
0.934550702571868... |
func (s ListEndpointGroupsOutput) String() string {
return awsutil.Prettify(s)
} | [
0.8915678858757019,
-0.7644359469413757,
0.0635894387960434,
-0.891242504119873,
-1.1242351531982422,
0.28972524404525757,
0.49526408314704895,
-1.3109489679336548,
-0.759150505065918,
0.003711152356117964,
0.6812067031860352,
-0.06668273359537125,
0.16423019766807556,
-0.40919214487075806... |
func (r ListEndpointGroupsRequest) Send(ctx context.Context) (*ListEndpointGroupsResponse, error) {
r.Request.SetContext(ctx)
err := r.Request.Send()
if err != nil {
return nil, err
}
resp := &ListEndpointGroupsResponse{
ListEndpointGroupsOutput: r.Request.Data.(*ListEndpointGroupsOutput),
response: ... | [
-0.9992818236351013,
0.4347494840621948,
0.3648483157157898,
-0.2238454520702362,
-0.5512335300445557,
0.0383077897131443,
-0.7273436784744263,
-0.8618358373641968,
-0.45763006806373596,
0.06557745486497879,
0.11243404448032379,
-0.025045761838555336,
-0.8501084446907043,
0.074034929275512... |
func (r *ListEndpointGroupsResponse) SDKResponseMetdata() *aws.Response {
return r.response
} | [
0.1377585083246231,
-0.5583450198173523,
0.30049213767051697,
-0.963267982006073,
-0.4434353709220886,
0.21664835512638092,
-0.8657044768333435,
-0.6637459993362427,
0.5361353158950806,
0.09694484621286392,
-0.004972429014742374,
-0.6074324250221252,
-0.058124884963035583,
-0.5808593034744... |
func Log() {
} | [
0.39603719115257263,
0.40671035647392273,
0.04129760339856148,
1.269987940788269,
-0.4413462281227112,
-0.2054661363363266,
1.2825806140899658,
0.6527184247970581,
0.5416920185089111,
-1.6267178058624268,
-1.4611451625823975,
0.03832855448126793,
0.23017646372318268,
0.3883898854255676,
... |
func TradeBucketKey(symbol string) string {
return symbol + "/" + TradeTimeframe + "/" + TradeSuffix
} | [
-0.1304042488336563,
0.10114797949790955,
0.3657054007053375,
-0.9816839098930359,
1.1161426305770874,
-0.05345873534679413,
0.04042719304561615,
-0.6698294878005981,
-0.7403540015220642,
0.658328115940094,
-0.35644906759262085,
0.738904595375061,
1.2557008266448975,
-0.30924713611602783,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.