text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (ins *EC2RemoteClient) WriteBytesToFile(source []byte, destination string) error {
err := ins.cmdClient.WriteBytesToFile(source, destination)
return err
} | [
-0.4124586880207062,
0.3753323256969452,
0.3495479226112366,
-0.672514796257019,
1.0114167928695679,
0.731643557548523,
-0.09921860694885254,
-0.128854900598526,
-0.7041942477226257,
-0.0013343882746994495,
-0.9664875268936157,
0.25622954964637756,
-0.34997260570526123,
-0.649989128112793,... |
func (SecretVersion_State) EnumDescriptor() ([]byte, []int) {
return file_google_cloud_secrets_v1beta1_resources_proto_rawDescGZIP(), []int{1, 0}
} | [
0.16240619122982025,
-0.19266200065612793,
0.42430904507637024,
0.2568567991256714,
-0.024150777608156204,
-0.21733297407627106,
0.10665255039930344,
0.7363294363021851,
0.0834268182516098,
0.6898432374000549,
-0.8607837557792664,
0.03860212489962578,
-0.32844093441963196,
0.20060181617736... |
func (*Secret) Descriptor() ([]byte, []int) {
return file_google_cloud_secrets_v1beta1_resources_proto_rawDescGZIP(), []int{0}
} | [
-0.10697511583566666,
0.11090603470802307,
0.5067418217658997,
0.2777140736579895,
0.152446910738945,
-0.25559860467910767,
-0.0030428061727434397,
0.13197645545005798,
-0.9714064598083496,
-0.6600520610809326,
-1.089617371559143,
-0.13600072264671326,
-0.01567564159631729,
0.6114096641540... |
func (*SecretVersion) Descriptor() ([]byte, []int) {
return file_google_cloud_secrets_v1beta1_resources_proto_rawDescGZIP(), []int{1}
} | [
0.05093768984079361,
-0.0052877324633300304,
0.347006618976593,
0.21751967072486877,
0.21837641298770905,
-0.07194825261831284,
0.893248438835144,
0.2801620364189148,
-0.7793949246406555,
-0.31259143352508545,
-0.9983792901039124,
0.3072183132171631,
-0.4683159291744232,
0.6836831569671631... |
func (*Replication) Descriptor() ([]byte, []int) {
return file_google_cloud_secrets_v1beta1_resources_proto_rawDescGZIP(), []int{2}
} | [
-0.73221755027771,
0.6123816967010498,
0.43291136622428894,
-0.009486358612775803,
-0.1389710158109665,
-0.1696537584066391,
0.15898895263671875,
0.5176395177841187,
-0.578570544719696,
0.3197092115879059,
-0.36989253759384155,
-0.3490191400051117,
-0.42617812752723694,
-0.1300507187843322... |
func (*SecretPayload) Descriptor() ([]byte, []int) {
return file_google_cloud_secrets_v1beta1_resources_proto_rawDescGZIP(), []int{3}
} | [
0.3052974045276642,
0.7342613339424133,
0.45203641057014465,
0.021665366366505623,
-0.06739798188209534,
-0.11710985004901886,
0.2593783438205719,
0.250329852104187,
-0.39627382159233093,
-0.7148060202598572,
-0.7046616077423096,
0.7469766736030579,
-0.3894312083721161,
-0.2700389325618744... |
func (*Replication_Automatic) Descriptor() ([]byte, []int) {
return file_google_cloud_secrets_v1beta1_resources_proto_rawDescGZIP(), []int{2, 0}
} | [
0.29865530133247375,
-0.12966561317443848,
0.49534347653388977,
-0.44924670457839966,
-0.27442097663879395,
0.457988977432251,
0.2091507613658905,
1.1138488054275513,
-1.6726175546646118,
0.5127081274986267,
-1.1896861791610718,
0.6311654448509216,
0.037817321717739105,
0.4534979462623596,... |
func (*Replication_UserManaged) Descriptor() ([]byte, []int) {
return file_google_cloud_secrets_v1beta1_resources_proto_rawDescGZIP(), []int{2, 1}
} | [
0.11514214426279068,
0.11827246099710464,
0.29196304082870483,
0.22777731716632843,
-0.38382238149642944,
0.10785632580518723,
0.4411814510822296,
0.6930972933769226,
-0.015282739885151386,
0.14843371510505676,
-1.0123252868652344,
0.577156126499176,
0.5079092383384705,
0.03524684533476829... |
func (*Replication_UserManaged_Replica) Descriptor() ([]byte, []int) {
return file_google_cloud_secrets_v1beta1_resources_proto_rawDescGZIP(), []int{2, 1, 0}
} | [
-0.1022101640701294,
-0.16740062832832336,
0.10243430733680725,
0.5239223837852478,
-0.6999679207801819,
-0.003724187146872282,
0.12439659982919693,
0.13797111809253693,
-0.6770747303962708,
-0.0917314738035202,
-0.4696305990219116,
0.6619318127632141,
-0.07009151577949524,
0.2438020259141... |
func getArguments() {
// define pointers to the arguments which will be filled up when flag.Parse() is called
langFlag := flag.String("l", string(auto), "Which language to use. Args are: lua | wren | moon | auto")
dirFlag := flag.String("d", ".", "The directory containing the main file and the subfiles")
outFlag :=... | [
0.12331638485193253,
-0.3750438094139099,
0.6774919629096985,
0.18575039505958557,
0.6435134410858154,
-0.2129184603691101,
-0.09469472616910934,
0.3712504208087921,
-1.5970369577407837,
-0.2728307545185089,
-0.14340481162071228,
0.4233747720718384,
-1.0769081115722656,
1.1283044815063477,... |
func buildLogMsg(title, msg string) droneyaml.BuildItem {
return droneyaml.BuildItem{
Key: "Warning: " + title,
Build: droneyaml.Build{
Container: droneyaml.Container{
Image: "library/alpine:3.2",
Environment: droneyaml.MapEqualSlice([]string{"MSG=" + msg}),
},
Commands: []string{`echo "$MSG... | [
0.1956995278596878,
0.03380492702126503,
0.5778100490570068,
-0.032218243926763535,
-0.5534005761146545,
0.22421738505363464,
-1.200528621673584,
0.5565585494041443,
-0.5355179309844971,
-0.08392403274774551,
-0.010429434478282928,
1.0073373317718506,
0.5770622491836548,
0.0612958706915378... |
func fibonacci() func() int {
first, second := 0, 1
return func() int {
ret := first
first, second = second, first+second
return ret
}
} | [
0.46085458993911743,
-0.5471065044403076,
0.2587531805038452,
0.3750378489494324,
0.4302278459072113,
-1.0810531377792358,
0.918595552444458,
-0.4918540418148041,
-0.8273798823356628,
-0.969838559627533,
-1.016951560974121,
0.1793936938047409,
0.6913162469863892,
-0.5112218856811523,
0.4... |
func NewDeployment(configTier config.Tier, configSlot config.Slot, boshDeployment *data.Deployment) (deployment *Deployment) {
tierName := configTier.Name
slotName := configSlot.Name
name := fmt.Sprintf("%s / %s - %s", tierName, slotName, boshDeployment.Name)
releases := make([]DisplayNameVersion, len(boshDeploym... | [
-0.5315679311752319,
-0.2543978989124298,
0.6608947515487671,
-1.2590304613113403,
-0.6616246104240417,
-0.07904747128486633,
-0.14969488978385925,
0.06833048164844513,
-0.2603469789028168,
0.7378221154212952,
-0.12827490270137787,
0.18785478174686432,
0.6889389157295227,
0.339329808950424... |
func (deployment *Deployment) ContainsFilterTag(filterTag string) bool {
if filterTag == "" {
return true
}
for _, release := range deployment.Releases {
if release.Name == filterTag {
return true
}
}
return false
} | [
-0.2396606057882309,
-0.6538648009300232,
0.4326152503490448,
-0.39196375012397766,
-0.3556467592716217,
-0.5475707054138184,
-0.43481504917144775,
-0.2970602214336395,
0.012186229228973389,
1.2754138708114624,
-0.6500539779663086,
0.6892746686935425,
-0.021511739119887352,
1.2983655929565... |
func NewUncertaintyGroup(count uint) UncertaintyGroup {
return &uncertaintyGroup{
remaining: count,
results: make(chan error),
}
} | [
-0.44436028599739075,
0.0689697414636612,
0.09472019970417023,
-0.6969162225723267,
-1.0148228406906128,
-0.580226480960846,
-0.01638457179069519,
-0.786268413066864,
-0.5298047661781311,
-0.8089421987533569,
-0.22337128221988678,
-0.29237082600593567,
-1.0610626935958862,
0.83120173215866... |
func ByteOrder() binary.ByteOrder { return byteOrder } | [
1.110597848892212,
0.07640165835618973,
0.15876172482967377,
0.07556883245706558,
-0.1688026338815689,
0.046710994094610214,
-0.989709198474884,
0.19823776185512543,
-0.027882596477866173,
-1.2686529159545898,
-1.2339251041412354,
0.5172474980354309,
-0.28024932742118835,
1.211578369140625... |
func (ls *LightString) Init() {
log.Infof("Creating %v pixel light string", ls.Count)
ls.Last = ls.Count // default last pixel to count
n := 0
for n < ls.Count {
ls.Pixels = append(ls.Pixels, &Pixel{
Color: defaultPixelColor,
Brightness: defaultPixelBrightness,
})
n++
}
} | [
-0.010561688803136349,
-0.334725022315979,
0.37333056330680847,
-0.8983525633811951,
0.09991827607154846,
0.37599825859069824,
-0.5205943584442139,
0.16534768044948578,
0.048476483672857285,
-0.27163073420524597,
0.027304844930768013,
-0.013918776996433735,
-0.007178547792136669,
0.6063886... |
func (ls *LightString) FillString(color uint8) {
log.Debugf("Filling pixels with color %v", color)
n := 0
for n < ls.Last {
ls.Pixels[n].Color = color
log.Debugf("Coloring pixel %v %v", n, color)
n++
}
} | [
-0.5547871589660645,
0.2662753462791443,
0.49959030747413635,
-1.0344029664993286,
0.6697266101837158,
0.12065011262893677,
-0.6393262147903442,
-0.5362966060638428,
0.4060523808002472,
0.029063858091831207,
-0.0034243266563862562,
0.19702748954296112,
0.11245131492614746,
1.09420979022979... |
func (ls *LightString) SetColor(position int, color uint8) error {
if position > ls.Last {
log.Errorf("SetColor: last valid pixel is #%v", ls.Last)
return fmt.Errorf("SetColor: last valid pixel is #%v", ls.Last)
}
log.Debugf("Coloring pixel %v %v", position, color)
ls.Pixels[position].Color = color
return nil
... | [
0.1778055876493454,
-0.675430178642273,
0.41100892424583435,
-0.5744295716285706,
-0.25327280163764954,
0.4449261724948883,
-0.7891627550125122,
0.36552536487579346,
0.5026429891586304,
0.379955917596817,
-0.08926643431186676,
0.16626957058906555,
-0.22375233471393585,
0.7653340101242065,
... |
func (ls *LightString) Render() {
log.Debug("Rendering string")
} | [
0.06348367035388947,
-1.180212378501892,
0.2208331674337387,
-0.4118678867816925,
0.017732609063386917,
-0.061337634921073914,
-0.7866041660308838,
0.5999607443809509,
0.06069790571928024,
-0.5926281213760376,
0.08547496050596237,
0.13043618202209473,
-0.8515821695327759,
0.171220615506172... |
func NewDirectRequestSpec(spec *job.DirectRequestSpec) *DirectRequestSpec {
return &DirectRequestSpec{
ContractAddress: spec.ContractAddress,
MinIncomingConfirmations: spec.MinIncomingConfirmations,
MinIncomingConfirmationsEnv: spec.MinIncomingConfirmationsEnv,
MinContractPayment: spec.... | [
0.47714027762413025,
-0.955278754234314,
0.2626902759075165,
-0.5980851054191589,
-0.41957274079322815,
0.796697735786438,
-0.7211136817932129,
-0.11744963377714157,
0.03938557580113411,
-0.07774166762828827,
0.2956952452659607,
0.5857112407684326,
0.18452148139476776,
0.02145957760512829,... |
func NewFluxMonitorSpec(spec *job.FluxMonitorSpec) *FluxMonitorSpec {
var drumbeatSchedulePtr *string
if spec.DrumbeatEnabled {
drumbeatSchedulePtr = &spec.DrumbeatSchedule
}
var drumbeatRandomDelayPtr *string
if spec.DrumbeatRandomDelay > 0 {
drumbeatRandomDelay := spec.DrumbeatRandomDelay.String()
drumbeat... | [
0.24465571343898773,
-0.5151852369308472,
0.3694959580898285,
-0.3052167594432831,
-0.49368831515312195,
-0.1261022537946701,
0.1549653261899948,
0.06453949958086014,
0.3139778971672058,
0.12845851480960846,
-0.44732242822647095,
0.7093217968940735,
-0.12018979340791702,
0.2087991088628769... |
func NewOffChainReportingSpec(spec *job.OCROracleSpec) *OffChainReportingSpec {
return &OffChainReportingSpec{
ContractAddress: spec.ContractAddress,
P2PBootstrapPeers: spec.P2PBootstrapPeers,
P2PV2Bootstrappers: spec.P2PV2Bootstrappers,
... | [
0.22282589972019196,
-0.39758503437042236,
0.5629556775093079,
-1.0649951696395874,
-0.24243983626365662,
-0.2705587148666382,
0.032091982662677765,
-0.4526829123497009,
-0.28866803646087646,
0.7300073504447937,
0.2890387773513794,
0.5002531409263611,
-0.14258885383605957,
0.49094593524932... |
func NewOffChainReporting2Spec(spec *job.OCR2OracleSpec) *OffChainReporting2Spec {
return &OffChainReporting2Spec{
ContractID: spec.ContractID,
Relay: spec.Relay,
RelayConfig: spec.RelayConfig,
P2PV2Bootstrappers: spec.P2PV... | [
0.14876095950603485,
-0.8874310851097107,
0.39595937728881836,
-0.8405532836914062,
-0.7857415080070496,
-0.08897534012794495,
-0.17711089551448822,
-0.5399787425994873,
-0.37704533338546753,
0.13266119360923767,
0.11297295242547989,
0.8516108393669128,
0.04359884560108185,
0.2975286245346... |
func NewPipelineSpec(spec *pipeline.Spec) PipelineSpec {
return PipelineSpec{
ID: spec.ID,
JobID: spec.JobID,
DotDAGSource: spec.DotDagSource,
}
} | [
0.4605352282524109,
-0.9517573118209839,
-0.04672925919294357,
-1.2430164813995361,
-1.173170804977417,
0.11816082894802094,
-0.7875566482543945,
0.35194000601768494,
0.3284074366092682,
-0.06898905336856842,
-0.7483976483345032,
0.707863986492157,
1.1466076374053955,
-0.5397636294364929,
... |
func NewKeeperSpec(spec *job.KeeperSpec) *KeeperSpec {
return &KeeperSpec{
ContractAddress: spec.ContractAddress,
FromAddress: spec.FromAddress,
CreatedAt: spec.CreatedAt,
UpdatedAt: spec.UpdatedAt,
EVMChainID: spec.EVMChainID,
}
} | [
0.9314364790916443,
-0.7020273804664612,
0.26579228043556213,
-0.2694089412689209,
-1.0329186916351318,
0.9823841452598572,
-0.1654747873544693,
0.09181182086467743,
-0.6805827021598816,
-0.10403905063867569,
-0.11625365912914276,
0.4377637505531311,
0.44166210293769836,
0.2343104183673858... |
func NewWebhookSpec(spec *job.WebhookSpec) *WebhookSpec {
return &WebhookSpec{
CreatedAt: spec.CreatedAt,
UpdatedAt: spec.UpdatedAt,
}
} | [
0.5035154819488525,
-0.8564773201942444,
0.39863547682762146,
-0.3334558606147766,
-0.9124299883842468,
-0.30312854051589966,
-0.5112466812133789,
-0.09714756906032562,
-0.6147804260253906,
0.840295672416687,
-0.4371238350868225,
0.5096519589424133,
0.6315674781799316,
0.24114710092544556,... |
func NewCronSpec(spec *job.CronSpec) *CronSpec {
return &CronSpec{
CronSchedule: spec.CronSchedule,
CreatedAt: spec.CreatedAt,
UpdatedAt: spec.UpdatedAt,
}
} | [
0.8121087551116943,
-0.7185578942298889,
0.25010034441947937,
-0.047727689146995544,
-1.1371382474899292,
-0.17852561175823212,
-0.4363723695278168,
-0.4975283741950989,
-0.28074735403060913,
0.509495735168457,
-0.4736686944961548,
0.6017547845840454,
0.8131840229034424,
-0.003130209632217... |
func NewBlockhashStoreSpec(spec *job.BlockhashStoreSpec) *BlockhashStoreSpec {
return &BlockhashStoreSpec{
CoordinatorV1Address: spec.CoordinatorV1Address,
CoordinatorV2Address: spec.CoordinatorV2Address,
CoordinatorV2PlusAddress: spec.CoordinatorV2PlusAddress,
WaitBlocks: ... | [
0.8692519068717957,
-0.667306661605835,
0.3996666967868805,
-0.423747181892395,
-0.9462783336639404,
-0.08146040141582489,
-0.3241358697414398,
0.27392780780792236,
0.4808104634284973,
0.5475623607635498,
0.2003469169139862,
0.6967055797576904,
-0.202768936753273,
-0.1852385699748993,
0.... |
func NewBlockHeaderFeederSpec(spec *job.BlockHeaderFeederSpec) *BlockHeaderFeederSpec {
return &BlockHeaderFeederSpec{
CoordinatorV1Address: spec.CoordinatorV1Address,
CoordinatorV2Address: spec.CoordinatorV2Address,
CoordinatorV2PlusAddress: spec.CoordinatorV2PlusAddress,
WaitBlocks: ... | [
0.8844990730285645,
-0.9498695731163025,
0.6607593297958374,
0.07877349108457565,
-0.4784056544303894,
-0.35143914818763733,
-0.35148587822914124,
0.22289671003818512,
-0.27631667256355286,
0.3438217341899872,
0.3751218616962433,
0.8644564747810364,
-0.3535381257534027,
0.03085867501795292... |
func NewBootstrapSpec(spec *job.BootstrapSpec) *BootstrapSpec {
return &BootstrapSpec{
ContractID: spec.ContractID,
Relay: spec.Relay,
RelayConfig: spec.RelayConfig,
BlockchainTimeout: spec.BlockchainTimeout,
ContractCon... | [
0.3215838074684143,
-0.5588217377662659,
0.29439830780029297,
-0.2640669643878937,
-1.3191977739334106,
-0.3954044580459595,
-0.44266530871391296,
-0.24602855741977692,
-0.20550864934921265,
0.5096040368080139,
-0.10836765915155411,
-0.11756055802106857,
0.5749773383140564,
0.1190597563982... |
func NewJobResource(j job.Job) *JobResource {
resource := &JobResource{
JAID: NewJAIDInt32(j.ID),
Name: j.Name.ValueOrZero(),
Type: JobSpecType(j.Type),
SchemaVersion: j.SchemaVersion,
GasLimit: j.GasLimit,
ForwardingAllowed: j.ForwardingAllowed,
MaxTas... | [
0.16274765133857727,
-0.42472946643829346,
0.2384265959262848,
-0.3616056740283966,
-0.8224340677261353,
-0.45159974694252014,
-0.18643590807914734,
0.07615943253040314,
-0.00688268942758441,
-0.012056736275553703,
-0.06365261226892471,
0.5205483436584473,
-0.4541533887386322,
0.6661767363... |
func (r JobResource) GetName() string {
return "jobs"
} | [
0.36798977851867676,
-0.43213197588920593,
0.4057173728942871,
-0.17893165349960327,
-0.34824058413505554,
0.4128677546977997,
-0.03666357323527336,
-0.17662811279296875,
-0.12594349682331085,
-0.05082280561327934,
0.01437560934573412,
-0.3395111560821533,
0.23751497268676758,
0.5661914944... |
func WithGroupIDConsumerOption(groupID string) ConsumerOption {
return func(c *Consumer) {
c.config.GroupID = groupID
}
} | [
0.25952306389808655,
-0.5249923467636108,
0.4042723774909973,
0.5836183428764343,
0.24290139973163605,
-0.665238082408905,
0.4461855888366699,
-0.9522412419319153,
-0.021048812195658684,
1.6668888330459595,
0.394822359085083,
-0.02286306582391262,
-0.01744634285569191,
0.25798162817955017,... |
func WithTopicConsumerOption(topic string) ConsumerOption {
return func(c *Consumer) {
c.config.Topic = topic
}
} | [
0.7569167017936707,
-0.5158929228782654,
0.34656742215156555,
0.40848109126091003,
0.11964477598667145,
-0.4728110134601593,
0.41533124446868896,
-0.44988560676574707,
-0.051181092858314514,
1.164372205734253,
0.5376113653182983,
-0.47894036769866943,
0.6291608214378357,
-0.248816683888435... |
func WithMaxMinByteConsumerOption(min, max int) ConsumerOption {
return func(c *Consumer) {
c.config.MinBytes = min
c.config.MaxBytes = max
}
} | [
0.33693575859069824,
-0.8308961987495422,
0.587716817855835,
0.2750966548919678,
-0.4953050911426544,
-0.30009955167770386,
-0.33780768513679504,
-0.4945485293865204,
0.5611563324928284,
0.7228915095329285,
-0.6077509522438049,
0.3539256751537323,
-0.21760383248329163,
-0.1455208659172058,... |
func WithAutoCommitConsumerOption(flag bool) ConsumerOption {
return func(c *Consumer) { c.autocommit = flag }
} | [
0.7133157849311829,
-0.2487063705921173,
0.48557618260383606,
0.17752662301063538,
0.4111813008785248,
-0.7266298532485962,
0.7929475903511047,
-0.005231484305113554,
-0.45387449860572815,
1.8135240077972412,
0.29212796688079834,
0.02200343832373619,
-0.15316343307495117,
-0.63363146781921... |
func WithAutoCommitTimeConsumerOption(dur time.Duration) ConsumerOption {
return func(c *Consumer) { c.config.CommitInterval = dur }
} | [
0.4339357614517212,
0.032577674835920334,
0.5284210443496704,
-0.2569130063056946,
0.49408063292503357,
-0.12675461173057556,
0.31798210740089417,
-0.5530363917350769,
-0.33727970719337463,
1.8083775043487549,
0.1923673450946808,
0.3323249816894531,
0.10906784236431122,
-0.0510556288063526... |
func WithDecoderConsumerOption(fn Decoder) ConsumerOption {
return func(c *Consumer) { c.dec = fn }
} | [
0.9646302461624146,
-0.1173470988869667,
0.6092699766159058,
0.36283743381500244,
-0.4819867014884949,
-0.8466081619262695,
0.6724463105201721,
-0.6561046838760376,
0.03664027899503708,
-0.09497375786304474,
-0.19144561886787415,
-0.3250010311603546,
0.989075779914856,
-0.01334690116345882... |
func WithBeforeFuncsConsumerOption(fns ...BeforeFunc) ConsumerOption {
return func(c *Consumer) { c.befores = append(c.befores, fns...) }
} | [
0.5459442138671875,
0.6620714664459229,
0.30752620100975037,
0.061187535524368286,
0.4603807032108307,
-1.5949530601501465,
-0.16338342428207397,
-0.545352578163147,
0.14600536227226257,
0.3372364342212677,
-0.2883860170841217,
0.02509448677301407,
0.19341355562210083,
-0.18877488374710083... |
func WithAfterFuncsConsumerOption(fns ...AfterFunc) ConsumerOption {
return func(c *Consumer) { c.afters = append(c.afters, fns...) }
} | [
0.8237568140029907,
-0.19906426966190338,
0.34234777092933655,
0.5439428091049194,
-0.34464389085769653,
-1.1028430461883545,
-0.09371589869260788,
0.21726851165294647,
0.3730755150318146,
0.14966420829296112,
-0.7184293270111084,
-0.36794036626815796,
0.2845463454723358,
-0.40955406427383... |
func WithEndpointConsumerOption(end endpoint.Endpoint) ConsumerOption {
return func(c *Consumer) { c.end = end }
} | [
0.14823609590530396,
-0.6192243695259094,
0.612966001033783,
0.5501532554626465,
0.46044766902923584,
-0.21936602890491486,
-0.026410555467009544,
-0.14283302426338196,
-0.4119172990322113,
1.481590747833252,
0.2132457196712494,
-0.17544591426849365,
0.1111353188753128,
-0.7486392855644226... |
func WithReaderConsumerOption(reader *kafgo.Reader) ConsumerOption {
return func(c *Consumer) { c.reader = reader }
} | [
0.8174983859062195,
-0.8962662220001221,
0.401689350605011,
-0.16152672469615936,
-0.5720170736312866,
-0.34254446625709534,
0.49364542961120605,
-0.5450169444084167,
-0.09111188352108002,
1.1749836206436157,
0.5416752696037292,
-0.7421573400497437,
0.7131553292274475,
-0.31218087673187256... |
func WithOffsetConsumerOption(offset int64) ConsumerOption {
return func(c *Consumer) {
switch offset {
case LastOffset:
c.config.StartOffset = LastOffset
case FirstOffset:
c.config.StartOffset = FirstOffset
default:
c.config.StartOffset = FirstOffset
}
}
} | [
-0.01394531037658453,
-0.6881410479545593,
0.6144058704376221,
-0.20854128897190094,
-0.11529451608657837,
-0.08638838678598404,
0.7026318907737732,
-0.2537275552749634,
0.18232247233390808,
0.9780860543251038,
0.08743416517972946,
0.2614452838897705,
0.7936525940895081,
-0.048419885337352... |
func (c *Consumer) Open() error {
if c.reader == nil {
c.reader = kafgo.NewReader(*c.config)
}
for {
// start a new context
var (
ctx = context.Background()
msg kafgo.Message
err error
)
if c.autocommit {
msg, err = c.reader.ReadMessage(ctx)
} else {
msg, err = c.reader.FetchMessage(ctx)... | [
-0.28298988938331604,
0.20504975318908691,
0.803945004940033,
0.032609958201646805,
-0.25623875856399536,
-0.6749062538146973,
0.4139690399169922,
0.5753976702690125,
-0.703160285949707,
0.06783128529787064,
0.7007841467857361,
-0.3537651300430298,
-0.525549054145813,
-0.02362135611474514,... |
func NewConsumer(
brokers []string,
logger log.Logger,
options ...ConsumerOption,
) (*Consumer, error) {
// default values
cfg := kafgo.ReaderConfig{
Brokers: brokers,
GroupID: defaultConsumerGroupID,
Topic: defaultTopic,
Logger: kafka.LoggerFunc(logger.Debugf),
}
cs := &Consumer{
reader: nil,
co... | [
0.4487483501434326,
-0.6245142221450806,
0.37833479046821594,
1.0159852504730225,
-0.3417162597179413,
-0.45710423588752747,
-0.06541720032691956,
-0.13414056599140167,
-0.39611688256263733,
0.8785869479179382,
0.4304986000061035,
-0.6433385610580444,
-0.6528398990631104,
0.480752736330032... |
func (left *DataTable) InnerJoin(right *DataTable, on []JoinOn) (*DataTable, error) {
return newJoinImpl(innerJoin, []*DataTable{left, right}, on).Compute()
} | [
0.18027426302433014,
0.1924847662448883,
0.5820598006248474,
0.7836058735847473,
-1.5742754936218262,
0.31864696741104126,
-0.6634253263473511,
0.44247910380363464,
-1.0665079355239868,
-0.3320516347885132,
-0.9906583428382874,
0.7456614375114441,
-0.9334335923194885,
-0.02931593544781208,... |
func InnerJoin(tables []*DataTable, on []JoinOn) (*DataTable, error) {
return newJoinImpl(innerJoin, tables, on).Compute()
} | [
0.35124367475509644,
0.403872013092041,
0.49601712822914124,
1.366480827331543,
-2.018465280532837,
0.35715892910957336,
-0.17832955718040466,
1.0970215797424316,
-0.9601442813873291,
-0.39767926931381226,
-0.9413363933563232,
1.0624678134918213,
-0.9702479243278503,
-0.4375484883785248,
... |
func (left *DataTable) LeftJoin(right *DataTable, on []JoinOn) (*DataTable, error) {
return newJoinImpl(leftJoin, []*DataTable{left, right}, on).Compute()
} | [
0.27790892124176025,
0.14361801743507385,
0.5350849628448486,
0.697880744934082,
-1.07567298412323,
0.32823678851127625,
-1.0840790271759033,
0.005497555248439312,
-0.6775364279747009,
0.42146748304367065,
-1.1519817113876343,
0.4120215177536011,
-0.4046142101287842,
0.7975443005561829,
... |
func LeftJoin(tables []*DataTable, on []JoinOn) (*DataTable, error) {
return newJoinImpl(leftJoin, tables, on).Compute()
} | [
0.5714737176895142,
0.32541513442993164,
0.4194795489311218,
1.1296199560165405,
-1.397260069847107,
0.7210035920143127,
-0.6774941086769104,
0.5459588170051575,
-0.5653796195983887,
0.3721504211425781,
-0.9758210182189941,
0.6202026605606079,
-0.49265581369400024,
0.6482576131820679,
-0... |
func (left *DataTable) RightJoin(right *DataTable, on []JoinOn) (*DataTable, error) {
return newJoinImpl(rightJoin, []*DataTable{left, right}, on).Compute()
} | [
0.4357883334159851,
0.331371933221817,
0.4272218346595764,
0.788891077041626,
-1.307332158088684,
0.11713049560785294,
-1.0529489517211914,
-0.0013120969524607062,
-1.0055011510849,
0.4220975339412689,
-1.254620909690857,
0.6743290424346924,
-0.1609802097082138,
0.2953908443450928,
-0.18... |
func RightJoin(tables []*DataTable, on []JoinOn) (*DataTable, error) {
return newJoinImpl(rightJoin, tables, on).Compute()
} | [
0.6876219511032104,
0.5144635438919067,
0.375008225440979,
1.2936416864395142,
-1.7411422729492188,
0.24186955392360687,
-0.6608342528343201,
0.5842759013175964,
-0.9625998735427856,
0.3999467194080353,
-1.0160356760025024,
0.9056410789489746,
-0.25686129927635193,
0.011111187748610973,
... |
func (left *DataTable) OuterJoin(right *DataTable, on []JoinOn) (*DataTable, error) {
return newJoinImpl(outerJoin, []*DataTable{left, right}, on).Compute()
} | [
-0.29036590456962585,
0.3804265558719635,
0.5423999428749084,
0.3184649348258972,
-1.7810485363006592,
0.5208854675292969,
-0.4691818058490753,
0.5018640160560608,
-0.8885934948921204,
0.06607239693403244,
-0.5970418453216553,
0.8445370197296143,
-0.6074736714363098,
0.2493230104446411,
... |
func OuterJoin(tables []*DataTable, on []JoinOn) (*DataTable, error) {
return newJoinImpl(outerJoin, tables, on).Compute()
} | [
-0.060311395674943924,
0.5191327333450317,
0.42443910241127014,
0.9411306977272034,
-2.135249376296997,
0.7440532445907593,
0.14087778329849243,
0.9584851861000061,
-0.7276391386985779,
0.04409473389387131,
-0.39712828397750854,
1.2450205087661743,
-0.629205048084259,
-0.06691033393144608,... |
func On(fields ...string) []JoinOn {
var jon []JoinOn
for _, f := range fields {
matches := rgOn.FindStringSubmatch(f)
switch len(matches) {
case 0:
jon = append(jon, JoinOn{Table: "*", Field: f})
case 3:
t := matches[1]
if len(t) == 0 {
t = "*"
}
jon = append(jon, JoinOn{Table: t, Field: ... | [
0.022005653008818626,
-0.3304251730442047,
0.7661871910095215,
0.6504395008087158,
-0.21909867227077484,
-0.1898876279592514,
-1.2661291360855103,
0.8663389086723328,
-0.7414601445198059,
0.5797502398490906,
-0.585239052772522,
-0.4185761511325836,
-0.6413571834564209,
-0.26215794682502747... |
func Using(fields ...string) []JoinOn {
var jon []JoinOn
for _, f := range fields {
jon = append(jon, JoinOn{Table: "*", Field: f})
}
return jon
} | [
-0.4446775019168854,
0.488474041223526,
0.5884904265403748,
0.8277880549430847,
-0.2445785105228424,
0.3150768578052521,
-0.9064087867736816,
0.11602149158716202,
-0.7112070322036743,
0.09474091976881027,
-0.45045769214630127,
-0.2732483148574829,
-0.9084987044334412,
0.11134964227676392,
... |
func (app *App) GetOrders(page, perPage int, snapshotID string) (*rpc.GetOrdersResponse, error) {
ordersInfos := []*zeroex.AcceptedOrderInfo{}
if perPage <= 0 {
return &rpc.GetOrdersResponse{
OrdersInfos: ordersInfos,
SnapshotID: snapshotID,
}, nil
}
var snapshot *db.Snapshot
if snapshotID == "" {
//... | [
-0.5294543504714966,
0.6113588213920593,
0.8159583210945129,
-0.03324081003665924,
-0.39407309889793396,
-0.9250269532203674,
-0.64179927110672,
-0.01124230120331049,
1.140992283821106,
-0.03889873996376991,
0.6270812749862671,
-0.16860021650791168,
-0.19987235963344574,
0.8217025995254517... |
func (app *App) AddOrders(signedOrdersRaw []*json.RawMessage) (*zeroex.ValidationResults, error) {
allValidationResults := &zeroex.ValidationResults{
Accepted: []*zeroex.AcceptedOrderInfo{},
Rejected: []*zeroex.RejectedOrderInfo{},
}
schemaValidOrders := []*zeroex.SignedOrder{}
for _, signedOrderRaw := range si... | [
-0.8801868557929993,
-0.1901450753211975,
0.6947992444038391,
0.23947618901729584,
-0.19542811810970306,
-0.035499583929777145,
-0.23430302739143372,
-0.3247644305229187,
0.6028164625167847,
-0.2571660876274109,
0.3005968928337097,
-0.2639704644680023,
-0.39857766032218933,
0.8724771738052... |
func (app *App) AddPeer(peerInfo peerstore.PeerInfo) error {
ctx, cancel := context.WithTimeout(context.Background(), peerConnectTimeout)
defer cancel()
return app.node.Connect(ctx, peerInfo)
} | [
0.006813972257077694,
-0.4730406403541565,
0.5064482688903809,
0.43269073963165283,
-0.45360442996025085,
0.8565266132354736,
-1.1770758628845215,
0.4243217706680298,
-0.27615678310394287,
-0.6916967034339905,
0.8197441101074219,
-0.7033951282501221,
-0.8808737397193909,
0.6060389280319214... |
func (app *App) SubscribeToOrderEvents(sink chan<- []*zeroex.OrderEvent) event.Subscription {
subscription := app.orderWatcher.Subscribe(sink)
return subscription
} | [
-0.2370084673166275,
-0.2661392092704773,
0.3796742260456085,
-0.07708501815795898,
0.8041959404945374,
-0.7763748168945312,
0.19904303550720215,
-0.8110548853874207,
0.6733856201171875,
-0.724566638469696,
-0.033385276794433594,
0.7836118936538696,
-0.1679043173789978,
0.13611829280853271... |
func (app *App) Close() {
if err := app.node.Close(); err != nil {
log.WithField("error", err.Error()).Error("error while closing node")
}
app.ethWatcher.Stop()
if err := app.orderWatcher.Stop(); err != nil {
log.WithField("error", err.Error()).Error("error while closing orderWatcher")
}
app.blockWatcherCance... | [
0.3417087495326996,
0.09949801862239838,
0.8412392735481262,
0.6075993776321411,
0.12113639712333679,
1.1381256580352783,
0.5572825074195862,
-0.9629759192466736,
-0.7130009531974792,
0.7062740325927734,
1.0460659265518188,
-0.3069151043891907,
0.16156555712223053,
0.6290654540061951,
1.... |
func New(out io.Writer) Logger {
l := log.NewJSONLogger(log.NewSyncWriter(out))
l = log.With(l, "ts", log.DefaultTimestampUTC)
return &logger{l}
} | [
-0.18980832397937775,
-0.4825819432735443,
0.502767026424408,
-0.35931241512298584,
-1.403232455253601,
-1.1843312978744507,
-0.7334463000297546,
0.12177155911922455,
-0.8857452273368835,
-0.03659405931830406,
-0.277069091796875,
0.10151411592960358,
1.5217726230621338,
0.6133328080177307,... |
func (s *StatusPageHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if s.Authenticator != nil {
_, err := s.Authenticator.Authenticate(r.Context(), w, r)
if errors.Is(err, oidc.ErrRedirectRequired) {
return
}
if err != nil {
http.Error(w, "Error: Authentication failed", http.StatusInternalSer... | [
0.07287348061800003,
-0.11164428293704987,
0.8069861531257629,
0.3190450966358185,
-0.3368196487426758,
0.0008556282264180481,
0.05056612566113472,
-0.2677544355392456,
-0.6075488328933716,
0.6906440854072571,
0.4559013545513153,
-0.11683094501495361,
-0.9049484729766846,
1.449002146720886... |
func (f *ForceRunHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
log.Logger("webserver").Info("Force run requested")
var data struct {
Result string `json:"result"`
Message string `json:"message"`
}
switch r.Method {
case "POST":
var (
userEmail string
err error
)
if f.Authenti... | [
-0.1959305852651596,
0.1258351355791092,
0.9525818228721619,
0.5984188318252563,
-0.3839417099952698,
0.4085797071456909,
-0.187709242105484,
-0.9788706302642822,
-0.6749517321586609,
0.415568470954895,
0.48469650745391846,
0.8054477572441101,
-0.7743915915489197,
1.486167073249817,
0.82... |
func (ws *WebServer) Start() error {
if ws.server != nil {
return fmt.Errorf("WebServer already running")
}
log.Logger("webserver").Info("Launching")
templatePath := ws.TemplatePath
if templatePath == "" {
templatePath = defaultServerTemplatePath
}
template, err := createTemplate(templatePath)
if err != n... | [
-0.8069131970405579,
-0.7036956548690796,
0.7795747518539429,
0.2115943878889084,
0.08645714819431305,
0.10328573733568192,
0.1362883448600769,
0.5598753094673157,
0.24271689355373383,
0.29471805691719055,
-0.47862064838409424,
1.0187408924102783,
-0.2266252040863037,
1.119619607925415,
... |
func (ws *WebServer) Shutdown() error {
err := ws.server.Shutdown(context.Background())
ws.server = nil
return err
} | [
-0.5761626362800598,
-0.3738570809364319,
0.5945249199867249,
-0.018965356051921844,
0.3597962260246277,
0.4267348647117615,
0.4028177559375763,
-0.0487709641456604,
0.9958415031433105,
0.30079782009124756,
-0.25523966550827026,
1.4820616245269775,
-0.8310441970825195,
0.8665280938148499,
... |
func defaultConfig() *config {
return &config{
Drop: false,
RGBA: rgba{
R: 255,
G: 255,
B: 255,
A: 1,
},
Export: export{
Format: "jpeg",
Quality: 85,
},
}
} | [
0.1275903284549713,
0.27237603068351746,
0.473440557718277,
0.1931011974811554,
-0.6577860713005066,
-0.18045060336589813,
0.047760408371686935,
0.572827935218811,
0.6514879465103149,
-0.047053012996912,
-0.36414602398872375,
-0.28705230355262756,
0.043181270360946655,
1.3632581233978271,
... |
func WithHTTPTimeout(timeout time.Duration) HTTPCheckerOption {
return func(c *HTTPChecker) {
c.timeout = timeout
}
} | [
1.1945661306381226,
-0.5835294723510742,
0.4944297969341278,
-0.06655442714691162,
0.12053101509809494,
0.6260796785354614,
-0.20933838188648224,
0.5065202116966248,
-0.09951930493116379,
0.36487603187561035,
-0.2518831193447113,
-0.3251231610774994,
0.21808397769927979,
0.7944523692131042... |
func WithHTTPMethod(method string) HTTPCheckerOption {
return func(c *HTTPChecker) {
c.method = method
}
} | [
0.5857886075973511,
-0.3436976671218872,
0.5281749367713928,
-0.09785018116235733,
0.006471488159149885,
0.7632079720497131,
0.22862297296524048,
-0.3105649948120117,
-0.3380917012691498,
-0.12155686318874359,
0.1473892778158188,
-0.23177313804626465,
0.11252389848232269,
0.632585644721984... |
func NewHTTPChecker(url string, opts ...HTTPCheckerOption) *HTTPChecker {
checker := &HTTPChecker{
url: url,
method: http.MethodGet,
}
for _, opt := range opts {
opt(checker)
}
return checker
} | [
-0.9883341789245605,
-0.45089441537857056,
0.4130135178565979,
0.6192507743835449,
-1.0333538055419922,
0.262045294046402,
-0.7887617349624634,
0.4142428934574127,
0.019814852625131607,
-0.5045930743217468,
-0.2009139508008957,
-0.2239954173564911,
-0.45404335856437683,
0.946435809135437,
... |
func (c *HTTPChecker) Check() error {
client := &http.Client{
Timeout: c.timeout,
}
req, err := http.NewRequest(c.method, c.url, nil)
if err != nil {
return err
}
resp, err := client.Do(req)
if err != nil {
return err
}
if resp.StatusCode != http.StatusOK {
return ErrCheckFailed
}
return nil
} | [
-0.2810671031475067,
0.23738957941532135,
0.6325404644012451,
0.8676690459251404,
0.49217644333839417,
1.0265376567840576,
-0.6816441416740417,
-0.30602583289146423,
-1.2959965467453003,
-0.1573449969291687,
0.6154863834381104,
0.5432006120681763,
-0.626814067363739,
0.8349495530128479,
... |
func (m *MT) Seed(theseed int64) {
// Lower 32bit
seed := uint32(theseed)
for m.lp = 0; m.lp < 624; m.lp++ {
m.Key[m.lp] = seed
seed = (uint32(1812433253)*(seed^(seed>>30)) + m.lp + 1) & 0xffffffff
//m.arrayL[m.lp] = 0x6c078965*(m.arrayL[m.lp-1]^(m.arrayL[m.lp-1]>>30)) + m.lp
}
} | [
-0.09308166056871414,
-0.03409741446375847,
0.573916494846344,
-1.0781477689743042,
-0.6092841029167175,
1.1803548336029053,
0.4318774342536926,
-0.44061267375946045,
0.5591458082199097,
0.17392557859420776,
-0.1415015161037445,
0.45347860455513,
-0.7132323384284973,
0.3562719225883484,
... |
func teststring(t *testing.T, s string) {
buf := toint8(s)
r := kstat.CFieldString(buf[:])
if r != s {
t.Fatalf("full buf mismatch: %q vs %q", s, r)
}
r = kstat.CFieldString(buf[:len(s)])
if r != s {
t.Fatalf("exact buf mismatch: %q vs %q", s, r)
}
r = kstat.CFieldString(buf[:len(s)+1])
if r != s {
t.Fat... | [
0.5180556178092957,
0.09347836673259735,
0.33617112040519714,
-0.2830219864845276,
0.3736368715763092,
0.10217539221048355,
0.8071097135543823,
-1.0547664165496826,
0.9021837115287781,
-0.575901210308075,
-0.5071317553520203,
-0.32518547773361206,
-0.4379187822341919,
-0.32818126678466797,... |
func TestCFieldString(t *testing.T) {
teststring(t, "this is a test string")
teststring(t, "")
buf := toint8("abc\x00def")
r := kstat.CFieldString(buf[:])
if r != "abc" {
t.Fatalf("embedded null not properly handled: %q", r)
}
} | [
1.3808317184448242,
-0.20592044293880463,
0.24572210013866425,
-0.6122509837150574,
0.27809733152389526,
0.7312402129173279,
0.5209816098213196,
-0.5417954921722412,
0.9181362986564636,
-0.5291197299957275,
-0.5729570388793945,
-0.502157986164093,
-1.2354819774627686,
-0.27931535243988037,... |
func (*Request) Descriptor() ([]byte, []int) {
return file_imgCode_proto_rawDescGZIP(), []int{0}
} | [
-1.8417272567749023,
0.41391250491142273,
0.5807618498802185,
0.17212741076946259,
0.25395745038986206,
-0.5513627529144287,
0.1247362568974495,
0.07821022719144821,
0.11775651574134827,
-1.0658103227615356,
-0.05787227675318718,
0.412529855966568,
0.4348434805870056,
0.7822495698928833,
... |
func (*Response) Descriptor() ([]byte, []int) {
return file_imgCode_proto_rawDescGZIP(), []int{1}
} | [
-0.5538972616195679,
0.08320005983114243,
0.3048488199710846,
0.286300927400589,
-0.07197147607803345,
-0.6488111019134521,
1.035632610321045,
0.13317996263504028,
0.6459484696388245,
-0.8907376527786255,
-0.9478418231010437,
-0.3422228693962097,
0.24661193788051605,
0.6916762590408325,
... |
func (*CheckRequest) Descriptor() ([]byte, []int) {
return file_imgCode_proto_rawDescGZIP(), []int{2}
} | [
-1.0911436080932617,
0.15120704472064972,
0.6381263136863708,
0.19784431159496307,
0.19245561957359314,
-0.5114046931266785,
0.10106699913740158,
0.3568478524684906,
-0.24670951068401337,
0.20952406525611877,
0.11142967641353607,
0.3636060655117035,
0.2394484281539917,
0.956415057182312,
... |
func (*CheckResponse) Descriptor() ([]byte, []int) {
return file_imgCode_proto_rawDescGZIP(), []int{3}
} | [
-0.17410655319690704,
0.13791075348854065,
0.4317200183868408,
0.039677638560533524,
0.7559918761253357,
-1.135642647743225,
0.6678459048271179,
0.16364501416683197,
0.22575849294662476,
0.20389825105667114,
-0.4570704698562622,
-0.5152601599693298,
-0.7330300211906433,
0.3241417407989502,... |
func Open(dsn string) (*Adapter, error) {
var err error
adapter := &Adapter{sql.New("?", false, errorFunc, incrementFunc)}
adapter.DB, err = db.Open("sqlite3", dsn)
return adapter, err
} | [
-0.48461854457855225,
0.8574117422103882,
0.3764159381389618,
-0.019149737432599068,
-1.5158588886260986,
-0.45659658312797546,
0.07793985307216644,
0.8926398754119873,
0.7607527375221252,
-0.6313583254814148,
-0.4878309667110443,
0.17236654460430145,
-0.09495974332094193,
-0.1344711035490... |
func (c *Client) UpdateMatchmakingConfiguration(ctx context.Context, params *UpdateMatchmakingConfigurationInput, optFns ...func(*Options)) (*UpdateMatchmakingConfigurationOutput, error) {
if params == nil {
params = &UpdateMatchmakingConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateM... | [
-1.5888032913208008,
-0.0064305588603019714,
0.6982265114784241,
-0.15813405811786652,
-0.4199507236480713,
-0.17984597384929657,
0.7153448462486267,
-0.20064975321292877,
0.6166645884513855,
0.12609319388866425,
-0.7376362681388855,
1.0140739679336548,
-0.17877046763896942,
-0.64198017120... |
func (rc *RouteConfig) RouteHandler(writer http.ResponseWriter, request *http.Request) {
log := rc.route.Logger.
WithEventSource(rc.route.EventSource.Name).
WithEndpoint(rc.route.Webhook.Endpoint).
WithPort(rc.route.Webhook.Port)
log.Info("request received")
if !helper.ActiveEndpoints[rc.route.Webhook.Endpoi... | [
-0.03568481281399727,
-0.6087938547134399,
0.8338051438331604,
0.05688964203000069,
0.5889554023742676,
-0.05841584876179695,
0.42534151673316956,
0.7553530931472778,
-0.2720077931880951,
0.9837885499000549,
-0.10545766353607178,
-0.17418956756591797,
-0.5889187455177307,
0.227077871561050... |
func (ese *GitlabEventSourceExecutor) StartEventSource(eventSource *gateways.EventSource, eventStream gateways.Eventing_StartEventSourceServer) error {
defer gateways.Recover(eventSource.Name)
log := ese.Log.WithEventSource(eventSource.Name)
log.Info("operating on event source")
config, err := parseEventSource(ev... | [
0.3235824704170227,
-0.019212493672966957,
0.3254639208316803,
-0.9425895810127258,
0.11141964793205261,
-0.8395278453826904,
0.11702065914869308,
0.9095461964607239,
-0.02997753769159317,
0.8112956881523132,
-0.48467138409614563,
0.4259761571884155,
0.2448468804359436,
0.6951435804367065,... |
func (_m *OrganizationFetcher) FetchOrganization(filters []services.QueryFilter) (models.Organization, error) {
ret := _m.Called(filters)
var r0 models.Organization
if rf, ok := ret.Get(0).(func([]services.QueryFilter) models.Organization); ok {
r0 = rf(filters)
} else {
r0 = ret.Get(0).(models.Organization)
... | [
-0.4969537854194641,
0.554922342300415,
0.5153465867042542,
0.2808355689048767,
-0.3319217264652252,
-0.18845638632774353,
0.8759280443191528,
-0.5478076934814453,
-0.0025319522246718407,
0.20235209167003632,
-0.25957727432250977,
0.2446146160364151,
0.7619876861572266,
0.4756050705909729,... |
func SignString(value, key string) string {
return fmt.Sprintf("%x----%s", hmac.New(sha1.New, []byte(key)).Sum([]byte(value)), value)
} | [
-0.6534241437911987,
-0.4516635239124298,
0.8044502139091492,
-0.16215142607688904,
-0.40904009342193604,
0.6541957259178162,
-0.9101539850234985,
0.14942269027233124,
-0.4009937047958374,
1.3600271940231323,
0.15562210977077484,
-0.3987773060798645,
-0.11641662567853928,
-0.32325705885887... |
func ValidateSignedString(value, key string) (string, error) {
parts := strings.SplitN(value, "----", 2)
if parts[0] == fmt.Sprintf("%x", hmac.New(sha1.New, []byte(key)).Sum([]byte(parts[1]))) {
return parts[1], nil
}
return "", errors.New("data is tampered")
} | [
-0.23353925347328186,
-0.5391368865966797,
0.6483408212661743,
0.4357260763645172,
-0.829835832118988,
0.33376359939575195,
-0.2881132662296295,
-0.5113723278045654,
0.31704744696617126,
0.7191711068153381,
-0.07931022346019745,
-0.00772901251912117,
-0.9396147131919861,
-0.091744780540466... |
func (rcs *Service) pingLoop(done <-chan struct{}) {
pingChan := make(chan *model.RemoteCluster, MaxConcurrentSends*2)
// create a thread pool to send pings concurrently to remotes.
for i := 0; i < MaxConcurrentSends; i++ {
go rcs.pingEmitter(pingChan, done)
}
go rcs.pingGenerator(pingChan, done)
} | [
-0.6011223196983337,
0.44027867913246155,
0.312175452709198,
0.1625123769044876,
0.6495689749717712,
0.5099281668663025,
0.42838555574417114,
-0.654923141002655,
-0.3643478751182556,
0.369890421628952,
-0.5308836698532104,
0.07335441559553146,
-0.41039833426475525,
0.2813686728477478,
-0... |
func (rcs *Service) pingEmitter(pingChan <-chan *model.RemoteCluster, done <-chan struct{}) {
for {
select {
case rc := <-pingChan:
if rc == nil {
return
}
online := rc.IsOnline()
if err := rcs.pingRemote(rc); err != nil {
rcs.server.Log().Log(mlog.LvlRemoteClusterServiceWarn, "Remote cluster... | [
-0.9046276807785034,
-0.6055687665939331,
0.37006086111068726,
-0.07757439464330673,
0.1501915007829666,
0.5240882635116577,
-0.18031777441501617,
0.1986636221408844,
-0.04130099341273308,
0.5663250088691711,
-0.9064522981643677,
0.012560848146677017,
-1.001476526260376,
0.7398461103439331... |
func (rcs *Service) pingRemote(rc *model.RemoteCluster) error {
frame, err := makePingFrame(rc)
if err != nil {
return err
}
url := fmt.Sprintf("%s/%s", rc.SiteURL, PingURL)
resp, err := rcs.sendFrameToRemote(PingTimeout, rc, frame, url)
if err != nil {
return err
}
ping := model.RemoteClusterPing{}
err ... | [
-0.3307628035545349,
-0.34143874049186707,
0.528774619102478,
-0.7365432381629944,
-0.40101358294487,
0.7686188817024231,
-0.4090958535671234,
-0.05838233232498169,
-0.13487739861011505,
1.248197078704834,
-0.4775514304637909,
0.7303229570388794,
-0.9398605823516846,
0.30476483702659607,
... |
func IsUserInProtectBranchWhitelist(repoID, userID int64, branch string) bool {
has, err := x.Where("repo_id = ?", repoID).And("user_id = ?", userID).And("name = ?", branch).Get(new(ProtectBranchWhitelist))
return has && err == nil
} | [
0.5206099152565002,
-0.38188695907592773,
0.34287184476852417,
0.5773775577545166,
0.14179781079292297,
0.1905072182416916,
-0.8023712635040283,
-0.11422418057918549,
0.12127014249563217,
0.2968195378780365,
-0.3480340242385864,
0.5249008536338806,
-0.8108385801315308,
0.46208107471466064,... |
func GetProtectBranchOfRepoByName(repoID int64, name string) (*ProtectBranch, error) {
protectBranch := &ProtectBranch{
RepoID: repoID,
Name: name,
}
has, err := x.Get(protectBranch)
if err != nil {
return nil, err
} else if !has {
return nil, ErrBranchNotExist{args: map[string]any{"name": name}}
}
ret... | [
0.6410696506500244,
0.5164985656738281,
0.5203477740287781,
0.5556759238243103,
0.06064976006746292,
-0.7377868890762329,
-0.6425272226333618,
-1.698207139968872,
-0.039187997579574585,
0.5973542332649231,
-0.6451210975646973,
-0.19407634437084198,
-1.378133773803711,
-0.25800326466560364,... |
func IsBranchOfRepoRequirePullRequest(repoID int64, name string) bool {
protectBranch, err := GetProtectBranchOfRepoByName(repoID, name)
if err != nil {
return false
}
return protectBranch.Protected && protectBranch.RequirePullRequest
} | [
-0.9525414705276489,
0.029300004243850708,
0.8012527823448181,
0.38518744707107544,
-0.2579260468482971,
-0.4019742012023926,
-0.3183321952819824,
-0.5423184633255005,
1.2218716144561768,
0.3828382194042206,
-0.3077518343925476,
0.435395210981369,
-1.1529420614242554,
0.6141239404678345,
... |
func UpdateProtectBranch(protectBranch *ProtectBranch) (err error) {
sess := x.NewSession()
defer sess.Close()
if err = sess.Begin(); err != nil {
return err
}
if protectBranch.ID == 0 {
if _, err = sess.Insert(protectBranch); err != nil {
return fmt.Errorf("Insert: %v", err)
}
}
if _, err = sess.ID(p... | [
-0.39404839277267456,
-0.17291754484176636,
0.6596547365188599,
0.9594045281410217,
0.24909844994544983,
0.07008974254131317,
-0.4140988886356354,
-0.6242611408233643,
0.3344988524913788,
0.4161668121814728,
-0.6530728936195374,
-0.2225203812122345,
-1.3953032493591309,
-0.0380764380097389... |
func UpdateOrgProtectBranch(repo *Repository, protectBranch *ProtectBranch, whitelistUserIDs, whitelistTeamIDs string) (err error) {
if err = repo.GetOwner(); err != nil {
return fmt.Errorf("GetOwner: %v", err)
} else if !repo.Owner.IsOrganization() {
return fmt.Errorf("expect repository owner to be an organizati... | [
0.09216175973415375,
-0.31330740451812744,
0.7549538016319275,
0.2943279445171356,
-0.033112384378910065,
0.039916593581438065,
0.225070059299469,
-0.41448166966438293,
-0.12490802258253098,
0.43371981382369995,
0.3943963944911957,
0.9742470383644104,
-0.12021655589342117,
-0.2712798118591... |
func GetProtectBranchesByRepoID(repoID int64) ([]*ProtectBranch, error) {
protectBranches := make([]*ProtectBranch, 0, 2)
return protectBranches, x.Where("repo_id = ? and protected = ?", repoID, true).Asc("name").Find(&protectBranches)
} | [
0.82087641954422,
0.28557831048965454,
0.3094075918197632,
0.9645357728004456,
0.39346352219581604,
-0.7828350067138672,
-0.42671531438827515,
-0.8869112133979797,
0.5817584991455078,
0.6568948030471802,
-0.9136788845062256,
-0.4090326726436615,
-0.9054415822029114,
0.4621211886405945,
0... |
func dumpInfo(c chan os.Signal) {
for {
<-c
log.Println("Signal caught - dumping runtime stats")
var m runtime.MemStats
runtime.ReadMemStats(&m)
s, _ := json.Marshal(m)
log.Println("MemStats JSON follows")
log.Printf("%s\n", s)
var garC debug.GCStats
debug.ReadGCStats(&garC)
log.Printf("\nLastGC:\t... | [
0.749752402305603,
-0.5466974377632141,
0.8252519965171814,
-1.120567798614502,
0.5249157547950745,
0.535852313041687,
0.18099774420261383,
-1.4855633974075317,
-0.6929598450660706,
-0.3851887881755829,
-0.5706220269203186,
0.747390866279602,
0.04406037926673889,
0.9014391899108887,
1.29... |
func QuickExec(cmdLine string, workDir ...string) (string, error) {
return ExecLine(cmdLine, workDir...)
} | [
0.44252142310142517,
-0.5269679427146912,
0.2492297738790512,
0.5492045879364014,
0.37974095344543457,
-0.2738204598426819,
-0.30050963163375854,
-0.5589568614959717,
-0.15060341358184814,
-0.8418906331062317,
-0.8106904029846191,
-0.24003024399280548,
0.2866383194923401,
0.170559257268905... |
func ExecLine(cmdLine string, workDir ...string) (string, error) {
p := cmdline.NewParser(cmdLine)
// create a new Cmd instance
cmd := p.NewExecCmd()
if len(workDir) > 0 {
cmd.Dir = workDir[0]
}
bs, err := cmd.Output()
return string(bs), err
} | [
-0.26860252022743225,
-0.6863409280776978,
0.6429395079612732,
0.3707044720649719,
-0.1053798571228981,
-0.24601995944976807,
-0.012315355241298676,
-0.1807662546634674,
-0.5065337419509888,
-0.9032508730888367,
-0.16058655083179474,
-0.20659972727298737,
-0.4244336783885956,
-0.1419149637... |
func ShellExec(cmdLine string, shells ...string) (string, error) {
// shell := "/bin/sh"
shell := "sh"
if len(shells) > 0 {
shell = shells[0]
}
var out bytes.Buffer
cmd := exec.Command(shell, "-c", cmdLine)
cmd.Stdout = &out
if err := cmd.Run(); err != nil {
return "", err
}
return out.String(), nil
} | [
0.9545220136642456,
-0.1356390416622162,
0.7590650320053101,
0.026518722996115685,
-0.14791955053806305,
0.5368597507476807,
-0.6347927451133728,
-0.07244627177715302,
-0.4696160554885864,
-0.030421823263168335,
-0.776492714881897,
-0.012674873694777489,
-0.006484829355031252,
0.4486237466... |
func ThreeWay(a, b, parent types.Value, vwr types.ValueReadWriter) (merged types.Value, err error) {
if a == nil && b == nil {
return parent, nil
} else if a == nil {
return parent, newMergeConflict("Cannot merge nil Value with %s.", b.Type().Describe())
} else if b == nil {
return parent, newMergeConflict("Ca... | [
0.038973741233348846,
0.10110480338335037,
0.6780081987380981,
-0.013464110903441906,
0.21456649899482727,
-0.5884659886360168,
-1.1502870321273804,
-0.19022521376609802,
0.38158199191093445,
-0.077119842171669,
0.4039240777492523,
-0.04526057466864586,
-0.6442290544509888,
0.6360566616058... |
func unmergeable(a, b types.Value) bool {
if a != nil && b != nil {
aKind, bKind := a.Type().Kind(), b.Type().Kind()
return aKind != bKind || types.IsPrimitiveKind(aKind) || types.IsPrimitiveKind(bKind)
}
return true
} | [
-0.9349038004875183,
0.20356442034244537,
0.8351024389266968,
-0.25658494234085083,
0.32991135120391846,
0.014041834510862827,
-0.12576256692409515,
-0.04995499551296234,
-0.6931700706481934,
0.5005695223808289,
0.6957111358642578,
0.6588798761367798,
-1.3501521348953247,
1.147063612937927... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.