text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (c *Cache) getBlock(aoffset int64, locked bool) *cacheBlock {
if !locked {
c.mu.Lock()
defer c.mu.Unlock()
}
if blk, ok := c.blocks[aoffset]; ok {
c.lru.MoveToFront(blk.lru)
return blk
}
return nil
} | [
-0.40697550773620605,
0.9202793836593628,
0.685606837272644,
0.12278059870004654,
-0.4091072976589203,
0.033521462231874466,
0.14146538078784943,
-1.0076684951782227,
0.6784240007400513,
-0.1424645632505417,
0.4840830862522125,
0.9124837517738342,
-0.03509369492530823,
-0.7888217568397522,... |
func (c *Cache) blockAlign(offset int64) int64 {
return offset / int64(c.blockSize) * int64(c.blockSize)
} | [
-0.683739185333252,
-0.6308890581130981,
0.46166443824768066,
-0.16971231997013092,
-1.169073224067688,
0.38720011711120605,
-0.12924998998641968,
0.24397316575050354,
-0.6818804740905762,
0.42565733194351196,
-0.1058107316493988,
0.01958516612648964,
-0.7200227379798889,
0.485525369644165... |
func (r *RepoStruct) Register() {
if r == nil {
return
}
if r.forge == nil {
return
}
r.forge.ForjCore.Repos[r.name] = r
} | [
-0.6740301847457886,
0.7324914336204529,
0.04268519952893257,
-0.5255166888237,
0.9283252358436584,
-0.8883978128433228,
0.2373693585395813,
-0.15134194493293762,
-0.04897786304354668,
-0.5217070579528809,
-0.988874077796936,
-0.35304972529411316,
0.05349311977624893,
0.038177575916051865,... |
func (r *RepoStruct) Flags() (flags []string) {
if r == nil {
flags = make([]string, 0)
return
}
coreList := []string{
FieldRepoName,
FieldRepoUpstream,
FieldRepoGitRemote,
FieldRepoRemote,
FieldRepoRemoteURL,
FieldRepoTitle,
FieldRepoFlow,
FieldRepoTemplate,
FieldRepoDeployName,
FieldRepoRol... | [
-0.8451810479164124,
-0.16241289675235748,
0.43908044695854187,
-1.2823039293289185,
0.4827544391155243,
0.466166615486145,
-0.12902763485908508,
-0.11648836731910706,
0.1367061883211136,
-0.009073902852833271,
-0.9446650743484497,
0.4191720485687256,
-0.8859261274337769,
0.442277342081069... |
func (r *RepoStruct) Get(field string) (value *goforjj.ValueStruct, found bool, source string) {
if r == nil {
return
}
source = r.sources.Get(field)
switch fieldSel := strings.Split(field, ":"); fieldSel[0] {
case FieldRepoName:
value, found = value.SetIfFound(r.name, (r.name != ""))
case FieldRepoApps, Fiel... | [
-0.6728620529174805,
-0.6066733598709106,
0.6626556515693665,
-1.27321195602417,
0.08028019219636917,
0.020719565451145172,
-0.03115755505859852,
0.08843564987182617,
-0.39720314741134644,
0.16677019000053406,
-0.22423645853996277,
0.4818686842918396,
-0.05919881537556648,
0.44235301017761... |
func (r *RepoStruct) SetHandler(source string, from func(field string) (string, bool), keys ...string) {
if r == nil {
return
}
for _, key := range keys {
if v, found := from(key); found {
r.Set(source, key, v)
}
}
} | [
-0.668944239616394,
0.4618724584579468,
0.2742466628551483,
-0.5688270926475525,
-0.3685699999332428,
0.06894444674253464,
-0.06182229518890381,
1.385703206062317,
-1.092803716659546,
-0.1348528414964676,
-0.8058683276176453,
-0.30772867798805237,
0.05468698590993881,
0.08680505305528641,
... |
func (r *RepoStruct) SetInternalRelApp(appRelName, appName string) (updated *bool, _ error) {
if err := r.initApp(); err != nil {
return nil, err
}
if v, found := r.Apps[appRelName]; found {
appName = v // Set always declared one.
}
if app, err := r.forge.ForjCore.Apps.Found(appName); err != nil {
return n... | [
-0.33527302742004395,
-0.5759450197219849,
0.9078015089035034,
-0.5591496229171753,
-0.6201073527336121,
0.3106909692287445,
-0.08915981650352478,
-0.42649906873703003,
0.2655463218688965,
0.5017668008804321,
0.150338277220726,
-0.14752544462680817,
-0.7164424657821655,
-0.3109438419342041... |
func (r *RepoStruct) SetApp(appRelName, appName string) (updated *bool, _ error) {
if err := r.initApp(); err != nil {
return nil, err
}
updated = new(bool)
if v, found := r.Apps[appRelName]; !found || (found && v != appName) {
*updated = true
}
r.Apps[appRelName] = appName
if set, err := r.SetInternalRelA... | [
-0.32563623785972595,
-0.33723533153533936,
0.829237163066864,
0.5314664244651794,
-0.8814247846603394,
0.4296334683895111,
-0.2281600683927536,
-0.23494267463684082,
0.5600284934043884,
0.6882846355438232,
0.1552278995513916,
-0.3225465714931488,
-0.7217689156532288,
-0.04871106892824173,... |
func ruleCheck(get func(string) (string, bool), rule []string) (found bool, err error) {
return
} | [
0.0942884013056755,
-0.44032999873161316,
0.33088311553001404,
0.31337594985961914,
1.5968091487884521,
0.9059286117553711,
-0.09217207878828049,
0.7071720957756042,
-0.6139118075370789,
0.7509349584579468,
1.028656244277954,
1.565021276473999,
0.21027828752994537,
0.014527622610330582,
... |
func (r *RepoStruct) HasApps(rulesList ...string) (found bool, err error) {
if r.apps == nil {
return
}
ruleChecker := rules.NewRuleChecker()
for appRelName, app := range r.apps {
found = true
for _, rule := range rulesList {
var key string
if key, _, _, err = ruleChecker.Validate(rule); err != nil {
... | [
0.19787879288196564,
-0.14761550724506378,
0.8825012445449829,
0.16088765859603882,
-0.581371545791626,
0.4799017608165741,
-0.009388498030602932,
0.20526088774204254,
-0.45770156383514404,
0.5641336441040039,
0.6186808347702026,
-0.30446285009384155,
-0.36104196310043335,
0.85635608434677... |
func (r *RepoStruct) Name() string {
if r == nil {
return ""
}
return r.name
} | [
-0.26670917868614197,
0.03544490411877632,
0.3302733898162842,
-0.5388587117195129,
-0.668933629989624,
-0.3503568470478058,
0.6073805689811707,
-0.10050204396247864,
0.9178699254989624,
0.3136533200740814,
-0.77504563331604,
-0.9531626105308533,
-0.33470430970191956,
-0.4363287389278412,
... |
func (r *RepoStruct) IsCurrentDeploy() (ret bool) {
if r == nil {
return
}
return r.isCurrentDeploy && r.isDeploy
} | [
-0.5968252420425415,
-0.7538394331932068,
0.30855509638786316,
-0.06278209388256073,
-0.5158207416534424,
-0.07315277308225632,
0.559563934803009,
-0.03619083762168884,
0.7099335789680481,
0.25726717710494995,
-0.5090973973274231,
-0.2357272058725357,
-0.5909139513969421,
0.487619817256927... |
func (r *RepoStruct) SetCurrentDeploy() {
if r == nil {
return
}
if !r.isDeploy {
return
}
r.isCurrentDeploy = true
} | [
-0.03378554433584213,
-0.6016635298728943,
0.3926233649253845,
-0.1437077522277832,
-0.23285463452339172,
0.3668469190597534,
0.8904498219490051,
0.36171770095825195,
0.15431329607963562,
-0.06516382098197937,
-0.5109687447547913,
-0.18251867592334747,
-0.799227237701416,
0.958809792995452... |
func MakeExitServerUserdata(authToken, version string) string {
return `#!/bin/bash
export AUTHTOKEN="` + authToken + `"
export IP=$(curl -sfSL https://checkip.amazonaws.com)
curl -SLsf https://github.com/inlets/inlets-pro/releases/download/` + version + `/inlets-pro -o /tmp/inlets-pro && \
chmod +x /tmp/inlets-pr... | [
-0.5563331246376038,
-0.5017074942588806,
0.6747313737869263,
0.15544621646404266,
-0.8022241592407227,
0.7570892572402954,
-0.2277655452489853,
0.036431241780519485,
-0.01374711561948061,
-0.42180630564689636,
-0.33884066343307495,
0.8867999911308289,
0.1729992926120758,
-0.33028170466423... |
func panicGuard(cmdFn func(*cobra.Command, []string)) func(*cobra.Command, []string) error {
return func(c *cobra.Command, args []string) (err error) {
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("%v", r)
}
}()
cmdFn(c, args)
return nil
}
} | [
0.336618572473526,
0.25353509187698364,
0.4223993718624115,
0.4317093789577484,
0.19550351798534393,
-0.34872716665267944,
-0.10888536274433136,
-0.21585774421691895,
-0.30844682455062866,
-0.5080589652061462,
-0.14160031080245972,
-0.5066180229187012,
-0.4366995394229889,
0.83953195810317... |
func panicf(format string, args ...interface{}) {
panic(fmt.Sprintf(format, args...))
} | [
0.6527592539787292,
-0.40593206882476807,
0.3378675878047943,
0.5405181646347046,
0.1854444146156311,
0.43264609575271606,
-0.32573163509368896,
0.21275494992733002,
-1.011263132095337,
-0.3011545240879059,
0.2971220016479492,
0.1615433692932129,
0.5474238991737366,
0.4584706127643585,
0... |
func runStart(_ *cobra.Command, args []string) error {
if startBackground {
return rerunBackground()
}
if err := initInsecure(); err != nil {
return err
}
// Default the log directory to the "logs" subdirectory of the first
// non-memory store. We only do this for the "start" command which is why
// this w... | [
0.26631051301956177,
0.10418224334716797,
0.8605611324310303,
0.560077428817749,
0.7481738924980164,
-0.026587573811411858,
0.989094614982605,
-0.367752343416214,
-0.13370271027088165,
-0.125594824552536,
-0.3435387909412384,
0.9066422581672668,
-0.8899840116500854,
0.18306273221969604,
... |
func rerunBackground() error {
args := make([]string, 0, len(os.Args))
foundBackground := false
for _, arg := range os.Args {
if arg == "--background" || strings.HasPrefix(arg, "--background=") {
foundBackground = true
continue
}
args = append(args, arg)
}
if !foundBackground {
args = append(args, "-... | [
0.45676249265670776,
0.2616480886936188,
1.2305771112442017,
1.0488638877868652,
0.40876802802085876,
-0.39541080594062805,
0.30686575174331665,
-0.5631247162818909,
-0.8710116744041443,
-0.06766284257173538,
0.5226811766624451,
1.0936148166656494,
-0.845597505569458,
0.7816477417945862,
... |
func doShutdown(c serverpb.AdminClient, ctx context.Context, onModes []int32) (string, error) {
stream, err := c.Drain(ctx, &serverpb.DrainRequest{
On: onModes,
Shutdown: true,
})
if err != nil {
return "", err
}
_, err = stream.Recv()
if err == nil {
for {
if _, err := stream.Recv(); !grpcutil.I... | [
-0.4128599762916565,
-0.028598977252840996,
1.0244795083999634,
-0.3435699939727783,
-0.10141382366418839,
0.971699595451355,
-0.4938026964664459,
-0.9557624459266663,
0.15864352881908417,
1.1797294616699219,
0.34666165709495544,
0.3594568073749542,
-1.4265623092651367,
0.11585915833711624... |
func runQuit(_ *cobra.Command, _ []string) error {
onModes := make([]int32, len(server.GracefulDrainModes))
for i, m := range server.GracefulDrainModes {
onModes[i] = int32(m)
}
c, stopper, err := getAdminClient()
if err != nil {
return err
}
defer stopper.Stop()
ctx := stopperContext(stopper)
retry, er... | [
-0.6465015411376953,
0.19064968824386597,
0.779325008392334,
-0.480320006608963,
0.37900301814079285,
0.6750701665878296,
0.3501380980014801,
-0.9988165497779846,
-0.32035982608795166,
-0.21863016486167908,
-0.19710642099380493,
0.840083658695221,
-0.2606165409088135,
0.44019025564193726,
... |
func (t *TransientDescriptor) SetTransition(transition func(ctx context.Context, url *url.URL, reader io.ReadCloser) (*StableDescriptor, error)) (*TransientDescriptor, error) {
if t == nil {
return nil, errors.New("reference to transient descriptor is nil")
}
if transition == nil {
return nil, errors.New("nil p... | [
-0.8102887272834778,
0.08820023387670517,
0.2717955410480499,
-0.24460281431674957,
0.5014151334762573,
-0.49334096908569336,
0.3379693031311035,
0.04460280016064644,
-0.03909628838300705,
0.161760613322258,
-0.7224995493888855,
0.15228179097175598,
0.2264716774225235,
0.711898684501648,
... |
func (t *TransientDescriptor) SetLocation(location *url.URL) (*TransientDescriptor, error) {
if t == nil {
return nil, errors.New("reference to transient descriptor is nil")
}
if location == nil {
return nil, errors.New("nil pointer value for `location` parameter")
}
t.Lock()
defer t.Unlock()
t.location =... | [
-0.8985974192619324,
0.3260378837585449,
0.29982537031173706,
-0.7895177006721497,
0.09763216972351074,
-0.5443001389503479,
0.7484601140022278,
0.687613844871521,
-0.023734088987112045,
0.44702231884002686,
-0.38709136843681335,
-0.19593244791030884,
-0.05960803106427193,
0.43761596083641... |
func (t *TransientDescriptor) SetSource(source *StableDescriptor) (*TransientDescriptor, error) {
if t == nil {
return nil, errors.New("reference to transient descriptor is nil")
}
if source == nil {
return nil, errors.New("nil pointer value for `source` parameter")
}
t.Lock()
defer t.Unlock()
err := sour... | [
-0.8537229895591736,
1.6234537363052368,
0.48150724172592163,
0.6339741945266724,
-0.2620915472507477,
-0.28754496574401855,
0.5225276947021484,
-0.032111939042806625,
-0.25728461146354675,
0.5189028978347778,
-0.5318228006362915,
0.40482696890830994,
-0.47842124104499817,
0.88954418897628... |
func TestPostgresDSNCreation(t *testing.T) {
db := "TestDB"
host := "somehost.com"
port := 20
username := "someuser"
password := "somepassword"
query := "SELECT id, config FROM table WHERE id in %ID_LIST%"
cfg := &config.PostgresConfig{
Database: db,
Host: host,
Port: port,
Userna... | [
-0.4879049062728882,
0.7665851712226868,
0.7163401246070862,
0.06043205410242081,
0.4302368462085724,
-0.15541811287403107,
-0.07321787625551224,
0.20497076213359833,
-0.6171551942825317,
-0.39163780212402344,
-1.3678196668624878,
-0.20674049854278564,
0.47054558992385864,
0.50754159688949... |
func processCommand(id int, message string, gv *GameVariables) error {
var err error = nil
// preallocate the update group
var u UpdateGroup
u.TileUpdates = make([]Tile, 0, 16)
u.WeaponHits = make([]HitInfo, 0, 1)
u.TargetUpdates = make([]Target, 0, 1)
i := strings.Index(message, ":")
if i < 0 {
return error... | [
-0.2775534987449646,
-0.28990650177001953,
1.136570692062378,
-0.06860340386629105,
0.7242000699043274,
0.15444886684417725,
0.41388264298439026,
-0.9176692366600037,
0.032637134194374084,
0.6442345976829529,
0.05415843799710274,
0.5043696761131287,
-0.5885431170463562,
0.7422056198120117,... |
func NewMockActionFactory(ctrl *gomock.Controller) *MockActionFactory {
mock := &MockActionFactory{ctrl: ctrl}
mock.recorder = &MockActionFactoryMockRecorder{mock}
return mock
} | [
0.5965949892997742,
-0.8121969699859619,
0.27332445979118347,
0.7882211804389954,
-0.10081538558006287,
-0.5696925520896912,
1.5288141965866089,
-0.3515537679195404,
0.7845368385314941,
0.09987656027078629,
-0.5112077593803406,
-0.07206407934427261,
-0.10196444392204285,
0.6199496388435364... |
func (m *MockActionFactory) EXPECT() *MockActionFactoryMockRecorder {
return m.recorder
} | [
0.15484292805194855,
-0.5398315787315369,
0.243807852268219,
0.6891913414001465,
0.24887190759181976,
-0.16211003065109253,
0.5546574592590332,
0.35149163007736206,
0.7033791542053223,
-0.5140291452407837,
0.7886026501655579,
0.9095829725265503,
-0.16832824051380157,
0.41089919209480286,
... |
func (m *MockActionFactory) Create(arg0 models.Rule) (Action, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Create", arg0)
ret0, _ := ret[0].(Action)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
-0.7011595368385315,
-0.15809091925621033,
0.2247585654258728,
0.9289734363555908,
1.7225852012634277,
0.3165976107120514,
1.0047811269760132,
-0.5290269255638123,
-1.5661060810089111,
0.3280623257160187,
-0.20523612201213837,
-0.872926652431488,
-0.04855075106024742,
1.5119516849517822,
... |
func (mr *MockActionFactoryMockRecorder) Create(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockActionFactory)(nil).Create), arg0)
} | [
-0.019183393567800522,
0.38610121607780457,
0.12772506475448608,
0.8128291964530945,
0.20987501740455627,
0.5543676018714905,
-0.28459101915359497,
-1.2269535064697266,
-0.15296712517738342,
0.5282319784164429,
0.7908158302307129,
0.048291172832250595,
-0.49164724349975586,
1.9567055702209... |
func NewMockAction(ctrl *gomock.Controller) *MockAction {
mock := &MockAction{ctrl: ctrl}
mock.recorder = &MockActionMockRecorder{mock}
return mock
} | [
-0.02429734542965889,
-0.259748637676239,
0.3800988495349884,
0.2545769214630127,
0.8959890007972717,
0.08985012769699097,
1.0346229076385498,
-0.8065721988677979,
0.6960874795913696,
0.7431553602218628,
-1.1463420391082764,
0.44111311435699463,
-0.6839549541473389,
0.7718650102615356,
-... |
func (m *MockAction) EXPECT() *MockActionMockRecorder {
return m.recorder
} | [
0.06365564465522766,
-0.5909584760665894,
0.35586851835250854,
0.5665692090988159,
0.48582565784454346,
0.08938143402338028,
0.6607608199119568,
-0.07389923930168152,
0.7692816853523254,
-0.0032799066975712776,
0.6924199461936951,
1.2158405780792236,
-0.6373034715652466,
0.5765734910964966... |
func (m *MockAction) Execute(arg0 context.Context) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "Execute", arg0)
} | [
-0.2695631980895996,
-0.7154374122619629,
0.5073748826980591,
1.11338210105896,
1.4995063543319702,
0.7774829268455505,
0.22222284972667694,
-0.4091050624847412,
-0.47101864218711853,
0.6637294292449951,
-0.27429136633872986,
-1.0365464687347412,
-0.30243900418281555,
0.4098246693611145,
... |
func (mr *MockActionMockRecorder) Execute(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockAction)(nil).Execute), arg0)
} | [
-0.15847069025039673,
0.06704013794660568,
0.4670632779598236,
0.8247513175010681,
0.18469156324863434,
0.23924656212329865,
-0.5683223605155945,
-0.9851824045181274,
0.5304453372955322,
1.116029977798462,
0.47490009665489197,
0.13814643025398254,
-0.6961970925331116,
1.0795598030090332,
... |
func TestCopyStruct(t *testing.T) {
x := testXXX{F0: "0", F1: "1", F2: 1, F3: time.Now(), F5: time.Now(), F10: []string{"111", "222", "333"}}
y := testXXX{}
logStruct(t, "Reference", x)
logStruct(t, "Before", y)
if err := CopyStruct(&x, &y); err != nil {
t.Error(err)
}
logStruct(t, "After", y)
} | [
0.21377399563789368,
0.07634542137384415,
0.8181825876235962,
-0.18208467960357666,
-0.8378558158874512,
0.4730597734451294,
0.5675348043441772,
-0.5845204591751099,
0.4170280992984772,
-0.7654141783714294,
-0.5809758901596069,
0.5486632585525513,
0.17259640991687775,
-0.5470224022865295,
... |
func (*HoneyBadgerBFTMessage) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _HoneyBadgerBFTMessage_OneofMarshaler, _HoneyBadgerBFTMessage_OneofUnmarshaler, _HoneyBadgerBFT... | [
-0.26474952697753906,
0.9182116389274597,
0.6484290957450867,
-0.4431699514389038,
1.1086117029190063,
-0.949746310710907,
0.7163915634155273,
-1.1083461046218872,
0.12482485920190811,
-0.8026251196861267,
-0.7031230330467224,
-0.1873195618391037,
-0.8320329189300537,
1.2798558473587036,
... |
func (*HoneyBadgerBFTMessageBinaryAgreement) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _HoneyBadgerBFTMessageBinaryAgreement_OneofMarshaler, _HoneyBadgerBFTMessageBina... | [
-0.26037487387657166,
0.7896174788475037,
0.705926775932312,
-0.6531577706336975,
0.4813973009586334,
-0.6570062637329102,
0.9109719395637512,
-0.7287573218345642,
-0.0290732029825449,
-0.23416239023208618,
0.030420085415244102,
0.008099406957626343,
-0.8913513422012329,
1.4016388654708862... |
func (*HoneyBadgerBFTMessageReliableBroadcast) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _HoneyBadgerBFTMessageReliableBroadcast_OneofMarshaler, _HoneyBadgerBFTMessage... | [
0.17377400398254395,
0.4591868221759796,
0.5880271792411804,
-0.9754303693771362,
0.4147360920906067,
-0.6509368419647217,
0.7122416496276855,
-0.833253800868988,
0.6630333662033081,
-0.6226920485496521,
-0.3440612554550171,
0.5248448848724365,
-0.6563920974731445,
1.1064969301223755,
0.... |
func (r *ReconcileComplianceScan) reconcileReplicatedTailoringConfigMap(scan *compv1alpha1.ComplianceScan, origName, origNs, privName, privNs, scanName string, logger logr.Logger) error {
logger.Info("Reconciling Tailoring ConfigMap", "ConfigMap.Name", origName, "ConfigMap.Namespace", origNs)
origCM := &corev1.Confi... | [
-0.6409438252449036,
-0.41861504316329956,
0.5685253143310547,
-0.25308969616889954,
0.01822037436068058,
-0.1338212788105011,
0.5751418471336365,
0.5968353748321533,
0.3526530861854553,
0.40449774265289307,
-0.3529549539089203,
0.4585592448711395,
-0.321556031703949,
1.1696686744689941,
... |
func (i *Inventory) Items() []*ItemStack {
return i.items
} | [
-1.1569150686264038,
-0.44848451018333435,
0.16354413330554962,
0.7619823217391968,
0.831186830997467,
0.3336532711982727,
0.07607728987932205,
-0.5596511960029602,
-0.19861061871051788,
0.052633266896009445,
-0.5358864665031433,
0.26353195309638977,
-0.7728606462478638,
-1.025351643562317... |
func (i *Inventory) Cap() int {
return i.cap
} | [
-1.3458707332611084,
-0.6067213416099548,
0.5346305966377258,
0.9269223809242249,
-0.08927071839570999,
0.6214849948883057,
0.810985803604126,
-0.31967318058013916,
-0.15296493470668793,
1.1000419855117798,
0.17320480942726135,
0.2890452742576599,
0.022757703438401222,
-0.6336901783943176,... |
func (i *Inventory) Count() int {
count := 0
for _, item := range i.items {
if item != nil {
count++
}
}
return count
} | [
0.02939242497086525,
-0.8421056270599365,
0.6825171113014221,
0.4721863269805908,
0.5592614412307739,
-0.5183777809143066,
0.07333104312419891,
0.48174312710762024,
-0.7751389741897583,
0.6883686780929565,
-0.6408944129943848,
-0.38568246364593506,
0.06857078522443771,
0.6004775762557983,
... |
func (i *Inventory) SetCap(cap int) {
if cap < i.cap {
panic("Cannot shrink inventory.")
}
i.cap = cap
} | [
-0.7833881974220276,
-0.10577715188264847,
0.7623443603515625,
1.5075002908706665,
-0.04370294511318207,
0.637115478515625,
0.49884265661239624,
-0.6647140979766846,
0.036324042826890945,
0.4251546561717987,
-0.06439878046512604,
-0.43203505873680115,
0.10572411864995956,
-0.44595482945442... |
func (i *Inventory) AddItem(item *ItemStack) bool {
if item == nil {
return false
}
// do we already have it?
for idx, stack := range i.items {
if stack == nil {
continue
}
if stack.Item == item.Item {
i.items[idx].Count += item.Count
return true
}
}
// use a copy to not modify the original... | [
-0.931831955909729,
0.6984498500823975,
0.9394608736038208,
0.38842466473579407,
0.44751572608947754,
0.6243815422058105,
0.4222713112831116,
-0.30355939269065857,
0.5223391056060791,
0.2504102885723114,
-0.26598140597343445,
-1.0633376836776733,
-0.7497887015342712,
-0.6244320869445801,
... |
func (i *Inventory) CanConsumeItems(stacks []*ItemStack) bool {
canConsume := true
for _, s := range stacks {
canConsume = canConsume && i.CanConsume(s)
if !canConsume {
break
}
}
return canConsume
} | [
-0.16633783280849457,
-0.20118148624897003,
0.7532426118850708,
2.0936522483825684,
0.4432213604450226,
-0.22182832658290863,
-0.10582812130451202,
0.06259056180715561,
-1.398437738418579,
0.9820085763931274,
-0.16160036623477936,
-1.109830617904663,
-0.5284509062767029,
0.5880938768386841... |
func (i *Inventory) CanConsume(stack *ItemStack) bool {
canConsume := false
i.iterateItems(stack.Item, func(idx int) bool {
if i.items[idx].Count >= stack.Count {
canConsume = true
}
return false
})
return canConsume
} | [
-0.11209043115377426,
-0.18876753747463226,
0.682803213596344,
0.9479640126228333,
0.32983162999153137,
-0.5458799004554749,
0.28713059425354004,
0.024052653461694717,
-1.177941918373108,
0.9150084853172302,
-0.5649399161338806,
-0.38919493556022644,
0.036508895456790924,
0.044072505086660... |
func (i *Inventory) ConsumeItems(stacks []*ItemStack) bool {
allConsumed := true
for _, s := range stacks {
allConsumed = allConsumed && i.ConsumeItem(s)
}
return allConsumed
} | [
-0.18459762632846832,
-0.15641537308692932,
0.6855825185775757,
1.4516706466674805,
0.9723584651947021,
0.18553736805915833,
-0.3100799322128296,
-0.11285676807165146,
-0.9070084095001221,
0.8494346141815186,
0.07397101819515228,
-1.575124979019165,
-0.49078240990638733,
0.7838996648788452... |
func (i *Inventory) ConsumeItem(stack *ItemStack) bool {
hasConsumed := false
i.iterateItems(stack.Item, func(idx int) bool {
cstack := i.items[idx]
if cstack.Count >= stack.Count {
cstack.Count -= stack.Count
if cstack.Count == 0 {
i.items[idx] = nil
}
hasConsumed = true
}
return false
})
... | [
0.07650282979011536,
-0.03510086238384247,
0.7407344579696655,
0.8363403081893921,
0.8196818828582764,
-0.18881960213184357,
0.12765994668006897,
0.21430039405822754,
-0.7478143572807312,
0.8167399764060974,
-0.1750294417142868,
-1.0662546157836914,
-0.3334869146347046,
0.08871927112340927... |
func (i *Inventory) DropAll(item Item) {
i.iterateItems(item, func(idx int) bool {
i.items[idx] = nil
return false
})
} | [
-0.8039932250976562,
-0.4784753918647766,
0.7838549017906189,
0.06729923188686371,
0.883625864982605,
0.5439672470092773,
-0.48409780859947205,
0.19918856024742126,
0.42847999930381775,
0.8656039237976074,
-0.6330366730690002,
-0.3749898374080658,
-0.8352088928222656,
-0.17019514739513397,... |
func (i *Inventory) iterateItems(itemType Item, p itemStackPredicate) {
for idx, stack := range i.items {
if stack != nil && stack.Item.ID == itemType.ID {
if !p(idx) {
break
}
}
}
} | [
-0.9226334691047668,
0.17403152585029602,
0.5898511409759521,
0.638550341129303,
1.2081135511398315,
0.36178842186927795,
-0.3569679260253906,
-0.23153996467590332,
-0.8552380800247192,
1.030976414680481,
0.4475563168525696,
0.21525494754314423,
-1.1682381629943848,
-0.09112688153982162,
... |
func (i *Inventory) Copy() *Inventory {
j := NewInventory()
j.cap = i.cap
for _, s := range i.items {
j.items = append(j.items, s.Copy())
}
return &j
} | [
-1.213310956954956,
-1.658313274383545,
0.3493354916572571,
0.7065035700798035,
-0.8739854097366333,
0.784363329410553,
0.6678112149238586,
-0.5238078236579895,
0.3138726055622101,
0.42022010684013367,
0.2532288432121277,
-0.06095868721604347,
-0.48963820934295654,
-1.0425962209701538,
0... |
func Replace(route Route, mtuConfig mtu.Configuration) error {
return errUnsupportedOp
} | [
-0.40161019563674927,
0.5286324620246887,
0.5606686472892761,
0.5908110737800598,
-0.7644281387329102,
0.13207171857357025,
-0.12332043051719666,
2.0164642333984375,
-0.3658083379268646,
0.7225861549377441,
-0.5190224051475525,
-0.5898142457008362,
-0.7090274691581726,
-0.1447041779756546,... |
func Delete(route Route) error {
return errUnsupportedOp
} | [
0.018177049234509468,
0.6708651185035706,
0.5205480456352234,
1.1606959104537964,
-0.07086540013551712,
0.46162086725234985,
0.39906543493270874,
1.0994963645935059,
0.6854450106620789,
0.49891525506973267,
-0.14405710995197296,
-0.18141643702983856,
-0.4972739815711975,
-0.078662939369678... |
func NodeDeviceWithDefaultRoute(enableIPv4, enableIPv6 bool) (netlink.Link, error) {
return nil, errUnsupportedOp
} | [
-0.8101628422737122,
0.5439508557319641,
0.3914417028427124,
0.6435315012931824,
0.7550505995750427,
-0.08085542917251587,
0.14579424262046814,
0.09279017150402069,
0.24100841581821442,
-0.011967328377068043,
0.12176096439361572,
-1.1825029850006104,
-0.6198055148124695,
0.6302433013916016... |
func Bind(
host string,
port int,
username string,
password string,
instanceID string,
params map[string]string,
) (string, map[string]interface{}, error) {
bindingID := uuid.NewV4().String()
url := fmt.Sprintf(
"%s/v2/service_instances/%s/service_bindings/%s",
getBaseURL(host, port),
instanceID,
bindin... | [
-1.402699589729309,
-0.4981509745121002,
1.294049859046936,
-0.27888309955596924,
-0.586023211479187,
0.002728399820625782,
-0.12520162761211395,
-0.3155995309352875,
-0.6609964370727539,
0.953585684299469,
-0.25626033544540405,
0.9975319504737854,
-0.3364333212375641,
0.8346153497695923,
... |
func (m NsswitchSource) Pointer() *NsswitchSource {
return &m
} | [
0.16312643885612488,
-0.2317529171705246,
-0.003191182389855385,
-0.7914549112319946,
-0.38755491375923157,
0.665482759475708,
0.06287417560815811,
-0.45036739110946655,
0.98603355884552,
-0.2850409150123596,
0.5350613594055176,
0.0023028759751468897,
-0.7184867858886719,
0.445167005062103... |
func (m NsswitchSource) Validate(formats strfmt.Registry) error {
var res []error
// value enum
if err := m.validateNsswitchSourceEnum("", "body", m); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
} | [
-0.7516493201255798,
0.67519211769104,
0.14939028024673462,
-0.21213515102863312,
0.19235503673553467,
-0.39048418402671814,
-0.038883354514837265,
-0.40237727761268616,
-0.07968148589134216,
0.5997721552848816,
-0.5808060169219971,
-0.13280801475048065,
-0.3339361548423767,
1.115334033966... |
func (m NsswitchSource) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
} | [
-0.219373419880867,
0.4802201986312866,
0.11141857504844666,
-0.4195517897605896,
-0.16283594071865082,
0.20899437367916107,
-0.4220581650733948,
0.18046283721923828,
0.7534341216087341,
0.29578661918640137,
-0.153675377368927,
0.3936404585838318,
-0.6683275699615479,
0.7199721336364746,
... |
func NewEvent(x, y float64, button Button, event string) Event {
return Event{
Point2: floatgeom.Point2{x, y},
Button: button,
Event: event,
}
} | [
1.763645887374878,
-0.8403077125549316,
0.2712620496749878,
0.5268950462341309,
-0.6278914213180542,
0.9214176535606384,
-0.3389188051223755,
-0.1972341239452362,
-0.18489299714565277,
0.1800573170185089,
-0.3218924403190613,
0.47451281547546387,
0.9215149879455566,
-0.4586869180202484,
... |
func NewZeroEvent(x, y float64) Event {
return NewEvent(x, y, ButtonNone, "")
} | [
0.8370770215988159,
-0.2394534796476364,
0.3579925000667572,
0.2568244934082031,
-0.8014565110206604,
-0.23414301872253418,
-0.4751017391681671,
-0.7507866621017456,
-0.23154720664024353,
-0.5962432026863098,
-0.43282419443130493,
0.5692328214645386,
-0.058739349246025085,
0.17822426557540... |
func (e Event) ToSpace() *collision.Space {
sp := collision.NewUnassignedSpace(e.X(), e.Y(), 0.1, 0.1)
sp.Location.Max[2] = MaxZLayer
sp.Location.Min[2] = MinZLayer
return sp
} | [
0.84648197889328,
-0.7932602763175964,
0.5026529431343079,
0.22709870338439941,
0.3326646089553833,
0.02172057330608368,
0.7971915006637573,
-0.2075924575328827,
1.0458725690841675,
0.011358336545526981,
-0.41296741366386414,
-0.33308693766593933,
-0.06451473385095596,
-0.24367471039295197... |
func FindMatchedSum(inputs []int, sum int) (int, int) {
hashmap := make(map[int]int)
u.Debug("- BEGIN inputs%+v\n", inputs)
for i := 0; i < len(inputs); i++ {
var value = inputs[i]
var target = sum - value
if index, ok := hashmap[target]; ok {
u.Debug("- FOUND inputs[%v] == %v, in hash %+v\n\n", i, value, ... | [
-0.4667591154575348,
-0.9284111857414246,
0.7091754078865051,
0.13792121410369873,
-0.3093646168708801,
-0.044072747230529785,
1.489420771598816,
-0.4815102219581604,
0.12748238444328308,
-0.18025292456150055,
0.2732480764389038,
0.15001405775547028,
-0.6775286793708801,
0.4790546298027038... |
func (v *Vault) GetTransitInfo() {
d, err := v.Client.Logical().Read("transit/keys/" + s.Vault.TransitKey)
if err != nil {
log.Fatalf("Vault error: %v", err)
}
if d == nil {
log.Fatalf("The configured transit key doesn't seem to exists : %v", s.Vault.TransitKey)
}
table := tablewriter.NewWriter(os.Stdout)
... | [
0.24090968072414398,
0.2731037735939026,
0.4965845048427582,
-0.9271042346954346,
0.12325030565261841,
-0.6734206676483154,
-0.4662390351295471,
0.01903076283633709,
-1.6139956712722778,
0.8091846704483032,
-0.36476704478263855,
0.15583863854408264,
-0.1741313934326172,
0.47326594591140747... |
func (v *Vault) CreateTransitKey(key string) {
_, err := v.Client.Logical().Write("transit/keys/"+key, make(map[string]interface{}))
if err != nil {
log.Fatalf("Vault error: %v", err)
}
fmt.Println("Transit key created successfully")
} | [
-0.3030889928340912,
0.00782354548573494,
0.28125515580177307,
-0.6896436810493469,
0.9618157148361206,
0.6207957863807678,
-0.1611577719449997,
-0.4763237535953522,
-0.6568472385406494,
1.2512401342391968,
-1.0687718391418457,
-0.031887855380773544,
-0.7349098324775696,
0.86501544713974,
... |
func (v *Vault) ListTransitKeys() {
d, err := v.Client.Logical().List("transit/keys")
if err != nil {
log.Fatalf("Vault error: %v", err)
}
if d != nil {
table := tablewriter.NewWriter(os.Stdout)
table.SetHeader([]string{"Key"})
for _, l := range d.Data["keys"].([]interface{}) {
table.Append([]string{l.(... | [
-0.3337066173553467,
0.15333639085292816,
0.38041549921035767,
-1.246600866317749,
0.05321715027093887,
-1.3820868730545044,
-0.303310751914978,
-0.045276250690221786,
-0.47948911786079407,
1.4241275787353516,
-0.6988741755485535,
0.7710587978363037,
-0.5328351855278015,
0.8906428813934326... |
func (v *Vault) DeleteTransitKey(key string) {
p := make(map[string]interface{})
p["deletion_allowed"] = "true"
_, err := v.Client.Logical().Write("transit/keys/"+key+"/config", p)
if err != nil {
log.Fatalf("Vault error: %v", err)
}
_, err = v.Client.Logical().Delete("transit/keys/" + key)
if err != nil {
... | [
-0.36323490738868713,
0.13736705482006073,
0.4555215835571289,
-0.510807991027832,
0.024813499301671982,
-0.06771980971097946,
-0.00033823284320533276,
0.33067551255226135,
0.15295103192329407,
1.59050714969635,
-0.619756281375885,
0.2606854736804962,
-0.535530149936676,
0.7940987348556519... |
func (v *Vault) ListSecrets() {
log.Debugf("Listing secrets in Vault KV Path: %v", s.VaultKVPath())
d, err := v.Client.Logical().List(s.VaultKVPath())
if err != nil {
log.Fatalf("Vault error: %v", err)
}
table := tablewriter.NewWriter(os.Stdout)
table.SetHeader([]string{"Key"})
for _, l := range d.Data["keys"... | [
-0.017117787152528763,
-0.32159915566444397,
0.3756249248981476,
0.06079176440834999,
0.05278155580163002,
-0.5882224440574646,
-1.1475999355316162,
-0.1995621621608734,
-0.3402884900569916,
0.3779906630516052,
0.15228042006492615,
1.4292116165161133,
0.6325076222419739,
0.5994248986244202... |
func (v *Vault) Status() {
vh, err := v.Client.Sys().Health()
fmt.Println("[VAULT]")
if err != nil {
log.Fatalf("Vault error: %v", err)
}
listPath := s.VaultKVPath()
if s.VaultKVVersion() == 2 {
listPath = s.VaultKVPath() + "metadata"
}
d, err := v.Client.Logical().List(listPath)
if err != nil {
log.Fa... | [
0.312499076128006,
-0.7836605906486511,
0.5452443361282349,
0.05381885543465614,
0.05595460534095764,
0.028110411018133163,
-0.6259072422981262,
0.4173585772514343,
-0.45876890420913696,
0.5005457997322083,
-0.03229328989982605,
1.0306376218795776,
0.620650053024292,
0.8621568083763123,
... |
func (v *Vault) Cipher(value string) string {
s5Engine := s5Vault.Client{
Client: v.Client,
Config: &s5Vault.Config{
Key: s.Vault.TransitKey,
},
}
cipheredValue, err := s5Engine.Cipher(value)
if err != nil {
log.Fatal(err)
}
return s5.GenerateOutput(cipheredValue)
} | [
0.22835159301757812,
0.09835188835859299,
0.2964021861553192,
0.05501461401581764,
-0.7919524908065796,
0.14997254312038422,
0.08724463731050491,
-1.2559810876846313,
-0.008534622378647327,
1.2256574630737305,
0.16759337484836578,
0.004118611570447683,
0.08040887862443924,
0.26198852062225... |
func (v *Vault) Decipher(value string) string {
s5Engine := s5Vault.Client{
Client: v.Client,
Config: &s5Vault.Config{
Key: s.Vault.TransitKey,
},
}
parsedInput, err := s5.ParseInput(value)
if err != nil {
log.Fatal(err)
}
decipheredValue, err := s5Engine.Decipher(parsedInput)
if err != nil {
log.... | [
0.3167976438999176,
0.00197806628420949,
0.6284846663475037,
-0.014796248637139797,
-0.8983981013298035,
0.10568982362747192,
-0.1184406653046608,
-0.028176987543702126,
-0.1784297674894333,
0.21297229826450348,
-0.45163410902023315,
-1.0954562425613403,
-0.016497140750288963,
0.3626966178... |
func (v *Vault) WriteSecret(secret string, data map[string]interface{}) {
queryPath := s.VaultKVPath() + secret
var payload map[string]interface{}
if s.Vault.KV.Version == 2 {
queryPath = s.VaultKVPath() + "data/" + secret
payload = make(map[string]interface{})
payload["data"] = data
} else {
payload = data... | [
-0.27458062767982483,
-0.591020405292511,
0.6777750253677368,
-0.10222034901380539,
0.3592958450317383,
-0.053991276770830154,
-1.3405274152755737,
-0.07626106590032578,
-0.02903485856950283,
-0.09143402427434921,
-0.9295865893363953,
0.49009525775909424,
-0.1989843100309372,
0.35577431321... |
func (v *Vault) DeleteSecret(secret string) {
_, err := v.Client.Logical().Delete(s.VaultKVPath() + secret)
if err != nil {
log.Fatalf("Vault error: %v", err)
}
color.Green("=> Deleted secret '%v' and its underlying keys", secret)
} | [
0.9107087254524231,
-0.4315766990184784,
0.3443237245082855,
-0.23313367366790771,
-0.009049947373569012,
0.033637430518865585,
-0.9425978064537048,
-0.2783353626728058,
0.17342621088027954,
-0.07972623407840729,
-1.0787074565887451,
0.4308699369430542,
0.34184467792510986,
0.3894212543964... |
func (v *Vault) DeleteSecretKey(secret, key string) {
// TODO: Implement!
color.Yellow("=> [NOT IMPLEMENTED] - Deleted secret:key %v:%v", secret, key)
} | [
0.8361422419548035,
-0.4642059803009033,
0.41210228204727173,
0.6198024153709412,
0.670474648475647,
-0.6987383961677551,
-0.6770070791244507,
0.08560363948345184,
0.341639906167984,
0.5428833961486816,
-1.2393134832382202,
1.0881224870681763,
0.2430710792541504,
0.858944833278656,
0.069... |
func (api *API) GetAccountHistory(ctx context.Context, account string, from, limit int32) (AccountHistory, error) {
resp := make(AccountHistory, 0)
err := api.call(ctx, "get_account_history", []interface{}{account, from, limit}, &resp)
return resp, err
} | [
-0.16578377783298492,
1.3389613628387451,
0.6920672655105591,
0.4807039499282837,
-0.09081519395112991,
-0.6437763571739197,
0.6738470196723938,
-0.22105009853839874,
0.4603516757488251,
-0.5542844533920288,
-0.17348790168762207,
1.3835927248001099,
-0.03425512835383415,
-0.766575932502746... |
func (api *API) GetAccountScrToScrTransfers(ctx context.Context, account string, from, limit int32) (AccountHistory, error) {
resp := make(AccountHistory, 0)
err := api.call(ctx, "get_account_scr_to_scr_transfers", []interface{}{account, from, limit}, &resp)
return resp, err
} | [
0.17355065047740936,
0.9115920662879944,
0.5938700437545776,
-0.16016966104507446,
-0.08974359929561615,
-0.8003286123275757,
0.21694031357765198,
-0.7481970191001892,
0.4637201428413391,
-0.24487334489822388,
-0.01261277124285698,
1.3117458820343018,
-0.13498523831367493,
-0.4398719668388... |
func ConnectionStatusPUnknown() *ConnectionStatus {
v := ConnectionStatusVUnknown
return &v
} | [
0.3781158924102783,
-0.38329267501831055,
0.1832694262266159,
-0.24383260309696198,
-0.18161042034626007,
-0.363069087266922,
-0.5306053757667542,
0.11975764483213425,
-0.301689088344574,
-0.741581916809082,
-0.17307378351688385,
-0.5031378865242004,
0.3991583287715912,
-0.1906833648681640... |
func ConnectionStatusPAttempted() *ConnectionStatus {
v := ConnectionStatusVAttempted
return &v
} | [
0.3685913383960724,
-0.34165918827056885,
0.24444493651390076,
-0.6623553037643433,
-0.09895718097686768,
0.6741682887077332,
-0.5087234377861023,
-0.3257237374782562,
0.42186975479125977,
0.4836450517177582,
-0.4433889091014862,
-0.9747374057769775,
-0.19142019748687744,
-0.46765103936195... |
func ConnectionStatusPSucceeded() *ConnectionStatus {
v := ConnectionStatusVSucceeded
return &v
} | [
0.8533499836921692,
-0.32250985503196716,
0.2484624683856964,
0.39665400981903076,
-0.5787394642829895,
0.9324733018875122,
-1.1345781087875366,
0.5261825323104858,
0.34929922223091125,
-0.08408880978822708,
-0.2173268049955368,
-1.6012210845947266,
0.2659415900707245,
-0.6778554916381836,... |
func ConnectionStatusPBlocked() *ConnectionStatus {
v := ConnectionStatusVBlocked
return &v
} | [
0.7291997075080872,
-0.005700686480849981,
0.4099561870098114,
1.480362057685852,
-0.14962983131408691,
1.1675554513931274,
-0.3074297308921814,
-0.10285361856222153,
-0.16345137357711792,
-0.22032582759857178,
-0.066322460770607,
-1.1647900342941284,
-0.9582619667053223,
0.012281393632292... |
func ConnectionStatusPFailed() *ConnectionStatus {
v := ConnectionStatusVFailed
return &v
} | [
0.7252642512321472,
0.18463833630084991,
-0.1009453758597374,
0.11978026479482651,
-0.5650501251220703,
0.21458502113819122,
-1.1219831705093384,
-0.5288423299789429,
-0.5337406992912292,
-0.7439688444137573,
-0.26302820444107056,
-0.8910092115402222,
-0.23997868597507477,
0.32441690564155... |
func ConnectionStatusPUnknownFutureValue() *ConnectionStatus {
v := ConnectionStatusVUnknownFutureValue
return &v
} | [
0.06633006781339645,
0.27729707956314087,
0.09145823121070862,
-0.07678764313459396,
-0.6352911591529846,
-0.7438985705375671,
-0.6914237141609192,
0.1071891263127327,
-0.5793024301528931,
-0.9398584961891174,
0.19895245134830475,
-0.49895647168159485,
0.5132904052734375,
0.100134909152984... |
func warnParams(len int, cap string) (complex64 complex128) {
return 0
} | [
-0.7211761474609375,
-0.09295099973678589,
0.3113299608230591,
0.31919732689857483,
0.4643390476703644,
-0.004186844453215599,
0.6941643953323364,
-0.3994266390800476,
-0.018961502239108086,
0.25434547662734985,
-0.20507308840751648,
0.7092925310134888,
-0.6866132020950317,
-0.024038413539... |
func (bool shadower) shadowThem() {} | [
0.24251766502857208,
0.373538613319397,
0.26154807209968567,
1.150116205215454,
-0.427713006734848,
0.47817671298980713,
1.6874865293502808,
0.9216755032539368,
0.16066046059131622,
-0.25581613183021545,
-0.850412905216217,
0.10277725011110306,
0.0769636482000351,
0.20903897285461426,
-0... |
func RequestPathHandler(w http.ResponseWriter, req *http.Request) {
path := filepath.Join(webDir, req.URL.Path)
log.Println("Serving file:", path)
//do not show directories
fi, err := os.Stat(path)
if os.IsNotExist(err) {
log.Println("[FileHandler] error path does not exist:", err)
http.NotFound(w, req)
r... | [
-0.337093710899353,
-0.575161874294281,
0.564980149269104,
0.8307543992996216,
-0.03710293769836426,
1.2653696537017822,
1.3958271741867065,
-0.05260234698653221,
-0.27356210350990295,
-0.11865188926458359,
0.790547788143158,
-0.49638742208480835,
-0.6130768656730652,
1.046194076538086,
... |
func (m *Metadata) ToJSON() (string, error) {
jsonData, err := json.Marshal(m)
if err != nil {
return "", errors.Wrap(err, "marshal repository")
}
return string(jsonData), nil
} | [
-0.29551002383232117,
-0.0889953151345253,
0.45377954840660095,
-0.2487962692975998,
-0.11743295192718506,
0.10612983256578445,
-0.3055211007595062,
-0.17385105788707733,
0.30630338191986084,
1.3510923385620117,
-0.22038748860359192,
0.7874042391777039,
-0.15739285945892334,
-0.46229723095... |
func (m *Metadata) FromJSON(jsonData string) error {
if len(jsonData) == 0 {
return errors.New("empty json data to construct repository")
}
return json.Unmarshal([]byte(jsonData), m)
} | [
-0.6817161440849304,
-0.02122795768082142,
0.34311455488204956,
-1.2414389848709106,
-0.7081922292709351,
0.29194173216819763,
-0.976768970489502,
0.5543205142021179,
0.28638115525245667,
0.4232327938079834,
-0.26791912317276,
0.42446213960647583,
-0.06488100439310074,
-0.20785753428936005... |
func NewMockDirStore(ctrl *gomock.Controller) *MockDirStore {
mock := &MockDirStore{ctrl: ctrl}
mock.recorder = &MockDirStoreMockRecorder{mock}
return mock
} | [
-0.655212938785553,
0.2855750322341919,
0.3017331063747406,
-0.06505153328180313,
-0.6148757934570312,
-0.373227596282959,
0.9055556058883667,
-0.24243904650211334,
0.9326899647712708,
-0.2667848765850067,
-0.5928277373313904,
-0.2554784417152405,
-0.5662459135055542,
0.5107020139694214,
... |
func (m *MockDirStore) EXPECT() *MockDirStoreMockRecorder {
return m.recorder
} | [
-0.3461514115333557,
0.43055540323257446,
0.30963292717933655,
0.08125127106904984,
0.05435342714190483,
-0.12126912921667099,
0.819259762763977,
0.44518688321113586,
1.112868070602417,
-0.6963909864425659,
0.6717279553413391,
0.8713387250900269,
-0.639530599117279,
0.0038913548924028873,
... |
func (m *MockDirStore) Lookup(arg0, arg1, arg2 string) (buildpack.Descriptor, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Lookup", arg0, arg1, arg2)
ret0, _ := ret[0].(buildpack.Descriptor)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
-0.9402104020118713,
0.1056603416800499,
0.37544962763786316,
0.17889605462551117,
0.7011123299598694,
0.3476077914237976,
0.9961398243904114,
0.14006099104881287,
-0.23831675946712494,
-0.1635611355304718,
-0.34732872247695923,
-0.28815287351608276,
-0.17947368323802948,
0.222103238105773... |
func (mr *MockDirStoreMockRecorder) Lookup(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Lookup", reflect.TypeOf((*MockDirStore)(nil).Lookup), arg0, arg1, arg2)
} | [
-0.6994551420211792,
0.5588664412498474,
0.3196912705898285,
0.019273856654763222,
-0.0401790589094162,
0.34508195519447327,
0.1706807017326355,
-0.6613281965255737,
0.6440703868865967,
0.46632227301597595,
0.578835666179657,
0.6229305863380432,
-0.5563778281211853,
0.3537167012691498,
0... |
func (m *MockDirStore) LookupBp(arg0, arg1 string) (*buildpack.BpDescriptor, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "LookupBp", arg0, arg1)
ret0, _ := ret[0].(*buildpack.BpDescriptor)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
0.319029837846756,
-0.021316658705472946,
0.49903035163879395,
0.06106264889240265,
0.8741934895515442,
0.8494213819503784,
1.1865311861038208,
-0.4151557683944702,
-0.2503925859928131,
0.09078490734100342,
-0.7340525984764099,
-0.2945218086242676,
-1.0066217184066772,
0.8532553315162659,
... |
func (mr *MockDirStoreMockRecorder) LookupBp(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LookupBp", reflect.TypeOf((*MockDirStore)(nil).LookupBp), arg0, arg1)
} | [
0.3070836067199707,
0.6420535445213318,
0.5062839388847351,
-0.11915400624275208,
0.22141538560390472,
0.8445960879325867,
0.23713353276252747,
-0.8619429469108582,
0.4912894070148468,
1.1748231649398804,
0.2180018275976181,
0.1439751386642456,
-1.3850065469741821,
0.8421963453292847,
0.... |
func (m *MockDirStore) LookupExt(arg0, arg1 string) (*buildpack.ExtDescriptor, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "LookupExt", arg0, arg1)
ret0, _ := ret[0].(*buildpack.ExtDescriptor)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
-0.3143952488899231,
0.0521407313644886,
0.3324885964393616,
0.1268012672662735,
0.11203763633966446,
0.380393385887146,
0.10732154548168182,
-0.15116822719573975,
-0.24454504251480103,
-0.2550874948501587,
-1.0759403705596924,
-0.2682787775993347,
-0.442383736371994,
1.116724967956543,
... |
func (mr *MockDirStoreMockRecorder) LookupExt(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LookupExt", reflect.TypeOf((*MockDirStore)(nil).LookupExt), arg0, arg1)
} | [
-0.3695460557937622,
0.9136190414428711,
0.3723403811454773,
-0.28875574469566345,
-0.5582539439201355,
0.5134945511817932,
-0.7094927430152893,
-0.48490074276924133,
0.7344722747802734,
0.5365985631942749,
-0.19511383771896362,
0.5830394625663757,
-0.9971376657485962,
0.9729728698730469,
... |
func (ut *createLinkPayload) Validate() (err error) {
if ut.Path == nil {
err = goa.MergeErrors(err, goa.MissingAttributeError(`response`, "path"))
}
if ut.URL == nil {
err = goa.MergeErrors(err, goa.MissingAttributeError(`response`, "url"))
}
if ut.Path != nil {
if utf8.RuneCountInString(*ut.Path) < 6 {
... | [
0.15663771331310272,
-0.6067514419555664,
0.674776554107666,
-1.145527958869934,
0.29229721426963806,
0.22096337378025055,
0.08793308585882187,
-0.8275736570358276,
0.14540733397006989,
-1.0970244407653809,
0.4687533378601074,
-0.3365023136138916,
-0.2799660563468933,
0.16264906525611877,
... |
func (ut *createLinkPayload) Publicize() *CreateLinkPayload {
var pub CreateLinkPayload
if ut.Path != nil {
pub.Path = *ut.Path
}
if ut.URL != nil {
pub.URL = *ut.URL
}
return &pub
} | [
-0.10654817521572113,
-0.12188632041215897,
0.27486830949783325,
-0.9387356042861938,
0.49642303586006165,
0.3655521273612976,
-0.4204041659832001,
-0.06034735590219498,
0.25465235114097595,
-0.9681128263473511,
0.6591976284980774,
0.7242076992988586,
-0.6643055081367493,
0.571179330348968... |
func (ut *CreateLinkPayload) Validate() (err error) {
if ut.Path == "" {
err = goa.MergeErrors(err, goa.MissingAttributeError(`response`, "path"))
}
if ut.URL == "" {
err = goa.MergeErrors(err, goa.MissingAttributeError(`response`, "url"))
}
if utf8.RuneCountInString(ut.Path) < 6 {
err = goa.MergeErrors(err,... | [
0.1122012734413147,
-0.5988210439682007,
0.7108485102653503,
-1.1868771314620972,
0.17184102535247803,
0.3012763559818268,
0.05917136371135712,
-0.7966373562812805,
0.12108432501554489,
-1.0678496360778809,
0.4343777596950531,
-0.242606058716774,
-0.390011191368103,
0.05929458141326904,
... |
func (ut *updateLinkPayload) Validate() (err error) {
if ut.Path == nil {
err = goa.MergeErrors(err, goa.MissingAttributeError(`response`, "path"))
}
if ut.URL == nil {
err = goa.MergeErrors(err, goa.MissingAttributeError(`response`, "url"))
}
if ut.Path != nil {
if utf8.RuneCountInString(*ut.Path) < 6 {
... | [
-0.18124406039714813,
-0.8788078427314758,
0.7588475346565247,
-1.0464963912963867,
-0.2088821679353714,
0.06409303843975067,
-0.09309861063957214,
-0.4143196940422058,
0.14793922007083893,
-0.8333052396774292,
0.42000794410705566,
-0.2388565093278885,
-0.27493131160736084,
0.0304693933576... |
func (ut *updateLinkPayload) Publicize() *UpdateLinkPayload {
var pub UpdateLinkPayload
if ut.Path != nil {
pub.Path = *ut.Path
}
if ut.URL != nil {
pub.URL = *ut.URL
}
return &pub
} | [
-0.49104833602905273,
-0.5928188562393188,
0.37643489241600037,
-0.7837814092636108,
-0.19432513415813446,
0.027486808598041534,
-0.640289843082428,
0.37004002928733826,
0.37208232283592224,
-0.4748065769672394,
0.8097941279411316,
0.7583317756652832,
-0.5598053336143494,
0.392186820507049... |
func (ut *UpdateLinkPayload) Validate() (err error) {
if ut.Path == "" {
err = goa.MergeErrors(err, goa.MissingAttributeError(`response`, "path"))
}
if ut.URL == "" {
err = goa.MergeErrors(err, goa.MissingAttributeError(`response`, "url"))
}
if utf8.RuneCountInString(ut.Path) < 6 {
err = goa.MergeErrors(err,... | [
-0.24175624549388885,
-0.8541848659515381,
0.794417142868042,
-1.078076958656311,
-0.3633613586425781,
0.09886469691991806,
-0.11298731714487076,
-0.3796932101249695,
0.13016103208065033,
-0.7831894159317017,
0.39332300424575806,
-0.10349645465612411,
-0.3565320372581482,
-0.11185066401958... |
func TestProposalBuffer(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)
ctx := context.Background()
var p testProposer
var b propBuf
var pc proposalCreator
clock := hlc.NewClock(hlc.UnixNano, time.Nanosecond)
b.Init(&p, tracker.NewLockfreeTracker(), clock, cluster.MakeTestingClusterSe... | [
-0.2714150846004486,
0.6775285005569458,
0.8254951238632202,
-0.07833996415138245,
0.47556251287460327,
0.9319800734519958,
0.42330724000930786,
-0.13850495219230652,
0.152054563164711,
-0.14759324491024017,
-0.565636157989502,
-0.08388974517583847,
-1.5998519659042358,
0.24379226565361023... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.