text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func PromptAction() string {
prompt := promptui.Select{
Label: "Select action",
Items: []string{"Add to Github organizations/ teams", "Remove from Github organization", "Make site admin"},
}
_, result, err := prompt.Run()
if err != nil {
log.Fatalf("Prompt failed %v\n", err)
}
return result
} | [
-0.1407279223203659,
-0.6525866985321045,
0.17991790175437927,
-0.14441241323947906,
0.8567496538162231,
0.659029483795166,
0.4722527265548706,
-0.9071176052093506,
0.8630611300468445,
0.9507275223731995,
-0.12732896208763123,
1.1306875944137573,
-0.36779293417930603,
-0.19129104912281036,... |
func GetOrgsForUser(username string) map[string]createUser.Org {
Client = githubLogin.CreateClient()
allOrgs := createUser.GetAllOrgs()
userOrgs := make(map[string]createUser.Org)
for org := range allOrgs {
isMember, _, err := Client.Organizations.IsMember(context.Background(), org, username)
if err != nil {
... | [
0.09082682430744171,
0.6670945882797241,
0.3125339150428772,
0.35565170645713806,
-0.010785199701786041,
0.42264848947525024,
-0.29009005427360535,
-0.3995561897754669,
-0.8388023972511292,
-0.4186573624610901,
-0.1740105301141739,
-0.2356032431125641,
-0.156460240483284,
0.641842424869537... |
func (s *Saver) sendResponse(i interface{}, idleDeath bool, id int) {
select {
case <-s.stop:
s.logFunc(LogInfo, "ignoring send response, saver will stop.")
return
default:
// Nothing, just continue...
}
// No stop signal, send the response
res := &SaverResponse{
i,
idleDeath,
id,
}
s.logFunc(LogInf... | [
-0.9751814603805542,
-0.2728874385356903,
0.4151696562767029,
0.9308318495750427,
0.576490044593811,
-0.03618520870804787,
0.33069583773612976,
-0.651037871837616,
0.9016624093055725,
0.9192625880241394,
-0.8473687767982483,
-1.4491522312164307,
-0.6858612298965454,
-0.5706047415733337,
... |
func NewDefaultCryptoHandlerOpts() *CryptoHandlerOpts {
return &CryptoHandlerOpts{
TransformOpts: &TransformOpts{TransformItems: []Transformable{
NewFileTransformable(TfstateFilename, true, ThBkpExtension),
NewFileTransformable(TfstateBkpFilename, true, ThBkpExtension)},
TfvarsFilename: TfvarsFilename},
E... | [
0.3328528106212616,
0.02677604742348194,
0.29226720333099365,
-0.3121359348297119,
0.6450181603431702,
0.18188780546188354,
-0.07617144286632538,
0.0002542163711041212,
-0.7234041094779968,
0.5033097863197327,
-1.0544393062591553,
-0.5513553619384766,
-0.36206260323524475,
0.25466179847717... |
func (o *CryptoHandlerOpts) InlineMode() bool {
return o.EncMode == ThEncryptModeInline
} | [
0.04698856174945831,
-0.1014939546585083,
0.2260027974843979,
0.20181195437908173,
0.3656614124774933,
0.47741636633872986,
-0.2192598283290863,
0.032561469823122025,
-0.2750142812728882,
0.7804088592529297,
-0.6827623844146729,
0.17093977332115173,
-1.664813756942749,
-0.7754911780357361,... |
func (o *CryptoHandlerOpts) ValidateForEncryptDecrypt() error {
if o.EncProvider == ThEncryptProviderSimple && o.SimpleKey == "" {
return fmt.Errorf("You must supply a valid simple-key when using the simply provider. " +
"The simple provider uses AES and so the AES key should be either 16 or 32 byte to select AES... | [
-0.37749698758125305,
0.47304466366767883,
0.5807342529296875,
-0.40016600489616394,
0.4466993808746338,
0.04892870783805847,
-0.12243539094924927,
-0.4624338746070862,
-0.2749263346195221,
0.266468346118927,
-0.10531830042600632,
-0.33620020747184753,
-0.20910240709781647,
0.3533617258071... |
func (t *CryptoHandler) Init(ctx *CryptoHandlerOpts) error {
return t.Encrypter.Init(ctx.NamedEncKey)
} | [
-0.11636444181203842,
0.4611361026763916,
0.33798113465309143,
-0.27675798535346985,
0.19532178342342377,
0.6062825322151184,
-0.3763863146305084,
0.013153107836842537,
-0.7919168472290039,
0.6802529692649841,
-0.9946302175521851,
0.24874314665794373,
-0.1634681224822998,
0.962400019168853... |
func (t *CryptoHandler) Encrypt(ctx *CryptoHandlerOpts) error {
return t.applyCryptoAction(ctx,
func(ctx *CryptoHandlerOpts, ci Transformable) error { return t.encrypt(ctx, ci) })
} | [
0.5962668061256409,
1.219398021697998,
0.22512833774089813,
0.29521018266677856,
1.401724934577942,
0.2211395800113678,
1.0984419584274292,
-0.7358719110488892,
0.3485308885574341,
-0.0432768352329731,
-0.02260608971118927,
-0.056264396756887436,
-0.35241085290908813,
0.06656897068023682,
... |
func (t *CryptoHandler) Decrypt(ctx *CryptoHandlerOpts) error {
return t.applyCryptoAction(ctx,
func(ctx *CryptoHandlerOpts, ci Transformable) error { return t.decrypt(ctx, ci) })
} | [
0.6663378477096558,
1.2685846090316772,
0.25290369987487793,
0.7661948204040527,
1.2130680084228516,
-0.09961704164743423,
1.1044244766235352,
-0.4484395980834961,
0.51791912317276,
-0.06450880318880081,
-0.07002747803926468,
-0.07922236621379852,
-0.3675549030303955,
0.001996530219912529,... |
func (t *CryptoHandler) applyCryptoAction(ctx *CryptoHandlerOpts, cryptoFunc cryptoTransformAction) error {
// Do first pass over all items to be encrypted/decrypted to ensure they are
// all valid before we begin
for _, ci := range ctx.TransformItems {
if err := ci.validate(); err != nil {
log.Printf("Not a va... | [
-0.07968113571405411,
-0.3479333519935608,
0.5581572651863098,
-0.03522304445505142,
0.9373908638954163,
-0.15984264016151428,
0.758198082447052,
0.21397288143634796,
0.4279814660549164,
0.023047273978590965,
-0.037538714706897736,
0.3236764371395111,
-0.0651959702372551,
0.501873970031738... |
func (t *CryptoHandler) encryptInline(plain []byte, key, tfvf string, dblEncrypt bool, exclWhitespace bool) ([]byte, error) {
if !dblEncrypt {
r := regexp.MustCompile(thCryptoWrapRegExp)
m := r.FindSubmatch(plain)
if len(m) >= 1 {
return nil, newCryptoWrapError(errMsgAlreadyEncrypted)
}
}
tfvu := NewTfV... | [
-0.6847427487373352,
0.538612425327301,
0.6411617994308472,
-0.29217690229415894,
-0.2809700667858124,
0.19153931736946106,
-0.4090004861354828,
0.22596381604671478,
-0.5412334203720093,
0.7225131392478943,
-0.5991100072860718,
-0.22459858655929565,
-1.2218830585479736,
0.09684447944164276... |
func Add(kp *keypool.KeyPool, keyDir string) error {
err := os.MkdirAll(keyDir, 0700)
if err != nil {
return err
}
kp.RegisterStorage(nil, writeKeyToDir(keyDir), loadKeysFromDir(keyDir))
return nil
} | [
-0.44546377658843994,
0.12972651422023773,
0.4973883330821991,
0.30865412950515747,
0.2395872324705124,
0.834839403629303,
0.04707025736570358,
0.24236924946308136,
0.42366036772727966,
-0.12267999351024628,
-0.34731292724609375,
0.22324621677398682,
-0.5844849348068237,
0.9608767032623291... |
func writeKeyToDir(keyDir string) keypool.WriteKeyCallbackFunc {
return func(keyid []byte, usage string, marshalledKey []byte) error {
// Write key to file in keyDir
err := ioutil.WriteFile(filepath.Join(keyDir, fmt.Sprintf("%x.pubkey", keyid)), marshalledKey, 0600)
if err != nil {
return err
}
return nil... | [
0.06525415927171707,
-0.9195939302444458,
0.495589017868042,
-0.14453376829624176,
0.23918095231056213,
0.4720690846443176,
0.48440977931022644,
0.5557711720466614,
-0.17016516625881195,
0.21719352900981903,
0.2792556881904602,
-0.046789541840553284,
0.31158122420310974,
1.0362045764923096... |
func loadKeysFromDir(keyDir string) keypool.LoadKeysCallbackFunc {
return func(keypool *keypool.KeyPool) error {
files, err := ioutil.ReadDir(keyDir)
if err != nil {
return err
}
for _, file := range files {
d, err := ioutil.ReadFile(filepath.Join(keyDir, file.Name()))
if err != nil {
return err
... | [
-0.1314821094274521,
0.08148030936717987,
0.7377429008483887,
-0.24467991292476654,
-1.1669533252716064,
-0.10453979671001434,
0.008936266414821148,
-0.6885132789611816,
-0.17027120292186737,
0.6683968901634216,
-0.20732234418392181,
-0.4185679852962494,
-0.32607051730155945,
0.66816437244... |
func (fn ShowMoveDatesSummaryHandlerFunc) Handle(params ShowMoveDatesSummaryParams) middleware.Responder {
return fn(params)
} | [
0.31621670722961426,
0.7432954907417297,
0.4144963324069977,
-0.05747099965810776,
-1.0013514757156372,
0.5651124119758606,
0.692585289478302,
0.2108209878206253,
0.6595599055290222,
0.2523311376571655,
0.760349690914154,
0.7855410575866699,
0.5454173684120178,
0.1571251004934311,
-0.108... |
func NewShowMoveDatesSummary(ctx *middleware.Context, handler ShowMoveDatesSummaryHandler) *ShowMoveDatesSummary {
return &ShowMoveDatesSummary{Context: ctx, Handler: handler}
} | [
0.5745783448219299,
0.8330937027931213,
0.1764374077320099,
-0.3139967918395996,
-1.3141496181488037,
0.3830432593822479,
0.25247013568878174,
0.3034745454788208,
0.46884801983833313,
0.4609287679195404,
0.2899574041366577,
1.8015187978744507,
1.2058125734329224,
0.8179799914360046,
-0.1... |
func NewMIME(mime string) MIME {
kind, subtype := splitMime(mime)
return MIME{Type: kind, Subtype: subtype, Value: mime}
} | [
-0.4905795753002167,
-0.4336402714252472,
0.31341755390167236,
1.198501706123352,
-1.0162112712860107,
-0.012381955981254578,
-0.3369961678981781,
0.6674289703369141,
-0.33324164152145386,
0.6505497694015503,
-0.30806317925453186,
-0.1898321956396103,
-1.5192004442214966,
-1.20092654228210... |
func ScrubFile(repoPath string, fileName string) error {
gitPath, _ := exec.LookPath("git")
cmd := NewCommand("filter-branch", "--force", "--prune-empty", "--tag-name-filter", "cat",
"--index-filter", "\""+gitPath+"\" rm --cached --ignore-unmatch "+fileName,
"--", "--all")
_, err := cmd.RunInDir(repoPath);
if e... | [
0.9585447311401367,
0.2947748005390167,
0.9654654264450073,
0.13477084040641785,
0.360384464263916,
0.8775763511657715,
0.6350963711738586,
0.16128948330879211,
-0.7178820371627808,
0.37134501338005066,
0.8275308012962341,
0.11269078403711319,
-0.43397384881973267,
0.46429601311683655,
0... |
func ScrubCommitNameAndEmail(repoPath, newName, newEmail string) error {
os.RemoveAll(path.Join(repoPath, ".git/refs/original/"))
if _, err := NewCommand("filter-branch", "-f", "--env-filter", `
export GIT_COMMITTER_NAME="`+newName+`"
export GIT_COMMITTER_EMAIL="`+newEmail+`"
export GIT_AUTHOR_NAME="`+newName+`"
expo... | [
0.5846561193466187,
-0.23296457529067993,
0.8159425258636475,
-0.40027326345443726,
-0.019383518025279045,
0.23323172330856323,
0.08029086142778397,
0.04376506060361862,
-0.47007620334625244,
1.033440113067627,
0.4148165285587311,
1.3325142860412598,
-0.5049543976783752,
0.3317179679870605... |
func NewWorkspace(identifier string) Workspace {
return Workspace{
Identifier: identifier,
CurrentVersion: "4.0",
CreateVersion: "4.0",
}
} | [
-0.7207146883010864,
-1.1528522968292236,
0.16020885109901428,
0.15253300964832306,
-0.6731908321380615,
-0.1282227635383606,
-0.25713014602661133,
-0.3894707262516022,
0.6714491844177246,
-0.454616516828537,
-1.0099766254425049,
-0.06896188855171204,
-0.5785041451454163,
-0.09323690086603... |
func (w *Workspace) FindProject(id string) *Project {
for i, p := range w.Projects {
if p.Identifier == id {
return w.Projects[i]
}
}
return nil
} | [
-0.05636924132704735,
-0.22313591837882996,
0.11675215512514114,
-0.021572096273303032,
-0.2234918475151062,
-0.10192806273698807,
-0.2253846526145935,
-1.3017003536224365,
0.6076933741569519,
0.43333497643470764,
0.525440514087677,
-0.0279422365128994,
-1.4952248334884644,
0.1959866881370... |
func (w *Workspace) AddProject(p *Project) {
// Add this system to project
w.Projects = append(w.Projects, p)
// Sort the Systems
sort.Sort(ByProjectID(w.Projects))
} | [
-0.6652699708938599,
0.5211821794509888,
0.2926549017429352,
0.3389250934123993,
0.45955947041511536,
1.1250641345977783,
-0.5144034028053284,
-1.246152400970459,
0.7412904500961304,
-0.6132141947746277,
0.38794824481010437,
-0.21902713179588318,
-1.0783966779708862,
0.7278780341148376,
... |
func (w *Workspace) ConvertToHandover() {
w.convert(ptHandover)
} | [
-0.02117646299302578,
-0.26747965812683105,
0.2842895984649658,
-0.29320862889289856,
0.014465680345892906,
0.6642006039619446,
0.35092005133628845,
-0.7792641520500183,
0.1564570516347885,
-0.01597273349761963,
0.3027264475822449,
-0.17111210525035858,
-0.290030300617218,
0.22349433600902... |
func (w *Workspace) ConvertToRelease() {
w.convert(ptRelease)
} | [
-0.22106173634529114,
-0.280108779668808,
0.14912377297878265,
-0.6177641153335571,
0.047514658421278,
-0.6030313968658447,
-0.7366604208946228,
-0.4032681882381439,
0.7344524264335632,
0.7252862453460693,
0.5421453714370728,
0.3392677903175354,
-1.1394290924072266,
0.5810253620147705,
-... |
func (w *Workspace) convert(pt packType) {
// itterate over all Projects
for pi, p := range w.Projects {
// Itterate over all Systems
for si, s := range p.Systems {
// Create new File Stack for this system
var files []*File
// Itterate over all Files
for _, f := range s.Files {
// Select the exten... | [
-0.13426357507705688,
0.16602648794651031,
0.7703129053115845,
-0.5753931999206543,
0.06093113124370575,
0.3001386225223541,
0.1896999031305313,
-0.17957298457622528,
0.07859175652265549,
0.5873520970344543,
0.11936990171670914,
0.10811664909124374,
-0.34216737747192383,
0.8571423292160034... |
func (w *Workspace) FromBytes(b []byte) error {
// Convert XML to Structure
xml.Unmarshal(b, &w)
// Return Cleanly
return nil
} | [
-0.15556477010250092,
-0.03051447495818138,
0.16459184885025024,
-0.26164907217025757,
-0.6499036550521851,
0.426099956035614,
0.11202379316091537,
0.008940157480537891,
1.4008166790008545,
-0.3596220910549164,
-0.4131386876106262,
-0.16284839808940887,
-0.5909772515296936,
-0.001069849007... |
func (w *Workspace) ToXML() ([]byte, error) {
// Set static values
w.CurrentVersion = "4.0"
// Create a ByteBuffer
b := &bytes.Buffer{}
// Add xml header constant
b.WriteString(xml.Header)
// Prep new encoder
//output, err := xml.MarshalIndent(w, "", "")
output, err := xml.Marshal(w)
if err != nil {
return... | [
-0.23172450065612793,
0.245045006275177,
0.8474435806274414,
0.15691417455673218,
-0.665963888168335,
0.07123520225286484,
-0.021823152899742126,
-0.16045434772968292,
0.8667646050453186,
-0.0027899262495338917,
-0.2679935693740845,
0.2085452377796173,
-1.080116868019104,
0.244133353233337... |
func (w *Workspace) SetRelativeFilepaths() {
// itterate over all elements
for pi, p := range w.Projects {
for si, s := range p.Systems {
for fi, f := range s.Files {
w.Projects[pi].Systems[si].Files[fi].FilePathName = filepath.Join(FileFolder(f.Type), filepath.Base(f.FilePathName))
}
}
}
} | [
0.2574796974658966,
-0.3933754861354828,
0.5776198506355286,
0.5016120672225952,
-0.14723017811775208,
1.2518746852874756,
0.4117352366447449,
0.16422715783119202,
-0.7287275791168213,
0.4018579423427582,
0.09906014800071716,
-0.5868588089942932,
-0.682190477848053,
0.9598950743675232,
0... |
func (w *Workspace) SetAbsoluteFilepaths(path string) {
// itterate over all elements
for pi, p := range w.Projects {
for si, s := range p.Systems {
for fi, f := range s.Files {
if !filepath.IsAbs(f.FilePathName) {
w.Projects[pi].Systems[si].Files[fi].FilePathName = filepath.Join(path, f.FilePathName)
... | [
-0.22972317039966583,
-0.854046642780304,
0.7744232416152954,
-0.24962280690670013,
-0.5317478775978088,
1.7646712064743042,
0.08092743903398514,
0.13564826548099518,
-0.5976678133010864,
0.6754693388938904,
-0.2789379358291626,
-0.6249238848686218,
-0.08442850410938263,
0.8986594676971436... |
func FileFolder(t string) string {
switch t {
case "TKN", "Source", "MasterSrc":
{
return "Source"
}
case "Include":
{
return "Includes"
}
case "IR", "AMX_IR_DB", "IRN_DB":
{
return "IR Files"
}
case "TP4", "TP5", "TPD", "KPD":
{
return "Interfaces"
}
case "XDD", "Module", "DUET", ... | [
-0.3986903131008148,
-0.8665331602096558,
0.36424797773361206,
-0.6109384298324585,
-0.5902639031410217,
0.5657879710197449,
0.5905730128288269,
0.33673200011253357,
-0.5515823364257812,
0.05977523699402809,
-0.22130267322063446,
-0.5123383402824402,
0.2973763346672058,
0.9956884384155273,... |
func (b *Blob) Format() []byte {
rjson, err := json.Marshal(b)
if err == nil {
return rjson
}
return nil
} | [
0.6912647485733032,
-0.9462220668792725,
0.5003124475479126,
-0.17340610921382904,
0.2773178517818451,
-0.4688985049724579,
-1.1835654973983765,
-0.8325119018554688,
0.6746773719787598,
0.5030202865600586,
-0.11619773507118225,
0.5798556208610535,
-0.939221978187561,
0.5398576855659485,
... |
func main() {
flag.Parse()
//高级接口
http.HandleFunc("/advance", handler.WithAdvanced(handler.Simple))
//简单接口
http.HandleFunc("/simple", handler.Simple)
http.HandleFunc("/", index)
fmt.Println("Starting Server on", hostPort)
if err := http.ListenAndServe(hostPort, nil); err != nil {
log.Fatalf("HTTP Server Fa... | [
0.3548307716846466,
-0.4427477717399597,
0.8987863659858704,
0.6630540490150452,
0.8806574940681458,
1.0302352905273438,
0.3917559087276459,
0.7616999745368958,
-1.0476857423782349,
-0.892967939376831,
-0.5499683022499084,
-0.3433859944343567,
0.01657641865313053,
-0.06952740252017975,
0... |
func checkAndProcessLeafList(existingEntry db.Value, tblRw db.Value, opcode int, d *db.DB, tblNm string, tblKey string) db.Value {
dbTblSpec := &db.TableSpec{Name: tblNm}
mergeTblRw := db.Value{Field: map[string]string{}}
for field, value := range tblRw.Field {
if strings.HasSuffix(field, "@") {
exstLst := exis... | [
0.2764388918876648,
-0.47759756445884705,
0.9136388897895813,
-0.1921061873435974,
-0.37960201501846313,
0.26224106550216675,
-0.1763889193534851,
0.3943749964237213,
0.5305203795433044,
0.67413729429245,
0.1522207111120224,
0.07120196521282196,
-0.32858410477638245,
1.637420654296875,
-... |
func areEqual(a, b interface{}) bool {
if util.IsValueNil(a) && util.IsValueNil(b) {
return true
}
va, vb := reflect.ValueOf(a), reflect.ValueOf(b)
if va.Kind() == reflect.Ptr && vb.Kind() == reflect.Ptr {
return reflect.DeepEqual(va.Elem().Interface(), vb.Elem().Interface())
}
return reflect.DeepEqual(a, b)... | [
-0.5737000107765198,
-0.0597132071852684,
0.9182894825935364,
0.2895425856113434,
0.3131217956542969,
0.2780812382698059,
0.020386630669236183,
-0.34627190232276917,
0.04277486726641655,
0.9808146953582764,
-0.1663953810930252,
1.186144471168518,
-0.7328072190284729,
0.7481984496116638,
... |
func CopySliceToTable(L *lua.State, vslice reflect.Value) int {
if vslice.IsValid() && vslice.Type().Kind() == reflect.Slice {
n := vslice.Len()
L.CreateTable(n, 0)
for i := 0; i < n; i++ {
L.PushInteger(int64(i + 1))
GoToLua(L, nil, vslice.Index(i))
L.SetTable(-3)
}
return 1
}... | [
-0.8796972632408142,
0.5816174149513245,
0.6173952221870422,
0.3205675184726715,
-0.5240263342857361,
-0.26230111718177795,
0.4393870234489441,
0.14679211378097534,
-0.17528925836086273,
1.3131030797958374,
-0.1965937614440918,
0.3134854733943939,
-0.1004401445388794,
-0.020058441907167435... |
func CopyMapToTable(L *lua.State, vmap reflect.Value) int {
if vmap.IsValid() && vmap.Type().Kind() == reflect.Map {
n := vmap.Len()
L.CreateTable(0, n)
for _, key := range vmap.MapKeys() {
val := vmap.MapIndex(key)
GoToLua(L, nil, key)
GoToLua(L, nil, val)
L.SetTable(-3)
}
... | [
-1.0296458005905151,
-0.04329921305179596,
0.8225238919258118,
0.2074766308069229,
-0.722780704498291,
0.009381377138197422,
0.391613245010376,
0.37652117013931274,
0.08892333507537842,
0.6322357654571533,
0.16594256460666656,
-0.09953230619430542,
-0.058303575962781906,
-0.325439870357513... |
func GoToLua(L *lua.State, t reflect.Type, val reflect.Value) {
proxify := true
if !val.IsValid() || val.IsNil() {
L.PushNil()
return
}
if t == nil {
t = val.Type()
if t.Kind() == reflect.Interface { // unbox interfaces!
val = valueOf(val.Interface())
t = val.Type()
}
proxif... | [
-0.4360847771167755,
0.6164822578430176,
0.9854826927185059,
-0.24197815358638763,
-0.33737289905548096,
-0.10788571834564209,
0.39498502016067505,
-0.1268804669380188,
0.24338656663894653,
0.3313695192337036,
0.1497793346643448,
1.2995365858078003,
0.3858683109283447,
0.2836015522480011,
... |
func LuaToGo(L *lua.State, t reflect.Type, idx int) interface{} {
var value interface{}
var kind reflect.Kind
if t == nil { // let the Lua type drive the conversion...
switch L.Type(idx) {
case lua.LUA_TNIL:
return nil // well, d'oh
case lua.LUA_TBOOLEAN:
kind = reflect.Bool
case lua.... | [
-0.3615722954273224,
0.034992944449186325,
0.8160905241966248,
-0.8157724142074585,
-0.7195299863815308,
-0.4039134979248047,
-0.2880586087703705,
-0.38090601563453674,
0.000098056421848014,
-0.19349408149719238,
0.012158720754086971,
0.6719831228256226,
0.582206130027771,
-0.1666037291288... |
func GoLuaFunc(L *lua.State, fun interface{}) lua.LuaGoFunction {
switch f := fun.(type) {
case func(*lua.State) int:
return f
case func(string) string:
return func(L *lua.State) int {
L.PushString(f(L.ToString(1)))
return 1
}
case func(float64) float64:
return func(L *lua.State) int... | [
-0.45997047424316406,
0.5963659882545471,
0.8983029723167419,
-0.15854975581169128,
-0.1398129016160965,
-0.7892975807189941,
0.5266237258911133,
0.5580704808235168,
-0.7590468525886536,
-0.44290196895599365,
-0.16010682284832,
0.6912095546722412,
0.9937254786491394,
-0.015367848798632622,... |
func Register(L *lua.State, table string, values Map) {
register(L, table, values, true)
} | [
-0.4175734221935272,
0.7967948317527771,
0.11732754856348038,
0.4081811308860779,
0.09189214557409286,
-0.12354418635368347,
-0.9079034924507141,
1.0021841526031494,
-1.0654854774475098,
-0.8309887647628784,
-0.8344957232475281,
-0.025234505534172058,
0.8989423513412476,
0.5968197584152222... |
func (lo *LuaObject) Get(idx interface{}) interface{} {
L := lo.L
lo.Push() // the table
GoToLua(L, nil, valueOf(idx))
L.GetTable(-2)
val := LuaToGo(L, nil, -1)
L.Pop(1) // the table
return val
} | [
-0.5938062071800232,
0.259152889251709,
0.48165127635002136,
0.21180716156959534,
-0.15544073283672333,
-0.357709139585495,
-0.6129163503646851,
-0.5088557600975037,
-0.21682338416576385,
-0.5211815237998962,
-0.12988469004631042,
0.6319750547409058,
0.018544061109423637,
-0.55419838428497... |
func (lo *LuaObject) Set(idx interface{}, val interface{}) interface{} {
L := lo.L
lo.Push() // the table
GoToLua(L, nil, valueOf(idx))
GoToLua(L, nil, valueOf(val))
L.SetTable(-3)
L.Pop(1) // the table
return val
} | [
-0.2038804590702057,
0.39461633563041687,
0.3555099666118622,
-0.10149243474006653,
-0.6059291958808899,
0.12350086867809296,
-0.49350506067276,
-0.591015636920929,
0.06159649416804314,
0.04247775673866272,
-0.059820935130119324,
0.288347452878952,
-0.15265417098999023,
-0.6257489323616028... |
func (lo *LuaObject) Call(args ...interface{}) (res interface{}, err error) {
L := lo.L
lo.Push() // the function...
for _, arg := range args { // push the args
GoToLua(L, nil, valueOf(arg))
}
ret := L.PCall(len(args), 1, 0)
if ret == 0 { // cool
res = LuaToGo(L, nil, -1)
} else {... | [
-0.3636930286884308,
0.26228728890419006,
0.8096857070922852,
0.25943538546562195,
0.15238673985004425,
0.19690832495689392,
-0.9911843538284302,
-0.35110172629356384,
-0.6423240900039673,
0.011516927741467953,
0.014448530972003937,
-0.3962410092353821,
-0.6534298658370972,
0.0075702299363... |
func (lo *LuaObject) Push() {
lo.L.RawGeti(lua.LUA_REGISTRYINDEX, lo.Ref)
} | [
-0.008602598682045937,
0.019080599769949913,
0.36371591687202454,
-0.24097594618797302,
0.13594277203083038,
0.37820199131965637,
0.5069081783294678,
-0.3312193751335144,
0.38052070140838623,
-0.11827147006988525,
-0.4704663157463074,
1.368962287902832,
-0.002217900240793824,
0.30519002676... |
func (lo *LuaObject) Close() {
lo.L.Unref(lua.LUA_REGISTRYINDEX, lo.Ref)
} | [
0.17193104326725006,
-0.6467812061309814,
0.22638429701328278,
-0.8668762445449829,
-0.37337392568588257,
0.7836911082267761,
0.9302968382835388,
-0.18404382467269897,
0.12369512021541595,
-0.9363972544670105,
0.02722468227148056,
0.5613958239555359,
-0.9346989989280701,
0.4784008860588074... |
func (lo *LuaObject) Iter() *LuaTableIter {
return &LuaTableIter{lo, true, nil, nil}
} | [
0.3927662670612335,
-1.12952721118927,
0.2570585310459137,
0.28501906991004944,
-0.13508479297161102,
0.6801750659942627,
0.41653335094451904,
-0.25523218512535095,
-0.24212534725666046,
-0.8328495025634766,
0.28922978043556213,
-0.49157488346099854,
0.23027542233467102,
-0.005200104787945... |
func NewLuaObject(L *lua.State, idx int) *LuaObject {
tp := L.LTypename(idx)
L.PushValue(idx)
ref := L.Ref(lua.LUA_REGISTRYINDEX)
return &LuaObject{L, ref, tp}
} | [
0.15519815683364868,
-0.3061041831970215,
0.33559656143188477,
-0.9170432090759277,
-0.9564554691314697,
0.2935391962528229,
-0.5076385736465454,
-0.5299854278564453,
0.62558513879776,
-0.7058562636375427,
-0.8642236590385437,
0.10642064362764359,
0.37809357047080994,
-0.4501553475856781,
... |
func NewLuaObjectFromName(L *lua.State, path string) *LuaObject {
Lookup(L, path, 0)
return NewLuaObject(L, -1)
} | [
0.22244951128959656,
-1.4592992067337036,
0.38607311248779297,
-0.21777822077274323,
-1.249523639678955,
-0.006892121396958828,
-0.6066857576370239,
-0.08143021166324615,
0.025847874581813812,
-0.5235453844070435,
-0.8084938526153564,
-0.4918823838233948,
0.4128285050392151,
-0.76255750656... |
func Lookup(L *lua.State, path string, idx int) {
parts := strings.Split(path, ".")
if idx != 0 {
L.PushValue(idx)
} else {
L.GetGlobal("_G")
}
for _, field := range parts {
L.GetField(-1, field)
L.Remove(-2) // remove table
}
} | [
-0.6568130850791931,
0.5550016164779663,
0.5588579177856445,
-0.4417753517627716,
-0.3312968909740448,
0.3055048882961273,
0.6109049916267395,
0.2576143145561218,
-0.39646461606025696,
0.7759621143341064,
0.08361026644706726,
0.03517043963074684,
-0.10298419743776321,
-1.196576476097107,
... |
func Init() *lua.State {
var L = lua.NewState()
L.OpenLibs()
initializeProxies(L)
RawRegister(L, "luar", Map{
"map2table": map2table,
"slice2table": slice2table,
})
return L
} | [
-0.15788280963897705,
-0.2949615716934204,
0.3794005513191223,
-0.5474274754524231,
-0.3832809627056122,
0.3727964758872986,
0.047269340604543686,
0.881113588809967,
0.6520283222198486,
-1.0525131225585938,
0.07189379632472992,
0.20382316410541534,
0.3476279079914093,
-0.018310043960809708... |
func NewLeaseFromProto(a *poolrpc.Lease) *Lease {
var opHash chainhash.Hash
copy(opHash[:], a.ChannelPoint.Txid)
chanPoint := fmt.Sprintf("%v:%d", opHash, a.ChannelPoint.OutputIndex)
return &Lease{
ChannelPoint: chanPoint,
ChannelAmtSat: a.ChannelAmtSat,
ChannelDurationBlocks: a.ChannelDurat... | [
1.0473003387451172,
-0.7193489074707031,
0.4700332283973694,
-0.8483079671859741,
-0.4580528140068054,
-0.12100722640752792,
-0.6451088786125183,
-0.655788004398346,
0.18838317692279816,
-0.5172685980796814,
-0.16905462741851807,
0.251597136259079,
-1.1194939613342285,
-0.05525351315736770... |
func NewSnapshotsFromProto(s []*auctioneerrpc.BatchSnapshotResponse) []*Snapshot {
result := make([]*Snapshot, len(s))
for idx, snapshot := range s {
result[idx] = &Snapshot{
Version: snapshot.Version,
BatchID: hex.EncodeToString(
snapshot.BatchId,
),
PrevBatchID: hex.EncodeToString(
snapshot.Pr... | [
0.32300522923469543,
-0.9877933859825134,
0.21179449558258057,
0.34224313497543335,
-0.1447450965642929,
0.1638941913843155,
-0.3829362690448761,
-0.27236104011535645,
0.202881321310997,
-0.2987125515937805,
-0.5218451619148254,
-0.6565443277359009,
0.101939357817173,
0.09854709357023239,
... |
func NewCatalogContent()(*CatalogContent) {
m := &CatalogContent{
DeployableContent: *NewDeployableContent(),
}
odataTypeValue := "#microsoft.graph.windowsUpdates.catalogContent"
m.SetOdataType(&odataTypeValue)
return m
} | [
0.05728567764163017,
-0.35646334290504456,
0.17933668196201324,
-0.17017778754234314,
-1.7850821018218994,
0.208267480134964,
-0.6993772387504578,
-0.2783702611923218,
-0.2626751959323883,
0.922758936882019,
0.08930706977844238,
0.456074059009552,
-0.23733919858932495,
-0.27557873725891113... |
func CreateCatalogContentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewCatalogContent(), nil
} | [
0.5836120247840881,
-0.29311349987983704,
0.3260231018066406,
0.2165430635213852,
-1.347359538078308,
0.38149988651275635,
-0.37866947054862976,
0.02927044779062271,
-0.3258885443210602,
-0.3151346445083618,
0.3233991265296936,
-0.0346817821264267,
0.4534221291542053,
0.2728477716445923,
... |
func (m *CatalogContent) GetCatalogEntry()(CatalogEntryable) {
val, err := m.GetBackingStore().Get("catalogEntry")
if err != nil {
panic(err)
}
if val != nil {
return val.(CatalogEntryable)
}
return nil
} | [
1.0611903667449951,
0.173630952835083,
-0.11371049284934998,
0.5785843729972839,
0.34550073742866516,
0.3463142216205597,
-0.3388515114784241,
-0.02956727333366871,
-0.24539336562156677,
-0.07818831503391266,
0.42689767479896545,
0.46829989552497864,
-0.5094128847122192,
-0.560289561748504... |
func (m *CatalogContent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := m.DeployableContent.GetFieldDeserializers()
res["catalogEntry"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) er... | [
0.023832639679312706,
0.29042142629623413,
0.31886026263237,
-0.5533133149147034,
0.10717279464006424,
-0.33339089155197144,
-0.15619637072086334,
0.3047442138195038,
-0.9320041537284851,
-0.6560167670249939,
-0.6059516668319702,
0.19400902092456818,
-1.0248914957046509,
0.0325154215097427... |
func (m *CatalogContent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
err := m.DeployableContent.Serialize(writer)
if err != nil {
return err
}
{
err = writer.WriteObjectValue("catalogEntry", m.GetCatalogEntry())
... | [
0.059943415224552155,
0.21547521650791168,
0.2752942740917206,
-0.12281879037618637,
0.5015003681182861,
-0.21939902007579803,
0.44373753666877747,
0.18018129467964172,
-0.8177456259727478,
0.5192229747772217,
0.10553457587957382,
0.20901042222976685,
-0.4928545355796814,
0.348918497562408... |
func (m *CatalogContent) SetCatalogEntry(value CatalogEntryable)() {
err := m.GetBackingStore().Set("catalogEntry", value)
if err != nil {
panic(err)
}
} | [
0.5974094867706299,
0.16074246168136597,
-0.20067015290260315,
0.19537998735904694,
0.1133643314242363,
0.9185599684715271,
-0.4635044038295746,
-0.02601645328104496,
-0.5137112736701965,
0.16706913709640503,
-0.3871605098247528,
-0.20885121822357178,
0.009434926323592663,
0.01557102333754... |
func (c *Client) CreateAwsLogSource(ctx context.Context, params *CreateAwsLogSourceInput, optFns ...func(*Options)) (*CreateAwsLogSourceOutput, error) {
if params == nil {
params = &CreateAwsLogSourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateAwsLogSource", params, optFns, c.addOperationCrea... | [
-0.5297195315361023,
1.2950613498687744,
0.5077618956565857,
-1.0106161832809448,
-0.5632193088531494,
-0.5758915543556213,
0.006364668719470501,
-0.5486970543861389,
0.82969069480896,
0.28945860266685486,
-0.8482705950737,
1.5648833513259888,
0.09784794598817825,
-0.8543825745582581,
-0... |
func (s *Service) ArcHandle(arcMsg *ugcmdl.ArcMsg) {
var (
msgMID = arcMsg.New.Mid
trustUp = false
)
if len(s.activeUps) > 0 { // check whether it's our trust upper
if _, ok := s.activeUps[msgMID]; ok {
trustUp = true
}
} else { // when the memory is not ready, check upper from DB
mid, _ := s.dao.UpIn... | [
-0.009493391960859299,
-0.14986136555671692,
0.8895962834358215,
-0.985032856464386,
-0.17416158318519592,
0.3837161660194397,
0.663871169090271,
0.09597183018922806,
1.0279314517974854,
0.265529990196228,
0.3289016783237457,
0.6634215116500854,
-0.8260250091552734,
0.4214474856853485,
0... |
func (s *Service) arcExist(aid int64) bool {
var (
res *ugcmdl.Archive
err error
)
if res, err = s.dao.ParseArc(ctx, aid); err != nil || res == nil {
return false
}
if res.Deleted == _deleted {
return false
}
return true
} | [
-0.34020131826400757,
-0.4942792057991028,
0.7472350597381592,
-0.7079066038131714,
0.25793570280075073,
0.31978684663772583,
-0.17196273803710938,
-0.1494523584842682,
0.6929755806922913,
1.2690708637237549,
0.22183871269226074,
-0.09800125658512115,
-0.18512025475502014,
0.12229313701391... |
func (s *Service) arcInsert(arc *ugcmdl.ArchDatabus) (err error) {
if exist := s.arcExist(arc.Aid); exist {
appDao.PromError("DsInsert:Exist")
log.Error("Databus Insert Data Aid %d Exist", arc.Aid)
return
}
if err = s.importArc(context.Background(), arc.Aid, false); err != nil {
appDao.PromError("DsInsert:Er... | [
-0.2228611260652542,
0.6196178793907166,
0.7573158144950867,
-0.6752532124519348,
-0.02696979232132435,
0.9247991442680359,
0.722078263759613,
0.32580065727233887,
0.33784765005111694,
0.2535950243473053,
-0.9060966968536377,
0.8677796125411987,
-0.7678443789482117,
0.1701965034008026,
1... |
func (s *Service) arcUpdate(old *ugcmdl.ArchDatabus, new *ugcmdl.ArchDatabus) (err error) {
if !s.arcExist(new.Aid) { // if an archive is not existing yet in our DB, we insert it
return s.arcInsert(new)
}
new.Cover = s.coverURL(new.Cover, s.c.UgcSync.Cfg.BFSPrefix)
var (
oldAllow = &ugcmdl.ArcAllow{}
newAllow... | [
-0.1566772162914276,
-0.7479462027549744,
0.9204839468002319,
0.056145649403333664,
-0.6146944165229797,
0.22242574393749237,
0.29299435019493103,
0.15519948303699493,
0.9824877977371216,
0.3817722797393799,
0.3710024654865265,
0.7642052173614502,
-0.5633418560028076,
0.2352924644947052,
... |
func (s *Service) arcCompare(old *ugcmdl.ArchDatabus, new *ugcmdl.ArchDatabus) (err error) {
var (
diff *ugcmdl.VideoDiff
hitPGC bool
)
if hitPGC, err = s.delPGC(new.TypeID, new.Aid); err != nil {
return
}
if hitPGC { // if the archive hits PGC types, delete it
log.Warn("arcCompare Del Aid %d, Because of... | [
-0.07214116305112839,
-0.5908390283584595,
0.791430652141571,
0.0607718899846077,
0.14865413308143616,
0.04611596092581749,
0.29048407077789307,
-0.2991195321083069,
0.6253771781921387,
0.3804558217525482,
0.4724838137626648,
1.4585163593292236,
0.029345465824007988,
1.1478779315948486,
... |
func (s *Service) getPTypeName(typeID int32) (name string) {
var (
second, first *arcmdl.Tp
ok bool
)
if second, ok = s.arcTypes[typeID]; !ok {
log.Error("can't find type for ID: %d ", typeID)
return
}
if first, ok = s.arcTypes[second.Pid]; !ok {
log.Error("can't find type for ID: %d, second I... | [
-0.20404914021492004,
-0.31724828481674194,
0.852295458316803,
-0.3141433000564575,
-0.1458800882101059,
-0.19255201518535614,
-0.3643910586833954,
-1.2838902473449707,
-0.4492858946323395,
0.5684207677841187,
0.2746114134788513,
-0.25933516025543213,
-0.4256276488304138,
0.711357414722442... |
func (s *Service) getPType(typeID int) (pid int) {
var (
second *arcmdl.Tp
ok bool
)
if second, ok = s.arcTypes[int32(typeID)]; !ok {
log.Error("can't find type for ID: %d ", typeID)
return
}
return int(second.Pid)
} | [
0.40917038917541504,
0.3783853054046631,
0.7057269811630249,
-0.637610137462616,
0.3655705153942108,
-0.3086118996143341,
0.2701943516731262,
-1.3937784433364868,
0.38873982429504395,
0.8745982646942139,
0.4165038764476776,
0.435453861951828,
-0.9879093170166016,
0.30696263909339905,
1.6... |
func (s *Service) diffArc(old *ugcmdl.ArchDatabus, new *ugcmdl.ArchDatabus) (diff bool) {
diff = (old.Title != new.Title)
diff = diff || (old.Content != new.Content)
diff = diff || (old.PubTime != new.PubTime)
diff = diff || (old.TypeID != new.TypeID)
diff = diff || (old.Cover != new.Cover)
diff = diff || (s.getP... | [
-1.0592422485351562,
-0.7677770256996155,
0.6350743770599365,
-0.45307794213294983,
-0.0897466391324997,
0.922996461391449,
0.2650788724422455,
-0.583142876625061,
-0.4938335716724396,
-0.06617271155118942,
-0.19571559131145477,
0.9626341462135315,
-0.4512236714363098,
1.2313504219055176,
... |
func (s *Service) treatDiffV(diff *ugcmdl.VideoDiff) (err error) {
var (
newPages []*arcmdl.Page
page *arcmdl.Page
aid = diff.Aid
tx *sql.Tx
)
// all the operations about this archive's videos, will be in one transaction
if tx, err = s.dao.BeginTran(ctx); err != nil {
log.Error("BeginTran E... | [
-0.36759135127067566,
-0.38640034198760986,
1.0684802532196045,
-0.10357529670000076,
0.35152754187583923,
-0.6034229397773743,
0.6837970614433289,
0.29366543889045715,
1.4848090410232544,
-0.009343895129859447,
0.553754985332489,
0.16336330771446228,
-0.2427700161933899,
1.021559834480285... |
func (m *Message) Send() (string, error) {
return "Message sent successfully by thirdparty library", nil
} | [
0.4014606475830078,
-0.286885142326355,
0.12998181581497192,
0.15963947772979736,
0.10727083683013916,
0.6940152645111084,
-0.7542352080345154,
-0.4614574611186981,
-1.1634747982025146,
0.629173994064331,
0.07127406448125839,
-0.2073313444852829,
-1.3979213237762451,
0.21143747866153717,
... |
func NewAgentServer(certPath string, keyPath string, caCertPath string) (*AgentServer, error) {
agent := a.NewAgent()
log := l.GetLogger()
router := mux.NewRouter()
server := &http.Server{Handler: router}
err := cmn.SetupTLSServer(server, caCertPath)
if err != nil {
return nil, err
}
as := &AgentServer{
a... | [
-0.8212714791297913,
-1.5050638914108276,
0.6861740946769714,
0.11102784425020218,
-0.027938228100538254,
-0.18661528825759888,
0.0965084508061409,
-0.45190107822418213,
0.08321988582611084,
0.23478826880455017,
-0.24543750286102295,
0.505706787109375,
0.1943030059337616,
0.773638784885406... |
func (as *AgentServer) Start(port string) {
as.server.Addr = ":" + port
err := as.server.ListenAndServeTLS(as.certPath, as.keyPath)
if err != nil {
as.log.Error(err)
os.Exit(1)
}
} | [
0.07278231531381607,
-1.3848011493682861,
0.37796643376350403,
-0.26903778314590454,
-0.054436251521110535,
0.5095661878585815,
0.22545956075191498,
0.7357923984527588,
-0.16824813187122345,
0.6897159218788147,
-0.1974291056394577,
0.633388876914978,
0.6440653204917908,
0.4291432797908783,... |
func (r *reconciler) Reconcile(resourceName string) error {
klog.V(4).Infof("Reconciling RBAC for %s", resourceName)
err := r.ensureRBACClusterRole(resourceName)
if err != nil {
return err
}
err = r.ensureRBACClusterRoleBinding(resourceName)
if err != nil {
return err
}
return nil
} | [
0.2784121036529541,
-0.6863223314285278,
0.5883494019508362,
0.37783581018447876,
0.8843686580657959,
-0.30245915055274963,
0.5045880675315857,
-0.4581494927406311,
-0.3594296872615814,
0.08928540349006653,
0.30612245202064514,
-0.01488984003663063,
-0.9784435033798218,
0.7835233211517334,... |
func (t *SimpleChaincode) query(stub shim.ChaincodeStubInterface, args []string) pb.Response {
var A string // Entities
var err error
if len(args) != 1 {
return shim.Error("Incorrect number of arguments. Expecting name of the person to query")
}
A = args[0]
// Get the state from the ledger
Avalbytes, err :=... | [
-0.071141317486763,
-0.44087547063827515,
0.6289578676223755,
-0.6619229316711426,
-0.3802313208580017,
-0.5642701387405396,
-0.5538031458854675,
-0.1730705350637436,
0.2725060284137726,
0.2719052731990814,
0.5165679454803467,
0.20738954842090607,
-0.4239060580730438,
0.4086201786994934,
... |
func (r *RootCommandeer) buildUrl() (*url.URL, error) {
sanitizedPath := r.server
if !strings.HasPrefix(sanitizedPath, "http://") && !strings.HasPrefix(sanitizedPath, "https://") {
sanitizedPath = "http://" + sanitizedPath
}
urlPath, err := url.Parse(sanitizedPath)
if err != nil {
return nil, err
}
return ur... | [
0.051380548626184464,
-0.7223680019378662,
0.685272216796875,
1.4739521741867065,
0.09547536820173264,
0.708501398563385,
0.5268239974975586,
0.709235429763794,
-0.15366029739379883,
-0.20354780554771423,
0.4861173629760742,
0.11555338650941849,
-0.8219465017318726,
0.46676257252693176,
... |
func InitializationVariableEnvironment() {
log.Println("Start reading variable environment")
Project.Mode = os.Getenv("MODE")
Project.JWT.Key = os.Getenv("JWT_KEY")
Project.Crypto.Key = os.Getenv("CRYPTO_KEY") // TODO length must be 32
Project.Crypto.IV = os.Getenv("CRYPTO_IV") // TODO length must be 16
switc... | [
-0.20871566236019135,
-0.2325705736875534,
0.8642164468765259,
0.36746302247047424,
0.3776697516441345,
0.7454691529273987,
0.23583590984344482,
-0.3161054849624634,
-0.8571171760559082,
0.9623531103134155,
-0.2651864290237427,
0.5991618037223816,
-0.530670702457428,
0.3636825978755951,
... |
func (o *Operator) StepDown(key ops.SiteKey) error {
o.cfg.Leader.StepDown()
return nil
} | [
-0.304705947637558,
0.6127117276191711,
0.306944876909256,
0.264799565076828,
0.023607539013028145,
0.6905113458633423,
1.2747828960418701,
0.4851551651954651,
0.46160969138145447,
-0.17967212200164795,
-0.7568122744560242,
-0.36754557490348816,
-0.6761842966079712,
1.0652369260787964,
-... |
func (server *Server) NewWorker(consumerTag string) *Worker {
return &Worker{
server: server,
ConsumerTag: consumerTag,
}
} | [
0.3361871838569641,
-0.8074211478233337,
0.26414191722869873,
0.45087510347366333,
-0.319102019071579,
-0.17089025676250458,
-0.7721057534217834,
-0.4990442991256714,
-0.11939236521720886,
-0.05187113210558891,
-1.3196176290512085,
0.5059656500816345,
-0.9080137610435486,
0.783736824989318... |
func (server *Server) GetConnection() Connectable {
return server.connection
} | [
-0.3382045030593872,
-0.5951036214828491,
0.44772157073020935,
1.1672565937042236,
0.20990218222141266,
-0.18586723506450653,
0.6025302410125732,
0.07205697894096375,
-0.4406329095363617,
-0.13075490295886993,
-0.4601369798183441,
-0.20922191441059113,
-1.1249064207077026,
0.60588818788528... |
func (server *Server) GetConfig() *config.Config {
return server.config
} | [
0.2681826949119568,
0.025608008727431297,
0.3091233968734741,
0.6527034044265747,
-0.02546977438032627,
0.23285578191280365,
0.19349566102027893,
0.612242579460144,
-0.08887653797864914,
-0.3866199254989624,
-0.896120011806488,
0.995071291923523,
-0.5613259673118591,
1.1538465023040771,
... |
func (server *Server) RegisterTasks(tasks map[string]interface{}) {
server.registeredTasks = tasks
} | [
-0.470986932516098,
0.6575276851654053,
0.3722604215145111,
0.6521198749542236,
0.9101690053939819,
0.39630815386772156,
0.09607471525669098,
0.14021840691566467,
0.033585160970687866,
-0.3947654068470001,
-1.7394503355026245,
0.6263718008995056,
-0.0892673209309578,
1.2250723838806152,
... |
func (server *Server) RegisterTask(name string, task interface{}) {
server.registeredTasks[name] = task
} | [
-0.6693077683448792,
0.584494948387146,
0.20408110320568085,
0.7919911742210388,
0.7908488512039185,
0.22090786695480347,
-0.6859769225120544,
0.24678131937980652,
-0.3701457977294922,
0.4120250940322876,
-2.1107900142669678,
0.9288990497589111,
0.10433923453092575,
0.6779122948646545,
0... |
func (server *Server) GetRegisteredTask(name string) interface{} {
return server.registeredTasks[name]
} | [
-0.3892073333263397,
0.7799480557441711,
0.1941022127866745,
0.988690972328186,
0.24462446570396423,
-0.5083271861076355,
0.15009748935699463,
-0.3398057818412781,
-0.23877036571502686,
0.053627874702215195,
-1.5502345561981201,
1.220207929611206,
0.05986619368195534,
0.609072208404541,
... |
func (server *Server) SendTask(s *TaskSignature) error {
message, err := json.Marshal(s)
if err != nil {
return fmt.Errorf("JSON Encode Message: %v", err)
}
if err := server.connection.PublishMessage(
[]byte(message), s.RoutingKey,
); err != nil {
return fmt.Errorf("Publish Message: %v", err)
}
return n... | [
-0.9829054474830627,
0.5142605900764465,
0.7986422181129456,
0.7817650437355042,
-0.332689493894577,
-0.2575763463973999,
0.21902364492416382,
0.201898455619812,
-0.15625207126140594,
1.3998501300811768,
-1.1173760890960693,
0.7830171585083008,
0.0302935391664505,
0.8562021255493164,
-0.... |
func (m *master) Start() {
m.init()
m.setupEtcd()
m.startServer()
go m.startEventHandling()
m.runUserTask()
m.stop()
} | [
-0.21149995923042297,
0.14312009513378143,
0.33526191115379333,
1.0546432733535767,
-0.1755145937204361,
0.17260509729385376,
0.5478512048721313,
0.795513391494751,
-0.6567509770393372,
-0.47577783465385437,
-0.878162682056427,
0.4847085177898407,
0.07635615766048431,
0.5289044380187988,
... |
func Test_fullJustify(t *testing.T) {
type args struct {
words []string
maxWidth int
}
tests := []struct {
name string
args args
want []string
}{
{name: "test", args: struct {
words []string
maxWidth int
}{words: []string{"This", "is", "an", "example", "of", "text", "justification."}, maxW... | [
0.9054399728775024,
0.2608565390110016,
0.7729166150093079,
-1.2218329906463623,
0.037772804498672485,
-0.574329674243927,
-0.24630491435527802,
0.33986714482307434,
-0.10384740680456161,
-0.008281601592898369,
-0.24450233578681946,
0.21675251424312592,
-0.5519927144050598,
1.2535620927810... |
func (reply Reply) IsNil() bool {
return reply.data == nil
} | [
-0.053889017552137375,
-0.2839076519012451,
0.2223069667816162,
-0.8055283427238464,
-0.3663966655731201,
-0.2351170927286148,
-1.1888755559921265,
-0.9869271516799927,
0.5906675457954407,
0.11162986606359482,
-1.2009074687957764,
0.9242151975631714,
-0.6810557246208191,
-0.113421857357025... |
func (reply Reply) String() (string, error) {
result, err := redis.String(reply.data, reply.err)
if err != nil {
return "", redisError(err)
}
return result, nil
} | [
0.1060832217335701,
-0.10277198255062103,
0.12822771072387695,
-0.9718072414398193,
-0.644055962562561,
-0.6031985878944397,
-0.9677734375,
-1.453486680984497,
0.665992796421051,
0.4938253164291382,
0.011399354785680771,
0.8892989158630371,
-0.7410321235656738,
-0.38377952575683594,
0.17... |
func (reply Reply) Bytes() ([]byte, error) {
result, err := redis.Bytes(reply.data, reply.err)
if err != nil {
return []byte{}, redisError(err)
}
return result, nil
} | [
-0.5423150658607483,
0.8665781617164612,
0.20666669309139252,
-1.113692045211792,
0.2179313749074936,
-0.70317143201828,
-2.2462353706359863,
-0.7598509788513184,
1.0514148473739624,
-0.25022056698799133,
-0.3682025671005249,
0.9971737861633301,
-0.9172747731208801,
0.3286128342151642,
-... |
func (reply Reply) Float64() (float64, error) {
result, err := redis.Float64(reply.data, reply.err)
if err != nil {
return 0, redisError(err)
}
return result, nil
} | [
-0.49512067437171936,
0.9499737620353699,
0.2821856439113617,
-0.09857667237520218,
0.7249737977981567,
-1.7385700941085815,
-0.5548071265220642,
-0.24229033291339874,
0.10462874174118042,
-0.17486970126628876,
0.043062787503004074,
0.28021153807640076,
-1.2829406261444092,
1.1118470430374... |
func (reply Reply) Int64() (int64, error) {
result, err := redis.Int64(reply.data, reply.err)
if err != nil {
return 0, redisError(err)
}
return result, nil
} | [
-0.9297483563423157,
0.4869503974914551,
0.24179647862911224,
-0.2563830018043518,
0.3166126310825348,
-1.5810356140136719,
-0.6762616038322449,
-0.02748258411884308,
0.45807361602783203,
0.2085692584514618,
0.23724856972694397,
0.33494964241981506,
-1.2624642848968506,
0.4611108899116516,... |
func (reply Reply) Int() (int, error) {
result, err := redis.Int(reply.data, reply.err)
if err != nil {
return 0, redisError(err)
}
return result, nil
} | [
-0.20974454283714294,
0.5355446338653564,
0.32006970047950745,
-1.3560014963150024,
-0.05925416573882103,
-0.8593459725379944,
-0.7473198175430298,
-0.6576108932495117,
-0.251217246055603,
0.38710519671440125,
-0.05411923676729202,
0.3010026812553406,
-0.6304576992988586,
0.246124044060707... |
func (reply Reply) Bool() (bool, error) {
result, err := redis.Bool(reply.data, reply.err)
if err != nil {
return false, redisError(err)
}
return result, nil
} | [
-0.20079077780246735,
0.34161603450775146,
0.5222945213317871,
-0.6973249316215515,
-0.029214799404144287,
-0.3575960397720337,
-0.9253699779510498,
0.526988685131073,
0.5745612382888794,
0.5105844140052795,
-0.4074473977088928,
0.7586637735366821,
-0.2332269698381424,
-0.6137819290161133,... |
func (reply Reply) List() ([]string, error) {
result, err := redis.Strings(reply.data, reply.err)
if err != nil {
return nil, redisError(err)
}
return result, nil
} | [
0.3030067980289459,
-0.403572142124176,
0.24282518029212952,
-1.089015245437622,
0.5602718591690063,
-0.7283579111099243,
-1.6862454414367676,
0.0044052377343177795,
1.064122200012207,
0.8769713640213013,
-0.2860077917575836,
0.6729151010513306,
-0.8650270700454712,
0.35402512550354004,
... |
func (reply Reply) Map() (map[string]string, error) {
result, err := redis.StringMap(reply.data, reply.err)
if err != nil {
return nil, redisError(err)
}
return result, nil
} | [
-0.5767358541488647,
-0.11768988519906998,
0.43421512842178345,
-1.076683759689331,
-0.5480562448501587,
-0.21302075684070587,
-1.291998028755188,
-0.2771042287349701,
1.303562045097351,
1.0931309461593628,
0.2464885711669922,
0.5258311629295349,
-0.09470667690038681,
-0.11005228757858276,... |
func (reply Reply) Scan(args ...interface{}) error {
if reply.err != nil {
return reply.err
}
values, err := redis.Values(reply.data, nil)
if err != nil {
return redisError(err)
}
if len(values) == 0 {
return ErrNoValues
}
_, err = redis.Scan(values, args...)
if err != nil {
return redisError(err)
... | [
-0.3507858216762543,
0.7840964794158936,
0.7113975882530212,
-0.12120727449655533,
-0.33789050579071045,
-0.6484184265136719,
-0.8468408584594727,
-0.6264395713806152,
0.11017672717571259,
-0.8578783869743347,
-0.12911291420459747,
0.5063969492912292,
-0.3151378333568573,
0.973805785179138... |
func (reply Reply) ScanStruct(dest interface{}) error {
if reply.err != nil {
return reply.err
}
values, err := redis.Values(reply.data, nil)
if err != nil {
return redisError(err)
}
if len(values) == 0 {
return ErrNoValues
}
if err = redis.ScanStruct(values, dest); err != nil {
return redisError(err... | [
-0.887005627155304,
0.37583470344543457,
0.6250664591789246,
-0.3581955134868622,
-1.1346092224121094,
-0.44218164682388306,
-1.182071566581726,
-0.8610050678253174,
1.262719988822937,
-0.6530006527900696,
-0.3294733464717865,
0.27536675333976746,
-0.10963021963834763,
0.31987711787223816,... |
func NewContext(r *repo.Repo) *AppContext {
ac := &AppContext{r: r}
return ac
} | [
1.1447606086730957,
-0.6927196383476257,
0.18664991855621338,
0.26956677436828613,
-0.8288862705230713,
0.09259748458862305,
-0.8462939858436584,
-0.7485424876213074,
1.4433950185775757,
0.026744576171040535,
-0.258448988199234,
0.01966634951531887,
0.46448859572410583,
0.24578358232975006... |
func (s *Server) GetUser(res http.ResponseWriter, req *http.Request, p httprouter.Params) {
var (
meUser = p.ByName("userID") == "me"
resp = JSON(nil, res)
)
// handle other users later!
if !meUser {
resp.Error(errors.New("kljshadf"), http.StatusNotFound)
return
}
u := User{
ID: uuid.NewV1(),
E... | [
-0.7797056436538696,
-0.7809763550758362,
0.7622566223144531,
1.1839193105697632,
0.021224312484264374,
0.2984624207019806,
0.4877227544784546,
0.053980179131031036,
0.3586041331291199,
-0.002982528181746602,
-0.1217157319188118,
-0.23714691400527954,
-0.2694976329803467,
0.252165526151657... |
func NewArchive(ctx *pulumi.Context,
name string, args *ArchiveArgs, opts ...pulumi.ResourceOption) (*Archive, error) {
if args == nil {
args = &ArchiveArgs{}
}
var resource Archive
err := ctx.RegisterResource("sakuracloud:index/archive:Archive", name, args, &resource, opts...)
if err != nil {
return nil, er... | [
0.11193377524614334,
0.6414668560028076,
0.4400176405906677,
0.4476424753665924,
0.2638321816921234,
-0.037531528621912,
-0.47286736965179443,
0.28384506702423096,
0.2744503915309906,
0.08578664064407349,
0.07620401680469513,
0.3822624981403351,
-0.4349675178527832,
-0.23172993957996368,
... |
func GetArchive(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ArchiveState, opts ...pulumi.ResourceOption) (*Archive, error) {
var resource Archive
err := ctx.ReadResource("sakuracloud:index/archive:Archive", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, ... | [
0.5317705869674683,
0.24457046389579773,
0.25876471400260925,
0.32768258452415466,
0.24106954038143158,
-0.49684420228004456,
-0.5896907448768616,
-0.12267328798770905,
1.0056320428848267,
-0.35609352588653564,
0.6634490489959717,
1.0192207098007202,
-0.16972702741622925,
-0.97868847846984... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.