text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (r *warmupRunnable) Start(ctx context.Context) error {
log := ctrl.LoggerFrom(ctx)
if r.warmupInterval == 0 {
r.warmupInterval = defaultWarmupInterval
}
if r.warmupTimeout == 0 {
r.warmupTimeout = defaultWarmupTimeout
}
ctx, cancel := context.WithTimeout(ctx, r.warmupTimeout)
defer cancel()
err := wai... | [
-0.3367997705936432,
0.2464553862810135,
0.724033534526825,
-0.3413110077381134,
0.02862096019089222,
-0.1928892433643341,
-0.13177403807640076,
0.9199711680412292,
-0.1429894119501114,
0.25619247555732727,
-0.7884775996208191,
0.7201189994812012,
-0.27073410153388977,
-0.00240866374224424... |
func warmupRegistry(ctx context.Context, client client.Client, reader client.Reader, runtimeClient runtimeclient.Client) error {
log := ctrl.LoggerFrom(ctx)
var errs []error
extensionConfigList := runtimev1.ExtensionConfigList{}
if err := reader.List(ctx, &extensionConfigList); err != nil {
return errors.Wrapf(... | [
0.023253390565514565,
0.4241533875465393,
0.8707695007324219,
0.09294240921735764,
0.11608428508043289,
-0.8197665810585022,
0.6133553981781006,
0.7457716464996338,
0.5417967438697815,
0.7820636630058289,
-0.19009186327457428,
0.3333050012588501,
-0.27076059579849243,
0.6576173305511475,
... |
func NewFileShare(ctx *pulumi.Context,
name string, args *FileShareArgs, opts ...pulumi.ResourceOption) (*FileShare, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AdminUser == nil {
return nil, errors.New("invalid value for required argument 'AdminUser'")
... | [
0.40227407217025757,
0.9820166230201721,
0.43942174315452576,
0.5293432474136353,
0.21418194472789764,
0.4812881052494049,
-0.3208037316799164,
0.2614731788635254,
-0.9883835315704346,
0.09701195359230042,
-0.4245264530181885,
-0.1009034588932991,
-0.7694476246833801,
0.8353778123855591,
... |
func GetFileShare(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *FileShareState, opts ...pulumi.ResourceOption) (*FileShare, error) {
var resource FileShare
err := ctx.ReadResource("azure-native:storsimple/v20161001:FileShare", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
... | [
0.7213343381881714,
0.3896510601043701,
0.3097970485687256,
0.5508715510368347,
0.18830858170986176,
-0.23739312589168549,
-0.800347626209259,
-0.16238541901111603,
0.24045896530151367,
-0.9766095876693726,
0.3201647400856018,
0.41724371910095215,
-0.2766305208206177,
-0.9939681887626648,
... |
func (app *specificTokenCodeBuilder) Create() SpecificTokenCodeBuilder {
return createSpecificTokenCodeBuilder()
} | [
0.7718949317932129,
-0.04764040559530258,
0.0033520048018544912,
1.2393033504486084,
-0.5041072368621826,
-0.21870779991149902,
-0.8121597170829773,
1.1195509433746338,
0.47032326459884644,
-0.7735576033592224,
-0.22123417258262634,
0.6703387498855591,
-0.0834575966000557,
0.76836133003234... |
func (app *specificTokenCodeBuilder) WithVariableName(variableName string) SpecificTokenCodeBuilder {
app.variableName = variableName
return app
} | [
1.1160213947296143,
-0.9030615091323853,
0.13239894807338715,
0.6426841020584106,
-1.3148592710494995,
0.044553663581609726,
-0.7326961755752563,
1.2383253574371338,
0.9874870181083679,
-0.08698376268148422,
-0.952668309211731,
0.23417063057422638,
0.29613763093948364,
0.04480365663766861,... |
func (app *specificTokenCodeBuilder) WithAmount(amount string) SpecificTokenCodeBuilder {
app.amount = amount
return app
} | [
0.6596689224243164,
-0.8828933835029602,
0.1941559910774231,
0.1894754320383072,
-1.2691444158554077,
-0.08493058383464813,
-0.03500973433256149,
0.5748428106307983,
1.194817066192627,
0.05123097822070122,
-0.441023051738739,
0.3663347363471985,
0.9228725433349609,
0.6073947548866272,
0.... |
func (app *specificTokenCodeBuilder) WithPatternVariable(pattern string) SpecificTokenCodeBuilder {
app.patternVariable = pattern
return app
} | [
-0.206099271774292,
-0.3821954131126404,
0.13087192177772522,
-0.11202039569616318,
-0.43958067893981934,
0.2577086091041565,
0.28318387269973755,
0.5394320487976074,
0.7462072968482971,
-0.37269458174705505,
-1.1578022241592407,
1.2545353174209595,
0.4520657956600189,
0.16366790235042572,... |
func (app *specificTokenCodeBuilder) Now() (SpecificTokenCode, error) {
if app.variableName == "" {
return nil, errors.New("the variableName is mandatory in order to build a SpecificTokenCode instance")
}
if app.patternVariable == "" {
return nil, errors.New("the pattern variable is mandatory in order to build ... | [
0.5721922516822815,
-0.893883466720581,
0.34481126070022583,
0.5176705121994019,
-0.3620372712612152,
-0.7887697219848633,
-0.26513180136680603,
0.5829927325248718,
-0.3459738492965698,
-0.5608994960784912,
-0.40505772829055786,
0.8919247984886169,
0.3967803120613098,
0.5991382598876953,
... |
func RemoveUnicodeNull(str string) string {
return strings.Replace(str, "\x00", "", -1)
} | [
0.20086218416690826,
-1.3762346506118774,
0.46903371810913086,
0.2887825071811676,
-0.7744945883750916,
-0.0981176495552063,
-0.2378992885351181,
1.1265965700149536,
0.9629119634628296,
0.1332259625196457,
-0.8498442769050598,
0.354155957698822,
-0.8462681770324707,
-0.09549415856599808,
... |
func (*GetOssTokenReq) Descriptor() ([]byte, []int) {
return file_api_proto_msg_GetOssToken_proto_rawDescGZIP(), []int{0}
} | [
-0.9709047079086304,
0.41000792384147644,
0.5758622884750366,
0.3160133361816406,
0.5683273077011108,
-0.5845288634300232,
-0.00395637471228838,
0.5686780214309692,
-0.8212398886680603,
-1.2681946754455566,
-0.3513590693473816,
1.6643495559692383,
0.18022815883159637,
1.4998732805252075,
... |
func (*GetOssTokenRsp) Descriptor() ([]byte, []int) {
return file_api_proto_msg_GetOssToken_proto_rawDescGZIP(), []int{1}
} | [
0.34677615761756897,
-0.051975276321172714,
-0.015760740265250206,
-0.2648245394229889,
0.12231883406639099,
-0.6385455131530762,
-0.9218000173568726,
-0.26983949542045593,
0.04433388635516167,
-0.7438256144523621,
-0.03488701581954956,
0.7050251364707947,
-0.969865083694458,
0.63336658477... |
func NewTranslator() common.Translator[component.Config] {
return NewTranslatorWithName("")
} | [
0.21446900069713593,
-0.3205694854259491,
0.19604574143886566,
-0.46042943000793457,
-1.3065391778945923,
-0.4764745235443115,
-0.3579210638999939,
0.03565401956439018,
0.009672923013567924,
-0.6535922288894653,
-0.48559582233428955,
-0.7173038125038147,
-0.2731481194496155,
0.318313628435... |
func NewTranslatorWithName(name string) common.Translator[component.Config] {
return &translator{name, tcplogreceiver.NewFactory()}
} | [
-0.004370967857539654,
-0.3669322729110718,
0.18583518266677856,
-0.5233402252197266,
-1.7406673431396484,
-1.2109990119934082,
-0.5675126314163208,
-0.2632254362106323,
0.5874274969100952,
0.04524584114551544,
-1.3704532384872437,
-1.2005736827850342,
-0.052709758281707764,
0.704509317874... |
func (t *translator) Translate(conf *confmap.Conf) (component.Config, error) {
if !conf.IsSet(baseKey) ||
(conf.IsSet(common.ConfigKey(serviceAddressKey)) && !strings.Contains(fmt.Sprintf("%v", conf.Get(serviceAddressKey)), common.Tcp)) {
return nil, &common.MissingKeyError{ID: t.ID(), JsonKey: fmt.Sprintf("missin... | [
-0.08627785742282867,
0.037364453077316284,
0.6003231406211853,
-0.6313084959983826,
-0.4441792368888855,
-0.8424890637397766,
0.342042475938797,
0.8150414824485779,
0.1605840027332306,
0.10539726912975311,
-0.3245024085044861,
-0.8866806030273438,
-0.1324692815542221,
0.08384055644273758,... |
func NewLinks(fp []Pair, ends [2]ArcOfer, r [2]vg.Length) (*Links, error) {
for _, p := range fp {
for i, f := range p.Features() {
if f.End() < f.Start() {
return nil, errors.New("rings: inverted feature")
}
if _, err := ends[i].ArcOf(nil, f); err != nil {
return nil, err
}
}
}
return &Links... | [
-0.6808478832244873,
-0.24268358945846558,
0.448194682598114,
0.34245535731315613,
0.2114269882440567,
0.06538639217615128,
0.29110559821128845,
-0.2637389898300171,
-1.120388150215149,
0.13227370381355286,
0.606441855430603,
0.41763418912887573,
-0.3266856372356415,
-0.3273555636405945,
... |
func (r *Links) DrawAt(ca draw.Canvas, cen vg.Point) {
if len(r.Set) == 0 {
return
}
// Check if we have a Bézier and we want more than one segment in the curve.
bez := r.Bezier != nil && r.Bezier.Segments > 1
var pa vg.Path
loop:
for _, fp := range r.Set {
p := fp.Features()
loc := [2]Feature{p[0].Parent... | [
-0.4448697865009308,
-0.23689381778240204,
0.7914261221885681,
-0.7380903959274292,
0.6892469525337219,
0.12148554623126984,
0.34004512429237366,
-0.9767128825187683,
-0.16458193957805634,
-0.2333606332540512,
0.522546648979187,
0.059149667620658875,
0.32197415828704834,
-0.436974585056304... |
func (r *Links) Plot(ca draw.Canvas, plt *plot.Plot) {
trX, trY := plt.Transforms(&ca)
r.DrawAt(ca, vg.Point{trX(r.X), trY(r.Y)})
} | [
0.09550872445106506,
0.8793738484382629,
-0.017056062817573547,
-0.8214374780654907,
0.09249807149171829,
0.04081421718001366,
0.6901309490203857,
-0.2771138846874237,
0.37920379638671875,
-1.1174274682998657,
0.31220167875289917,
1.1784374713897705,
0.7802168130874634,
-0.3460847139358520... |
func (r *Links) GlyphBoxes(plt *plot.Plot) []plot.GlyphBox {
if len(r.Set) == 0 {
return nil
}
rad := float64(r.Radii[0])
if float64(r.Radii[1]) > rad {
rad = float64(r.Radii[1])
}
// If draw a Bézier we need to see if the radius is increased,
// so we mock the drawing, just keeping a record of the furthes... | [
0.09865576773881912,
0.1227123960852623,
0.7315940856933594,
-0.915159285068512,
0.3473389744758606,
0.009904536418616772,
1.0801739692687988,
-0.8419530987739563,
0.3600434362888336,
-0.1981690227985382,
-0.3074272871017456,
0.6198012828826904,
-0.1620212197303772,
0.20357869565486908,
... |
func resolveSymbolPath(module string, symname string, addr uint64, pid int) (string, uint64, error) {
if pid == -1 {
pid = 0
}
modname, offset, err := bccResolveSymname(module, symname, addr, pid)
if err != nil {
return "", 0, fmt.Errorf("unable to locate symbol %s in module %s: %v", symname, module, err)
}
... | [
0.07501906901597977,
-0.661334216594696,
0.35803964734077454,
-0.44735297560691833,
-0.2179173082113266,
-0.4372757077217102,
0.32026204466819763,
0.6001619696617126,
0.21484127640724182,
0.21505576372146606,
-0.5304872989654541,
0.202699676156044,
-0.6012346744537354,
0.8097235560417175,
... |
func getUserSymbolsAndAddresses(module string) ([]*symbolAddress, error) {
symbolCache.lock.Lock()
defer symbolCache.lock.Unlock()
// return previously cached list if it exists
if _, ok := symbolCache.cache[module]; ok {
return symbolCache.cache[module], nil
}
symbolCache.cache[module] = []*symbolAddress{}
sy... | [
-0.6563631892204285,
-0.3786464333534241,
0.5160182118415833,
-0.30009573698043823,
-0.45615002512931824,
-0.6374947428703308,
0.6459408402442932,
-0.5332931280136108,
1.2637412548065186,
0.3477311134338379,
-1.3481948375701904,
0.6211362481117249,
-0.4535328149795532,
1.054269552230835,
... |
func foreach_symbol_callback(symname *C.char, addr C.uint64_t) {
symbolCache.cache[symbolCache.currentModule] =
append(symbolCache.cache[symbolCache.currentModule], &symbolAddress{C.GoString(symname), (uint64)(addr)})
} | [
-0.10484375804662704,
-0.32270750403404236,
0.34120625257492065,
-0.5327914357185364,
-0.22436778247356415,
-0.7886781692504883,
1.0674149990081787,
-0.08957280218601227,
0.9728485345840454,
0.9267953634262085,
-0.5934235453605652,
1.205126166343689,
0.6580851674079895,
0.8460686802864075,... |
func StartOfBilling(t time.Time) time.Time {
return time.Date(t.Year(), t.Month(), 1, 0, 0, 0, 0, time.Local)
} | [
0.6377865076065063,
0.46392807364463806,
0.6051269769668579,
0.4826804995536804,
-0.40332794189453125,
0.5495790243148804,
0.0006465911865234375,
-0.1380137801170349,
0.3315237760543823,
0.857726514339447,
-0.236154243350029,
0.16741369664669037,
0.2895798683166504,
1.0596449375152588,
-... |
func (g *Gorc) Inc() {
g.Lock()
g.count++
g.Unlock()
} | [
0.16314446926116943,
0.23755323886871338,
0.4577554166316986,
-0.6183924078941345,
0.08302493393421173,
1.317208170890808,
0.719272255897522,
0.43619683384895325,
-1.5030267238616943,
-0.15010163187980652,
0.27247104048728943,
0.9236319661140442,
-0.7732040286064148,
0.3302070200443268,
... |
func (g *Gorc) IncBy(b int) {
g.Lock()
g.count += b
g.Unlock()
} | [
-0.1984190046787262,
0.478016197681427,
0.5691654682159424,
-0.11755102872848511,
0.1869955211877823,
0.35025840997695923,
0.879481315612793,
0.183876633644104,
-0.6296770572662354,
0.2915186583995819,
-0.36411404609680176,
0.1797623634338379,
-1.2941851615905762,
-0.12769287824630737,
0... |
func (g *Gorc) Dec() {
g.Lock()
g.count--
g.Unlock()
} | [
0.9385951161384583,
0.2362980842590332,
0.370751291513443,
-0.7857682704925537,
0.9058480262756348,
0.6877232193946838,
1.2253367900848389,
0.4658043384552002,
-1.6936848163604736,
-0.2682536244392395,
0.8323665857315063,
0.016855968162417412,
-0.5733100771903992,
0.031550854444503784,
1... |
func (g *Gorc) DecBy(b int) {
g.Lock()
g.count -= b
g.Unlock()
} | [
0.09240418672561646,
0.2603185176849365,
0.5555870532989502,
-0.32663410902023315,
0.7071175575256348,
-0.22364921867847443,
1.0011367797851562,
0.5285998582839966,
-1.1144235134124756,
0.40605083107948303,
-0.09572414308786392,
-0.5209436416625977,
-1.3520174026489258,
-0.0981691852211952... |
func (g *Gorc) Get() int {
return int(g.count)
} | [
-0.7545121908187866,
0.46063220500946045,
0.5811980962753296,
-1.2874754667282104,
1.3202062845230103,
-0.2681264281272888,
0.16546230018138885,
0.23055461049079895,
-1.6349362134933472,
-0.13945867121219635,
0.21954487264156342,
0.6739776134490967,
-0.8780834078788757,
0.15493935346603394... |
func (g *Gorc) SetWaitMillis(w int) {
g.Lock()
g.waitMillis = time.Duration(w) * time.Millisecond
g.Unlock()
} | [
-0.758497953414917,
-0.7013778686523438,
0.3532490134239197,
-0.7578129768371582,
-0.18480870127677917,
0.8070950508117676,
-0.14159032702445984,
-0.4148883819580078,
-0.11585932224988937,
-0.9994537830352783,
-0.38796085119247437,
0.5338714122772217,
0.012873373925685883,
0.61226534843444... |
func (g *Gorc) Init() {
g.Lock()
g.count = 0
g.waitMillis = 100 * time.Millisecond
g.Unlock()
} | [
0.25851696729660034,
0.2578340172767639,
0.35657820105552673,
-0.8703742623329163,
0.8709006905555725,
0.4447190463542938,
0.3169257640838623,
0.3492310643196106,
-1.5056966543197632,
0.22515234351158142,
0.37429285049438477,
0.7995495200157166,
-0.8558195233345032,
0.3968071937561035,
0... |
func (g *Gorc) WaitLow(w int) {
for g.count >= w {
time.Sleep(g.waitMillis)
}
return
} | [
0.8850425481796265,
0.5234792232513428,
0.30194854736328125,
-0.9597757458686829,
0.23132385313510895,
0.44708532094955444,
0.41738319396972656,
-1.1449817419052124,
-0.9373120069503784,
-0.6423061490058899,
-0.008958935737609863,
-0.302719384431839,
-0.3782419264316559,
0.6503990292549133... |
func (g *Gorc) WaitHigh(w int) {
for g.count <= w {
time.Sleep(g.waitMillis)
}
return
} | [
0.42628538608551025,
0.597257137298584,
0.3519824743270874,
0.05709998309612274,
0.1294456273317337,
0.9370861649513245,
0.21466122567653656,
-0.5326430797576904,
-1.2654390335083008,
-0.9836065173149109,
-0.5280405879020691,
0.328022837638855,
0.10478971153497696,
0.08764638006687164,
0... |
func (o *DeleteMeCommentsCommentIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewDeleteMeCommentsCommentIDOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}... | [
0.10344723612070084,
-1.1889564990997314,
0.678497850894928,
-0.026298779994249344,
0.005082343704998493,
-1.5547741651535034,
0.05058619752526283,
-0.762263834476471,
0.38732948899269104,
0.5769957900047302,
0.5562635660171509,
-0.5706432461738586,
-1.125928521156311,
-0.21839429438114166... |
func NewDeleteMeCommentsCommentIDOK() *DeleteMeCommentsCommentIDOK {
return &DeleteMeCommentsCommentIDOK{}
} | [
0.45392295718193054,
-1.0388842821121216,
0.512877881526947,
-0.1761423647403717,
-0.396236389875412,
-0.4588630497455597,
0.13538780808448792,
-0.34884458780288696,
0.31650838255882263,
0.018123215064406395,
-0.5412396192550659,
-1.1724272966384888,
-0.39500632882118225,
-0.08496443182229... |
func (pr httpProber) ProbeForBody(req *http.Request, timeout time.Duration) (probe.Result, string, string, error) {
pr.transport.DisableCompression = true // removes Accept-Encoding header
client := &http.Client{
Timeout: timeout,
Transport: pr.transport,
CheckRedirect: RedirectChecker(pr.followNonLoc... | [
-0.29374200105667114,
0.23133617639541626,
0.5287336111068726,
-0.04945094883441925,
-0.09031467884778976,
0.18534114956855774,
-0.7804026007652283,
-0.9057363271713257,
0.10947347432374954,
0.9706230163574219,
0.14951001107692719,
-0.6939839720726013,
-0.7262994050979614,
0.56986445188522... |
func Mul128(x, y uint64) (z1, z0 uint64) {
// Split x and y into 2 halfwords each, multiply
// the halfwords separately while avoiding overflow,
// and return the product as 2 words.
const (
W = uint(unsafe.Sizeof(x)) * 8;
W2 = W / 2;
B2 = 1 << W2;
M2 = B2 - 1;
)
if x < y {
x, y = y, x
}
if x < B2 ... | [
-0.2394661009311676,
0.30448469519615173,
0.7284252047538757,
-0.34411588311195374,
-0.6720819473266602,
-0.12085525691509247,
0.0010599090019240975,
-0.7615526914596558,
0.4425404667854309,
1.068220615386963,
-0.4283635914325714,
0.6034353375434875,
-0.11423467844724655,
0.418848812580108... |
func MulAdd128(x, y, c uint64) (z1, z0 uint64) {
// Split x and y into 2 halfwords each, multiply
// the halfwords separately while avoiding overflow,
// and return the product as 2 words.
const (
W = uint(unsafe.Sizeof(x)) * 8;
W2 = W / 2;
B2 = 1 << W2;
M2 = B2 - 1;
)
// TODO(gri) Should implement spec... | [
0.15077409148216248,
0.07106652110815048,
0.6005449891090393,
-0.7362961173057556,
-0.41832342743873596,
0.23961856961250305,
0.19533273577690125,
-1.0253334045410156,
0.24824519455432892,
0.8273847699165344,
-0.14264671504497528,
0.73371821641922,
-0.30822378396987915,
0.23394456505775452... |
func Div128(x1, x0, y uint64) (q, r uint64) {
if x1 == 0 {
q, r = x0/y, x0%y;
return;
}
// TODO(gri) Implement general case.
panic("Div128 not implemented for x > 1<<64-1");
} | [
-0.40621066093444824,
0.39205795526504517,
0.11455107480287552,
0.10278118401765823,
-0.23895502090454102,
0.09414695203304291,
-0.5274892449378967,
-0.2925183176994324,
0.05050782114267349,
0.8298749923706055,
0.5082811117172241,
0.42595288157463074,
-0.08928880095481873,
0.49508348107337... |
func (s *Server) Run() error {
opentracing.SetGlobalTracer(s.Tracer)
if s.Port == 0 {
return fmt.Errorf("server port must be set")
}
s.uuid = uuid.New().String()
opts := []grpc.ServerOption{
grpc.KeepaliveParams(keepalive.ServerParameters{
Timeout: 120 * time.Second,
}),
grpc.KeepaliveEnforcementPoli... | [
-1.1396349668502808,
0.5160569548606873,
1.0179181098937988,
-0.8692987561225891,
0.7070958018302917,
0.4554000198841095,
0.5060433745384216,
0.8133100867271423,
-0.2664971649646759,
1.1231460571289062,
-0.820442259311676,
0.6608254313468933,
-0.8358647227287292,
-0.08325301855802536,
1.... |
func (s *Server) Shutdown() {
s.Registry.Deregister(s.uuid)
} | [
-1.0110020637512207,
0.4374281167984009,
0.1431945413351059,
-0.14054033160209656,
0.6233819127082825,
0.6117482781410217,
0.1232716292142868,
1.9948757886886597,
0.6138423681259155,
0.6877868175506592,
-0.7288617491722107,
1.6125775575637817,
-1.039681077003479,
0.10541441291570663,
0.3... |
func (s *Server) MakeReservation(ctx context.Context, req *pb.Request) (*pb.Result, error) {
res := new(pb.Result)
res.HotelId = make([]string, 0)
// session, err := mgo.Dial("mongodb-reservation")
// if err != nil {
// panic(err)
// }
// defer session.Close()
session := s.MongoSession.Copy()
defer session.C... | [
-1.1468168497085571,
0.606680691242218,
1.066653847694397,
-0.22898606956005096,
0.04520299658179283,
0.2622809410095215,
0.07085894793272018,
0.5978653430938721,
-0.7793878316879272,
0.9907628297805786,
-0.3772696256637573,
0.25966691970825195,
-0.8470396995544434,
0.29642564058303833,
... |
func (s *Server) CheckAvailability(ctx context.Context, req *pb.Request) (*pb.Result, error) {
res := new(pb.Result)
res.HotelId = make([]string, 0)
// session, err := mgo.Dial("mongodb-reservation")
// if err != nil {
// panic(err)
// }
// defer session.Close()
session := s.MongoSession.Copy()
defer session... | [
-1.145076036453247,
-0.01630493439733982,
1.11485755443573,
0.7681877017021179,
-0.15347425639629364,
0.10635887086391449,
0.4565292298793793,
0.5258558392524719,
-0.2523244321346283,
1.4809162616729736,
-0.5505123734474182,
-0.23190368711948395,
-0.6445676684379578,
1.3049236536026,
0.8... |
func New() (*Config, error) {
config, err := initViper()
return config, err
} | [
-0.13746650516986847,
-0.26089969277381897,
0.16794493794441223,
0.836639940738678,
-1.3613603115081787,
-0.5864889621734619,
-0.43619808554649353,
0.6691208481788635,
-0.6888331174850464,
0.322725772857666,
-1.0277013778686523,
-0.13351121544837952,
0.5127155780792236,
0.34630563855171204... |
func (r *CassandraRestoreReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
ctx := context.Background()
_ = r.Log.WithValues("cassandrarestore", req.NamespacedName)
instance := &api.CassandraRestore{}
err := r.Get(ctx, req.NamespacedName, instance)
if err != nil {
if errors.IsNotFound(err) {
retu... | [
-0.26715216040611267,
0.19405414164066315,
0.9426091313362122,
-0.5797683000564575,
0.03167814388871193,
-0.5015543103218079,
-0.6278931498527527,
0.4446018934249878,
0.3181479275226593,
0.23794522881507874,
0.13431832194328308,
-0.46069926023483276,
-1.1163125038146973,
0.5103317499160767... |
func NewFoo() *Foo {
return &Foo{}
} | [
0.7851318120956421,
-0.4484928548336029,
0.18382130563259125,
0.8303797245025635,
-0.5386659502983093,
-0.8756590485572815,
-0.19042907655239105,
-0.49561449885368347,
-1.166530728340149,
-0.9782124161720276,
-0.7597289681434631,
0.6655385494232178,
0.20823298394680023,
0.4160343408584595,... |
func FormatBytes(i int64) string {
const (
KiB = 1024
MiB = 1048576
GiB = 1073741824
TiB = 1099511627776
)
switch {
case i >= TiB:
return fmt.Sprintf("%.02fTiB", float64(i)/TiB)
case i >= GiB:
return fmt.Sprintf("%.02fGiB", float64(i)/GiB)
case i >= MiB:
return fmt.Sprintf("%.02fMiB", float64(i)/MiB... | [
-0.21036162972450256,
0.16443505883216858,
0.6616647243499756,
-0.7014961242675781,
-0.2161153256893158,
-0.07786858081817627,
0.15784433484077454,
-0.4735040068626404,
-0.04820781201124191,
0.7370845675468445,
1.1499332189559937,
-0.4298884868621826,
-0.8543195128440857,
0.805323481559753... |
func (pi *packetInfo) checkBanMessage() error {
if len(pi.message.Packet) != 1 {
return nil
}
pkt := pi.message.Packet[0]
packet := pkt.GetPacket()
if packet.Message == nil {
return nil
}
if packet.Message.Blame == nil {
return nil
}
if packet.Message.Blame.Reason == message.Reason_LIAR {
banKey :=... | [
0.606508195400238,
-0.20886345207691193,
0.8506433963775635,
0.713910698890686,
0.5290886163711548,
-0.002035539597272873,
-0.07563599944114685,
-0.4828217029571533,
-0.6423422694206238,
0.397812157869339,
-0.4015048146247864,
0.7903010249137878,
-1.3666505813598633,
1.0403329133987427,
... |
func Dial(addr string) (*Conn, error) {
conn, err := net.Dial("tcp", addr)
if err != nil {
return nil, err
}
return newConn(conn)
} | [
0.5598919987678528,
-0.43787726759910583,
0.23766912519931793,
0.6064675450325012,
-0.45214658975601196,
0.23327840864658356,
-0.39148417115211487,
0.8994032144546509,
0.7643004059791565,
0.050126366317272186,
0.292724609375,
0.6060664057731628,
0.8392190337181091,
0.05385735258460045,
-... |
func DialTLS(addr string, cfg *tls.Config) (*Conn, error) {
conn, err := tls.Dial("tcp", addr, cfg)
if err != nil {
return nil, err
}
return newConn(conn)
} | [
1.0319486856460571,
0.11485534906387329,
0.11671347916126251,
-0.5667180418968201,
-1.1306439638137817,
-0.16431815922260284,
-0.9147243499755859,
0.1884014904499054,
0.3091781437397003,
0.6476502418518066,
0.24578166007995605,
0.0698973685503006,
0.47003573179244995,
-0.5115669965744019,
... |
func (c *Conn) WriteMessage(msg interface{}) error {
data, err := xml.Marshal(msg)
if err != nil {
return err
}
color.Printf("@{|}<!-- REQUEST -->\n%s\n\n", string(data))
return c.WriteDataUnit(data)
} | [
-1.1330845355987549,
0.3471284806728363,
0.5853256583213806,
-0.44612130522727966,
1.166809320449829,
0.310776025056839,
-0.48827850818634033,
0.017967049032449722,
0.09044823795557022,
-0.8598830699920654,
0.5733351707458496,
0.1519441306591034,
-0.595270574092865,
1.0509421825408936,
-... |
func (c *Conn) WriteDataUnit(p []byte) error {
s := uint32(4 + len(xml.Header) + len(p))
err := binary.Write(c.Conn, binary.BigEndian, s)
if err != nil {
return err
}
_, err = c.Conn.Write([]byte(xml.Header))
if err != nil {
return err
}
_, err = c.Conn.Write(p)
return err
} | [
-1.2074652910232544,
0.08134748786687851,
0.6432809829711914,
-1.234336018562317,
0.4096902012825012,
0.7366651892662048,
-0.5616340637207031,
0.3484276831150055,
-0.2233598679304123,
-1.0414385795593262,
-0.9960044622421265,
0.3357904553413391,
-0.7368577718734741,
-0.0665767565369606,
... |
func (c *Conn) ReadResponse(rmsg *Response) error {
data, err := c.ReadDataUnit()
if err != nil {
return err
}
color.Printf("@{c}<!-- RESPONSE -->\n%s\n\n", string(data))
err = xml.Unmarshal(data, rmsg)
if err != nil {
return err
}
// color.Fprintf(os.Stderr, "@{y}%s\n", spew.Sprintf("%+v", msg))
if len(rm... | [
0.46307164430618286,
-0.39224132895469666,
0.7121953368186951,
-0.1583031415939331,
-0.2901197373867035,
-0.7184023857116699,
-0.3134908378124237,
-0.7295646667480469,
0.4241662323474884,
-0.6761568784713745,
0.8242131471633911,
-0.16408711671829224,
-1.3747822046279907,
-0.287101089954376... |
func (c *Conn) ReadDataUnit() (data []byte, err error) {
var s uint32
err = binary.Read(c.Conn, binary.BigEndian, &s)
if err != nil {
return
}
data = make([]byte, s)
n, err := c.Conn.Read(data)
if err != nil {
return
}
if 4+n != int(s) {
return data, io.ErrNoProgress
}
return data, nil
} | [
-0.4914209842681885,
0.38590916991233826,
0.7152720093727112,
-0.731354296207428,
-0.4368889033794403,
0.3411509096622467,
-0.6526556015014648,
-0.23559603095054626,
-0.4079303741455078,
-1.0094395875930786,
0.04832014814019203,
0.7034496068954468,
-0.8760470747947693,
-0.3754563331604004,... |
func FromPixels(x, y int) Size {
return Size{FromPixelsX(x), FromPixelsY(y)}
} | [
0.5025362372398376,
0.003906617406755686,
0.5360802412033081,
-1.840340256690979,
-0.8733372092247009,
0.5409215092658997,
-1.6074724197387695,
-1.2197102308273315,
0.7436931729316711,
-0.11124905198812485,
0.537813663482666,
-0.1905544549226761,
0.3687768578529358,
-0.41300317645072937,
... |
func (s *Size) IsZero() bool {
return s.Width == 0 && s.Height == 0
} | [
-0.52864670753479,
-1.0067164897918701,
0.25327053666114807,
0.9864845871925354,
0.07325670123100281,
-0.663139820098877,
-0.16876500844955444,
-0.0010476006427779794,
1.0977582931518555,
-0.3488311171531677,
-0.2762327492237091,
0.8569415807723999,
-0.4753146469593048,
0.8897225856781006,... |
func (s *Size) String() string {
return "(" + s.Width.String() + "x" + s.Height.String() + ")"
} | [
-0.16187255084514618,
-0.9200751781463623,
0.2815234363079071,
-0.8047379851341248,
-1.072581171989441,
0.0023121933918446302,
0.22816987335681915,
-1.609971284866333,
0.3146565854549408,
0.17349672317504883,
-0.6449777483940125,
0.5152589678764343,
0.2698916792869568,
-0.45274415612220764... |
func PossibleCodeValues() []Code {
return []Code{BadRequest, Conflict, NotFound}
} | [
-0.9088425636291504,
-0.22573937475681305,
0.2754528224468231,
1.2782034873962402,
-0.1518820822238922,
0.5016588568687439,
-0.7976759076118469,
0.8034202456474304,
0.17265596985816956,
-0.6414951086044312,
-0.5549384951591492,
0.16648052632808685,
-0.15869314968585968,
1.487267255783081,
... |
func PossibleStateValues() []State {
return []State{Active, Deleted}
} | [
-0.3823064863681793,
-0.5135828852653503,
0.2886728346347809,
0.4969855546951294,
-0.9537860155105591,
0.08167237788438797,
-1.019104242324829,
0.9053511023521423,
0.5596652626991272,
-0.44809940457344055,
-0.6952376961708069,
-0.01813509501516819,
0.42809951305389404,
0.3494117259979248,
... |
func (c *Config) Client() (*Conn, error) {
cf := singularity.NewConfig().
SetHost(c.Host).
SetPort(c.Port).
SetRetry(c.Retry).
Build()
client := singularity.NewClient(cf)
return &Conn{
sclient: client,
}, nil
} | [
0.20100708305835724,
-0.2673299312591553,
0.1139010563492775,
0.7567217946052551,
-0.5652445554733276,
0.2904905676841736,
0.2896672785282135,
1.2381608486175537,
-0.3717177212238312,
-0.33665281534194946,
-0.7144138216972351,
0.9495724439620972,
0.1558910757303238,
-0.6183407306671143,
... |
func WriteSSLFiles(dir string, certData, keyData []byte, logger logrus.FieldLogger) (sslCertPath,
sslKeyPath string, err error) {
ctx := logger.WithField("method", "loadSSLFiles")
sslCertPath = path.Join(dir, sslCertFilename)
sslKeyPath = path.Join(dir, sslKeyFilename)
// Write cert and key to file.
errF := iout... | [
-1.008384108543396,
-0.5872067213058472,
0.5639817714691162,
0.09168357402086258,
0.3346841335296631,
0.0779176875948906,
0.18905675411224365,
0.39356720447540283,
-0.49090367555618286,
0.22006995975971222,
-0.554246723651886,
0.03744925931096077,
-0.25999701023101807,
0.3612804114818573,
... |
func LoadPEMBlockFromEnv(envvar string) ([]byte, error) {
s := os.Getenv(envvar)
sA := strings.SplitAfter(s, "----- ")
sA2 := strings.Split(sA[1], " -")
sA = []string{sA[0], sA2[0], sA2[1]}
sA3 := strings.Split(sA2[0], " ")
sF := []string{sA[0]}
sF = append(sF, sA3...)
sF = append(sF, "-"+sA2[1])
s = strin... | [
-0.36241698265075684,
-0.841982364654541,
0.9786600470542908,
0.005174890160560608,
-0.3800917863845825,
-0.056879546493291855,
-0.857262134552002,
-0.4492824077606201,
0.1420474797487259,
0.1864098459482193,
-0.9635664820671082,
0.32857516407966614,
-1.0875173807144165,
0.2259524315595626... |
func watchUntilTimeout(ctx context.Context, timeout time.Duration, w watch.Interface, condition func(event *watch.Event) (bool, error)) error {
ctx, cancelTimeout := context.WithTimeout(ctx, timeout)
defer cancelTimeout()
for {
select {
case <-ctx.Done():
return ctx.Err()
case event := <-w.ResultChan():
... | [
1.005807638168335,
0.32837003469467163,
0.35451820492744446,
-0.26812490820884705,
-0.5138018727302551,
0.5602057576179504,
-0.4463309347629547,
-0.6032606363296509,
-0.12285256385803223,
0.6032670736312866,
0.05962039902806282,
0.4371670186519623,
0.17919810116291046,
0.194842129945755,
... |
func WaitForPodSucceeded(ctx context.Context, pods corev1.PodInterface, podName string, timeout time.Duration) error {
log.Entry(ctx).Infof("Waiting for %s to be complete", podName)
w, err := pods.Watch(ctx, metav1.ListOptions{})
if err != nil {
return fmt.Errorf("initializing pod watcher: %s", err)
}
defer w.S... | [
-0.32657140493392944,
0.28807923197746277,
0.3048034906387329,
-0.23866192996501923,
0.048679519444704056,
0.34966903924942017,
-0.8488173484802246,
0.1312139630317688,
-0.6252685189247131,
-0.20368598401546478,
-0.6304497718811035,
-0.23868009448051453,
0.38000917434692383,
-0.27161973714... |
func WaitForPodInitialized(ctx context.Context, pods corev1.PodInterface, podName string) error {
log.Entry(ctx).Infof("Waiting for %s to be initialized", podName)
w, err := pods.Watch(ctx, metav1.ListOptions{})
if err != nil {
return fmt.Errorf("initializing pod watcher: %s", err)
}
defer w.Stop()
return wat... | [
-0.7962774038314819,
-0.5808925628662109,
0.3355690538883209,
-0.7806610465049744,
0.4018108546733856,
-0.11700595170259476,
-0.4430854916572571,
-0.22997131943702698,
-0.296200692653656,
-0.277183473110199,
-1.124758005142212,
0.006459206808358431,
-0.01858450286090374,
0.2122948318719864... |
func WaitForDeploymentToStabilize(ctx context.Context, c kubernetes.Interface, ns, name string, timeout time.Duration) error {
log.Entry(ctx).Infof("Waiting for %s to stabilize", name)
fields := fields.Set{
"metadata.name": name,
"metadata.namespace": ns,
}
w, err := c.AppsV1().Deployments(ns).Watch(ctx, ... | [
-0.34679868817329407,
0.2987841069698334,
0.43987753987312317,
-1.1464895009994507,
-0.29162558913230896,
0.2323904037475586,
-0.5429471731185913,
-0.9531969428062439,
-0.22271759808063507,
0.4245757758617401,
-0.2003369778394699,
0.23955725133419037,
0.45825934410095215,
0.153930097818374... |
func GetDetailedRequest(requestUID string) DetailedRequest {
db := GetDB()
defer db.Close()
resultingQuery := "SELECT uid, client_ip, method, path, " +
"url, host, time, headers, body, referrer, user_agent " +
"FROM requests WHERE uid = ? LIMIT 1;"
row := db.QueryRow(resultingQuery, requestUID)
var body stri... | [
-0.5467026829719543,
0.6610656976699829,
0.743793249130249,
-0.524093747138977,
-0.5164201259613037,
-0.4647064805030823,
-0.3399290442466736,
-0.3371920883655548,
0.616213858127594,
-0.8819549679756165,
0.3148796558380127,
0.8470426201820374,
-0.0659765675663948,
1.0411429405212402,
0.3... |
func main() {
os.Exit(doit())
} | [
0.3363974392414093,
-0.4127006530761719,
0.2473158836364746,
0.9694211483001709,
1.0760598182678223,
1.2332236766815186,
0.9331969618797302,
-0.29368653893470764,
-1.0537841320037842,
0.112845778465271,
-0.28881242871284485,
0.15241925418376923,
0.3362736701965332,
-0.0970207154750824,
-... |
func newOSProcessContext() (*processContext, error) {
workdir, err := os.Getwd()
if err != nil {
return nil, err
}
return newProcessContext(workdir, os.Stdin, os.Stdout, os.Stderr), nil
} | [
-0.23919819295406342,
-1.2036107778549194,
0.5368979573249817,
-0.5275045037269592,
-0.7404680848121643,
-0.6303074359893799,
0.28439387679100037,
-1.493598461151123,
0.11009553074836731,
-0.0514521449804306,
-0.24722184240818024,
0.01754465326666832,
0.31042441725730896,
0.113077051937580... |
func newTestProcessContext(workdir string) *processContext {
return newProcessContext(workdir, strings.NewReader(""), ioutil.Discard, ioutil.Discard)
} | [
0.5755240321159363,
-1.098294734954834,
0.44228553771972656,
-1.1341854333877563,
-0.47592103481292725,
-0.2660333216190338,
0.25320401787757874,
-1.4222244024276733,
0.746554970741272,
-0.32255661487579346,
0.27992483973503113,
0.3433644771575928,
-0.5468587875366211,
-0.40335679054260254... |
func newProcessContext(workdir string, stdin io.Reader, stdout, stderr io.Writer) *processContext {
return &processContext{
workdir: workdir,
env: os.Environ(),
stdin: stdin,
stdout: stdout,
stderr: stderr,
outlog: log.New(stdout, "", 0),
errlog: log.New(stderr, "gocdk: ", 0),
}
} | [
-0.03031063638627529,
-0.3360620439052582,
0.5515440106391907,
-0.5432828664779663,
-0.8900904059410095,
-0.11998516321182251,
-0.26160287857055664,
-1.0196516513824463,
-0.38999366760253906,
0.09175463020801544,
0.39161089062690735,
0.1164034903049469,
-0.27949780225753784,
0.162013038992... |
func overrideEnv(env []string, vars ...string) []string {
// Setting the slice's capacity to length ensures that a new backing array
// is allocated if len(vars) > 0.
return append(env[:len(env):len(env)], vars...)
} | [
-0.4373495876789093,
-0.021330619230866432,
0.5552863478660583,
0.21816939115524292,
0.8334996104240417,
-0.44265663623809814,
-0.3899974822998047,
0.2303660362958908,
-0.2816492021083832,
-0.05063827708363533,
-0.18189111351966858,
1.1726813316345215,
-0.33081868290901184,
0.2371563166379... |
func (pctx *processContext) resolve(path string) string {
if filepath.IsAbs(path) {
return path
}
return filepath.Join(pctx.workdir, path)
} | [
0.15778188407421112,
-0.13745759427547455,
0.7341883182525635,
-0.11761274933815002,
-0.2177879810333252,
0.794233500957489,
-0.4137439429759979,
-1.2285373210906982,
-0.10992300510406494,
-0.6599009037017822,
1.0486117601394653,
-0.6134375333786011,
-0.6955620646476746,
-0.016944935545325... |
func (pctx *processContext) gcpCredentials(ctx context.Context) (*google.Credentials, error) {
// TODO(light): google.DefaultCredentials uses Getenv directly, so it is
// difficult to disentangle to use processContext.
return gcp.DefaultCredentials(ctx)
} | [
-0.1679753214120865,
0.06154543161392212,
0.10154147446155548,
0.11405964940786362,
1.009377360343933,
0.507825493812561,
-0.7056191563606262,
-1.0359792709350586,
-0.5089873671531677,
0.1783144623041153,
-0.34288468956947327,
0.3183337152004242,
-0.7090405821800232,
0.37486374378204346,
... |
func (pctx *processContext) Logf(format string, a ...interface{}) {
pctx.errlog.Printf(format, a...)
} | [
0.4485783874988556,
-0.6683468222618103,
0.36908280849456787,
-0.33223679661750793,
0.6414217948913574,
0.09151282906532288,
-0.2709181010723114,
0.21854697167873383,
-0.2699994146823883,
-1.1167829036712646,
0.20053203403949738,
1.0700658559799194,
0.10114004462957382,
0.49467945098876953... |
func (pctx *processContext) Printf(format string, a ...interface{}) {
pctx.outlog.Printf(format, a...)
} | [
0.19466102123260498,
-0.3645722270011902,
0.44659850001335144,
-0.05493219569325447,
0.10649093985557556,
0.2098335474729538,
0.32735729217529297,
-0.34295693039894104,
-0.6172600984573364,
-0.8077802658081055,
1.0447864532470703,
0.8172559142112732,
-0.08006357401609421,
0.591733932495117... |
func (pctx *processContext) Println(a ...interface{}) {
pctx.outlog.Println(a...)
} | [
0.030115922912955284,
-0.509393036365509,
0.4531063139438629,
0.35488516092300415,
-0.32155027985572815,
0.28588491678237915,
0.23848360776901245,
-0.36146119236946106,
0.004165380261838436,
-0.6981960535049438,
0.4664286673069,
0.5851953029632568,
0.3205413818359375,
0.1803140491247177,
... |
func (pctx *processContext) ModuleRoot(ctx context.Context) (string, error) {
for dir, prevDir := pctx.workdir, ""; ; dir = filepath.Dir(dir) {
if dir == prevDir {
return "", xerrors.Errorf("couldn't find a Go CDK project root at or above %s", pctx.workdir)
}
prevDir = dir
if _, err := os.Stat(filepath.Join... | [
0.014393049292266369,
0.5515207052230835,
0.49925845861434937,
-0.4822266697883606,
0.2393416166305542,
0.3099586069583893,
0.9865848422050476,
-0.9739943742752075,
0.1606430858373642,
0.9679178595542908,
0.9839071035385132,
1.6296446323394775,
-0.9238385558128357,
0.8408095240592957,
-0... |
func (pctx *processContext) NewCommand(ctx context.Context, dir, name string, arg ...string) *exec.Cmd {
cmd := exec.CommandContext(ctx, name, arg...)
if dir == "" {
cmd.Dir = pctx.workdir
} else {
cmd.Dir = dir
}
cmd.Env = pctx.env
cmd.Stdin = pctx.stdin
cmd.Stdout = pctx.stdout
cmd.Stderr = pctx.stderr
r... | [
0.22517327964305878,
-0.8231056928634644,
0.5116105079650879,
-0.279329776763916,
0.0580902174115181,
0.623492956161499,
-0.030625447630882263,
-0.4063059687614441,
0.4114176332950592,
-0.4890521466732025,
0.9615458250045776,
0.7423545122146606,
-0.011406252160668373,
0.33879828453063965,
... |
func withInterrupt(parent context.Context) (_ context.Context, stop func()) {
sig := make(chan os.Signal, 1)
signal.Notify(sig, interruptSignals()...)
ctx, cancel := context.WithCancel(parent)
done := make(chan struct{})
go func() {
select {
case <-sig:
cancel()
case <-done:
}
}()
return ctx, func() {... | [
0.25352340936660767,
-0.35068976879119873,
0.6295315027236938,
-0.9439334869384766,
-0.8138095736503601,
-0.7034865021705627,
-0.19889295101165771,
-0.5641158819198608,
-0.051184847950935364,
0.17022748291492462,
-0.4656706750392914,
-0.2840304970741272,
-0.3275083899497986,
-0.97704941034... |
func createLongestPrefixSuffix(pat []rune) []int {
lps := make([]int, len(pat))
index := 0
for i := 1; i < len(pat); {
if pat[i] == pat[index] {
lps[i] = index + 1
index++
i++
} else {
if index != 0 {
index = lps[index-1]
} else {
lps[i] = 0
i++
}
}
}
return lps
} | [
-0.13633112609386444,
-0.1598016321659088,
0.8672455549240112,
-0.6163458824157715,
-0.2006092071533203,
-0.0748397558927536,
0.41897475719451904,
0.023835252970457077,
0.9039679169654846,
0.2352752834558487,
-1.0477993488311768,
0.5630290508270264,
-0.15143804252147675,
0.4983768761157989... |
func kmpAlgorithm(src, pat string) {
lps := createLongestPrefixSuffix([]rune(pat))
i := 0
j := 0
for i < len(src) {
if src[i] == pat[j] {
i++
j++
}
if j == len(pat) {
fmt.Println("Pattern Found at index:", i-j)
j = lps[j-1]
} else if src[i] != pat[j] {
if j != 0 {
j = lps[j-1]
} else... | [
0.4600546061992645,
0.23164552450180054,
0.6884969472885132,
-0.5118497610092163,
-0.9598385691642761,
-0.03096349537372589,
0.7812458276748657,
0.08627526462078094,
0.5525935292243958,
1.1783931255340576,
0.07818653434515,
1.0170379877090454,
-0.12096132338047028,
-0.44921445846557617,
... |
func Listener() {
for {
for p, _ := range Config.Feeds {
//fmt.Print("Updating feed: ", Config.Feeds[p].Feed.Title, "\n")
// maybe only do at init step?
str := Config.Feeds[p].Feed.UpdateURL
feed, err := rss.Fetch(str)
if feed != nil {
Config.Feeds[p].Feed = *feed
} else {
//fmt.Println("Go... | [
-0.16213859617710114,
-0.928405225276947,
0.8164771199226379,
-0.481671541929245,
0.2116527557373047,
-0.03396930918097496,
-0.010385722853243351,
0.5980483889579773,
-0.8144933581352234,
0.261208713054657,
0.22879138588905334,
-0.08522837609052658,
-0.3465985655784607,
0.9172479510307312,... |
func Notify(id int) {
resp := ".\n"
resp += "**" + Config.Feeds[id].Feed.Title + ": **" + "\n"
resp += Config.Feeds[id].Feed.Items[0].Date.String() + "\n\n"
// If a 9front feed, extract the user ☺
if strings.Contains(Config.Feeds[id].Feed.Items[0].Link, "http://code.9front.org/hg/") {
lines := strings.Split(Conf... | [
-0.1561773121356964,
-0.1621602475643158,
0.7366465330123901,
-0.5837014317512512,
0.2859862148761749,
-0.49865955114364624,
-0.3920597732067108,
-0.4682649075984955,
-0.7712506055831909,
0.013964537531137466,
-0.7196812629699707,
0.7536405324935913,
0.11416783928871155,
1.031575083732605,... |
func (m *Mux) Last(ds *discordgo.Session, dm *discordgo.Message, ctx *Context) {
resp := ".\n"
id, _ := strconv.Atoi(ctx.Fields[len(ctx.Fields) -1])
if id >= 0 && id < len(Config.Feeds) {
resp += "**" + Config.Feeds[id].Feed.Title + ": **" + "\n"
resp += Config.Feeds[id].Feed.Items[0].Date.String() + "\n\n"
/... | [
0.4245339035987854,
-0.05457785725593567,
1.0885422229766846,
-0.5610479116439819,
0.17245696485042572,
-0.7351032495498657,
-0.6226999759674072,
-0.20120348036289215,
-0.3213498890399933,
0.266410768032074,
-0.32838174700737,
0.6631971597671509,
-0.02873075194656849,
0.28351858258247375,
... |
func (m *Mux) List(ds *discordgo.Session, dm *discordgo.Message, ctx *Context) {
resp := "```\n"
for p, v := range Config.Feeds {
resp += strconv.Itoa(p) + ": " + v.Feed.Title + ", " + v.Feed.Link + "\n"
}
resp += "```\n"
ds.ChannelMessageSend(dm.ChannelID, resp)
return
} | [
-0.09664209932088852,
-0.14964918792247772,
0.5106224417686462,
-1.0960023403167725,
0.7210810780525208,
-0.9298833012580872,
-0.8276743292808533,
-0.13665448129177094,
-0.2593098282814026,
-0.1870015412569046,
-0.360572874546051,
1.4488073587417603,
-0.4677876830101013,
0.8368083834648132... |
func (m *Mux) Add(ds *discordgo.Session, dm *discordgo.Message, ctx *Context) {
if !authorized(dm) {
ds.ChannelMessageSend(dm.ChannelID, "Only the bot owner can do that.")
return
}
//http://code.9front.org/hg/plan9front/rss-log
resp := "```\n"
// URL to feed should be last item
url := ctx.Fields[len(ctx.Fiel... | [
-0.05033780261874199,
0.42846640944480896,
0.8990308046340942,
-0.3358660638332367,
0.6002187728881836,
-0.26895439624786377,
-0.38396957516670227,
-0.2431826889514923,
0.3615197241306305,
-0.6247466206550598,
0.2278968095779419,
0.8459433317184448,
-0.41092991828918457,
0.5691755414009094... |
func (m *Mux) Remove(ds *discordgo.Session, dm *discordgo.Message, ctx *Context) {
if !authorized(dm) {
ds.ChannelMessageSend(dm.ChannelID, "Only the bot owner can do that.")
return
}
//http://code.9front.org/hg/plan9front/rss-log
resp := "```\n"
// ID to feed should be last item
ID, err := strconv.Atoi(ctx.... | [
-0.32588502764701843,
0.7340670824050903,
0.7976830005645752,
-0.5362706184387207,
0.03602612391114235,
-0.42864108085632324,
-0.28834018111228943,
0.22073379158973694,
0.295195996761322,
-0.10026433318853378,
0.057856980711221695,
0.7700856328010559,
-1.166735053062439,
0.0220038909465074... |
func (m *Mux) Subscribe(ds *discordgo.Session, dm *discordgo.Message, ctx *Context) {
resp := "\n"
id, _ := strconv.Atoi(ctx.Fields[len(ctx.Fields) -1])
if id >= 0 && id < len(Config.Feeds) {
var sub Subscription
// Check if already subscribed
for _, v := range Config.Subs {
if v.ChanID == dm.ChannelID &&... | [
0.501995325088501,
0.29902464151382446,
0.7357369661331177,
-0.24627220630645752,
0.05879896879196167,
-0.772979736328125,
-0.5430163145065308,
-0.9869763255119324,
0.3200628459453583,
-0.6388540267944336,
-0.09124898910522461,
1.4033633470535278,
-0.877693772315979,
0.6502894163131714,
... |
func (m *Mux) Unsubscribe(ds *discordgo.Session, dm *discordgo.Message, ctx *Context) {
resp := "\n"
id, _ := strconv.Atoi(ctx.Fields[len(ctx.Fields) -1])
if id >= 0 && id < len(Config.Feeds) {
// Check if subscribed
removed := false
for i, v := range Config.Subs {
if v.ChanID == dm.ChannelID && v.SubID ==... | [
0.6550968885421753,
0.07554233819246292,
0.7974907755851746,
-0.4004148840904236,
-0.2503359615802765,
-0.9396765232086182,
-0.26995447278022766,
-0.34519752860069275,
0.013882922008633614,
-0.16275900602340698,
0.11324205249547958,
0.9715354442596436,
-1.2789887189865112,
0.26695626974105... |
func main() {
flag.Parse()
if err := echoargs(!*n, *s, flag.Args()); err != nil {
fmt.Fprintf(os.Stderr, "echo %v\n", err)
os.Exit(1)
}
} | [
0.38816213607788086,
0.16033300757408142,
0.8322771191596985,
1.0652406215667725,
-0.07116100937128067,
0.9037439227104187,
-0.4231084883213043,
0.3659471273422241,
-1.1964284181594849,
0.34363654255867004,
0.4163682162761688,
0.10221267491579056,
-0.40602225065231323,
-0.02269945293664932... |
func GetPlayerActions(playerID uint, matchID uint, data common.IDatasource) (*PlayerMatchStats, error) {
// On récupère le joueur
player, err := data.GetPlayer(playerID)
if err != nil {
return nil, err
}
// On récupère le match
match, err := data.GetMatch(matchID)
if err != nil {
return nil, err
}
player... | [
-0.2283257097005844,
-0.6212809681892395,
1.0015230178833008,
-0.8714615106582642,
-0.1164899617433548,
-1.0985398292541504,
0.10692322254180908,
-0.37732547521591187,
-0.05394696444272995,
0.28400328755378723,
-0.5621755719184875,
0.011855078861117363,
-0.447663813829422,
-0.2952502667903... |
func NewStoredChannel(netID, name string) *StoredChannel {
return &StoredChannel{netID, name, make(JSONStorer)}
} | [
0.1118946224451065,
-0.4284873604774475,
0.02444838546216488,
-0.41087326407432556,
-0.5856547355651855,
0.3126083016395569,
-0.7901413440704346,
-1.138208031654358,
0.3755318522453308,
-1.049141764640808,
-0.8155902624130249,
0.5003601312637329,
-0.1103389635682106,
0.17224572598934174,
... |
func (s *StoredChannel) Clone() *StoredChannel {
return &StoredChannel{s.NetID, s.Name, s.JSONStorer.Clone()}
} | [
0.2392687052488327,
-0.837195098400116,
0.2488248497247696,
-0.19090959429740906,
-0.42211252450942993,
0.47956302762031555,
-0.9434930682182312,
-1.4050183296203613,
0.8339893817901611,
-0.5036059617996216,
-0.2087465524673462,
1.0239015817642212,
-0.3423433303833008,
-0.4221023917198181,... |
func (s *StoredChannel) makeID() string {
return strings.ToLower(fmt.Sprintf("%s.%s", s.Name, s.NetID))
} | [
0.9434340000152588,
-0.9355853796005249,
0.40554744005203247,
-1.3073397874832153,
-0.04398875683546066,
0.9962812066078186,
-0.6171157956123352,
-0.7661199569702148,
0.6685731410980225,
-0.13026952743530273,
0.2065793126821518,
0.12629763782024384,
-0.5804495215415955,
-0.2535982728004455... |
func (s *StoredChannel) serialize() ([]byte, error) {
buffer := &bytes.Buffer{}
encoder := gob.NewEncoder(buffer)
err := encoder.Encode(s)
if err != nil {
return nil, err
}
return buffer.Bytes(), nil
} | [
0.15409842133522034,
0.7257978320121765,
0.31955817341804504,
-0.39533743262290955,
1.1621402502059937,
-0.813231348991394,
-0.7024008631706238,
-0.6882312893867493,
0.14190831780433655,
0.04275161400437355,
-0.35155951976776123,
1.0234929323196411,
-1.7738010883331299,
0.5041473507881165,... |
func deserializeChannel(serialized []byte) (*StoredChannel, error) {
buffer := &bytes.Buffer{}
decoder := gob.NewDecoder(buffer)
if _, err := buffer.Write(serialized); err != nil {
return nil, err
}
dec := &StoredChannel{}
err := decoder.Decode(dec)
return dec, err
} | [
-0.013326864689588547,
0.201592817902565,
0.5063395500183105,
-0.8930150270462036,
0.6407028436660767,
-0.3210379183292389,
-0.1093222126364708,
-0.4560449719429016,
0.5295023918151855,
-0.3949715793132782,
-0.48368406295776367,
0.055199671536684036,
-1.6596558094024658,
0.0572558231651783... |
func ValidateInboundEndpointList(t *testing.T, inboundEndpointCmd string, config *MiConfig) {
t.Helper()
output, _ := ListArtifacts(t, inboundEndpointCmd, config)
artifactList := config.MIClient.GetArtifactListFromAPI(utils.MiManagementInboundEndpointResource, &artifactutils.InboundEndpointList{})
validateinboundEn... | [
-0.5347753167152405,
-1.1553105115890503,
0.4496653974056244,
0.2292996048927307,
0.060360126197338104,
0.6108027100563049,
-0.12543417513370514,
0.14052461087703705,
0.32701125741004944,
0.5940600037574768,
-0.8210872411727905,
-0.11667364835739136,
-1.070616602897644,
-0.0815592333674430... |
func ValidateInboundEndpoint(t *testing.T, inboundEndpointCmd string, config *MiConfig, inboundEndpointName string) {
t.Helper()
output, _ := GetArtifact(t, config, inboundEndpointCmd, inboundEndpointName)
artifact := config.MIClient.GetArtifactFromAPI(utils.MiManagementInboundEndpointResource, getParamMap("inboundE... | [
0.17640557885169983,
-1.4380252361297607,
0.5521241426467896,
0.34805190563201904,
-0.3254433870315552,
0.693678617477417,
-0.18554247915744781,
0.10326318442821503,
-0.07914304733276367,
0.3286048173904419,
-0.0794139951467514,
0.6959420442581177,
-1.393730640411377,
-0.35644882917404175,... |
func NewCustomerAPI(r *mux.Router, cus models.CustomerUsecase) {
customerAPI := &customerAPI{
customerUsecase: cus,
}
r.HandleFunc("/customer", customerAPI.Create).Methods("POST")
r.HandleFunc("/customer", customerAPI.GetAll).Methods("GET")
r.HandleFunc("/customer/{id_customer}", customerAPI.GetByID).Methods("G... | [
-1.0060654878616333,
-0.8980749845504761,
0.37843698263168335,
1.2076972723007202,
-0.010718315839767456,
-0.18158234655857086,
0.1735611855983734,
0.07208301872015,
-0.133358433842659,
0.7759876847267151,
-0.777922511100769,
-0.358976274728775,
0.08158963173627853,
1.1352441310882568,
0... |
func (wm *state) focused() *client {
for _, client := range wm.clients {
if client.state == StateActive {
return client
}
}
return nil
} | [
0.7589040398597717,
-1.663068413734436,
0.4507046937942505,
-0.3609735667705536,
0.08332180976867676,
-0.38251161575317383,
0.885766863822937,
-1.2935988903045654,
-0.24632282555103302,
-0.3908204734325409,
0.10704167932271957,
1.291011929512024,
-0.367391437292099,
-0.8158681988716125,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.