text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (a *Async) flushBuf(b *buffer) {
tasks := b.Tasks()
if len(tasks) > 0 {
for _, t := range tasks {
a.wait.Add(1)
go func(t *task) {
t.Do()
a.wait.Done()
}(t)
}
a.wait.Wait()
b.Reset()
}
} | [
0.03278600051999092,
1.0819514989852905,
0.6076416969299316,
0.6454679369926453,
0.548852264881134,
0.2741453945636749,
1.1118881702423096,
-0.07574060559272766,
-0.49006402492523193,
0.19399777054786682,
-0.8622981905937195,
0.5800336599349976,
-0.47932854294776917,
0.7048024535179138,
... |
func NewLaunchTemplate(ctx *pulumi.Context,
name string, args *LaunchTemplateArgs, opts ...pulumi.ResourceOption) (*LaunchTemplate, error) {
if args == nil {
args = &LaunchTemplateArgs{}
}
var resource LaunchTemplate
err := ctx.RegisterResource("aws:ec2/launchTemplate:LaunchTemplate", name, args, &resource, opt... | [
-0.03747294843196869,
-0.3629499077796936,
0.49037012457847595,
-0.18956857919692993,
-0.9680398106575012,
0.29077884554862976,
-0.6461613178253174,
0.3865482807159424,
0.8176027536392212,
0.4723718464374542,
-0.9588862061500549,
-0.08546693623065948,
0.02596920169889927,
-0.22545626759529... |
func GetLaunchTemplate(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *LaunchTemplateState, opts ...pulumi.ResourceOption) (*LaunchTemplate, error) {
var resource LaunchTemplate
err := ctx.ReadResource("aws:ec2/launchTemplate:LaunchTemplate", name, id, state, &resource, opts...)
if err != nil {
return... | [
0.3661060035228729,
-0.433723509311676,
0.2995830774307251,
-0.3227246403694153,
-0.769482433795929,
0.14651747047901154,
-1.1746480464935303,
0.06845831125974655,
1.556675672531128,
0.29492542147636414,
-0.3542720675468445,
0.6217542290687561,
0.05187726393342018,
-1.0266834497451782,
-... |
func doCheckAndSaveOnExit(profileList *ProfileCsv) {
var restructuredCsv [][]string
// Make CSV datas
restructuredCsv = append(restructuredCsv, profileList.FieldNames)
restructuredCsv = append(restructuredCsv, tableDatas...)
// Count nb of deleted column(s)
count := 0
for _, act := range profileList.FieldOut {
... | [
-0.2514839470386505,
-0.37731197476387024,
0.7517421841621399,
0.6789945960044861,
0.303034245967865,
0.10110998898744583,
0.9078746438026428,
0.5051184892654419,
0.2572908401489258,
0.43690139055252075,
-0.4560739994049072,
0.19570544362068176,
-0.2663136422634125,
0.2817422151565552,
0... |
func getOptFileName(filename string) string {
return genLib.SplitFilePath(filename, "opt").OutputNewExt
} | [
-0.33279529213905334,
-0.032050721347332,
0.6719409823417664,
0.08687957376241684,
-0.4525405466556549,
-0.11088429391384125,
0.4352480173110962,
0.3748016357421875,
-0.6042160987854004,
1.6924506425857544,
-0.25441181659698486,
-0.5013789534568787,
-0.10329733043909073,
-0.741816401481628... |
func rwProfileCsv(filename string) ProfileCsv {
optFilename := getOptFileName(filename)
profileList := NewProfileCsv(filename) // Create ProfileList
if _, err := os.Stat(optFilename); os.IsNotExist(err) { // Opt file does not exist
genLib.WriteJson(optFilename, &profileList) // then save it ...
} else { // Opt f... | [
-0.6779308319091797,
-0.6446970105171204,
0.7039409875869751,
0.46786609292030334,
0.2644135653972626,
0.23187753558158875,
0.00730574456974864,
-0.8572046756744385,
0.11432066559791565,
0.9869062900543213,
-0.9399532675743103,
-0.07981770485639572,
-0.42629873752593994,
0.0369804129004478... |
func addAndSetCsv(filename, name string) {
profile := rwProfileCsv(filename)
table := genLib.ReadCsv(filename, profile.Comma, profile.NumberCols, profile.FirstLine+1)
for idx := 0; idx < len(storeProfiles); idx++ {
if storeProfiles[idx].Name == name {
storeProfiles[idx].Prof = profile
storeProfiles[idx].Prof... | [
0.36017903685569763,
-0.6671132445335388,
0.614668071269989,
0.5833141803741455,
0.03833327069878578,
0.006525819655507803,
0.19171185791492462,
0.01904238760471344,
0.23964416980743408,
0.29259103536605835,
-0.4623725116252899,
0.42837226390838623,
0.09484248608350754,
0.27721577882766724... |
func setProfile(name string) {
for idx := 0; idx < len(storeProfiles); idx++ {
if storeProfiles[idx].Name == name {
CsvProfileList = storeProfiles[idx].Prof
CsvProfileList.Name = name
tableDatas = storeProfiles[idx].Table
if optionsBox != nil {
// Disabling Option Tab if focused data is not Main tabl... | [
0.18782208859920502,
0.06971689313650131,
0.676132082939148,
0.9468318223953247,
-0.5182066559791565,
0.5919308066368103,
0.3185921311378479,
0.16198846697807312,
0.2859538793563843,
0.6730263233184814,
-0.5578919649124146,
0.39408397674560547,
-0.13763058185577393,
0.8136649131774902,
-... |
func reloadMainStoreProfile() {
ChkRow.Reset() // Reset stored checked rows history
storeProfiles = NewStoreProfiles()
storeProfiles[0].Prof = CsvProfileList
storeProfiles[0].Prof.Name = profName[0] // as "Main"
storeProfiles[0].Table = tableDatas
storeProfiles[0].Initialised = CsvProfileList.Initialised
setProf... | [
0.5560972094535828,
0.018856162205338478,
0.4765419065952301,
0.9928440451622009,
-0.5593392252922058,
0.34173691272735596,
0.6302162408828735,
-0.17440389096736908,
0.2894906997680664,
0.3173854947090149,
-0.20170123875141144,
0.6021316051483154,
-0.21861642599105835,
0.24530330300331116,... |
func (c *Client) NewPubSub() *PubSub {
return &PubSub{
conn: c.pool.Get(),
}
} | [
0.33370983600616455,
-0.3552267849445343,
0.02716103382408619,
0.4100635051727295,
-0.8043208718299866,
-0.010529053397476673,
-0.5162331461906433,
-0.5368407368659973,
-0.7174209356307983,
-1.3393194675445557,
0.05563320964574814,
0.5745485424995422,
-0.8000406622886658,
-0.10686006397008... |
func (ps *PubSub) Publish(channel string, arg interface{}) (int, error) {
return redis.Int(ps.conn.Do("PUBLISH", channel, arg))
} | [
-0.8868067264556885,
0.9830294251441956,
0.3920546770095825,
-0.13761356472969055,
-0.10006717592477798,
-0.41740089654922485,
-0.6124633550643921,
0.5866560935974121,
-0.62636798620224,
-0.25356820225715637,
-0.11847630143165588,
0.11159955710172653,
-1.0902198553085327,
0.658320069313049... |
func (ps *PubSub) Subscribe(channel ...interface{}) error {
ps.conn.Send("SUBSCRIBE", channel...)
return ps.conn.Flush()
} | [
-0.538536012172699,
0.7393081188201904,
0.3725833594799042,
0.6733115911483765,
0.5820237994194031,
0.2899540066719055,
-1.4203214645385742,
-0.6495339274406433,
-1.1900415420532227,
-0.49336862564086914,
-0.43085142970085144,
0.13985121250152588,
-1.1352108716964722,
0.08892440795898438,
... |
func (ps PubSub) PSubscribe(channel ...interface{}) error {
ps.conn.Send("PSUBSCRIBE", channel...)
return ps.conn.Flush()
} | [
-0.6174143552780151,
0.39867204427719116,
0.5000290274620056,
0.6059069037437439,
-0.3100924491882324,
-0.22197771072387695,
-2.081916332244873,
-0.8053590059280396,
-1.066867470741272,
-0.3002482056617737,
-0.7396743297576904,
-0.23271124064922333,
-1.4905815124511719,
0.32568350434303284... |
func (ps PubSub) Unsubscribe(channel ...interface{}) error {
ps.conn.Send("UNSUBSCRIBE", channel...)
return ps.conn.Flush()
} | [
-0.12046157568693161,
0.9406617283821106,
0.38926732540130615,
0.24369816482067108,
0.3819279372692108,
-0.4836918115615845,
-1.047494888305664,
-0.22689424455165863,
-1.2294914722442627,
-0.26765894889831543,
-0.31368741393089294,
-0.34228426218032837,
-1.1748663187026978,
-0.354353606700... |
func (ps PubSub) PUnsubscribe(channel ...interface{}) error {
ps.conn.Send("PUNSUBSCRIBE", channel...)
return ps.conn.Flush()
} | [
-0.3509027063846588,
0.7853496670722961,
0.42992278933525085,
0.11320452392101288,
-0.2674580514431,
-0.3044776916503906,
-0.7809677124023438,
0.2233552187681198,
-0.5504891276359558,
-0.40633514523506165,
-0.4113852083683014,
-0.26004213094711304,
-1.16484797000885,
0.16650179028511047,
... |
func (ps PubSub) Ping(data string) error {
ps.conn.Send("PING", data)
return ps.conn.Flush()
} | [
-0.2588636577129364,
0.29736554622650146,
0.31554028391838074,
0.7914782762527466,
0.43326008319854736,
0.6319264769554138,
-1.0189086198806763,
0.2531217038631439,
-0.40506604313850403,
0.5368247032165527,
0.20954620838165283,
-0.07190610468387604,
-1.1467288732528687,
0.02614593878388405... |
func (ps PubSub) Close() error {
return ps.conn.Close()
} | [
0.40480899810791016,
-0.22732675075531006,
0.33460938930511475,
0.588861346244812,
-0.1637498289346695,
0.8907006978988647,
-1.3545703887939453,
0.2495957612991333,
-1.3114875555038452,
-1.077192783355713,
0.8294023275375366,
-0.02760898321866989,
-1.3269563913345337,
0.15868839621543884,
... |
func (ps PubSub) Receive() (Message, error) {
return ps.receiveInternal(ps.conn.Receive())
} | [
-0.10501047968864441,
-0.17939312756061554,
0.25572288036346436,
0.18452271819114685,
0.12849099934101105,
-0.15604428946971893,
-1.269273042678833,
-0.07429718971252441,
-1.0989952087402344,
-0.752998948097229,
0.5178302526473999,
0.1815527230501175,
-0.5941367745399475,
-0.02254184521734... |
func (ps PubSub) ReceiveWithTimeout(timeout time.Duration) (Message, error) {
return ps.receiveInternal(redis.ReceiveWithTimeout(ps.conn, timeout))
} | [
0.43717947602272034,
-0.23374909162521362,
0.34759870171546936,
-0.3304787874221802,
-0.4267204701900482,
0.01972351036965847,
-2.0109901428222656,
-0.3853890001773834,
-0.22995628416538239,
0.30079755187034607,
-0.12691578269004822,
0.38106489181518555,
-0.15998788177967072,
0.31592607498... |
func (dbh *DBHandle) Connect(conf *config.Config) error {
dbh.DB = pg.Connect(&pg.Options{
Addr: fmt.Sprintf("%s:%d", conf.DB.Hostname, conf.DB.Port),
User: conf.DB.Username,
Password: conf.DB.Password,
Database: conf.DB.Database,
})
ctx := context.Background()
if err := dbh.DB.Ping(ctx); err != ni... | [
0.07539944350719452,
0.5531809329986572,
0.6882242560386658,
1.010931134223938,
0.7225623726844788,
1.2446012496948242,
-0.318393349647522,
0.1114000529050827,
-1.6313767433166504,
0.3422156572341919,
-0.18192648887634277,
-0.0839565247297287,
-0.9211354851722717,
0.07564976066350937,
0.... |
func (dbh *DBHandle) Init() error {
if dbh.DB == nil {
return ErrMissingDBConnection
}
err := dbh.createSchema()
if err != nil {
return err
}
return nil
} | [
0.4380319118499756,
0.36907240748405457,
0.6459119915962219,
-0.24558405578136444,
1.1249057054519653,
1.288794755935669,
-0.6770208477973938,
1.0742226839065552,
-0.49214667081832886,
-0.811670184135437,
0.05330045893788338,
0.32467010617256165,
-0.9114170074462891,
0.7330760955810547,
... |
func (dbh *DBHandle) createSchema() error {
models := []interface{}{
(*Item)(nil),
}
for _, model := range models {
err := dbh.DB.Model(model).CreateTable(&orm.CreateTableOptions{
Temp: false,
IfNotExists: true,
})
if err != nil {
return err
}
}
return nil
} | [
-0.5591238141059875,
0.19790199398994446,
0.6545829176902771,
1.0592960119247437,
2.266309976577759,
0.438596248626709,
0.08488388359546661,
0.14134089648723602,
-0.4355930685997009,
0.03607082739472389,
-0.38267162442207336,
-1.573398232460022,
-0.3074864149093628,
0.7395437955856323,
0... |
func (initp *InitParams) copyTemplates(source, destination string) error {
if source == "" {
return fmt.Errorf("template source volume not specified")
}
if destination == "" {
return fmt.Errorf("template destination volume not specified")
}
initp.logger.Info("Installing aerospike.conf", "source", source, "de... | [
-0.2781725823879242,
-0.47669169306755066,
0.6395034790039062,
-0.023443203419446945,
-0.09152425825595856,
0.6451253294944763,
-0.021833134815096855,
0.12468621134757996,
-0.6708258986473083,
1.4782525300979614,
0.10601511597633362,
-0.5328419208526611,
-0.4822787344455719,
0.337008774280... |
func FilesystemPreRequirements(rundir string) error {
if err := os.RemoveAll(rundir); err != nil && !os.IsNotExist(err) {
return fmt.Errorf("failed to remove old pod info socket directory %s: %v", rundir, err)
}
if err := os.MkdirAll(rundir, thickPluginSocketRunDirPermissions); err != nil {
return fmt.Errorf("fa... | [
-0.9226654767990112,
0.40660780668258667,
0.7161512970924377,
-0.6600494980812073,
-0.30101504921913147,
-0.7664753794670105,
0.9905446767807007,
-0.5236819386482239,
0.8699945211410522,
-1.0276856422424316,
0.6931854486465454,
0.4002704918384552,
-0.16146276891231537,
0.9297451972961426,
... |
func (s *Server) HandleCNIRequest(cmd string, k8sArgs *types.K8sArgs, cniCmdArgs *skel.CmdArgs, exec invoke.Exec, kubeClient *k8s.ClientInfo) ([]byte, error) {
var result []byte
var err error
logging.Verbosef("%s starting CNI request %s", cmd, printCmdArgs(cniCmdArgs))
switch cmd {
case "ADD":
result, err = cmd... | [
-0.3143663704395294,
-0.352550745010376,
0.6960152983665466,
0.7234033346176147,
0.021799493581056595,
-0.4646452069282532,
-0.6862685084342957,
-0.3645358383655548,
0.03748801350593567,
-0.1515781283378601,
0.41543373465538025,
-0.5316135883331299,
-0.5618117451667786,
0.541623055934906,
... |
func (s *Server) HandleDelegateRequest(cmd string, k8sArgs *types.K8sArgs, cniCmdArgs *skel.CmdArgs, exec invoke.Exec, kubeClient *k8s.ClientInfo, interfaceAttributes *api.DelegateInterfaceAttributes) ([]byte, error) {
var result []byte
var err error
var multusConfByte []byte
multusConfByte = bytes.Replace(s.serve... | [
0.05796997621655464,
0.00721276318654418,
0.8999354243278503,
0.39110445976257324,
0.4353499114513397,
-0.07835010439157486,
-0.16426923871040344,
-0.2441551834344864,
0.6774499416351318,
-0.3318006098270416,
0.631721556186676,
-0.001333599560894072,
-0.4048847556114197,
1.0606197118759155... |
func GetListener(socketPath string) (net.Listener, error) {
l, err := net.Listen("unix", socketPath)
if err != nil {
return nil, logging.Errorf("failed to listen on pod info socket: %v", err)
}
if err := os.Chmod(socketPath, config.UserRWPermission); err != nil {
_ = l.Close()
return nil, logging.Errorf("fail... | [
0.018644394353032112,
-0.15444912016391754,
0.6025523543357849,
-0.1340324431657791,
0.0055955820716917515,
0.33398905396461487,
0.1254677027463913,
-0.3832750618457794,
-0.40451404452323914,
-0.42082613706588745,
0.7161133885383606,
0.10660485923290253,
-0.557429313659668,
0.0767749622464... |
func NewCNIServer(daemonConfig *ControllerNetConf, serverConfig []byte) (*Server, error) {
kubeClient, err := k8s.InClusterK8sClient()
if err != nil {
return nil, fmt.Errorf("error getting k8s client: %v", err)
}
exec := invoke.Exec(nil)
if daemonConfig.ChrootDir != "" {
chrootExec := &ChrootExec{
Stderr: ... | [
0.2671971619129181,
-0.501533567905426,
0.32682621479034424,
0.6469932794570923,
-0.2362205535173416,
-0.553250789642334,
-0.290528267621994,
-0.2346823364496231,
0.24343283474445343,
0.04625314474105835,
-0.19737358391284943,
0.8356561064720154,
-0.36087164282798767,
0.8041388988494873,
... |
func cmdDelegateDel(cmdArgs *skel.CmdArgs, k8sArgs *types.K8sArgs, exec invoke.Exec, kubeClient *k8s.ClientInfo, multusConfig *types.NetConf) error {
namespace := string(k8sArgs.K8S_POD_NAMESPACE)
podName := string(k8sArgs.K8S_POD_NAME)
if namespace == "" || podName == "" {
return fmt.Errorf("required CNI variable... | [
0.6073625683784485,
-0.0025957997422665358,
0.9070701003074646,
0.12624283134937286,
0.22343012690544128,
0.5908812880516052,
0.0029533577617257833,
-0.02360943891108036,
0.5344632267951965,
-0.1117367371916771,
0.1302535980939865,
0.5458009839057922,
-0.09637824445962906,
0.35505399107933... |
func LoadDaemonNetConf(config []byte) (*ControllerNetConf, error) {
daemonNetConf := &ControllerNetConf{
SocketDir: DefaultMultusRunDir,
}
if err := json.Unmarshal(config, daemonNetConf); err != nil {
return nil, fmt.Errorf("failed to unmarshall the daemon configuration: %w", err)
}
logging.SetLogStderr(daemo... | [
-0.1512393057346344,
-0.1479942500591278,
0.512201726436615,
-0.8909239768981934,
-1.003001093864441,
-0.5319613814353943,
0.08308377861976624,
-0.16605274379253387,
0.6256694793701172,
-0.5549852848052979,
-1.1720890998840332,
-0.37475526332855225,
-0.33587008714675903,
0.4732400476932525... |
func (m *MailMessage) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCc(formats); err != nil {
res = append(res, err)
}
if err := m.validateReplyBy(formats); err != nil {
res = append(res, err)
}
if err := m.validateReplyTo(formats); err != nil {
res = append(res, err)
}
... | [
-0.026121092960238457,
0.3154980540275574,
0.3013373613357544,
-0.8245928287506104,
0.3808421194553375,
-0.05759633332490921,
0.11469876766204834,
-0.9759017825126648,
-0.4607844054698944,
-0.11904454231262207,
0.18826746940612793,
0.437919020652771,
-1.4356508255004883,
0.6676362752914429... |
func (a *API) Verify(w http.ResponseWriter, r *http.Request) error {
switch r.Method {
case http.MethodGet:
return a.verifyGet(w, r)
case http.MethodPost:
return a.verifyPost(w, r)
default:
return unprocessableEntityError("Only GET and POST methods are supported.")
}
} | [
-0.37216663360595703,
0.0507483147084713,
0.5829232931137085,
1.0391383171081543,
0.877526044845581,
0.09511059522628784,
-0.7863664031028748,
-0.5811303853988647,
-0.2919846475124359,
-0.03900793194770813,
-0.1388181895017624,
0.2781188488006592,
0.2705673575401306,
1.5939277410507202,
... |
func (a *API) verifyUserAndToken(ctx context.Context, conn *storage.Connection, params *VerifyParams, aud string) (*models.User, error) {
config := a.config
var user *models.User
var err error
var tokenHash string
if isPhoneOtpVerification(params) {
params.Phone, err = validatePhone(params.Phone)
if err != ni... | [
0.11357934027910233,
-0.770253598690033,
0.5937218070030212,
0.544910728931427,
0.023302607238292694,
0.31152546405792236,
-0.5992906093597412,
-0.3828795850276947,
0.44743719696998596,
-0.2724926173686981,
-0.34307917952537537,
0.5231283903121948,
0.570702314376831,
0.8522480726242065,
... |
func isOtpValid(actual, expected string, sentAt *time.Time, otpExp uint) bool {
if expected == "" || sentAt == nil {
return false
}
return !isOtpExpired(sentAt, otpExp) && (actual == expected)
} | [
-0.14189454913139343,
-1.2495667934417725,
0.5281466245651245,
-0.5063892602920532,
-1.0066090822219849,
0.7890033721923828,
-1.379812240600586,
0.29336339235305786,
0.2399238497018814,
1.2451372146606445,
1.0233556032180786,
0.1487487554550171,
-0.17311149835586548,
-0.8832201957702637,
... |
func isPhoneOtpVerification(params *VerifyParams) bool {
return params.Phone != "" && params.Email == ""
} | [
-0.2073529064655304,
-0.4903948903083801,
0.26992207765579224,
0.7622222304344177,
0.2823987305164337,
1.0358418226242065,
-1.037972331047058,
0.226750448346138,
0.5549810528755188,
0.2610497772693634,
-0.07838622480630875,
-0.16416038572788239,
-0.4439854323863983,
0.7479831576347351,
-... |
func isEmailOtpVerification(params *VerifyParams) bool {
return params.Phone == "" && params.Email != ""
} | [
-0.1460760086774826,
-0.19978569447994232,
0.3371488153934479,
0.5631788372993469,
0.024099411442875862,
0.9969435334205627,
-1.0709084272384644,
0.45016783475875854,
0.5739696025848389,
0.7351205348968506,
-0.29392021894454956,
-0.24192413687705994,
-0.4963006377220154,
0.491980642080307,... |
func NewHTTPPool(self string) *HTTPPool {
p := NewHTTPPoolOpts(self, nil)
http.Handle(p.opts.BasePath, p)
return p
} | [
-0.21670988202095032,
-0.9742355346679688,
0.37964457273483276,
0.41384613513946533,
-0.08120331913232803,
0.9343613386154175,
0.4408494830131531,
-0.483551561832428,
-0.5462035536766052,
-0.6887847185134888,
0.1819775104522705,
0.7925463914871216,
-0.6763038039207458,
0.23153367638587952,... |
func NewHTTPPoolOpts(self string, o *HTTPPoolOptions) *HTTPPool {
if httpPoolMade {
panic("groupcache: NewHTTPPool must be called only once")
}
httpPoolMade = true
p := &HTTPPool{
self: self,
httpGetters: make(map[string]*httpGetter),
}
if o != nil {
p.opts = *o
}
if p.opts.BasePath == "" {
p.... | [
-0.8612903356552124,
-0.06094281002879143,
0.6084754467010498,
0.11854574829339981,
-0.3167911469936371,
0.33317360281944275,
0.38446715474128723,
-0.42335227131843567,
0.31152158975601196,
0.4262625277042389,
-0.20294605195522308,
0.35243523120880127,
-0.5142273306846619,
0.12132187932729... |
func (p *HTTPPool) Set(peers ...string) {
p.mu.Lock()
defer p.mu.Unlock()
p.peers = consistenthash.New(p.opts.Replicas, p.opts.HashFn)
p.peers.Add(peers...)
p.httpGetters = make(map[string]*httpGetter, len(peers))
for _, peer := range peers {
p.httpGetters[peer] = &httpGetter{transport: p.Transport, baseURL: pe... | [
-1.1600825786590576,
0.18384085595607758,
0.21857480704784393,
-0.38133668899536133,
0.3860560953617096,
0.8498644232749939,
-0.35809141397476196,
0.10999620705842972,
-0.8134941458702087,
0.21281082928180695,
-0.37263500690460205,
0.9582493305206299,
-0.7643868923187256,
0.118055745959281... |
func RegisterAuthProvider(name string, factory ProvidersFactory) {
providersMutex.Lock()
defer providersMutex.Unlock()
if _, found := providers[name]; found {
logger.Get().Critical("Auth provider %s was registered twice", name)
}
providers[name] = factory
} | [
-1.2187044620513916,
0.31916868686676025,
0.36174276471138,
0.08731693029403687,
0.07411687821149826,
-0.10089131444692612,
-0.24381841719150543,
-0.8106601238250732,
0.9340161681175232,
0.6130541563034058,
-1.1693238019943237,
0.795357346534729,
-0.18254433572292328,
0.10895759612321854,
... |
func InitAuthProvider(name string, configFilePath string) (AuthInterface, error) {
var authprovider AuthInterface
if name == "" {
logger.Get().Info("No providers specified.")
return nil, nil
}
var err error
if configFilePath != "" {
config, err := os.Open(configFilePath)
if err != nil {
logger.Get().... | [
-0.4784286916255951,
-0.741248369216919,
0.45512038469314575,
0.06425375491380692,
-0.8718055486679077,
-0.28034138679504395,
0.3637703061103821,
0.0004469623963814229,
0.4767967760562897,
0.46809571981430054,
-0.22001348435878754,
0.39709123969078064,
-0.8953921794891357,
0.12365184724330... |
func ProfileHandler(c buffalo.Context) error {
user := models.User{}
db := c.Value("tx").(*pop.Connection)
db.Find(&user, c.Param("uid"))
return c.Render(200, r.JSON(user))
} | [
0.6983545422554016,
0.5124679803848267,
0.45575976371765137,
0.2777212858200073,
-0.07064991444349289,
0.1267324537038803,
0.46218860149383545,
-0.10851366072893143,
0.17639967799186707,
0.846157968044281,
0.31285086274147034,
-1.0313454866409302,
-0.9080975651741028,
0.025338105857372284,... |
func platformConstructExitStatus(e libcontainerd.StateInfo) *container.ExitStatus {
return &container.ExitStatus{
ExitCode: int(e.ExitCode),
}
} | [
-0.3015625774860382,
-0.5766768455505371,
0.2787906229496002,
-0.45766404271125793,
-0.12429855018854141,
0.40207457542419434,
-0.534450113773346,
0.7035565376281738,
-0.9987387657165527,
-0.21745282411575317,
-0.35950833559036255,
-0.9241780042648315,
0.8664767742156982,
0.564027488231658... |
func Parse(s string) (v Version, err error) {
var major, minor, patch int
if len(s) == 0 {
return v, errors.New("Empty version string")
}
parts := strings.SplitN(s, ".", 3)
if len(parts) >= 1 {
major, err = strconv.Atoi(parts[0])
if err != nil {
return
}
}
if len(parts) >= 2 {
minor, err = strconv.A... | [
-0.13927166163921356,
-0.3164219856262207,
0.8103811740875244,
-0.06600265949964523,
-1.051334261894226,
-0.22107243537902832,
0.25097233057022095,
-0.10998817533254623,
0.4350569546222687,
-0.2014065533876419,
-0.4044286906719208,
-0.15764708817005157,
-0.5151583552360535,
-0.969343245029... |
func (v Version) Compare(o Version) int {
if v.Major != o.Major {
if v.Major > o.Major {
return 1
}
return -1
}
if v.Minor != o.Minor {
if v.Minor > o.Minor {
return 1
}
return -1
}
if v.Patch != o.Patch {
if v.Patch > o.Patch {
return 1
}
return -1
}
return 0
} | [
-1.111134648323059,
-0.467359721660614,
0.8405665755271912,
-0.37064024806022644,
-0.5582860112190247,
0.18463152647018433,
0.22974908351898193,
-0.15446539223194122,
0.299787700176239,
0.2547885477542877,
-0.6681166291236877,
-0.1289430558681488,
-0.1896803230047226,
0.6056740880012512,
... |
func (_m *VirtualMachine) CreateLXC(opts lxc.CreateOptions) (task.Task, error) {
ret := _m.Called(opts)
var r0 task.Task
if rf, ok := ret.Get(0).(func(lxc.CreateOptions) task.Task); ok {
r0 = rf(opts)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(task.Task)
}
}
var r1 error
if rf, ok := ret.Get(1).... | [
0.28948846459388733,
-0.10005588084459305,
0.6484750509262085,
-0.09780613332986832,
0.2207673043012619,
0.24455125629901886,
0.5436160564422607,
0.03861026093363762,
-0.07404376566410065,
-0.20272809267044067,
-0.14934377372264862,
0.08189567178487778,
-0.0051888637244701385,
0.5343976020... |
func (_m *VirtualMachine) CreateQEMU(opts qemu.CreateOptions) (task.Task, error) {
ret := _m.Called(opts)
var r0 task.Task
if rf, ok := ret.Get(0).(func(qemu.CreateOptions) task.Task); ok {
r0 = rf(opts)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(task.Task)
}
}
var r1 error
if rf, ok := ret.Get(... | [
-0.5841575264930725,
0.11473079025745392,
0.662994921207428,
0.126982182264328,
0.8324233293533325,
-0.26610860228538513,
0.738280177116394,
-0.21885237097740173,
0.35297369956970215,
-0.5384111404418945,
-0.5055911540985107,
0.023216916248202324,
-0.6117514371871948,
0.19015125930309296,
... |
func (_m *VirtualMachine) DeleteLXC(vmid uint, purge bool, force bool) (task.Task, error) {
ret := _m.Called(vmid, purge, force)
var r0 task.Task
if rf, ok := ret.Get(0).(func(uint, bool, bool) task.Task); ok {
r0 = rf(vmid, purge, force)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(task.Task)
}
}
... | [
0.6935646533966064,
0.02427035942673683,
0.7877787351608276,
-0.39992865920066833,
0.1628461480140686,
-0.5632375478744507,
-0.18649783730506897,
-0.21066448092460632,
0.4000868499279022,
0.4778982996940613,
-0.15071770548820496,
0.8038034439086914,
-0.08693574368953705,
0.4228071570396423... |
func (_m *VirtualMachine) DeleteQEMU(vmid uint, purge bool, force bool) (task.Task, error) {
ret := _m.Called(vmid, purge, force)
var r0 task.Task
if rf, ok := ret.Get(0).(func(uint, bool, bool) task.Task); ok {
r0 = rf(vmid, purge, force)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(task.Task)
}
}
... | [
-0.22418884932994843,
0.05822528526186943,
0.5777286887168884,
-0.06055113300681114,
0.4932578504085541,
-0.9335468411445618,
0.07653685659170151,
-0.25238749384880066,
0.5740200877189636,
0.4304804503917694,
-0.5008880496025085,
0.8214605450630188,
-0.6085215210914612,
0.45519688725471497... |
func (_m *VirtualMachine) Get(vmid uint) (vm.VirtualMachine, error) {
ret := _m.Called(vmid)
var r0 vm.VirtualMachine
if rf, ok := ret.Get(0).(func(uint) vm.VirtualMachine); ok {
r0 = rf(vmid)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(vm.VirtualMachine)
}
}
var r1 error
if rf, ok := ret.Get(1).... | [
-0.553398847579956,
-0.4288604259490967,
0.3946736454963684,
0.04793383926153183,
0.7604853510856628,
-0.4657529592514038,
0.039779577404260635,
-0.23437261581420898,
0.1391441822052002,
0.32198822498321533,
0.19378182291984558,
0.8366795778274536,
-0.5832359194755554,
0.2785186171531677,
... |
func (_m *VirtualMachine) List() ([]vm.VirtualMachine, error) {
ret := _m.Called()
var r0 []vm.VirtualMachine
if rf, ok := ret.Get(0).(func() []vm.VirtualMachine); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]vm.VirtualMachine)
}
}
var r1 error
if rf, ok := ret.Get(1).(func() erro... | [
-0.3307511508464813,
-0.2674611508846283,
0.4405022859573364,
0.4546280801296234,
0.8990166783332825,
-0.28753694891929626,
0.5280981063842773,
0.796364963054657,
0.18423868715763092,
0.0358114093542099,
-0.799390971660614,
0.45855292677879333,
-0.00161316420417279,
0.6651881337165833,
-... |
func (_m *VirtualMachine) ListByKind(kind vm.Kind) ([]vm.VirtualMachine, error) {
ret := _m.Called(kind)
var r0 []vm.VirtualMachine
if rf, ok := ret.Get(0).(func(vm.Kind) []vm.VirtualMachine); ok {
r0 = rf(kind)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]vm.VirtualMachine)
}
}
var r1 error
if ... | [
0.002842000452801585,
-0.43867990374565125,
0.2856326997280121,
0.4976657032966614,
0.46786046028137207,
-0.3433099091053009,
0.44712626934051514,
-0.5714341402053833,
-0.07216180115938187,
0.8265847563743591,
-0.5887359380722046,
0.6187372803688049,
-0.4004191756248474,
0.9629270434379578... |
func NewCudaDevice(d cuda.Device) Device {
device := cudaDevice(d)
return &device
} | [
-0.29497453570365906,
0.39735299348831177,
0.19448697566986084,
0.2811046540737152,
-1.375230312347412,
-0.008587921038269997,
0.2402459979057312,
-0.11536340415477753,
0.48409420251846313,
-0.6864268779754639,
0.19821757078170776,
1.012072205543518,
0.2636863887310028,
0.6840973496437073,... |
func (d *cudaDevice) GetAttributes() (map[string]interface{}, error) {
return nil, fmt.Errorf("GetAttributes is not supported for CUDA devices")
} | [
-0.5861091017723083,
0.17322494089603424,
0.5216518640518188,
0.6699437499046326,
-0.2411631941795349,
-0.4445914328098297,
-0.31868624687194824,
0.26231327652931213,
-0.05708247050642967,
0.0007455619634129107,
0.07361473888158798,
0.3611305058002472,
-0.9092611074447632,
0.34445500373840... |
func (d *cudaDevice) GetCudaComputeCapability() (int, int, error) {
major, r := cuda.Device(*d).GetAttribute(cuda.COMPUTE_CAPABILITY_MAJOR)
if r != cuda.SUCCESS {
return 0, 0, fmt.Errorf("failed to get CUDA compute capability major for device: result=%v", r)
}
minor, r := cuda.Device(*d).GetAttribute(cuda.COMPUT... | [
-1.3490408658981323,
0.007337411865592003,
0.7710399627685547,
0.016784075647592545,
-0.7656853795051575,
-0.5947751998901367,
0.862501323223114,
-0.02223040722310543,
-0.5302705764770508,
0.08912782371044159,
0.30414697527885437,
0.11710544675588608,
0.22352862358093262,
0.835123419761657... |
func (d *cudaDevice) GetDeviceHandleFromMigDeviceHandle() (Device, error) {
return nil, fmt.Errorf("GetDeviceHandleFromMigDeviceHandle is unsupported for CUDA devices")
} | [
0.21090248227119446,
0.04325110837817192,
0.3616439402103424,
0.7205032706260681,
-0.9568381309509277,
0.7118785977363586,
0.7020791172981262,
-0.30684688687324524,
0.35301437973976135,
-0.7285335063934326,
0.691461443901062,
0.5065813064575195,
-1.0524369478225708,
0.12066926062107086,
... |
func (d *cudaDevice) GetTotalMemoryMB() (uint64, error) {
total, r := cuda.Device(*d).TotalMem()
if r != cuda.SUCCESS {
return 0, fmt.Errorf("failed to get memory info for device: %v", r)
}
return total / (1024 * 1024), nil
} | [
0.05111328512430191,
-0.03960384801030159,
0.7336907386779785,
0.42109379172325134,
0.4933133125305176,
-0.6358082890510559,
0.834816038608551,
-0.27594566345214844,
0.7154312133789062,
-0.003677534172311425,
-0.1246754601597786,
0.052280668169260025,
-0.9607869982719421,
0.624058485031127... |
func (d *cudaDevice) GetMigDevices() ([]Device, error) {
return nil, fmt.Errorf("GetMigDevices is unsupported for CUDA devices")
} | [
-0.7791780829429626,
0.40684187412261963,
0.6370902061462402,
1.2800929546356201,
-0.14102031290531158,
0.1823989748954773,
-0.14776866137981415,
-0.09802385419607162,
0.9484478831291199,
-0.08899141103029251,
-0.1207503229379654,
0.8916928172111511,
-1.249813437461853,
1.5494028329849243,... |
func (d *cudaDevice) GetName() (string, error) {
name, r := cuda.Device(*d).GetName()
if r != cuda.SUCCESS {
return "", fmt.Errorf("failed to get device name: %v", r)
}
return name, nil
} | [
-0.7849014401435852,
0.39302167296409607,
0.4637841582298279,
1.0490306615829468,
-0.4691063165664673,
-0.5812451839447021,
0.23315387964248657,
-0.6965831518173218,
-0.39464589953422546,
0.7896273136138916,
0.5882022380828857,
0.1278904229402542,
-0.03465425968170166,
0.46559885144233704,... |
func (d *cudaDevice) GetUUID() (string, error) {
return "", fmt.Errorf("GetUUID is unsupported for CUDA devices")
} | [
-0.06663010269403458,
0.18677830696105957,
0.7237475514411926,
0.6406000256538391,
-0.9194259643554688,
0.5996609926223755,
0.26147156953811646,
0.5540013313293457,
0.44216015934944153,
0.2070331871509552,
0.6397775411605835,
0.7532094120979309,
-0.24955330789089203,
0.3436719477176666,
... |
func (d *cudaDevice) IsMigCapable() (bool, error) {
return false, nil
} | [
-0.8497921228408813,
0.16695424914360046,
0.7937271595001221,
0.8587626814842224,
-0.8991605639457703,
0.070102758705616,
0.749275803565979,
0.23716160655021667,
0.43304750323295593,
0.6848244071006775,
0.4245178997516632,
-0.4654594659805298,
-1.7264735698699951,
1.4114311933517456,
0.6... |
func (d *cudaDevice) IsMigEnabled() (bool, error) {
return false, nil
} | [
-0.7375493049621582,
0.2568742632865906,
0.610548198223114,
1.1050856113433838,
-0.28659144043922424,
-0.25541606545448303,
-0.08822967857122421,
0.8468737602233887,
0.5871269702911377,
0.10109736770391464,
-0.647837221622467,
-0.43116992712020874,
-1.8028802871704102,
1.3114526271820068,
... |
func NewExporter(uri url.URL, insecure bool, user, password string) *Exporter {
q := uri.Query()
metricsURI := uri
q.Set("query", "select metric, value from system.metrics")
metricsURI.RawQuery = q.Encode()
asyncMetricsURI := uri
q.Set("query", "select metric, value from system.asynchronous_metrics")
asyncMetri... | [
-0.39356890320777893,
0.38047245144844055,
0.7084357738494873,
0.9597256183624268,
0.017114831134676933,
-0.17893429100513458,
0.10302162170410156,
0.243498295545578,
0.2603449821472168,
0.01897861249744892,
0.39460718631744385,
0.2811632454395294,
-0.3036251962184906,
1.0295109748840332,
... |
func (e *Exporter) Describe(ch chan<- *prometheus.Desc) {
// We cannot know in advance what metrics the exporter will generate
// from clickhouse. So we use the poor man's describe method: Run a collect
// and send the descriptors of all the collected metrics.
metricCh := make(chan prometheus.Metric)
doneCh := ma... | [
-0.017053408548235893,
0.3989719748497009,
0.7304241061210632,
0.044263407588005066,
0.6936157941818237,
0.21372707188129425,
-0.5649591684341431,
-0.6941423416137695,
-0.6837366819381714,
0.3186965584754944,
0.24471674859523773,
0.9634037017822266,
0.04007605090737343,
1.0712519884109497,... |
func (e *Exporter) Collect(ch chan<- prometheus.Metric) {
upValue := 1
if err := e.collect(ch); err != nil {
log.Printf("Error scraping clickhouse: %s", err)
e.scrapeFailures.Inc()
e.scrapeFailures.Collect(ch)
upValue = 0
}
ch <- prometheus.MustNewConstMetric(
prometheus.NewDesc(
prometheus.BuildFQN... | [
-0.6840357184410095,
-0.24184107780456543,
0.6149461269378662,
0.1793719381093979,
0.387370765209198,
0.5168506503105164,
-0.0012773940106853843,
-0.21504805982112885,
-0.5462214946746826,
0.407177597284317,
0.7534650564193726,
0.38093170523643494,
0.8682407140731812,
1.2131679058074951,
... |
func toSnake(in string) string {
runes := []rune(in)
length := len(runes)
var out []rune
for i := 0; i < length; i++ {
if i > 0 && unicode.IsUpper(runes[i]) && ((i+1 < length && unicode.IsLower(runes[i+1])) || unicode.IsLower(runes[i-1])) {
out = append(out, '_')
}
out = append(out, unicode.ToLower(runes[... | [
-0.6353192925453186,
-0.014857464469969273,
0.7463899850845337,
-0.6761847734451294,
-0.30665943026542664,
-0.7269413471221924,
-0.12179750949144363,
-0.21380333602428436,
-0.15061278641223907,
0.9223482608795166,
-1.0188838243484497,
0.8512009382247925,
-0.2307998090982437,
-0.44662919640... |
func (dbHandler *DbHandler) CreateUser(user user.User) (err error) {
psw, _ := bcrypt.GenerateFromPassword([]byte(user.Password), bcrypt.DefaultCost)
user.Password = string(psw)
err = dbHandler.handlers[UserCollection].GetCollection().Insert(user)
return
} | [
0.034927789121866226,
0.5677237510681152,
0.5086467862129211,
0.6917550563812256,
0.5816324949264526,
1.1376334428787231,
0.1938197761774063,
0.0392550453543663,
-0.1807338446378708,
0.12239684909582138,
-1.5409371852874756,
-1.044075846672058,
-0.7762230038642883,
0.8253053426742554,
0.... |
func (dbHandler *DbHandler) RemoveUser(currentUsername string, currentUserPassword string, username string) (err error) {
currentUser, userFindErr := dbHandler.FindUser(currentUsername)
if userFindErr != nil {
err = userFindErr
return
}
isAdmin := currentUser.UserLevel == user.LevelAdmin
if !isAdmin {
err =... | [
-0.7916957139968872,
-0.26265949010849,
0.5588629841804504,
0.8977620005607605,
-0.3200671970844269,
0.6559081673622131,
0.44191157817840576,
-0.2663327157497406,
-0.5642256736755371,
0.371149480342865,
0.00222589704208076,
0.4067690372467041,
-1.2630524635314941,
0.8036102056503296,
0.7... |
func (dbHandler *DbHandler) UserLogin(credential user.Credential, issueJWT bool) (token string, tokenExpirationTime time.Time, err error) {
u, userFindErr := dbHandler.FindUser(credential.Username)
if userFindErr != nil { // user not found
err = errors.New("user not found")
return
}
pswCompErr := bcrypt.Compar... | [
-0.31557732820510864,
-0.4459546208381653,
0.9602733850479126,
-0.4727341830730438,
-1.1076565980911255,
0.12556353211402893,
-0.04025448113679886,
0.6383978128433228,
0.510941743850708,
0.33830592036247253,
-0.8238494992256165,
-0.27158504724502563,
0.24136994779109955,
0.1508757919073104... |
func (dbHandler *DbHandler) PlaceSearch(req *PlaceSearchRequest) (places []POI.Place, err error) {
collName := string(req.PlaceCat)
dbHandler.SetCollHandler(collName)
err = EnsureSpatialIndex(dbHandler.handlers[collName].GetCollection())
if err != nil {
return
}
if _, exist := dbHandler.handlers[collName]; !ex... | [
-0.9793126583099365,
0.046937793493270874,
0.5092881917953491,
-0.04737578704953194,
0.9965762495994568,
0.8832806944847107,
-0.2437237650156021,
0.034605272114276886,
-0.6476466655731201,
0.1967974156141281,
-0.11905695497989655,
-0.6879017949104309,
-0.7852941751480103,
0.538342118263244... |
func EnsureSpatialIndex(coll *mgo.Collection) (err error) {
index := mgo.Index{
Key: []string{"$2dsphere:location"},
}
err = coll.EnsureIndex(index)
return
} | [
0.26533305644989014,
-0.3312828838825226,
0.3401012718677521,
0.4624543786048889,
0.020398380234837532,
0.9606866240501404,
-0.041404061019420624,
0.054048120975494385,
0.3269924223423004,
0.0021617235615849495,
-0.7070779800415039,
0.31838372349739075,
0.015233762562274933,
0.051078319549... |
func (router *Router) Handler(req *http.Request) (h http.Handler, pattern string) {
for _, route := range router.Routes {
match := route.Pattern.FindStringSubmatch(req.URL.Path)
if len(match) != 0 {
return http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
ctx := HTTPContext{
Response: ... | [
-0.4386975169181824,
-0.5119353532791138,
0.5542061924934387,
-0.0118350675329566,
0.26338472962379456,
0.12433062493801117,
0.7281062006950378,
0.743200421333313,
0.14563709497451782,
-0.41522130370140076,
0.0755215734243393,
-0.7359268665313721,
0.8349176049232483,
0.04136576130986214,
... |
func NewMiddleware(directorURL string) *middleware {
return &middleware{
directorURL: directorURL,
}
} | [
-0.4353127181529999,
-0.7210949063301086,
-0.00660700723528862,
1.0163302421569824,
-1.118285059928894,
-0.4835900664329529,
-0.9057589769363403,
0.4027230739593506,
0.8234150409698486,
-0.8199263215065002,
-0.37552303075790405,
0.6984546780586243,
-0.7675246000289917,
0.6428088545799255,
... |
func (m middleware) ExtensionName() string {
return "OperationsExtension"
} | [
0.7783463597297668,
-0.013491898775100708,
0.6670470237731934,
1.194928526878357,
-0.9529976844787598,
-0.5590821504592896,
0.22081927955150604,
1.0282214879989624,
1.0532898902893066,
0.3927787244319916,
0.3996042311191559,
-0.22879718244075775,
0.18657968938350677,
-0.04593442752957344,
... |
func (m middleware) Validate(_ gqlgen.ExecutableSchema) error {
return nil
} | [
0.43811193108558655,
0.06598445773124695,
0.29104989767074585,
0.4818600118160248,
0.30441659688949585,
0.6033859252929688,
0.6663930416107178,
-0.7067081928253174,
0.10417494177818298,
-0.9222507476806641,
0.363179087638855,
0.10915078967809677,
-1.2202486991882324,
1.2949074506759644,
... |
func (m *middleware) InterceptOperation(ctx context.Context, next gqlgen.OperationHandler) gqlgen.ResponseHandler {
operations := make([]*Operation, 0)
ctx = SaveToContext(ctx, &operations)
return next(ctx)
} | [
-0.4375177025794983,
1.0024069547653198,
0.26002222299575806,
-0.3786749541759491,
-0.15143901109695435,
0.23233407735824585,
1.3477611541748047,
-0.15980039536952972,
0.7666062116622925,
0.43890851736068726,
-0.38492491841316223,
-1.0998756885528564,
-0.5158007144927979,
-0.68635064363479... |
func (m *middleware) InterceptResponse(ctx context.Context, next gqlgen.ResponseHandler) *gqlgen.Response {
resp := next(ctx)
operations, ok := FromCtx(ctx)
if !ok {
return resp
}
locations := make([]string, 0)
for _, operation := range *operations {
operationURL := fmt.Sprintf("%s/%s/%s", m.directorURL, op... | [
-0.05060390383005142,
-0.10912002623081207,
0.6444452404975891,
-0.832478404045105,
-0.2768169343471527,
-0.41919806599617004,
0.8606049418449402,
-0.5657527446746826,
0.883327066898346,
0.867898166179657,
-0.05333010479807854,
-0.6827145218849182,
-0.23087725043296814,
-0.1292424201965332... |
func NewSet(name string, client *Client) Set {
return Set{name: name, c: client}
} | [
0.9037229418754578,
0.12963132560253143,
0.2270892709493637,
-1.2271088361740112,
-1.404138445854187,
-0.07446230202913284,
-0.44333502650260925,
-1.0012562274932861,
-1.4497824907302856,
0.7593212127685547,
0.014619720168411732,
0.9449178576469421,
-0.04441371560096741,
-0.657271087169647... |
func (set Set) Name() string { return set.name } | [
-0.5653574466705322,
-0.30487412214279175,
0.15417833626270294,
-0.41661375761032104,
-1.5263395309448242,
0.15061712265014648,
-0.13004834949970245,
-1.3723063468933105,
-0.5843150615692139,
0.8986707925796509,
-0.1985034942626953,
0.12106619030237198,
0.3197314739227295,
0.14097031950950... |
func (set Set) Add(ctx context.Context, members ...string) (int64, error) {
req := newRequestSize(2+len(members), "\r\n$4\r\nSADD\r\n$")
req.addStringAndStrings(set.name, members)
return set.c.cmdInt(ctx, req)
} | [
-0.6579908728599548,
0.44441771507263184,
0.5907690525054932,
-0.21518123149871826,
0.4934072494506836,
0.1863907426595688,
-0.8935761451721191,
-0.8450136184692383,
-0.6675485372543335,
-0.2211141288280487,
0.24492734670639038,
0.9635915756225586,
-1.5292143821716309,
0.34394678473472595,... |
func (set Set) Cardinality(ctx context.Context) (int64, error) {
req := newRequest("*2\r\n$5\r\nSCARD\r\n$")
req.addString(set.name)
return set.c.cmdInt(ctx, req)
} | [
-0.7181060910224915,
0.4789457619190216,
0.4498564600944519,
0.4492778480052948,
0.0027878195978701115,
-0.5346670746803284,
-0.17362268269062042,
-0.6415196657180786,
-0.31714993715286255,
-0.02299455739557743,
-0.37279945611953735,
0.41482725739479065,
-0.6491038799285889,
0.448376536369... |
func (set Set) Diff(ctx context.Context, keys ...string) ([]string, error) {
req := newRequestSize(2+len(keys), "\r\n$5\r\nSDIFF\r\n$")
req.addStringAndStrings(set.name, keys)
return set.c.cmdStrings(ctx, req)
} | [
-1.465088129043579,
-0.007409418933093548,
0.5760216116905212,
-0.02886607125401497,
0.004998216405510902,
0.12269744277000427,
-0.7728647589683533,
-1.027808427810669,
-0.8219539523124695,
0.3366294205188751,
-0.32474616169929504,
0.8857167959213257,
-0.6529574990272522,
0.678331017494201... |
func (set Set) DiffStore(ctx context.Context, dst string, keys ...string) (int64, error) {
req := newRequestSize(3+len(keys), "\r\n$10\r\nSDIFFSTORE\r\n$")
req.addString2AndStrings(dst, set.name, keys)
return set.c.cmdInt(ctx, req)
} | [
-1.3773618936538696,
0.6976534724235535,
0.433694452047348,
-0.5156043171882629,
-0.7601416110992432,
0.10164419561624527,
0.17133668065071106,
-0.6851969361305237,
-0.5136488080024719,
-0.3042755722999573,
-0.9321722984313965,
0.6379812955856323,
-0.9318974018096924,
-0.13811254501342773,... |
func (set Set) Inter(ctx context.Context, keys ...string) ([]string, error) {
req := newRequestSize(2+len(keys), "\r\n$6\r\nSINTER\r\n$")
req.addStringAndStrings(set.name, keys)
return set.c.cmdStrings(ctx, req)
} | [
-0.5840421915054321,
0.2996967136859894,
0.6941452622413635,
-0.1258085072040558,
-0.2400251179933548,
-0.5133548378944397,
-1.328297734260559,
-0.8980910778045654,
-0.9991185665130615,
0.2748130261898041,
0.08095601946115494,
0.6178784966468811,
-1.2815793752670288,
-0.19954459369182587,
... |
func (set Set) IsMember(ctx context.Context, member string) (bool, error) {
req := newRequest("*3\r\n$9\r\nSISMEMBER\r\n$")
req.addString2(set.name, member)
res, err := set.c.cmdInt(ctx, req)
return res == 1, err
} | [
-0.6871400475502014,
0.8507483601570129,
0.496185839176178,
0.03139713034033775,
-0.18056781589984894,
-0.017467178404331207,
-0.9689925909042358,
-0.7912312746047974,
0.22783739864826202,
-0.07537785172462463,
-0.022156186401844025,
0.8928625583648682,
-1.794299840927124,
-0.2282742112874... |
func (set Set) Members(ctx context.Context) ([]string, error) {
req := newRequest("*2\r\n$8\r\nSMEMBERS\r\n$")
req.addString(set.name)
return set.c.cmdStrings(ctx, req)
} | [
-0.8835024833679199,
0.19175302982330322,
0.20585384964942932,
-0.4981820583343506,
0.3895087242126465,
0.1000637412071228,
-1.5450326204299927,
-1.1350656747817993,
-0.13608106970787048,
-0.035335782915353775,
0.255920946598053,
1.1584938764572144,
-1.0983132123947144,
0.23750033974647522... |
func (set Set) MultiIsMembers(ctx context.Context, members ...string) ([]bool, error) {
req := newRequestSize(2+len(members), "\r\n$10\r\nSMISMEMBER\r\n$")
req.addStringAndStrings(set.name, members)
ss, err := set.c.cmdInts(ctx, req)
if err != nil {
return nil, err
}
res := make([]bool, len(ss))
for i := range... | [
-1.382623314857483,
0.2543858289718628,
0.5518158078193665,
0.6078903675079346,
0.24364368617534637,
-0.14743009209632874,
-1.2445068359375,
-0.12258372455835342,
0.3859024941921234,
0.8421173691749573,
-0.856343150138855,
0.42455819249153137,
-1.799957036972046,
1.0807945728302002,
-0.8... |
func (set Set) MoveTo(ctx context.Context, dst, member string) (bool, error) {
req := newRequest("*4\r\n$5\r\nSMOVE\r\n$")
req.addString3(set.name, dst, member)
res, err := set.c.cmdInt(ctx, req)
return res == 1, err
} | [
-0.8539842963218689,
0.9586281776428223,
0.602666974067688,
-0.5346611738204956,
-0.5352145433425903,
0.06587134301662445,
-0.6831681728363037,
-0.8939549922943115,
-1.096009612083435,
0.3749563694000244,
-0.8016580939292908,
0.5197291970252991,
-0.8442631363868713,
-0.8462666869163513,
... |
func (set Set) Pop(ctx context.Context) (string, error) {
req := newRequest("*2\r\n$4\r\nSPOP\r\n$")
req.addString(set.name)
return set.c.cmdString(ctx, req)
} | [
-0.6032496094703674,
0.6718207001686096,
0.5189412236213684,
-0.1177963986992836,
-0.5390877723693848,
-0.057794712483882904,
-0.31501057744026184,
-1.4530469179153442,
-0.40557169914245605,
0.6301991939544678,
0.22498616576194763,
0.25154921412467957,
-0.4215345084667206,
-0.5671911239624... |
func (set Set) Pops(ctx context.Context, count int) ([]string, error) {
req := newRequest("*3\r\n$4\r\nSPOP\r\n$")
req.addStringInt(set.name, int64(count))
return set.c.cmdStrings(ctx, req)
} | [
-0.9528573155403137,
0.41054704785346985,
0.6111941337585449,
-0.4533139765262604,
0.019475555047392845,
-0.19439615309238434,
-0.9133426547050476,
-1.2299830913543701,
-0.2494945526123047,
1.233647346496582,
-0.15406443178653717,
-0.24877001345157623,
-0.44525080919265747,
-0.550595104694... |
func (set Set) RandomMember(ctx context.Context) (string, error) {
req := newRequest("*2\r\n$11\r\nSRANDMEMBER\r\n$")
req.addString(set.name)
return set.c.cmdString(ctx, req)
} | [
-0.2962210476398468,
0.40562155842781067,
0.37082239985466003,
-0.32439446449279785,
-0.45932990312576294,
0.5920767188072205,
-0.8247336149215698,
-1.2077851295471191,
0.05403568223118782,
-0.5885739922523499,
-0.09669586271047592,
0.7344660758972168,
-1.2932735681533813,
0.23070013523101... |
func (set Set) RandomMembers(ctx context.Context, count int64) ([]string, error) {
req := newRequestSize(int(1+count), "\r\n$11\r\nSRANDMEMBER\r\n$")
req.addStringInt(set.name, count)
return set.c.cmdStrings(ctx, req)
} | [
-0.6917534470558167,
0.27474379539489746,
0.2549513280391693,
-0.5127333402633667,
0.29341962933540344,
0.21050991117954254,
-1.115990161895752,
-1.291905403137207,
0.08109887689352036,
-0.05659249797463417,
-0.1415630578994751,
0.6902371644973755,
-1.4755849838256836,
0.5750458240509033,
... |
func (set Set) Remove(ctx context.Context, members ...string) (int64, error) {
req := newRequestSize(2+len(members), "\r\n$4\r\nSREM\r\n$")
req.addStringAndStrings(set.name, members)
return set.c.cmdInt(ctx, req)
} | [
-0.7288298606872559,
0.5118937492370605,
0.6678289771080017,
-0.23225721716880798,
-0.2972643971443176,
-0.45456406474113464,
-0.46996140480041504,
-0.2748851776123047,
-0.6167649030685425,
-0.15707826614379883,
-0.5144460797309875,
0.5195769667625427,
-1.8996694087982178,
-0.1802143156528... |
func (set Set) Scan(ctx context.Context) error {
panic("redis: Set.Scan not implemented")
} | [
-0.6690987348556519,
0.6934476494789124,
0.2767863869667053,
0.2197924703359604,
-0.622816801071167,
0.48576849699020386,
-0.0814952701330185,
-1.2771036624908447,
0.6068598628044128,
-0.6391825079917908,
0.1353096216917038,
1.0394320487976074,
0.4403083920478821,
0.4184768795967102,
-0.... |
func (set Set) Union(ctx context.Context, keys ...string) ([]string, error) {
req := newRequestSize(2+len(keys), "\r\n$6\r\nSUNION\r\n$")
req.addStringAndStrings(set.name, keys)
return set.c.cmdStrings(ctx, req)
} | [
-1.3086787462234497,
0.08051031082868576,
0.5879657864570618,
-0.06064796447753906,
0.22050926089286804,
-0.4090258777141571,
-1.1649315357208252,
-0.8622840642929077,
-0.253969669342041,
0.3439730405807495,
-0.42519938945770264,
1.109718680381775,
-0.6623353362083435,
0.14152589440345764,... |
func (set Set) UnionStore(ctx context.Context, dst string, keys ...string) (int64, error) {
req := newRequestSize(3+len(keys), "\r\n$11\r\nSUNIONSTORE\r\n$")
req.addString2AndStrings(dst, set.name, keys)
return set.c.cmdInt(ctx, req)
} | [
-1.3879703283309937,
1.1013875007629395,
0.43990781903266907,
-0.6599420309066772,
-0.47410547733306885,
0.32986271381378174,
-0.2872191071510315,
-0.24659676849842072,
-0.0011713883141055703,
-0.49816086888313293,
-0.925215482711792,
0.47828051447868347,
-0.8122357726097107,
-0.6846238970... |
func (m *CompaniesItemJournalsItemJournalLinesJournalLineItemRequestBuilder) Account()(*CompaniesItemJournalsItemJournalLinesItemAccountRequestBuilder) {
return NewCompaniesItemJournalsItemJournalLinesItemAccountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter)
} | [
-0.15101128816604614,
-0.08127548545598984,
0.2310449331998825,
0.3850001096725464,
0.18066418170928955,
-0.28035059571266174,
1.0097384452819824,
0.1887880265712738,
1.1916933059692383,
-0.9961352944374084,
0.6693633794784546,
1.1307507753372192,
-0.04360707849264145,
0.046165574342012405... |
func NewCompaniesItemJournalsItemJournalLinesJournalLineItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CompaniesItemJournalsItemJournalLinesJournalLineItemRequestBuilder) {
m := &CompaniesItemJournalsItem... | [
-0.20510730147361755,
-0.28138795495033264,
0.43920499086380005,
-0.7031382918357849,
-0.5066201686859131,
0.23924288153648376,
-0.22931942343711853,
-0.02117275260388851,
-0.22534604370594025,
-0.7971886992454529,
0.17761395871639252,
0.054453302174806595,
-0.5468897819519043,
-0.21353155... |
func NewCompaniesItemJournalsItemJournalLinesJournalLineItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CompaniesItemJournalsItemJournalLinesJournalLineItemRequestBuilder) {
urlParams := make(map[string]string)
urlParams["reques... | [
-0.5752455592155457,
-0.21968448162078857,
0.21631789207458496,
0.009946285746991634,
-0.1699855923652649,
-0.09390033036470413,
-0.5671074986457825,
0.22310489416122437,
0.3034454584121704,
-1.0576382875442505,
0.10950888693332672,
-0.5288404822349548,
-0.28106001019477844,
-0.24782989919... |
func (m *CompaniesItemJournalsItemJournalLinesJournalLineItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *CompaniesItemJournalsItemJournalLinesJournalLineItemRequestBuilderDeleteRequestConfiguration)(error) {
requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);
if er... | [
0.23249861598014832,
-0.28094178438186646,
0.5772333741188049,
-0.14031018316745758,
-0.18827003240585327,
0.014588949270546436,
-0.15276555716991425,
-0.03213098645210266,
0.33362799882888794,
-0.36646363139152527,
0.36998656392097473,
-0.1476968377828598,
-0.6646409630775452,
0.122787535... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.