text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (of *Offspring) RelativeFitness() float64 {
return float64(of.Fitness) / float64( of.MaxFitness() )
} | [
0.6294220685958862,
-0.1679658442735672,
0.6371756792068481,
1.0198848247528076,
-1.1761689186096191,
0.6203673481941223,
0.1522129327058792,
-0.28099024295806885,
-0.6732035875320435,
-0.17060904204845428,
-0.40204352140426636,
-0.5111352205276489,
-0.8608329892158508,
-0.0298012588173151... |
func (of *Offspring) Overman() bool {
return of.Fitness == of.MaxFitness()
} | [
-0.9267212152481079,
-0.3793335258960724,
0.521501362323761,
0.16124150156974792,
-0.28521305322647095,
0.19899100065231323,
-0.5059671401977539,
-0.5301485061645508,
0.04088972508907318,
-1.069358229637146,
-0.01104668714106083,
-0.18897728621959686,
-0.7269222140312195,
0.172365367412567... |
func (of *Offspring) Report() string {
return fmt.Sprintf("%04d: %s --- score: %4.2f%% (%d/%d)", of.Generation,
string(of.Phrase), of.RelativeFitness()*100, of.Fitness, of.MaxFitness() )
} | [
-0.12839245796203613,
-0.4412823021411896,
0.8398130536079407,
-0.6154207587242126,
0.0006848154007457197,
0.5173419117927551,
-0.011072353459894657,
-0.5900007486343384,
-0.8769010305404663,
-0.12478145956993103,
0.2089720070362091,
-0.615852952003479,
-0.16628104448318481,
-0.12460479140... |
func NewOffspringSlice(length int) OffspringSlice {
return OffspringSlice( make([]*Offspring, length) )
} | [
-0.5102924704551697,
-0.6864365339279175,
0.2375207096338272,
0.13215406239032745,
-1.601216197013855,
1.0483993291854858,
-0.2881503403186798,
0.0742092877626419,
-0.0616610050201416,
-0.22644008696079254,
0.03328979015350342,
0.12448067963123322,
-0.4215013384819031,
0.9432787895202637,
... |
func (s OffspringSlice) Len() int {
return len(s)
} | [
-0.16198371350765228,
-0.04382694512605667,
0.08386507630348206,
-0.5289617776870728,
-0.13430321216583252,
-0.49174052476882935,
0.5652220845222473,
1.0438251495361328,
0.44293344020843506,
-0.08549033105373383,
-0.9123765230178833,
0.6814015507698059,
0.3374920189380646,
0.17373509705066... |
func (s OffspringSlice) Less(i, j int) bool {
return s[i].Fitness < s[j].Fitness
} | [
-0.3598742187023163,
-0.1508059799671173,
0.40920257568359375,
0.016997797414660454,
-0.5309805870056152,
0.027270980179309845,
-0.6310576796531677,
-0.807749330997467,
-0.3821435570716858,
-0.23699717223644257,
-0.10104677826166153,
0.2149568647146225,
-0.18322142958641052,
0.142942026257... |
func (s OffspringSlice) Swap(i, j int) {
s[i], s[j] = s[j], s[i]
} | [
-1.331045389175415,
-0.49303877353668213,
0.23721010982990265,
-0.33200088143348694,
-0.32442378997802734,
0.5374744534492493,
-0.04237011447548866,
0.5263037085533142,
-0.14169687032699585,
0.15054269134998322,
-0.3406921923160553,
1.2171522378921509,
0.4696589708328247,
-0.64224129915237... |
func (client *Client) SegmentSky(request *SegmentSkyRequest) (response *SegmentSkyResponse, err error) {
response = CreateSegmentSkyResponse()
err = client.DoAction(request, response)
return
} | [
-1.2478725910186768,
0.04606819525361061,
0.4534560441970825,
1.060157060623169,
0.596392035484314,
-1.0040287971496582,
1.4861512184143066,
-0.8950199484825134,
1.4214051961898804,
0.21653907001018524,
-0.6628791689872742,
0.616934061050415,
-0.6271376013755798,
0.6352911591529846,
-0.3... |
func (client *Client) SegmentSkyWithChan(request *SegmentSkyRequest) (<-chan *SegmentSkyResponse, <-chan error) {
responseChan := make(chan *SegmentSkyResponse, 1)
errChan := make(chan error, 1)
err := client.AddAsyncTask(func() {
defer close(responseChan)
defer close(errChan)
response, err := client.SegmentSk... | [
-0.6251328587532043,
-0.7830394506454468,
0.7758830785751343,
-0.263404905796051,
0.45019280910491943,
-0.3490889370441437,
0.8640427589416504,
-1.3719896078109741,
0.9901667237281799,
0.28319886326789856,
-0.11038405448198318,
0.7343501448631287,
-0.5095257759094238,
0.665848970413208,
... |
func (client *Client) SegmentSkyWithCallback(request *SegmentSkyRequest, callback func(response *SegmentSkyResponse, err error)) <-chan int {
result := make(chan int, 1)
err := client.AddAsyncTask(func() {
var response *SegmentSkyResponse
var err error
defer close(result)
response, err = client.SegmentSky(req... | [
-0.46885979175567627,
-0.29948872327804565,
0.9828911423683167,
-0.090397909283638,
0.3241611123085022,
-0.818407416343689,
1.109374761581421,
-1.1189872026443481,
1.7406741380691528,
0.3842807710170746,
0.15116611123085022,
-0.5130002498626709,
0.04472056403756142,
0.6722952723503113,
0... |
func CreateSegmentSkyRequest() (request *SegmentSkyRequest) {
request = &SegmentSkyRequest{
RpcRequest: &requests.RpcRequest{},
}
request.InitWithApiInfo("imageseg", "2019-12-30", "SegmentSky", "", "")
request.Method = requests.POST
return
} | [
-0.39214980602264404,
-0.5141609311103821,
0.8212620615959167,
0.2947670519351959,
0.6702334880828857,
-0.2927002012729645,
0.0940973237156868,
-0.3570776879787445,
0.23177088797092438,
0.2375228852033615,
-0.26997238397598267,
0.6635316610336304,
-0.1146877110004425,
1.7467012405395508,
... |
func CreateSegmentSkyResponse() (response *SegmentSkyResponse) {
response = &SegmentSkyResponse{
BaseResponse: &responses.BaseResponse{},
}
return
} | [
-0.4250752925872803,
-1.524114966392517,
0.3640398383140564,
0.1271013766527176,
0.5137300491333008,
-0.5196911692619324,
0.8164977431297302,
-0.7941684126853943,
1.5136522054672241,
0.06383858621120453,
-0.63193678855896,
-0.5935181975364685,
-0.4542086720466614,
1.1333717107772827,
0.1... |
func NewController() Controller {
return &controller{
iManager: instance.Mgr,
pManager: policy.Mgr,
scheduler: scheduler.Sched,
executionMgr: task.NewExecutionManager(),
}
} | [
0.6209090352058411,
-0.07242962718009949,
0.2526381313800812,
0.3629041016101837,
-0.39228156208992004,
0.388849139213562,
-0.3406272232532501,
0.07493903487920761,
0.342728853225708,
-0.34156230092048645,
0.33955147862434387,
0.41180479526519775,
-0.003498048521578312,
0.7448667287826538,... |
func (c *controller) CountPolicy(ctx context.Context, query *q.Query) (int64, error) {
return c.pManager.Count(ctx, query)
} | [
0.4414031207561493,
-0.3467932939529419,
0.34004250168800354,
-0.02734392322599888,
0.21718692779541016,
1.2361270189285278,
-0.2617487609386444,
0.03315211087465286,
0.544295072555542,
0.2923910319805145,
0.04434593394398689,
-0.18234474956989288,
0.3676185607910156,
0.5983660817146301,
... |
func (c *controller) CreatePolicy(ctx context.Context, schema *policyModels.Schema) (id int64, err error) {
if schema == nil {
return 0, errors.New("nil policy schema provided")
}
// Update timestamps
now := time.Now()
schema.CreatedAt = now
schema.UpdatedTime = now
// Get full model of policy schema
err = ... | [
-0.11397203803062439,
-0.11138110607862473,
0.993400514125824,
0.29061359167099,
0.5601261258125305,
0.429094523191452,
0.20975413918495178,
0.6794989705085754,
0.5485559701919556,
0.3814608156681061,
-0.39565402269363403,
-0.0025363133754581213,
-0.7884171605110168,
0.837225079536438,
0... |
func (c *controller) GetPolicy(ctx context.Context, id int64) (*policyModels.Schema, error) {
return c.pManager.Get(ctx, id)
} | [
0.11006802320480347,
0.4156675934791565,
0.32440295815467834,
0.3851211965084076,
0.61149001121521,
0.2790476679801941,
-0.4686252474784851,
-0.2107536643743515,
1.052817940711975,
-0.2791566550731659,
-0.022821536287665367,
0.360453337430954,
-0.05504768714308739,
0.08051391690969467,
-... |
func (c *controller) GetPolicyByName(ctx context.Context, projectID int64, name string) (*policyModels.Schema, error) {
return c.pManager.GetByName(ctx, projectID, name)
} | [
0.34338754415512085,
0.2499091476202011,
0.11778359115123749,
-0.22220860421657562,
-0.19547688961029053,
0.11193392425775528,
-0.5218548774719238,
-0.8563982248306274,
-0.19296766817569733,
0.5592707395553589,
-0.3222956359386444,
-0.19295695424079895,
-0.518801212310791,
0.25929549336433... |
func (c *controller) UpdatePolicy(ctx context.Context, schema *policyModels.Schema, props ...string) error {
if schema == nil {
return errors.New("nil policy schema provided")
}
// Get policy cache
s0, err := c.pManager.Get(ctx, schema.ID)
if err != nil {
return err
}
// Double check trigger
if s0.Trigger... | [
-0.48205357789993286,
-0.5399051904678345,
1.0046392679214478,
0.4512363076210022,
-0.0004168720915913582,
0.3275822103023529,
0.2594709098339081,
0.8919229507446289,
0.377314031124115,
0.7824220657348633,
-0.1523216813802719,
0.26447221636772156,
-0.1760890930891037,
0.6612812876701355,
... |
func (c *controller) DeletePolicy(ctx context.Context, id int64) error {
s, err := c.pManager.Get(ctx, id)
if err != nil {
return err
}
if s.Trigger != nil && s.Trigger.Type == policyModels.TriggerTypeScheduled && len(s.Trigger.Settings.Cron) > 0 {
err = c.scheduler.UnScheduleByVendor(ctx, job.P2PPreheatVendorT... | [
0.15673941373825073,
-0.2136704921722412,
0.6159662008285522,
0.22445809841156006,
0.593535304069519,
0.07967149466276169,
0.04331944137811661,
0.06475081294775009,
0.9779415130615234,
-0.4090302884578705,
0.24004076421260834,
0.28931668400764465,
-0.24099001288414001,
1.2795898914337158,
... |
func (c *controller) DeletePoliciesOfProject(ctx context.Context, project int64) error {
policies, err := c.ListPoliciesByProject(ctx, project, nil)
if err != nil {
return err
}
for _, p := range policies {
if err = c.DeletePolicy(ctx, p.ID); err != nil {
return err
}
}
return nil
} | [
0.11040141433477402,
-0.13795031607151031,
0.2995087802410126,
-0.01701350510120392,
0.14944562315940857,
0.7861579656600952,
0.3720308840274811,
-0.9911931157112122,
0.7425423860549927,
0.27042531967163086,
0.5543361306190491,
-0.4642692506313324,
-0.7060560584068298,
0.7866555452346802,
... |
func (c *controller) ListPolicies(ctx context.Context, query *q.Query) ([]*policyModels.Schema, error) {
return c.pManager.ListPolicies(ctx, query)
} | [
-0.5237043499946594,
-0.20916739106178284,
0.28007349371910095,
-0.20103193819522858,
0.07132081687450409,
0.6518440842628479,
-1.2343270778656006,
-0.4673781096935272,
1.3988656997680664,
-0.3010212182998657,
0.6512282490730286,
-0.18287739157676697,
-0.3953419625759125,
0.486373037099838... |
func (c *controller) ListPoliciesByProject(ctx context.Context, project int64, query *q.Query) ([]*policyModels.Schema, error) {
return c.pManager.ListPoliciesByProject(ctx, project, query)
} | [
-0.5192729234695435,
-0.14540627598762512,
0.21705420315265656,
-0.07125496864318848,
-0.3072035610675812,
0.6337562203407288,
-0.5712270140647888,
-0.8682315945625305,
1.0020208358764648,
0.19641569256782532,
0.49625125527381897,
-0.2522873282432556,
-0.4307125508785248,
0.57118821144104,... |
func (c *controller) CheckHealth(ctx context.Context, instance *providerModels.Instance) error {
if instance == nil {
return errors.New("instance can not be nil")
}
fac, ok := provider.GetProvider(instance.Vendor)
if !ok {
return errors.Errorf("no driver registered for provider %s", instance.Vendor)
}
// Co... | [
-0.42671218514442444,
-0.027844326570630074,
0.749461829662323,
0.3576175570487976,
0.5719680190086365,
0.7240768671035767,
0.307096004486084,
1.0022867918014526,
0.7673729062080383,
0.4415971040725708,
-0.23810429871082306,
-0.01767222210764885,
-0.21961401402950287,
0.8691160678863525,
... |
func NewBlockingStack() *BlockingStack {
ret := &BlockingStack{
popBlock: make(chan int),
pushBlock: make(chan int),
}
return ret
} | [
-0.25391340255737305,
0.2521401047706604,
0.2923636734485626,
0.9269823431968689,
-1.2608058452606201,
-0.6959465146064758,
0.2888789772987366,
-1.2951349020004272,
-0.5425798296928406,
0.4736712872982025,
-0.72748863697052,
-0.6577183604240417,
-0.753126323223114,
-0.26921898126602173,
... |
func (s *BlockingStack) SetSize(sz int) {
s.maxSize = sz
} | [
0.5690872669219971,
1.213342547416687,
0.2501906156539917,
1.5984272956848145,
-0.5220749974250793,
0.0006684294203296304,
0.875288188457489,
0.3804185092449188,
0.2851066589355469,
0.07151255756616592,
-1.5953171253204346,
-0.7094229459762573,
-1.1986684799194336,
0.9291523098945618,
0.... |
func (s *BlockingStack) Len() int {
return s.size
} | [
0.8649919629096985,
0.9163135886192322,
0.16899555921554565,
0.39039918780326843,
0.254537969827652,
-0.5775901079177856,
1.4677244424819946,
0.13026906549930573,
-0.6116982698440552,
-0.08849111199378967,
-1.6550993919372559,
-0.4422077536582947,
-0.05725277215242386,
0.25461962819099426,... |
func (s *BlockingStack) Top() interface{} {
if s.Len() <= 0 {
return nil
}
return s.top.value
} | [
-0.6339141130447388,
1.2346235513687134,
0.5327919125556946,
1.1712191104888916,
-0.6132166981697083,
-0.560841977596283,
0.13581225275993347,
-0.5298056602478027,
-0.08409704267978668,
0.5202978849411011,
-0.07783610373735428,
-0.4575183093547821,
-0.7488085031509399,
-0.11743655055761337... |
func (s *BlockingStack) Pop() interface{} {
s.popLock.Lock()
defer s.popLock.Unlock()
if s.Len() <= 0 {
s.popBlockState = true
<-s.popBlock
s.popBlockState = false
}
ret := s.top.value
s.top = s.top.prev
s.size--
if s.pushBlockState {
s.pushBlock <- 1
}
return ret
} | [
-0.4437037408351898,
1.0494356155395508,
0.8369183540344238,
0.8424196839332581,
-1.122269630432129,
-0.6285293102264404,
0.8171626329421997,
-0.45943912863731384,
-0.2955043315887451,
0.8738145232200623,
-0.3621315658092499,
-0.9387471079826355,
-0.5555558800697327,
0.10765796899795532,
... |
func (s *BlockingStack) Push(v interface{}) {
s.pushLock.Lock()
defer s.pushLock.Unlock()
if s.Len() >= s.maxSize {
s.pushBlockState = true
<-s.pushBlock
s.pushBlockState = false
}
s.top = &BlockingstackElement{
value: v,
prev: s.top,
}
s.size++
if s.popBlockState {
s.popBlock <- 1
}
} | [
-0.37003663182258606,
1.480839490890503,
0.5116620659828186,
0.7959653735160828,
-0.6471726894378662,
0.054305706173181534,
0.785067617893219,
-0.5454034209251404,
0.4482857584953308,
0.8197562098503113,
-0.7766222953796387,
0.2145499289035797,
-0.23397187888622284,
0.6534538269042969,
1... |
func (r *AccessTokenResponse) AsRedirectURL(redirectURL string, extraParams url.Values) string {
extraParams.Set("access_token", r.Token)
extraParams.Set("token_type", r.TokenType)
extraParams.Set("expires_in", strconv.Itoa(r.ExpiresIn))
extraParams.Set("refresh_token", r.RefreshToken)
return redirectURL + "#" + ... | [
0.41512882709503174,
-0.44994157552719116,
0.4212084710597992,
-0.7258409857749939,
-0.41492679715156555,
0.798730731010437,
-1.0436038970947266,
-0.18077528476715088,
0.9989993572235107,
-0.15289655327796936,
0.3474365770816803,
0.15390734374523163,
0.6326663494110107,
-0.3213094770908355... |
func (a *API) Token(w http.ResponseWriter, r *http.Request) error {
ctx := r.Context()
grantType := r.FormValue("grant_type")
switch grantType {
case "password":
return a.ResourceOwnerPasswordGrant(ctx, w, r)
case "refresh_token":
return a.RefreshTokenGrant(ctx, w, r)
case "id_token":
return a.IdTokenGrant... | [
-0.7331694960594177,
-0.78761225938797,
0.612935483455658,
0.5542136430740356,
0.12163189798593521,
-0.14365370571613312,
0.4745253622531891,
-0.1994219720363617,
0.5637003779411316,
-0.37788456678390503,
0.5070387721061707,
0.6831793785095215,
0.22995205223560333,
0.4104388654232025,
0.... |
func (a *API) ResourceOwnerPasswordGrant(ctx context.Context, w http.ResponseWriter, r *http.Request) error {
db := a.db.WithContext(ctx)
params := &PasswordGrantParams{}
body, err := getBodyBytes(r)
if err != nil {
return badRequestError("Could not read body").WithInternalError(err)
}
if err := json.Unmarsh... | [
-0.25145599246025085,
0.20141620934009552,
0.9610835313796997,
0.6234241724014282,
-0.7551890015602112,
0.34127873182296753,
0.029450833797454834,
-0.39311301708221436,
0.5727224946022034,
0.3388465344905853,
0.7656415700912476,
0.13822539150714874,
-0.7180014848709106,
0.6841048002243042,... |
func (a *API) RefreshTokenGrant(ctx context.Context, w http.ResponseWriter, r *http.Request) error {
db := a.db.WithContext(ctx)
config := a.config
params := &RefreshTokenGrantParams{}
body, err := getBodyBytes(r)
if err != nil {
return badRequestError("Could not read body").WithInternalError(err)
}
if err ... | [
-0.05112120881676674,
-0.8776559233665466,
0.8287677764892578,
0.5419362783432007,
-1.1138005256652832,
-0.2025606781244278,
-0.19961769878864288,
-0.5201138854026794,
0.10559409111738205,
0.8096792697906494,
0.4882509410381317,
0.8921740651130676,
-0.033779438585042953,
-0.185513824224472... |
func (a *API) IdTokenGrant(ctx context.Context, w http.ResponseWriter, r *http.Request) error {
db := a.db.WithContext(ctx)
config := a.config
log := observability.GetLogEntry(r)
params := &IdTokenGrantParams{}
body, err := getBodyBytes(r)
if err != nil {
return badRequestError("Could not read body").WithInte... | [
-0.7457922697067261,
-0.7401764988899231,
0.7255418300628662,
-0.36618685722351074,
-1.138311743736267,
0.32113030552864075,
-0.4103708565235138,
-0.17868082225322723,
-0.09293612837791443,
0.35035914182662964,
0.43542739748954773,
0.8979841470718384,
-1.1067379713058472,
0.170281842350959... |
func (a *API) setCookieTokens(config *conf.GlobalConfiguration, token *AccessTokenResponse, session bool, w http.ResponseWriter) error {
// don't need to catch error here since we always set the cookie name
_ = a.setCookieToken(config, "access-token", token.Token, session, w)
_ = a.setCookieToken(config, "refresh-to... | [
-0.37585052847862244,
-0.8202197551727295,
0.3285468816757202,
-0.28646188974380493,
-0.34607747197151184,
-0.6237581372261047,
-0.20985081791877747,
-0.4874414801597595,
0.01096322201192379,
0.4748211205005646,
-0.7236588597297668,
0.5239233374595642,
0.18128450214862823,
-0.0292750075459... |
func RedirectHandler(c *fiber.Ctx) {
provider := c.Params("provider")
if provider != "google" && provider != "facebook" {
errors.SendErrors(c, http.StatusUnprocessableEntity, &[]string{"unsupported provider"})
}
cfg := config.GetInstance()
providerSecrets := map[string]map[string]string{
"facebook": {
"clie... | [
-0.8472604751586914,
-0.09382765740156174,
0.6021155714988708,
0.8973772525787354,
0.05708871781826019,
1.0595347881317139,
1.2212352752685547,
-0.11418145895004272,
0.6951907277107239,
0.3316102921962738,
0.12378578633069992,
0.722562849521637,
-0.08063383400440216,
-0.06058180704712868,
... |
func writeTemplate(dirToWrite, dirType, parentDir, templateName string) error {
fmt.Printf("\n\n\nAbsolute Directory: %v\nDirrectory Type: %v\nParent Dir: %v\nName of template: %v\n\n\n", dirToWrite, dirType, parentDir, templateName)
// Open index file in components directory and read data
data, err := getIndexDat... | [
-0.9351400136947632,
-0.576286792755127,
0.7285614013671875,
-0.48334428668022156,
0.924146831035614,
0.07850910723209381,
0.7665244936943054,
0.06532901525497437,
0.0407235324382782,
0.11741054058074951,
-0.5931371450424194,
0.06345701217651367,
-0.15194372832775116,
0.1318354308605194,
... |
func getProcessPidAndPort(t *testing.T) (int32, uint32) {
cc, err := net.Connections("")
if err != nil {
t.Fatalf("failed to get the connections with err: %v", err)
return 0, 0
}
if len(cc) == 0 {
t.Skip("no available connection")
return 0, 0
}
c := cc[0]
return c.Pid, c.Laddr.Port
} | [
-0.057187777012586594,
-1.2122701406478882,
0.8605195879936218,
-1.110708475112915,
0.5448770523071289,
0.4744943082332611,
0.3697208762168884,
0.45210784673690796,
0.1288796067237854,
0.20850253105163574,
0.1608649045228958,
0.3303298354148865,
-1.1900447607040405,
0.4865562617778778,
1... |
func getProcessPidFromName(t *testing.T) (string, int32) {
pp, err := process.Processes()
if err != nil {
t.Fatalf("failed to get the processes with err: %v", err)
return "", 0
}
p := pp[0]
if len(pp) == 0 {
t.Skip("no available processes")
return "", 0
}
name, err := p.Name()
if err != nil {
t.Fatalf... | [
0.25205275416374207,
-1.8069742918014526,
0.6829661130905151,
-1.096213698387146,
-0.7424477338790894,
0.4416401982307434,
-0.4814622700214386,
0.2069932073354721,
0.7411898374557495,
0.8601084351539612,
-0.20435884594917297,
-0.15227217972278595,
-0.6319377422332764,
0.2425757795572281,
... |
func (op *GetMoreOp) OpCode() OpCode {
return OpCodeGetMore
} | [
0.06857597827911377,
-0.4467563331127167,
0.30002298951148987,
0.7080027461051941,
0.3517022728919983,
-0.5321146845817566,
0.44461268186569214,
-0.7920812368392944,
0.8937631249427795,
-0.2846004366874695,
0.8086325526237488,
0.44805431365966797,
0.22764146327972412,
-0.9898413419723511,
... |
func (op *GetMoreOp) Meta() OpMetadata {
return OpMetadata{"getmore", op.Collection, "", op.CursorId}
} | [
-0.04127896949648857,
0.2849820852279663,
0.38073399662971497,
0.43120017647743225,
0.6517648696899414,
-0.43225452303886414,
-0.6088273525238037,
-0.4927775263786316,
0.0166169460862875,
1.0075972080230713,
-0.1191505491733551,
0.6030452251434326,
0.8270063996315002,
-0.9866140484809875,
... |
func (op *GetMoreOp) Abbreviated(chars int) string {
return fmt.Sprintf("%v", op)
} | [
0.27073758840560913,
-0.5614296197891235,
0.6007291078567505,
-0.9459562301635742,
-1.3055205345153809,
-0.24391545355319977,
-0.19858533143997192,
-0.833797812461853,
0.32160937786102295,
0.7982438802719116,
0.06146218627691269,
0.9593769907951355,
1.134209156036377,
-0.5016832947731018,
... |
func (op *GetMoreOp) getCursorIDs() ([]int64, error) {
return []int64{op.CursorId}, nil
} | [
-0.9567022323608398,
0.339102566242218,
0.2041119486093521,
0.11268439888954163,
0.13015156984329224,
-1.17606782913208,
-0.5898491144180298,
-0.228335440158844,
0.09607560932636261,
1.147096872329712,
-0.27157896757125854,
1.7601600885391235,
-1.4305304288864136,
0.17213872075080872,
0.... |
func (op *GetMoreOp) setCursorIDs(newCursorIDs []int64) error {
var newCursorID int64
if len(newCursorIDs) > 1 {
return fmt.Errorf("rewriting getmore command cursorIDs requires 1 id, received: %d", len(newCursorIDs))
}
if len(newCursorIDs) < 1 {
newCursorID = 0
} else {
newCursorID = newCursorIDs[0]
}
op.... | [
-1.0052490234375,
-0.09274820983409882,
0.41785094141960144,
-0.07508596032857895,
0.23888441920280457,
-1.1518497467041016,
-0.3336281180381775,
0.01158697996288538,
0.2556024193763733,
1.1054965257644653,
-0.35620924830436707,
1.7345850467681885,
-1.0671254396438599,
0.30406856536865234,... |
func (op *GetMoreOp) FromReader(r io.Reader) error {
var b [12]byte
if _, err := io.ReadFull(r, b[:4]); err != nil {
return err
}
name, err := readCStringFromReader(r)
if err != nil {
return err
}
op.Collection = string(name)
if _, err := io.ReadFull(r, b[:12]); err != nil {
return err
}
op.Limit = getI... | [
0.18844576179981232,
-0.21330057084560394,
0.5498806238174438,
-0.3206769824028015,
-0.8336125612258911,
-0.7939255237579346,
-0.08618687838315964,
-0.5358041524887085,
0.4463256597518921,
0.4233863353729248,
-0.5636045336723328,
0.28585851192474365,
-0.12009269744157791,
-0.04030669108033... |
func (op *GetMoreOp) Execute(session *mgo.Session) (Replyable, error) {
session.SetSocketTimeout(0)
before := time.Now()
_, _, data, resultReply, err := mgo.ExecOpWithReply(session, &op.GetMoreOp)
after := time.Now()
mgoReply, ok := resultReply.(*mgo.ReplyOp)
if !ok {
panic("reply from execution was not the c... | [
-0.06948339194059372,
0.5877763032913208,
0.8495823740959167,
-0.6733047962188721,
0.0733124166727066,
-0.7440135478973389,
-0.7670889496803284,
-0.8696678280830383,
0.2188890278339386,
0.9990984201431274,
-0.6002035140991211,
-0.051346346735954285,
-0.571622371673584,
-0.8217599987983704,... |
func (r *memcachedScraper) parseInt(key, value string) (int64, bool) {
i, err := strconv.ParseInt(value, 10, 64)
if err != nil {
r.logInvalid("int", key, value)
return 0, false
}
return i, true
} | [
-0.8116411566734314,
0.31129947304725647,
0.7017061114311218,
-0.7454779744148254,
-0.6647950410842896,
0.22933292388916016,
-0.3464421033859253,
0.1229911521077156,
-0.40618011355400085,
0.5668740272521973,
-0.08191812038421631,
-0.23241566121578217,
-0.7417055368423462,
-0.51331627368927... |
func (r *memcachedScraper) parseFloat(key, value string) (float64, bool) {
i, err := strconv.ParseFloat(value, 64)
if err != nil {
r.logInvalid("float", key, value)
return 0, false
}
return i, true
} | [
0.01500533614307642,
1.0168176889419556,
0.565829873085022,
0.2739819288253784,
-0.5851161479949951,
-0.620640218257904,
-0.43050631880760193,
0.05191758647561073,
-0.7180211544036865,
0.10333868861198425,
0.19498547911643982,
-0.47468632459640503,
-0.8854228854179382,
0.25489357113838196,... |
func ServerHeader(next echo.HandlerFunc) echo.HandlerFunc {
return func(c echo.Context) error {
c.Response().Header().Set(echo.HeaderServer, "Echo/2.0")
return next(c)
}
} | [
-0.4944874346256256,
-0.9446335434913635,
0.5951781272888184,
0.6863285303115845,
-0.5695737600326538,
0.31501859426498413,
0.35930994153022766,
0.05175287276506424,
0.029283741489052773,
0.23809048533439636,
-0.8467652797698975,
0.7764145731925964,
-0.06537142395973206,
0.7942450642585754... |
func init() {
runtime.GOMAXPROCS(runtime.NumCPU())
} | [
0.590313196182251,
0.8557203412055969,
0.29857954382896423,
0.45720648765563965,
0.6900671720504761,
0.009275063872337341,
0.5295087099075317,
0.6771003603935242,
-0.9714723229408264,
-0.1746872067451477,
-0.30694323778152466,
1.129949688911438,
-0.5085458755493164,
0.36655569076538086,
... |
func Decode(body []byte) (B, error) {
return (&Decoder{
r: nil,
//buf: append(body[:0:0], body...),
buf: body,
}).Decode()
} | [
0.23093831539154053,
0.15965864062309265,
0.41520386934280396,
0.5484768152236938,
-0.027688410133123398,
-0.14572183787822723,
-0.8042410612106323,
-0.7330464124679565,
0.8939587473869324,
-0.7535250186920166,
-1.1304203271865845,
0.49231380224227905,
-1.2032822370529175,
1.01903688907623... |
func NewDecoder(r io.Reader) *Decoder {
return &Decoder{
r: r,
buf: nil,
}
} | [
0.5746117830276489,
-1.2591404914855957,
-0.10077840089797974,
-0.43091467022895813,
-1.4850449562072754,
-0.1677781641483307,
-0.3058324456214905,
-0.4760238528251648,
0.4214968681335449,
-1.2643948793411255,
-0.5075697898864746,
-0.5357509255409241,
0.16878420114517212,
1.180483818054199... |
func (d *Decoder) Decode() (b B, e error) {
if d.r != nil {
body, e := ioutil.ReadAll(d.r)
if e != nil {
return b, e
}
d.buf = body
}
d.bufLen = len(d.buf)
d.decode(&b, 1)
return
} | [
-0.24596019089221954,
0.1785845160484314,
0.5800256729125977,
0.43630728125572205,
0.08860626071691513,
-0.7890012264251709,
-0.14626765251159668,
0.1465265452861786,
0.18343588709831238,
-0.8861633539199829,
-0.4677847623825073,
0.20283694565296173,
-0.683562695980072,
0.9502254128456116,... |
func NewMap[I Interval[K], V, K any](cmpK Cmp[K], cmpI Cmp[I]) Map[I, V, K] {
return Map[I, V, K]{
Map: abstract.MakeMap[I, V, config[K], aug[K, I]](
config[K]{compareK: cmpK}, cmpI),
}
} | [
0.20500823855400085,
-0.8003718852996826,
0.4085141122341156,
0.3321758508682251,
-0.4923030436038971,
1.1850237846374512,
0.05754062160849571,
-0.3062075972557068,
-0.09375802427530289,
0.2590971887111664,
0.23808473348617554,
-0.15910392999649048,
0.472167432308197,
-0.3795570135116577,
... |
func (t *Map[I, V, K]) Iterator() Iterator[K, V, I] {
return Iterator[K, V, I]{
Iterator: t.Map.Iterator(),
}
} | [
-0.9512349367141724,
-1.1557085514068604,
0.19602276384830475,
-0.5737718343734741,
-0.7962092757225037,
0.3984699249267578,
0.3884454369544983,
0.4516363739967346,
0.009507845155894756,
0.04042457789182663,
0.18458569049835205,
-0.7006141543388367,
0.368493914604187,
-0.8353719115257263,
... |
func (app *Application) GetCloudConfig(context *gin.Context) {
clientIP := context.ClientIP()
log.Printf("Received cloud-config request from %s", clientIP)
var server *compute.Server
if clientIP != "127.0.0.1" {
remoteMACAddress := arp.Search(clientIP)
if remoteMACAddress == "" {
context.String(http.Statu... | [
0.13438336551189423,
0.7614127993583679,
0.7135606408119202,
0.4043254554271698,
0.15910735726356506,
-0.0587085522711277,
-0.0847446396946907,
0.46219056844711304,
-0.9805024862289429,
0.43778541684150696,
-0.21930710971355438,
0.5085710883140564,
-0.08573487401008606,
1.1318470239639282,... |
func SetNullOutput() {
logrus.SetOutput(ioutil.Discard)
} | [
2.1814749240875244,
-0.9471703171730042,
0.3330634534358978,
-0.67279052734375,
-0.9964595437049866,
-1.0183236598968506,
0.6686319708824158,
-0.1703980267047882,
0.014148542657494545,
-1.0560559034347534,
0.14214502274990082,
0.7938745021820068,
0.5217660665512085,
0.33738958835601807,
... |
func CorporateCreateTicketDecodeRequest(ctx context.Context, r *http.Request) (interface{}, error) {
var req dt.CorporateCreateTicketJSONRequest
var tokenValidation dt.TokenValidation
//token Authorization
var mySigningKey = []byte(conf.Param.TokenAuth)
token, err := request.ParseFromRequest(r, request.Authorizat... | [
-0.6734424233436584,
-0.5828250646591187,
0.8370921015739441,
-0.1085088774561882,
-0.7469599843025208,
0.2859708070755005,
-0.5111448168754578,
-0.04701349139213562,
-0.4094049632549286,
-0.5409265160560608,
0.27868446707725525,
0.5297321677207947,
-0.7701635360717773,
0.7672423720359802,... |
func CorporateCreateTicketEncodeResponse(ctx context.Context, w http.ResponseWriter, response interface{}) error {
var body []byte
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Headers", "Content-Type,Authorization")
body, err := json.Marshal(&response)
logger.Logf("Corpor... | [
0.09425219148397446,
-1.0413386821746826,
0.6982646584510803,
0.6069907546043396,
-0.44365379214286804,
0.22979849576950073,
0.5770909786224365,
0.03340356796979904,
0.578848659992218,
0.0915108248591423,
-0.9857893586158752,
0.14844726026058197,
-0.5309634208679199,
0.7248511910438538,
... |
func CorporateCreateTicketEndpoint(svc services.CorporateCreateTicketServices, dbConn lib.DbConnection) endpoint.Endpoint {
return func(ctx context.Context, request interface{}) (interface{}, error) {
if req, ok := request.(dt.CorporateCreateTicketJSONRequest); ok {
return svc.CorporateCreateTicket(ctx, req, dbC... | [
0.04836313799023628,
-0.6434776186943054,
0.7663796544075012,
0.5994864702224731,
-0.1699073165655136,
0.5346982479095459,
0.2666855454444885,
0.03299327939748764,
-0.6891674399375916,
-0.13174358010292053,
0.11568847298622131,
-0.05498078837990761,
-0.5075353980064392,
0.8173186779022217,... |
func NewHTTPReader(
proxy *url.URL,
path string,
accountID int,
licenseKey string,
retryFor time.Duration,
verbose bool,
) Reader {
transport := http.DefaultTransport
if proxy != nil {
proxyFunc := http.ProxyURL(proxy)
transport.(*http.Transport).Proxy = proxyFunc
}
return &HTTPReader{
client: &htt... | [
0.4720827043056488,
-0.43319785594940186,
0.41179758310317993,
-0.21528173983097076,
-1.0566210746765137,
0.18154245615005493,
-0.9033793210983276,
0.6565017700195312,
-0.10491380840539932,
0.009669637307524681,
0.902528703212738,
0.7041450142860413,
-0.3420446217060089,
0.0165320783853530... |
func (r *HTTPReader) Read(ctx context.Context, editionID, hash string) (*ReadResult, error) {
var result *ReadResult
var err error
// RetryFor value of 0 means that no retries should be performed.
// Max zero retries has to be set to achieve that
// because the backoff never stops if MaxElapsedTime is zero.
exp ... | [
0.22171373665332794,
-0.6808046102523804,
0.7398271560668945,
0.05562891811132431,
-0.22509948909282684,
-0.5148041248321533,
-1.010179042816162,
-0.340353786945343,
0.19511939585208893,
0.11759064346551895,
0.8933506011962891,
0.4066978096961975,
-0.4766148030757904,
-0.23013651371002197,... |
func (r *HTTPReader) get(
ctx context.Context,
editionID string,
hash string,
) (result *ReadResult, err error) {
requestURL := fmt.Sprintf(
urlFormat,
r.path,
url.PathEscape(editionID),
url.QueryEscape(hash),
)
if r.verbose {
log.Printf("Requesting updates for %s: %s", editionID, requestURL)
}
req,... | [
-0.12098567187786102,
-0.8797382116317749,
0.8011666536331177,
-0.4677187502384186,
-0.21432092785835266,
-0.4437752664089203,
-1.3749881982803345,
-0.16033628582954407,
-0.46379032731056213,
0.743063747882843,
0.9075557589530945,
0.46120262145996094,
-0.2207629233598709,
-0.36726823449134... |
func parseTime(s string) (time.Time, error) {
t, err := time.ParseInLocation(time.RFC1123, s, time.UTC)
if err != nil {
return time.Time{}, fmt.Errorf("parsing time: %w", err)
}
return t, nil
} | [
-0.024847939610481262,
-0.6445183753967285,
0.5785733461380005,
-0.2661034166812897,
-0.6855685710906982,
-0.21049624681472778,
-0.6314284801483154,
0.32142913341522217,
0.5032751560211182,
0.3295097351074219,
0.03364693000912666,
-0.5140676498413086,
-0.5200005173683167,
-0.62320345640182... |
func eulerStep(f fdy, x, y, h float64) float64 {
return y + h*f(x, y)
} | [
0.5476027131080627,
0.47448572516441345,
0.3279736042022705,
0.041250552982091904,
0.24156808853149414,
-0.1483984887599945,
-0.14725613594055176,
0.17048168182373047,
-1.5797022581100464,
-0.5151253938674927,
0.16172854602336884,
-0.8477858901023865,
0.6347760558128357,
0.9147597551345825... |
func newCoolingRate(k float64) func(float64) float64 {
return func(deltaTemp float64) float64 {
return -k * deltaTemp
}
} | [
-0.007460140157490969,
0.3433922529220581,
0.7430726885795593,
0.6424480676651001,
-1.3358397483825684,
-0.48254549503326416,
-0.625532329082489,
-0.02758919633924961,
-1.34859037399292,
-0.06590962409973145,
-0.17542621493339539,
-1.2040824890136719,
-0.6780529022216797,
0.440506339073181... |
func newTempFunc(k, ambientTemp, initialTemp float64) func(float64) float64 {
return func(time float64) float64 {
return ambientTemp + (initialTemp-ambientTemp)*math.Exp(-k*time)
}
} | [
1.081346869468689,
-0.44820505380630493,
0.36910077929496765,
0.2842796742916107,
-0.5480693578720093,
-0.06894338876008987,
0.27675196528434753,
0.49258992075920105,
-0.5232579112052917,
0.28023800253868103,
-0.10798487812280655,
0.31745481491088867,
0.8745448589324951,
-0.049017142504453... |
func newCoolingRateDy(k, ambientTemp float64) fdy {
crf := newCoolingRate(k)
// note that result is dependent only on the object temperature.
// there are no additional dependencies on time, so the x parameter
// provided by eulerStep is unused.
return func(_, objectTemp float64) float64 {
return crf(objectTemp ... | [
-0.34035733342170715,
-0.28176096081733704,
0.6444560289382935,
0.6902903914451599,
-0.8033162951469421,
-1.2827810049057007,
0.20624738931655884,
-0.7340731620788574,
-1.2754205465316772,
-0.7454425096511841,
-0.3676832616329193,
-0.32852569222450256,
0.38198330998420715,
0.40633997321128... |
func New() *ApplIDRequestAckGrp {
var m ApplIDRequestAckGrp
return &m
} | [
0.47507673501968384,
-0.2533830404281616,
-0.07052873820066452,
0.06682172417640686,
-0.6156540513038635,
-0.5188800096511841,
-0.6810694336891174,
-0.6123239994049072,
-0.5432242751121521,
0.15645940601825714,
1.4731087684631348,
0.47260820865631104,
-0.2387746125459671,
0.101954445242881... |
func NewNoApplIDs() *NoApplIDs {
var m NoApplIDs
return &m
} | [
-0.36268916726112366,
-0.27017539739608765,
-0.32936057448387146,
-0.7848346829414368,
-1.4717074632644653,
-0.1709003746509552,
-0.26019006967544556,
-0.22754260897636414,
-0.35849106311798096,
-0.8096979856491089,
0.226795494556427,
0.8785577416419983,
-0.8819682598114014,
0.986914038658... |
func buildSelfLink(groupVersion, plural, namespace, name string) string {
if namespace == metav1.NamespaceAll {
return fmt.Sprintf("/apis/%s/%s/%s", groupVersion, plural, name)
}
return fmt.Sprintf("/apis/%s/namespaces/%s/%s/%s", groupVersion, namespace, plural, name)
} | [
-0.5106671452522278,
-1.2648218870162964,
0.34206724166870117,
0.4100206196308136,
-0.9003906846046448,
-0.5144266486167908,
0.09263088554143906,
0.6401422619819641,
0.532020628452301,
-0.5048012733459473,
0.30072250962257385,
1.0803254842758179,
-0.19473229348659515,
0.14363278448581696,
... |
func NewHTTPClient(cfgFile string) (*HTTPClient, error) {
cfg, err := config.LoadConfig(cfgFile)
if err != nil {
return nil, err
}
return NewHTTPClientFromConfig(cfg)
} | [
-0.19088929891586304,
-0.8360220789909363,
0.2930507957935333,
0.6828649044036865,
-1.30953848361969,
0.442959189414978,
0.6197584867477417,
0.11234153807163239,
-1.3092740774154663,
0.5441073775291443,
-1.036467432975769,
0.12302155792713165,
-0.591550350189209,
0.032943181693553925,
0.... |
func NewHTTPClientFromConfig(cfg *config.Config) (*HTTPClient, error) {
// get clients
ordererClients, err := getOrdererHTTPClients(cfg)
if err != nil {
return nil, err
}
peerClients, err := getPeerHTTPClients(cfg)
if err != nil {
return nil, err
}
return &HTTPClient{
ordererHTTPClients: ordererClients,
... | [
0.09645529836416245,
-0.9534668326377869,
0.3947499692440033,
0.35153165459632874,
-0.6190932393074036,
-0.028116682544350624,
-0.17692597210407257,
-0.6925783753395081,
-0.29431575536727905,
0.33844617009162903,
-0.2754758596420288,
0.531102180480957,
-0.5596393942832947,
0.19687294960021... |
func (c *HTTPClient) ListChannelByHTTP(system bool) ([]ChannelInfo, error) {
var channelInfos []ChannelInfo
pubKey := c.GetPrivKey().PubKey()
pk, err := pubKey.Bytes()
if err != nil {
return channelInfos, err
}
var infos ListChannelResp
// var result map[string]interface{}
for i, ordererHTTPClient := range c.... | [
-0.41120854020118713,
-0.7948991656303406,
0.7404056787490845,
-0.4881194531917572,
0.1525525152683258,
-0.02703535370528698,
-0.2387951910495758,
-1.540079951286316,
-0.8866149187088013,
0.6747508645057678,
-0.010134895332157612,
0.6800180673599243,
-0.4769648611545563,
1.1478168964385986... |
func (c *HTTPClient) CreateChannelByHTTP(channelID string, public bool, admins, members []*core.Member,
gasPrice uint64, ratio uint64, maxGas uint64) error {
// log.Infof("Create channel %s", channelID)
self, err := core.NewMember(c.privKey.PubKey(), "admin")
if err != nil {
return err
}
admins = unionMembers(a... | [
-0.49335744976997375,
0.04041968286037445,
0.6821721196174622,
-0.2753894031047821,
1.3377164602279663,
0.3323426842689514,
-0.2380530685186386,
-1.3955355882644653,
-1.097524642944336,
0.6983869075775146,
-0.02158505469560623,
0.47327956557273865,
-0.9838237166404724,
0.847305417060852,
... |
func (c *HTTPClient) AddTxByHTTP(tx *core.Tx) (*pb.TxStatus, error) {
var info AddTxResp
for i, ordererHTTPClient := range c.ordererHTTPClients {
coreTxBytes, _ := tx.Bytes()
requestBody, _ := json.Marshal(map[string]string{
"tx": string(coreTxBytes),
})
resp, err := http.Post("http://"+ordererHTTPClient+"... | [
-0.5377066135406494,
-0.3463551998138428,
1.0638947486877441,
-0.3556120991706848,
0.17882844805717468,
0.20968325436115265,
0.07420201599597931,
-1.1161648035049438,
-0.7745419144630432,
0.8375495672225952,
-0.21495796740055084,
-0.26243701577186584,
-1.0963903665542603,
0.889962971210479... |
func (c *HTTPClient) GetHistoryByHTTP(address []byte) (*pb.TxHistory, error) {
collector := NewCollector(len(c.peerHTTPClients), 1)
for i := range c.peerHTTPClients {
go func(i int) {
var info GetTxHistoryResp
requestBody, _ := json.Marshal(map[string]string{
"address": hex.EncodeToString(address),
})
... | [
0.03611672669649124,
0.7863999605178833,
1.0808204412460327,
-0.15594694018363953,
0.017174124717712402,
-0.02718384936451912,
0.3514224886894226,
-0.3204557001590729,
-0.44557613134384155,
0.8851637840270996,
-0.4658573865890503,
0.1235128864645958,
-0.7048735618591309,
0.4196002185344696... |
func (c *HTTPClient) GetPrivKey() crypto.PrivateKey {
return c.privKey
} | [
0.7638205885887146,
0.4012714922428131,
0.38757941126823425,
0.6312412023544312,
0.9978005886077881,
-0.03427187353372574,
0.21810175478458405,
-0.37516921758651733,
-0.14340785145759583,
-0.3924945294857025,
-0.04679327830672264,
1.4181017875671387,
-1.0943444967269897,
0.2821567952632904... |
func (c *HTTPClient) GetAccountBalanceByHTTP(address common.Address) (uint64, error) {
var times int
var info GetAccountBalanceResp
for i := range c.ordererHTTPClients {
requestBody, _ := json.Marshal(map[string]string{
"address": hex.EncodeToString(address.Bytes()),
})
resp, err := http.Post("http://"+c.or... | [
-0.7422030568122864,
-0.37084460258483887,
1.1731904745101929,
-0.06714115291833878,
0.4748777747154236,
-0.3909427225589752,
0.5002172589302063,
-0.8174561262130737,
-0.2859523594379425,
0.10807869583368301,
0.6529474854469299,
0.17243337631225586,
-0.7731854915618896,
0.9098142981529236,... |
func (c *HTTPClient) GetTokenInfoByHTTP(address common.Address, channelID []byte) (uint64, error) {
collector := NewCollector(len(c.peerHTTPClients), 1)
var info GetTokenInfoResp
for i := range c.peerHTTPClients {
go func(i int) {
requestBody, _ := json.Marshal(map[string]string{
"address": hex.EncodeToSt... | [
-0.28669366240501404,
-0.24437223374843597,
1.1352312564849854,
-0.9338679909706116,
0.415000855922699,
-0.23713834583759308,
-0.36832892894744873,
-0.7236071228981018,
-1.0583229064941406,
0.04291743040084839,
-0.533423662185669,
0.4109693169593811,
-0.6372270584106445,
0.7131845951080322... |
func RegisterWorkflow(workflowFunc interface{}) {
thImpl := getHostEnvironment()
err := thImpl.RegisterWorkflow(workflowFunc)
if err != nil {
panic(err)
}
} | [
-0.07243974506855011,
1.0022860765457153,
0.4401504099369049,
0.9212371706962585,
0.9371731281280518,
-0.08411435782909393,
0.801719605922699,
0.7244678735733032,
-0.6720306873321533,
0.18096354603767395,
-1.0470794439315796,
0.598731517791748,
-0.011275392957031727,
0.29634708166122437,
... |
func NewChannel(ctx Context) Channel {
state := getState(ctx)
state.dispatcher.channelSequence++
return NewNamedChannel(ctx, fmt.Sprintf("chan-%v", state.dispatcher.channelSequence))
} | [
-0.6610550880432129,
0.09700455516576767,
0.36015957593917847,
-0.5252905488014221,
-0.7464515566825867,
0.07935324311256409,
-0.4300471246242523,
-0.7409394383430481,
1.1977956295013428,
-0.6027606725692749,
-0.42733410000801086,
0.9463796019554138,
0.5988370776176453,
0.10405347496271133... |
func NewNamedChannel(ctx Context, name string) Channel {
return &channelImpl{name: name}
} | [
-0.35181769728660583,
-0.6649752855300903,
0.07496779412031174,
-0.8032342791557312,
-1.7980420589447021,
0.6996190547943115,
-0.38737475872039795,
-1.1763465404510498,
0.3775697946548462,
-0.4176872968673706,
-0.8784220814704895,
0.5839723944664001,
0.18421070277690887,
0.0077522071078419... |
func NewBufferedChannel(ctx Context, size int) Channel {
return &channelImpl{size: size}
} | [
0.5100067853927612,
-0.3107852637767792,
0.3703630268573761,
-0.5212740898132324,
-0.5278719067573547,
0.1976374238729477,
0.045515276491642,
-1.417356252670288,
0.5911324620246887,
-1.3668733835220337,
-1.0340778827667236,
1.4699281454086304,
-0.46309328079223633,
0.19634686410427094,
-... |
func NewNamedBufferedChannel(ctx Context, name string, size int) Channel {
return &channelImpl{name: name, size: size}
} | [
0.6247431039810181,
-0.4294847548007965,
0.526952862739563,
-0.9192556738853455,
-0.5072903037071228,
0.20426900684833527,
-0.17989395558834076,
-1.7276244163513184,
0.3048913776874542,
-0.9330019950866699,
-1.2635304927825928,
0.7953343391418457,
-0.3953593969345093,
0.0915428102016449,
... |
func NewSelector(ctx Context) Selector {
state := getState(ctx)
state.dispatcher.selectorSequence++
return NewNamedSelector(ctx, fmt.Sprintf("selector-%v", state.dispatcher.selectorSequence))
} | [
-0.8561496138572693,
-0.5067272782325745,
0.2034957855939865,
-0.23842085897922516,
-0.529434084892273,
-0.884015679359436,
-0.6796045899391174,
-0.6848282217979431,
1.1043906211853027,
-0.6022396683692932,
-1.1535193920135498,
0.1668296903371811,
0.4386569559574127,
0.33010321855545044,
... |
func NewNamedSelector(ctx Context, name string) Selector {
return &selectorImpl{name: name}
} | [
-0.5218629240989685,
-0.8322177529335022,
-0.059177298098802567,
-0.8644658923149109,
-1.5026789903640747,
-0.43767446279525757,
-1.4426264762878418,
-1.2367171049118042,
0.8461511135101318,
-0.47456273436546326,
-1.9139734506607056,
-0.13612982630729675,
0.0872030109167099,
-0.10963790118... |
func Go(ctx Context, f func(ctx Context)) {
state := getState(ctx)
state.dispatcher.newCoroutine(ctx, f)
} | [
0.35205408930778503,
0.9735175967216492,
0.5055965781211853,
-0.4395340383052826,
0.5672779679298401,
-0.11480122804641724,
-0.2000267505645752,
0.8241350054740906,
-0.5838503241539001,
0.22659964859485626,
-0.9058498740196228,
0.68799889087677,
1.7000806331634521,
-0.3274891972541809,
-... |
func GoNamed(ctx Context, name string, f func(ctx Context)) {
state := getState(ctx)
state.dispatcher.newNamedCoroutine(ctx, name, f)
} | [
0.3256679177284241,
0.3024716377258301,
0.5175737142562866,
-0.5298953056335449,
-0.17628470063209534,
0.3776558041572571,
-0.5634834170341492,
0.12535807490348816,
-0.21438801288604736,
0.2321951985359192,
-1.564180850982666,
0.4169732630252838,
0.9905841946601868,
-0.1476726531982422,
... |
func NewFuture(ctx Context) (Future, Settable) {
impl := &futureImpl{channel: NewChannel(ctx).(*channelImpl)}
return impl, impl
} | [
-0.06698504835367203,
0.7192432284355164,
0.2949865162372589,
0.029527870938181877,
-0.7919265627861023,
-1.4063761234283447,
-0.4006565511226654,
-0.19678302109241486,
0.08893471956253052,
-0.20094361901283264,
-0.8144797086715698,
0.600299596786499,
0.5817031860351562,
0.6431258916854858... |
func GetWorkflowInfo(ctx Context) *WorkflowInfo {
return getWorkflowEnvironment(ctx).WorkflowInfo()
} | [
0.5484097599983215,
-0.3891083002090454,
0.03653194382786751,
0.47473856806755066,
0.337856262922287,
0.4057040512561798,
-0.013550403527915478,
-0.7928776144981384,
-0.6327548623085022,
-0.9959801435470581,
-0.8019460439682007,
0.7452786564826965,
0.16677133738994598,
0.5163763761520386,
... |
func GetLogger(ctx Context) *zap.Logger {
return getWorkflowEnvironment(ctx).GetLogger()
} | [
0.30244192481040955,
0.02878730185329914,
0.17504915595054626,
0.4181968867778778,
0.6154282093048096,
0.524781346321106,
0.24181611835956573,
-0.2054736614227295,
0.28466543555259705,
-0.43800830841064453,
0.46946850419044495,
0.5190116167068481,
-0.7576998472213745,
1.0499792098999023,
... |
func Now(ctx Context) time.Time {
return getWorkflowEnvironment(ctx).Now()
} | [
-0.15866674482822418,
-0.32617515325546265,
0.266493558883667,
0.20598286390304565,
0.42193180322647095,
0.41116365790367126,
0.15646980702877045,
0.051904816180467606,
-0.7022004127502441,
0.32656893134117126,
-0.7080687284469604,
0.5812010765075684,
0.10565661638975143,
0.698374927043914... |
func RequestCancelWorkflow(ctx Context, workflowID, runID string) error {
ctx1 := setWorkflowEnvOptionsIfNotExist(ctx)
options := getWorkflowEnvOptions(ctx1)
if options.domain == nil {
return errors.New("need a valid domain")
}
return getWorkflowEnvironment(ctx).RequestCancelWorkflow(*options.domain, workflowID,... | [
-0.4311280846595764,
-0.09873837232589722,
0.46560394763946533,
0.9217140674591064,
0.6781570911407471,
-0.17640353739261627,
-0.7205897569656372,
-0.27637144923210144,
0.5104937553405762,
-0.3436802327632904,
0.35279542207717896,
1.5735580921173096,
-1.0260958671569824,
0.9090075492858887... |
func WithChildWorkflowOptions(ctx Context, cwo ChildWorkflowOptions) Context {
ctx1 := setWorkflowEnvOptionsIfNotExist(ctx)
wfOptions := getWorkflowEnvOptions(ctx1)
wfOptions.domain = common.StringPtr(cwo.Domain)
wfOptions.taskListName = common.StringPtr(cwo.TaskList)
wfOptions.workflowID = cwo.WorkflowID
wfOptio... | [
0.9371317028999329,
-0.9262150526046753,
0.7591062188148499,
-0.24533957242965698,
0.31535372138023376,
0.004199305549263954,
0.3469103276729584,
-0.5500947833061218,
0.1558065563440323,
0.2351340353488922,
-0.8195606470108032,
-0.25646165013313293,
-0.28892451524734497,
0.4589498341083526... |
func WithWorkflowDomain(ctx Context, name string) Context {
ctx1 := setWorkflowEnvOptionsIfNotExist(ctx)
getWorkflowEnvOptions(ctx1).domain = common.StringPtr(name)
return ctx1
} | [
-0.22266416251659393,
-0.7449750304222107,
0.6109816431999207,
-0.402371346950531,
0.36150062084198,
-0.05403376370668411,
0.39425456523895264,
-0.7553278803825378,
1.0555793046951294,
-0.0726800486445427,
-0.24964983761310577,
0.3545333743095398,
0.20914682745933533,
0.7473160028457642,
... |
func WithWorkflowTaskList(ctx Context, name string) Context {
ctx1 := setWorkflowEnvOptionsIfNotExist(ctx)
getWorkflowEnvOptions(ctx1).taskListName = common.StringPtr(name)
return ctx1
} | [
0.06490113586187363,
-0.5418472290039062,
0.834804356098175,
0.15271560847759247,
0.004339540842920542,
0.001097773783840239,
0.5216485261917114,
-0.21844910085201263,
0.5643063187599182,
1.0790460109710693,
-0.6724562048912048,
-0.6886191964149475,
0.6365122199058533,
0.7749107480049133,
... |
func WithWorkflowID(ctx Context, workflowID string) Context {
ctx1 := setWorkflowEnvOptionsIfNotExist(ctx)
getWorkflowEnvOptions(ctx1).workflowID = workflowID
return ctx1
} | [
0.5010020732879639,
-0.9757569432258606,
0.5414707660675049,
-0.3267211318016052,
0.17170481383800507,
0.049424175173044205,
0.03892182186245918,
-0.3800966143608093,
1.5238195657730103,
0.8974838852882385,
0.6029729247093201,
0.08705519884824753,
0.1072724387049675,
1.345496416091919,
-... |
func WithChildPolicy(ctx Context, childPolicy ChildWorkflowPolicy) Context {
ctx1 := setWorkflowEnvOptionsIfNotExist(ctx)
getWorkflowEnvOptions(ctx1).childPolicy = childPolicy
return ctx1
} | [
1.2216404676437378,
-0.7405657172203064,
0.6877361536026001,
-0.3598474860191345,
0.7955266237258911,
0.587822675704956,
-0.2574767768383026,
-0.4625821113586426,
0.8957802653312683,
0.2505621910095215,
-0.8632981181144714,
-0.47720465064048767,
0.06205076724290848,
0.08301017433404922,
... |
func WithExecutionStartToCloseTimeout(ctx Context, d time.Duration) Context {
ctx1 := setWorkflowEnvOptionsIfNotExist(ctx)
getWorkflowEnvOptions(ctx1).executionStartToCloseTimeoutSeconds = common.Int32Ptr(int32(d.Seconds()))
return ctx1
} | [
-0.18389807641506195,
-0.22704491019248962,
0.5749615430831909,
-0.5858269333839417,
0.42161062359809875,
0.2420184463262558,
0.4429967701435089,
-0.13864006102085114,
0.532814085483551,
0.5415136814117432,
0.6819719076156616,
0.16591498255729675,
0.555760383605957,
1.199306607246399,
-0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.