text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (ƨ *DiffTestResult) Key(key *datastore.Key) *KeyedDiffTestResult {
return &KeyedDiffTestResult{
DiffTestResult: ƨ,
Key: key,
}
} | [
-0.33643627166748047,
0.20048807561397552,
0.28897204995155334,
0.13947175443172455,
-0.42511191964149475,
0.7202125787734985,
0.7226547598838806,
0.13497012853622437,
0.8310275673866272,
-0.3038449287414551,
-0.3692316710948944,
-0.49289828538894653,
-0.23582376539707184,
-0.0644605681300... |
func (ƨ DiffTestResults) Key(keys []*datastore.Key) (keyed []KeyedDiffTestResult) {
if len(keys) != len(ƨ) {
panic("Key() called on an slice with len(keys) != len(slice)")
}
keyed = make([]KeyedDiffTestResult, len(ƨ))
for i := range keyed {
keyed[i] = KeyedDiffTestResult{
DiffTestResult: &ƨ[i],
Key: ... | [
-1.1599116325378418,
-0.026259467005729675,
0.3449591100215912,
0.2704189121723175,
0.48188090324401855,
0.4690712094306946,
0.5371651649475098,
-0.10303519666194916,
0.7310599684715271,
0.66374671459198,
-0.48820093274116516,
-0.14010979235172272,
-0.6344005465507507,
0.36127543449401855,... |
func (ƨ DiffTestResult) Put(ctx context.Context, key *datastore.Key) (*datastore.Key, error) {
if key != nil {
return datastore.Put(ctx, key, &ƨ)
}
return datastore.Put(ctx, datastore.NewIncompleteKey(ctx, "DiffTestResult", nil), &ƨ)
} | [
-0.5674431324005127,
0.7050356268882751,
0.279742032289505,
-0.606715202331543,
-0.03513718396425247,
0.11706502735614777,
1.5413812398910522,
-0.003174004377797246,
0.5550315976142883,
0.27951711416244507,
-0.8950405716896057,
-0.35743823647499084,
-0.945370614528656,
-0.21292415261268616... |
func (ƨ DiffTestResult) PutWithParent(ctx context.Context, parent *datastore.Key) (*datastore.Key, error) {
if parent == nil {
return nil, errors.New("parent key is nil, expected a valid key")
}
return datastore.Put(ctx, datastore.NewIncompleteKey(ctx, "DiffTestResult", parent), &ƨ)
} | [
0.14735659956932068,
0.33983540534973145,
0.23453091084957123,
-0.8106346130371094,
-0.6106606721878052,
-0.135846346616745,
0.8949400186538696,
-1.101099967956543,
0.01641090027987957,
0.040104061365127563,
-0.6398670673370361,
-0.46399986743927,
-0.5861683487892151,
-0.08511535078287125,... |
func NewQueryForDiffTestResult() *datastore.Query {
return datastore.NewQuery("DiffTestResult")
} | [
0.7296163439750671,
-0.018965568393468857,
0.10901510715484619,
-0.24824127554893494,
-0.3234410285949707,
-0.6571149230003357,
0.4529602527618408,
0.09005096554756165,
-0.21862439811229706,
-1.275926947593689,
0.036265671253204346,
-0.6600602865219116,
0.2528929114341736,
0.53467416763305... |
func (m *matrixDef) AddDimension(name, desc string, values map[string]interface{}) {
m.OrderedDimensionNames = append(m.OrderedDimensionNames, name)
m.OrderedDimensionDescs = append(m.OrderedDimensionDescs, desc)
m.Dimensions[name] = values
} | [
0.0858018696308136,
0.09261422604322433,
0.5832992196083069,
-0.09873638302087784,
-0.28768232464790344,
0.6142123937606812,
-0.03147324174642563,
0.1803646981716156,
-0.11477215588092804,
-0.3650083839893341,
-0.6233441233634949,
0.07737405598163605,
0.08722004294395447,
1.261261463165283... |
func (m matrixDef) FixedDimension(dimensionName, valueName string) matrixDef {
return m.clone(func(dimension, value string) bool {
return dimension != dimensionName || value == valueName
})
} | [
0.5472257733345032,
-0.5179040431976318,
0.26194238662719727,
0.8342573046684265,
-1.0887386798858643,
0.582131028175354,
0.5890082120895386,
-0.4030672013759613,
-0.1102614551782608,
0.06044993922114372,
-0.7437842488288879,
0.8984262943267822,
-0.6766875982284546,
0.7133705615997314,
-... |
func (m *matrixDef) FixtureConfigs() []fixtureConfig {
cs := m.combinations()
fcfgs := make([]fixtureConfig, len(cs))
for i, c := range m.combinations() {
m := c.Map()
fcfgs[i] = fixtureConfig{
Desc: c.String(),
dbPrimary: m["store"].(bool),
projects: m["project"].(projectList),
}
}
return fcf... | [
-0.364790678024292,
0.4201579689979553,
0.1952064037322998,
0.7324331998825073,
0.044154565781354904,
-0.38946425914764404,
0.2714678645133972,
0.3761415481567383,
0.06205769628286362,
0.6123324632644653,
-0.9441155791282654,
-0.5557482242584229,
-0.2726292014122009,
0.7805162668228149,
... |
func (c combination) String() string {
var names []string
for _, p := range c {
names = append(names, p.Name)
}
return strings.Join(names, "/")
} | [
-0.5161466598510742,
-0.4015975296497345,
0.34801894426345825,
0.10422561317682266,
-0.02216300554573536,
0.8355327844619751,
0.9847941398620605,
-0.8147132992744446,
-0.6226274967193604,
0.3318135440349579,
0.21377597749233246,
-1.0267709493637085,
0.0697721466422081,
-0.29886534810066223... |
func (c combination) Map() map[string]interface{} {
res := make(map[string]interface{}, len(c))
for _, p := range c {
res[p.Dimension] = p.Value
}
return res
} | [
-0.7754533290863037,
0.004081388004124165,
0.5214415192604065,
0.33296433091163635,
-0.49736541509628296,
0.7012397646903992,
0.2572134733200073,
0.21968799829483032,
0.0637708455324173,
0.8370230197906494,
-0.5455859303474426,
-0.6758119463920593,
0.8247495293617249,
-0.413928747177124,
... |
func NewCustomAttribute(ctx *pulumi.Context,
name string, args *CustomAttributeArgs, opts ...pulumi.ResourceOption) (*CustomAttribute, error) {
if args == nil {
args = &CustomAttributeArgs{}
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource CustomAttribute
err := ctx.RegisterResource("vsphere:index/c... | [
0.5144340991973877,
0.15798421204090118,
0.1380651295185089,
0.04569670930504799,
-0.5027035474777222,
0.17722371220588684,
0.167510524392128,
0.5672935247421265,
0.5224911570549011,
0.4538672864437103,
-0.045922085642814636,
0.6550030708312988,
-1.3247308731079102,
-0.8709833025932312,
... |
func GetCustomAttribute(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *CustomAttributeState, opts ...pulumi.ResourceOption) (*CustomAttribute, error) {
var resource CustomAttribute
err := ctx.ReadResource("vsphere:index/customAttribute:CustomAttribute", name, id, state, &resource, opts...)
if err != ni... | [
0.9805392622947693,
-0.3289009630680084,
0.06186443939805031,
0.05306914448738098,
-0.8730416297912598,
-0.051882751286029816,
0.1261906623840332,
0.2641329765319824,
1.1825683116912842,
0.0680355578660965,
0.6884060502052307,
1.4079660177230835,
-1.1447632312774658,
-1.5481396913528442,
... |
func (o CustomAttributeOutput) ManagedObjectType() pulumi.StringPtrOutput {
return o.ApplyT(func(v *CustomAttribute) pulumi.StringPtrOutput { return v.ManagedObjectType }).(pulumi.StringPtrOutput)
} | [
1.0656756162643433,
-0.28633978962898254,
0.26440492272377014,
-0.48416557908058167,
0.2662314772605896,
0.824371874332428,
0.8549242615699768,
-0.08945312350988388,
0.6503458619117737,
-0.5486522316932678,
0.021816875785589218,
0.6353988647460938,
0.041800741106271744,
-0.9893682599067688... |
func (o CustomAttributeOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *CustomAttribute) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
} | [
0.822748601436615,
-0.8947497010231018,
0.20986191928386688,
-0.7175973653793335,
-1.1991788148880005,
0.21102012693881989,
0.898587167263031,
0.51774662733078,
0.15187469124794006,
0.929826557636261,
0.14837320148944855,
0.7014970183372498,
0.446167528629303,
-1.208453893661499,
-0.1388... |
func metadataFromAttributes(attrs pcommon.Map) payload.HostMetadata {
hm := payload.HostMetadata{Meta: &payload.Meta{}, Tags: &payload.HostTags{}}
if src, ok := attributes.SourceFromAttrs(attrs); ok && src.Kind == source.HostnameKind {
hm.InternalHostname = src.Identifier
hm.Meta.Hostname = src.Identifier
}
/... | [
0.12531431019306183,
-0.5841487050056458,
0.47328150272369385,
-0.7835135459899902,
-0.0458015576004982,
0.7805362939834595,
-0.7522112727165222,
0.06026586517691612,
-0.6677884459495544,
0.47071412205696106,
0.2264605462551117,
0.2909076511859894,
1.4131487607955933,
-0.21173378825187683,... |
func NewPusher(params exporter.CreateSettings, pcfg PusherConfig) inframetadata.Pusher {
return &pusher{
params: params,
pcfg: pcfg,
retrier: clientutil.NewRetrier(params.Logger, pcfg.RetrySettings, scrub.NewScrubber()),
httpClient: clientutil.NewHTTPClient(pcfg.TimeoutSettings, pcfg.InsecureSkipV... | [
-0.1521213948726654,
-0.2904852628707886,
0.5458611845970154,
0.5527383089065552,
-1.0011833906173706,
0.4818108379840851,
-1.0908979177474976,
-0.04303472489118576,
-0.502855658531189,
0.20799356698989868,
-0.20749789476394653,
0.3398122191429138,
-0.7582774758338928,
0.9433757066726685,
... |
func RunPusher(ctx context.Context, params exporter.CreateSettings, pcfg PusherConfig, p source.Provider, attrs pcommon.Map) {
// Push metadata every 30 minutes
ticker := time.NewTicker(30 * time.Minute)
defer ticker.Stop()
defer params.Logger.Debug("Shut down host metadata routine")
pusher := NewPusher(params, pc... | [
-0.4421767592430115,
-0.24714452028274536,
0.8087712526321411,
-0.11685729026794434,
-0.07967588305473328,
0.7770649790763855,
-0.2892274856567383,
-0.4001542627811432,
-1.085325837135315,
0.3519285023212433,
-0.012537096627056599,
0.685058057308197,
0.027539296075701714,
1.042168617248535... |
func IsSSHRetryable(code int) bool {
if code == 2 || code == 4 || code == 5 || code == 66 || code == 67 || code == 70 || code == 74 || code == 75 || code == 76 {
return true
}
return false
} | [
0.14187246561050415,
0.9187785387039185,
0.8515507578849792,
0.4681079089641571,
-0.43073269724845886,
-0.09552474319934845,
-0.10976146906614304,
0.042474593967199326,
0.08193593472242355,
0.316757470369339,
-0.6122596859931946,
0.35378509759902954,
-0.622014582157135,
0.09103301167488098... |
func IsSCPRetryable(code int) bool {
if code == 4 || code == 5 || code == 66 || code == 67 || code == 70 || code == 74 || code == 75 || code == 76 {
return true
}
return false
} | [
-0.3784048855304718,
0.7182965278625488,
0.7911997437477112,
0.19184742867946625,
-0.6546054482460022,
-0.3063699007034302,
-0.10778553038835526,
-0.03851255774497986,
0.5826877355575562,
0.6928516626358032,
-0.3064936399459839,
0.41889259219169617,
-0.9687132239341736,
-0.0942443162202835... |
func (tunnel *SSHTunnel) Close() error {
defer utils.LazyRemove(tunnel.keyFile.Name())
// Kills the process of the tunnel
err := tunnel.cmd.Process.Kill()
if err != nil {
log.Printf("tunnel.cmd.Process.Kill() failed: %s\n", reflect.TypeOf(err).String())
return fmt.Errorf("Unable to close tunnel :%s", err.Error... | [
0.057616494596004486,
-0.39188507199287415,
0.9607957601547241,
-0.6752304434776306,
0.14570754766464233,
0.3592354953289032,
-0.31618601083755493,
-0.4544850289821625,
-1.1134964227676392,
-0.29510679841041565,
0.5739445090293884,
0.453200101852417,
-0.4950569272041321,
0.0063514281064271... |
func getFreePort() (int, error) {
listener, err := net.Listen("tcp", ":0")
defer listener.Close()
if err != nil {
return 0, err
}
port := listener.Addr().(*net.TCPAddr).Port
return port, nil
} | [
0.904076874256134,
0.4666607975959778,
0.6521241068840027,
-0.6823159456253052,
0.6951141357421875,
-0.31879228353500366,
0.9321770668029785,
-0.45666003227233887,
-0.23884765803813934,
-0.44762787222862244,
-0.3400174379348755,
0.47274503111839294,
-1.0083242654800415,
0.9507261514663696,... |
func CreateTempFileFromString(content string, filemode os.FileMode) (*os.File, error) {
defaultTmpDir := "/tmp"
if runtime.GOOS == "windows" {
defaultTmpDir = ""
}
f, err := ioutil.TempFile(defaultTmpDir, "") // TODO Windows friendly
if err != nil {
return nil, err
}
_, err = f.WriteString(content)
if err ... | [
1.1528505086898804,
-1.167157769203186,
0.1423659324645996,
-0.10337955504655838,
-0.19783952832221985,
0.15222129225730896,
0.09429553151130676,
-0.26117512583732605,
-0.45321348309516907,
0.15332584083080292,
0.19023023545742035,
-0.5138722658157349,
-0.7205061316490173,
-0.5665734410285... |
func createTunnel(cfg *SSHConfig) (*SSHTunnel, error) {
f, err := CreateTempFileFromString(cfg.GatewayConfig.PrivateKey, 0400)
if err != nil {
return nil, err
}
localPort := cfg.LocalPort
if localPort == 0 {
localPort, err = getFreePort()
if err != nil {
return nil, err
}
}
options := "-q -oServerAli... | [
0.1120687797665596,
-0.4499339163303375,
0.7065813541412354,
-0.0839148685336113,
0.024829717352986336,
0.5296689867973328,
-0.04044568911194801,
-0.3181452453136444,
-0.33935871720314026,
-0.24310292303562164,
-0.6388237476348877,
0.5768847465515137,
-0.5175111889839172,
0.589186906814575... |
func (c *SSHCommand) Kill() error {
err := c.cmd.Process.Kill()
nerr := c.end()
if nerr != nil {
log.Warnf("Error waiting for command end: %v", nerr)
}
return err
} | [
0.7057263851165771,
-0.5941348075866699,
0.4217088222503662,
0.5289360880851746,
0.5715603828430176,
0.885881781578064,
-0.8832064270973206,
0.4251173138618469,
-1.1373834609985352,
-0.08181429654359818,
-0.40818044543266296,
0.22232332825660706,
-0.06729812920093536,
0.0647910088300705,
... |
func (c *SSHCommand) StdoutPipe() (io.ReadCloser, error) {
return c.cmd.StdoutPipe()
} | [
0.4773485064506531,
-0.06156076863408089,
0.6915355324745178,
0.04080953821539879,
-0.8746877908706665,
0.5183047652244568,
0.16900131106376648,
0.007851997390389442,
-0.8635228276252747,
0.17484916746616364,
0.8936372995376587,
-0.17453694343566895,
-0.824021577835083,
-0.0318051502108573... |
func (c *SSHCommand) StderrPipe() (io.ReadCloser, error) {
return c.cmd.StderrPipe()
} | [
0.22269666194915771,
-0.25909245014190674,
0.7091848254203796,
-0.2850036919116974,
-1.0247595310211182,
1.0557085275650024,
-0.3385806083679199,
0.030964260920882225,
-0.780342161655426,
0.26175808906555176,
0.7408578991889954,
0.21923260390758514,
-0.9986458420753479,
0.2970884144306183,... |
func (c *SSHCommand) StdinPipe() (io.WriteCloser, error) {
return c.cmd.StdinPipe()
} | [
0.7018445134162903,
-0.43912842869758606,
0.5744234919548035,
-0.0025082796346396208,
-0.7103689312934875,
0.9581680297851562,
0.2877769470214844,
0.36892831325531006,
-1.3129358291625977,
-0.23709547519683838,
-0.20277811586856842,
0.31254738569259644,
-1.2526448965072632,
0.1848109662532... |
func (c *SSHCommand) CombinedOutput() ([]byte, error) {
content, err := c.cmd.CombinedOutput()
nerr := c.end()
if nerr != nil {
log.Warnf("Error waiting for command end: %v", nerr)
}
return content, err
} | [
0.8795327544212341,
-0.6045603156089783,
0.5549858808517456,
0.5233732461929321,
-0.16875647008419037,
-0.3239814341068268,
-0.24253587424755096,
-0.5931767821311951,
-0.4703669548034668,
-0.5547910332679749,
0.21465516090393066,
-0.5151965618133545,
-0.9693586826324463,
0.5516176819801331... |
func (c *SSHCommand) Start() error {
return c.cmd.Start()
} | [
0.6243022084236145,
-0.6992217898368835,
0.09281070530414581,
0.2582591474056244,
0.34180447459220886,
0.7042514085769653,
-0.06488464027643204,
0.9804888963699341,
-0.6512118577957153,
-1.0500072240829468,
-0.7152022123336792,
1.6545908451080322,
-0.34539565443992615,
0.5465689897537231,
... |
func (ssh *SSHConfig) Command(cmdString string) (*SSHCommand, error) {
return ssh.command(cmdString, false)
} | [
-0.07454647868871689,
-0.6358367800712585,
0.2065410166978836,
-0.25646549463272095,
-0.31251010298728943,
1.2822601795196533,
-1.1821080446243286,
0.021112332120537758,
0.3854832351207733,
-0.8533312082290649,
-0.21568739414215088,
0.8599691987037659,
-0.35062921047210693,
0.0964923128485... |
func (ssh *SSHConfig) SudoCommand(cmdString string) (*SSHCommand, error) {
return ssh.command(cmdString, true)
} | [
0.04905112832784653,
-1.109919786453247,
0.24608920514583588,
-0.05237540230154991,
-0.07597767561674118,
0.4649447202682495,
-0.5618104338645935,
0.5793456435203552,
-0.617604672908783,
-0.636182963848114,
-0.8106133341789246,
1.015178918838501,
0.21088454127311707,
0.18308554589748383,
... |
func (ssh *SSHConfig) WaitServerReady(timeout time.Duration) error {
err := retry.WhileUnsuccessfulDelay5Seconds(
func() error {
cmd, err := ssh.Command("sudo cat /var/tmp/user_data.done")
if err != nil {
return err
}
retcode, _, stderr, err := cmd.Run()
if err != nil {
return err
}
if ... | [
-0.41830065846443176,
-0.3234524726867676,
0.8399350047111511,
-0.6237452626228333,
0.011009100824594498,
0.4151676893234253,
-0.038169797509908676,
-0.2927999496459961,
-0.5937329530715942,
0.058894481509923935,
-0.8830080628395081,
1.0511915683746338,
0.22496554255485535,
0.9966687560081... |
func (ssh *SSHConfig) Copy(remotePath, localPath string, isUpload bool) (int, string, string, error) {
tunnels, sshConfig, err := ssh.CreateTunnels()
if err != nil {
return 0, "", "", fmt.Errorf("Unable to create tunnels : %s", err.Error())
}
identityfile, err := CreateTempFileFromString(sshConfig.PrivateKey, 04... | [
-0.34294813871383667,
-0.36070913076400757,
0.9328166842460632,
0.45877477526664734,
-0.2523318827152252,
0.8491458892822266,
0.24617882072925568,
0.2286887913942337,
-0.5717607736587524,
0.8712103962898254,
-0.4083128571510315,
0.03299430385231972,
-0.3043515682220459,
-0.1243843361735344... |
func (ssh *SSHConfig) Exec(cmdString string) error {
tunnels, sshConfig, err := ssh.CreateTunnels()
if err != nil {
for _, t := range tunnels {
nerr := t.Close()
if nerr != nil {
log.Warnf("Error closing ssh tunnel: %v", nerr)
}
}
return fmt.Errorf("Unable to create command : %s", err.Error())
}
... | [
0.923662543296814,
0.20377078652381897,
0.9811690449714661,
0.43144530057907104,
0.09635715186595917,
0.286092072725296,
-0.0031687766313552856,
0.09301065653562546,
-0.9546371698379517,
-0.6616235971450806,
-0.3055785000324249,
-0.35957542061805725,
0.5845102667808533,
0.9139711260795593,... |
func (ssh *SSHConfig) Enter() error {
tunnels, sshConfig, err := ssh.CreateTunnels()
if err != nil {
for _, t := range tunnels {
nerr := t.Close()
if nerr != nil {
log.Warnf("Error closing ssh tunnel: %v", nerr)
}
}
return fmt.Errorf("Unable to create command : %s", err.Error())
}
sshCmdString, ... | [
0.38421857357025146,
0.3154487609863281,
0.9948909282684326,
-0.4124695658683777,
0.8990117311477661,
0.01191273145377636,
0.6658915877342224,
-0.29292675852775574,
-0.7393170595169067,
-0.6295051574707031,
-0.026157740503549576,
0.514895498752594,
0.3453912138938904,
1.085613489151001,
... |
func (ssh *SSHConfig) CommandContext(ctx context.Context, cmdString string) (*SSHCommand, error) {
tunnels, sshConfig, err := ssh.CreateTunnels()
if err != nil {
return nil, fmt.Errorf("Unable to create command : %s", err.Error())
}
sshCmdString, keyFile, err := createSSHCmd(sshConfig, cmdString, false)
if err !... | [
0.2761063575744629,
-0.49954062700271606,
0.7728962302207947,
-0.1522379368543625,
-0.1460963934659958,
0.6800423264503479,
-0.7862785458564758,
-0.7407301664352417,
0.5928237438201904,
-0.6774708032608032,
0.3083624243736267,
0.8298578858375549,
-0.1733558624982834,
0.22358939051628113,
... |
func CreateKeyPair() (publicKeyBytes []byte, privateKeyBytes []byte, err error) {
privateKey, _ := rsa.GenerateKey(rand.Reader, 2048)
publicKey := privateKey.PublicKey
pub, err := ssh.NewPublicKey(&publicKey)
if err != nil {
return nil, nil, err
}
publicKeyBytes = ssh.MarshalAuthorizedKey(pub)
priBytes := x5... | [
0.016968386247754097,
0.006409056484699249,
0.5516230463981628,
-0.20492015779018402,
-0.012561403214931488,
0.22056695818901062,
-1.4734102487564087,
-0.3428219258785248,
0.06844855099916458,
0.2230978012084961,
0.07709547132253647,
0.10555381327867508,
-1.4402042627334595,
1.307837605476... |
func (m *NetworkIP) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateIPAddress(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
} | [
-0.6748887896537781,
0.01767800748348236,
-0.22564390301704407,
0.25310590863227844,
0.5918849110603333,
0.008439620956778526,
0.40588006377220154,
-0.5213216543197632,
-0.07511436939239502,
-0.12521420419216156,
0.3039238750934601,
-1.7628287076950073,
-0.695903480052948,
0.31909310817718... |
func (o *DownloadClusterFilesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewDownloadClusterFilesOK(o.writer)
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
... | [
0.22312822937965393,
-0.7950834631919861,
0.9245150089263916,
0.5301277041435242,
0.2594403624534607,
-0.9282045364379883,
1.2252681255340576,
-0.5982614755630493,
0.2602473497390747,
0.06528327614068985,
0.2142089605331421,
-0.5991499423980713,
-1.319722056388855,
-0.33629941940307617,
... |
func NewDownloadClusterFilesOK(writer io.Writer) *DownloadClusterFilesOK {
return &DownloadClusterFilesOK{
Payload: writer,
}
} | [
0.7976677417755127,
-0.34131285548210144,
0.26603904366493225,
0.4137926995754242,
0.1238214448094368,
0.3332715928554535,
1.5778478384017944,
0.13888594508171082,
-0.6179433465003967,
0.8446874618530273,
-0.6677445769309998,
-0.7741986513137817,
-0.07770257443189621,
-0.5830681324005127,
... |
func NewDownloadClusterFilesUnauthorized() *DownloadClusterFilesUnauthorized {
return &DownloadClusterFilesUnauthorized{}
} | [
0.22506296634674072,
-0.39131781458854675,
0.4665668308734894,
0.8194952607154846,
-0.23810340464115143,
-0.3354157507419586,
0.7591865062713623,
0.13582605123519897,
-0.5681695342063904,
-0.8197381496429443,
-0.12261462956666946,
0.621281087398529,
-0.6308580636978149,
-0.8124160766601562... |
func NewDownloadClusterFilesForbidden() *DownloadClusterFilesForbidden {
return &DownloadClusterFilesForbidden{}
} | [
1.061624526977539,
0.13604988157749176,
0.47967812418937683,
1.0666509866714478,
-0.01685117557644844,
0.07870127260684967,
0.7785727977752686,
-0.753175675868988,
-0.5222730040550232,
-0.5000392198562622,
-0.09196865558624268,
0.3148244321346283,
-0.8784756064414978,
-0.9561609625816345,
... |
func NewDownloadClusterFilesNotFound() *DownloadClusterFilesNotFound {
return &DownloadClusterFilesNotFound{}
} | [
0.6189593076705933,
-0.9215431213378906,
0.04701945185661316,
0.509711503982544,
0.6848886609077454,
0.10761495679616928,
0.8194481134414673,
-0.29132071137428284,
-0.49441346526145935,
-0.24353186786174774,
-0.48374757170677185,
-0.0480521060526371,
-0.5979198217391968,
-0.202570602297782... |
func NewDownloadClusterFilesMethodNotAllowed() *DownloadClusterFilesMethodNotAllowed {
return &DownloadClusterFilesMethodNotAllowed{}
} | [
1.0695258378982544,
0.32622000575065613,
0.4484451413154602,
0.7294147610664368,
-0.3137860894203186,
0.1675722450017929,
1.4251810312271118,
-0.4705176055431366,
-0.8622910380363464,
-0.3375994563102722,
0.7974754571914673,
-0.3548663854598999,
-0.8979465365409851,
-0.701370358467102,
-... |
func NewDownloadClusterFilesConflict() *DownloadClusterFilesConflict {
return &DownloadClusterFilesConflict{}
} | [
0.8495279550552368,
-0.7260407209396362,
0.4986881613731384,
0.6543853878974915,
0.48036059737205505,
-0.0985015332698822,
0.8422735333442688,
-0.2961798310279846,
-0.3590123951435089,
-0.11663635820150375,
0.23283886909484863,
-0.7307915687561035,
-1.3604152202606201,
-0.37220078706741333... |
func NewDownloadClusterFilesServiceUnavailable() *DownloadClusterFilesServiceUnavailable {
return &DownloadClusterFilesServiceUnavailable{}
} | [
0.033354587852954865,
-0.9566808938980103,
0.4134133458137512,
0.06799982488155365,
0.19836781919002533,
-0.5810630321502686,
0.36851370334625244,
1.2390092611312866,
-0.6116104125976562,
-0.5051630139350891,
-0.1920611411333084,
-0.04980306327342987,
0.050440575927495956,
-0.5221231579780... |
func WithJSON(w http.ResponseWriter, r *http.Request, code int, payload interface{}) {
w.Header().Set("Content-Type", "application/json")
response, err := json.MarshalIndent(payload, "", " ")
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
w.Write([]byte("HTTP 500: Internal Server Error"))
retur... | [
-0.48554104566574097,
-0.8511407375335693,
0.9218525290489197,
-0.6945858597755432,
-0.7242152690887451,
-0.02908872254192829,
0.39122623205184937,
-0.05940661206841469,
0.002925506792962551,
0.3948386013507843,
0.33957725763320923,
0.08387574553489685,
0.18355406820774078,
0.3234916925430... |
func GetSession(conn *dbus.Conn, path dbus.ObjectPath) (Session, error) {
obj := conn.Object(SecretServiceDest, dbus.ObjectPath(path))
return &session{
path: path,
obj: obj,
}, nil
} | [
-0.05654924735426903,
0.07285508513450623,
0.23297083377838135,
0.25427111983299255,
0.1347445845603943,
-0.4994039833545685,
0.06352896988391876,
-0.857890248298645,
0.5568501353263855,
-0.818659245967865,
-0.5703290104866028,
1.0187220573425293,
-0.3296806514263153,
-1.277932047843933,
... |
func (s *session) Path() dbus.ObjectPath {
return s.path
} | [
-0.48536157608032227,
-0.6540107131004333,
0.19788701832294464,
0.4078969657421112,
-0.505754292011261,
0.6153420805931091,
1.4952024221420288,
-1.3950622081756592,
1.3824756145477295,
-0.0827672928571701,
-0.2510652542114258,
0.18105211853981018,
-0.2525424659252167,
-0.6517666578292847,
... |
func (s *session) Close() error {
return s.obj.Call(sessionMethodClose, 0).Err
} | [
-0.591942548751831,
-0.22139482200145721,
0.25802645087242126,
0.8468232750892639,
-0.5861817598342896,
-0.5546549558639526,
1.0211493968963623,
-2.0995190143585205,
0.5825433731079102,
-0.6122742295265198,
0.7875972390174866,
0.26646825671195984,
-0.22507482767105103,
0.35958582162857056,... |
func (s *Sms) Handle(w http.ResponseWriter, r *http.Request) {
r.ParseForm()
mobileNumber := r.Form["mobile_number"]
msg := fmt.Sprintf("Restyle - your code is %d", util.RandNum())
status, err := s.SmsService.Send(context.Background(), mobileNumber[0], msg)
if err != nil {
http.Error(w, http.StatusText(http.Stat... | [
-0.37029504776000977,
0.2679365873336792,
0.896462082862854,
-0.07713840156793594,
0.29336532950401306,
-0.20213095843791962,
0.22312800586223602,
0.0608140267431736,
0.25644099712371826,
-0.38112708926200867,
-0.04695186764001846,
0.4551190733909607,
-0.5973501801490784,
0.500464141368866... |
func NewV1CreateHelloOK() *V1CreateHelloOK {
return &V1CreateHelloOK{}
} | [
0.28380802273750305,
0.33155593276023865,
0.2722858786582947,
1.4385099411010742,
-0.2917706370353699,
0.9479723572731018,
-0.1430237889289856,
-0.052980516105890274,
-0.856330394744873,
1.0175939798355103,
0.44421759247779846,
0.06892311573028564,
-0.262669175863266,
0.7662003636360168,
... |
func (o *V1CreateHelloOK) WithPayload(payload *models.CreateHelloResponse) *V1CreateHelloOK {
o.Payload = payload
return o
} | [
0.7277715802192688,
0.44198137521743774,
0.2052154242992401,
0.34609946608543396,
0.26553428173065186,
0.930159330368042,
-0.17448528110980988,
-0.6813044548034668,
-0.13453246653079987,
0.2597936689853668,
0.21354417502880096,
-0.2875884771347046,
-0.17237979173660278,
0.02583566121757030... |
func (o *V1CreateHelloOK) SetPayload(payload *models.CreateHelloResponse) {
o.Payload = payload
} | [
0.08529914915561676,
0.5732311606407166,
0.1290319263935089,
0.3574680984020233,
0.41105934977531433,
1.3310697078704834,
-0.01908264122903347,
-0.278695672750473,
-0.3642560839653015,
0.26778626441955566,
-0.3051578402519226,
0.00219290261156857,
-0.7610132694244385,
0.572752833366394,
... |
func (o *V1CreateHelloOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(200)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
} | [
-0.28107452392578125,
0.08638982474803925,
0.3088451027870178,
0.7161593437194824,
1.2782173156738281,
0.22685150802135468,
0.43370452523231506,
0.016606297343969345,
0.2056620568037033,
0.5789971947669983,
0.19655269384384155,
-0.550499677658081,
-0.3930273950099945,
0.14161193370819092,
... |
func NewV1CreateHelloBadRequest() *V1CreateHelloBadRequest {
return &V1CreateHelloBadRequest{}
} | [
-0.41873618960380554,
-0.330995112657547,
0.5327566862106323,
0.8839260339736938,
0.03349997475743294,
0.5482727289199829,
-0.34731605648994446,
0.13237552344799042,
-0.6924470067024231,
0.434611976146698,
-0.2590761184692383,
0.32477283477783203,
-0.1566011905670166,
1.1991513967514038,
... |
func (o *V1CreateHelloBadRequest) WithPayload(payload *models.Error) *V1CreateHelloBadRequest {
o.Payload = payload
return o
} | [
-0.2554128170013428,
-0.046025775372982025,
0.2533760666847229,
0.2845548987388611,
0.22794705629348755,
0.8158013820648193,
-0.44773244857788086,
-0.9080888628959656,
-0.3069671094417572,
-0.3116552233695984,
0.1568303108215332,
-0.06982354819774628,
-0.1325288861989975,
0.306521356105804... |
func (o *V1CreateHelloBadRequest) SetPayload(payload *models.Error) {
o.Payload = payload
} | [
-0.9328995943069458,
0.15075115859508514,
0.12274939566850662,
0.30640512704849243,
0.6247338652610779,
1.2755109071731567,
-0.39084330201148987,
-0.8052813410758972,
-0.568522036075592,
-0.0779198631644249,
-0.17628972232341766,
0.5049641728401184,
-0.645031213760376,
0.7767159938812256,
... |
func (o *V1CreateHelloBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(400)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
} | [
-0.535431444644928,
0.13102971017360687,
0.4729624390602112,
0.7617811560630798,
1.1974079608917236,
0.6277334094047546,
0.07487379014492035,
-0.49427369236946106,
0.16120155155658722,
0.2899467349052429,
-0.23642447590827942,
-0.125417098402977,
-0.7717369794845581,
0.312674343585968,
0... |
func (o *V1CreateHelloInternalServerError) WithPayload(payload *models.Error) *V1CreateHelloInternalServerError {
o.Payload = payload
return o
} | [
-0.3994799554347992,
0.01250414177775383,
0.14018261432647705,
-0.476156622171402,
-0.4464627206325531,
0.8326037526130676,
-0.16734543442726135,
-0.4068162143230438,
0.057759273797273636,
-0.3139113783836365,
-0.1799234300851822,
-0.11037958413362503,
-0.4363498091697693,
0.67481029033660... |
func (o *V1CreateHelloInternalServerError) SetPayload(payload *models.Error) {
o.Payload = payload
} | [
-0.7458055019378662,
0.056296028196811676,
-0.04417897388339043,
-0.42296692728996277,
-0.22472497820854187,
1.0625903606414795,
-0.21965140104293823,
-0.01246831938624382,
-0.28908205032348633,
0.08029328286647797,
-0.3087921738624573,
0.432761549949646,
-1.0297341346740723,
1.17689812183... |
func (o *V1CreateHelloInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(500)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
} | [
-0.6823680400848389,
-0.06415295600891113,
0.25884172320365906,
0.19418863952159882,
0.6046454310417175,
0.403579443693161,
0.26615282893180847,
0.035205159336328506,
0.4787684381008148,
0.37741342186927795,
0.018781017512083054,
-0.02400781586766243,
-0.9255518913269043,
0.443229287862777... |
func NewTxCmd(m codec.Marshaler, txg tx.Generator, ar tx.AccountRetriever) *cobra.Command {
slashingTxCmd := &cobra.Command{
Use: types.ModuleName,
Short: "Slashing transaction subcommands",
DisableFlagParsing: true,
SuggestionsMinimumDistance: 2,
RunE: ... | [
1.5597625970840454,
0.07818032056093216,
0.5117024183273315,
0.0015515874838456511,
-0.27592676877975464,
0.024757420644164085,
0.4625557065010071,
-0.023178430274128914,
-0.565528154373169,
-0.4241458475589752,
-0.03681471571326256,
0.21969977021217346,
0.04823387414216995,
-0.03808251395... |
func GetTxCmd(cdc *codec.Codec) *cobra.Command {
slashingTxCmd := &cobra.Command{
Use: types.ModuleName,
Short: "Slashing transactions subcommands",
DisableFlagParsing: true,
SuggestionsMinimumDistance: 2,
RunE: client.ValidateCmd,
}
... | [
1.2082054615020752,
0.5197132229804993,
0.638464629650116,
-0.10553281754255295,
0.48764801025390625,
0.04654857516288757,
0.3231772184371948,
-0.027279343456029892,
-0.4472668766975403,
-0.6000186204910278,
-0.358163446187973,
0.3836943209171295,
-0.20545800030231476,
0.020268719643354416... |
func GetCmdUnjail(cdc *codec.Codec) *cobra.Command {
return &cobra.Command{
Use: "unjail",
Args: cobra.NoArgs,
Short: "unjail validator previously jailed for downtime",
Long: `unjail a jailed validator:
$ <appcli> tx slashing unjail --from mykey
`,
RunE: func(cmd *cobra.Command, args []string) error {
... | [
0.45310813188552856,
0.00871659629046917,
0.5721328854560852,
-0.9748893976211548,
-0.6889700889587402,
0.0413300022482872,
0.5744792222976685,
0.3010966181755066,
-0.5052412152290344,
-0.6104280352592468,
0.08462478965520859,
1.3919003009796143,
-0.4915572702884674,
0.6226746439933777,
... |
func subscribeToGameRedisMessages(game *contracts.Game, pool *redis.Pool, initialized *sync.WaitGroup) {
// Open connection to Redis
conn := pool.Get()
PSconn := pool.Get()
if conn.Err() != nil || PSconn.Err() != nil{
fmt.Println("Todo: connection error handling")
}
defer conn.Close()
defer PSconn.Close()
... | [
-0.8192698955535889,
-0.22556084394454956,
0.8399063348770142,
-0.36788296699523926,
0.4727003574371338,
-0.21125029027462006,
-1.005706548690796,
-0.7679429650306702,
-0.1866757720708847,
0.3132550120353699,
0.2807137966156006,
0.37678518891334534,
-0.5377532839775085,
1.0853420495986938,... |
func NewGift() *Gift {
o := new(Gift)
o.Initialize()
return o
} | [
-0.058825019747018814,
-0.4355156421661377,
0.05703600123524666,
1.0195832252502441,
-0.8590087294578552,
-0.44644254446029663,
0.30195116996765137,
-0.7395570278167725,
0.05758515000343323,
-0.7401103973388672,
-0.5079407095909119,
0.46544766426086426,
-0.49767863750457764,
0.510610640048... |
func (o *Gift) Initialize() {
o.giftBase.Initialize()
// Add your own initializations here
} | [
0.07191046327352524,
0.2960500121116638,
0.4079902172088623,
0.7674203515052795,
0.840702474117279,
-0.468300461769104,
1.0297486782073975,
-0.23461468517780304,
0.3125472962856293,
-0.22308678925037384,
-0.7955678701400757,
0.7499082088470459,
-0.24426843225955963,
1.04500412940979,
-0.... |
func (o *Gift) String() string {
if o == nil {
return "" // Possibly - Select One -?
}
return o.name
} | [
0.10280712693929672,
-0.156244158744812,
0.061584215611219406,
-0.13289041817188263,
-0.7083696722984314,
-0.12880513072013855,
1.3993135690689087,
-1.365457534790039,
1.088350534439087,
0.413131445646286,
-0.10595672577619553,
0.2492418885231018,
0.263771653175354,
-0.19156686961650848,
... |
func QueryGifts(ctx context.Context) *GiftsBuilder {
return queryGifts(ctx)
} | [
0.658980667591095,
1.4744144678115845,
0.16821439564228058,
0.31318652629852295,
-0.2542484402656555,
0.7502564787864685,
-0.2491215169429779,
-0.4729829430580139,
0.731746256351471,
-1.4952802658081055,
0.1817915141582489,
0.6868031024932861,
-0.8926149010658264,
-0.6093193292617798,
-1... |
func queryGifts(ctx context.Context) *GiftsBuilder {
return newGiftBuilder(ctx)
} | [
0.7441871762275696,
1.419206142425537,
0.16944079101085663,
0.17439912259578705,
-0.3447767496109009,
0.8037834167480469,
-0.29255977272987366,
-0.3240382671356201,
0.7556188702583313,
-1.6454520225524902,
0.11842942982912064,
0.7416543960571289,
-1.2633061408996582,
-0.6448984146118164,
... |
func DeleteGift(ctx context.Context, pk int) {
deleteGift(ctx, pk)
} | [
0.28432291746139526,
0.8148190975189209,
0.23101677000522614,
0.09053128957748413,
0.23638850450515747,
0.30232468247413635,
0.18913176655769348,
0.04015655815601349,
0.8730988502502441,
-1.1594288349151611,
-0.10405801236629486,
-0.1573292762041092,
-0.20204029977321625,
1.536205649375915... |
func Notification(title, message string) GNotifier {
config := &Config{title, message, 5000, ""}
n := ¬ifier{Config: config}
return n
} | [
-0.05765964463353157,
0.13133534789085388,
0.15056978166103363,
0.7631823420524597,
-0.41111844778060913,
-0.2414071261882782,
0.020829729735851288,
0.1583755612373352,
-0.34845489263534546,
0.45137274265289307,
-1.698378086090088,
0.46670466661453247,
-0.13787585496902466,
0.5686969757080... |
func NullNotification(title, message string) GNotifier {
config := &Config{title, message, 5000, ""}
n := &nullNotifier{Config: config}
return n
} | [
0.39488154649734497,
-0.20024530589580536,
0.29070696234703064,
-0.08987690508365631,
-0.6111524701118469,
-0.7550331354141235,
-0.16745494306087494,
0.22316749393939972,
0.5328248143196106,
-0.15139220654964447,
-1.6239163875579834,
0.6310610771179199,
-0.17333845794200897,
0.618484079837... |
func NewTestRecorder() *TestRecorder {
return &TestRecorder{[]*Config{}}
} | [
0.19291308522224426,
-0.35447609424591064,
0.1297675520181656,
-0.2235071361064911,
0.03282298147678375,
-0.24544169008731842,
-0.6795049905776978,
-0.7440934181213379,
0.29151836037635803,
-0.3909791111946106,
0.027701029554009438,
0.3715398609638214,
-1.1465210914611816,
1.42914378643035... |
func StartOperatingAlone() {
for f := 0; f < def.FloorCount; f++ {
for b := driver.ButtonType(0); b < def.ButtonCount; b++ {
if status := om.GetOrders(def.LocalId).GetStatus(f, b); status == om.OS_Completed || status == om.OS_Removing {
om.GetOrders(def.LocalId).RemoveOrder(f, b)
}
}
}
} | [
-0.22094203531742096,
0.6555954813957214,
0.6816832423210144,
1.0109333992004395,
0.49122411012649536,
-0.7714589834213257,
0.8789186477661133,
0.8523392081260681,
0.24645215272903442,
0.3517344892024994,
0.0602540448307991,
-1.0928518772125244,
-0.6140683889389038,
1.0547844171524048,
0... |
func ReassignOrders(ids []int, id int) {
for f := 0; f < def.FloorCount; f++ {
for b := driver.ButtonType(0); b < def.ButtonCount; b++ {
// Cab orders can only be executed by the original elevator
if b == driver.BT_Cab {
continue
}
// If no active elevators, take everything ourselves
if len(ids)... | [
-0.342338889837265,
-0.9384723901748657,
0.9070461988449097,
1.2585550546646118,
0.2511213421821594,
-0.9425495862960815,
0.15038736164569855,
-0.18907758593559265,
0.13660266995429993,
0.08206205815076828,
0.12388672679662704,
-0.10355808585882187,
-0.40109968185424805,
0.6232631206512451... |
func Synchronize(onlineIds, activeIds []int) {
if len(onlineIds) == 0 {
return
}
for f := 0; f < def.FloorCount; f++ {
for b := driver.ButtonType(0); b < def.ButtonCount; b++ {
if b == driver.BT_Cab {
continue
}
switch om.GetOrders(def.LocalId).GetStatus(f, b) {
case om.OS_Empty:
if anyRemov... | [
0.13581234216690063,
-0.5341418981552124,
0.827012300491333,
1.3674261569976807,
0.6181271076202393,
-0.814010500907898,
0.061380382627248764,
0.5297790765762329,
-0.044958412647247314,
0.9683189392089844,
-0.218301460146904,
-0.4212949872016907,
-0.6111742854118347,
0.8022051453590393,
... |
func getOwner(ids []int, floor int, button driver.ButtonType) int {
for _, id := range ids {
if om.GetOrders(id).GetOwner(floor, button) >= 0 {
return om.GetOrders(id).GetOwner(floor, button)
}
}
return -1
} | [
-0.401006817817688,
-0.2633419334888458,
0.7098843455314636,
1.9226455688476562,
0.2569427788257599,
-0.5788252949714661,
0.9858798384666443,
-0.22077208757400513,
0.035762958228588104,
-0.23852191865444183,
0.5616775155067444,
-0.22840085625648499,
-0.05513886734843254,
0.725425124168396,... |
func getLowestCost(ids []int, floor int, button driver.ButtonType) (cost int, id int) {
bestId := ids[0]
lowestCost := om.GetOrders(ids[0]).GetCost(floor, button)
for _, id := range ids {
if cost := om.GetOrders(id).GetCost(floor, button); lowestCost < 0 {
lowestCost = cost
bestId = id
} else if cost >= 0 ... | [
0.3376735746860504,
-1.3818104267120361,
0.8384461402893066,
0.005942604038864374,
0.18348751962184906,
-0.9546591639518738,
-0.6121295690536499,
-0.4740811288356781,
0.5172349214553833,
-0.1300419270992279,
0.12410617619752884,
0.14847780764102936,
-0.1919739693403244,
1.0866738557815552,... |
func GetBinding(name string) Binding {
for _, b := range bindings {
if name == b.Name {
return b
}
}
return Binding{
Name: "JSON",
}
} | [
-0.7845213413238525,
0.029772674664855003,
0.5857635140419006,
0.41989001631736755,
-0.8194595575332642,
-0.5180925130844116,
-0.22542670369148254,
-0.7818811535835266,
0.2844701111316681,
0.7131859660148621,
-0.5588847994804382,
0.7342543005943298,
0.23927299678325653,
0.07870642840862274... |
func newStart(r *sdl.Renderer) (*start, error) {
maxX, maxY, _ := r.GetRendererOutputSize()
s := &start{
r: r,
tw: 400,
th: 428,
frameCounter: 0,
}
// Set texture
var err error
s.t1, err = img.LoadTexture(r, "assets/alien_l1.png")
if err != nil {
return nil, fmt.Errorf("... | [
-0.2535370886325836,
-0.7851152420043945,
0.7389935851097107,
-0.5096793174743652,
-1.339483618736267,
-0.3775680959224701,
0.12719757854938507,
-0.37317731976509094,
-0.1100921779870987,
0.39222395420074463,
-0.2302580028772354,
-0.14406152069568634,
0.21464967727661133,
0.139545544981956... |
func (s *start) Draw() {
s.frameCounter++
if s.frameCounter < 10 {
s.r.Copy(s.t1, nil, &sdl.Rect{X: s.tx, Y: s.ty, W: s.tw, H: s.th})
} else {
s.r.Copy(s.t2, nil, &sdl.Rect{X: s.tx, Y: s.ty, W: s.tw, H: s.th})
}
if s.frameCounter > 20 {
s.frameCounter = 0
}
maxX, maxY, _ := s.r.GetRendererOutputSize()
t... | [
-0.7333799600601196,
-0.04668132960796356,
1.0119541883468628,
-0.5709341764450073,
-0.6637545824050903,
0.6357483267784119,
0.7671337723731995,
-0.4418923854827881,
0.009074275381863117,
-0.023968836292624474,
-0.12644913792610168,
0.27993375062942505,
0.23706933856010437,
0.2011276632547... |
func check(err error) {
if err != nil {
panic(err)
}
} | [
0.9076279997825623,
0.3895120620727539,
-0.00933310016989708,
1.6255722045898438,
-0.009953747503459454,
0.42037415504455566,
-0.4049481749534607,
0.15466098487377167,
0.46837079524993896,
0.12247966974973679,
0.17285889387130737,
0.4687558114528656,
0.4242030084133148,
1.6115363836288452,... |
func NewHydraKratosConnector() (*HydraKratosConnector, error) {
client, err := idprovider.NewHydraKratosClient()
if err != nil {
return nil, err
}
return &HydraKratosConnector{client}, nil
} | [
-0.46548059582710266,
-0.29154905676841736,
-0.08475498110055923,
-0.08949945122003555,
-0.45166000723838806,
-0.3511808216571808,
-0.501935601234436,
0.5657994151115417,
-0.4989694356918335,
-0.31797176599502563,
-0.7321613430976868,
-0.012268113903701305,
0.09515027701854706,
0.273024320... |
func (a *HydraKratosConnector) GetUserIDFromToken(token string) (string, error) {
return a.Client.GetUserIDFromToken(context.Background(), token)
} | [
0.6296080350875854,
-0.23586003482341766,
0.2003452032804489,
0.6557492017745972,
-0.1236594021320343,
0.31689929962158203,
-0.5604450702667236,
-0.7239023447036743,
-0.2307150512933731,
-0.3440088927745819,
-0.4348164498806,
0.3789234757423401,
-0.5059565305709839,
-0.25683704018592834,
... |
func (a *HydraKratosConnector) GetUserInfo(userID string) (*UserInfo, error) {
kratosInfo, err := a.Client.GetUserInfo(context.Background(), userID)
if err != nil {
return nil, err
}
return transformKratosUserInfoToUserInfo(kratosInfo)
} | [
0.1836870312690735,
-0.021378636360168457,
0.39443448185920715,
0.4637088179588318,
0.12986233830451965,
0.14770227670669556,
0.1789303869009018,
-1.0272753238677979,
-0.3744737505912781,
-0.3011016845703125,
-0.8334930539131165,
0.5773236155509949,
-0.07365657389163971,
0.3418518900871277... |
func (a *HydraKratosConnector) GetUserInfoFromAccessToken(accessToken string) (*UserInfo, error) {
userID, err := a.GetUserIDFromToken(accessToken)
if err != nil {
return nil, err
}
return a.GetUserInfo(userID)
} | [
0.897991955280304,
-0.5104078054428101,
0.2102583348751068,
0.22670882940292358,
-0.07035143673419952,
-0.011215455830097198,
-0.33035239577293396,
-0.9850841164588928,
-0.46212685108184814,
-0.7292301058769226,
-0.08677029609680176,
0.09734019637107849,
0.6376118659973145,
-0.315801233053... |
func (a *HydraKratosConnector) CreateIdentity(email string) (*CreateIdentityResponse, error) {
resp, err := a.Client.CreateIdentity(context.Background(), email)
if err != nil {
return nil, err
}
return &CreateIdentityResponse{
IdentityProvider: resp.IdentityProvider,
AuthProviderID: resp.AuthProviderID,
},... | [
-0.9114318490028381,
0.45429331064224243,
0.5249857306480408,
0.5316282510757446,
1.0704413652420044,
0.4045752286911011,
0.3872072696685791,
-0.023586219176650047,
0.9011762738227844,
0.7188791036605835,
-0.9939625263214111,
-0.4374726712703705,
-1.3839269876480103,
-0.25008878111839294,
... |
func (a *HydraKratosConnector) CreateInviteLink(authProviderID string) (*CreateInviteLinkResponse, error) {
ident, err := a.Client.CreateInviteLinkForIdentity(context.Background(), &idprovider.CreateInviteLinkForIdentityRequest{
AuthProviderID: authProviderID,
})
if err != nil {
return nil, err
}
return &Creat... | [
-0.9156951308250427,
0.0322628915309906,
0.3960963487625122,
0.3020128309726715,
0.8360573053359985,
0.4783797562122345,
-0.08165095001459122,
-0.025869619101285934,
0.367938756942749,
0.49077293276786804,
-0.9858160614967346,
0.9258813858032227,
-1.3473225831985474,
-0.07945337891578674,
... |
func Init() {
var once sync.Once
initDB := func() {
db, err := gorm.Open("mysql",
viper.GetString("mysql.master.user")+":"+
viper.GetString("mysql.master.password")+"@tcp("+
viper.GetString("mysql.master.host")+":"+
viper.GetString("mysql.master.port")+")/"+
viper.GetString("mysql.master.db")+"?c... | [
0.025789860635995865,
-0.18380899727344513,
1.0627113580703735,
0.7258774638175964,
0.010076411999762058,
0.0807480588555336,
-0.17965561151504517,
0.8538269996643066,
-0.004488504957407713,
0.31164997816085815,
-0.7827914953231812,
0.5042799711227417,
-0.21221813559532166,
0.5721300244331... |
func (m *V2beta1Pipeline) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCreatedAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateError(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
... | [
-0.24295878410339355,
-1.0850638151168823,
0.2454383224248886,
-0.9835251569747925,
0.698349118232727,
-0.3400479257106781,
0.2936197519302368,
-0.29931965470314026,
-1.3057184219360352,
0.4056313931941986,
0.4398125112056732,
0.6192245483398438,
-0.2030247449874878,
0.758476972579956,
-... |
func TestMiddleware_ValidAuth(t *testing.T) {
realm := Realm{Name: "Restricted", Charset: "utf-8", users: map[string]string{"gon": "hunter1"}}
auth := "Basic " + base64.StdEncoding.EncodeToString([]byte("gon:hunter1"))
rw := NewMockResponseWriter()
r := new(http.Request)
r.Header = http.Header{"Authorization": [... | [
0.03992709144949913,
-0.22778744995594025,
0.7181940078735352,
0.7041277885437012,
-0.5486240386962891,
0.41369548439979553,
-0.3786682188510895,
0.2924148142337799,
0.901119589805603,
-0.03253817558288574,
-0.32547643780708313,
0.30982083082199097,
-0.3802974224090576,
0.10258815437555313... |
func TestMiddleware_MissingAuth(t *testing.T) {
realm := Realm{Name: "Restricted", Charset: "utf-8", users: map[string]string{"gon": "hunter1"}}
rw := NewMockResponseWriter()
r := new(http.Request)
middleware := Middleware(realm)
route := func(w http.ResponseWriter, r *http.Request) {}
handler := middleware(ht... | [
-0.3919334411621094,
-0.14332042634487152,
0.582919180393219,
0.7451468706130981,
-0.47972381114959717,
0.6873029470443726,
0.30974408984184265,
0.6816736459732056,
0.47901108860969543,
-0.31480872631073,
-0.33993789553642273,
0.26238831877708435,
-0.14118948578834534,
0.4325363337993622,
... |
func TestHandlerFunc_ValidAuth(t *testing.T) {
realm := Realm{Name: "Restricted", Charset: "utf-8", users: map[string]string{"gon": "hunter1"}}
auth := "Basic " + base64.StdEncoding.EncodeToString([]byte("gon:hunter1"))
rw := NewMockResponseWriter()
r := new(http.Request)
r.Header = http.Header{"Authorization": ... | [
0.2419205605983734,
-0.5921667814254761,
0.5509427189826965,
0.7427096366882324,
-0.2869255542755127,
0.6149811148643494,
0.31298261880874634,
0.7233551144599915,
0.5608525276184082,
-0.3341468870639801,
-0.3964836597442627,
0.18990156054496765,
0.46434858441352844,
-0.5075283646583557,
... |
func TestHandlerFunc_MissingAuth(t *testing.T) {
realm := Realm{Name: "Restricted", Charset: "utf-8", users: map[string]string{"gon": "hunter1"}}
rw := NewMockResponseWriter()
r := new(http.Request)
route := func(w http.ResponseWriter, r *http.Request) {}
handler := HandlerFunc(realm, route)
if handler == nil {... | [
0.055084697902202606,
-0.6524767279624939,
0.5412629842758179,
0.7340313792228699,
0.045565955340862274,
0.5927367210388184,
0.776257336139679,
1.1347484588623047,
0.05654395371675491,
-0.6412903070449829,
-0.5765583515167236,
0.24636676907539368,
0.7330265641212463,
-0.2059314101934433,
... |
func (p *PlurkClient) GetResponses() *Responses {
return &Responses{p}
} | [
0.777407169342041,
-0.5343946814537048,
0.08241346478462219,
-0.14692288637161255,
1.0269039869308472,
-0.3432680368423462,
0.25143006443977356,
-0.6682036519050598,
0.9285030961036682,
-1.0857611894607544,
-0.7564418911933899,
0.19978715479373932,
-1.3032810688018799,
-0.7007938027381897,... |
func (r *Responses) ResponseAdd(plurkID int, content string, qualifier string) (result *Response, err error) {
params := make(url.Values)
params.Add("plurk_id", fmt.Sprintf("%d", plurkID))
params.Add("content", content)
params.Add("qualifier", qualifier)
data, err := r.Post("Responses/responseAdd", params)
if e... | [
0.14022253453731537,
-1.0871142148971558,
0.8158727884292603,
-0.07412059605121613,
-0.02830570377409458,
0.26349037885665894,
-0.09070544689893723,
0.19152863323688507,
1.2229585647583008,
-0.07447067648172379,
-0.35435038805007935,
0.23883745074272156,
-1.1504889726638794,
-0.75105011463... |
func (m *MockDriver) Templates() (map[string]string, error) {
return nil, nil
} | [
-1.400586724281311,
-0.67530757188797,
0.5580629110336304,
0.00953602883964777,
-0.5932911038398743,
-0.7792566418647766,
0.11375106871128082,
0.5045055747032166,
0.7628559470176697,
-0.20643681287765503,
-0.6528465747833252,
-1.0159754753112793,
-1.0393866300582886,
1.1554228067398071,
... |
func (m *MockDriver) Imports() (importers.Collection, error) {
return importers.Collection{
BasedOnType: importers.Map{
"null.Int": {
ThirdParty: importers.List{`"github.com/volatiletech/null/v8"`},
},
"null.String": {
ThirdParty: importers.List{`"github.com/volatiletech/null/v8"`},
},
"null.T... | [
-0.48802614212036133,
-0.3667030930519104,
0.6376968026161194,
-0.5828752517700195,
0.7108444571495056,
-0.43608349561691284,
-0.9633641242980957,
-0.015743399038910866,
0.2893093526363373,
0.567366898059845,
-0.9054213166236877,
-0.004001697525382042,
-1.0779802799224854,
0.11305373162031... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.