text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func GetECRAuthToken(awsRegion string) (authToken string, getAuthTokenErr error) {
ecrClient, ecrClientInitErr := config.ECRClientInit(awsRegion)
if ecrClientInitErr != nil {
return "", ecrClientInitErr
}
input := &ecr.GetAuthorizationTokenInput{}
result, getAuthTokenErr := ecrClient.GetAuthorizationToken(inpu... | [
-0.38568925857543945,
-0.24278518557548523,
0.8946483731269836,
-0.5866616368293762,
-0.4570061266422272,
0.021354490891098976,
0.6045423150062561,
0.41788217425346375,
0.004182436503469944,
-0.41598814725875854,
-0.05377298220992088,
0.7274520397186279,
0.16852343082427979,
0.309402376413... |
func CreateECRRepo(awsRegion string, ecrRepoName string) (ecrCreateRepo error) {
ecrClient, ecrClientInitErr := config.ECRClientInit(awsRegion)
if ecrClientInitErr != nil {
return ecrClientInitErr
}
input := &ecr.CreateRepositoryInput{
RepositoryName: aws.String(ecrRepoName),
}
_, createRepoErr := ecrClient... | [
-0.23615488409996033,
-0.05925174057483673,
0.7679030895233154,
-0.8771317601203918,
0.4467191994190216,
0.2464272677898407,
0.23399701714515686,
-0.354186087846756,
0.2093479037284851,
0.47720158100128174,
-0.6161599159240723,
-0.24267926812171936,
-0.20905591547489166,
0.0482136383652687... |
func (c *Cache) FindBundle(ref cnab.OCIReference) (CachedBundle, bool, error) {
cb := CachedBundle{}
cb.Reference = ref
cacheDir, err := c.GetCacheDir()
if err != nil {
return CachedBundle{}, false, err
}
cb.SetCacheDir(cacheDir)
found, err := cb.Load(c.Context)
if err != nil {
return CachedBundle{}, fals... | [
0.06773033738136292,
0.7272346615791321,
0.9248232245445251,
-0.393644779920578,
0.024520143866539,
-0.1915431022644043,
0.4523778557777405,
-1.0519486665725708,
-0.15439032018184662,
0.7351020574569702,
0.4358886480331421,
-0.11697355657815933,
-1.1645495891571045,
1.0977809429168701,
0... |
func (c *Cache) StoreBundle(bundleRef cnab.BundleReference) (CachedBundle, error) {
cb := CachedBundle{BundleReference: bundleRef}
cacheDir, err := c.GetCacheDir()
if err != nil {
return CachedBundle{}, err
}
cb.SetCacheDir(cacheDir)
// Remove any previously cached bundle files
err = c.FileSystem.RemoveAll(c... | [
-0.3680349588394165,
-0.21658281981945038,
0.8647124171257019,
-0.09770028293132782,
0.03276035189628601,
0.21696114540100098,
1.0460761785507202,
-0.021029464900493622,
0.39146143198013306,
0.36076241731643677,
0.4046385884284973,
-0.2976092994213104,
-0.39246195554733276,
0.2718886733055... |
func (c *Cache) cacheMetadata(cb *CachedBundle) error {
meta := Metadata{
Reference: cb.Reference,
Digest: cb.Digest,
}
path := cb.BuildMetadataPath()
return encoding.MarshalFile(c.FileSystem, path, meta)
} | [
0.34296026825904846,
-0.5039149522781372,
0.4107724726200104,
-0.049890317022800446,
0.3754182457923889,
0.8756526112556458,
-0.44269219040870667,
-0.05730387941002846,
-0.3109661638736725,
0.823809027671814,
-0.03771880641579628,
0.45235496759414673,
0.2622739374637604,
-0.057388596236705... |
func (c *Cache) cacheManifest(cb *CachedBundle) error {
if cb.Definition.IsPorterBundle() {
stamp, err := configadapter.LoadStamp(cb.Definition)
if err != nil {
fmt.Fprintf(c.Err, "WARNING: Bundle %s was created by porter but could not load the Porter stamp. This may be because it was created by an older versio... | [
-0.2976926863193512,
-0.8737991452217102,
0.6533336043357849,
0.2465764582157135,
-0.2046787291765213,
0.5456920862197876,
0.4464472532272339,
0.36030107736587524,
0.6939107775688171,
0.21625804901123047,
-0.3989453911781311,
0.3101710379123688,
-0.1886640042066574,
0.38012003898620605,
... |
func (s *server) GetUser(ctx context.Context, in *pb.UserMessage) (*pb.UserMessage, error) {
// log the message here
log.Printf("Received: %v", in.GetId())
// return a user
return &pb.UserMessage {
Id: in.GetId(),
Name: "Captain Funk",
Email: "captainfunk@legit.com",
},
nil // no error for now
} | [
-0.3113899827003479,
-0.31260520219802856,
0.4770640730857849,
0.3875197470188141,
0.10804964601993561,
0.09416042268276215,
0.13269354403018951,
-0.38572782278060913,
0.32462137937545776,
-0.7675613164901733,
-0.4118148982524872,
0.7214300632476807,
-1.5659905672073364,
0.0516164004802703... |
func newMovingAverage(sampleSize int) *movingAverage {
if sampleSize <= 0 {
panic("sampleSize must be greather than 0.")
}
return &movingAverage{
sampleSize: sampleSize,
ring: make([]float64, sampleSize),
}
} | [
-0.46683403849601746,
0.5889890193939209,
0.3562123775482178,
0.7715426683425903,
-1.3229761123657227,
-0.04202817380428314,
-0.14170080423355103,
-1.0117899179458618,
0.15449848771095276,
1.4474600553512573,
-0.004739819094538689,
-0.06141844764351845,
-0.38787299394607544,
0.765150129795... |
func (m *movingAverage) average() (float64, error) {
sum := .0
if !m.samplingComplete {
return sum, fmt.Errorf("cannot compute average without a full sampling")
}
for _, value := range m.ring {
sum += value
}
return sum / float64(m.sampleSize), nil
} | [
-0.719565212726593,
0.24549850821495056,
0.3712184727191925,
0.35890814661979675,
-0.2249310463666916,
-0.11576790362596512,
0.800991952419281,
-0.2911373972892761,
-0.7225053906440735,
1.4073413610458374,
0.44158726930618286,
0.04809271916747093,
-0.6833696365356445,
0.4879005253314972,
... |
func (m *movingAverage) insertValue(value float64) {
m.ring[m.nextIdx] = value
m.nextIdx = (m.nextIdx + 1) % m.sampleSize
if m.nextIdx == 0 {
m.samplingComplete = true
}
} | [
-0.24439910054206848,
1.6879501342773438,
0.6749383211135864,
-0.5752546191215515,
-0.1807795912027359,
0.618304431438446,
1.3657797574996948,
-0.5224244594573975,
-0.071544349193573,
1.2103924751281738,
0.22564449906349182,
-0.7617594003677368,
-0.8936752080917358,
0.7311589121818542,
0... |
func NewViewTimelogTotals() *ViewTimelogTotals {
this := ViewTimelogTotals{}
return &this
} | [
0.03920528292655945,
0.26511043310165405,
0.12288101762533188,
-0.5421097278594971,
-1.695881962776184,
-0.47995248436927795,
-0.40635254979133606,
-0.918615460395813,
0.1503114402294159,
0.18441618978977203,
-0.40734317898750305,
0.19285434484481812,
0.6605333685874939,
-0.066591329872608... |
func NewViewTimelogTotalsWithDefaults() *ViewTimelogTotals {
this := ViewTimelogTotals{}
return &this
} | [
0.13591068983078003,
0.8801408410072327,
0.055693384259939194,
-0.25967296957969666,
-0.6628276109695435,
-0.5112650990486145,
-0.7656441926956177,
-0.7182942628860474,
0.10003039985895157,
-0.4803278148174286,
-0.8835264444351196,
-0.5341240167617798,
0.43888846039772034,
0.44949713349342... |
func (o *ViewTimelogTotals) GetEstimatedMinutes() int32 {
if o == nil || o.EstimatedMinutes == nil {
var ret int32
return ret
}
return *o.EstimatedMinutes
} | [
0.035848215222358704,
0.33319875597953796,
0.11770296841859818,
-0.40249988436698914,
-0.35924315452575684,
0.248708575963974,
-0.17430374026298523,
-0.3981532156467438,
0.18765924870967865,
-0.09262561053037643,
-0.5346812009811401,
-0.4431766867637634,
-0.9227249622344971,
0.234405815601... |
func (o *ViewTimelogTotals) GetEstimatedMinutesOk() (*int32, bool) {
if o == nil || o.EstimatedMinutes == nil {
return nil, false
}
return o.EstimatedMinutes, true
} | [
-0.38843584060668945,
1.069042444229126,
0.44304996728897095,
-0.30703064799308777,
-0.35389086604118347,
0.20375362038612366,
-0.20682929456233978,
-0.4001879096031189,
0.09641767293214798,
0.36871853470802307,
-1.1538907289505005,
-0.4925287663936615,
0.5077696442604065,
0.09132190048694... |
func (o *ViewTimelogTotals) HasEstimatedMinutes() bool {
if o != nil && o.EstimatedMinutes != nil {
return true
}
return false
} | [
0.29077738523483276,
0.925501823425293,
0.37853726744651794,
-0.8542913794517517,
0.12499483674764633,
-0.02097436413168907,
-0.518531322479248,
0.010051785036921501,
-0.6773061156272888,
-0.0077510252594947815,
-1.209385633468628,
-0.7823957800865173,
0.29410994052886963,
0.11325791478157... |
func (o *ViewTimelogTotals) SetEstimatedMinutes(v int32) {
o.EstimatedMinutes = &v
} | [
-0.25529542565345764,
0.577057957649231,
0.17522960901260376,
-1.5034674406051636,
-0.9018320441246033,
0.6389222145080566,
-0.6420004367828369,
-1.1910144090652466,
-0.12369827926158905,
0.38784822821617126,
-0.7852751612663269,
0.2444576621055603,
-0.38748762011528015,
-0.462435185909271... |
func (o *ViewTimelogTotals) GetEstimatedMinutesActive() int32 {
if o == nil || o.EstimatedMinutesActive == nil {
var ret int32
return ret
}
return *o.EstimatedMinutesActive
} | [
0.1733214110136032,
-0.5129612684249878,
0.45659342408180237,
-0.7717162370681763,
-1.2830995321273804,
0.9011524319648743,
-0.22070281207561493,
-0.8434488773345947,
-0.38129058480262756,
-0.044581420719623566,
-0.5449410080909729,
0.18004819750785828,
-0.5700169205665588,
-0.354071229696... |
func (o *ViewTimelogTotals) GetEstimatedMinutesActiveOk() (*int32, bool) {
if o == nil || o.EstimatedMinutesActive == nil {
return nil, false
}
return o.EstimatedMinutesActive, true
} | [
0.1446356177330017,
-0.37943384051322937,
0.8267974853515625,
-0.6718595027923584,
-0.8035296201705933,
0.9559816718101501,
-0.1705402284860611,
-0.16960422694683075,
-0.3136533796787262,
0.5278570055961609,
-1.0197060108184814,
-0.43745696544647217,
0.7399979829788208,
0.07958722114562988... |
func (o *ViewTimelogTotals) HasEstimatedMinutesActive() bool {
if o != nil && o.EstimatedMinutesActive != nil {
return true
}
return false
} | [
0.4504196047782898,
0.05195246636867523,
0.6258600950241089,
-0.9472997784614563,
-0.5436960458755493,
0.37232619524002075,
-0.2144489586353302,
-0.1872047334909439,
-0.9824790954589844,
-0.19546674191951752,
-1.19754159450531,
-0.2856235206127167,
0.6607372164726257,
-0.1833045482635498,
... |
func (o *ViewTimelogTotals) SetEstimatedMinutesActive(v int32) {
o.EstimatedMinutesActive = &v
} | [
0.065120168030262,
-0.3854471743106842,
0.30120256543159485,
-1.5951876640319824,
-1.4550138711929321,
1.3373459577560425,
-0.3474348485469818,
-1.1878308057785034,
-0.5499519109725952,
0.4302956759929657,
-0.8997645974159241,
0.5654404759407043,
0.005017906427383423,
-0.9313802719116211,
... |
func (o *ViewTimelogTotals) GetEstimatedMinutesCompleted() int32 {
if o == nil || o.EstimatedMinutesCompleted == nil {
var ret int32
return ret
}
return *o.EstimatedMinutesCompleted
} | [
0.19896402955055237,
-0.3698533773422241,
0.15164035558700562,
-0.6137046217918396,
-0.485770046710968,
0.7133195996284485,
-0.05695013329386711,
-0.9579275846481323,
-0.2820979058742523,
0.3763183653354645,
-0.5503847002983093,
-0.5540776252746582,
-0.14637593924999237,
0.374898761510849,... |
func (o *ViewTimelogTotals) GetEstimatedMinutesCompletedOk() (*int32, bool) {
if o == nil || o.EstimatedMinutesCompleted == nil {
return nil, false
}
return o.EstimatedMinutesCompleted, true
} | [
-0.06810589879751205,
-0.21036206185817719,
0.5692631006240845,
-0.6976010203361511,
-0.4464515149593353,
0.7273372411727905,
0.27571025490760803,
-0.17845161259174347,
-0.5099823474884033,
0.8260858654975891,
-1.2405049800872803,
-0.9049981236457825,
0.6086735129356384,
0.7474398016929626... |
func (o *ViewTimelogTotals) HasEstimatedMinutesCompleted() bool {
if o != nil && o.EstimatedMinutesCompleted != nil {
return true
}
return false
} | [
0.35246512293815613,
0.2622561454772949,
0.35703161358833313,
-0.9492541551589966,
0.12430176883935928,
0.3748527765274048,
-0.07417837530374527,
-0.38574182987213135,
-0.988486111164093,
0.26232630014419556,
-1.0618947744369507,
-0.9211926460266113,
0.8960054516792297,
0.6236853003501892,... |
func (o *ViewTimelogTotals) SetEstimatedMinutesCompleted(v int32) {
o.EstimatedMinutesCompleted = &v
} | [
-0.000021018480765633285,
-0.21123525500297546,
0.2051953822374344,
-1.4664844274520874,
-0.6231538653373718,
1.1495513916015625,
-0.14270499348640442,
-1.19060218334198,
-0.4450916051864624,
0.5884159803390503,
-1.043529748916626,
-0.1790286898612976,
0.4447530508041382,
-0.02223922312259... |
func (o *ViewTimelogTotals) GetEstimatedMinutesFiltered() int32 {
if o == nil || o.EstimatedMinutesFiltered == nil {
var ret int32
return ret
}
return *o.EstimatedMinutesFiltered
} | [
0.2500644624233246,
0.3746541440486908,
0.31112799048423767,
-0.2556459903717041,
-0.36505112051963806,
0.35917460918426514,
0.11645564436912537,
-1.027078628540039,
-0.3110331892967224,
0.04776185005903244,
-0.668311357498169,
-0.08755375444889069,
-0.8255012035369873,
0.1373290866613388,... |
func (o *ViewTimelogTotals) GetEstimatedMinutesFilteredOk() (*int32, bool) {
if o == nil || o.EstimatedMinutesFiltered == nil {
return nil, false
}
return o.EstimatedMinutesFiltered, true
} | [
-0.035416536033153534,
0.6888734698295593,
0.7053029537200928,
-0.41092121601104736,
-0.7335325479507446,
0.3113633096218109,
0.1024458184838295,
-0.6618948578834534,
-0.6878706216812134,
0.8568148612976074,
-1.2947827577590942,
-0.5351802706718445,
0.03709912672638893,
0.31055766344070435... |
func (o *ViewTimelogTotals) HasEstimatedMinutesFiltered() bool {
if o != nil && o.EstimatedMinutesFiltered != nil {
return true
}
return false
} | [
0.28748875856399536,
0.9287661910057068,
0.5323625802993774,
-0.4871450662612915,
0.10539422184228897,
0.023078911006450653,
-0.037269338965415955,
-0.6056236028671265,
-1.0739887952804565,
0.1452340930700302,
-1.235207200050354,
-0.3558005094528198,
0.14501895010471344,
0.2061298191547393... |
func (o *ViewTimelogTotals) SetEstimatedMinutesFiltered(v int32) {
o.EstimatedMinutesFiltered = &v
} | [
0.040710024535655975,
0.5202536582946777,
0.34821614623069763,
-1.122990608215332,
-0.6082040667533875,
0.8645963072776794,
0.05457368865609169,
-1.5300748348236084,
-0.42974817752838135,
0.41160115599632263,
-0.8092421293258667,
0.4926649332046509,
-0.2415580302476883,
-0.3953829705715179... |
func (o *ViewTimelogTotals) GetEstimatedMinutesWithLoggedTime() int32 {
if o == nil || o.EstimatedMinutesWithLoggedTime == nil {
var ret int32
return ret
}
return *o.EstimatedMinutesWithLoggedTime
} | [
0.6216900944709778,
-0.18842147290706635,
0.5747268795967102,
0.13724926114082336,
-0.9289529919624329,
0.1770913004875183,
-0.6994320154190063,
-0.9570112228393555,
0.9999217987060547,
-0.2852901816368103,
-0.7738109230995178,
-0.44862857460975647,
-1.106597900390625,
0.5555358529090881,
... |
func (o *ViewTimelogTotals) GetEstimatedMinutesWithLoggedTimeOk() (*int32, bool) {
if o == nil || o.EstimatedMinutesWithLoggedTime == nil {
return nil, false
}
return o.EstimatedMinutesWithLoggedTime, true
} | [
0.3118404448032379,
-0.054639171808958054,
0.7622406482696533,
0.03685298562049866,
-1.0354077816009521,
0.1542658507823944,
-0.3142503499984741,
-0.433208703994751,
0.3773149251937866,
0.3786049783229828,
-1.2452419996261597,
-0.45637184381484985,
-0.21476656198501587,
0.8332147002220154,... |
func (o *ViewTimelogTotals) HasEstimatedMinutesWithLoggedTime() bool {
if o != nil && o.EstimatedMinutesWithLoggedTime != nil {
return true
}
return false
} | [
0.8949766755104065,
0.3359389007091522,
0.6243122816085815,
-0.11437512934207916,
-0.7657567858695984,
-0.10280922800302505,
-0.7415775656700134,
-0.33069953322410583,
0.026749292388558388,
-0.23455655574798584,
-1.265835165977478,
-0.5223135948181152,
-0.43157824873924255,
0.9098380208015... |
func (o *ViewTimelogTotals) SetEstimatedMinutesWithLoggedTime(v int32) {
o.EstimatedMinutesWithLoggedTime = &v
} | [
0.507733941078186,
0.005963019095361233,
0.38629546761512756,
-0.8132211565971375,
-1.2403022050857544,
0.7077339887619019,
-0.7095898985862732,
-1.070191502571106,
0.560592770576477,
0.08120934665203094,
-0.9989137649536133,
0.24814088642597198,
-0.5535329580307007,
0.3806836009025574,
... |
func (o *ViewTimelogTotals) GetMinutes() int32 {
if o == nil || o.Minutes == nil {
var ret int32
return ret
}
return *o.Minutes
} | [
0.08850672096014023,
0.8681156039237976,
-0.19827792048454285,
-0.3539676070213318,
0.03219246864318848,
-0.21214020252227783,
0.1411445587873459,
-0.8018661141395569,
1.1517208814620972,
-1.026259183883667,
0.3939632475376129,
-1.1837247610092163,
-0.98788982629776,
0.6271821856498718,
... |
func (o *ViewTimelogTotals) GetMinutesOk() (*int32, bool) {
if o == nil || o.Minutes == nil {
return nil, false
}
return o.Minutes, true
} | [
-0.342231422662735,
1.5144238471984863,
0.14989987015724182,
0.205959752202034,
0.003211535979062319,
-0.421840637922287,
-0.3701447546482086,
-0.4091250002384186,
0.5602453947067261,
0.045593198388814926,
-0.7731348872184753,
-1.09260094165802,
0.14988848567008972,
0.3193141222000122,
-... |
func (o *ViewTimelogTotals) HasMinutes() bool {
if o != nil && o.Minutes != nil {
return true
}
return false
} | [
0.5003883242607117,
1.0656112432479858,
0.08519188314676285,
-0.7818016409873962,
0.37546759843826294,
-0.5517910122871399,
-0.6621783375740051,
-0.13090698421001434,
0.785399854183197,
-0.933013379573822,
-0.34506353735923767,
-1.343285083770752,
-0.6897369027137756,
-0.005518342368304729... |
func (o *ViewTimelogTotals) SetMinutes(v int32) {
o.Minutes = &v
} | [
-0.053172044456005096,
1.0702533721923828,
-0.21845506131649017,
-1.3383229970932007,
-0.8988545536994934,
0.06950322538614273,
-0.8470810055732727,
-1.895656943321228,
0.415787935256958,
-0.23906587064266205,
0.6089836359024048,
0.44844356179237366,
-0.35174238681793213,
-0.46956259012222... |
func (o *ViewTimelogTotals) GetMinutesBillable() int32 {
if o == nil || o.MinutesBillable == nil {
var ret int32
return ret
}
return *o.MinutesBillable
} | [
0.5144948363304138,
0.20951442420482635,
0.24342283606529236,
-0.005691016558557749,
-0.46093565225601196,
0.33294251561164856,
-0.2437797635793686,
-1.2026185989379883,
-0.08019065111875534,
-0.24260082840919495,
-0.2668185532093048,
-1.121795415878296,
-1.3375142812728882,
0.875312566757... |
func (o *ViewTimelogTotals) GetMinutesBillableOk() (*int32, bool) {
if o == nil || o.MinutesBillable == nil {
return nil, false
}
return o.MinutesBillable, true
} | [
0.7252216339111328,
0.3782484531402588,
0.5981354713439941,
0.4760166108608246,
-0.46206042170524597,
0.22520175576210022,
-0.31125757098197937,
-0.3767906427383423,
-0.36277374625205994,
0.3170489966869354,
-1.0839524269104004,
-1.1569873094558716,
-0.22330908477306366,
0.9135255217552185... |
func (o *ViewTimelogTotals) HasMinutesBillable() bool {
if o != nil && o.MinutesBillable != nil {
return true
}
return false
} | [
0.7564163208007812,
0.6788524389266968,
0.4266839325428009,
-0.26120662689208984,
-0.014254914596676826,
-0.4115811884403229,
-0.5062722563743591,
-0.5509445071220398,
-0.2111886888742447,
-0.18194235861301422,
-0.9811850786209106,
-1.26981782913208,
-0.7600233554840088,
0.9853311777114868... |
func (o *ViewTimelogTotals) SetMinutesBillable(v int32) {
o.MinutesBillable = &v
} | [
0.7737947106361389,
0.5785980224609375,
0.11300651729106903,
-0.8591738939285278,
-0.695842444896698,
0.5371388792991638,
-0.655510663986206,
-1.9083001613616943,
-0.6192858219146729,
0.3295924961566925,
-0.10198093205690384,
0.1587134599685669,
-0.7289425134658813,
0.28135961294174194,
... |
func (o *ViewTimelogTotals) GetMinutesBilled() int32 {
if o == nil || o.MinutesBilled == nil {
var ret int32
return ret
}
return *o.MinutesBilled
} | [
0.9402923583984375,
0.15178515017032623,
0.2863729000091553,
-0.1597025841474533,
-0.25753459334373474,
0.9386876225471497,
-0.1414792686700821,
-1.0908421277999878,
1.1253480911254883,
-0.8969531655311584,
-0.2461218684911728,
-0.39134761691093445,
-1.2666444778442383,
1.4240567684173584,... |
func (o *ViewTimelogTotals) GetMinutesBilledOk() (*int32, bool) {
if o == nil || o.MinutesBilled == nil {
return nil, false
}
return o.MinutesBilled, true
} | [
0.4944760501384735,
0.9176788926124573,
0.5366167426109314,
0.12531034648418427,
0.013928729109466076,
0.547993004322052,
-0.3074769079685211,
-0.4952634274959564,
0.45064660906791687,
-0.7065328359603882,
-0.9099482297897339,
-0.47435468435287476,
-0.3399854004383087,
1.4473693370819092,
... |
func (o *ViewTimelogTotals) HasMinutesBilled() bool {
if o != nil && o.MinutesBilled != nil {
return true
}
return false
} | [
1.0394256114959717,
0.6219056844711304,
0.4180810749530792,
-0.6449493169784546,
0.21764621138572693,
0.16046103835105896,
-0.7622308731079102,
-0.44682934880256653,
0.7625702023506165,
-0.6483706831932068,
-0.8597785234451294,
-0.6401113867759705,
-0.5404171943664551,
1.4870150089263916,
... |
func (o *ViewTimelogTotals) SetMinutesBilled(v int32) {
o.MinutesBilled = &v
} | [
0.7995167374610901,
0.53096604347229,
0.06956594437360764,
-1.0653756856918335,
-0.6476122736930847,
1.1583154201507568,
-0.7364258170127869,
-2.0798580646514893,
0.46723517775535583,
-0.3021235466003418,
-0.1558413803577423,
0.8112186193466187,
-0.6311358213424683,
0.7625737190246582,
-... |
func (o *ViewTimelogTotals) GetMinutesNonBillable() int32 {
if o == nil || o.MinutesNonBillable == nil {
var ret int32
return ret
}
return *o.MinutesNonBillable
} | [
0.08882702142000198,
0.41039299964904785,
-0.15605497360229492,
0.0739125907421112,
-0.4182274341583252,
0.3491870164871216,
-0.24917319416999817,
-1.4192415475845337,
-0.30972954630851746,
-0.4715881645679474,
-0.25950533151626587,
-1.4579380750656128,
-1.5632363557815552,
0.9884147047996... |
func (o *ViewTimelogTotals) GetMinutesNonBillableOk() (*int32, bool) {
if o == nil || o.MinutesNonBillable == nil {
return nil, false
}
return o.MinutesNonBillable, true
} | [
0.4268341362476349,
0.506348729133606,
0.2882450222969055,
0.3819577991962433,
-0.4117935299873352,
0.32144618034362793,
-0.2560490369796753,
-1.0144325494766235,
-0.8174446821212769,
0.3512125611305237,
-0.7798154950141907,
-1.2673406600952148,
-0.9137572646141052,
1.361714482307434,
-0... |
func (o *ViewTimelogTotals) HasMinutesNonBillable() bool {
if o != nil && o.MinutesNonBillable != nil {
return true
}
return false
} | [
0.6213472485542297,
0.9571371078491211,
-0.003918220289051533,
-0.33265265822410583,
0.18914175033569336,
-0.39617830514907837,
-0.42597252130508423,
-1.079880952835083,
-0.6105355024337769,
-0.5924444198608398,
-0.5662476420402527,
-1.3570075035095215,
-1.3036831617355347,
1.4325084686279... |
func (o *ViewTimelogTotals) SetMinutesNonBillable(v int32) {
o.MinutesNonBillable = &v
} | [
0.028142793104052544,
0.7994522452354431,
-0.2299668937921524,
-0.9511296153068542,
-0.7748626470565796,
0.5950098633766174,
-0.5682108402252197,
-2.0772593021392822,
-0.7423210144042969,
0.25743937492370605,
-0.004925448447465897,
-0.28816428780555725,
-1.0561649799346924,
0.4968289434909... |
func (o *ViewTimelogTotals) GetMinutesNonBilled() int32 {
if o == nil || o.MinutesNonBilled == nil {
var ret int32
return ret
}
return *o.MinutesNonBilled
} | [
0.5142951607704163,
-0.1028904840350151,
-0.02074936218559742,
-0.5198050141334534,
-0.2248653918504715,
0.5226461887359619,
-0.11701423674821854,
-0.7747623920440674,
0.6471819877624512,
-0.998816192150116,
-0.3915528953075409,
-0.704303503036499,
-1.3409117460250854,
1.4966325759887695,
... |
func (o *ViewTimelogTotals) GetMinutesNonBilledOk() (*int32, bool) {
if o == nil || o.MinutesNonBilled == nil {
return nil, false
}
return o.MinutesNonBilled, true
} | [
0.1284821480512619,
0.6246181130409241,
0.16161659359931946,
-0.26839932799339294,
-0.03265993669629097,
0.6575024724006653,
-0.05603913962841034,
-0.6939257979393005,
0.12002687156200409,
-0.6783475875854492,
-0.7680661082267761,
-0.7003000378608704,
-0.6728672981262207,
1.891389369964599... |
func (o *ViewTimelogTotals) HasMinutesNonBilled() bool {
if o != nil && o.MinutesNonBilled != nil {
return true
}
return false
} | [
0.8330857753753662,
0.3827956020832062,
0.14376839995384216,
-0.9775390625,
0.2785271108150482,
-0.11383309215307236,
-0.5277050733566284,
-0.345228374004364,
0.34221380949020386,
-0.9353381991386414,
-0.7336738705635071,
-0.7287952303886414,
-1.0100443363189697,
1.7784277200698853,
-0.8... |
func (o *ViewTimelogTotals) SetMinutesNonBilled(v int32) {
o.MinutesNonBilled = &v
} | [
0.19699448347091675,
0.4166065454483032,
-0.18993104994297028,
-1.5014622211456299,
-0.6356945037841797,
0.9768475294113159,
-0.5230557322502136,
-1.6326656341552734,
0.26656076312065125,
-0.2912779152393341,
-0.13123928010463715,
0.45891624689102173,
-0.7974763512611389,
0.852093040943145... |
func RegisterServer(srv Server, registry *prometheus.Registry, opts ...grpc.ServerOption) *grpc.Server {
var metrics *grpc_prometheus.ServerMetrics
// TODO: Decouple registry from this.
if registry != nil {
metrics = grpc_prometheus.NewServerMetrics()
registry.MustRegister(metrics)
opts = append(opts,
grp... | [
-0.6917883157730103,
0.5473464727401733,
0.7036778330802917,
0.08714940398931503,
0.9436352252960205,
0.49055609107017517,
0.6755035519599915,
-0.33005601167678833,
0.5906714200973511,
-0.7394722104072571,
-0.0831688717007637,
1.0213192701339722,
-0.9034178256988525,
0.8403918743133545,
... |
func TestHello(t *testing.T) {
// refactor to minimize repeition:
assertCorrectMessage := func(t *testing.T, got, want string) {
// t.Helper needed to tell the test suit that this method is a helper
// this allows for function specific error messages and not this helper function
t.Helper()
if got != want {
... | [
0.1754293590784073,
0.04430162161588669,
0.7463506460189819,
-0.08598993718624115,
0.45784398913383484,
0.9472930431365967,
0.09489922970533371,
0.0027133675757795572,
-0.3126732409000397,
-0.7519610524177551,
-0.48673921823501587,
0.6737145781517029,
-0.14024652540683746,
0.60449045896530... |
func (svc *KMS) Decrypt(ctx context.Context, r DecryptRequest) (*DecryptResult, error) {
out, err := svc.RawDecrypt(ctx, r.ToInput())
if err != nil {
err = svc.errWrap(errors.ErrorData{
Err: err,
AWSOperation: "Decrypt",
})
svc.Errorf(err.Error())
return nil, err
}
return NewDecryptResult(out... | [
-0.9253485798835754,
1.2980270385742188,
0.5761042833328247,
0.4241752326488495,
-0.4089495539665222,
-0.5368714928627014,
0.16010376811027527,
-1.249720573425293,
0.4526848793029785,
0.16682079434394836,
0.13764937222003937,
0.2521612346172333,
-0.604554295539856,
-0.5020855069160461,
-... |
func ipFind(ip string) string {
r := regexp.MustCompile(`\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b`)
return r.FindString(ip)
} | [
-0.15198855102062225,
0.011026950553059578,
0.734744668006897,
0.029984187334775925,
-0.8992630839347839,
0.6082115173339844,
0.34180253744125366,
-0.21969284117221832,
-0.07260823249816895,
0.6070811152458191,
1.2238578796386719,
-0.5677000880241394,
-0.9713252782821655,
-1.49784243106842... |
func (ctx *serverContext) handlePhoneConnection(w http.ResponseWriter, r *http.Request) {
// login
user, err := ctx.auth.User(r.Form.Get("identity"))
if err != nil {
http.Error(w, "Missing identity token", 401)
return
}
// connect
socket, err := ctx.upgrader.Upgrade(w, r, nil)
if err != nil {
fmt.Println(... | [
-0.6178104877471924,
-0.7824314832687378,
1.0404753684997559,
0.03029504045844078,
-0.03264563903212547,
-0.04555298388004303,
0.4851321876049042,
-0.8196151256561279,
0.3071943521499634,
0.6925866603851318,
0.6762180328369141,
-1.2821993827819824,
-0.21066662669181824,
-0.0240518897771835... |
func (m *MockVersion) GetVersion(keyName string) (string, error) {
args := m.Called()
return args.String(0), args.Error(1)
} | [
-0.8636167645454407,
-0.3277200162410736,
0.6895436644554138,
1.0768811702728271,
0.112531878054142,
0.3258345127105713,
0.9081605076789856,
0.2424086630344391,
-0.259670615196228,
1.4428964853286743,
-0.7903719544410706,
-0.04291046783328056,
-0.811203122138977,
0.5720370411872864,
0.09... |
func (m *MockVersion) UpdateVersion(keyName, newVersion string) error {
args := m.Called()
return args.Error(0)
} | [
-1.1840462684631348,
-0.8062606453895569,
0.4846940338611603,
1.2816908359527588,
-0.15943197906017303,
0.5785157084465027,
0.5168709754943848,
0.9336161613464355,
-0.12207771837711334,
1.628260850906372,
-0.8599518537521362,
-0.11065750569105148,
-0.8255947828292847,
0.506847083568573,
... |
func (m *MockVersion) ParseVersionNumber(fileName string) (int64, error) {
args := m.Called()
return int64(args.Int(0)), args.Error(1)
} | [
-1.2792658805847168,
-0.22482897341251373,
0.7187929749488831,
0.5606040358543396,
-0.3291669189929962,
-0.1506747603416443,
1.6329691410064697,
0.9538375735282898,
0.03430892527103424,
0.01422701682895422,
-1.2024123668670654,
-0.36823996901512146,
-0.2699955105781555,
1.247247576713562,
... |
func (fn RemoveFromCartHandlerFunc) Handle(params RemoveFromCartParams, principal interface{}) middleware.Responder {
return fn(params, principal)
} | [
-0.09923478960990906,
-0.8392683267593384,
0.5961147546768188,
0.5732262134552002,
-0.33725351095199585,
0.41547971963882446,
0.44659385085105896,
0.17192986607551575,
-0.46759000420570374,
-0.5808305144309998,
0.30309614539146423,
-0.5357410907745361,
-0.866874098777771,
-0.44157099723815... |
func NewRemoveFromCart(ctx *middleware.Context, handler RemoveFromCartHandler) *RemoveFromCart {
return &RemoveFromCart{Context: ctx, Handler: handler}
} | [
0.06094011291861534,
-1.1928691864013672,
0.2477998435497284,
-0.03970721736550331,
-1.6062233448028564,
-0.05028792470693588,
-0.6611534953117371,
-1.0304592847824097,
0.013121883384883404,
-0.14778867363929749,
-0.259696364402771,
-0.39577245712280273,
-0.30732303857803345,
0.73846328258... |
func executor(in string) {
s := strings.TrimSpace(in)
s = strings.TrimSuffix(in, ";")
if s == "" {
return
} else if s == "quit" || s == "exit" {
os.Exit(0)
} else {
spin := spinner.New(spinner.CharSets[14], 100*time.Millisecond)
spin.Start()
defer spin.Stop()
ctx, cancel := context.WithCancel(context.... | [
0.8334590792655945,
-0.11333508044481277,
0.881340742111206,
0.6980984210968018,
-0.8829062581062317,
0.26081839203834534,
0.05583669990301132,
0.7831946015357971,
0.5089897513389587,
0.06466111540794373,
-0.15890909731388092,
-0.3376023471355438,
-0.7146621942520142,
0.22010743618011475,
... |
func completer(d prompt.Document) []prompt.Suggest {
keywords := []prompt.Suggest{
{Text: "SELECT", Description: "keyword"},
{Text: "FROM", Description: "keyword"},
{Text: "WHERE", Description: "keyword"},
{Text: "LIMIT", Description: "keyword"},
{Text: "DESC", Description: "keyword"},
{Text: "TABLE", Desc... | [
-0.22848321497440338,
-0.42459526658058167,
1.126543402671814,
0.3486894965171814,
-1.7718000411987305,
0.050383951514959335,
-0.19040648639202118,
-0.30753064155578613,
-0.1296013593673706,
0.6216300129890442,
0.20116762816905975,
0.483277827501297,
-0.23390933871269226,
1.441138982772827... |
func Test_CSRF_Next(t *testing.T) {
app := fiber.New()
app.Use(New(Config{
Next: func(_ *fiber.Ctx) bool {
return true
},
}))
resp, err := app.Test(httptest.NewRequest("GET", "/", nil))
utils.AssertEqual(t, nil, err)
utils.AssertEqual(t, fiber.StatusNotFound, resp.StatusCode)
} | [
0.42204898595809937,
0.5329676270484924,
0.2768852412700653,
0.8426927924156189,
0.73856520652771,
0.5781872868537903,
-0.4451983571052551,
0.2786482274532318,
0.1542271375656128,
-0.8368197083473206,
-0.3508968949317932,
0.26050618290901184,
-0.1234496459364891,
0.5241499543190002,
0.31... |
func (c *ALIModelContext) LinkToVPC() *alitasks.VPC {
return &alitasks.VPC{Name: s(c.GetNameForVPC())}
} | [
1.0529354810714722,
-0.5189933776855469,
0.39297133684158325,
-0.13248959183692932,
0.8772240877151489,
0.49013158679008484,
0.07420698553323746,
-1.4090056419372559,
1.5024501085281372,
-0.0705052837729454,
-0.053270041942596436,
0.2441534399986267,
0.010544459335505962,
-0.52234321832656... |
func (c *ALIModelContext) LinkToSecurityGroup(role kops.InstanceGroupRole) *alitasks.SecurityGroup {
return &alitasks.SecurityGroup{Name: s(c.GetNameForSecurityGroup(role))}
} | [
0.23780086636543274,
0.30051013827323914,
0.08026338368654251,
-0.6744027733802795,
0.1098707839846611,
0.47939327359199524,
0.5509506464004517,
-0.4894586503505707,
0.8540982007980347,
0.009387565776705742,
-0.3195273280143738,
0.27349111437797546,
-0.23406870663166046,
0.3529815375804901... |
func (c *ALIModelContext) LinkToVSwitch(subnetName string) *alitasks.VSwitch {
return &alitasks.VSwitch{Name: s(c.GetNameForVSwitch(subnetName))}
} | [
0.12317503988742828,
-0.34310850501060486,
0.18193663656711578,
0.4248611330986023,
0.42006027698516846,
0.3783526122570038,
-0.36593693494796753,
-0.4402925372123718,
0.7361871600151062,
-0.5502662062644958,
-0.5321835875511169,
0.7502313852310181,
0.7902416586875916,
-0.16202665865421295... |
func (c *ALIModelContext) LinkLoadBalancer() *alitasks.LoadBalancer {
return &alitasks.LoadBalancer{Name: s(c.GetNameForLoadBalancer())}
} | [
0.7660685777664185,
-0.40291035175323486,
0.3063861131668091,
0.27313703298568726,
0.011449637822806835,
0.9233880639076233,
-0.3342324197292328,
-0.7744216918945312,
1.0896497964859009,
-0.9062610864639282,
-0.07610718160867691,
-0.02822570502758026,
-0.013892645947635174,
1.0150250196456... |
func (c *ALIModelContext) CloudTagsForInstanceGroup(ig *kops.InstanceGroup) (map[string]string, error) {
labels := make(map[string]string)
// Apply any user-specified global labels first so they can be overridden by IG-specific labels
for k, v := range c.Cluster.Spec.CloudLabels {
labels[k] = v
}
// Apply any ... | [
-0.6573630571365356,
-0.10076508671045303,
0.5311805605888367,
-0.7199601531028748,
-0.1124470978975296,
-0.2726919651031494,
-0.5245375037193298,
-0.5947048664093018,
-0.771442711353302,
0.7040138244628906,
0.13004252314567566,
0.40448781847953796,
-0.550801157951355,
1.180179476737976,
... |
func NewGroup(bootles []Bottle, water uint32) Group {
return Group{
Water: water,
Bottles: bootles,
}
} | [
-0.3579437732696533,
0.3580968976020813,
0.09894442558288574,
0.21496255695819855,
-0.4129810333251953,
0.5136661529541016,
0.12829923629760742,
-1.119918704032898,
-0.7596614360809326,
-0.5016162395477295,
0.6533414125442505,
0.09644873440265656,
-0.5942381620407104,
0.20271161198616028,
... |
func CreateBottleGroup(waterVolume uint32, volumes ...uint32) Group {
bottles := make([]Bottle, len(volumes))
for i, v := range volumes {
bottles[i] = NewBottle(v)
}
return NewGroup(bottles, waterVolume)
} | [
-0.4795547127723694,
0.4744758605957031,
0.4238368570804596,
-0.6509128212928772,
0.49438154697418213,
0.8248451352119446,
-0.2873281240463257,
-1.1864334344863892,
-0.9605628252029419,
-0.5061730146408081,
-0.15955141186714172,
0.5019114017486572,
-0.7421276569366455,
0.4163588285446167,
... |
func (g Group) UseBottles() (int, []Bottle, error) {
mapBottles := make(map[int][]Bottle)
// generate a copy of bottles
bottles := make([]Bottle, len(g.Bottles))
copy(bottles, g.Bottles)
g.addBottle(mapBottles, []Bottle{}, bottles, len(g.Bottles))
waterRest := math.MaxInt64
for rest := range mapBottles {
if... | [
-1.5168254375457764,
-0.22490078210830688,
0.8630677461624146,
-0.3476417362689972,
0.35441017150878906,
-0.1340969204902649,
0.6170377731323242,
-0.64554762840271,
-0.5423661470413208,
-0.14013801515102386,
0.12845773994922638,
0.10854104161262512,
-0.7805496454238892,
0.4980229437351227,... |
func mapBottles(bottles []Bottle) map[uint32]int {
bottleMap := make(map[uint32]int, len(bottles))
for _, bottle := range bottles {
_, ok := bottleMap[bottle.VolumeML]
if !ok {
bottleMap[bottle.VolumeML] = 1
continue
}
bottleMap[bottle.VolumeML]++
}
return bottleMap
} | [
-1.31865394115448,
-0.6148905754089355,
0.687199592590332,
0.039699964225292206,
-0.26463186740875244,
0.5065440535545349,
0.43515974283218384,
-0.2505846917629242,
0.3171789050102234,
-0.05052001401782036,
-0.5573415160179138,
-0.5568065643310547,
-0.15654206275939941,
0.1947963684797287,... |
func (g Group) valid(bottle Bottle, combo []Bottle) bool {
myMap := mapBottles(g.Bottles)
v, ok := myMap[bottle.VolumeML]
if !ok || v <= 0 {
return false
}
myMap[bottle.VolumeML]--
for _, bottle := range combo {
v, ok := myMap[bottle.VolumeML]
if !ok || v <= 0 {
return false
}
myMap[bottle.VolumeML... | [
-0.7545050382614136,
-1.5557750463485718,
0.7888215184211731,
0.4453771412372589,
-0.30254092812538147,
1.2372997999191284,
-0.11872792989015579,
0.23316600918769836,
-1.0661207437515259,
0.2407836765050888,
0.5406308770179749,
-0.22143672406673431,
-0.5764616131782532,
-0.2894389629364013... |
func removeBottle(bottleToRemove Bottle, bootles []Bottle) []Bottle {
for i, bottle := range bootles {
if bottle.VolumeML == bottleToRemove.VolumeML {
bootles[i] = bootles[len(bootles)-1]
bootles = bootles[:len(bootles)-1]
return bootles
}
}
return bootles
} | [
-0.4858188331127167,
-0.6615811586380005,
0.8195481896400452,
1.2087726593017578,
0.42294105887413025,
-0.4215916395187378,
-0.5097508430480957,
0.48912501335144043,
-0.27629315853118896,
0.8734639286994934,
0.011109455488622189,
0.1180078387260437,
-1.2927335500717163,
-0.5590070486068726... |
func volume(bottles []Bottle) int {
result := 0
for _, b := range bottles {
result += int(b.VolumeML)
}
return result
} | [
-0.8369964361190796,
-0.49916499853134155,
0.530388355255127,
0.326642781496048,
0.57988440990448,
-0.24905072152614594,
0.24595679342746735,
-0.012967845425009727,
-0.4271789789199829,
-0.0757109522819519,
-0.19907817244529724,
-0.45573315024375916,
-0.4664342403411865,
0.4818461537361145... |
func (t *myChaincode) Init(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {
if len(args) != 1 {
return nil, errors.New("Incorrect number of arguments. Expecting 1")
}
return nil, nil
} | [
-0.8012548089027405,
-0.3382333517074585,
0.5059767365455627,
0.22310493886470795,
0.011829442344605923,
-0.5548909306526184,
-0.1896371990442276,
0.09451083838939667,
-0.8977193832397461,
-0.26257985830307007,
-0.21884307265281677,
0.9930719137191772,
-1.0497682094573975,
0.56103175878524... |
func (t *myChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {
switch function {
case "create":
if len(args) < 4{
return nil, errors.New("create operation must include at last four arguments, a uuid , a from , a to and timestamp")
}
... | [
-0.4959160089492798,
0.35836929082870483,
0.9744677543640137,
0.05405624583363533,
0.37350642681121826,
-0.2209669053554535,
-0.1710277646780014,
0.13722145557403564,
-0.7562747001647949,
0.34554967284202576,
-0.20333647727966309,
0.9927399754524231,
-0.4111676812171936,
0.3020658195018768... |
func (t *myChaincode) Query(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {
switch function {
case "myhistory":
if len(args) < 2{
return nil, errors.New("myhistory operation must include at last two arguments, owner, flag(and time s)")
}
... | [
-0.6441218256950378,
0.134562686085701,
0.8794436454772949,
0.576316237449646,
-0.262857586145401,
-0.6300890445709229,
-0.3657439351081848,
-0.26957136392593384,
-0.3147783577442169,
0.022051788866519928,
0.47296586632728577,
0.8285152912139893,
-0.595028281211853,
0.5782349705696106,
-... |
func chunkArrayOfStrings(targetGroupArns []*string, chunkSize int) (chunkedTargetGroupArns [][]*string) {
for i := 0; i < len(targetGroupArns); i += chunkSize {
end := i + chunkSize
if end > len(targetGroupArns) {
end = len(targetGroupArns)
}
chunkedTargetGroupArns = append(chunkedTargetGroupArns, targetGro... | [
-0.9126572012901306,
-1.1148180961608887,
0.5436120629310608,
-1.3716583251953125,
0.24296721816062927,
-0.5435643792152405,
0.3393095135688782,
-0.9208740592002869,
-0.097004234790802,
0.5938575267791748,
1.7577834129333496,
1.2373627424240112,
-0.6658556461334229,
0.04667436331510544,
... |
func (iface tagsInterface) getTargetGroups(resources []*tagsData, targetGroupArns []*string, albArns []*string) (filteredResources []*tagsData, err error) {
ctx := context.Background()
pageNum := 0
// You cannot describe more than '20' target groups at a time
// It feels like pageSize would handle this but it does ... | [
-0.4534353017807007,
-0.23411491513252258,
0.6991170048713684,
-0.9755266308784485,
-0.13479457795619965,
-0.6369905471801758,
-0.5331511497497559,
-0.8190827369689941,
-0.20226173102855682,
0.3294413983821869,
0.9117217063903809,
0.4991970658302307,
0.4339655637741089,
0.3683982491493225,... |
func (iface tagsInterface) getTaggedAutoscalingGroups(job job, region string) (resources []*tagsData, err error) {
ctx := context.Background()
pageNum := 0
return resources, iface.asgClient.DescribeAutoScalingGroupsPagesWithContext(ctx, &autoscaling.DescribeAutoScalingGroupsInput{},
func(page *autoscaling.Describe... | [
-0.6809841394424438,
0.32495033740997314,
0.35345715284347534,
-1.1317602396011353,
-0.3705099821090698,
-0.8551045060157776,
-0.8176447749137878,
-0.6101694703102112,
-1.2908389568328857,
0.42311859130859375,
-0.1457197070121765,
0.4059325158596039,
-0.2867948114871979,
1.16575026512146,
... |
func (iface tagsInterface) getTaggedApiGateway() (*apigateway.GetRestApisOutput, error) {
ctx := context.Background()
apiGatewayAPICounter.Inc()
var limit int64 = 500 // max number of results per page. default=25, max=500
const maxPages = 10
input := apigateway.GetRestApisInput{Limit: &limit}
output := apigateway... | [
-0.3318158984184265,
0.6713017821311951,
0.7256929874420166,
-0.7562319040298462,
0.398070365190506,
-0.6663671135902405,
-0.00033938715932890773,
-0.5652536749839783,
0.04837968945503235,
-0.12580318748950958,
-0.43753886222839355,
0.36952918767929077,
-1.1520122289657593,
0.7332313656806... |
func SubmitNotificationWithUserCategory(ctx context.Context, client cl.Client, users UserCategory, prefix string, pack NotificationPackage) {
notification := NotificationPackageToNotification(pack)
var wg sync.WaitGroup
errchan := make(chan error)
for ns := range users[prefix].Iter() {
wg.Add(1)
notificationTas... | [
-0.37335532903671265,
0.4770326614379883,
0.5571886301040649,
0.7196165323257446,
-0.1733071655035019,
0.15247087180614471,
0.4252030849456787,
-0.34147271513938904,
-0.12310212850570679,
0.8883965015411377,
-0.6316044330596924,
0.12492488324642181,
0.6368032693862915,
0.8716618418693542,
... |
func SubmitNotificationWithUser(ctx context.Context, client cl.Client, target string, pack NotificationPackage) {
notification := NotificationPackageToNotification(pack)
notificationTask := NewNotificationTask(ctx, client, target, []ntf.Notification{notification})
var wg sync.WaitGroup
errchan := make(chan error)
... | [
-0.32838279008865356,
0.33262899518013,
0.6047948002815247,
1.0305230617523193,
-0.16374912858009338,
0.5185192227363586,
0.18070048093795776,
-0.5240165591239929,
-0.6195662021636963,
0.2661714553833008,
-0.6699437499046326,
0.3540351688861847,
0.22293898463249207,
0.5346607565879822,
0... |
func Run() {
loading.Prefix = loadingMsgProcess
loading.Start()
var review []*Review
lineCh := make(chan string, 100)
go readFile(inputFile, lineCh)
for line := range lineCh {
index := getIndexPosition(line, delimiter)
if index != -1 {
r, err := unmarshal(line[index:])
if err != nil {
log.Fatalf... | [
-0.07209407538175583,
-0.6821150183677673,
0.8305229544639587,
-0.4799927771091461,
0.19471950829029083,
0.3003135621547699,
0.5146223902702332,
0.7419739961624146,
-1.5085506439208984,
0.02017952688038349,
0.15970221161842346,
-0.09256119281053543,
-1.1874613761901855,
0.3515235185623169,... |
func readFile(path string, lineCh chan string) {
file, err := os.Open(path)
if err != nil {
log.Fatalf("%s => %s", errorMsgWriteOut, err)
}
defer file.Close()
scanner := bufio.NewScanner(file)
for scanner.Scan() {
lineCh <- scanner.Text()
}
if err := scanner.Err(); err != nil {
log.Fatal(err)
}
close(... | [
0.6907771229743958,
-0.5134747624397278,
0.7211526036262512,
-0.47575417160987854,
0.3733694851398468,
1.0437235832214355,
0.11735407263040543,
0.36996230483055115,
-1.907795786857605,
-0.05271584168076515,
0.17781700193881989,
0.20745864510536194,
-0.3133482336997986,
0.6831598877906799,
... |
func unmarshal(jsonStr string) (*Review, error) {
var r Review
if err := json.Unmarshal([]byte(jsonStr), &r); err != nil {
return &Review{}, err
}
return &r, nil
} | [
-0.25072982907295227,
-0.3979840874671936,
0.07460348308086395,
-0.8818824887275696,
-1.3335071802139282,
-0.03251252695918083,
-0.7029470205307007,
-0.2412704974412918,
0.26321277022361755,
0.22677813470363617,
0.5923787355422974,
0.4037952125072479,
-0.6519449949264526,
-1.21052575111389... |
func writeOut(review []*Review, outputFile string) error {
file, err := os.Create(outputFile)
if err != nil {
return err
}
defer file.Close()
w := bufio.NewWriter(file)
_, err = w.WriteString("star\treview\n")
if err != nil {
return err
}
w.Flush()
for _, r := range review {
text := removeNewlines(r.... | [
-0.15633848309516907,
-0.39608141779899597,
0.5490291714668274,
-0.26279908418655396,
-0.7751376628875732,
0.7084749341011047,
-0.2721251845359802,
1.004837989807129,
-0.8712285161018372,
0.35845381021499634,
0.4918162524700165,
-0.06746118515729904,
0.25745224952697754,
0.7760058641433716... |
func removeNewlines(text string) string {
return strings.Replace(text, "\n", " ", -1)
} | [
-0.014113287441432476,
-0.608470618724823,
0.2383488565683365,
-0.04038378968834877,
-1.249423861503601,
0.09051387012004852,
-0.8510440587997437,
0.5311148762702942,
0.7726408839225769,
0.6000031232833862,
-0.22460635006427765,
-0.47711992263793945,
-0.9690864682197571,
0.2358783483505249... |
func removeTabs(text string) string {
return strings.Replace(text, "\t", " ", -1)
} | [
-0.044451214373111725,
-0.40746089816093445,
0.2638852000236511,
-0.039883263409137726,
-1.014341950416565,
0.18604391813278198,
-0.3086708188056946,
0.1971045583486557,
-0.6295859813690186,
0.5996168851852417,
-0.21608439087867737,
-0.706353485584259,
-0.38201963901519775,
-0.477748543024... |
func normaliseStars(star int) int {
if star >= 3 {
return 1
}
return 0
} | [
-1.4783519506454468,
-0.043949007987976074,
0.18418747186660767,
-0.2608897089958191,
-1.4622869491577148,
1.0444586277008057,
-0.00632390147075057,
0.8346831202507019,
0.8695287704467773,
0.47446057200431824,
-0.6738817095756531,
-0.22162598371505737,
-0.8501662015914917,
0.06177152693271... |
func getIndexPosition(str, substr string) int {
return strings.Index(str, substr)
} | [
0.2526529133319855,
-0.9251866936683655,
0.3233596384525299,
0.043243080377578735,
-0.8053258657455444,
-0.0127587104216218,
0.6220840811729431,
0.3985041081905365,
-0.8177138566970825,
0.07971307635307312,
-0.4390912652015686,
0.026011791080236435,
-0.3956400156021118,
-0.819015383720398,... |
func GeocodingHandler(metaCtor api.MetadataStorageCtor, dataCtor api.DataStorageCtor, sourceFolder string) func(http.ResponseWriter, *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
// get dataset name
dataset := pat.Param(r, "dataset")
storageName := model.NormalizeDatasetID(dataset)
// ... | [
-0.21181350946426392,
-0.009120984002947807,
0.7251599431037903,
-0.1559642255306244,
-0.3249562680721283,
0.4405730962753296,
-0.03222014009952545,
0.4931083619594574,
-0.22119730710983276,
1.2720967531204224,
0.155406191945076,
-0.06563413888216019,
-0.05498209595680237,
0.51295900344848... |
func (*Http1ProtocolOptions_HeaderKeyFormat) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_)(nil),
}
} | [
-0.9578941464424133,
-0.13593652844429016,
0.18977110087871552,
0.34231555461883545,
-0.09834083169698715,
-0.48656290769577026,
-0.3327782452106476,
-1.1420063972473145,
0.8561084866523743,
0.8059561252593994,
0.23992161452770233,
-0.21181456744670868,
-1.1322269439697266,
0.7239738702774... |
func NewGenerator(iterations int, concurrency int) *Generator {
return &Generator{
concurrency: uint32(concurrency),
inputChan: make(chan bool),
lock: &sync.Mutex{},
maxItems: uint32(iterations),
patterns: []Pattern{},
}
} | [
-0.005876163020730019,
0.039018675684928894,
0.3937561810016632,
-0.26959049701690674,
-1.0682154893875122,
0.04409562423825264,
0.5811071991920471,
0.3039102256298065,
0.40436553955078125,
-0.39958420395851135,
0.21932964026927948,
0.13220557570457458,
-0.8807439208030701,
0.0247658286243... |
func (g *Generator) AddPattern(p *Pattern) {
g.lock.Lock()
defer g.lock.Unlock()
g.patterns = append(g.patterns, *p)
} | [
-1.061830759048462,
0.6864713430404663,
0.32756736874580383,
0.31124624609947205,
0.34478211402893066,
1.1910309791564941,
-0.11328711360692978,
0.5426673293113708,
0.26701438426971436,
-1.1086021661758423,
-0.8025646209716797,
0.10426180064678192,
-0.8769131898880005,
0.7209304571151733,
... |
func (g *Generator) Execute() {
g.lock.Lock()
defer g.lock.Unlock()
// Check if any patterns have been added to the Generator
if len(g.patterns) == 0 {
return
}
// pSum is the sum of the scores of all patterns
pSum := 0
for _, p := range g.patterns {
pSum += p.Probability
}
var wg = sync.WaitGroup{}
fo... | [
-0.15807406604290009,
0.19737522304058075,
0.958522617816925,
-0.08935298025608063,
0.7496793866157532,
0.3134632706642151,
0.5276694297790527,
0.09190140664577484,
-1.0757865905761719,
0.42617425322532654,
-0.12150641530752182,
-0.9039797186851501,
-1.1235417127609253,
0.2701924443244934,... |
func (rf *Raft) GetState() (int, bool) {
rf.mu.Lock()
defer rf.mu.Unlock()
var term int
var isleader bool
// Your code here (2A).
isleader = false
if rf.status == 2 {
isleader = true
}
term = rf.currentTerm
return term, isleader
} | [
-0.06594694405794144,
-0.3828895092010498,
0.756390392780304,
0.5216606855392456,
-0.6451526284217834,
-0.6291021704673767,
0.26098117232322693,
0.20395611226558685,
-0.36937862634658813,
-0.025447312742471695,
-0.7794788479804993,
0.8207786083221436,
-1.0138388872146606,
0.565507233142852... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.