text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (irs *InstanceRuntimeSelect) Float64X(ctx context.Context) float64 {
v, err := irs.Float64(ctx)
if err != nil {
panic(err)
}
return v
} | [
-0.7127910256385803,
0.33168208599090576,
0.09034138917922974,
0.33372920751571655,
-0.021463096141815186,
0.011624966748058796,
-0.22866691648960114,
-0.8418017029762268,
0.2399795651435852,
-0.19311141967773438,
0.1665826290845871,
0.4307306408882141,
-0.7614886164665222,
0.0582210943102... |
func (irs *InstanceRuntimeSelect) Bools(ctx context.Context) ([]bool, error) {
if len(irs.fields) > 1 {
return nil, errors.New("ent: InstanceRuntimeSelect.Bools is not achievable when selecting more than 1 field")
}
var v []bool
if err := irs.Scan(ctx, &v); err != nil {
return nil, err
}
return v, nil
} | [
-1.3545053005218506,
0.47906821966171265,
0.3572663366794586,
-0.5215190052986145,
0.8865013122558594,
0.17738690972328186,
-0.26143571734428406,
-0.27252906560897827,
-0.284048467874527,
0.13296285271644592,
0.42791807651519775,
0.9900060296058655,
-0.4317888021469116,
-0.2308632284402847... |
func (irs *InstanceRuntimeSelect) BoolsX(ctx context.Context) []bool {
v, err := irs.Bools(ctx)
if err != nil {
panic(err)
}
return v
} | [
-0.6197693347930908,
0.21774592995643616,
0.34262529015541077,
0.1675702929496765,
-0.4239242374897003,
0.424730122089386,
-1.1225205659866333,
-0.36820119619369507,
-0.05011353641748428,
0.6381176114082336,
-0.1726078987121582,
0.9906960129737854,
-0.20477624237537384,
-0.3755647242069244... |
func (irs *InstanceRuntimeSelect) Bool(ctx context.Context) (_ bool, err error) {
var v []bool
if v, err = irs.Bools(ctx); err != nil {
return
}
switch len(v) {
case 1:
return v[0], nil
case 0:
err = &NotFoundError{instanceruntime.Label}
default:
err = fmt.Errorf("ent: InstanceRuntimeSelect.Bools returne... | [
-0.9146417379379272,
0.013236288912594318,
0.4031335413455963,
-0.195679172873497,
1.090230107307434,
0.33700084686279297,
0.4653274714946747,
0.1580422967672348,
-0.19854366779327393,
0.37225621938705444,
0.4863337278366089,
0.7844591736793518,
-0.13808931410312653,
-0.29299432039260864,
... |
func (irs *InstanceRuntimeSelect) BoolX(ctx context.Context) bool {
v, err := irs.Bool(ctx)
if err != nil {
panic(err)
}
return v
} | [
-0.294101357460022,
0.12610028684139252,
0.36677300930023193,
-0.23425187170505524,
-0.13534964621067047,
1.2164236307144165,
-0.607033908367157,
0.03506527096033096,
0.09020467102527618,
0.4043092429637909,
-0.2928493618965149,
0.8865798711776733,
-0.2991796135902405,
-0.8760141134262085,... |
func (s *ServerCommand) Execute(args []string) error {
log.Printf("[INFO] start server on port: %d", s.HTTPPort)
ctx, cancel := context.WithCancel(context.Background())
go func() { // catch signal and invoke graceful termination
stop := make(chan os.Signal, 1)
signal.Notify(stop, os.Interrupt, syscall.SIGTERM)... | [
0.12799936532974243,
-0.6578917503356934,
0.9663836359977722,
0.7196234464645386,
1.0162079334259033,
0.6784703731536865,
-0.21134816110134125,
0.0319841243326664,
-0.7371091842651367,
1.0923494100570679,
-0.29098179936408997,
0.014789515174925327,
-0.6606201529502869,
0.05909200385212898,... |
func (a *serverApp) run(ctx context.Context) error {
go func() { // shutdown on context cancellation
<-ctx.Done()
a.restSrv.Shutdown()
}()
a.restSrv.Run(a.HTTPPort)
close(a.terminated)
return nil
} | [
-0.04579523205757141,
-1.0563194751739502,
0.5808535814285278,
0.43115219473838806,
0.2456483244895935,
1.167059063911438,
-0.004048430360853672,
-0.6065915822982788,
0.4571548104286194,
-0.16611559689044952,
-0.11515586078166962,
-0.05086659640073776,
-0.8246749043464661,
0.11678634583950... |
func (a *serverApp) Wait() {
<-a.terminated
} | [
0.23077011108398438,
-0.6560927033424377,
0.08087257295846939,
0.06869935989379883,
0.8166848421096802,
1.3315614461898804,
-0.14112359285354614,
0.1541353017091751,
-0.07751231640577316,
-0.6244182586669922,
-0.7488275170326233,
0.22892260551452637,
-0.03797004744410515,
0.959452331066131... |
func HomeLink(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Welcome home!")
} | [
0.562693178653717,
-0.7623435854911804,
0.5132942199707031,
0.4273880124092102,
0.1991230994462967,
-0.09177719801664352,
0.5622497797012329,
0.01841362752020359,
0.5015336871147156,
0.04404914379119873,
0.29360729455947876,
0.7009760141372681,
-0.4561237394809723,
-0.1803363412618637,
-... |
func NewHardDisk(size uint64, throughput uint64, prng *rand.Rand) Drive {
return &hardDisk{
size: size,
throughput: throughput,
age: 0,
status: OK,
prng: prng,
}
} | [
0.14460527896881104,
-0.3245600759983063,
0.2976877987384796,
-0.2330092489719391,
-0.6151527762413025,
0.9648838639259338,
0.18630510568618774,
-0.18640267848968506,
0.06607965379953384,
-1.097808599472046,
0.4872100353240967,
0.8493357300758362,
-0.56596440076828,
0.32985246181488037,
... |
func annualizedFailureRateToMeanTimeBetweenFailures(x float64) float64 {
return -8760 / math.Log(1-x)
} | [
0.4057984948158264,
-0.09641307592391968,
0.24793781340122223,
0.22411766648292542,
-0.9806898236274719,
0.3176761567592621,
-1.1802480220794678,
-0.4200915992259979,
0.3977619707584381,
-0.2904169261455536,
0.46809837222099304,
0.12975673377513885,
0.009731139987707138,
-0.095190428197383... |
func NewDefault() Middleware {
return New(Config{}, nil)
} | [
0.5822537541389465,
-0.05085550993680954,
0.07428896427154541,
1.386871099472046,
-0.39873433113098145,
-0.011035892181098461,
-0.5330333113670349,
-0.21527408063411713,
0.7249091863632202,
-0.1957288682460785,
-0.40855059027671814,
0.371075838804245,
-0.8883673548698425,
1.1336669921875,
... |
func New(cfg Config, reg prometheus.Registerer) Middleware {
// If no registerer then set the default one.
if reg == nil {
reg = prometheus.DefaultRegisterer
}
// Validate the configuration.
cfg.validate()
// Create our middleware with all the configuration options.
m := &middleware{
httpRequestHistogram: ... | [
0.3081319034099579,
0.6536824703216553,
0.6015791893005371,
0.7128782868385315,
-0.014533581212162971,
0.18470878899097443,
-0.011698301881551743,
0.1533164381980896,
-0.9405442476272583,
-0.12209206074476242,
0.22363589704036713,
0.6424853801727295,
-0.3266454041004181,
1.7398346662521362... |
func (m *middleware) Handler(handlerID string, h http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// Intercept the writer so we can retrieve data afterwards.
wi := &responseWriterInterceptor{
statusCode: http.StatusOK,
ResponseWriter: w,
}
// If th... | [
0.3286876380443573,
0.22117628157138824,
0.45508891344070435,
0.3017696142196655,
-0.2104833573102951,
0.25002196431159973,
0.5957145094871521,
0.9222731590270996,
-0.28370004892349243,
-0.5685698390007019,
0.008311782032251358,
0.3957432210445404,
0.44993215799331665,
1.2218005657196045,
... |
func main() {
fmt.Println("==TESTING==", os.Args[0])
var err error
timeout, err = time.ParseDuration(timeoutString)
if err != nil {
fmt.Printf("ERROR: Invalid timeout string %v: %q\n", timeoutString, err)
return
}
// create server1 with only pre-generated thumbnails allowed
server1Cmd, server1CmdChan, serv... | [
-0.5745911002159119,
0.17720596492290497,
1.1482080221176147,
0.45782825350761414,
0.4334374666213989,
0.19903385639190674,
1.6210582256317139,
-0.2798273265361786,
-0.2543471157550812,
-0.5406860113143921,
-0.2963789105415344,
0.31516188383102417,
-0.0869896411895752,
1.0097275972366333,
... |
func NewSqlPoolVulnerabilityAssessment(ctx *pulumi.Context,
name string, args *SqlPoolVulnerabilityAssessmentArgs, opts ...pulumi.ResourceOption) (*SqlPoolVulnerabilityAssessment, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.SqlPoolSecurityAlertPolicyId == ... | [
-0.06524378806352615,
-0.218120276927948,
0.46903353929519653,
-0.13731881976127625,
-0.4039960503578186,
0.42512834072113037,
-0.5563846230506897,
-0.0867939442396164,
0.5330241322517395,
-0.06174277514219284,
-0.339334636926651,
0.5301094651222229,
-0.4087408781051636,
-0.273788869380950... |
func GetSqlPoolVulnerabilityAssessment(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SqlPoolVulnerabilityAssessmentState, opts ...pulumi.ResourceOption) (*SqlPoolVulnerabilityAssessment, error) {
var resource SqlPoolVulnerabilityAssessment
err := ctx.ReadResource("azure:synapse/sqlPoolVulnerabilityAsse... | [
-0.02632681280374527,
-0.5162360072135925,
0.3007631003856659,
-0.7329424023628235,
-1.0423153638839722,
0.4876905083656311,
-0.9142106175422668,
-0.49445053935050964,
1.082378625869751,
-0.1790262758731842,
0.1272171288728714,
1.2707386016845703,
-0.4357069730758667,
-1.272555947303772,
... |
func (o SqlPoolVulnerabilityAssessmentOutput) RecurringScans() SqlPoolVulnerabilityAssessmentRecurringScansOutput {
return o.ApplyT(func(v *SqlPoolVulnerabilityAssessment) SqlPoolVulnerabilityAssessmentRecurringScansOutput {
return v.RecurringScans
}).(SqlPoolVulnerabilityAssessmentRecurringScansOutput)
} | [
0.38444873690605164,
-0.37457767128944397,
0.6159146428108215,
0.0050670611672103405,
-0.6695460081100464,
0.41164863109588623,
0.6057474613189697,
-0.475760817527771,
1.0166674852371216,
-0.7286108136177063,
0.09453194588422775,
0.9142415523529053,
-0.29867076873779297,
-1.472376108169555... |
func (o SqlPoolVulnerabilityAssessmentOutput) SqlPoolSecurityAlertPolicyId() pulumi.StringOutput {
return o.ApplyT(func(v *SqlPoolVulnerabilityAssessment) pulumi.StringOutput { return v.SqlPoolSecurityAlertPolicyId }).(pulumi.StringOutput)
} | [
1.619461178779602,
-0.6275522112846375,
0.3081704080104828,
-0.41616910696029663,
0.060802485793828964,
2.095486879348755,
-0.1429150551557541,
0.13502520322799683,
1.4349558353424072,
0.46820276975631714,
-0.003039161441847682,
2.0739634037017822,
0.010699528269469738,
-1.309670090675354,... |
func (o SqlPoolVulnerabilityAssessmentOutput) StorageAccountAccessKey() pulumi.StringPtrOutput {
return o.ApplyT(func(v *SqlPoolVulnerabilityAssessment) pulumi.StringPtrOutput { return v.StorageAccountAccessKey }).(pulumi.StringPtrOutput)
} | [
0.41645190119743347,
-1.224984884262085,
0.5738071799278259,
0.0022698589600622654,
-0.024749809876084328,
0.6638694405555725,
1.6216545104980469,
0.10114958882331848,
0.7092633843421936,
-0.19452929496765137,
1.0332450866699219,
1.5176719427108765,
0.689297080039978,
-1.526164174079895,
... |
func (o SqlPoolVulnerabilityAssessmentOutput) StorageContainerPath() pulumi.StringOutput {
return o.ApplyT(func(v *SqlPoolVulnerabilityAssessment) pulumi.StringOutput { return v.StorageContainerPath }).(pulumi.StringOutput)
} | [
0.42525604367256165,
-0.6527320742607117,
0.31623533368110657,
0.3701521158218384,
0.6735730767250061,
0.973639965057373,
1.053078532218933,
-0.5647211670875549,
0.345164030790329,
-0.5780582427978516,
0.5018300414085388,
0.695382297039032,
0.44781818985939026,
-0.8593371510505676,
-0.08... |
func (o SqlPoolVulnerabilityAssessmentOutput) StorageContainerSasKey() pulumi.StringPtrOutput {
return o.ApplyT(func(v *SqlPoolVulnerabilityAssessment) pulumi.StringPtrOutput { return v.StorageContainerSasKey }).(pulumi.StringPtrOutput)
} | [
0.43340593576431274,
-0.04442828521132469,
0.524834394454956,
0.17453539371490479,
0.3793380856513977,
-0.13897015154361725,
0.3289873003959656,
-0.5896538496017456,
0.4835456609725952,
0.45729416608810425,
-0.011867333203554153,
0.5214036107063293,
0.4968353509902954,
-0.8877649307250977,... |
func (r *Response) Validate(lastID int64) error {
if !(r.StatusManager == ResponseStatusReview ||
r.StatusManager == ResponseStatusDenied ||
r.StatusManager == ResponseStatusAccepted) {
return errors.New("wrong manager response status")
}
if !(r.StatusFreelancer == ResponseStatusReview ||
r.StatusFreelancer ... | [
0.33833351731300354,
-0.7952720522880554,
0.6829056143760681,
-0.15030162036418915,
0.04580703750252724,
0.1719406694173813,
-0.2482145130634308,
-0.9269197583198547,
0.2127550095319748,
-1.0045431852340698,
0.377716064453125,
-0.48533251881599426,
-0.7615804076194763,
0.448714017868042,
... |
func (q *UnsafeQueue16) String() string {
return fmt.Sprintf("Queue{capacity: %v, capMod: %v, putPos: %v, getPos: %v}",
q.capacity, q.capMod, q.getPos, q.getPos)
} | [
0.33030351996421814,
-1.591530203819275,
0.38974568247795105,
-1.2316113710403442,
0.05068858340382576,
0.34919729828834534,
-0.549517810344696,
-0.8902589678764343,
-0.6193572878837585,
0.5847474336624146,
-0.18372392654418945,
0.8911163806915283,
0.052011746913194656,
-0.391191303730011,... |
func (q *UnsafeQueue16) Capacity() uint32 {
return q.capacity
} | [
0.8603619933128357,
-0.553650975227356,
0.3392843008041382,
-0.31859347224235535,
-0.04465235024690628,
0.8306146264076233,
0.9419082403182983,
-0.7512609362602234,
-0.3635426163673401,
0.17205291986465454,
-0.03814040124416351,
0.11987454444169998,
0.19590018689632416,
0.03614784032106399... |
func (q *UnsafeQueue16) Quantity() uint16 {
if q.putPos >= q.getPos {
return q.putPos - q.getPos
}
return q.capMod + (q.putPos - q.getPos)
} | [
-0.2050272673368454,
-0.9189692735671997,
0.6953525543212891,
-0.618920087814331,
0.2637609541416168,
0.4554308354854584,
-0.1770336925983429,
-0.8399254679679871,
-0.1448102742433548,
-0.29668664932250977,
-0.5241562128067017,
0.162759467959404,
-0.029442602768540382,
-0.17955952882766724... |
func (q *UnsafeQueue16) Size() uint16 {
if q.putPos >= q.getPos {
return q.putPos - q.getPos
}
return q.capMod + (q.putPos - q.getPos)
} | [
0.2529555559158325,
-0.1082163006067276,
0.5050250291824341,
-1.449967622756958,
-0.15171948075294495,
0.5362604260444641,
-0.19497151672840118,
-1.0413360595703125,
-0.14755694568157196,
0.17664195597171783,
-0.23508203029632568,
0.34490320086479187,
-0.7074002623558044,
-0.23761226236820... |
func (q *UnsafeQueue16) Put(val uint16) bool {
if q.putPos+2 == q.getPos {
runtime.Gosched()
return false
}
q.cache[q.putPos&q.capMod] = val
q.putPos++
return true
} | [
-0.5662291646003723,
0.971925675868988,
0.49386459589004517,
-0.8432910442352295,
-0.2635859251022339,
0.7749606370925903,
-0.3047105371952057,
-0.6643176674842834,
-0.4802475571632385,
0.2183036357164383,
-1.0033111572265625,
-0.20149441063404083,
-0.7446905970573425,
-0.20868152379989624... |
func (q *UnsafeQueue16) Get() (val uint16, ok bool) {
if q.putPos == q.getPos {
runtime.Gosched()
return 0, false
}
val = q.cache[q.getPos&q.capMod]
q.getPos++
return val, true
} | [
-0.7101424932479858,
0.33446812629699707,
0.6376545429229736,
-0.5658624768257141,
0.33008915185928345,
-0.2771613597869873,
-0.7678957581520081,
-0.3722817301750183,
-0.8592915534973145,
0.3809811770915985,
-0.7796111702919006,
0.5071917176246643,
-0.5808979272842407,
-0.3790535628795624,... |
func NewBatch() KVStoreBatch {
return &baseKVStoreBatch{}
} | [
0.9823576807975769,
-0.1845085322856903,
0.1551615446805954,
1.585817813873291,
-0.8657602071762085,
0.4073779582977295,
-0.49461644887924194,
0.08251901715993881,
0.5717951059341431,
-0.8082882165908813,
0.09056131541728973,
0.20018893480300903,
0.0184364914894104,
-0.16892272233963013,
... |
func (b *baseKVStoreBatch) Lock() {
b.mutex.Lock()
} | [
0.536229133605957,
-0.013437673449516296,
0.17818133533000946,
1.4255706071853638,
0.29257848858833313,
0.7468488812446594,
0.05635609105229378,
0.19616006314754486,
0.6040233373641968,
-1.2732170820236206,
0.1456020325422287,
0.31529200077056885,
-0.4793083071708679,
-0.09849154204130173,... |
func (b *baseKVStoreBatch) Unlock() {
b.mutex.Unlock()
} | [
0.20971477031707764,
0.04079438000917435,
0.2861267626285553,
1.3568317890167236,
-0.19157126545906067,
0.19822430610656738,
-0.37441545724868774,
1.0566085577011108,
0.5067273378372192,
-0.5454655885696411,
0.05533461272716522,
0.5835251808166504,
-0.653461754322052,
-0.4560054540634155,
... |
func (b *baseKVStoreBatch) ClearAndUnlock() {
defer b.mutex.Unlock()
b.writeQueue = nil
} | [
-0.08155757933855057,
-0.7079043388366699,
0.4478832185268402,
0.1601812094449997,
-0.6286883354187012,
-0.4921032786369324,
-0.24950651824474335,
0.41956189274787903,
0.06942244619131088,
0.36692869663238525,
0.3466159403324127,
0.3880492150783539,
0.13353955745697021,
0.21587499976158142... |
func (b *baseKVStoreBatch) Put(namespace string, key, value []byte, errorFormat string, errorArgs ...interface{}) {
b.mutex.Lock()
defer b.mutex.Unlock()
b.batch(Put, namespace, key, value, errorFormat, errorArgs)
} | [
-0.12458164244890213,
0.09855319559574127,
0.08364125341176987,
0.5621092915534973,
-0.06080189347267151,
0.03739155828952789,
-0.6248758435249329,
-0.2732313573360443,
-0.11725065857172012,
0.38736701011657715,
-0.5081361532211304,
0.9950554966926575,
-0.8325353860855103,
0.35071292519569... |
func (b *baseKVStoreBatch) PutIfNotExists(namespace string, key, value []byte, errorFormat string, errorArgs ...interface{}) error {
b.mutex.Lock()
defer b.mutex.Unlock()
b.batch(PutIfNotExists, namespace, key, value, errorFormat, errorArgs)
return nil
} | [
-0.2034657597541809,
0.17047183215618134,
0.25654861330986023,
0.1577974408864975,
0.46226051449775696,
-0.11183904856443405,
-0.9168725609779358,
-0.7780036330223083,
-0.018883969634771347,
0.9903888702392578,
-0.29304561018943787,
0.37709665298461914,
-0.9046320915222168,
0.6187499165534... |
func (b *baseKVStoreBatch) Delete(namespace string, key []byte, errorFormat string, errorArgs ...interface{}) {
b.mutex.Lock()
defer b.mutex.Unlock()
b.batch(Delete, namespace, key, nil, errorFormat, errorArgs)
} | [
0.4806163012981415,
-0.041145361959934235,
0.17343567311763763,
1.4565781354904175,
0.26640236377716064,
-0.3490343987941742,
-1.040688395500183,
-0.004681835416704416,
0.5715314149856567,
0.4897787272930145,
0.019834009930491447,
0.872772753238678,
-0.9511895179748535,
0.4155648648738861,... |
func (b *baseKVStoreBatch) Size() int {
return len(b.writeQueue)
} | [
-0.0004846950469072908,
-0.5302428007125854,
0.36466696858406067,
-0.043075937777757645,
0.1586432307958603,
-0.06035945937037468,
0.07580557465553284,
0.23657283186912537,
0.03914547339081764,
-0.36604025959968567,
-0.27275994420051575,
0.12447641789913177,
-0.7545355558395386,
0.34892705... |
func (b *baseKVStoreBatch) Entry(index int) (*writeInfo, error) {
if index < 0 || index >= len(b.writeQueue) {
return nil, errors.Wrap(ErrInvalidDB, "index out of range")
}
return &b.writeQueue[index], nil
} | [
0.026308253407478333,
-0.6179726123809814,
0.33881065249443054,
-0.41117602586746216,
0.3409601151943207,
-0.042359884828329086,
0.5349906086921692,
-0.6894624829292297,
0.29002252221107483,
0.30187079310417175,
0.6235959529876709,
0.3684013783931732,
-0.8058372735977173,
-0.10073094815015... |
func (b *baseKVStoreBatch) Clear() {
b.mutex.Lock()
defer b.mutex.Unlock()
b.writeQueue = nil
} | [
0.235016331076622,
-0.630096971988678,
0.24687600135803223,
0.48853400349617004,
-0.10979447513818741,
0.2917228639125824,
-0.28486302495002747,
-0.11805909126996994,
-0.08325407654047012,
-0.12711764872074127,
0.8154720664024353,
0.8753417134284973,
-0.07003465294837952,
0.417778462171554... |
func (b *baseKVStoreBatch) CloneBatch() KVStoreBatch {
b.mutex.Lock()
defer b.mutex.Unlock()
c := baseKVStoreBatch{
writeQueue: make([]writeInfo, b.Size()),
}
// clone the writeQueue
copy(c.writeQueue, b.writeQueue)
return &c
} | [
0.5096847414970398,
-0.7560202479362488,
0.42069435119628906,
0.6470320820808411,
-0.08368462324142456,
0.38994288444519043,
-0.38983747363090515,
-0.02321869693696499,
0.6234430074691772,
-0.7121757864952087,
0.16396130621433258,
0.46453481912612915,
-0.9545377492904663,
-0.23751358687877... |
func (b *baseKVStoreBatch) batch(op int32, namespace string, key, value []byte, errorFormat string, errorArgs ...interface{}) {
b.writeQueue = append(
b.writeQueue,
writeInfo{
writeType: op,
namespace: namespace,
key: key,
value: value,
errorFormat: errorFormat,
errorArgs: err... | [
-0.1884443163871765,
-0.4386990964412689,
0.400648832321167,
0.39691826701164246,
0.432595819234848,
0.3376671373844147,
-0.588992178440094,
-0.030142396688461304,
-0.2583134174346924,
-0.4728086590766907,
-0.4808119833469391,
0.5794821381568909,
-0.0013388863299041986,
0.28582334518432617... |
func NewCachedBatch() CachedBatch {
return &cachedBatch{
KVStoreBatch: NewBatch(),
KVStoreCache: NewKVCache(),
snapshots: make(map[int]CachedBatch),
}
} | [
0.2199385017156601,
0.1004544273018837,
0.18743471801280975,
1.3848015069961548,
-1.0579912662506104,
0.16768063604831696,
-0.5557111501693726,
-0.31070905923843384,
0.24292302131652832,
-1.4530125856399536,
-1.3591753244400024,
0.5526109933853149,
0.1458144187927246,
0.3691052794456482,
... |
func (cb *cachedBatch) Lock() {
cb.lock.Lock()
} | [
0.08958367258310318,
1.36557936668396,
0.354351669549942,
1.1170765161514282,
0.8260469436645508,
1.3332678079605103,
1.2704662084579468,
-0.52937251329422,
0.034645676612854004,
-1.3741722106933594,
-0.3223970830440521,
0.20225585997104645,
-0.5060096383094788,
-0.09787360578775406,
0.0... |
func (cb *cachedBatch) Unlock() {
cb.lock.Unlock()
} | [
-0.2923896908760071,
1.3940242528915405,
0.4179285764694214,
1.0425983667373657,
0.563424825668335,
0.9710351824760437,
0.7157168388366699,
0.6429526805877686,
0.01917234994471073,
-0.5552594661712646,
-0.3309657573699951,
0.40822961926460266,
-0.7053570747375488,
-0.5836011171340942,
0.... |
func (cb *cachedBatch) ClearAndUnlock() {
defer cb.lock.Unlock()
cb.KVStoreCache.Clear()
cb.KVStoreBatch.Clear()
// clear all saved snapshots
cb.tag = 0
cb.snapshots = nil
cb.snapshots = make(map[int]CachedBatch)
} | [
-0.41575077176094055,
0.303509920835495,
0.5641968250274658,
0.7954662442207336,
-0.4730105698108673,
0.08073471486568451,
0.3262826204299927,
0.040406860411167145,
0.5464280843734741,
0.14694805443286896,
-0.5157436728477478,
-0.39298704266548157,
0.5427167415618896,
0.18751011788845062,
... |
func (cb *cachedBatch) Put(namespace string, key, value []byte, errorFormat string, errorArgs ...interface{}) {
cb.lock.Lock()
defer cb.lock.Unlock()
h := cb.hash(namespace, key)
cb.Write(h, value)
cb.batch(Put, namespace, key, value, errorFormat, errorArgs)
} | [
0.019667500630021095,
0.9389460682868958,
0.3375999629497528,
0.4547031819820404,
0.4229714274406433,
0.19151675701141357,
-0.00007442592323059216,
-0.23133090138435364,
-0.3246627449989319,
0.33156082034111023,
-1.0071767568588257,
0.6792864799499512,
-0.8693661093711853,
0.26662647724151... |
func (cb *cachedBatch) PutIfNotExists(namespace string, key, value []byte, errorFormat string, errorArgs ...interface{}) error {
cb.lock.Lock()
defer cb.lock.Unlock()
// TODO: bug, this is not a valid check whether the instance exists
h := cb.hash(namespace, key)
if err := cb.WriteIfNotExist(h, value); err != nil ... | [
-0.393963098526001,
0.8436177372932434,
0.5823217034339905,
-0.06555186212062836,
0.6318393349647522,
0.13839702308177948,
-0.5725333094596863,
-0.4864296317100525,
-0.03911454975605011,
0.7993056178092957,
-0.48442554473876953,
0.09969192743301392,
-0.8469128012657166,
0.6525506973266602,... |
func (cb *cachedBatch) Delete(namespace string, key []byte, errorFormat string, errorArgs ...interface{}) {
cb.lock.Lock()
defer cb.lock.Unlock()
h := cb.hash(namespace, key)
cb.Evict(h)
cb.batch(Delete, namespace, key, nil, errorFormat, errorArgs)
} | [
0.7938352227210999,
1.263843297958374,
0.4649256467819214,
1.4774094820022583,
0.7234740853309631,
0.12621231377124786,
-0.7170833349227905,
0.00019252178026363254,
0.41338619589805603,
0.7347815036773682,
-0.6123011708259583,
0.7276600003242493,
-0.9477666616439819,
0.4759574234485626,
... |
func (cb *cachedBatch) Clear() {
cb.lock.Lock()
defer cb.lock.Unlock()
cb.KVStoreCache.Clear()
cb.KVStoreBatch.Clear()
// clear all saved snapshots
cb.tag = 0
cb.snapshots = nil
cb.snapshots = make(map[int]CachedBatch)
} | [
-0.3351382315158844,
0.8340598344802856,
0.49215883016586304,
1.2941151857376099,
-0.1034042090177536,
0.9991312623023987,
0.4467228353023529,
-0.30438175797462463,
0.38909319043159485,
-0.34480020403862,
-0.412246972322464,
-0.012106405571103096,
0.5554784536361694,
0.6444115042686462,
... |
func (cb *cachedBatch) Get(namespace string, key []byte) ([]byte, error) {
cb.lock.RLock()
defer cb.lock.RUnlock()
h := cb.hash(namespace, key)
return cb.Read(h)
} | [
-0.22132474184036255,
0.6609356999397278,
0.6532757878303528,
0.6954410672187805,
0.03979996591806412,
-0.21147707104682922,
-1.429998755455017,
-0.863987922668457,
-0.4061156213283539,
0.27675455808639526,
-0.07875039428472519,
0.8354930281639099,
-1.147308588027954,
-0.23929499089717865,... |
func (cb *cachedBatch) Snapshot() int {
cb.lock.Lock()
defer cb.lock.Unlock()
defer func() { cb.tag++ }()
// save a clone of current batch/cache
cb.snapshots[cb.tag] = cb.clone()
return cb.tag
} | [
-0.4939393699169159,
1.1938109397888184,
0.5309125781059265,
0.1299138367176056,
-0.31121596693992615,
0.043486565351486206,
0.8437106609344482,
-0.24080432951450348,
-0.1580272912979126,
-0.4778357744216919,
-1.2914131879806519,
-0.5806149244308472,
-0.5592811107635498,
-0.516072690486908... |
func (cb *cachedBatch) Revert(snapshot int) error {
cb.lock.Lock()
defer cb.lock.Unlock()
// throw error if the snapshot number does not exist
if _, ok := cb.snapshots[snapshot]; !ok {
return errors.Wrapf(ErrInvalidDB, "invalid snapshot number = %d", snapshot)
}
cb.KVStoreBatch = nil
cb.KVStoreCache = nil
cb.... | [
0.04160270094871521,
0.9777442812919617,
0.6081776022911072,
0.05820629000663757,
-0.25912919640541077,
0.026745235547423363,
0.5435016751289368,
0.8191296458244324,
0.4942697584629059,
-0.8968479037284851,
-0.3904404044151306,
-0.6841076612472534,
-0.7094058990478516,
-0.21388494968414307... |
func (cb *cachedBatch) hash(namespace string, key []byte) hash.CacheHash {
stream := hash.Hash160b([]byte(namespace))
stream = append(stream, key...)
return byteutil.BytesToCacheHash(hash.Hash160b(stream))
} | [
1.1013984680175781,
0.9544521570205688,
0.4174777567386627,
0.6668638586997986,
-0.2128615826368332,
0.6743074655532837,
-1.0453795194625854,
-0.32620102167129517,
0.3858744204044342,
-0.005297255702316761,
-0.77860027551651,
1.12639319896698,
-0.6886500716209412,
0.5950352549552917,
-0.... |
func (cb *cachedBatch) clone() CachedBatch {
// note it only clones the current internal batch and cache, to be used by Revert() later
// it does not clone the entire cachedBatch struct itself
return &cachedBatch{
KVStoreBatch: cb.CloneBatch(),
KVStoreCache: cb.KVStoreCache.Clone(),
}
} | [
0.27349963784217834,
-0.34428343176841736,
0.5800838470458984,
1.4922722578048706,
-0.9264053106307983,
1.0876498222351074,
-0.34098657965660095,
-0.3207431137561798,
0.2957744598388672,
-0.48633697628974915,
-0.5850618481636047,
0.28702545166015625,
-0.534561038017273,
-0.5034998059272766... |
func (cb *cachedBatch) kvBatch() KVStoreBatch {
return cb.KVStoreBatch
} | [
0.6029195189476013,
0.7500078082084656,
0.07897135615348816,
0.6831943988800049,
-0.515004575252533,
0.6419317126274109,
-0.7162838578224182,
-0.11831455677747726,
0.7871688008308411,
-0.3721502125263214,
0.11393437534570694,
0.5415878295898438,
-0.20789340138435364,
-0.41026172041893005,
... |
func (cb *cachedBatch) kvCache() KVStoreCache {
return cb.KVStoreCache
} | [
0.9260699152946472,
0.1531466543674469,
0.13514748215675354,
0.9347583055496216,
-0.9227817058563232,
-0.14726188778877258,
-0.5784956216812134,
-0.02688547410070896,
1.0832672119140625,
0.3451697528362274,
0.6701155304908752,
-0.19742397964000702,
-0.09083642065525055,
-0.6090420484542847... |
func (*JwtProvider) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*JwtProvider_RemoteJwks)(nil),
(*JwtProvider_LocalJwks)(nil),
}
} | [
-1.3603813648223877,
0.4276111125946045,
0.28571927547454834,
-0.26893743872642517,
-0.3211899399757385,
0.1168229952454567,
-0.2220776528120041,
-0.7561227083206177,
1.670751929283142,
1.1694914102554321,
-0.6643571257591248,
0.4660753905773163,
-0.4108576774597168,
0.8522213101387024,
... |
func (*JwtRequirement) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*JwtRequirement_ProviderName)(nil),
(*JwtRequirement_ProviderAndAudiences)(nil),
(*JwtRequirement_RequiresAny)(nil),
(*JwtRequirement_RequiresAll)(nil),
(*JwtRequirement_AllowMissingOrFailed)(nil),
(*JwtRequirement_AllowMissi... | [
-2.109825372695923,
0.11185876280069351,
0.5905532836914062,
-0.8481900095939636,
0.2736468017101288,
-0.18263226747512817,
-0.03639325499534607,
-0.7328442931175232,
1.221129059791565,
0.9614174365997314,
-0.41338425874710083,
0.807627260684967,
-0.044605519622564316,
1.0836654901504517,
... |
func NewProductHandler(productRepo domain.ProductRepository) *ProductHandler {
return &ProductHandler{
productRepo: productRepo,
}
} | [
-0.25060614943504333,
0.08246246725320816,
-0.08271675556898117,
0.6159914135932922,
-0.06267007440328598,
0.2540559470653534,
-0.045784760266542435,
-0.2568216323852539,
0.44748732447624207,
0.24219851195812225,
-0.5055883526802063,
0.346240371465683,
0.12133575975894928,
0.05056467652320... |
func Diff(originalVersion *Directory, newerVersion *Directory) []Patch {
origFiles := originalVersion.Flatten()
newFiles := newerVersion.Flatten()
return DiffFlat(origFiles, newFiles)
} | [
-0.6727253198623657,
-1.1068446636199951,
0.5364751219749451,
0.11622891575098038,
-0.6250560879707336,
0.8251243233680725,
0.23497560620307922,
0.9542123675346375,
0.09955520927906036,
0.04710500314831734,
-0.12134712934494019,
0.5110985040664673,
-0.05787276476621628,
0.5522258877754211,... |
func DiffFlat(origFiles, newFiles []FileInfo) []Patch {
state := &diffState{
origFiles: origFiles,
newFiles: newFiles,
patches: []Patch{},
}
state.computePatches()
return state.patches
} | [
-0.3447543680667877,
-1.1379808187484741,
0.5959899425506592,
-0.812843918800354,
-0.34795311093330383,
0.7712339758872986,
0.3413776755332947,
-0.011641120538115501,
0.09601867198944092,
-0.7149105072021484,
-0.15421783924102783,
0.13405919075012207,
-0.20642061531543732,
0.69966721534729... |
func (s *diffState) computePatches() {
origLen := len(s.origFiles)
newLen := len(s.newFiles)
origIndex, newIndex := 0, 0
DIR_COMPARE_LOOP:
for {
switch {
case origIndex >= origLen && newIndex >= newLen:
break DIR_COMPARE_LOOP
case origIndex >= origLen:
// We are at the end of the list for origFiles an... | [
-0.015634752810001373,
-0.6320423483848572,
0.8164637684822083,
-0.22111643850803375,
0.4112669825553894,
0.1610378921031952,
1.0392054319381714,
0.4962349236011505,
0.21542389690876007,
-0.23087739944458008,
-0.08384302258491516,
0.43288883566856384,
-0.20536337792873383,
0.34530138969421... |
func (s *diffState) addPatch(f FileInfo, patchType PatchType) {
patch := Patch{
File: f,
Type: patchType,
}
s.patches = append(s.patches, patch)
} | [
-0.3549351990222931,
-0.45285019278526306,
0.5546308159828186,
-0.2728283405303955,
0.010660392232239246,
1.5284345149993896,
-0.8511327505111694,
0.830489993095398,
0.2721901834011078,
-1.6101921796798706,
-0.061672598123550415,
0.17905525863170624,
0.7286363244056702,
0.7992366552352905,... |
func Initialize(client *goesi.APIClient) {
esiClient = client
updateRegions()
go scheduleRegionUpdate()
} | [
-0.018024662509560585,
0.3497028350830078,
0.41838037967681885,
-0.25236576795578003,
0.7046535611152649,
-0.2596554458141327,
-0.5733582973480225,
0.4338397979736328,
-0.2965436279773712,
0.18389534950256348,
-0.6549228429794312,
0.09675822407007217,
-0.0014358145417645574,
-0.36460500955... |
func GetMarketRegions() []int64 {
return regionIDs
} | [
0.00616287300363183,
0.21974454820156097,
0.18674050271511078,
-0.3422393798828125,
0.42429566383361816,
-0.3848307430744171,
-0.3600374162197113,
-1.4427483081817627,
1.2540736198425293,
-0.32577088475227356,
-0.22850583493709564,
1.2222979068756104,
-0.575005292892456,
0.6461621522903442... |
func scheduleRegionUpdate() {
ticker := time.NewTicker(30 * time.Minute)
defer ticker.Stop()
for {
<-ticker.C
go updateRegions()
}
} | [
0.03550199419260025,
-0.71198970079422,
0.5431941747665405,
0.022248828783631325,
0.008289131335914135,
0.41986075043678284,
-0.44995081424713135,
-0.3495778441429138,
-0.3816014528274536,
0.17988424003124237,
0.10439654439687729,
0.5261393189430237,
-0.3513265550136566,
-0.379082262516021... |
func updateRegions() {
logrus.Debug("Updating regions.")
regions, err := getMarketRegions()
if err != nil {
logrus.WithError(err).Error("Could not get regionIDs from ESI!")
return
}
regionIDs = regions
logrus.Debug("Region update done.")
} | [
-0.3456650376319885,
-0.6999303698539734,
0.14503435790538788,
-0.5689870119094849,
0.18113107979297638,
-0.5824291110038757,
-0.644534707069397,
-0.18064631521701813,
-0.11965645849704742,
0.5860323309898376,
0.19314426183700562,
0.9191243052482605,
0.053481969982385635,
0.092033110558986... |
func getRegionIDs() ([]int32, error) {
regionIDs, _, err := esiClient.ESI.UniverseApi.GetUniverseRegions(nil, nil)
if err != nil {
return nil, err
}
return regionIDs, nil
} | [
0.013180676847696304,
0.34935781359672546,
0.36453914642333984,
0.12999914586544037,
0.8207398653030396,
0.06294438987970352,
-0.8072500228881836,
0.01783834956586361,
0.22706183791160583,
-0.14392535388469696,
-0.43762728571891785,
1.396625280380249,
-0.7724827527999878,
-0.06865942478179... |
func getMarketRegions() ([]int64, error) {
regionIDs, err := getRegionIDs()
if err != nil {
return nil, err
}
var marketRegionIDs []int64
for _, regionID := range regionIDs {
// Filter invalid regions
if regionID < 11000000 && regionID != 10000004 && regionID != 10000019 {
marketRegionIDs = append(market... | [
-0.015367542393505573,
0.05549909919500351,
0.2820960581302643,
-0.4366922676563263,
0.2927193343639374,
-0.6945527791976929,
-0.510551393032074,
-0.5962299704551697,
1.1205520629882812,
-0.2105695903301239,
0.04640123248100281,
0.7742593288421631,
-0.9979085326194763,
0.8008981347084045,
... |
func headersCheck(c *gin.Context) {
if c.GetHeader("Content-Type") != "application/json" {
c.AbortWithStatusJSON(http.StatusBadRequest, msg("request payload not recognized"))
return
}
c.Next()
} | [
-0.4179254472255707,
-0.3789597153663635,
0.7857584953308105,
1.3569213151931763,
0.47578805685043335,
0.985698401927948,
-1.0295482873916626,
-0.918609619140625,
-0.5369255542755127,
0.6648454070091248,
1.2125219106674194,
0.5590866208076477,
0.18317364156246185,
-0.5356332659721375,
0.... |
func authCheck(c *gin.Context) {
// Parse the token from the header. Take into account that the token prepended by Bearer
// keyword.
var (
token string
err error
)
{
h := c.GetHeader("Authorization")
if len(h) < 8 {
c.AbortWithStatusJSON(http.StatusUnauthorized, msg("authorization header missed or no... | [
0.017310861498117447,
-0.0044077918864786625,
0.6960135102272034,
1.37019681930542,
0.2942335307598114,
-0.3542778491973877,
0.44757774472236633,
-0.19004271924495697,
-0.11675179749727249,
0.0113289849832654,
0.6366611123085022,
0.7098012566566467,
0.47531750798225403,
-0.2774883508682251... |
func getUser(c *gin.Context) user.User {
var u user.User
if v, ok := c.Get(session); ok {
u = v.(user.User)
}
return u
} | [
0.07739869505167007,
-0.4050266742706299,
0.24593763053417206,
1.3960838317871094,
-0.03651512414216995,
-0.8495068550109863,
0.7932059168815613,
-1.1454942226409912,
1.4360942840576172,
-0.9360426664352417,
0.33028456568717957,
0.44635137915611267,
0.6926037073135376,
-0.20404355227947235... |
func NewWriter(w io.Writer, iv, key []byte, init CryptoInitilizer) (io.Writer, error) {
c, err := init(key)
if err != nil {
return nil, err
}
wr := &writer{
enc: cipher.NewCFBEncrypter(c, iv),
w: w,
}
return wr, nil
} | [
-0.2741089165210724,
0.07082549482584,
0.13756848871707916,
1.2249809503555298,
-0.0021642446517944336,
-0.7201347947120667,
0.18912363052368164,
0.2612810730934143,
-0.4339619278907776,
0.8618955016136169,
-0.6191802024841309,
-0.7067701816558838,
-0.9691376090049744,
0.12767700850963593,... |
func NewAesWriter(w io.Writer, iv, key []byte) (io.Writer, error) {
return NewWriter(w, iv, key, aes.NewCipher)
} | [
-0.5180299282073975,
-0.570831298828125,
0.1932457685470581,
-0.1843218207359314,
-0.7453114986419678,
-0.5352814793586731,
-0.5409268736839294,
-0.34734854102134705,
0.33474090695381165,
0.5315708518028259,
0.016680873930454254,
-0.161251962184906,
0.6002086400985718,
0.899139404296875,
... |
func SpanishRunes(phrase string) {
fmt.Println(len(phrase), "bytes")
fmt.Println(utf8.RuneCountInString(phrase), "runes")
c, size := utf8.DecodeRuneInString(phrase)
fmt.Printf("First rune: %c %v bytes", c, size)
} | [
0.9626920819282532,
0.2461855262517929,
0.5637736916542053,
-1.3594096899032593,
0.7836322784423828,
-0.37275364995002747,
-0.6646839380264282,
0.9545488953590393,
0.5542454123497009,
0.29139286279678345,
-0.24094240367412567,
0.7347926497459412,
-0.012325351126492023,
-0.2520158886909485,... |
func GetLint() error {
path, _ := util.GetGoBinaryPath("golint")
if path != "" {
fmt.Println("Tool 'golint' already installed")
return nil
}
err := sh.RunV("go", "install", "golang.org/x/lint/golint@latest")
if err != nil {
fmt.Println("Could not go get golint")
return err
}
return nil
} | [
1.3385885953903198,
0.2270306795835495,
0.7630986571311951,
-0.6181044578552246,
1.226340413093567,
0.38834521174430847,
-0.35280370712280273,
-0.4924473166465759,
-0.6212186217308044,
0.26190686225891113,
-0.44905605912208557,
1.1533260345458984,
-0.653538703918457,
0.01512993685901165,
... |
func GoLint(pathToCheck string, excludes ...string) error {
mg.Deps(GetLint)
golintPath, err := util.GetGoBinaryPath("golint")
if err != nil {
fmt.Println("❌ GoLint")
return err
}
gopath := util.GetGoPath()
dirs, err := util.GetPackagePathsWithExcludes(pathToCheck, excludes...)
if err != nil {
fmt.Println... | [
0.40258318185806274,
0.35854673385620117,
0.9379796981811523,
-0.24610689282417297,
0.6716626286506653,
0.9065030217170715,
0.08211896568536758,
-0.1498323231935501,
-0.10443294048309326,
0.4905671179294586,
-0.19413919746875763,
0.7264513373374939,
-1.0297248363494873,
0.07151991873979568... |
func GoLintD(dir string, excludes ...string) error {
mg.Deps(GetLint)
golintBin, err := util.GetGoBinaryPath("golint")
if err != nil {
fmt.Println("❌ GoLint")
return err
}
var allExcludes []string
allExcludes = append(allExcludes, excludes...)
allExcludes = append(allExcludes, util.GoLintExcludes()...)
dir... | [
0.3664608895778656,
0.3246201276779175,
1.1024606227874756,
-0.3992222547531128,
0.33541518449783325,
1.770755648612976,
-0.07740089297294617,
0.29386845231056213,
-0.39606496691703796,
0.32045817375183105,
0.2623973786830902,
1.2474124431610107,
-1.2435803413391113,
0.1682281494140625,
... |
func (e *evalContext) decodeRelatedColumnVals(relatedColOffsets []int, handle int64, value [][]byte, row []types.Datum) error {
var err error
for _, offset := range relatedColOffsets {
col := e.columnInfos[offset]
if col.GetPkHandle() {
if mysql.HasUnsignedFlag(uint(col.GetFlag())) {
row[offset] = types.Ne... | [
-0.08028300106525421,
-0.30106914043426514,
0.4834435284137726,
-0.36655744910240173,
-0.4545978307723999,
0.5544990301132202,
0.37931618094444275,
-0.3716438114643097,
-0.5721936225891113,
-0.811398983001709,
-0.3936786353588104,
-0.1412733942270279,
-0.04932466521859169,
0.62611240148544... |
func (s Scale) BuildGrading() map[rune]int {
out := make(map[rune]int)
for _, mapping := range s {
for _, letter := range mapping.Letters {
out[letter] = mapping.Points
}
}
return out
} | [
-1.6247820854187012,
-0.4676061272621155,
0.5801507234573364,
-0.3395369350910187,
-0.765650749206543,
0.05224485695362091,
0.13751429319381714,
0.5461744666099548,
-0.8262251019477844,
0.674233078956604,
-0.5942655205726624,
0.15277191996574402,
0.11153886467218399,
0.05385346710681915,
... |
func Score(word string) int {
var score int
if word == "" {
return score
}
for _, letter := range word {
score += grading[unicode.ToUpper(letter)]
}
return score
} | [
-0.5067539811134338,
0.692833423614502,
0.5587459802627563,
-0.2111981064081192,
-0.23244349658489227,
0.26783716678619385,
-0.09007129818201065,
0.24898754060268402,
-0.07222483307123184,
1.1287096738815308,
-0.055402763187885284,
-0.2678949236869812,
-1.1580830812454224,
0.46327656507492... |
func NewApplication() Application {
return app
} | [
0.3416120111942291,
-1.3465162515640259,
0.041062790900468826,
0.4029184877872467,
-0.8589024543762207,
0.20912839472293854,
0.413246750831604,
-0.04027407243847847,
0.8125975131988525,
0.06498987227678299,
-0.3418048620223999,
0.030269628390669823,
-0.10890351980924606,
0.5684547424316406... |
func Logger() *golog.Logger {
return app.Logger()
} | [
0.6096775531768799,
0.28400498628616333,
0.20533037185668945,
-0.07701446861028671,
0.2836063802242279,
0.22461920976638794,
-0.5218855738639832,
0.5333554744720459,
0.3201630413532257,
-0.6235048174858093,
0.2554553747177124,
0.10181938111782074,
0.14898866415023804,
0.5770710110664368,
... |
func ServiceLocator() *internal.ServiceLocatorImpl {
return app.GetServiceLocator()
} | [
-0.02713528648018837,
-0.38047653436660767,
0.31350818276405334,
-0.2861796021461487,
-1.5925530195236206,
-0.056630879640579224,
1.0860371589660645,
-0.42217060923576355,
0.4816724956035614,
-0.8551864624023438,
0.47662389278411865,
0.027957329526543617,
0.22714011371135712,
0.27591779828... |
func WorkerFromCtx(ctx Context) Worker {
if result, ok := ctx.Values().Get(internal.WorkerKey).(Worker); ok {
return result
}
return nil
} | [
-0.6691625118255615,
-0.01122831366956234,
0.18186573684215546,
-0.24110238254070282,
-0.2346620410680771,
0.1815335601568222,
-1.13980233669281,
-0.43345707654953003,
0.16598108410835266,
-0.04299882799386978,
-0.4773424565792084,
-1.3070805072784424,
-0.11025336384773254,
-0.134696096181... |
func ToWorker(ctx Context) Worker {
return WorkerFromCtx(ctx)
} | [
-0.017597811296582222,
0.1628200262784958,
0.40975189208984375,
-0.4302043914794922,
-0.24173136055469513,
0.5126798748970032,
-0.28444838523864746,
-0.2659669518470764,
0.680298388004303,
-0.5025342702865601,
-0.6583781242370605,
-0.1938858926296234,
0.16791744530200958,
-0.36743512749671... |
func (m *PresenceInfoExtensionInfo) Validate(formats strfmt.Registry) error {
var res []error
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
} | [
0.3644009828567505,
-0.40141457319259644,
0.28399890661239624,
0.4918188452720642,
-0.051907289773225784,
0.291882187128067,
-0.2587265372276306,
0.6150078773498535,
-0.5970939993858337,
0.11713936924934387,
0.17125016450881958,
-0.4875645339488983,
-0.9873728156089783,
0.6256505250930786,... |
func UpdateHook(db gorp.SqlExecutor, h *sdk.WorkflowNodeHook) error {
dbhook := NodeHook(*h)
if _, err := db.Update(&dbhook); err != nil {
return sdk.WrapError(err, "updateHook> Cannot update hook")
}
if err := dbhook.PostInsert(db); err != nil {
return sdk.WrapError(err, "updateHook> Cannot post update hook")
... | [
-0.42396295070648193,
0.5980914235115051,
0.6532362699508667,
0.3387272357940674,
0.7327239513397217,
0.7744421362876892,
0.2434147149324417,
-0.18811464309692383,
-0.47873392701148987,
0.8743202090263367,
0.50779128074646,
0.24302218854427338,
-0.36471712589263916,
0.7265644073486328,
0... |
func insertHook(db gorp.SqlExecutor, node *sdk.WorkflowNode, hook *sdk.WorkflowNodeHook) error {
hook.WorkflowNodeID = node.ID
if hook.WorkflowHookModelID == 0 {
hook.WorkflowHookModelID = hook.WorkflowHookModel.ID
}
var icon string
if hook.WorkflowHookModelID != 0 {
icon = hook.WorkflowHookModel.Icon
model... | [
-0.3023022413253784,
0.6669520139694214,
0.860432505607605,
0.9354870915412903,
0.8691892623901367,
0.41402721405029297,
0.41822290420532227,
0.3828822076320648,
-0.6994228959083557,
1.1146377325057983,
0.338284969329834,
-0.3780665695667267,
-0.8123269081115723,
0.9022230505943298,
0.45... |
func (r *NodeHook) PostInsert(db gorp.SqlExecutor) error {
sConfig, errgo := gorpmapping.JSONToNullString(r.Config)
if errgo != nil {
return errgo
}
if _, err := db.Exec("update workflow_node_hook set config = $2 where id = $1", r.ID, sConfig); err != nil {
return err
}
return nil
} | [
-0.8976632356643677,
0.5359335541725159,
0.28396767377853394,
-0.7248364090919495,
-0.04789194092154503,
-0.2775048017501831,
0.3926638960838318,
0.36502063274383545,
-1.453116774559021,
1.0406774282455444,
-0.5028416514396667,
-1.0210191011428833,
-1.4684152603149414,
0.6441671252250671,
... |
func (r *NodeHook) PostGet(db gorp.SqlExecutor) error {
var res = struct {
Config sql.NullString `db:"config"`
}{}
if err := db.SelectOne(&res, "select config from workflow_node_hook where id = $1", r.ID); err != nil {
return err
}
conf := sdk.WorkflowNodeHookConfig{}
if err := gorpmapping.JSONNullString(re... | [
-1.016445279121399,
0.2425786256790161,
0.438304603099823,
-0.800054669380188,
0.6848708987236023,
-0.20263473689556122,
-0.3046579957008362,
0.057487230747938156,
-1.2907112836837769,
0.5746501088142395,
0.07602597773075104,
-0.4095225930213928,
-0.7517929673194885,
0.5110102295875549,
... |
func LoadAllHooks(db gorp.SqlExecutor) ([]sdk.WorkflowNodeHook, error) {
res := []NodeHook{}
if _, err := db.Select(&res, "select id, uuid, workflow_hook_model_id, workflow_node_id from workflow_node_hook"); err != nil {
if err == sql.ErrNoRows {
return nil, nil
}
return nil, sdk.WrapError(err, "LoadAllHooks... | [
-0.6627967357635498,
0.4520829916000366,
0.2658289670944214,
0.25441649556159973,
0.39223963022232056,
0.16659526526927948,
-0.18684111535549164,
-0.486615926027298,
-0.5785006880760193,
0.5935631990432739,
0.7793962359428406,
0.09464402496814728,
-0.7071132063865662,
1.0795520544052124,
... |
func LoadHookByUUID(db gorp.SqlExecutor, uuid string) (*sdk.WorkflowNodeHook, error) {
query := `
SELECT id, uuid, workflow_hook_model_id, workflow_node_id
FROM workflow_node_hook
WHERE uuid = $1`
res := NodeHook{}
if err := db.SelectOne(&res, query, uuid); err != nil {
if err == sql.ErrNoRows {
return ... | [
-0.5873451232910156,
0.36465638875961304,
0.39593201875686646,
-0.2486954629421234,
-0.0748378187417984,
-0.3283167779445648,
0.2586636245250702,
-0.45721474289894104,
-1.0811700820922852,
0.9643734097480774,
0.7217432260513306,
-0.13202399015426636,
-0.8362017869949341,
-0.206982806324958... |
func TestClientServer(t *testing.T) {
// Our test root.
root, err := ioutil.TempDir("", "tlstest")
if err != nil {
t.Fatalf("TempDir failed: %v", err)
}
defer os.RemoveAll(root)
// Create the certs and configs.
CreateCA(root)
CreateSignedCert(root, CA, "01", "servers", "Servers CA")
CreateSignedCert(root, ... | [
0.7782015204429626,
-0.12401620298624039,
0.592322051525116,
-0.7776974439620972,
0.2500015199184418,
0.3885151743888855,
0.8328584432601929,
-0.5125027298927307,
-0.34448692202568054,
0.419611394405365,
-0.860740602016449,
0.35207319259643555,
-0.031796567142009735,
0.3037126958370209,
... |
func NewDistrictCommand(repo repository.Repository) cli.Command {
return cli.Command{
Name: "district",
Usage: "Save the districts of a country",
Action: func(c *cli.Context) error {
cID := c.Args().First()
if cID == "" {
return errors.New("Please provide the country code id")
}
id := strings.T... | [
-0.028587397187948227,
-0.17808009684085846,
0.49435946345329285,
-0.6483517289161682,
0.7255914807319641,
-0.015313285402953625,
0.2182914912700653,
-0.09268256276845932,
-0.15990063548088074,
0.31531909108161926,
-0.3176352381706238,
0.7953755855560303,
0.5509561896324158,
0.751015126705... |
func Appointment(Bapp appointment.BookAppointment) (*appointment.BookAppointment,*apierrors.RestErr){
//Validate all the input fields for length and Format
if FieldErr:=Bapp.BasicFieldValidation();FieldErr!=nil{
return nil,FieldErr
}
//Booking Status
// 1 - Add/Book
// 2 - Update/Reschedule
// 3 - ... | [
-0.2230333387851715,
-0.6792095899581909,
0.8868519067764282,
0.7998214960098267,
-0.570770263671875,
0.99372798204422,
-0.23715315759181976,
0.5705382227897644,
-0.09476615488529205,
0.9746453166007996,
0.8839085698127747,
-0.3621969521045685,
-0.9364719390869141,
0.49778714776039124,
0... |
func newCacheDB(persistent, memory storage.DataStore) storage.DataStore {
return &memoryDB{
persistent: persistent,
inmem: memory,
persistentAPN: nil,
inmemAPN: nil,
}
} | [
0.45947226881980896,
-0.3561118245124817,
0.3635717034339905,
1.1434054374694824,
-1.32809579372406,
0.7314624190330505,
-0.8273930549621582,
0.3371938467025757,
0.5673454403877258,
-0.7471498250961304,
-0.27339234948158264,
0.3026182949542999,
-0.9401998519897461,
0.5897712111473083,
0.... |
func (m *memoryDB) AllocateSequence(identifier string, current uint64, new uint64) bool {
return m.persistent.AllocateSequence(identifier, current, new)
} | [
-1.576541781425476,
0.19336014986038208,
0.4287847578525543,
0.35700279474258423,
-0.2339554876089096,
-0.4629684090614319,
-0.6769002079963684,
0.026240717619657516,
0.41917794942855835,
0.4973541498184204,
-0.27937445044517517,
-0.5997368693351746,
-0.4415666162967682,
0.1116185039281845... |
func (m *memoryDB) CurrentSequence(identifier string) (uint64, error) {
return m.persistent.CurrentSequence(identifier)
} | [
-2.0329480171203613,
-0.991783082485199,
0.20071835815906525,
0.195990189909935,
-0.2924356460571289,
-0.9714218974113464,
-0.02305886708199978,
-0.28929099440574646,
0.20878972113132477,
0.6769201159477234,
-0.6451481580734253,
-0.06554962694644928,
-0.9139407873153687,
0.5260939598083496... |
func (m *memoryDB) NewCollectionID() model.CollectionKey {
// just return the persistent implementation here.
return m.persistent.NewCollectionID()
} | [
0.5526551604270935,
-0.8260592818260193,
0.42228612303733826,
0.3842339515686035,
-0.8374790549278259,
0.5075663924217224,
0.5033442378044128,
-0.6458021998405457,
0.36023595929145813,
0.373171329498291,
0.1686747968196869,
-0.08547848463058472,
-0.19739364087581635,
1.4771969318389893,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.