text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func New(opts ...Option) *Bot {
var bot Bot
for _, opt := range withDefaults(opts) {
opt(&bot)
}
return &bot
} | [
-0.44264429807662964,
0.06406547129154205,
0.23775415122509003,
1.022770643234253,
-0.04289333149790764,
0.061955783516168594,
-0.9359124898910522,
-0.027532657608389854,
-0.3700905740261078,
-0.6403636932373047,
-0.6543332934379578,
0.1667308807373047,
-0.12935756146907806,
0.234443321824... |
func (bot *Bot) Run(ctx context.Context) error {
ctx, cancel := context.WithCancel(ctx)
defer cancel()
inputs, err := bot.ui.Listen(ctx)
if err != nil {
return err
}
for {
select {
case <-ctx.Done():
bot.process(ctx, Intent{ID: SysIntentShutdown})
return nil
case msg, ok := <-inputs:
if !ok {
... | [
-0.17848069965839386,
-0.3879905343055725,
0.8035493493080139,
0.3130252957344055,
0.21949155628681183,
0.4818798005580902,
0.2543496787548065,
-0.4556131660938263,
-0.07472144812345505,
-0.14235974848270416,
0.05030945688486099,
0.09523000568151474,
-1.0178569555282593,
0.4880548119544983... |
func byteSlicesToCSlices(vals [][]byte) (charsSlice, sizeTSlice) {
if len(vals) == 0 {
return nil, nil
}
chars := make(charsSlice, len(vals))
sizes := make(sizeTSlice, len(vals))
for i, val := range vals {
chars[i] = (*C.char)(C.CBytes(val))
sizes[i] = C.size_t(len(val))
}
return chars, sizes
} | [
0.7984150052070618,
-0.7157894372940063,
0.4370501935482025,
-0.922082781791687,
-0.20775769650936127,
-0.9443512558937073,
-0.2808651030063629,
0.26295968890190125,
0.32964998483657837,
0.8567324876785278,
-0.1823137402534485,
0.46666228771209717,
0.434792160987854,
0.7432597279548645,
... |
func (m *Manager) ConvertProvince2Info(name string) (Province, error) {
var province Province
if len(name) < 2 {
return province, errors.New("invalid province name")
}
key := utils.Hash("Province_" + name)
err := fetch(key, &province)
if err == nil {
return province, nil
}
query := `SELECT * FROM list_loca... | [
-1.2543056011199951,
-1.0578430891036987,
0.6883304119110107,
-0.6800315380096436,
-0.2379603534936905,
-0.19330425560474396,
-0.7967031002044678,
-0.10746554285287857,
0.24639903008937836,
0.2204725742340088,
-0.8111883401870728,
-0.22857007384300232,
-0.08757089078426361,
-0.684163451194... |
func (m *Manager) ConvertProvinceID2Info(id int64) (Province, error) {
var province Province
if id < 1 {
return province, errors.New("invalid province name")
}
key := utils.Hash(fmt.Sprintf("Province_%d", id))
err := fetch(key, &province)
if err == nil {
return province, nil
}
query := `SELECT * FROM list_... | [
-0.8989211916923523,
-1.1820465326309204,
0.5512105822563171,
-0.8449792861938477,
0.1712304800748825,
-0.24931098520755768,
-0.7653147578239441,
-0.18747469782829285,
0.5214404463768005,
0.20697253942489624,
-0.5605643391609192,
-0.10604402422904968,
-0.13527154922485352,
-0.4691685140132... |
func New(scope InboundNatScope) *Service {
client := newClient(scope)
return &Service{
Scope: scope,
client: client,
Reconciler: async.New(scope, client, client),
}
} | [
-0.13992314040660858,
-0.920131266117096,
0.2508372366428375,
-0.8664051294326782,
0.02819262258708477,
-0.128323033452034,
-0.5060486197471619,
-0.8047500252723694,
-0.7078804969787598,
0.2248373180627823,
0.39162155985832214,
1.4189201593399048,
0.07232113927602768,
0.6291911005973816,
... |
func (s *Service) Name() string {
return serviceName
} | [
-0.6774218678474426,
-0.7487972974777222,
0.08543502539396286,
0.14024822413921356,
-1.3732805252075195,
-0.07531839609146118,
0.21909579634666443,
-0.8761037588119507,
-0.18569283187389374,
0.6854860782623291,
-0.48174676299095154,
0.1918882429599762,
-0.08670347929000854,
0.7831538319587... |
func (s *Service) Reconcile(ctx context.Context) error {
ctx, log, done := tele.StartSpanWithLogger(ctx, "inboundnatrules.Service.Reconcile")
defer done()
// Externally managed clusters might not have an LB
if s.Scope.APIServerLBName() == "" {
log.V(4).Info("Skipping InboundNatRule reconciliation as the cluster ... | [
-0.6388125419616699,
0.043373480439186096,
0.8109444975852966,
-0.7549618482589722,
1.0325206518173218,
-0.31320253014564514,
-0.16843277215957642,
-0.7394928932189941,
-1.3562350273132324,
0.5683914422988892,
0.7007229924201965,
0.130166694521904,
-0.8077822923660278,
0.6344342827796936,
... |
func (s *Service) Delete(ctx context.Context) error {
ctx, _, done := tele.StartSpanWithLogger(ctx, "inboundnatrules.Service.Delete")
defer done()
ctx, cancel := context.WithTimeout(ctx, reconciler.DefaultAzureServiceReconcileTimeout)
defer cancel()
specs := s.Scope.InboundNatSpecs(make(map[int32]struct{}))
if ... | [
-0.4166596531867981,
0.2869343161582947,
0.7731816172599792,
-0.4782865643501282,
0.9077792167663574,
-0.08507923036813736,
-0.018479738384485245,
-0.82884681224823,
-0.6216989755630493,
0.8822374939918518,
0.7759181261062622,
0.022249411791563034,
-0.6969519257545471,
0.6993191838264465,
... |
func (s *Service) IsManaged(ctx context.Context) (bool, error) {
return true, nil
} | [
-0.4073781669139862,
0.09724099189043045,
0.6685868501663208,
-0.14016014337539673,
0.6833499073982239,
-0.09191178530454636,
-0.5398176908493042,
0.03368063271045685,
1.506024956703186,
-0.7025856375694275,
-0.47907859086990356,
0.6195441484451294,
-0.37501609325408936,
0.7983924150466919... |
func fillState64(state, seed []uint64) {
stateSize := len(state)
seedSize := len(seed)
l := int(math.Min(float64(seedSize), float64(stateSize)))
copy(state[:l], seed[:l])
if seedSize < stateSize {
for i := seedSize; i < stateSize; i++ {
state[i] = scrambleWell(state[i-len(seed)], uint(i))
}
}
} | [
-0.5051381587982178,
0.7796289324760437,
0.6613258719444275,
0.40152958035469055,
-0.20661179721355438,
0.027903323993086815,
0.3038875162601471,
-0.5311006903648376,
1.3177495002746582,
0.07730627804994583,
-0.24701298773288727,
-0.1267661601305008,
-0.13009591400623322,
0.489621251821517... |
func fillState(state, seed []uint32) {
stateSize := len(state)
seedSize := len(seed)
l := int(math.Min(float64(seedSize), float64(stateSize)))
copy(state[:l], seed[:l])
if seedSize < stateSize {
for i := seedSize; i < stateSize; i++ {
state[i] = uint32(scrambleWell(uint64(state[i-len(seed)]), uint(i)) & 0xff... | [
-0.13365203142166138,
1.1604578495025635,
0.6240741610527039,
-0.2837789058685303,
-0.4056953489780426,
0.43655669689178467,
0.1398419737815857,
-0.7290739417076111,
1.1186500787734985,
-0.0857880562543869,
-0.6672582030296326,
0.12868112325668335,
-0.30130261182785034,
0.33833447098731995... |
func multMatVect(substream []uint32, A [][]uint32, m1 uint32, B [][]uint32, m2 uint32) {
vv := make([]uint32, 3)
for i := 0; i < 3; i++ {
vv[i] = substream[i]
}
matVecModM(A, vv, vv, m1)
for i := 0; i < 3; i++ {
substream[i] = vv[i]
}
for i := 0; i < 3; i++ {
vv[i] = substream[i+3]
}
matVecModM(B, vv, v... | [
0.8863810300827026,
0.16083547472953796,
0.9795238971710205,
-0.13698655366897583,
-0.2146608680486679,
0.09392806887626648,
0.33172842860221863,
-0.4044990837574005,
0.009350667707622051,
-0.2683682441711426,
0.05270415171980858,
0.10199388861656189,
-0.2552527189254761,
-0.11378674954175... |
func main() {
hm, err := hoster.New("./hosts.txt")
if err != nil {
panic(err)
}
mapping, ok := hm.LookupByAddress("192.168.10.10")
fmt.Println(ok) // true
fmt.Println(mapping.Address) // 192.168.10.10
fmt.Println(mapping.Hosts) // []string{"hoster-1.k8s.svc.cluster.local", "hoster-2.k8s.svc.clu... | [
0.13152803480625153,
-0.5232135653495789,
1.0517326593399048,
0.21194806694984436,
-0.18338172137737274,
0.4812852144241333,
0.5328388810157776,
0.5325198769569397,
-1.1412378549575806,
-0.494476318359375,
0.25806117057800293,
0.023815758526325226,
0.2086298018693924,
0.0056787095963954926... |
func (m *APIKeyCreationRequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateLabel(formats); err != nil {
res = append(res, err)
}
if err := m.validateOrganizationID(formats); err != nil {
res = append(res, err)
}
if err := m.validateSecret(formats); err != nil {
res = ap... | [
-1.0794442892074585,
0.6813547611236572,
0.04340890422463417,
-0.16307991743087769,
-0.16727407276630402,
-0.2696816623210907,
-0.2610686421394348,
-0.6511306166648865,
-1.1414610147476196,
0.515697181224823,
0.3873855471611023,
-0.24391788244247437,
-0.5320403575897217,
0.9220067262649536... |
func ensureUniqueNamespace(ctx context.Context, c client.Client, ownerObj runtime.Object, prefix string, scheme *runtime.Scheme) (*corev1.Namespace, error) {
namespaceList := &corev1.NamespaceList{}
if err := c.List(ctx, namespaceList, owner.OwnedBy(ownerObj, scheme)); err != nil {
return nil, fmt.Errorf("listing N... | [
-0.22419369220733643,
0.5101875066757202,
0.5401096940040588,
0.2641151547431946,
0.35007283091545105,
-0.4835834801197052,
0.18555060029029846,
-1.2520583868026733,
1.9347562789916992,
-0.08507739752531052,
-0.22961479425430298,
0.5580770969390869,
-0.07759710401296616,
0.6099956035614014... |
func (h Hera) TableExists(tableName string) error {
theDML := "SELECT exists (select 1 from information_schema.tables WHERE table_schema='public' AND table_name=" + "'" + tableName + "'" + ")"
var occurrences bool
if errQ := h.DBConn.QueryRow(theDML).Scan(&occurrences); errQ != nil {
return errQ
}
if occurrence... | [
-0.32423919439315796,
-0.007498998194932938,
0.6276116371154785,
0.7133510708808899,
1.4555647373199463,
0.2260267436504364,
-0.4384090304374695,
0.7759025692939758,
-0.6513617038726807,
0.2514761686325073,
-0.1573692262172699,
-0.46189433336257935,
-0.1735636293888092,
0.34224817156791687... |
func (h Hera) DropTable(tableName string, withCascade bool) error {
ddl := []string{"drop table IF EXISTS", tableName}
if withCascade {
ddl = append(ddl, "CASCADE")
}
ddl = append(ddl, ";")
dropDDL := strings.Join(ddl, " ")
// execute now. w/o context as it is table dropped. might take some time.
_, errDr := ... | [
-0.2943427562713623,
0.6257582306861877,
0.8013578057289124,
0.3987117111682892,
0.4385835528373718,
-0.14494268596172333,
0.1824798434972763,
0.2381056696176529,
-0.185047447681427,
0.19030019640922546,
-0.4699474275112152,
0.012455151416361332,
-0.16025806963443756,
0.5236560106277466,
... |
func (p scheduleWithOverProvisioningAwareness) priority() priority {
return highPriority
} | [
0.21550653874874115,
0.4389302134513855,
0.15587218105793,
1.2769221067428589,
0.05344417691230774,
-0.004546411335468292,
-0.23821887373924255,
0.31236106157302856,
1.3109455108642578,
-0.9765889048576355,
0.3116287887096405,
-0.18429234623908997,
-0.362346351146698,
1.066576361656189,
... |
func (p scheduleWithOverProvisioningAwareness) name() policyName {
return overProvisioningPolicy
} | [
-0.36379873752593994,
-0.30470481514930725,
0.3670039772987366,
0.39782026410102844,
-1.0662215948104858,
1.134260654449463,
-0.03401228412985802,
0.19936354458332062,
1.0401697158813477,
1.1595884561538696,
0.24213893711566925,
-0.5736657977104187,
0.06386775523424149,
0.11646199971437454... |
func (p scheduleWithOverProvisioningAwareness) filter(pools *csp.CSPList) (*csp.CSPList, error) {
if len(p.err) > 0 {
return nil, errors.Errorf("failed to fetch overprovisioning details:%v", p.err)
}
if p.overProvisioning {
klog.Infof("Overprovisioning restriction policy not added as overprovisioning is enabled... | [
-0.24120835959911346,
-0.5455684661865234,
0.4856407046318054,
0.42571234703063965,
-0.46033403277397156,
0.8590198159217834,
0.240812286734581,
-0.3830259144306183,
1.1877812147140503,
0.916467010974884,
0.7653884887695312,
0.23450829088687897,
-0.4384916126728058,
0.09746710956096649,
... |
func (p *scheduleWithOverProvisioningAwareness) consumedCapacity(csp *apis.CStorPool) (resource.Quantity, error) {
var totalcapcity resource.Quantity
cstorVolumeMap := make(map[string]bool)
label := string(apis.CStorPoolKey) + "=" + csp.Name
cstorVolumeReplicaObjList, err := cstorvolumereplica.NewKubeclient().WithN... | [
-0.566257894039154,
-1.1759089231491089,
0.7398884296417236,
0.10916569828987122,
0.35766470432281494,
-0.18054673075675964,
0.606188952922821,
-0.3091531991958618,
0.7552970051765442,
0.9804781675338745,
-0.020145541056990623,
-1.1476496458053589,
0.3262612223625183,
0.5133529305458069,
... |
func (p *scheduleWithOverProvisioningAwareness) getCStorVolumeCapacity(name string) (resource.Quantity, error) {
cv, err := cstorvolume.NewKubeclient().WithNamespace(p.openebsNamespace).Get(name, metav1.GetOptions{})
if err != nil {
return resource.Quantity{}, errors.Wrapf(err, "failed to fetch cstorvolume %s", nam... | [
-0.6183462738990784,
-1.3051331043243408,
0.6530646085739136,
0.17495495080947876,
-0.37538158893585205,
-0.5524280667304993,
-0.001342450617812574,
-0.40343591570854187,
0.16630855202674866,
0.4107609689235687,
0.4122397303581238,
-0.3613220155239105,
0.4740138351917267,
0.408255130052566... |
func (p scheduleOnHost) priority() priority {
return mediumPriority
} | [
-0.08826404064893723,
0.0024870664346963167,
0.17270953953266144,
0.6670606732368469,
-0.5840758681297302,
0.46494609117507935,
-0.7971438765525818,
0.37078648805618286,
0.4090968668460846,
-0.9399332404136658,
-0.11056005954742432,
0.12138968706130981,
-1.084468126296997,
0.63137513399124... |
func (p scheduleOnHost) name() policyName {
return scheduleOnHostAnnotationPolicy
} | [
-0.07073861360549927,
-0.762494683265686,
0.3084222376346588,
-0.07154656201601028,
-0.9528946876525879,
1.5754345655441284,
-0.4083850085735321,
0.548433244228363,
-0.31603842973709106,
1.2136067152023315,
-0.698236346244812,
0.010090099647641182,
0.29557543992996216,
-0.22324536740779877... |
func (p scheduleOnHost) filter(pools *csp.CSPList) (*csp.CSPList, error) {
if p.hostName == "" {
return pools, nil
}
filteredPools := pools.Filter(csp.HasAnnotation(string(scheduleOnHostAnnotation), p.hostName))
return filteredPools, nil
} | [
-0.19443655014038086,
0.04801756143569946,
0.30434736609458923,
1.0037685632705688,
-0.47787556052207947,
1.055841088294983,
0.0208639707416296,
0.6035835146903992,
-0.21576561033725739,
0.6229198575019836,
-0.206835076212883,
0.8035171031951904,
-0.3721407353878021,
0.0404474176466465,
... |
func (p preferScheduleOnHost) priority() priority {
return mediumPriority
} | [
-0.13399167358875275,
0.1898210048675537,
0.1059102863073349,
0.4779564440250397,
-0.4187295436859131,
0.9894246459007263,
-0.8302395939826965,
0.11750282347202301,
0.2922980487346649,
-0.9755849242210388,
0.026125892996788025,
0.5637980103492737,
-0.9185654520988464,
0.9642453789710999,
... |
func (p preferScheduleOnHost) name() policyName {
return preferScheduleOnHostAnnotationPolicy
} | [
-0.3448674976825714,
-0.3764377534389496,
0.3542309105396271,
-0.158380925655365,
-0.810865581035614,
2.0204734802246094,
-0.7030768990516663,
0.18509630858898163,
-0.29373374581336975,
1.0547254085540771,
-0.3399540185928345,
0.22146464884281158,
0.11571485549211502,
0.17349041998386383,
... |
func (p preferScheduleOnHost) filter(pools *csp.CSPList) (*csp.CSPList, error) {
plist, err := p.scheduleOnHost.filter(pools)
if err != nil {
return nil, err
}
if len(plist.GetPoolUIDs()) == 0 {
return pools, nil
}
return plist, nil
} | [
-0.4839155972003937,
0.06729644536972046,
0.5064234733581543,
0.9798353910446167,
-0.5445286631584167,
1.3663591146469116,
-0.4261991083621979,
0.05957929044961929,
0.1116841658949852,
0.5078339576721191,
0.05613571032881737,
0.9116218686103821,
-0.7863309383392334,
0.12626901268959045,
... |
func (p antiAffinityLabel) priority() priority {
return lowPriority
} | [
0.4547373652458191,
-0.5746033787727356,
0.024037448689341545,
-0.5415715575218201,
0.5755760073661804,
0.9004891514778137,
-0.4114156663417816,
-0.3553566336631775,
0.8097966313362122,
-1.025080680847168,
0.31214532256126404,
0.15403763949871063,
-0.731654942035675,
0.6236468553543091,
... |
func (p antiAffinityLabel) name() policyName {
return antiAffinityLabelPolicy
} | [
-0.16837818920612335,
-1.2013356685638428,
0.27849477529525757,
-0.6822819113731384,
-0.7396285533905029,
1.892329216003418,
-0.45394980907440186,
-0.012479100376367569,
0.4885634183883667,
1.2570362091064453,
0.5355143547058105,
-0.23890239000320435,
0.15730009973049164,
0.216467738151550... |
func (p antiAffinityLabel) filter(pools *csp.CSPList) (*csp.CSPList, error) {
if p.labelSelector == "" {
return pools, nil
}
// pools that are already associated with
// this label should be excluded
//
// NOTE: we try without giving any namespace
// so that it lists from all available
// namespaces
cvrs, er... | [
-0.48732152581214905,
-0.6846245527267456,
0.235923632979393,
-0.14972826838493347,
0.009691078215837479,
1.691165804862976,
0.029325466603040695,
-0.8444979786872864,
0.9232313632965088,
0.6958499550819397,
0.4356209337711334,
0.589326024055481,
-0.6843326687812805,
0.4479292333126068,
... |
func (p preferAntiAffinityLabel) name() policyName {
return preferAntiAffinityLabelPolicy
} | [
-0.4397430121898651,
-0.4579072594642639,
0.3179772198200226,
-0.3992854058742523,
0.15447767078876495,
1.2763032913208008,
-0.5415765047073364,
-0.11409934610128403,
0.201700821518898,
1.2220314741134644,
0.4779999852180481,
-0.6270245909690857,
0.17396743595600128,
0.053983356803655624,
... |
func (p preferAntiAffinityLabel) filter(pools *csp.CSPList) (*csp.CSPList, error) {
plist, err := p.antiAffinityLabel.filter(pools)
if err != nil {
return plist, err
}
if len(plist.GetPoolUIDs()) > 0 {
return plist, nil
}
return pools, nil
} | [
-0.619371771812439,
-0.26959189772605896,
0.34114718437194824,
0.2628754675388336,
0.03743515908718109,
1.7790201902389526,
-0.1062336191534996,
-0.31993812322616577,
0.3291122019290924,
0.7473862171173096,
0.5431954860687256,
0.5150536298751831,
-0.5456762313842773,
0.3045165240764618,
... |
func newSelection(pools *csp.CSPList, opts ...buildOption) *selection {
s := &selection{pools: pools, policies: &policyList{map[priority][]policy{}}}
for _, o := range opts {
if o != nil {
o(s)
}
}
withDefaultSelection(s)
return s
} | [
-0.4547804892063141,
-0.6329103112220764,
-0.1477208286523819,
0.8077697157859802,
0.00602080300450325,
-0.07463828474283218,
-0.010512201115489006,
-0.40950116515159607,
0.7870582938194275,
0.3281751871109009,
-1.0199098587036133,
0.04234147444367409,
-0.5423485636711121,
-0.1351377367973... |
func (s *selection) hasPolicy(p policyName) bool {
return hasPolicy(p)(s.policies)
} | [
0.2987169921398163,
-0.40561041235923767,
0.2706345021724701,
0.14372234046459198,
0.2110719084739685,
0.45232439041137695,
-0.372449666261673,
0.4540426731109619,
0.6682406067848206,
0.3036159873008728,
-0.1676330864429474,
-0.8040087223052979,
-0.04064355418086052,
-0.10871733725070953,
... |
func (s *selection) hasPreferAntiAffinityLabel() bool {
return s.hasPolicy(preferAntiAffinityLabelPolicy)
} | [
-0.09675662964582443,
-0.4307408034801483,
0.3398534059524536,
-0.3368718922138214,
0.30092376470565796,
0.49819087982177734,
-0.037627924233675,
-0.13188831508159637,
0.2011602818965912,
0.6750183701515198,
0.2113524079322815,
-0.17524011433124542,
0.32999300956726074,
0.9193181991577148,... |
func (s *selection) hasAntiAffinityLabel() bool {
return s.hasPolicy(antiAffinityLabelPolicy)
} | [
-0.13755640387535095,
-0.8532468676567078,
0.06478777527809143,
-0.4124968945980072,
0.44750097393989563,
0.5129990577697754,
0.17635822296142578,
0.030388498678803444,
0.12727200984954834,
1.2308812141418457,
0.1702757477760315,
-0.15943101048469543,
0.2628346085548401,
0.937306821346283,... |
func ExecutionMode(m executionMode) buildOption {
return func(s *selection) {
s.mode = m
}
} | [
-0.07785655558109283,
0.20849744975566864,
0.18764153122901917,
0.16170498728752136,
-0.04455319792032242,
0.9450770616531372,
0.421281635761261,
0.8849765062332153,
0.6530700325965881,
0.13029561936855316,
-0.385979562997818,
-0.14124122262001038,
0.11145895719528198,
-0.6060311198234558,... |
func PreferAntiAffinityLabel(lbl string) buildOption {
return func(s *selection) {
p := preferAntiAffinityLabel{antiAffinityLabel{labelSelector: lbl, cvrList: defaultCVRList()}}
s.policies.add(p)
}
} | [
-0.26188498735427856,
-0.39978182315826416,
0.14025793969631195,
-0.24432316422462463,
0.4483400285243988,
0.9477694034576416,
-0.06414665281772614,
-0.024417990818619728,
0.8838979601860046,
0.11740892380475998,
0.28808432817459106,
-0.2831648290157318,
-0.2737128436565399,
0.305289685726... |
func AntiAffinityLabel(lbl string) buildOption {
return func(s *selection) {
p := antiAffinityLabel{labelSelector: lbl, cvrList: defaultCVRList()}
s.policies.add(p)
}
} | [
-0.16280972957611084,
-0.6506093740463257,
0.12366008758544922,
-0.3467191159725189,
0.23415908217430115,
1.1123878955841064,
-0.06427447497844696,
0.24172121286392212,
0.9000080823898315,
0.39330780506134033,
-0.17912262678146362,
-0.05159957706928253,
-0.19338172674179077,
0.189073681831... |
func PreferScheduleOnHostAnnotation(hostNameAnnotation string) buildOption {
hostName := strings.TrimPrefix(hostNameAnnotation, string(scheduleOnHostAnnotation)+"=")
return func(s *selection) {
p := preferScheduleOnHost{scheduleOnHost{hostName: hostName}}
s.policies.add(p)
}
} | [
-0.7906076908111572,
-0.08757215738296509,
0.27732616662979126,
0.10183363407850266,
-0.3550630807876587,
0.7040489315986633,
-0.19633187353610992,
0.6948220133781433,
-0.302438348531723,
0.08896882086992264,
-0.12244325876235962,
0.5820013880729675,
0.25439009070396423,
-0.090888723731040... |
func CapacityAwareProvisioning(values ...string) buildOption {
return func(s *selection) {
var err error
overProvisioningPolicy := &scheduleWithOverProvisioningAwareness{}
spcName := getSPCName(values...)
if strings.TrimSpace(spcName) == "" {
err = errors.New("Got empty storage pool claim from runtask")
... | [
0.15803192555904388,
-1.0265227556228638,
1.0518083572387695,
-0.23777230083942413,
-0.12907442450523376,
0.4363103210926056,
0.8410844206809998,
0.1478518694639206,
0.7094271183013916,
0.19151891767978668,
0.8898177742958069,
0.09199602156877518,
0.04113059118390083,
-0.09383565932512283,... |
func GetPolicies(values ...string) []buildOption {
var opts []buildOption
for _, val := range values {
if strings.Contains(val, string(scheduleOnHostAnnotation)) {
opts = append(opts, PreferScheduleOnHostAnnotation(val))
} else if strings.Contains(val, string(preferReplicaAntiAffinityLabel)) {
opts = append... | [
-0.33802539110183716,
-0.09665490686893463,
0.6532627940177917,
0.24251052737236023,
0.5979143381118774,
0.5555040836334229,
-0.577477216720581,
-0.165853351354599,
0.038439370691776276,
0.08302339166402817,
0.7314342856407166,
0.26166221499443054,
-0.5377956032752991,
0.4366704821586609,
... |
func (s *selection) validate() error {
if s.hasAntiAffinityLabel() && s.hasPreferAntiAffinityLabel() {
return errors.New("invalid selection: both antiAffinityLabel and preferAntiAffinityLabel policies can not be together")
}
return nil
} | [
-0.28346437215805054,
-0.3396592438220978,
0.1962757706642151,
-0.10325733572244644,
0.9178338646888733,
0.6529449820518494,
0.3667674958705902,
-0.45249709486961365,
0.13893984258174896,
0.4684465825557709,
1.2540879249572754,
0.1626780480146408,
0.030405383557081223,
0.7850447297096252,
... |
func (s *selection) filter() (*csp.CSPList, error) {
var err error
if s.policies == nil || len(s.policies.items) == 0 || s.pools == nil || len(s.pools.GetPoolUIDs()) == 0 {
return s.pools, nil
}
// make a copy of original pool UIDs
filtered := csp.ListBuilder().WithList(s.pools).List()
// Sorting policies based... | [
-0.5728368759155273,
-0.561371386051178,
0.4280235171318054,
0.3471660017967224,
0.018489185720682144,
1.2412457466125488,
-0.009705722332000732,
0.039870765060186386,
1.0630427598953247,
0.36724138259887695,
0.38999831676483154,
0.4653763473033905,
-0.5965667963027954,
0.2317131608724594,... |
func Filter(entries *csp.CSPList, opts ...buildOption) (*csp.CSPList, error) {
if entries == nil {
return entries, nil
}
s := newSelection(entries, opts...)
err := s.validate()
if err != nil {
return nil, err
}
return s.filter()
} | [
-0.1679815948009491,
-0.21969324350357056,
0.16826967895030975,
1.1215912103652954,
-0.06200968101620674,
0.5827906131744385,
-0.17872931063175201,
0.38625428080558777,
0.8194958567619324,
0.2511741518974304,
-0.19554461538791656,
0.28702491521835327,
-0.44310274720191956,
0.13422898948192... |
func FilterPoolIDs(entries *csp.CSPList, opts []buildOption) ([]string, error) {
plist, err := Filter(entries, opts...)
if err != nil {
return nil, err
}
return plist.GetPoolUIDs(), nil
} | [
-0.009107346646487713,
-0.46427807211875916,
0.22161230444908142,
0.348966121673584,
-0.6869276762008667,
1.4986302852630615,
0.14613601565361023,
-0.02558884583413601,
1.0333000421524048,
0.8441134095191956,
-0.5727013945579529,
1.4769872426986694,
-1.2977367639541626,
-0.2614341974258423... |
func TemplateFunctions() template.FuncMap {
return template.FuncMap{
"cspGetPolicies": GetPolicies,
"cspFilterPoolIDs": FilterPoolIDs,
"cspAntiAffinity": AntiAffinityLabel,
"cspPreferAntiAffinity": PreferAntiAffinityLabel,
"preferScheduleOnHost": PreferScheduleOnHostAnn... | [
-0.9933708310127258,
-0.24816764891147614,
0.21825037896633148,
-0.45662549138069153,
0.6147201061248779,
-0.2733086347579956,
0.19234931468963623,
0.7967422008514404,
-0.01783437468111515,
-0.3147660791873932,
-1.1829804182052612,
0.5029876828193665,
-0.13392160832881927,
-0.1055910289287... |
func (b *Batch) Enqueue(jobs ...Job) {
b.jobs = append(b.jobs, jobs...)
} | [
0.33743447065353394,
0.24471049010753632,
0.129828542470932,
0.9442124366760254,
1.2745929956436157,
0.3972215950489044,
-1.458808183670044,
0.2661207914352417,
-0.8523909449577332,
-0.720440685749054,
-0.3342859745025635,
0.6090993881225586,
-0.7285577654838562,
0.7836084961891174,
-0.6... |
func (b *Batch) Execute() error {
if len(b.jobs) == 0 {
return errors.New("No job provided")
}
if _, err := b.redisClient.Pipelined(func(pipe *redis.Pipeline) error {
pipe.SAdd(fmt.Sprintf("%s:queues", b.namespace), b.queue)
for _, job := range b.jobs {
buffer, err := job.Marshal()
if err != nil {
... | [
-0.21740145981311798,
0.269717276096344,
0.8113124966621399,
-0.17409414052963257,
1.0823825597763062,
0.13084924221038818,
-1.4471285343170166,
0.15784952044487,
-0.9552764296531677,
0.9341292977333069,
-0.30442503094673157,
-0.12507577240467072,
-0.1722344011068344,
0.19884982705116272,
... |
func skipToEnd(yylex interface{}) {
yylex.(*Tokenizer).SkipToEnd = true
} | [
-0.6112076640129089,
-0.3253193795681,
0.25971612334251404,
-0.19785621762275696,
-0.3025544583797455,
0.4733053743839264,
0.41963669657707214,
0.047923751175403595,
-0.7438850402832031,
0.03772031515836716,
-0.6449442505836487,
-0.4062660336494446,
0.1586872637271881,
0.16315169632434845,... |
func SetMapping(ctx context.Context, nat NAT, protocol string, extport, intport int, name string) error {
if err := nat.addPortMapping(protocol, extport, intport, name, mapTimeout); err != nil {
return err
}
go func() {
refresh := time.NewTimer(mapUpdateInterval)
defer func() {
refresh.Stop()
nat.delet... | [
-0.741443932056427,
-0.11853769421577454,
0.6935378313064575,
0.027475493028759956,
-0.45197829604148865,
0.557601273059845,
-0.46924343705177307,
-0.34943896532058716,
0.45337533950805664,
0.5461190938949585,
-0.27337679266929626,
0.06932646781206131,
-0.10743255168199539,
-0.517968177795... |
func DiscoverGateway() (NAT, error) {
select {
case nat := <-discoverUPNPIG1():
return nat, nil
case nat := <-discoverUPNPIG2():
return nat, nil
case nat := <-discoverNATPMP():
return nat, nil
case <-time.After(10 * time.Second):
return nil, errNoNATFound
}
} | [
0.06996586918830872,
0.6357388496398926,
0.5137184858322144,
0.2686721384525299,
-0.3520180583000183,
-0.8203763365745544,
-0.9649776220321655,
-0.9847544431686401,
-0.23706388473510742,
0.1423271745443344,
-0.019719332456588745,
0.6021761894226074,
-0.6811148524284363,
1.3165538311004639,... |
func (tf *factory) makeFileTailer(source *sources.LogSource) (Tailer, error) {
fileSource, err := tf.makeFileSource(source)
if err != nil {
return nil, err
}
return tf.attachChildSource(source, fileSource)
} | [
0.4457571506500244,
0.29345086216926575,
0.3168628513813019,
-1.4737457036972046,
-0.8183146715164185,
0.3086629807949066,
0.3554973304271698,
0.40108510851860046,
-0.7495505213737488,
-0.5588655471801758,
-1.1220811605453491,
-0.054534077644348145,
0.8109817504882812,
0.07944759726524353,... |
func (tf *factory) makeFileSource(source *sources.LogSource) (*sources.LogSource, error) {
// The user configuration consulted is different depending on what we are
// logging. Note that we assume that by the time we have gotten a source
// from AD, it is clear what we are logging. The `Wait` here should return
/... | [
0.0467410571873188,
0.5699015259742737,
0.3802887499332428,
-0.7030544877052307,
-0.1409568190574646,
-0.2734975516796112,
-0.18649925291538239,
-0.25330889225006104,
-0.28349030017852783,
-0.2474256306886673,
-0.03650836646556854,
0.27748870849609375,
0.2603551745414734,
0.059553381055593... |
func (tf *factory) attachChildSource(source, childSource *sources.LogSource) (Tailer, error) {
containerID := source.Config.Identifier
sourceInfo := status.NewMappedInfo("Container Info")
source.RegisterInfo(sourceInfo)
// Update parent source with additional information
sourceInfo.SetMessage(containerID,
fmt.... | [
0.5333431363105774,
-0.4844646155834198,
0.45129042863845825,
-1.1857752799987793,
-0.5897465348243713,
-0.22977523505687714,
-0.12717849016189575,
0.21861134469509125,
-0.4303189516067505,
-0.49907729029655457,
-1.3188352584838867,
0.40272486209869385,
0.15316234529018402,
0.9157010316848... |
func (tf *factory) makeDockerFileSource(source *sources.LogSource) (*sources.LogSource, error) {
containerID := source.Config.Identifier
path := tf.findDockerLogPath(containerID)
// check access to the file; if it is not readable, then returning an error will
// try to fall back to reading from a socket.
f, err ... | [
0.4574134647846222,
0.23523634672164917,
0.4584047496318817,
-0.5548763871192932,
-0.9414039850234985,
-0.9103021025657654,
0.4056844115257263,
0.22728823125362396,
-0.4930255711078644,
-0.9838986992835999,
-0.08557260781526566,
-0.10899730026721954,
0.5952821969985962,
-0.1055992916226387... |
func (tf *factory) findDockerLogPath(containerID string) string {
// if the user has set a custom docker data root, this will pick it up
// and set it in place of the usual docker base path
overridePath := coreConfig.Datadog.GetString("logs_config.docker_path_override")
if len(overridePath) > 0 {
return filepath.... | [
0.3694719076156616,
-0.5751524567604065,
0.6923301815986633,
-0.17097775638103485,
-0.5817143321037292,
-0.1739831566810608,
0.3796718716621399,
-1.1598042249679565,
-0.16749407351016998,
0.050238993018865585,
0.4263608157634735,
0.4000592529773712,
0.13687972724437714,
0.9244963526725769,... |
func (tf *factory) makeK8sFileSource(source *sources.LogSource) (*sources.LogSource, error) {
containerID := source.Config.Identifier
pod, err := tf.workloadmetaStore.GetKubernetesPodForContainer(containerID)
if err != nil {
return nil, fmt.Errorf("cannot find pod for container %q: %w", containerID, err)
}
var... | [
0.22421379387378693,
0.17667584121227264,
0.5443835854530334,
-0.561913251876831,
-0.4680899381637573,
-0.8046285510063171,
-0.21287178993225098,
-0.2931593954563141,
-0.012431154027581215,
-0.2580520808696747,
-0.28151121735572815,
0.07056114077568054,
0.43007516860961914,
-0.398295789957... |
func findK8sLogPath(pod *workloadmeta.KubernetesPod, containerName string) string {
// the pattern for container logs is different depending on the version of Kubernetes
// so we need to try three possbile formats
// until v1.9 it was `/var/log/pods/{pod_uid}/{container_name_n}.log`,
// v.1.10 to v1.13 it was `/var... | [
0.2235812395811081,
-0.7296314835548401,
1.1297234296798706,
-0.06430608034133911,
-0.26664969325065613,
-0.6439304947853088,
0.12726867198944092,
-1.1249247789382935,
0.32992851734161377,
0.5656895637512207,
0.21392913162708282,
0.10678882151842117,
0.1355883926153183,
0.2929213047027588,... |
func NewAny(p interface{}) *any.Any {
t, v := arch.EncodeType(p)
return &any.Any{
TypeUrl: t,
Value: v,
}
} | [
-1.0252643823623657,
-0.48165544867515564,
0.5354685187339783,
0.3104642331600189,
-0.7257730960845947,
-0.42546969652175903,
-0.818605363368988,
-0.3688841462135315,
0.11520732194185257,
-0.5738595128059387,
-0.42849865555763245,
0.4352647662162781,
-0.2944834530353546,
0.4365695416927337... |
func Unmarshal(s *any.Any) interface{} {
return arch.DecodeType(s.TypeUrl, s.Value)
} | [
-0.5863133668899536,
-0.044631198048591614,
0.2898597717285156,
-0.16661575436592102,
-0.5758323073387146,
-0.6239551305770874,
0.16931067407131195,
0.31077876687049866,
0.47288209199905396,
-0.995112955570221,
0.08427011221647263,
0.4942418932914734,
0.03391478955745697,
-0.21193997561931... |
func Handler() http.Handler {
gin.SetMode(gin.TestMode)
e := gin.New()
e.GET("/api/v3/repos/:owner/:name", getRepo)
e.GET("/api/v3/repositories/:id", getRepoByID)
e.GET("/api/v3/orgs/:org/memberships/:user", getMembership)
e.GET("/api/v3/user/memberships/orgs/:org", getMembership)
return e
} | [
-0.04652347415685654,
-0.1602305769920349,
0.3386531174182892,
0.4549342691898346,
0.6130997538566589,
0.5705276727676392,
-0.24480517208576202,
0.35181668400764465,
-0.17349384725093842,
-1.0653382539749146,
-0.13825751841068268,
0.19141891598701477,
0.08547677844762802,
-0.07988147437572... |
func StringToUTF16(s string) []uint16 { return utf16.Encode([]rune(s + "\x00")) } | [
0.8233654499053955,
-0.5381661057472229,
0.24674144387245178,
-0.9264853596687317,
0.3016488552093506,
-0.995432436466217,
-0.17441757023334503,
0.00930005218833685,
0.20003050565719604,
-0.07685333490371704,
-0.48028790950775146,
-0.011959078721702099,
0.24980472028255463,
-0.380813062191... |
func StringToUTF16Ptr(s string) *uint16 { return &StringToUTF16(s)[0] } | [
0.874788761138916,
-0.612911581993103,
0.10300182551145554,
-0.9072872400283813,
-0.18720510601997375,
-0.6137000322341919,
-0.1845627874135971,
0.38902097940444946,
0.2000693678855896,
-0.22091902792453766,
1.3653368949890137,
-0.6261113882064819,
-0.16543225944042206,
-1.0330770015716553... |
func NewRevokedSessions() *RevokedSessions {
this := RevokedSessions{}
return &this
} | [
0.6857947111129761,
-0.6386240720748901,
0.015382815152406693,
0.7929468750953674,
-0.738625705242157,
-0.5950125455856323,
0.580760657787323,
0.1315714418888092,
1.7771422863006592,
-0.31873759627342224,
-1.1736434698104858,
-0.021137259900569916,
-0.8581626415252686,
0.11571347713470459,... |
func NewRevokedSessionsWithDefaults() *RevokedSessions {
this := RevokedSessions{}
return &this
} | [
0.7425001859664917,
-0.0953826904296875,
0.1591966450214386,
0.3925294876098633,
-0.07210423052310944,
-0.5297987461090088,
-0.17019760608673096,
0.11041102558374405,
1.777168869972229,
-0.19429364800453186,
-1.2305299043655396,
-1.0539488792419434,
-0.9734699726104736,
0.16564121842384338... |
func (o *RevokedSessions) GetCount() int64 {
if o == nil || o.Count == nil {
var ret int64
return ret
}
return *o.Count
} | [
1.210334300994873,
0.6901583671569824,
0.2792617976665497,
1.164287805557251,
0.2506428360939026,
-0.5048865079879761,
1.224526286125183,
-0.2921990156173706,
0.8637255430221558,
-0.2189873456954956,
0.5913880467414856,
-1.6012394428253174,
-1.007803201675415,
0.7022988796234131,
1.33660... |
func (o *RevokedSessions) GetCountOk() (*int64, bool) {
if o == nil || o.Count == nil {
return nil, false
}
return o.Count, true
} | [
0.23293912410736084,
-0.13058675825595856,
0.48270466923713684,
0.8693315386772156,
0.4300234913825989,
0.13864153623580933,
1.0894423723220825,
0.4064415395259857,
-0.03098037652671337,
0.6975687742233276,
-0.5344312787055969,
-0.8727509379386902,
-0.02753109484910965,
1.1380165815353394,... |
func (o *RevokedSessions) HasCount() bool {
if o != nil && o.Count != nil {
return true
}
return false
} | [
1.4983835220336914,
0.3247397541999817,
0.2635236978530884,
0.693166971206665,
0.9885203242301941,
-0.3556112051010132,
0.2803543508052826,
0.7473648190498352,
0.08175703138113022,
-0.3912292718887329,
-0.06784860789775848,
-1.5394593477249146,
-0.6012289524078369,
0.23748892545700073,
0... |
func (o *RevokedSessions) SetCount(v int64) {
o.Count = &v
} | [
0.8124854564666748,
0.61127769947052,
-0.24752558767795563,
0.8371561765670776,
-0.4335721433162689,
-0.36523422598838806,
-0.06715460866689682,
-0.6850080490112305,
0.33166632056236267,
0.8208039402961731,
0.4240565896034241,
-0.10591862350702286,
-0.1600770503282547,
-0.15962447226047516... |
func New(c *config.Config) *DAL {
db := pg.Connect(&pg.Options{
Addr: c.PostgresHost + ":" + c.PostgresPort,
User: c.PostgresUser,
Password: c.PostgresPass,
Database: c.PostgresDatabase,
})
dal := &DAL{db}
log.Info("DAL waiting for database...")
err := dal.Ping()
for err != nil {
err = dal.Ping... | [
0.07460446655750275,
-0.21334737539291382,
0.4395414888858795,
-0.49687695503234863,
-0.2891028821468353,
0.7605098485946655,
-0.2677285373210907,
0.3192600905895233,
-0.3567962646484375,
0.1201169490814209,
0.3763532340526581,
0.9290350079536438,
0.4923694431781769,
-0.10440971702337265,
... |
func (dal *DAL) Ping() error {
i := 0
_, err := dal.db.QueryOne(pg.Scan(&i), "SELECT 1")
return err
} | [
-0.7390231490135193,
1.5301344394683838,
0.4192471504211426,
0.730625569820404,
0.7427380681037903,
0.22279474139213562,
-0.000987866660580039,
0.508832573890686,
-0.2998668849468231,
0.698981761932373,
0.6010113954544067,
-0.46906840801239014,
-0.1692420095205307,
-0.30964335799217224,
... |
func (dal *DAL) Close() error {
return dal.db.Close()
} | [
-0.47269877791404724,
0.9978324770927429,
0.12596650421619415,
-0.49377915263175964,
-0.9029352068901062,
0.9876718521118164,
-0.5334391593933105,
-0.27869662642478943,
0.35225650668144226,
-0.5783793926239014,
0.43755555152893066,
0.07466990500688553,
-0.1428397297859192,
0.64085078239440... |
func (c *Client) GetConfigurationCountries() (
*ConfigurationCountries,
error,
) {
tmdbURL := fmt.Sprintf(
"%s%scountries?api_key=%s",
baseURL,
configurationURL,
c.apiKey,
)
configurationCountries := ConfigurationCountries{}
if err := c.get(tmdbURL, &configurationCountries); err != nil {
return nil, err... | [
-1.0018099546432495,
0.7232590317726135,
0.15995196998119354,
0.7147166728973389,
0.21083633601665497,
-0.9733161926269531,
0.32713520526885986,
0.2121584713459015,
-0.39831140637397766,
0.15223531424999237,
-0.08182219415903091,
-0.14899654686450958,
-0.2906430661678314,
0.174977526068687... |
func (c *Client) GetConfigurationJobs() (*ConfigurationJobs, error) {
tmdbURL := fmt.Sprintf(
"%s%sjobs?api_key=%s",
baseURL,
configurationURL,
c.apiKey,
)
configurationJobs := ConfigurationJobs{}
if err := c.get(tmdbURL, &configurationJobs); err != nil {
return nil, err
}
return &configurationJobs, nil... | [
-1.087509036064148,
0.6431789994239807,
0.12180619686841965,
0.7271071672439575,
0.33165794610977173,
-0.9057607650756836,
0.15610498189926147,
0.43186911940574646,
-0.827716052532196,
0.13280002772808075,
-0.5996912121772766,
-0.734748363494873,
-1.2060438394546509,
0.06627251207828522,
... |
func (c *Client) GetConfigurationLanguages() (
*ConfigurationLanguages,
error,
) {
tmdbURL := fmt.Sprintf(
"%s%slanguages?api_key=%s",
baseURL,
configurationURL,
c.apiKey,
)
configurationLanguages := ConfigurationLanguages{}
if err := c.get(tmdbURL, &configurationLanguages); err != nil {
return nil, err... | [
-1.1997791528701782,
0.47194069623947144,
-0.0997755229473114,
0.7360463738441467,
0.1582871377468109,
-1.041630744934082,
0.03354128822684288,
0.5725827217102051,
-0.2944343090057373,
0.7103201150894165,
-0.7925432920455933,
-0.6205815672874451,
-0.9612563848495483,
0.23815931379795074,
... |
func (c *Client) GetConfigurationPrimaryTranslations() (
*ConfigurationPrimaryTranslations,
error,
) {
tmdbURL := fmt.Sprintf(
"%s%sprimary_translations?api_key=%s",
baseURL, configurationURL, c.apiKey,
)
configurationPrimaryTranslations := ConfigurationPrimaryTranslations{}
if err := c.get(tmdbURL, &configur... | [
-0.483281672000885,
0.8965855240821838,
0.5172250866889954,
0.4660036265850067,
-0.1275871843099594,
-0.8079345226287842,
-0.3621397018432617,
0.12253853678703308,
-0.027975983917713165,
0.14457660913467407,
-0.4889987111091614,
-1.039243459701538,
-0.6610209345817566,
-0.15889284014701843... |
func (c *Client) GetConfigurationTimezones() (
*ConfigurationTimezones,
error,
) {
tmdbURL := fmt.Sprintf(
"%s%stimezones?api_key=%s",
baseURL,
configurationURL,
c.apiKey,
)
configurationTimeZones := ConfigurationTimezones{}
if err := c.get(tmdbURL, &configurationTimeZones); err != nil {
return nil, err... | [
-1.550376296043396,
0.5820579528808594,
0.23045092821121216,
1.333857536315918,
0.4064944386482239,
-0.7007412910461426,
1.1248584985733032,
-0.03777415677905083,
0.027190756052732468,
1.2395975589752197,
-1.033942461013794,
-0.804813027381897,
-0.9205644130706787,
-0.06718921661376953,
... |
func (ki keyInfo) Weight() int {
return ki.size
} | [
-0.3045694828033447,
-0.14565029740333557,
0.5239015221595764,
-0.07281012833118439,
-0.33460503816604614,
0.6840226650238037,
0.7225072979927063,
-0.3508542776107788,
-1.2958433628082275,
0.22459861636161804,
-0.6844564080238342,
-1.2512742280960083,
-1.2588773965835571,
0.788820683956146... |
func (w *worker) handleEvents(evts []model.Event) error {
// Make sure we copy r.Key before we return, since it may be a pointer
// into a buffer that will be overwritten.
kis := make([]keyInfo, 0, len(evts))
for i, evt := range evts {
if evt.Type == model.EventGetHit {
kis = kis[:i+1]
kis[i] = keyInfo{evt.... | [
-0.1434963047504425,
0.1666674166917801,
0.6385594606399536,
0.01131138764321804,
0.16122926771640778,
-0.6586042642593384,
0.3746296763420105,
-0.8705284595489502,
0.013710692524909973,
-0.08188199251890182,
-0.17960111796855927,
-1.0646512508392334,
-0.44619542360305786,
-0.0269012544304... |
func (w *worker) top(k int) []hotlist.Entry {
w.topRequest <- k
return <-w.topReply
} | [
-1.606354832649231,
0.17932234704494476,
0.5927037000656128,
-0.10096260905265808,
0.23911020159721375,
-0.06623969972133636,
-0.5764936804771423,
0.0016644886927679181,
0.1609632521867752,
0.8246362805366516,
-0.7638776898384094,
-0.15212328732013702,
-0.4422589838504791,
0.29158216714859... |
func (w *worker) reset() {
w.resetRequest <- true
} | [
-0.9181236624717712,
0.5843682289123535,
0.1854712963104248,
0.5420072078704834,
0.9399944543838501,
0.19368229806423187,
0.24259760975837708,
-0.6934232711791992,
-1.2796862125396729,
-0.2593590319156647,
-0.4304729104042053,
0.7968780994415283,
-0.9855808615684509,
0.007217967417091131,
... |
func (w *worker) close() {
close(w.kisChan)
} | [
0.5601308941841125,
-0.08568024635314941,
0.3332984149456024,
0.04820425063371658,
-0.6033008694648743,
0.9536787271499634,
0.05949220061302185,
-0.8670221567153931,
-0.9225234389305115,
-0.9694620370864868,
-0.0013062357902526855,
-0.23050175607204437,
-0.544300377368927,
1.58048498630523... |
func (dd *dictDecoder) init(size int, dict []byte) {
*dd = dictDecoder{hist: dd.hist}
if cap(dd.hist) < size {
dd.hist = make([]byte, size)
}
dd.hist = dd.hist[:size]
if len(dict) > len(dd.hist) {
dict = dict[len(dict)-len(dd.hist):]
}
dd.wrPos = copy(dd.hist, dict)
if dd.wrPos == len(dd.hist) {
dd.wrPo... | [
-0.2412741333246231,
0.21463219821453094,
0.6806735992431641,
-1.4578593969345093,
-0.905632734298706,
0.17760835587978363,
0.05932699143886566,
0.7182539701461792,
-0.11700785160064697,
-0.4526217579841614,
-0.5346839427947998,
0.4610981345176697,
0.4821058511734009,
1.2327028512954712,
... |
func (dd *dictDecoder) histSize() int {
if dd.full {
return len(dd.hist)
}
return dd.wrPos
} | [
0.3632258474826813,
0.8794839382171631,
0.4665374755859375,
-1.082217812538147,
-0.40887364745140076,
-0.4556327760219574,
0.33204349875450134,
0.4465057849884033,
-0.14529024064540863,
-0.624221920967102,
-0.322050005197525,
0.051439885050058365,
0.000024074162865872495,
0.663611888885498... |
func (dd *dictDecoder) availRead() int {
return dd.wrPos - dd.rdPos
} | [
-0.18652749061584473,
0.024088112637400627,
0.4700639545917511,
-2.1542446613311768,
-1.065035104751587,
0.676277756690979,
0.2550719082355499,
0.07193915545940399,
-0.6048523783683777,
0.025767317041754723,
0.5751259922981262,
0.7185159921646118,
-0.313235342502594,
0.0010963563108816743,... |
func (dd *dictDecoder) availWrite() int {
return len(dd.hist) - dd.wrPos
} | [
-0.9213338494300842,
0.2838975191116333,
0.3457552194595337,
-1.169286847114563,
0.2539680302143097,
-0.01737266033887863,
0.6484863758087158,
0.7494708895683289,
-0.7455060482025146,
0.41927945613861084,
-0.11239395290613174,
0.1843048632144928,
-0.024925388395786285,
0.7585358619689941,
... |
func (dd *dictDecoder) writeSlice() []byte {
return dd.hist[dd.wrPos:]
} | [
-1.6410263776779175,
-0.057406116276979446,
0.41625428199768066,
-0.6507169008255005,
0.5686711668968201,
-0.8185710906982422,
-0.3369692265987396,
0.1958402693271637,
-0.5926170349121094,
-0.7168282866477966,
0.24924135208129883,
0.2252701222896576,
-0.24403110146522522,
0.726936042308807... |
func (dd *dictDecoder) writeMark(cnt int) {
dd.wrPos += cnt
} | [
-1.3889567852020264,
0.47801241278648376,
0.3244718611240387,
-1.1300443410873413,
1.5499945878982544,
-0.611892819404602,
0.830350399017334,
0.4247490465641022,
-0.549667477607727,
-0.8074796199798584,
-0.989537239074707,
0.3639572858810425,
0.4225400388240814,
0.9602884650230408,
0.234... |
func (dd *dictDecoder) writeByte(c byte) {
dd.hist[dd.wrPos] = c
dd.wrPos++
} | [
-0.4969496726989746,
0.43537816405296326,
0.38188377022743225,
-0.8995231986045837,
1.2112354040145874,
0.23038704693317413,
0.9186208844184875,
0.5934295654296875,
-0.2926899492740631,
-0.8088167309761047,
-0.48250293731689453,
0.1869591474533081,
-0.32011112570762634,
1.291467308998108,
... |
func (dd *dictDecoder) writeCopy(dist, length int) int {
dstBase := dd.wrPos
dstPos := dstBase
srcPos := dstPos - dist
endPos := dstPos + length
if endPos > len(dd.hist) {
endPos = len(dd.hist)
}
// Copy non-overlapping section after destination position.
//
// This section is non-overlapping in that the co... | [
-0.6360177993774414,
-0.2420443445444107,
1.0267305374145508,
-1.11587393283844,
-1.3088886737823486,
0.14755135774612427,
0.8214635848999023,
0.21690566837787628,
-0.51743483543396,
0.3111855089664459,
-0.5355721116065979,
0.055951058864593506,
0.07877814024686813,
-0.22105993330478668,
... |
func (dd *dictDecoder) tryWriteCopy(dist, length int) int {
dstPos := dd.wrPos
endPos := dstPos + length
if dstPos < dist || endPos > len(dd.hist) {
return 0
}
dstBase := dstPos
srcPos := dstPos - dist
// Copy possibly overlapping section before destination position.
loop:
dstPos += copy(dd.hist[dstPos:endPo... | [
-1.1401206254959106,
0.028168560937047005,
0.7951646447181702,
-1.0079231262207031,
-1.1259115934371948,
-0.10866522789001465,
0.5107419490814209,
-0.1789368987083435,
-0.4559791386127472,
-0.02573738619685173,
0.04221079871058464,
0.1684654951095581,
0.4026879668235779,
-0.033478192985057... |
func (dd *dictDecoder) readFlush() []byte {
toRead := dd.hist[dd.rdPos:dd.wrPos]
dd.rdPos = dd.wrPos
if dd.wrPos == len(dd.hist) {
dd.wrPos, dd.rdPos = 0, 0
dd.full = true
}
return toRead
} | [
-0.35137319564819336,
0.3972885310649872,
0.5456429123878479,
-1.1633278131484985,
-0.48840245604515076,
0.017844416201114655,
0.03228479623794556,
-0.3849008083343506,
-0.5453295707702637,
-1.1560665369033813,
0.40695247054100037,
1.1575409173965454,
0.148674875497818,
0.7525126338005066,... |
func setupDir(c testutil.Cleanuper) {
testutil.InTempDir(c)
writeFile("a.go", `package x
//elvdoc:fn f2
//
// Function 2 from a.
//
// Some indented code.
`)
writeFile("b.go", `package x
//elvdoc:fn f1
//
// Function 1 from b.
//elvdoc:var v2
//
// Variable 2 from b.
`)
writeFile("c.go", `package x
//elvdoc:va... | [
0.1770065277814865,
0.22510851919651031,
0.7924621105194092,
-0.1530376821756363,
0.3541453182697296,
0.3502426743507385,
0.8918945789337158,
0.5899648070335388,
-0.11829279363155365,
-0.15973511338233948,
0.28221240639686584,
-0.36599019169807434,
0.7268248200416565,
0.5112131237983704,
... |
func hello(name string){
fmt.Println("Hello" , name)
} | [
1.1037788391113281,
-0.6951029300689697,
0.6573045253753662,
0.16905046999454498,
-0.6672185659408569,
0.7872796058654785,
-0.03670848533511162,
0.4136887490749359,
-0.9630056023597717,
-0.3360501527786255,
-1.1062504053115845,
1.0242656469345093,
0.3607606589794159,
-0.18302121758460999,
... |
func (format *Envelope) Configure(conf core.PluginConfig) error {
plugin, err := core.NewPluginWithType(conf.GetString("EnvelopeFormatter", "format.Forward"), conf)
if err != nil {
return err
}
format.base = plugin.(core.Formatter)
format.prefix = shared.Unescape(conf.GetString("EnvelopePrefix", ""))
format.po... | [
0.11297808587551117,
-0.7759597301483154,
0.594946026802063,
-0.5000120401382446,
0.11621429771184921,
-1.0659774541854858,
-0.131422221660614,
0.5535807013511658,
-0.26810434460639954,
-0.39908021688461304,
-0.7298588752746582,
0.07255715876817703,
-0.07013086974620819,
1.1971595287322998... |
func (format *Envelope) Format(msg core.Message) ([]byte, core.MessageStreamID) {
basePayload, streamID := format.base.Format(msg)
prefixLen := len(format.prefix)
baseLen := len(basePayload)
postfixLen := len(format.postfix)
payload := make([]byte, prefixLen+baseLen+postfixLen)
if prefixLen > 0 {
prefixLen =... | [
0.2646377384662628,
-0.9962010383605957,
0.5992794036865234,
-0.7155793905258179,
-0.7603690028190613,
-0.8646620512008667,
-0.016164405271410942,
-0.7084968090057373,
0.5752130746841431,
-0.29835328459739685,
0.35702845454216003,
0.6097348928451538,
-0.5984283685684204,
1.4975876808166504... |
func NewClient(httpClient *http.Client, URL string, Token string, Source string, SourceType string, Index string) (*Client) {
// Create a new client
if httpClient == nil {
tr := &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}} // turn off certificate checking
httpClient = &http.Client{Timeo... | [
0.37182027101516724,
0.19377098977565765,
0.3522152602672577,
-0.07392290234565735,
-0.5348794460296631,
0.35516175627708435,
-0.008810375817120075,
-0.12966638803482056,
0.10551027953624725,
-0.2023942470550537,
-0.3486514985561371,
0.5517038106918335,
-0.9509653449058533,
-1.003922939300... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.