text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func handlePostRequest(w http.ResponseWriter, r *http.Request) {
apiPrefix := "/api/"
pathWithoutAPIPrefix := r.URL.Path[len(apiPrefix):]
switch pathWithoutAPIPrefix {
case "add":
handleAddItemToMenu(w, r)
case "delete":
handleDeleteItem(w, r)
default:
w.WriteHeader(400)
}
} | [
-1.0501716136932373,
-0.4624997079372406,
0.5566315054893494,
0.22575664520263672,
0.374278724193573,
-0.21367475390434265,
-0.12355561554431915,
0.24612939357757568,
0.09729855507612228,
-0.38180428743362427,
0.3930020034313202,
-1.1482234001159668,
-0.3080155849456787,
0.6264054775238037... |
func handleAddItemToMenu(w http.ResponseWriter, r *http.Request) {
addBody := &addBody{}
// Create uuid for the new item
newID := uuid.New()
stringifiedID := newID.String()
item := db.Item{ID: stringifiedID}
err := parseBodyForJSON(w, r, &addBody)
if err != nil {
fmt.Fprint(w, "Failed to parse")
}
db.Add... | [
-1.1269252300262451,
-0.13467659056186676,
0.7552807927131653,
0.27217745780944824,
0.969508707523346,
0.5915864109992981,
-0.41948243975639343,
0.09415200352668762,
-0.07907965779304504,
-0.48853248357772827,
-0.1318473368883133,
-0.5000157952308655,
-0.3473462760448456,
0.446998596191406... |
func handleUpdateItem(w http.ResponseWriter, r *http.Request) {
updateBody := modifierBody{}
err := parseBodyForJSON(w, r, &updateBody)
if err != nil {
fmt.Fprintf(w, "Failed to update item")
}
db.UpdateItemInMenu(updateBody.MenuID, updateBody.Item)
handleGetMenu(w, r, updateBody.MenuID)
} | [
-1.6631684303283691,
-0.6412756443023682,
0.52598637342453,
0.5891557931900024,
0.353664368391037,
0.3506823182106018,
-0.8188872933387756,
0.33648818731307983,
-0.07331977039575577,
0.36347195506095886,
0.0024362877011299133,
-0.8255168795585632,
-0.48828262090682983,
1.0282922983169556,
... |
func NewVolumeEngine(
casConfigPVC string,
casConfigSC string,
castObj *v1alpha1.CASTemplate,
key string,
volumeValues map[string]interface{}) (e *volumeEngine, err error) {
if len(strings.TrimSpace(key)) == 0 {
err = fmt.Errorf("failed to create cas template engine: nil volume key was provided")
return
}
... | [
-0.18339474499225616,
-0.7856743931770325,
0.5044896006584167,
0.6590823531150818,
-0.40436944365501404,
-0.2890353798866272,
-0.49182552099227905,
0.5384226441383362,
-0.37089043855667114,
0.45226746797561646,
0.031078612431883812,
0.3253886103630066,
0.03225643187761307,
0.61887699365615... |
func (c *volumeEngine) prepareFinalConfig() (final []v1alpha1.Config) {
// merge unique config elements from SC with config from PVC
mc := cast.MergeConfig(c.casConfigPVC, c.casConfigSC)
// merge above resulting config with default config from CASTemplate
return cast.MergeConfig(mc, c.defaultConfig)
} | [
-0.7883273959159851,
-0.18414218723773956,
0.586773157119751,
0.6165645122528076,
0.28222423791885376,
-0.33816251158714294,
-0.695167601108551,
1.009170651435852,
0.9917793869972229,
1.10748291015625,
-0.5110268592834473,
-0.1580369770526886,
-0.09556639939546585,
1.3908299207687378,
1.... |
func (c *volumeEngine) Run() (op []byte, err error) {
m, err := cast.ConfigToMap(c.prepareFinalConfig())
if err != nil {
return
}
// set customized config
c.engine.SetConfig(m)
// delegate to generic cas template engine
return c.engine.Run()
} | [
-0.6902448534965515,
-0.3491916358470917,
0.48702993988990784,
0.024836115539073944,
-0.5476065874099731,
-0.4910031259059906,
0.3869280219078064,
0.7568126320838928,
-0.1277266889810562,
0.4160911738872528,
-0.4378226101398468,
-0.27214232087135315,
-0.019168157130479813,
-0.2715538442134... |
func (f *CustomCryptoSuiteProviderFactory) CreateCryptoSuiteProvider(config core.CryptoSuiteConfig) (core.CryptoSuite, error) {
c := wrapper.NewCryptoSuite(f.bccspProvider)
return c, nil
} | [
-0.4810042381286621,
0.12399081140756607,
0.23984764516353607,
-0.15021108090877533,
-0.15389098227024078,
0.2798219621181488,
0.15859532356262207,
-0.4676477611064911,
0.3421545624732971,
1.1411012411117554,
-0.4283815622329712,
0.3003727197647095,
-0.5030575394630432,
0.2397373467683792,... |
func Get() *Configuration {
var config Configuration
err := envconfig.Process("linotte", &config)
if err != nil {
log.Fatal(err.Error())
}
return &config
} | [
-0.3657851815223694,
-0.2938316762447357,
0.4510670602321625,
-0.4990048110485077,
0.3053845167160034,
0.02018946409225464,
-1.1676074266433716,
-0.2467086911201477,
-1.2095593214035034,
1.0117735862731934,
-0.6378414630889893,
0.6943925619125366,
-0.18743681907653809,
0.19048932194709778,... |
func (fsm *FSM) Insert(ctx context.Context, dbc *sql.DB, inserter Inserter) (int64, error) {
tx, err := dbc.Begin()
if err != nil {
return 0, err
}
defer tx.Rollback()
id, notify, err := fsm.InsertTx(ctx, tx, inserter)
if err != nil {
return 0, err
}
defer notify()
return id, tx.Commit()
} | [
-0.1487436592578888,
1.2768217325210571,
0.6502849459648132,
-0.055676694959402084,
-0.6691083908081055,
-0.7674567699432373,
0.28640997409820557,
0.4962719678878784,
-0.4143959879875183,
-0.07952564209699631,
-0.7033805251121521,
-1.0898747444152832,
-1.0942124128341675,
0.736168384552002... |
func NewServerByListen(network, address string, id metainfo.Hash, h Handler,
c ...Config) (*Server, error) {
ln, err := net.Listen(network, address)
if err != nil {
return nil, err
}
return NewServer(ln, id, h, c...), nil
} | [
0.7940462231636047,
-0.7000466585159302,
0.5514790415763855,
0.28555503487586975,
-0.07395283877849579,
0.490141898393631,
-0.3206115663051605,
-0.10387734323740005,
0.01430683396756649,
-0.17537972331047058,
-0.6114322543144226,
-0.37863919138908386,
-0.264485627412796,
0.2173656523227691... |
func NewServer(ln net.Listener, id metainfo.Hash, h Handler, c ...Config) *Server {
if id.IsZero() {
panic("the peer node id must not be empty")
}
var conf Config
conf.set(c...)
return &Server{Listener: ln, ID: id, Handler: h, Config: conf}
} | [
-0.019618507474660873,
-0.20952017605304718,
0.3988410532474518,
0.21237534284591675,
0.04332033917307854,
0.8913174271583557,
-0.8154391050338745,
0.7127286791801453,
-0.3632245361804962,
-0.39007019996643066,
-0.6108266711235046,
0.04093412682414055,
-0.7055708169937134,
0.76155763864517... |
func (s *Server) Run() {
s.Config.set()
for {
conn, err := s.Listener.Accept()
if err != nil {
s.Config.ErrorLog("fail to accept new connection: %s", err)
}
go s.handleConn(conn)
}
} | [
-0.523406982421875,
-0.469595342874527,
0.8478763699531555,
-0.16232238709926605,
0.3584023416042328,
0.7600035071372986,
0.32157057523727417,
0.6328586339950562,
-1.0076733827590942,
-0.304452508687973,
-0.717372715473175,
0.16221736371517181,
-0.36484941840171814,
0.7969037890434265,
1... |
func (s *Server) loopRun(pc *PeerConn, handler Handler) error {
for {
msg, err := pc.ReadMsg()
switch err {
case nil:
case io.EOF:
return nil
default:
s := err.Error()
if strings.Contains(s, "closed") {
return nil
}
return fmt.Errorf("fail to decode the message from '%s': %s",
pc.Remot... | [
-0.6553807854652405,
-0.6768887639045715,
0.6236804127693176,
-0.3587663769721985,
-0.2985486090183258,
1.1345102787017822,
-0.16515013575553894,
-0.2936687469482422,
-1.0494301319122314,
-0.6120965480804443,
0.35372117161750793,
0.07900282740592957,
-1.3512163162231445,
0.7767807841300964... |
func init() {
binlogplayer.RegisterClientFactory("gorpc", func() binlogplayer.Client {
return &client{}
})
} | [
0.23123134672641754,
-0.00870001595467329,
0.37541064620018005,
-0.8644649386405945,
0.9996294379234314,
0.2078143060207367,
-0.44228866696357727,
-0.2040078341960907,
-1.0798842906951904,
-0.3297078013420105,
-0.7074038982391357,
1.3837164640426636,
-0.8752790093421936,
-0.073466241359710... |
func Add(
mgr manager.Manager,
log *zap.SugaredLogger,
numWorkers int,
workerName string,
externalURL string,
seedGetter provider.SeedGetter,
userClusterConnProvider userClusterConnectionProvider,
overwriteRegistry string,
nodePortRange string,
nodeAccessNetwork string,
etcdDiskSize resource.Quantity,
monit... | [
0.008385137654840946,
0.3274119794368744,
0.8044717907905579,
-0.4191145896911621,
0.44678977131843567,
-0.32998159527778625,
0.3351461589336395,
0.5209818482398987,
0.5255805850028992,
-0.37656113505363464,
0.6382960677146912,
0.5983140468597412,
-0.33138078451156616,
0.561126172542572,
... |
func (r Service) Verify(captchaResponse string) (requester.VerifyResponse, error) {
headers := map[string]string{
"Content-Type": "application/x-www-form-urlencoded",
}
body := url.Values{}
body.Set("secret", r.secret)
body.Set("response", captchaResponse)
apiRes := requester.VerifyResponse{}
err := r.http.JSO... | [
-0.9118760228157043,
-0.6894355416297913,
0.7504483461380005,
0.1523313820362091,
0.4475036859512329,
-0.8441291451454163,
-0.16399604082107544,
-0.8113494515419006,
0.8804270625114441,
-0.40156108140945435,
-2.210496664047241,
0.464587926864624,
-0.3332674205303192,
0.2549630403518677,
... |
func NewService(http webreq.HTTP, secret string) Service {
return Service{
http: http,
secret: secret,
}
} | [
-0.3104909658432007,
-0.7766537666320801,
0.3931017220020294,
0.40203797817230225,
-0.7165015935897827,
0.30235806107521057,
-1.0595965385437012,
-0.837103009223938,
-0.1244296133518219,
-0.31743866205215454,
-0.5514749884605408,
1.1072413921356201,
-0.45221346616744995,
0.6322968006134033... |
func AssertEqual(a interface{}, b interface{}) {
if a != b {
panic("Assertion Fail!")
}
} | [
0.6041789650917053,
0.41458773612976074,
0.5792413353919983,
1.249763011932373,
0.964114785194397,
0.9629022479057312,
-0.07979421317577362,
-0.6844723224639893,
0.466240793466568,
0.9774563312530518,
0.031114939600229263,
0.9908137917518616,
-0.6935461759567261,
0.3696185052394867,
0.34... |
func AssertTrue(a bool) {
if a == false {
panic("Assertion Fail!")
}
} | [
0.5893400311470032,
1.4299269914627075,
0.37026384472846985,
0.668615996837616,
0.3743935823440552,
0.7100152373313904,
0.25047582387924194,
0.19990235567092896,
-0.007653775159269571,
0.5428659319877625,
-0.20083576440811157,
0.20560099184513092,
-0.5506672859191895,
-0.038313522934913635... |
func NewPrometheus(subsystem string, customMetricsList ...[]*Metric) *Prometheus {
var metricsList []*Metric
if len(customMetricsList) > 1 {
panic("Too many args. NewPrometheus( string, <optional []*Metric> ).")
} else if len(customMetricsList) == 1 {
metricsList = customMetricsList[0]
}
for _, metric := ra... | [
-0.4884357452392578,
0.7111663222312927,
0.42232438921928406,
0.8239884972572327,
-0.00452244421467185,
0.18957436084747314,
-0.2013358175754547,
0.2918461263179779,
-0.033645372837781906,
-0.4685038924217224,
0.108901746571064,
0.8560313582420349,
-0.5709587335586548,
0.4402024745941162,
... |
func (p *Prometheus) SetPushGateway(pushGatewayURL, metricsURL string, pushIntervalSeconds time.Duration) {
p.Ppg.PushGatewayURL = pushGatewayURL
p.Ppg.MetricsURL = metricsURL
p.Ppg.PushIntervalSeconds = pushIntervalSeconds
p.startPushTicker()
} | [
0.2968006134033203,
0.9573821425437927,
0.43376511335372925,
0.47832393646240234,
-0.3492651879787445,
0.8540462255477905,
-0.40155136585235596,
0.05127252638339996,
-0.5581201314926147,
0.37438344955444336,
-0.2631865441799164,
0.8832073211669922,
-0.4917750954627991,
1.3761482238769531,
... |
func (p *Prometheus) SetPushGatewayJob(j string) {
p.Ppg.Job = j
} | [
0.4381660521030426,
0.7824243307113647,
0.29514989256858826,
-0.28810057044029236,
-0.3591661751270294,
1.6665942668914795,
-0.44944795966148376,
-0.4377734959125519,
-0.9003143906593323,
0.5981814861297607,
-0.14031808078289032,
0.36179354786872864,
-0.9416579604148865,
1.268099069595337,... |
func (p *Prometheus) SetListenAddress(address string) {
p.listenAddress = address
if p.listenAddress != "" {
p.router = gin.Default()
}
} | [
0.9630147218704224,
-0.7193875908851624,
0.7329238653182983,
-0.09821230918169022,
0.25643566250801086,
0.6199976205825806,
-0.19890472292900085,
0.6853867769241333,
0.7366140484809875,
-0.16983050107955933,
-0.17177212238311768,
1.681192398071289,
-0.6798424124717712,
0.3296643793582916,
... |
func (p *Prometheus) SetListenAddressWithRouter(listenAddress string, r *gin.Engine) {
p.listenAddress = listenAddress
if len(p.listenAddress) > 0 {
p.router = r
}
} | [
0.9474273324012756,
-1.1530942916870117,
0.7080150246620178,
-0.4232320189476013,
-0.049566857516765594,
0.7695455551147461,
-0.1510440707206726,
0.5965041518211365,
0.7207488417625427,
-0.04948941990733147,
0.3042449355125427,
0.9824808835983276,
-0.2311868667602539,
0.9271144866943359,
... |
func NewMetric(m *Metric, subsystem string) prometheus.Collector {
var metric prometheus.Collector
switch m.Type {
case "counter_vec":
metric = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: defaultNameSpace,
Subsystem: subsystem,
Name: m.Name,
Help: m.Description,
},
... | [
0.9762149453163147,
0.7092549800872803,
0.7653476595878601,
0.22267062962055206,
0.06782231479883194,
0.3089708089828491,
0.2342223972082138,
-1.115523338317871,
-0.5705735683441162,
0.2107454091310501,
0.9339061379432678,
0.39197322726249695,
0.03359600156545639,
0.5860665440559387,
-0.... |
func (p *Prometheus) Use(e *gin.Engine) {
e.Use(p.handlerFunc())
p.setMetricsPath(e)
} | [
0.1894616335630417,
0.35130950808525085,
0.6733144521713257,
0.33651623129844666,
0.778488039970398,
0.7420387268066406,
1.3699811697006226,
0.1114220842719078,
-1.0563181638717651,
-0.7905397415161133,
0.624178946018219,
0.46362289786338806,
-0.12341497093439102,
0.7781590819358826,
-0.... |
func (p *Prometheus) UseWithAuth(e *gin.Engine, accounts gin.Accounts) {
e.Use(p.handlerFunc())
p.setMetricsPathWithAuth(e, accounts)
} | [
0.4243243932723999,
-0.2980763912200928,
0.5018571615219116,
0.5428812503814697,
0.21300892531871796,
0.4667629599571228,
1.4085729122161865,
-0.1477189064025879,
-0.38951900601387024,
-0.38169702887535095,
0.562190592288971,
0.6051177382469177,
0.16138282418251038,
0.5312889218330383,
-... |
func InstrumentHandlerFunc(handlerName string, handlerFunc gin.HandlerFunc) gin.HandlerFunc {
return InstrumentHandlerFuncWithOpts(
prometheus.SummaryOpts{
Namespace: defaultNameSpace,
Subsystem: "http",
ConstLabels: prometheus.Labels{"handler": handlerName},
},
handlerFunc,
)
} | [
-0.025993624702095985,
-0.2752499580383301,
0.3450782299041748,
-0.23691090941429138,
-0.34219956398010254,
0.8190867900848389,
1.1794134378433228,
0.42108631134033203,
-0.1907438039779663,
0.34135523438453674,
0.7052764892578125,
0.5815149545669556,
0.09974045306444168,
-0.693251132965087... |
func sanitizeMethod(m string) string {
switch m {
case "GET", "get":
return "get"
case "PUT", "put":
return "put"
case "HEAD", "head":
return "head"
case "POST", "post":
return "post"
case "DELETE", "delete":
return "delete"
case "CONNECT", "connect":
return "connect"
case "OPTIONS", "options":
re... | [
0.1411265730857849,
0.030061952769756317,
0.7192179560661316,
-0.3469451069831848,
0.25411707162857056,
-0.3607901334762573,
-0.19484815001487732,
-1.1613115072250366,
-0.1626000851392746,
0.5279800295829773,
0.9648801684379578,
-0.3674229383468628,
-0.9548227787017822,
0.2670285105705261,... |
func (*StreamResponse) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _StreamResponse_OneofMarshaler, _StreamResponse_OneofUnmarshaler, _StreamResponse_OneofSizer, []interf... | [
-0.17822429537773132,
-0.11891446262598038,
0.642195999622345,
-0.7643626928329468,
0.273150235414505,
-1.146309733390808,
1.113895058631897,
-1.437835693359375,
1.0185601711273193,
-0.6398387551307678,
-0.4141382575035095,
-0.15700165927410126,
-0.8502252697944641,
0.6320237517356873,
0... |
func PrintInfo(msg interface{}) {
if os.Getenv("GHORG_QUIET") == "true" {
return
}
switch os.Getenv("GHORG_COLOR") {
case "enabled":
color.New(color.FgYellow).Println(msg)
default:
fmt.Println(msg)
}
} | [
1.002768635749817,
0.2314929962158203,
0.7459352612495422,
-0.012474569492042065,
0.9076498746871948,
0.7209932208061218,
-0.31434527039527893,
-0.1369374692440033,
-0.8516702055931091,
0.16313046216964722,
0.19355706870555878,
1.096623182296753,
-0.3590875267982483,
1.5609724521636963,
... |
func PrintSuccess(msg interface{}) {
switch os.Getenv("GHORG_COLOR") {
case "enabled":
color.New(color.FgGreen).Println(msg)
default:
fmt.Println(msg)
}
} | [
1.1684240102767944,
0.5372791886329651,
0.5631678700447083,
0.344361811876297,
0.41968032717704773,
0.9143027663230896,
-0.6525766253471375,
0.29524198174476624,
-0.4889615774154663,
0.28701120615005493,
0.1420944631099701,
1.070287823677063,
-0.2599138021469116,
0.9801318049430847,
0.54... |
func PrintSubtleInfo(msg interface{}) {
if os.Getenv("GHORG_QUIET") == "true" {
return
}
switch os.Getenv("GHORG_COLOR") {
case "enabled":
color.New(color.FgHiMagenta).Println(msg)
default:
fmt.Println(msg)
}
} | [
1.206907033920288,
0.14792326092720032,
0.7776928544044495,
-0.4756997227668762,
0.4584854245185852,
0.8441781401634216,
-0.198050394654274,
-0.044872384518384933,
-0.5496132373809814,
-0.3420415222644806,
-0.036916691809892654,
1.2055914402008057,
-0.10557876527309418,
1.0612525939941406,... |
func NewBandStatefulClient(
nodeURI string, privKey crypto.PrivKey, msgCap, maximumMsgPerTx int, memo string, chainID string,
) (BandStatefulClient, error) {
provider, err := NewBandProvider(nodeURI, privKey, chainID)
if err != nil {
return BandStatefulClient{}, err
}
ch := make(chan struct{})
close(ch)
client... | [
0.2761445939540863,
-0.2846788763999939,
0.3951150178909302,
-0.11057126522064209,
0.022564690560102463,
0.036561690270900726,
0.017837373539805412,
-0.9407085180282593,
0.05744671821594238,
0.1521773487329483,
-0.5547004342079163,
1.5505247116088867,
-1.1292431354522705,
-0.28003472089767... |
func numDecodings(s string) int {
if len(s) == 0 || s[0] == '0' {
return 0
}
ints := make([]int, len(s)+1)
ints[0] = 1
for i := 1; i < len(ints); i++ {
if s[i-1] == '0' {
ints[i] = 0
} else {
ints[i] = ints[i-1]
}
if i > 1 && (s[i-2] == '1' || (s[i-2] == '2' && int(s[i-1]) <= int('6'))) {
int... | [
-0.947166919708252,
0.8526054620742798,
0.8323275446891785,
-0.28838515281677246,
-0.9477803707122803,
-1.303707242012024,
0.7690516114234924,
0.5093149542808533,
0.6915154457092285,
-0.3287580609321594,
-0.35953056812286377,
-0.046307627111673355,
-0.6731321811676025,
0.29476824402809143,... |
func main() {
bits := 4
grayCode := Stack{}
GenerateGrayCode(&grayCode, bits)
grayCode.Print()
} | [
-0.02774002216756344,
1.1268373727798462,
0.3530370593070984,
1.3135770559310913,
0.830184280872345,
-0.06644346565008163,
1.1652374267578125,
-0.06779347360134125,
-0.44352859258651733,
0.5164794325828552,
-0.6527740359306335,
0.9886614084243774,
-0.18061980605125427,
0.3357914388179779,
... |
func GetRawStringOfTemplate(t *template.Template, values map[string]interface{}) (string, error) {
var buf bytes.Buffer
if err := t.Execute(&buf, values); err != nil {
return "", err
}
return buf.String(), nil
} | [
-0.24719685316085815,
0.47193461656570435,
0.5990222096443176,
-0.954463541507721,
-1.0514748096466064,
-0.4655783474445343,
-0.7526769638061523,
-0.34350597858428955,
-1.0251878499984741,
-0.2815462052822113,
0.040917932987213135,
-0.48352205753326416,
0.3959728181362152,
0.24303393065929... |
func NewDeleteAdmissionregistrationV1beta1CollectionMutatingWebhookConfigurationOK() *DeleteAdmissionregistrationV1beta1CollectionMutatingWebhookConfigurationOK {
return &DeleteAdmissionregistrationV1beta1CollectionMutatingWebhookConfigurationOK{}
} | [
-0.44241130352020264,
0.07666048407554626,
0.6384570598602295,
0.7609465718269348,
-0.2536238133907318,
0.7088960409164429,
0.9033902287483215,
0.5315791964530945,
-0.7205210328102112,
1.3772000074386597,
-0.07463064044713974,
-0.38792216777801514,
0.4219459295272827,
1.7472589015960693,
... |
func (o *DeleteAdmissionregistrationV1beta1CollectionMutatingWebhookConfigurationOK) WithPayload(payload *models.IoK8sApimachineryPkgApisMetaV1Status) *DeleteAdmissionregistrationV1beta1CollectionMutatingWebhookConfigurationOK {
o.Payload = payload
return o
} | [
-0.24554362893104553,
0.30217060446739197,
0.25245997309684753,
0.3103701174259186,
-0.21689751744270325,
-0.027087874710559845,
0.5907695293426514,
0.45194312930107117,
-0.30711761116981506,
1.2348109483718872,
0.2789052724838257,
-0.4976688623428345,
0.4047441780567169,
1.201470494270324... |
func (o *DeleteAdmissionregistrationV1beta1CollectionMutatingWebhookConfigurationOK) SetPayload(payload *models.IoK8sApimachineryPkgApisMetaV1Status) {
o.Payload = payload
} | [
-0.375400185585022,
0.5923466086387634,
0.11199913918972015,
0.5054897665977478,
-0.01075880229473114,
0.2664054036140442,
0.39121919870376587,
0.5724296569824219,
-0.490601122379303,
1.286574125289917,
0.2629282772541046,
-0.2907143831253052,
-0.09224337339401245,
1.5024218559265137,
0.... |
func (o *DeleteAdmissionregistrationV1beta1CollectionMutatingWebhookConfigurationOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(200)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware... | [
-0.5075758099555969,
-0.015551299788057804,
0.26595255732536316,
0.027093995362520218,
0.5897089242935181,
-0.6651334762573242,
0.93175208568573,
0.3991791009902954,
-0.11071507632732391,
1.617408275604248,
-0.10660936683416367,
-0.6294362545013428,
-0.5150715708732605,
1.0022716522216797,... |
func NewDeleteAdmissionregistrationV1beta1CollectionMutatingWebhookConfigurationUnauthorized() *DeleteAdmissionregistrationV1beta1CollectionMutatingWebhookConfigurationUnauthorized {
return &DeleteAdmissionregistrationV1beta1CollectionMutatingWebhookConfigurationUnauthorized{}
} | [
-0.6489118337631226,
-0.2004302442073822,
0.8036076426506042,
0.5431087017059326,
-0.23124390840530396,
0.42857858538627625,
0.744803786277771,
0.758742094039917,
-0.42300304770469666,
0.058792389929294586,
-0.030237823724746704,
0.5659870505332947,
-0.037693850696086884,
1.445701956748962... |
func (o *DeleteAdmissionregistrationV1beta1CollectionMutatingWebhookConfigurationUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(401)
} | [
-0.7522143721580505,
-0.19184227287769318,
0.28175535798072815,
0.3764435350894928,
0.5298187732696533,
-0.49365997314453125,
0.9281203746795654,
0.8065873980522156,
-0.037671077996492386,
0.7678692936897278,
-0.06688511371612549,
0.023628585040569305,
-0.7842000126838684,
0.70990329980850... |
func RecursionBinSearch(data []int, target int) int {
if len(data) == 0 {
return math.MinInt64
}
if len(data) == 1 && data[0] == target {
return 0
} else if len(data) == 1 {
return math.MinInt64
}
left := 0
right := len(data)
mid := left + (right-left)/2
if data[mid] > target {
right = mid
} else if ... | [
-0.5928928256034851,
0.019526736810803413,
0.6206396222114563,
0.5214526057243347,
-0.3186342716217041,
-0.03813645988702774,
-0.048968758434057236,
-0.8484590649604797,
0.7436158657073975,
-0.33042705059051514,
0.12428215891122818,
1.0515964031219482,
-1.3262481689453125,
0.85170513391494... |
func NewClient(
method string,
tgt *url.URL,
enc kithttp.EncodeRequestFunc,
dec kithttp.DecodeResponseFunc,
options ...kithttp.ClientOption,
) *Client {
return &Client{Client: kithttp.NewClient(method, tgt, enc, makeDecodeResponseFunc(dec), options...)}
} | [
0.3173246383666992,
-0.16889356076717377,
0.3751397430896759,
-0.15276607871055603,
-0.6904416084289551,
-0.19769833981990814,
-0.15322116017341614,
-0.49293962121009827,
-0.027598822489380836,
-1.0304369926452637,
0.010341016575694084,
0.5308523774147034,
0.19913068413734436,
-0.602491259... |
func makeDecodeResponseFunc(fn kithttp.DecodeResponseFunc) kithttp.DecodeResponseFunc {
return func(ctx context.Context, resp *http.Response) (interface{}, error) {
if err := HTTPError(resp); err != nil {
return nil, err
}
return fn(ctx, resp)
}
} | [
0.7157872915267944,
-0.919616162776947,
0.4475785791873932,
-0.4609189033508301,
-0.7368257641792297,
-0.4846418797969818,
0.31489408016204834,
-0.061147142201662064,
0.8620334267616272,
-1.095640778541565,
-0.6313394904136658,
-0.005237003322690725,
0.8656730651855469,
-1.1540230512619019... |
func NewHealthChecker(registration Lifecycle, checks []healthcheck.Agent) *HealthChecker {
if len(checks) == 0 {
panic("No health checks provided")
}
return &HealthChecker{
stop: make(chan struct{}),
agents: checks,
registration: registration,
}
} | [
-0.12461195886135101,
-0.2530248761177063,
0.1115252897143364,
1.0635067224502563,
-0.5164279341697693,
0.5348721146583557,
-0.04209147393703461,
0.14864599704742432,
0.3263726830482483,
-0.5816614031791687,
0.4517058730125427,
-0.09602919965982437,
-0.17311908304691315,
1.3161523342132568... |
func (checker *HealthChecker) Start() {
checker.mutex.Lock()
defer checker.mutex.Unlock()
if checker.active {
return
}
checker.active = true
go checker.maintainRegistration()
} | [
0.43805569410324097,
-0.6360926628112793,
0.47880133986473083,
1.113882303237915,
0.6058472394943237,
0.522635817527771,
0.6358273029327393,
0.6498245000839233,
-0.44711431860923767,
-0.3956557810306549,
-0.14026562869548798,
0.9803562760353088,
-0.5034263134002686,
1.1210521459579468,
0... |
func (checker *HealthChecker) Stop() {
checker.mutex.Lock()
defer checker.mutex.Unlock()
if !checker.active {
return
}
checker.active = false
checker.stop <- struct{}{}
<-checker.stop
} | [
-0.5434837937355042,
-0.8246161341667175,
0.3080483675003052,
0.17011122405529022,
0.34435561299324036,
1.0085543394088745,
0.5629016160964966,
0.05991417542099953,
-1.0784622430801392,
-0.33273011445999146,
0.28811347484588623,
0.3283114433288574,
-0.8371738195419312,
0.4261271357536316,
... |
func (dogModel *Dog) Create(dogDoc *Dog) error {
col, session := GetCollection(CollectionNameDog)
defer session.Close()
dogDoc.ID = bson.NewObjectId()
err := col.Insert(dogDoc)
return err
} | [
-0.1824485808610916,
0.2737012505531311,
0.2805108428001404,
0.09320477396249771,
0.629331648349762,
1.4128344058990479,
-0.020089853554964066,
-0.42972531914711,
-1.3526748418807983,
0.28718507289886475,
-1.0928150415420532,
-0.37451913952827454,
-1.0417345762252808,
0.7404177188873291,
... |
func (dogModel *Dog) Get(id string) (*Dog, error) {
col, session := GetCollection(CollectionNameDog)
defer session.Close()
var dogDoc Dog
err := col.FindId(bson.ObjectIdHex(id)).One(&dogDoc)
return &dogDoc, err
} | [
-0.3968556821346283,
-0.10648106783628464,
0.32125186920166016,
-0.25119051337242126,
0.6754921674728394,
0.27675649523735046,
-0.3792249262332916,
-0.5609402060508728,
-0.633715033531189,
-0.18455690145492554,
-0.7508615851402283,
0.9930576086044312,
-0.7569319009780884,
0.051612563431262... |
func (dogModel *Dog) Update(id string, dogDoc Dog) error {
col, session := GetCollection(CollectionNameDog)
defer session.Close()
err := col.Update(bson.M{"_id": bson.ObjectIdHex(id)}, bson.M{"$set": dogDoc})
return err
} | [
-0.8303502798080444,
-0.5278890132904053,
0.2581198513507843,
-0.2569790482521057,
-0.29316452145576477,
0.8365339040756226,
-0.42018115520477295,
-0.44899046421051025,
-0.7400668859481812,
0.330060213804245,
-0.8661426305770874,
0.4852108955383301,
-0.9801241755485535,
0.2853541672229767,... |
func (dogModel *Dog) Delete(id string) error {
col, session := GetCollection(CollectionNameDog)
defer session.Close()
err := col.Remove(bson.M{"_id": bson.ObjectIdHex(id)})
return err
} | [
-0.23457179963588715,
0.22122113406658173,
0.32617753744125366,
-0.06015052646398544,
0.5608341097831726,
0.8077502250671387,
-0.41074514389038086,
-0.41362667083740234,
-0.5974820256233215,
0.5410637259483337,
-1.1300716400146484,
0.0858524888753891,
-0.9467256665229797,
0.281600564718246... |
func (dogModel *Dog) Find(query bson.M) ([]Dog, error) {
col, session := GetCollection(CollectionNameDog)
defer session.Close()
dogs := []Dog{}
err := col.Find(query).All(&dogs)
return dogs, err
} | [
-0.03802981972694397,
0.1186174526810646,
0.1846316009759903,
0.22688685357570648,
0.7718452215194702,
0.28087911009788513,
-0.9114949703216553,
-0.6457276344299316,
-1.032304286956787,
0.7276821136474609,
-0.5143437385559082,
0.26441052556037903,
-0.9399679899215698,
1.5384835004806519,
... |
func (dogModel *Dog) FindPaginate(query bson.M, limit int, offset int) (Page, error) {
col, session := GetCollection(CollectionNameDog)
defer session.Close()
pag := []bson.M{{"$skip": offset}}
if limit > 0 {
pag = append(pag, bson.M{"$limit": limit})
}
pipeline := []bson.M{
bson.M{"$match": query},
bson.M{... | [
-0.44470205903053284,
0.5653260946273804,
0.7783781886100769,
-0.4305135905742645,
0.25683194398880005,
-0.3911930024623871,
-0.6075617671012878,
-0.3153836131095886,
-0.7104597091674805,
0.712145209312439,
0.7169559597969055,
-0.4611537456512451,
-0.773421049118042,
0.5973930954933167,
... |
func (p *HTTPRefreshProxy) ProxyRefresh(ctx context.Context, req *proxyproto.RefreshRequest) (*proxyproto.RefreshResponse, error) {
data, err := httpEncoder.EncodeRefreshRequest(req)
if err != nil {
return nil, err
}
respData, err := p.httpCaller.CallHTTP(ctx, p.proxy.Endpoint, httpRequestHeaders(ctx, p.proxy), d... | [
-0.8527393341064453,
0.1268688440322876,
0.3967834413051605,
0.09097655862569809,
-0.08412445336580276,
-0.3379022777080536,
-0.8956863284111023,
-0.7406564354896545,
0.13981753587722778,
0.27351710200309753,
-0.28124406933784485,
0.7946309447288513,
-0.8930567502975464,
-0.038779113441705... |
func (c *CommandWriter) WriteTemplate(data TemplateModel) error {
if c.config.PreCommand != "" {
err := preCheck(c.config, data)
if err != nil {
return errors.Wrap(err, "pre check failed")
}
}
err := write(c.config, data)
if err != nil {
return errors.Wrap(err, "failed to write data")
}
if c.config.P... | [
-1.3006449937820435,
0.5794501304626465,
0.42861250042915344,
0.639755129814148,
1.1390241384506226,
0.14231956005096436,
0.593264102935791,
0.7079362869262695,
-0.9113391637802124,
-0.24924372136592865,
-0.4848529100418091,
-0.9172629714012146,
-0.5208786129951477,
1.5544655323028564,
0... |
func (h *HTTPHandler) Get() (http.Response, error) {
response, err := http.Get(h.Endpoint)
if err != nil {
return http.Response{}, err
}
return *response, nil
} | [
-0.34648147225379944,
-1.0231359004974365,
0.3904593288898468,
0.06450219452381134,
0.7409497499465942,
-0.289964884519577,
-0.7531245350837708,
-0.47307273745536804,
-0.7162421345710754,
-0.21491175889968872,
0.28831470012664795,
0.4094821512699127,
-0.8243329524993896,
-0.593795657157898... |
func NewLoader(dimension *Dimension, x, z int32) *Loader {
return &Loader{dimension, x, z, func(chunk *chunks.Chunk) {}, func(chunk *chunks.Chunk) {}, func(){}, sync.RWMutex{}, make(map[int]*chunks.Chunk), make(map[int]bool), make(map[int]bool)}
} | [
0.47722122073173523,
-0.6263535022735596,
0.23928724229335785,
0.022886065766215324,
-1.4604310989379883,
-0.2800135314464569,
-0.5510675311088562,
-0.9701042771339417,
-0.9854023456573486,
-0.2287336140871048,
-0.6203113198280334,
0.623206377029419,
-0.31969234347343445,
0.447335153818130... |
func (loader *Loader) Move(chunkX, chunkZ int32) {
loader.ChunkX = chunkX
loader.ChunkZ = chunkZ
} | [
-0.42386263608932495,
-1.5052849054336548,
0.46967461705207825,
-0.47387778759002686,
0.10030785202980042,
0.668202817440033,
-0.4619457721710205,
-0.7712436318397522,
-1.1299413442611694,
-0.18240271508693695,
-0.6995419263839722,
0.8240980505943298,
-0.3560222089290619,
0.222463324666023... |
func (loader *Loader) Warp(dimension *Dimension, chunkX, chunkZ int32) {
loader.Dimension = dimension
loader.Move(chunkX, chunkZ)
} | [
-0.6618662476539612,
-0.1847815364599228,
0.4478847086429596,
0.10383041948080063,
-0.7510370016098022,
0.6359045505523682,
-0.2758077383041382,
-0.4192724823951721,
-0.8770103454589844,
-0.06309080123901367,
-0.19985875487327576,
1.2003438472747803,
0.5312681794166565,
0.06361927092075348... |
func (loader *Loader) GetLoadedChunkCount() int {
return len(loader.loadedChunks)
} | [
0.5818087458610535,
-0.9875035285949707,
0.6876396536827087,
-0.9618287682533264,
0.34888312220573425,
-0.32811349630355835,
0.14999543130397797,
0.2747178077697754,
-1.254380464553833,
-1.0647796392440796,
-0.9001961946487427,
1.2179219722747803,
0.4059954285621643,
1.17598557472229,
0.... |
func (loader *Loader) GetLoadedChunks() map[int]*chunks.Chunk {
return loader.loadedChunks
} | [
-0.49024009704589844,
-1.3486758470535278,
0.5736568570137024,
-0.6620951294898987,
-0.12786874175071716,
-0.23249422013759613,
-0.029377060011029243,
-0.6476298570632935,
-0.9925845861434937,
-1.043206810951233,
-1.144135594367981,
1.1482996940612793,
0.02135109156370163,
0.99734169244766... |
func (loader *Loader) HasChunkInUse(chunkX, chunkZ int32) bool {
loader.mutex.RLock()
var _, ok = loader.loadedChunks[loader.GetChunkHash(chunkX, chunkZ)]
loader.mutex.RUnlock()
return ok
} | [
-0.09633491188287735,
-0.6950257420539856,
0.5797241926193237,
-0.34828147292137146,
0.24064411222934723,
-0.9411121606826782,
0.2030857503414154,
-0.5594654679298401,
-1.9939947128295898,
-0.7427853345870972,
-0.5955320596694946,
0.4761626422405243,
-0.6000874638557434,
0.5195108652114868... |
func (loader *Loader) setChunkInUse(chunkX, chunkZ int32, chunk *chunks.Chunk) {
loader.mutex.Lock()
loader.loadedChunks[loader.GetChunkHash(chunkX, chunkZ)] = chunk
loader.mutex.Unlock()
} | [
-0.2857929468154907,
-0.8021093606948853,
0.4866296648979187,
-0.5394698977470398,
0.5461500287055969,
-0.3751109838485718,
0.1922820508480072,
-0.5833127498626709,
-1.9238733053207397,
-0.6120947599411011,
-1.097647786140442,
1.1274610757827759,
-0.6819818019866943,
0.2472803294658661,
... |
func (loader *Loader) unsetChunkFromUse(chunkX, chunkZ int32) {
loader.mutex.Lock()
delete(loader.loadedChunks, loader.GetChunkHash(chunkX, chunkZ))
loader.mutex.Unlock()
} | [
0.4958020746707916,
-1.1269484758377075,
0.3511601686477661,
-0.6450368165969849,
0.10962831974029541,
-0.2062263786792755,
0.44191640615463257,
0.06958046555519104,
-1.5300153493881226,
-0.3618890345096588,
-0.0560140535235405,
0.8827949166297913,
-0.7438108921051025,
0.2572419345378876,
... |
func (loader *Loader) GetChunkHash(x, z int32) int {
return loader.Dimension.chunkProvider.GetChunkIndex(x, z)
} | [
0.7678256630897522,
0.3262273669242859,
0.2604173719882965,
0.26177728176116943,
-0.38988375663757324,
0.19213490188121796,
-0.05392971634864807,
-0.8692891597747803,
-1.0316113233566284,
-0.18715304136276245,
-0.4586625099182129,
1.6432346105575562,
-0.29056262969970703,
-1.01820385456085... |
func (loader *Loader) GetChunkXZ(hash int) (int, int) {
return loader.Dimension.chunkProvider.GetChunkXZ(hash)
} | [
0.40007081627845764,
-0.36018458008766174,
0.24315617978572845,
0.6992397904396057,
-0.4920218288898468,
-1.197280764579773,
-0.06432146579027176,
-0.03271680697798729,
-0.44570693373680115,
-0.5658281445503235,
-0.3921244442462921,
0.942854106426239,
-0.062322575598955154,
0.6967265605926... |
func (loader *Loader) LoadChunk(x, z int32) {
var Hash = loader.GetChunkHash(x, z)
if !loader.HasChunkInUse(x, z) {
loader.loadChunkQueue[Hash] = true
}
delete(loader.unloadChunkQueue, Hash)
} | [
0.4157958924770355,
-0.37976548075675964,
0.2538444995880127,
-0.2750413119792938,
-0.024570045992732048,
0.13666903972625732,
-0.15088002383708954,
-0.13268280029296875,
-0.7598066329956055,
-0.4155762791633606,
-0.4509027898311615,
0.8755049705505371,
0.09453987330198288,
0.9095188975334... |
func (loader *Loader) UnloadChunk(x, z int32) {
var Hash = loader.GetChunkHash(x, z)
if loader.HasChunkInUse(x, z) {
loader.unloadChunkQueue[Hash] = true
}
delete(loader.loadChunkQueue, Hash)
} | [
0.1697048842906952,
-0.6562140583992004,
0.31106996536254883,
-0.9957556128501892,
-0.42056235671043396,
-0.26797688007354736,
0.050007738173007965,
-0.063804030418396,
-1.231192708015442,
-0.6609311699867249,
-0.27228209376335144,
1.0806876420974731,
0.050517719238996506,
0.55221331119537... |
func (loader *Loader) SortChunks(viewDistance int32) {
var ChunkX= loader.ChunkX
var ChunkZ= loader.ChunkZ
var RadiusSquared= int32(math.Pow(float64(viewDistance), 2))
for index := range loader.loadedChunks{
loader.unloadChunkQueue[index] = true
}
loader.loadChunkQueue = make(map[int]bool)
for x := -viewDis... | [
-0.05691113322973251,
-1.0517351627349854,
0.7049905061721802,
-1.1770814657211304,
-0.8791369199752808,
-0.535473108291626,
0.27188581228256226,
-0.9509185552597046,
-0.6365079283714294,
-0.3002658486366272,
-0.4753851890563965,
0.8732020258903503,
-0.11420971155166626,
0.506258487701416,... |
func (loader *Loader) ProcessLoadQueue(perTick int) {
var f = func(chunk *chunks.Chunk) {
loader.setChunkInUse(chunk.X, chunk.Z, chunk)
loader.LoadFunction(chunk)
}
var count = 1
for index := range loader.loadChunkQueue {
if count >= perTick {
break
}
var x, z= loader.GetChunkXZ(index)
loader.Dimensi... | [
0.18683123588562012,
-0.61429363489151,
0.6021613478660583,
-0.8142548203468323,
-0.409394234418869,
-0.8384066224098206,
0.3723583519458771,
-0.8584812879562378,
-0.4874950647354126,
0.017490914091467857,
0.05411059781908989,
0.13292759656906128,
0.037799037992954254,
0.8383758664131165,
... |
func (loader *Loader) ProcessUnloadQueue(perTick int) {
loader.mutex.Lock()
var count = 1
for index := range loader.unloadChunkQueue {
if count >= perTick {
break
}
var x, z= loader.GetChunkXZ(index)
var chunk, ok= loader.Dimension.chunkProvider.GetChunk(int32(x), int32(z))
if ok {
loader.UnloadFunct... | [
-0.06240672990679741,
-1.2881088256835938,
0.5970033407211304,
-1.3440191745758057,
-0.4493342936038971,
-1.119600772857666,
0.6137727499008179,
-0.6595730185508728,
-0.31152793765068054,
0.06606780737638474,
0.20527678728103638,
-0.07675198465585709,
0.054367244243621826,
0.83755046129226... |
func GetMessages(channelName string) []msg.Message {
for _, c := range Channels {
if c.Name == channelName {
return c.Messages
}
}
return make([]msg.Message, 0)
} | [
-0.6261187195777893,
-0.14107827842235565,
0.5557464361190796,
-0.5166854858398438,
1.0513520240783691,
-0.6541305184364319,
-0.44550251960754395,
-1.1004711389541626,
0.20779374241828918,
0.34123632311820984,
-0.040169280022382736,
0.5087785124778748,
-1.1812654733657837,
1.00046968460083... |
func (c *Client) Do(req Request, resp Response) error {
if req == nil {
return errors.New("nil request")
}
if resp == nil {
return errors.New("nil response")
}
if c.BufioPool == nil {
return errors.New("nil buffer io pool")
}
//fetch request type
viaProxy := (req.GetProxy() != nil)
reqType := parseReques... | [
-0.10577124357223511,
-0.3919943571090698,
0.9943645596504211,
0.2905130088329315,
0.24491189420223236,
0.4687969386577606,
0.40879663825035095,
-0.43036627769470215,
-0.2592257857322693,
-0.235701322555542,
0.1308637261390686,
0.6641979217529297,
-0.11277955025434494,
-0.04940244928002357... |
func (c *HostClient) LastUseTime() time.Time {
n := atomic.LoadUint32(&c.lastUseTime)
return time.Unix(startTimeUnix+int64(n), 0)
} | [
-0.10562646389007568,
0.2278658151626587,
0.6563857793807983,
-0.9417280554771423,
0.2939571738243103,
-0.4985262453556061,
0.015109281986951828,
-0.1282729208469391,
-0.16159413754940033,
0.35935553908348083,
-0.20893140137195587,
-0.4907727539539337,
-1.6910479068756104,
0.14481018483638... |
func (c *HostClient) Do(req Request, resp Response) error {
if req == nil {
return errors.New("nil request")
}
if resp == nil {
return errors.New("nil response")
}
if c.BufioPool == nil {
return errors.New("nil buffer io pool")
}
var err error
var retry bool
const maxAttempts = 5
attempts := 0
atomic.... | [
0.19864214956760406,
0.1453009843826294,
0.9952684640884399,
0.17602911591529846,
0.6570993661880493,
0.28062984347343445,
0.32448479533195496,
-1.2177902460098267,
-0.5032033324241638,
-0.28021368384361267,
-0.591062605381012,
0.002905425848439336,
-0.6343891024589539,
0.01473726890981197... |
func (c *HostClient) PendingRequests() int {
return int(atomic.LoadUint64(&c.pendingRequests))
} | [
-0.15851090848445892,
0.2325819730758667,
0.29337969422340393,
-0.07322779297828674,
-0.4448140263557434,
-0.009091303683817387,
-0.2708826959133148,
-0.08095278590917587,
-0.7029117345809937,
-0.507654070854187,
0.013545232824981213,
-0.5714918971061707,
-1.2870240211486816,
0.25218328833... |
func Set(k string, x interface{}, d time.Duration) {
c.Set(k, x, d)
} | [
0.44830381870269775,
0.6934927105903625,
0.27650317549705505,
-0.341768354177475,
-0.847614049911499,
0.612011194229126,
-1.0014187097549438,
-0.2386002540588379,
-0.8473823666572571,
0.7882562875747681,
-0.5547203421592712,
0.5434203147888184,
1.026574730873108,
0.3658519685268402,
-0.4... |
func Get(k string) (interface{}, bool) {
return c.Get(k)
} | [
-0.12126406282186508,
-0.02536015212535858,
0.30265605449676514,
-0.5344018936157227,
-0.3724198043346405,
-0.12432925403118134,
-1.1336538791656494,
0.3021601438522339,
-1.2526397705078125,
0.7915314435958862,
-0.5891680717468262,
0.026005122810602188,
-0.11201314628124237,
-0.69024765491... |
func SetCache(cache Cache) {
c = cache
} | [
0.5674734115600586,
0.42844220995903015,
0.1093241348862648,
0.791542649269104,
-0.4212939441204071,
0.17387551069259644,
0.0894135981798172,
0.904222846031189,
0.42994317412376404,
-0.0568661093711853,
-0.6471601724624634,
0.06535959243774414,
-0.026185596361756325,
0.7821184396743774,
... |
func (re *EthDev) RequireIOPL() bool {
return re.requireIOPL
} | [
-1.0157912969589233,
-0.24459676444530487,
0.6075239181518555,
-0.30842822790145874,
-0.7886557579040527,
0.6930174827575684,
0.6765146255493164,
-0.3464749753475189,
0.4597378373146057,
0.4736648499965668,
-0.1588040292263031,
-1.566158652305603,
-1.1049084663391113,
-0.46542295813560486,... |
func (r *Bucket_ReplicationDestination) AWSCloudFormationType() string {
return "AWS::S3::Bucket.ReplicationDestination"
} | [
0.4830215871334076,
0.48564696311950684,
0.5293939113616943,
-0.07510068267583847,
0.0292003583163023,
0.1702110916376114,
-0.10945457220077515,
0.29439035058021545,
0.3260144293308258,
0.1002955511212349,
-0.7827481031417847,
0.7099829912185669,
0.8228883147239685,
-0.37798628211021423,
... |
func New(b []byte) (*Exec, error) {
f, err := open(b)
if err != nil {
return nil, err
}
return &Exec{f: f}, nil
} | [
0.10491049289703369,
-0.7728661894798279,
0.49595901370048523,
0.6433606743812561,
-0.470439076423645,
-0.137271448969841,
0.14428375661373138,
0.44969579577445984,
-0.5034072399139404,
-0.5679826140403748,
-0.3797995448112488,
0.012858967296779156,
0.3278416693210602,
0.5299670100212097,
... |
func (m *Exec) Command(arg ...string) *exec.Cmd {
return exec.Command(m.f.Name(), arg...)
} | [
-0.2174243927001953,
-0.6355047821998596,
0.2879221737384796,
0.8286672234535217,
0.6278510093688965,
0.6540955901145935,
-0.590072512626648,
-0.00839992891997099,
-0.33909550309181213,
-0.9726624488830566,
0.6635679602622986,
0.851121723651886,
0.6812856793403625,
0.2496953010559082,
-0... |
func (m *Exec) Close() error {
return clean(m.f)
} | [
0.2740127146244049,
0.35847747325897217,
0.35280632972717285,
0.4685558080673218,
-0.6130311489105225,
0.6140123009681702,
0.06873244792222977,
-0.4635814428329468,
-1.6887470483779907,
-0.8980766534805298,
1.0585694313049316,
0.3148297965526581,
-0.4946325123310089,
0.8875420093536377,
... |
func Parse(r io.Reader) (*List, error) {
eventList := List{}
raw, err := ioutil.ReadAll(r)
if err != nil {
return &eventList, err
}
err = json.Unmarshal(raw, &eventList)
if err != nil {
return &eventList, err
}
return &eventList, nil
} | [
-0.3217464089393616,
-0.6351025104522705,
0.675433874130249,
-0.3016569912433624,
-0.630957841873169,
-0.7557590007781982,
-0.41155534982681274,
0.31696081161499023,
0.30292898416519165,
0.2963269352912903,
-0.5514888167381287,
-0.16882431507110596,
0.01759108155965805,
0.4452379643917084,... |
func (eventList *List) VCal() string {
var sVal string
tz := eventList.TimeZone
offset := eventList.Offset
sVal += "BEGIN:VCALENDAR\r\n"
sVal += "VERSION:2.0\r\n"
for _, e := range eventList.Events {
sVal += "BEGIN:VEVENT\r\n"
uid := fmt.Sprintf("UID:%s\r\n", e.ID)
start := fmt.Sprintf("DTSTART%s\r\n", he... | [
0.07930117845535278,
-1.280157446861267,
0.8287956118583679,
-1.0327779054641724,
-0.8014326095581055,
0.6928550601005554,
-0.5182047486305237,
-0.31812816858291626,
-0.032163310796022415,
1.1465158462524414,
-0.053829092532396317,
0.6471129059791565,
0.1806151419878006,
0.0194738581776618... |
func (yi YumInstalled) Check() error {
for _, p := range yi.Packages {
cmd := exec.Command("yum", "list", "installed", p)
out, err := cmd.CombinedOutput()
if err != nil {
return fmt.Errorf("run yum list installed %s: %w", p, err)
}
if len(out) <= 0 {
return fmt.Errorf("%s isn't installed and should ... | [
0.15308122336864471,
-0.0138423265889287,
0.6619184613227844,
0.3151954114437103,
1.1233831644058228,
-0.2233971208333969,
0.16522052884101868,
0.5651243925094604,
-0.006088533904403448,
0.1986500322818756,
0.5649814605712891,
0.017037341371178627,
-0.46286600828170776,
1.4260894060134888,... |
func YumInstalledFromArgs(args Args) (Checker, error) {
yi := YumInstalled{}
if err := requiredArgs(args, "packages"); err != nil {
return nil, err
}
if err := decodeFromArgs(args, &yi); err != nil {
return nil, err
}
return yi, nil
} | [
0.9357308149337769,
-0.9007965326309204,
0.5826967358589172,
0.07256101071834564,
0.18833041191101074,
-0.2813836932182312,
-0.3314951956272125,
0.7922778129577637,
0.8418214321136475,
0.0011595499236136675,
-0.26037728786468506,
-0.2343916893005371,
-0.5078294277191162,
0.947338879108429,... |
func mergeBranch(c *cli.Context) error {
if !dit.CheckDitFolderPresent() {
return ErrNotInitialized
}
if c.NArg() == 0 {
return ErrIncorrectOperands
}
headHash := dit.ReadHeadBranch(c.Args().First())
mergedCommit, _ := dit.GetCommit(headHash)
currentCommit := dit.GetHeadCommit()
splitCommit := dit.GetLCA(cu... | [
0.4272461235523224,
-0.35790205001831055,
1.0544495582580566,
0.5028150677680969,
0.6683778166770935,
0.4558213949203491,
1.1365350484848022,
0.36267274618148804,
-0.38269132375717163,
0.17354467511177063,
0.25302740931510925,
0.15696442127227783,
-0.5842767953872681,
0.8643685579299927,
... |
func (o *GetForbiddenAddressesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetForbiddenAddressesOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return... | [
0.028509991243481636,
-0.43415090441703796,
0.7714806795120239,
0.23418715596199036,
-0.6148343086242676,
-0.919896125793457,
0.2529759705066681,
-0.4949852228164673,
0.6275500059127808,
0.2746824324131012,
0.4987328052520752,
0.2106977105140686,
-1.140790343284607,
-0.26520177721977234,
... |
func NewGetForbiddenAddressesOK() *GetForbiddenAddressesOK {
return &GetForbiddenAddressesOK{}
} | [
0.5517374873161316,
1.3087401390075684,
0.22410990297794342,
0.8463180661201477,
-0.8137704730033875,
-0.5795599818229675,
0.2685823440551758,
0.21166224777698517,
0.2914150357246399,
-0.5219153165817261,
-0.5399757027626038,
0.615685224533081,
0.2333981692790985,
-0.552026629447937,
0.1... |
func NewGetForbiddenAddressesBadRequest() *GetForbiddenAddressesBadRequest {
return &GetForbiddenAddressesBadRequest{}
} | [
0.010520990937948227,
0.5091721415519714,
0.6126903891563416,
0.4129329025745392,
-0.7382266521453857,
-0.3907383382320404,
0.21403546631336212,
-0.011990537866950035,
0.11704002320766449,
-0.6469561457633972,
0.3541531562805176,
1.2624694108963013,
-0.28936925530433655,
0.1797239631414413... |
func (o *GetForbiddenAddressesOKBody) Validate(formats strfmt.Registry) error {
var res []error
if err := o.validateResult(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
} | [
0.9109028577804565,
0.898598313331604,
0.5877711176872253,
0.5452033877372742,
-0.5081908106803894,
-0.5058279633522034,
0.11745846271514893,
-0.8980956077575684,
0.18821880221366882,
0.24514681100845337,
0.7515584826469421,
0.5809467434883118,
-1.0341824293136597,
0.34989845752716064,
0... |
func (perm OpPermRole) Valid() bool {
switch perm {
case opPermRoleRead, opPermRoleWrite, opPermRoleAssignedOnly:
return true
default:
return false
}
} | [
-0.019103873521089554,
-0.7470187544822693,
0.6611706614494324,
0.16354970633983612,
-0.6065672039985657,
0.9374252557754517,
0.19857382774353027,
0.6264423131942749,
-0.07386745512485504,
0.31218138337135315,
1.2953659296035767,
0.40616777539253235,
-1.3834576606750488,
-0.557072043418884... |
func loadTemplates(dir string) (multitemplate.Renderer, error) {
r := multitemplate.NewRenderer()
base, err := filepath.Glob(dir + "/*.html")
if err != nil {
return r, err
}
pages, err := filepath.Glob("templates/pages/*.html")
if err != nil {
return r, err
}
for _, page := range pages {
templates := ma... | [
-0.3143218159675598,
0.2875326871871948,
0.832711398601532,
-0.05439632758498192,
-0.7284077405929565,
-0.23040451109409332,
-0.23348350822925568,
0.03732465207576752,
0.6507608890533447,
0.1899411380290985,
-0.6210501790046692,
-0.34679266810417175,
-0.4573189318180084,
1.4442516565322876... |
func (o *GetAcrV1NameTagsReferenceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetAcrV1NameTagsReferenceOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}... | [
0.18081553280353546,
-0.3428860306739807,
0.5741321444511414,
-0.1964627057313919,
-0.16125091910362244,
-1.0899052619934082,
-0.30475279688835144,
-1.161292314529419,
0.2548385560512543,
0.6089974641799927,
0.1640070527791977,
0.1934460997581482,
-0.8073993921279907,
0.4151363670825958,
... |
func NewGetAcrV1NameTagsReferenceOK() *GetAcrV1NameTagsReferenceOK {
return &GetAcrV1NameTagsReferenceOK{}
} | [
0.42074283957481384,
0.1103890985250473,
0.3690025508403778,
-0.37447836995124817,
-0.5157233476638794,
0.07343106716871262,
-0.23314811289310455,
-0.7421709299087524,
-0.6986700296401978,
0.7540233135223389,
-0.4489421844482422,
0.5077910423278809,
-0.15298879146575928,
0.5643248558044434... |
func NewGetAcrV1NameTagsReferenceBadRequest() *GetAcrV1NameTagsReferenceBadRequest {
return &GetAcrV1NameTagsReferenceBadRequest{}
} | [
-0.11598780006170273,
-0.016503680497407913,
0.6171926856040955,
-0.3454168140888214,
-0.2417614907026291,
-0.14844396710395813,
-0.8028050065040588,
-0.7368907928466797,
-0.8806242346763611,
-0.13429003953933716,
-0.0075019532814621925,
1.3326187133789062,
-0.7364019751548767,
0.996659696... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.