text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (i *TagsModel) Get() (err error) {
if i.Ib == 0 || i.Page == 0 {
return e.ErrNotFound
}
// Initialize response header
response := TagsType{}
// tags slice
tags := []Tags{}
// Initialize struct for pagination
paged := u.PagedResponse{}
// Set current page to parameter
paged.CurrentPage = i.Page
// ... | [
0.04899002984166145,
0.21065829694271088,
1.00421142578125,
-0.3860367238521576,
0.9598996639251709,
-0.7385608553886414,
-0.006059871520847082,
-0.5922072529792786,
-0.9976729154586792,
0.31883832812309265,
0.2012273222208023,
0.09251875430345535,
-0.0075356364250183105,
0.951139748096466... |
func getDockName(plistData plistDataType) string {
// Don't use a dock name, if not configured.
if len(plistData.JavaMacLauncher.DockName) == 0 {
return ""
}
// Get default dock name.
defaultName, isMapContainsKey := plistData.JavaMacLauncher.DockName["default"]
if isMapContainsKey {
defaultName = strings.Tr... | [
0.10935313254594803,
-0.09797648340463638,
0.6663864254951477,
0.5022735595703125,
-1.0802459716796875,
-0.17342506349086761,
0.49557673931121826,
0.46246200799942017,
-0.3271942436695099,
0.02639424055814743,
0.18934428691864014,
0.0539117269217968,
0.13703539967536926,
1.1693534851074219... |
func getDockIcon(plistData plistDataType) string {
return strings.TrimSpace(plistData.JavaMacLauncher.DockIcon)
} | [
0.13226108253002167,
0.19854986667633057,
0.11068080365657806,
0.05187882110476494,
-0.9513360857963562,
0.6540351510047913,
0.2750025987625122,
0.9925217628479004,
-0.17363770306110382,
0.24986736476421356,
-0.91501384973526,
0.674615204334259,
0.43033668398857117,
0.5362322926521301,
0... |
func getJavaHome() string {
var javaHome string
javaHome = getJavaHomeViaEnv()
if !isEmpty(javaHome) {
return javaHome
}
javaHome = getJavaHomeViaLibexec()
if !isEmpty(javaHome) {
return javaHome
}
return ""
} | [
0.3506931960582733,
-0.1686917096376419,
0.6631774306297302,
1.3116706609725952,
0.07519134134054184,
-0.3268280029296875,
0.4302753508090973,
-0.8388895392417908,
0.34585878252983093,
0.870905876159668,
0.7392421364784241,
0.9725610017776489,
-0.7235354781150818,
0.5420016050338745,
0.5... |
func getJavaHomeViaLibexec() string {
out, err := exec.Command("/usr/libexec/java_home").CombinedOutput()
if (err != nil || len(out) == 0) {
return ""
}
return strings.TrimSpace(string(out))
} | [
0.9677516222000122,
-0.6418752074241638,
0.6912090182304382,
0.7611724138259888,
-0.09657420963048935,
-0.060450490564107895,
-0.1807711273431778,
-1.0360417366027832,
-0.04729199409484863,
1.2141337394714355,
0.6475632190704346,
0.6006379127502441,
-0.37756943702697754,
0.2878111898899078... |
func getLanguage() string {
var language string
language = getLanguageViaEnv()
if !isEmpty(language) {
return language
}
language = getLanguageViaObjectiveC()
if !isEmpty(language) {
return language
}
language = getLanguageViaOsascript()
if !isEmpty(language) {
return language
}
return ""
} | [
0.3563891053199768,
0.1541135609149933,
0.5230466723442078,
1.4123094081878662,
0.9238037467002869,
-0.20572414994239807,
-0.03361774608492851,
-0.15329931676387787,
-0.1551014930009842,
-0.0832454264163971,
0.9963192939758301,
0.4599669873714447,
-0.22716300189495087,
1.3683162927627563,
... |
func getLanguageViaObjectiveC() string {
language := objc.Get("NSLocale").Get("preferredLanguages").Get("firstObject").String()
return strings.TrimSpace(language)
} | [
0.6390118598937988,
-0.5628318786621094,
0.6176121234893799,
-0.16720649600028992,
-0.05069040507078171,
-0.15732137858867645,
0.04576454684138298,
-0.43606820702552795,
-0.4438955783843994,
0.2599136233329773,
0.40470144152641296,
0.15252795815467834,
0.519633412361145,
0.5031951069831848... |
func getLanguageViaOsascript() string {
out, err := exec.Command("/usr/bin/osascript", "-e", "user locale of (get system info)").CombinedOutput()
if err != nil || len(out) == 0 {
return ""
}
return strings.TrimSpace(string(out))
} | [
0.29859957098960876,
-0.5581211447715759,
0.42362743616104126,
0.7181551456451416,
-0.552995502948761,
-0.11191992461681366,
0.5090261101722717,
-0.6032758355140686,
0.0408659465610981,
0.42738988995552063,
0.5532019138336182,
0.4323151707649231,
0.38768619298934937,
0.6162049174308777,
... |
func Init(store *store.Store) *Server {
s := &Server{
store: store,
}
s.setupEchoServer()
s.setupEchoMiddleware()
InitUI(s)
InitApis(s)
return s
} | [
-0.8956745862960815,
-0.00016704510198906064,
0.2748846411705017,
0.05220244824886322,
0.23916736245155334,
0.48898276686668396,
-0.23473741114139557,
0.1896696537733078,
0.7916014194488525,
-0.4453471004962921,
-0.5237208604812622,
1.0562020540237427,
0.19057811796665192,
0.65411376953125... |
func main() {
mountain = [5][5]int{
{1, 2, 3, 4, 5},
{16, 17, 18, 19, 6},
{15, 24, 25, 20, 7},
{14, 23, 22, 21, 8},
{13, 12, 11, 10, 9},
}
max := 0
for i := 0; i < 5; i++ {
for j := 0; j < 5; j++ {
path[i][j] = dfs(i, j) + 1
if path[i][j] >= max {
max = path[i][j]
}
}
}
fmt.Printf("the... | [
-0.05620341747999191,
0.8558133244514465,
1.0480809211730957,
0.7205628752708435,
-0.30345889925956726,
-0.8758310079574585,
0.9024150371551514,
-0.3451477587223053,
-0.707938551902771,
-0.037891700863838196,
-0.026843078434467316,
-0.23449435830116272,
-0.26409244537353516,
0.249651506543... |
func GetRow(grid [][]rune, n int) []rune {
return grid[n]
} | [
-0.2262461632490158,
1.162362813949585,
0.34376460313796997,
0.47320517897605896,
0.11064044386148453,
-1.3824328184127808,
-0.35483264923095703,
-0.6279666423797607,
-0.13876649737358093,
-0.04434880241751671,
0.7777290344238281,
1.229738712310791,
0.25579217076301575,
0.9195612668991089,... |
func GetCol(grid [][]rune, n int) []rune {
col := make([]rune, len(grid))
for i := 0; i < len(grid); i++ {
col[i] = grid[i][n]
}
return col
} | [
0.1821644902229309,
0.07311125844717026,
0.6329029202461243,
-0.14208219945430756,
0.664213240146637,
-1.0091453790664673,
0.03354512155056,
-0.784338116645813,
-0.8122171759605408,
0.6455902457237244,
-0.19216734170913696,
0.9436033368110657,
0.2947489619255066,
-0.04663873463869095,
0.... |
func BordersEqual(b1 []rune, b2 []rune) bool {
if len(b1) != len(b2) {
return false
}
for i := 0; i < len(b1); i++ {
if b1[i] != b2[i] {
return false
}
}
return true
} | [
0.4175899624824524,
-0.13164055347442627,
0.7970831990242004,
0.8483242988586426,
0.6241490840911865,
0.36629682779312134,
-0.9172253608703613,
-0.6819180250167847,
-0.06956901401281357,
0.8344556093215942,
-1.5945820808410645,
0.9775089621543884,
-1.4247441291809082,
0.32803425192832947,
... |
func ProviderHasPerUserSecrets(providerName string) (bool, error) {
// For Azure AD, check if it's configured to use the new or old flow. Only the old flow via Azure AD Graph uses per-user secrets.
if providerName == azure.Name {
p, ok := Providers[azure.Name]
if !ok {
return false, fmt.Errorf("error determini... | [
-0.3210065960884094,
0.17759571969509125,
0.5041407346725464,
0.6075761318206787,
-0.8325523734092712,
0.3525591790676117,
0.044541262090206146,
-0.6288617849349976,
0.7224180698394775,
0.6115870475769043,
-0.20487087965011597,
0.24603384733200073,
-0.4176839292049408,
0.6637706160545349,
... |
func newPromExporter(subsystem string) *promExporter {
RequestDurationBucket := []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10, 15, 20, 30, 40, 50, 60}
exporter := &promExporter{
requestCount: prometheus.NewCounterVec(
prometheus.CounterOpts{
Subsystem: subsystem,
Name: "requests_total"... | [
0.02468618005514145,
0.3427276611328125,
0.8858463764190674,
0.567287802696228,
-0.43943700194358826,
-0.068326435983181,
-0.22422254085540771,
0.032310791313648224,
-0.14601260423660278,
-0.21922409534454346,
0.002081001177430153,
0.4620051681995392,
-0.5079522132873535,
0.940286755561828... |
func (e *promExporter) SetupMiddleware(r *fasthttprouter.Router) fasthttp.RequestHandler {
// handle metrics requests
r.GET(prometheusMetricsEndpoint, metricsHandler())
return func(ctx *fasthttp.RequestCtx) {
// record time
start := time.Now()
// handle request
r.Handler(ctx)
// don't record stats for m... | [
-0.2771851718425751,
-0.2959195375442505,
0.8166945576667786,
0.11079160124063492,
-0.04812120646238327,
0.2643362879753113,
0.3801948130130768,
0.19400449097156525,
0.019328579306602478,
0.16661763191223145,
0.9018968939781189,
0.03652725741267204,
-0.5670207142829895,
1.2126497030258179,... |
func metricsHandler() fasthttp.RequestHandler {
return fasthttpadaptor.NewFastHTTPHandler(promhttp.Handler())
} | [
0.4894331097602844,
0.06981854885816574,
0.16555911302566528,
0.5231381058692932,
-0.759932279586792,
0.4192119538784027,
-0.37213265895843506,
0.06468012183904648,
-0.10815175622701645,
-1.1270557641983032,
0.40495210886001587,
-0.7889719009399414,
-0.36873772740364075,
-0.308347374200820... |
func EncodeECDSAPair(privateKey *ecdsa.PrivateKey, publicKey *ecdsa.PublicKey) (string, string) {
x509Encoded, err := x509.MarshalECPrivateKey(privateKey)
if err != nil {
log.Fatal(err)
}
pemEncoded := pem.EncodeToMemory(&pem.Block{Type: "PRIVATE KEY", Bytes: x509Encoded})
x509EncodedPub, err := x509.MarshalPKI... | [
-0.48958101868629456,
0.03298031911253929,
0.6176641583442688,
-0.7299026846885681,
-0.7847881317138672,
0.46358418464660645,
-1.1741526126861572,
-0.5943958163261414,
0.4375748634338379,
0.970207154750824,
0.18684729933738708,
0.7066078186035156,
-0.34610873460769653,
0.8479573130607605,
... |
func TestPr00(t *testing.T) {
const fname = "Pr00"
var dpsipr, depspr float64
tests := []struct {
ref string
fn func(d1, d2 float64) (d3, d4 float64)
}{
{"cgo", CgoPr00},
{"go", GoPr00},
}
for _, test := range tests {
tname := fname + " " + test.ref
dpsipr, depspr = GoPr00(2400000.5, 53736)
vvd(t,... | [
-0.3056301176548004,
0.23373453319072723,
0.5614816546440125,
-0.7098361849784851,
0.5490116477012634,
0.4570832848548889,
0.009206991642713547,
0.22779667377471924,
-0.015248125419020653,
0.2617633044719696,
-0.14058470726013184,
0.36576423048973083,
-0.07951982319355011,
0.53267765045166... |
func ReleaseEncoder(enc *Encoder) []byte {
data := enc.Bytes()
enc.Reset(nil)
encoderPool.Put(enc)
return data
} | [
-0.6228932738304138,
-0.018180638551712036,
0.3403857350349426,
-0.35537514090538025,
-0.770129382610321,
-0.2968686521053314,
-0.29168495535850525,
-0.4622578024864197,
0.23269379138946533,
0.11918507516384125,
-0.629741370677948,
0.9230080842971802,
-0.7643212080001831,
0.652954578399658... |
func (e *Encoder) Reset(buf []byte) {
for k := range e.syms {
delete(e.syms, k)
}
e.buf = buf[:0]
} | [
-0.17442171275615692,
0.06609516590833664,
0.06533290445804596,
-0.20953375101089478,
0.3860829174518585,
-0.4393579363822937,
1.0480941534042358,
0.1962418556213379,
-0.5087968111038208,
0.4193083941936493,
-1.156618356704712,
1.014055848121643,
-0.17433921992778778,
0.770825982093811,
... |
func (e *Encoder) reserve(delta int) []byte {
curLen := len(e.buf)
newLen := delta + len(e.buf)
if newLen <= cap(e.buf) {
e.buf = e.buf[:newLen]
return e.buf[curLen:]
}
newCap := cap(e.buf) * 2
if newCap < 128 {
newCap = 128
}
for newCap < newLen {
newCap *= 2
}
tmp := make([]byte, newCap)
copy(tmp, ... | [
-0.536632776260376,
0.06548800319433212,
0.9083539247512817,
-0.167006254196167,
-0.2094651609659195,
0.0779767781496048,
-0.39644813537597656,
-0.6483168601989746,
0.11700567603111267,
-0.5420300364494324,
-0.3763386011123657,
0.18414980173110962,
-0.928735613822937,
-0.23181119561195374,... |
func (e *Encoder) Write(data []byte) (int, error) {
n := len(data)
copy(e.reserve(n), data)
return n, nil
} | [
-1.5983390808105469,
1.1058300733566284,
0.523428738117218,
-0.25598806142807007,
0.3617458939552307,
-0.2559753656387329,
0.6326839923858643,
0.6498706340789795,
0.575953483581543,
0.170132577419281,
-1.462453842163086,
0.030873043462634087,
-1.236881971359253,
0.6399593353271484,
0.831... |
func (e *Encoder) write(data []byte) {
copy(e.reserve(len(data)), data)
} | [
-1.1011735200881958,
0.6852188110351562,
0.18084299564361572,
0.010791167616844177,
0.9221770763397217,
0.7063279747962952,
-0.11383276432752609,
0.7003884315490723,
0.6917510032653809,
0.28413474559783936,
-1.1530815362930298,
0.24068155884742737,
-0.8349791169166565,
0.8388440608978271,
... |
func (e *Encoder) Len() int { return len(e.buf) } | [
0.33684173226356506,
-0.37104442715644836,
0.10595100373029709,
-0.15022696554660797,
0.32214266061782837,
-0.5297975540161133,
1.2000881433486938,
0.9503268599510193,
-0.23751120269298553,
-0.6797080636024475,
-1.8670262098312378,
0.14977264404296875,
0.2432343065738678,
0.761637151241302... |
func (e *Encoder) PutGOB(val interface{}) {
gobe := gob.NewEncoder(e)
if err := gobe.Encode(val); err != nil {
log.Panicf("gob: failed to encode %v: %v", val, err)
}
} | [
0.06594791263341904,
0.9587810039520264,
0.6543495655059814,
0.19427594542503357,
0.23706507682800293,
0.6171494722366333,
-0.4844723343849182,
-0.47725367546081543,
-0.3211664855480194,
1.2783547639846802,
-0.5079167485237122,
0.5008729696273804,
-1.0789891481399536,
0.464684396982193,
... |
func (e *Encoder) PutVarint(v int64) {
n := binary.PutVarint(e.tmp[:], v)
e.write(e.tmp[0:n])
} | [
0.21965749561786652,
0.47144755721092224,
0.33091384172439575,
-0.559238612651825,
-0.2750627398490906,
0.1002890095114708,
0.32144635915756226,
-0.4954712390899658,
0.0022219556849449873,
0.7031957507133484,
-1.202531099319458,
0.23821024596691132,
-0.86822909116745,
0.6995473504066467,
... |
func (e *Encoder) PutHash(h hash.Hash) {
e.write(h[:])
} | [
0.3300429880619049,
0.5099170207977295,
0.18436291813850403,
0.7669432759284973,
0.4551340937614441,
0.8776480555534363,
0.3293691873550415,
0.13360930979251862,
-0.2600368857383728,
0.04011872783303261,
-0.8115643262863159,
0.921088695526123,
-0.7712902426719666,
1.0429688692092896,
0.9... |
func (e *Encoder) PutUint64(v uint64) {
binary.LittleEndian.PutUint64(e.tmp[:8], v)
e.write(e.tmp[:8])
} | [
-0.3950248658657074,
0.6812688708305359,
0.29459938406944275,
-0.7087206244468689,
0.7317475080490112,
0.03824731707572937,
0.4199717938899994,
0.1034301370382309,
0.34185492992401123,
0.22607390582561493,
-0.6702147722244263,
-0.17004379630088806,
-0.11549267172813416,
0.5757307410240173,... |
func (e *Encoder) PutByte(b byte) {
buf := e.reserve(1)
buf[0] = b
} | [
-0.18249393999576569,
1.4196988344192505,
0.35708126425743103,
0.1906302571296692,
0.8929175734519958,
0.59095299243927,
0.5336360931396484,
0.18018297851085663,
0.3294280469417572,
-0.10240758955478668,
-0.5090174078941345,
0.5248308181762695,
-1.8619047403335571,
0.5713410377502441,
0.... |
func (e *Encoder) PutBool(b bool) {
if b {
e.PutByte(1)
return
}
e.PutByte(0)
} | [
-0.23172879219055176,
1.6383808851242065,
0.595697820186615,
0.49741336703300476,
0.6813446879386902,
0.4385952651500702,
0.5244373679161072,
0.413084477186203,
0.1770993322134018,
1.0456316471099854,
-0.7947840094566345,
0.32744142413139343,
-0.764002799987793,
0.3035617470741272,
0.323... |
func (e *Encoder) PutRawBytes(data []byte) {
e.write(data)
} | [
-0.8903193473815918,
0.9944921731948853,
0.35246095061302185,
-1.4173394441604614,
-0.5310036540031433,
0.5276438593864441,
0.4016788601875305,
0.4328429698944092,
0.6745705008506775,
0.24412724375724792,
-1.5675400495529175,
-0.000950634537730366,
-0.4919400215148926,
1.235665202140808,
... |
func (e *Encoder) PutBytes(data []byte) {
e.PutVarint(int64(len(data)))
e.write(data)
} | [
-0.7131937742233276,
1.164501428604126,
0.1497824788093567,
-0.8297637104988098,
0.2635479271411896,
-0.12799569964408875,
0.4453096091747284,
0.6104000806808472,
0.46081918478012085,
0.16891591250896454,
-0.7993749976158142,
0.1264570653438568,
-0.9957790374755859,
1.133752703666687,
0.... |
func (e *Encoder) PutString(data string) {
e.PutBytes(unsafe.StringToBytes(data))
} | [
-0.3708670437335968,
0.9626374840736389,
0.16385839879512787,
-0.840334951877594,
-0.09640837460756302,
0.4295177459716797,
-0.16573764383792877,
-0.2541668117046356,
0.14195339381694794,
0.1226692870259285,
-0.7836785912513733,
0.21770839393138885,
-0.5321422219276428,
0.15662643313407898... |
func (e *Encoder) PutSymbol(id string) {
if e.syms == nil {
e.syms = make(map[string]int64)
}
v, ok := e.syms[id]
if ok {
e.PutVarint(v)
} else {
v = int64(len(e.syms)) + 1
e.syms[id] = v
e.PutVarint(-v)
e.PutString(id)
}
} | [
-0.88934725522995,
0.8881304264068604,
0.47943270206451416,
-0.7381771802902222,
0.0028451145626604557,
-0.631830632686615,
0.5881690979003906,
-0.292560338973999,
0.5329278111457825,
-0.019859161227941513,
-1.561018943786621,
0.7971293330192566,
-0.022788304835557938,
0.7310470342636108,
... |
func (e *Encoder) Bytes() []byte { return e.buf } | [
-0.12564896047115326,
-0.4389035105705261,
0.2047288715839386,
0.222900390625,
0.31527337431907654,
0.6790865063667297,
-0.281404584646225,
-0.04474405571818352,
0.2323315441608429,
-0.9757161736488342,
-0.7814061045646667,
0.9942954778671265,
-0.12535423040390015,
1.1137738227844238,
0.... |
func NewDecoder(data []byte) *Decoder {
dec := decoderPool.Get().(*Decoder)
dec.Reset(data)
return dec
} | [
0.19923804700374603,
-0.8599514365196228,
-0.1223590299487114,
-0.2897540330886841,
-0.5221250653266907,
-0.10440966486930847,
-0.5672957301139832,
-0.6552932858467102,
0.12403281033039093,
-0.7941022515296936,
-0.27557143568992615,
0.6661838293075562,
-0.45309868454933167,
1.2319755554199... |
func ReleaseDecoder(dec *Decoder) {
if dec.buf.Len() != 0 {
panic("marshal.Decoder: found trailing junk")
}
decoderPool.Put(dec)
} | [
0.13144280016422272,
1.2427113056182861,
0.5044354796409607,
-1.4256153106689453,
-0.5748076438903809,
0.131750226020813,
-0.37857645750045776,
-0.4153004586696625,
0.2987404465675354,
-0.6821724772453308,
-0.273031085729599,
0.43713730573654175,
-0.2437337338924408,
1.1603970527648926,
... |
func (d *Decoder) Byte() byte {
b, err := d.buf.ReadByte()
if err != nil {
panic("unmarshalByte")
}
return b
} | [
0.3734416663646698,
0.35148486495018005,
0.5080209374427795,
0.1997041255235672,
-0.13029751181602478,
0.20068688690662384,
0.36508244276046753,
-0.37748298048973083,
-0.16653482615947723,
-0.9427260160446167,
0.5359240770339966,
0.3248818516731262,
-0.43761661648750305,
-0.2457285374403,
... |
func (d *Decoder) Bool() bool {
b := d.Byte()
return b != 0
} | [
0.12578001618385315,
-0.038870710879564285,
0.34551921486854553,
0.09267528355121613,
-0.05714840441942215,
0.3014131188392639,
0.0484718382358551,
1.3402034044265747,
-0.02227811887860298,
-0.7743406891822815,
-0.724608838558197,
-0.1259610652923584,
0.2325793355703354,
0.2721052467823028... |
func (d *Decoder) Varint() int64 {
n, err := binary.ReadVarint(d.buf)
if err != nil {
panic("unmarshalVarint")
}
return n
} | [
0.9140312671661377,
-0.1417485773563385,
0.21922536194324493,
-0.64113450050354,
-0.6740256547927856,
-0.2575927972793579,
-0.3909580409526825,
-0.7372025847434998,
-0.4472028911113739,
-1.129189372062683,
-0.0019798451103270054,
0.029064524918794632,
-0.5375421047210693,
-0.47513422369956... |
func (d *Decoder) Uint64() uint64 {
data := d.tmp[:8]
n, err := d.buf.Read(data)
if n < 8 || err != nil {
panic("unmarshalUint64")
}
return binary.LittleEndian.Uint64(data)
} | [
-0.1524858921766281,
0.36792775988578796,
0.5258772373199463,
-0.2411891520023346,
0.11640176922082901,
-0.28507012128829956,
-0.126752570271492,
0.014941034838557243,
0.05640452355146408,
-1.0256986618041992,
0.7126870155334473,
-0.5712187886238098,
-0.024504195898771286,
-0.0388657972216... |
func (d *Decoder) GOB(val interface{}) {
gobd := gob.NewDecoder(d.buf)
if err := gobd.Decode(val); err != nil {
log.Panicf("gob: failed to decode: %v", err)
}
} | [
0.5431802868843079,
0.5805748105049133,
0.660885751247406,
0.2452847808599472,
0.261922687292099,
0.419723242521286,
-0.8930932879447937,
-0.41788578033447266,
-0.12624232470989227,
0.3133748769760132,
-0.3209182620048523,
0.5779964327812195,
-0.19237659871578217,
-0.040976088494062424,
... |
func (d *Decoder) Bytes() []byte {
n := d.Varint()
if n == 0 {
return nil
}
data := make([]byte, n)
nn, err := d.buf.Read(data)
if int64(nn) != n || err != nil {
log.Panicf("unmarshalBytes: %d %d %v", n, nn, err)
}
return data
} | [
-0.27153700590133667,
0.4288473129272461,
0.3559146225452423,
-0.45049506425857544,
-0.20388342440128326,
-0.8572602272033691,
-0.8358508944511414,
-0.7030174732208252,
0.45352160930633545,
-1.359736680984497,
-0.27169883251190186,
0.269929975271225,
-0.23516961932182312,
0.120124071836471... |
func (d *Decoder) String() string {
data := d.Bytes()
return unsafe.BytesToString(data)
} | [
-0.19821222126483917,
-0.5253276228904724,
-0.25041013956069946,
-0.7915321588516235,
-0.725124716758728,
0.15720811486244202,
-0.10411591827869415,
-0.9925965070724487,
-0.08815223723649979,
-0.7849729061126709,
-0.5920491218566895,
0.44372525811195374,
-0.2200588881969452,
0.069788850843... |
func (d *Decoder) Symbol() string {
if d.syms == nil {
d.syms = make(map[int64]string)
}
v := d.Varint()
if v < 0 {
v = -v
d.syms[v] = d.String()
}
id, ok := d.syms[v]
if !ok {
log.Panicf("name for symbol %d not defined in stream", v)
}
return id
} | [
-1.1168216466903687,
0.2650904059410095,
0.31503981351852417,
-0.08697762340307236,
-0.41541925072669983,
-0.9698718786239624,
0.9448145627975464,
-0.580112099647522,
0.4620518982410431,
-0.14807972311973572,
-0.8358030915260315,
0.7147492170333862,
0.47940677404403687,
1.034773349761963,
... |
func (d *Decoder) Len() int { return d.buf.Len() } | [
0.1569472700357437,
0.18552085757255554,
0.05331609770655632,
-0.9436854720115662,
-0.07295726984739304,
-0.9500510096549988,
0.8271461129188538,
0.8848353028297424,
-0.2561289370059967,
-1.6808735132217407,
-2.069002628326416,
0.37385067343711853,
0.7215421795845032,
0.5341894626617432,
... |
func (d *Decoder) RawBytes(data []byte) {
n, err := d.buf.Read(data)
if n != len(data) || err != nil {
log.Panicf("Decoder.RawBytes: %d %d %v", n, len(data), err)
}
} | [
-0.3748176097869873,
0.6777656078338623,
0.2626892924308777,
-0.47878989577293396,
-1.010324478149414,
-0.3913782238960266,
-0.4095780551433563,
-0.24736849963665009,
0.48830026388168335,
-0.19776414334774017,
-0.8690727353096008,
-0.15841469168663025,
0.2435079663991928,
0.459829717874527... |
func (d *Decoder) Hash() hash.Hash {
var h hash.Hash
d.RawBytes(h[:])
return h
} | [
0.4483954906463623,
0.2731434106826782,
0.24844124913215637,
0.08237955719232559,
-0.639639675617218,
0.2247592806816101,
-0.4969222843647003,
0.3041084110736847,
0.011125876568257809,
-1.5882118940353394,
-0.7103986144065857,
0.9009071588516235,
0.195623978972435,
0.1648353636264801,
0.... |
func CodeAndCase(r rune) (uint16, bool) {
for k, v := range runeMap {
switch {
case r == v.lc:
return k, false
case r == v.uc:
return k, true
}
}
return 0, false
} | [
-0.27343955636024475,
-0.6522766947746277,
0.666131854057312,
-0.3771584928035736,
-0.1337698996067047,
0.20875732600688934,
0.19411443173885345,
-0.10024145245552063,
0.7307240962982178,
0.5021051168441772,
-0.023059161379933357,
-0.2985910475254059,
-0.4492819905281067,
1.285439968109130... |
func date(s string) (time.Time, error) {
date, err := time.Parse(layoutISO, s)
return date, err
} | [
1.0316290855407715,
0.25099262595176697,
0.31191691756248474,
0.45236071944236755,
-1.5532171726226807,
0.1855609267950058,
0.014691794291138649,
-0.14285658299922943,
0.12291756272315979,
-0.04942072927951813,
-0.6535391807556152,
-0.6631854176521301,
-0.20549450814723969,
-0.138198450207... |
func (e *Extractor) Extract(input io.Reader) (types.Subtitles, error) {
subs := make(types.Subtitles, 0)
scanner := bufio.NewScanner(input)
state := 0
lineno := 0
var sub types.Subtitle
for scanner.Scan() {
lineno++
line := scanner.Text()
line = strings.TrimSpace(line)
switch state {
case 0:
// expec... | [
-0.03342331945896149,
-0.4739098846912384,
0.8794018626213074,
0.7178871035575867,
-1.1234341859817505,
-0.2570722997188568,
-0.5742087960243225,
0.2967557907104492,
-0.3501380681991577,
0.2852897644042969,
0.19579806923866272,
0.23849709331989288,
-0.06350023299455643,
0.4589337408542633,... |
func Watch(paths ...string) (*Watcher, error) {
event := make(chan EventItem)
err := watch(paths, event)
if err != nil {
return nil, err
}
return &Watcher{
Event: event,
}, nil
} | [
0.289814293384552,
-0.24639806151390076,
0.4476866126060486,
0.8171355724334717,
0.2563043236732483,
0.26433584094047546,
0.3300940990447998,
0.1801837831735611,
-1.011541724205017,
-0.6347718834877014,
-0.41836926341056824,
0.3067185580730438,
0.1944858878850937,
-0.17924979329109192,
0... |
func (r *reconciler) ensureCRD(ctx context.Context, desired *apiextensionsv1.CustomResourceDefinition) (bool, *apiextensionsv1.CustomResourceDefinition, error) {
name := types.NamespacedName{
Namespace: desired.Namespace,
Name: desired.Name,
}
have, current, err := r.currentCRD(ctx, name)
if err != nil {
... | [
0.30020368099212646,
-0.4118005931377411,
0.9249247908592224,
-0.7725377082824707,
0.2917814552783966,
0.4647534489631653,
-0.6323307752609253,
-0.32970312237739563,
0.3895259201526642,
0.16287346184253693,
0.7706986665725708,
0.42803099751472473,
-0.7653372883796692,
0.21650511026382446,
... |
func (r *reconciler) ensureGatewayAPICRDs(ctx context.Context) error {
var errs []error
for i := range managedCRDs {
// The controller-runtime client mutates its argument, so give
// it a copy of the CRD rather than the original.
crd := managedCRDs[i].DeepCopy()
_, _, err := r.ensureCRD(ctx, crd)
errs = app... | [
0.39690637588500977,
0.12280622124671936,
0.5115106105804443,
-1.2154990434646606,
1.0763534307479858,
-0.4622042179107666,
-0.36448934674263,
-0.7632299661636353,
0.12376756966114044,
0.47280654311180115,
0.7654767036437988,
0.25133058428764343,
-0.9356656670570374,
0.8757096529006958,
... |
func (r *reconciler) currentCRD(ctx context.Context, name types.NamespacedName) (bool, *apiextensionsv1.CustomResourceDefinition, error) {
var crd apiextensionsv1.CustomResourceDefinition
if err := r.client.Get(ctx, name, &crd); err != nil {
if errors.IsNotFound(err) {
return false, nil, nil
}
return false, ... | [
0.3638951778411865,
-0.7189099192619324,
0.7907015085220337,
-1.1963132619857788,
-0.4818641245365143,
-0.11607053875923157,
-0.3086136281490326,
-0.30748578906059265,
0.013344652950763702,
0.49601784348487854,
0.7008506655693054,
0.5543270707130432,
-0.6249085068702698,
0.4001814126968384... |
func (r *reconciler) createCRD(ctx context.Context, desired *apiextensionsv1.CustomResourceDefinition) error {
if err := r.client.Create(ctx, desired); err != nil {
return fmt.Errorf("failed to create CRD %s: %w", desired.Name, err)
}
log.Info("created CRD", "name", desired.Name)
return nil
} | [
0.7795679569244385,
-0.3460904657840729,
0.5776684880256653,
-0.5571746826171875,
0.28619277477264404,
0.9070330858230591,
-0.8354594707489014,
-0.2691095471382141,
-0.1730865240097046,
0.19826748967170715,
0.6668198704719543,
0.5798186659812927,
-1.1325970888137817,
0.031240271404385567,
... |
func (r *reconciler) updateCRD(ctx context.Context, current, desired *apiextensionsv1.CustomResourceDefinition) (bool, error) {
changed, updated := crdChanged(current, desired)
if !changed {
return false, nil
}
// Diff before updating because the client may mutate the object.
diff := cmp.Diff(current, updated, ... | [
-0.39834707975387573,
-0.6380459070205688,
0.9142115116119385,
-0.5747720003128052,
-0.3689156770706177,
0.4050586521625519,
-0.32284197211265564,
-0.23862719535827637,
-0.45408546924591064,
0.2940443158149719,
0.6022346615791321,
0.4693457782268524,
-0.8474324941635132,
0.0022552423179149... |
func crdChanged(current, expected *apiextensionsv1.CustomResourceDefinition) (bool, *apiextensionsv1.CustomResourceDefinition) {
crdCmpOpts := []cmp.Option{
// Ignore fields that the API may have modified.
cmpopts.IgnoreFields(apiextensionsv1.CustomResourceDefinitionSpec{}, "Conversion"),
cmpopts.EquateEmpty(),
... | [
0.2637796700000763,
-0.7477692365646362,
0.8087411522865295,
-0.6935526132583618,
-0.19994552433490753,
0.6109994649887085,
0.43779614567756653,
0.10393336415290833,
-0.07790512591600418,
0.38741281628608704,
-0.017415259033441544,
0.5768551826477051,
0.03325141593813896,
0.071164213120937... |
func New(it *msvc.ProjectIterator) *Graph {
gr := &Graph{
g: simple.NewDirectedGraph(),
allNodes: rbtree.New(),
nextID: 1,
}
it.Foreach(gr.newNode)
ait := rbtree.NewWalkInorder(gr.allNodes)
ait.Foreach(gr.newEdges)
return gr
} | [
-0.530178427696228,
0.006651075556874275,
0.3110058605670929,
-0.08405596762895584,
-0.8718068599700928,
0.6980249285697937,
0.48135408759117126,
-0.2587229311466217,
-0.07112856209278107,
0.24709907174110413,
0.4382627606391907,
0.27658119797706604,
0.07865680009126663,
0.4995221793651581... |
func (gr *Graph) AllPaths() *path.AllShortest {
paths := path.DijkstraAllPaths(gr.g)
return &paths
} | [
1.0009993314743042,
-0.1871197372674942,
0.35854169726371765,
1.4863829612731934,
-0.6802605986595154,
0.5022457242012024,
0.2193884402513504,
-0.020917078480124474,
1.2606505155563354,
-1.0033715963363647,
0.6152932047843933,
0.3101148307323456,
0.07210127264261246,
-0.05119131878018379,
... |
func (gr *Graph) To(n *Node) []*Node {
refs := gr.g.To(n.ID())
nodes := make([]*Node, refs.Len())
i := 0
for refs.Next() {
nodes[i] = refs.Node().(*Node)
i++
}
return nodes
} | [
-1.3483564853668213,
0.845973789691925,
0.540634036064148,
-1.058813452720642,
1.4871604442596436,
-0.3518359065055847,
0.40945208072662354,
-0.309421181678772,
-0.16068492829799652,
1.0181876420974731,
-0.6738239526748657,
1.3589974641799927,
0.423282265663147,
-0.12462886422872543,
-0.... |
func (gr *Graph) Foreach(nodeFn func(n *Node)) {
it := rbtree.NewWalkInorder(gr.allNodes)
it.Foreach(func(cmp rbtree.Comparable) {
nodeFn(cmp.(*Node))
})
} | [
0.4029141366481781,
0.28805673122406006,
0.31781312823295593,
0.33402019739151,
0.7446197271347046,
0.11728627234697342,
1.2197928428649902,
-0.08130617439746857,
-0.7563251852989197,
0.056544527411460876,
0.05114917829632759,
0.40238940715789795,
0.7824584245681763,
1.138299584388733,
-... |
func RunAutoserv(ctx context.Context, m *MainJob, j AutoservJob, w io.Writer) (r *Result, err error) {
if m.UseLocalHostInfo {
if err2 := prepareHostInfo(m.ResultsDir, j); err2 != nil {
return nil, err2
}
defer func() {
if err2 := retrieveHostInfo(m.ResultsDir, j); err2 != nil {
log.Printf("Failed to r... | [
-0.9780660271644592,
-0.39055708050727844,
0.6640570759773254,
0.29886147379875183,
-0.4819054901599884,
-0.2789953649044037,
0.8837316632270813,
-0.07368863373994827,
-0.5183143019676208,
-0.2414892315864563,
-0.2284698486328125,
0.5523565411567688,
-0.4983521103858948,
0.5191664099693298... |
func TKOParse(c autotest.Config, resultsDir string, level int, w io.Writer) (failed int, err error) {
a := &autotest.ParseArgs{
Level: level,
RecordDuration: true,
Reparse: true,
ResultsDir: resultsDir,
SingleDir: true,
SuiteReport: true,
WritePidfile: true,
}
cmd := autot... | [
-0.345041424036026,
-0.30721986293792725,
0.9075684547424316,
-0.21556024253368378,
0.32027244567871094,
-0.23986497521400452,
1.0384092330932617,
0.9016691446304321,
-0.4979637861251831,
-0.23099221289157867,
0.17604559659957886,
-0.1850694864988327,
-0.6117776036262512,
-0.45563796162605... |
func runTask(ctx context.Context, c autotest.Config, a *autotest.AutoservArgs, w io.Writer) (*Result, error) {
r := &Result{}
cmd := autotest.AutoservCommand(c, a)
cmd.Stdout = w
cmd.Stderr = w
var err error
r.RunResult, err = osutil.RunWithAbort(ctx, cmd)
if err != nil {
return r, err
}
if es, ok := cmd.Pr... | [
-0.7268797159194946,
-0.23486937582492828,
0.6624599099159241,
0.47482582926750183,
-0.4185199737548828,
-0.2879981994628906,
0.41178184747695923,
0.015427210368216038,
-0.4047596752643585,
-0.10598750412464142,
-0.431743860244751,
0.2066895216703415,
0.02188381738960743,
-0.04594879597425... |
func runTest(ctx context.Context, c autotest.Config, a *autotest.AutoservArgs, w io.Writer) (*Result, error) {
r, err := runTask(ctx, c, a, w)
if !r.Started {
return r, err
}
p := filepath.Join(a.ResultsDir, autoservPidFile)
if i, err2 := readTestsFailed(p); err2 != nil {
if err == nil {
err = err2
}
} e... | [
-0.002535395324230194,
0.33488982915878296,
0.6074252128601074,
0.19612228870391846,
-0.10435783863067627,
-0.11260277032852173,
0.9019827842712402,
-0.3552239239215851,
-0.5292275547981262,
-0.5580976009368896,
-0.1500217765569687,
-0.395773708820343,
-0.7463858723640442,
-0.1566227525472... |
func isTest(a *autotest.AutoservArgs) bool {
switch {
case a.Verify, a.Cleanup, a.Reset, a.Repair, a.Provision:
return false
default:
return true
}
} | [
-0.025134524330496788,
0.6977559328079224,
0.19044284522533417,
0.6519469022750854,
0.7200295329093933,
0.2526884973049164,
-0.09844721108675003,
-0.32071033120155334,
0.8500453233718872,
0.005197593010962009,
0.006924074608832598,
0.5211048126220703,
-1.8502148389816284,
0.137902095913887... |
func readTestsFailed(pidFile string) (int, error) {
b, err := ioutil.ReadFile(pidFile)
if err != nil {
return 0, err
}
s := string(b)
lines := strings.Split(s, "\n")
if len(lines) < 3 {
return 0, fmt.Errorf("Not enough lines in pidfile %s", pidFile)
}
i, err := strconv.Atoi(lines[2])
if err != nil {
retu... | [
0.3987463414669037,
-0.15546618402004242,
0.6700989603996277,
-0.8546014428138733,
-0.33144083619117737,
-0.3134932219982147,
0.303234338760376,
0.46487781405448914,
-0.8270111083984375,
-0.41921842098236084,
0.8727677464485168,
-0.36467504501342773,
-0.6841194033622742,
-0.194312021136283... |
func TestAdd(t *testing.T) {
body, err := json.Marshal(&fakeRequests)
if err != nil {
t.Fatal(err)
}
res, err := http.Post(url+"add", contentType, bytes.NewBuffer(body))
if err != nil {
t.Fatal(err)
}
if res.StatusCode != http.StatusOK {
t.Fatal(fmt.Errorf("Wrong status code = %v", res.StatusCode))
}
... | [
0.14190541207790375,
0.33122366666793823,
0.9395317435264587,
0.2087501734495163,
0.6348949670791626,
1.0682061910629272,
-0.48967471718788147,
-0.2459198534488678,
0.07123979181051254,
-0.40742117166519165,
-0.025273289531469345,
0.11900816857814789,
-0.6195021271705627,
0.460453152656555... |
func TestWriteAndReadSingleStringsNotIndexed(t *testing.T) {
var ctx = context.Background()
var buf = internal.NewAnonymousFile()
var writer *Writer = NewWriter(ctx, buf)
var reader *Reader
var keys []string
var k, v string
var err error
for k, _ = range testdata {
keys = append(keys, k)
}
sort.Strings(ke... | [
0.221841499209404,
-0.6885524988174438,
0.6471958160400391,
-0.3291589617729187,
0.5751621127128601,
0.08025429397821426,
0.4471530616283417,
0.13443173468112946,
-0.2894976735115051,
-0.20671358704566956,
0.21167701482772827,
0.35747620463371277,
-0.29479318857192993,
-0.4707705080509186,... |
func TestWriteAndReadStringMapNotIndexed(t *testing.T) {
var ctx = context.Background()
var result_map = make(map[string]string)
var buf = internal.NewAnonymousFile()
var writer = NewWriter(ctx, buf)
var reader *Reader
var k, v string
var err error
var ok bool
// Fill the sstable with some test data.
err = w... | [
0.09607410430908203,
-1.102096676826477,
0.605691134929657,
-0.14104105532169342,
0.6766487956047058,
0.14982251822948456,
0.6602509617805481,
-0.025233076885342598,
-0.3625513017177582,
-0.3699096739292145,
-0.0402662493288517,
-0.025465812534093857,
-0.3044671416282654,
-0.42474925518035... |
func TestWriteKeyOrderViolation(t *testing.T) {
var ctx = context.Background()
var buf = internal.NewAnonymousFile()
var writer = NewWriter(ctx, buf)
var err error
err = writer.WriteString(ctx, "test2", "data2")
if err != nil {
t.Errorf("Unexpected error writing test data to sstable: %s", err)
}
err = write... | [
0.3905836343765259,
0.19256702065467834,
0.8252457976341248,
0.31881818175315857,
0.4971877336502075,
-0.1773621141910553,
0.291167676448822,
0.2273484617471695,
-0.7986158132553101,
-0.2648642063140869,
-0.539204478263855,
-0.04887114837765694,
-0.42229217290878296,
-0.3094139099121094,
... |
func BenchmarkIndexlessLookup(b *testing.B) {
var ctx = context.Background()
var buf = internal.NewAnonymousFile()
var writer = NewWriter(ctx, buf)
var reader *Reader
var keys []string
var k, v string
var err error
var i int
for k, _ = range testdata {
keys = append(keys, k)
}
// Fill the sstable with so... | [
-0.1385982632637024,
-0.18504026532173157,
0.7963075637817383,
-0.8287372589111328,
0.20128130912780762,
-0.11458772420883179,
0.8833558559417725,
-0.11771292984485626,
-0.1486358642578125,
0.25999870896339417,
0.345018595457077,
0.33472663164138794,
-0.3425488770008087,
-0.883054018020629... |
func BenchmarkIndexedNonCachedLookup(b *testing.B) {
var ctx = context.Background()
var buf = internal.NewAnonymousFile()
var buf_idx = internal.NewAnonymousFile()
var writer *Writer = NewIndexedWriter(ctx, buf, buf_idx, IndexType_EVERY_N, 4)
var reader *Reader
var keys []string
var k, v string
var err error
v... | [
-0.3393422067165375,
-0.18017098307609558,
0.7385930418968201,
-0.48642289638519287,
0.32609593868255615,
-0.12689217925071716,
0.7493532299995422,
-0.26369038224220276,
-0.017037929967045784,
0.20118258893489838,
0.07253053039312363,
0.3289385139942169,
-0.2921057343482971,
-0.51613432168... |
func NewMountCapability(
mode csi.VolumeCapability_AccessMode_Mode,
fsType string,
mountFlags []string) *csi.VolumeCapability {
return &csi.VolumeCapability{
AccessMode: &csi.VolumeCapability_AccessMode{
Mode: mode,
},
AccessType: &csi.VolumeCapability_Mount{
Mount: &csi.VolumeCapability_MountVolume{
... | [
0.824302077293396,
-2.037487506866455,
0.4032536745071411,
0.92115718126297,
-0.8780280947685242,
-1.019770622253418,
-0.48991671204566956,
-0.303495854139328,
0.23259097337722778,
0.629365861415863,
0.1672373265028,
0.4191209375858307,
0.2383962720632553,
0.14528247714042664,
0.58182251... |
func NewBlockCapability(
mode csi.VolumeCapability_AccessMode_Mode) *csi.VolumeCapability {
return &csi.VolumeCapability{
AccessMode: &csi.VolumeCapability_AccessMode{
Mode: mode,
},
AccessType: &csi.VolumeCapability_Block{
Block: &csi.VolumeCapability_BlockVolume{},
},
}
} | [
0.3991604447364807,
-1.4832656383514404,
0.5777627825737,
0.8615162968635559,
-0.8197138905525208,
-0.9348926544189453,
0.062400221824645996,
-0.11373671889305115,
0.1732889860868454,
1.0983309745788574,
0.1567678302526474,
0.47377490997314453,
-0.43301957845687866,
-0.22787833213806152,
... |
func CreateVolume(
ctx context.Context,
c csi.ControllerClient,
version *csi.Version,
name string,
requiredBytes, limitBytes uint64,
capabilities []*csi.VolumeCapability,
params map[string]string,
callOpts ...grpc.CallOption) (volume *csi.VolumeInfo, err error) {
req := &csi.CreateVolumeRequest{
Name: ... | [
-0.12601052224636078,
-0.23645932972431183,
0.8170036673545837,
-0.3541126549243927,
0.42577582597732544,
0.17295126616954803,
-0.41036710143089294,
-0.2515665888786316,
-0.30045247077941895,
0.5386667251586914,
-0.046155430376529694,
0.720593273639679,
-1.0309152603149414,
0.3222717940807... |
func DeleteVolume(
ctx context.Context,
c csi.ControllerClient,
version *csi.Version,
volumeID *csi.VolumeID,
volumeMetadata *csi.VolumeMetadata,
callOpts ...grpc.CallOption) error {
req := &csi.DeleteVolumeRequest{
Version: version,
VolumeId: volumeID,
VolumeMetadata: volumeMetadata,
}
_,... | [
0.07222089916467667,
-0.3154752552509308,
0.6389510035514832,
-0.12096353620290756,
1.3873240947723389,
0.12713824212551117,
-0.5413742065429688,
-0.22361606359481812,
0.09924983978271484,
0.18646414577960968,
0.3052171766757965,
1.4764249324798584,
-1.1476857662200928,
0.16720382869243622... |
func ControllerPublishVolume(
ctx context.Context,
c csi.ControllerClient,
version *csi.Version,
volumeID *csi.VolumeID,
volumeMetadata *csi.VolumeMetadata,
nodeID *csi.NodeID,
volumeCapability *csi.VolumeCapability,
readonly bool,
callOpts ...grpc.CallOption) (
*csi.PublishVolumeInfo, error) {
req := &csi.... | [
0.04735609143972397,
-0.8202474117279053,
0.5398998260498047,
-0.41553550958633423,
0.6110990643501282,
-0.3393087685108185,
0.10126504302024841,
-0.08041801303625107,
-0.6046904921531677,
0.7596843838691711,
0.4681116044521332,
0.8697171211242676,
-0.23663081228733063,
0.22403593361377716... |
func ControllerUnpublishVolume(
ctx context.Context,
c csi.ControllerClient,
version *csi.Version,
volumeID *csi.VolumeID,
volumeMetadata *csi.VolumeMetadata,
nodeID *csi.NodeID,
callOpts ...grpc.CallOption) error {
req := &csi.ControllerUnpublishVolumeRequest{
Version: version,
VolumeId: volu... | [
0.1948479264974594,
-0.9014267325401306,
0.30438193678855896,
-1.0644973516464233,
0.9694401621818542,
0.008937427774071693,
0.34623098373413086,
0.45073843002319336,
-0.6275553107261658,
0.4343858063220978,
0.9236668944358826,
0.509164571762085,
-0.2624698579311371,
0.26092416048049927,
... |
func ValidateVolumeCapabilities(
ctx context.Context,
c csi.ControllerClient,
version *csi.Version,
volumeInfo *csi.VolumeInfo,
volumeCapabilities []*csi.VolumeCapability,
callOpts ...grpc.CallOption) (*csi.ValidateVolumeCapabilitiesResponse_Result, error) {
req := &csi.ValidateVolumeCapabilitiesRequest{
Vers... | [
-0.7266882061958313,
-1.2978498935699463,
0.5876113176345825,
0.44797176122665405,
0.04793740436434746,
-0.3751317858695984,
0.28462812304496765,
-0.6669138669967651,
0.39557668566703796,
0.6036614775657654,
-0.17905451357364655,
0.17779383063316345,
-0.9322544932365417,
0.1038147211074829... |
func ListVolumes(
ctx context.Context,
c csi.ControllerClient,
version *csi.Version,
maxEntries uint32,
startingToken string,
callOpts ...grpc.CallOption) (
volumes []*csi.VolumeInfo, nextToken string, err error) {
req := &csi.ListVolumesRequest{
MaxEntries: maxEntries,
StartingToken: startingToken,
V... | [
-0.13800418376922607,
-0.8013423681259155,
0.4887939691543579,
-0.14858485758304596,
0.3092741072177887,
-0.6278601288795471,
-0.9108989238739014,
-0.224901482462883,
0.14004121720790863,
0.2244919389486313,
-0.4377732276916504,
0.33144426345825195,
-0.6984646320343018,
0.6896539330482483,... |
func GetCapacity(
ctx context.Context,
c csi.ControllerClient,
version *csi.Version,
volumeCapabilities []*csi.VolumeCapability,
callOpts ...grpc.CallOption) (uint64, error) {
req := &csi.GetCapacityRequest{
Version: version,
VolumeCapabilities: volumeCapabilities,
}
res, err := c.GetCapacity(c... | [
-0.5077011585235596,
-0.2703048288822174,
0.8068973422050476,
0.9799724817276001,
0.6703136563301086,
-0.6850430965423584,
0.45773181319236755,
0.0012986556394025683,
0.37456923723220825,
0.8760562539100647,
0.11337092518806458,
0.42439034581184387,
-0.8644958138465881,
0.0583484061062336,... |
func ControllerGetCapabilities(
ctx context.Context,
c csi.ControllerClient,
version *csi.Version,
callOpts ...grpc.CallOption) (
capabilties []*csi.ControllerServiceCapability, err error) {
req := &csi.ControllerGetCapabilitiesRequest{
Version: version,
}
res, err := c.ControllerGetCapabilities(ctx, req, c... | [
-0.40428808331489563,
-0.08134891837835312,
0.2918412387371063,
0.43315500020980835,
0.6455331444740295,
-0.2850894033908844,
0.2868611514568329,
-0.32498085498809814,
0.5191639065742493,
0.22301261126995087,
-0.8568882346153259,
0.38831955194473267,
-1.1396631002426147,
0.5166762471199036... |
func NewPersister(ks *keyspace.KeySpace) *Persister {
return &Persister{
doneCh: make(chan struct{}),
ks: ks,
persistFn: Persist,
}
} | [
-0.08879920095205307,
-0.6506398320198059,
0.25554531812667847,
0.4453203082084656,
-0.5834717750549316,
-0.7114338874816895,
-1.4979798793792725,
-0.4210245609283447,
0.0811106264591217,
-0.6487410068511963,
-0.40454578399658203,
-0.0764748752117157,
-0.7292376756668091,
1.665835142135620... |
func (p *Persister) attemptPersist(spool Spool) {
if spool.ContentLength() == 0 {
// Persisting an empty Spool is a no-op.
return
}
// Attach the current BackingStore of the Fragment's JournalSpec.
p.ks.Mu.RLock()
var item, ok = allocator.LookupItem(p.ks, spool.Journal.String())
p.ks.Mu.RUnlock()
if !ok {
... | [
-0.15505298972129822,
-0.18966910243034363,
0.3792988359928131,
-0.5770998001098633,
0.5588096976280212,
0.09523726254701614,
0.3703983426094055,
-0.03222476318478584,
0.5824661254882812,
0.24430277943611145,
-0.28314143419265747,
-0.11975420266389847,
-0.6622871160507202,
0.03560357540845... |
func NewMOptionsWithHandler(o *options) OptionsWithHandler {
return OptionsWithHandler{
o,
}
} | [
-0.1621115654706955,
-0.7663623690605164,
0.11132382601499557,
1.0464818477630615,
-1.2949175834655762,
-0.23610292375087738,
-0.0009671984007582068,
-0.5649479031562805,
0.303158700466156,
-0.20273151993751526,
-1.138185977935791,
-0.8284715414047241,
0.14439217746257782,
1.92218267917633... |
func (m OptionsWithHandler) HandleFastHTTP(ctx *fasthttp.RequestCtx) {
switch string(ctx.Path()) {
case "/":
m.ping(ctx)
case "/send":
m.sendRequest(ctx)
default:
ctx.Error("Not found", fasthttp.StatusNotFound)
}
} | [
0.4278606176376343,
-0.012543601915240288,
0.6935523748397827,
1.1436113119125366,
0.03301765397191048,
0.21225032210350037,
0.2067641317844391,
-0.7452643513679504,
-0.19101758301258087,
-0.02465951256453991,
-0.021035874262452126,
-0.5564761757850647,
-0.07158025354146957,
0.683842122554... |
func (c contentMessage) String() string {
message := console.Colorize("Time", fmt.Sprintf("[%s]", c.Time.Format(printDate)))
message += console.Colorize("Size", fmt.Sprintf("%7s", strings.Join(strings.Fields(humanize.IBytes(uint64(c.Size))), "")))
fileDesc := ""
if c.VersionID != "" {
fileDesc += console.Coloriz... | [
0.41982507705688477,
-1.0181100368499756,
0.5690252184867859,
-1.3513919115066528,
-0.25884318351745605,
0.3975197374820709,
0.22358448803424835,
-1.105063557624817,
-1.2583168745040894,
0.21133755147457123,
0.4875110387802124,
1.0618258714675903,
-0.6453157663345337,
0.470486044883728,
... |
func (c contentMessage) JSON() string {
c.Status = "success"
jsonMessageBytes, e := json.MarshalIndent(c, "", " ")
fatalIf(probe.NewError(e), "Unable to marshal into JSON.")
return string(jsonMessageBytes)
} | [
0.35478106141090393,
-0.7443304061889648,
0.37227052450180054,
-0.7853838205337524,
-0.07552552968263626,
0.047273632138967514,
0.13338685035705566,
-0.7217565774917603,
-0.2941192388534546,
-0.03585848957300186,
0.31192120909690857,
1.1774224042892456,
-1.1245367527008057,
0.4471460878849... |
func getOSDependantKey(path string, isDir bool) string {
sep := "/"
// for windows make sure to print in 'windows' specific style.
if runtime.GOOS == "windows" {
path = strings.Replace(path, "/", "\\", -1)
sep = "\\"
}
if isDir && !strings.HasSuffix(path, sep) {
return fmt.Sprintf("%s%s", path, sep)
}
re... | [
-0.4573761224746704,
-0.3252490758895874,
0.6546506881713867,
-0.13064232468605042,
-0.7372624278068542,
0.039153940975666046,
0.7122578024864197,
0.10870427638292313,
-0.7899760603904724,
0.6742125749588013,
0.4437011778354645,
0.5217342972755432,
-0.04321698844432831,
0.7316465973854065,... |
func generateContentMessages(clntURL ClientURL, ctnts []*ClientContent, printAllVersions bool) (msgs []contentMessage) {
prefixPath := clntURL.Path
prefixPath = filepath.ToSlash(prefixPath)
if !strings.HasSuffix(prefixPath, "/") {
prefixPath = prefixPath[:strings.LastIndex(prefixPath, "/")+1]
}
prefixPath = stri... | [
-0.48603489995002747,
-0.5130645632743835,
0.7107279896736145,
-0.23199471831321716,
0.16089916229248047,
0.17743124067783356,
0.21171687543392181,
-0.9604275226593018,
-0.5833436250686646,
0.5513962507247925,
-0.5109192728996277,
-0.3308488428592682,
-0.14954519271850586,
0.81471151113510... |
func printObjectVersions(clntURL ClientURL, ctntVersions []*ClientContent, printAllVersions bool) {
sortObjectVersions(ctntVersions)
msgs := generateContentMessages(clntURL, ctntVersions, printAllVersions)
for _, msg := range msgs {
printMsg(msg)
}
} | [
-0.3921731114387512,
-0.5219916105270386,
0.4891377091407776,
0.3921704590320587,
-0.4108823537826538,
0.7220712304115295,
-0.040362946689128876,
-1.5816906690597534,
0.09101869910955429,
0.558408796787262,
-0.47378355264663696,
0.5298117399215698,
-0.6372393369674683,
0.403537392616272,
... |
func doList(ctx context.Context, clnt Client, isRecursive, isIncomplete bool, timeRef time.Time, withOlderVersions bool) error {
var (
lastPath string
perObjectVersions []*ClientContent
cErr error
)
for content := range clnt.List(ctx, ListOptions{
isRecursive: isRecursive,
isI... | [
-0.005761375185102224,
-0.4543834924697876,
0.5411949157714844,
0.18207228183746338,
0.7120937705039978,
-0.2145451158285141,
0.5287877321243286,
-0.2993769943714142,
0.26665186882019043,
0.6549666523933411,
-0.17139115929603577,
0.8803227543830872,
-0.037875328212976456,
0.276690393686294... |
func namespaceFilterTest(ctx context.Context, c client.Client, invConfig invconfig.InventoryConfig, inventoryName, namespaceName string) {
By("apply resources in order based on depends-on annotation")
applier := invConfig.ApplierFactoryFunc()
inv := invConfig.InvWrapperFunc(invConfig.FactoryFunc(inventoryName, name... | [
0.05499792844057083,
-0.01523574348539114,
0.9225431084632874,
0.17924286425113678,
-0.05750449374318123,
0.22435800731182098,
0.580486536026001,
-0.5265470147132874,
0.24649956822395325,
-0.030755216255784035,
-0.7390136122703552,
0.16623051464557648,
-0.08729226142168045,
0.7037839889526... |
func (c *Context) New() hctx.Context {
cc := NewContextWithOuter(map[string]interface{}{}, c)
return cc
} | [
0.32789409160614014,
-0.83078932762146,
0.05019248276948929,
0.1493261307477951,
-0.7843711376190186,
0.3011547923088074,
-0.2767705023288727,
0.05347143113613129,
0.06159636750817299,
-0.4379001557826996,
-0.32598239183425903,
-0.303861141204834,
0.5399156212806702,
0.6824422478675842,
... |
func (c *Context) Set(key string, value interface{}) {
c.moot.Lock()
defer c.moot.Unlock()
c.data[key] = value
} | [
-0.4321163594722748,
-0.023281823843717575,
0.051340434700250626,
-0.179929718375206,
0.09706781059503555,
0.007155839819461107,
-0.2892894148826599,
-0.6468601226806641,
-0.6543941497802734,
0.836777925491333,
-0.46680688858032227,
0.6604307889938354,
-0.3641587197780609,
-0.0094157168641... |
func (c *Context) Value(key interface{}) interface{} {
if s, ok := key.(string); ok {
if v, ok := c.data[s]; ok {
return v
}
if c.outer != nil {
return c.outer.Value(s)
}
}
return c.Context.Value(key)
} | [
-0.6622106432914734,
-0.10810349136590958,
0.4739876687526703,
-0.31462395191192627,
-0.2418045997619629,
-0.06671100854873657,
-0.24197831749916077,
-0.43938007950782776,
0.30953583121299744,
0.07506630569696426,
0.4546106457710266,
0.976431667804718,
-0.26342010498046875,
0.6341208815574... |
func (c *Context) Has(key string) bool {
return c.Value(key) != nil
} | [
0.18096224963665009,
0.02848251909017563,
0.19082045555114746,
-0.24571570754051208,
0.05115057900547981,
-0.25835317373275757,
-0.8801442384719849,
0.6802775859832764,
-0.39704662561416626,
-0.16540463268756866,
-0.639325737953186,
-0.46245622634887695,
0.0877586156129837,
0.6431922912597... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.