text
stringlengths
11
6.3k
embedding
listlengths
768
768
func (op *OpQuery) makeLimitStatment() string { if op.limit > 0 { return fmt.Sprintf("LIMIT %d", op.limit) } return "" }
[ -0.17040584981441498, -0.15640036761760712, 0.48926109075546265, -1.0418983697891235, -1.1286908388137817, 0.10472161322832108, 0.35728758573532104, -0.26778388023376465, 1.1154818534851074, 0.20055940747261047, 0.8693695664405823, -0.4242125451564789, -0.5239646434783936, -1.1810656785964...
func NewOpQuery(sobjectName string) *OpQuery { return &OpQuery{ sobjectName: sobjectName, } }
[ 0.019683565944433212, -1.0396851301193237, 0.3834122121334076, 0.5701245069503784, -1.4654080867767334, -0.4469861686229706, -0.39605236053466797, -0.3818289041519165, 0.28700879216194153, 0.18428637087345123, 0.44804930686950684, 0.21838372945785522, 0.10698878020048141, -0.27892455458641...
func (h *handler) getBuild(w http.ResponseWriter, r *http.Request) { _, responseContentType, err := contenttype.APICheck(r.Header) w.Header().Set("Content-Type", responseContentType) errResponder := httperr.NewResponder(responseContentType, h.logger) if err != nil { errResponder.Respond(w, http.StatusNotAcceptab...
[ -0.3369576334953308, -1.4735631942749023, 1.0285595655441284, 0.7081011533737183, -0.12155692279338837, 0.525769829750061, 0.10367297381162643, -0.3473755717277527, 0.09689414501190186, -0.3162543475627899, 0.4013304114341736, 1.1707979440689087, -0.7634943723678589, 0.7779458165168762, ...
func (d *DataplaneResource) mergeLists( meshCfg *mesh_proto.PrometheusMetricsBackendConfig, dpCfg *mesh_proto.PrometheusMetricsBackendConfig, ) { aggregate := make(map[string]*mesh_proto.PrometheusAggregateMetricsConfig) for _, conf := range meshCfg.Aggregate { aggregate[conf.Name] = conf } // override Mesh agg...
[ 0.03761257603764534, 0.6539484858512878, 0.5861358046531677, -0.7614620923995972, 0.4288696348667145, 0.7333580255508423, -0.38490816950798035, 0.0007034154841676354, -0.45415404438972473, -0.12822207808494568, -0.379806786775589, -0.4206082820892334, -0.6209597587585449, 1.681356430053711...
func generateNewBlock(oldBlock Block, dataPayload string) (Block, error) { var newBlock Block timeNow := time.Now() newBlock.Index = oldBlock.Index + 1 newBlock.Timestamp = timeNow.String() newEvent, err := dataPayloadtoServiceEvent(dataPayload) if err != nil { log.Println("ERROR: Unable to convert data pay...
[ 0.1547248512506485, 0.5366718769073486, 0.8121742010116577, -0.35020115971565247, -0.4905126094818115, 0.2262740433216095, -0.6732877492904663, -0.39103442430496216, -0.1082756444811821, -0.4379625916481018, -0.4453151226043701, 0.2779656946659088, -0.22707447409629822, 0.23229773342609406...
func loadBaseData() error { err := fileToInterface(validGarageDataFile, &ValidGarages) if err != nil { log.Println("ERROR: Unable to load valid garage data") return err } err = fileToInterface(validVehicleDataFile, &ValidVehicles) if err != nil { log.Println("ERROR: Unable to load valid vehicles data") ...
[ -0.24185143411159515, -0.44403892755508423, 0.7878656983375549, -0.10818441957235336, 0.5099058151245117, 1.685871958732605, -0.15630707144737244, 0.12532642483711243, -0.831212043762207, -0.47209975123405457, -0.3659241795539856, 0.4626919627189636, -1.0211808681488037, 0.2191191613674163...
func dataPayloadtoServiceEvent(dataPayload string) (ServiceEvent, error) { var newServiceEvent ServiceEvent var newEventDescription EventDescription var newEventDescriptionType EventType var vehicle Vehicle var garage Garage log.Print(string(newServiceEvent.Identifier) + string(newEventDescription.VehicleMilage...
[ 0.2420559823513031, -0.5681020021438599, 0.7014769315719604, -1.2878323793411255, -0.36057859659194946, 0.03598179295659065, -0.5352623462677002, -0.3803549110889435, -0.5279415249824524, -0.0769491046667099, -0.5486249327659607, 1.262643575668335, -0.5738248229026794, 0.3398591876029968, ...
func calculateHash(block Block) string { // Time and vehicle identifier (v5c) are the key block items to generate the hash record := string(string(block.Index) + block.Timestamp + block.Event.PerformedOnVehicle.V5c + block.PrevHash) h := sha256.New() h.Write([]byte(record)) hashed := h.Sum(nil) return hex.Encode...
[ 0.7755038738250732, -0.47236284613609314, 0.7424560785293579, 0.3870132863521576, -0.5891398787498474, -0.09618303179740906, 0.39694830775260925, 0.741238534450531, -0.20901934802532196, 0.5539528131484985, -0.849473774433136, -0.7113157510757446, -0.894790530204773, 0.21682383120059967, ...
func generateGenesisBlock() Block { var genesisBlock Block var genesisRecord ServiceEvent var genesisRecordEventDescription EventDescription var genesisRecordEventDescriptionType EventType var genesisRecordVehicle Vehicle var genesisRecordGarage Garage // Seed values for Garage, Vehicle, EventType and EventDes...
[ -0.3239617645740509, 0.27690353989601135, 1.1032897233963013, -0.1796974390745163, 0.39687812328338623, 0.07679126411676407, -0.31743723154067993, -0.06995809823274612, -0.9630041122436523, 0.005398898385465145, -0.36131131649017334, 0.7511361241340637, -0.5715761184692383, 0.7476152181625...
func isBlockValid(prior Block, current Block) bool { return true }
[ 0.018132543191313744, -0.8906864523887634, 0.7344673275947571, 1.0815963745117188, -0.31392502784729004, 0.9033868908882141, -0.1963224560022354, 0.402710497379303, -0.27765005826950073, -0.5562973022460938, 0.4434739053249359, 1.1795387268066406, -1.2696846723556519, 0.49527835845947266, ...
func replaceChain(newBlock Block) bool { // make this thread safe blockchainwritelock.Lock() defer blockchainwritelock.Unlock() // Is the block valid and if so then append it to the chain if isBlockValid(newBlock, Blockchain[len(Blockchain)-1]) { Blockchain = append(Blockchain, newBlock) BlockchainLength = l...
[ -0.43460142612457275, -0.39244648814201355, 0.7133209109306335, 0.03861195966601372, 0.7928352355957031, -0.5572459101676941, 0.04432567581534386, 0.35914337635040283, 0.021805576980113983, 0.32848021388053894, -1.0078036785125732, -0.3054426312446594, -1.1210113763809204, 0.88773173093795...
func ServerStart(port string) (string, error) { // List of view handlers handlerStrings = append(handlerStrings, "/", "/blockchain/view/<ID>", "/garage/view/<ID>", "serviceevent/add/", "/vehicle/view/<ID>") http.HandleFunc("/", defaultHandler) // Each call to "/" will invoke defaultHandler http.HandleFunc("/block...
[ -0.26875391602516174, -0.39723658561706543, 0.6779882311820984, -0.2677794396877289, 0.6405285000801086, -0.1719350963830948, 0.004579631146043539, 0.3197859823703766, -0.2620658278465271, 0.2509101927280426, -0.4879629611968994, 0.4611257016658783, -0.701291561126709, 0.5911850333213806, ...
func defaultHandler(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "INFO: Default Handler called from %s. Please try alternative methods such as \n %s", r.RemoteAddr, handlerStrings) }
[ 0.41576823592185974, -0.5494449734687805, 0.26215726137161255, -0.03637407720088959, 0.07508096843957901, 0.9937601089477539, 0.28638574481010437, 0.2056923359632492, -0.5070503354072571, -0.6986052393913269, 0.7376851439476013, -0.403701514005661, -0.8191072940826416, 0.41110992431640625,...
func blockchainViewHandler(w http.ResponseWriter, r *http.Request) { // Take the URL beyond /blockchain/ and split into request and value strings requestAction := strings.Split(r.URL.String(), "/") requestItem, err := strconv.Atoi(requestAction[3]) requestItem = requestItem - 1 if err != nil { log.Println("INF...
[ -0.25030019879341125, -0.5734052658081055, 0.6439008712768555, -0.17827259004116058, -0.22095797955989838, -0.07530248165130615, -0.0037939902395009995, -0.3290756940841675, 0.2374637871980667, 0.27774837613105774, 1.0358093976974487, 0.48672056198120117, -0.8276922106742859, 0.21064984798...
func garageViewHandler(w http.ResponseWriter, r *http.Request) { // Take the URL beyond /garage/ and split into request and value strings requestAction := strings.Split(r.URL.String(), "/") requestItem, err := strconv.Atoi(requestAction[3]) if err != nil { log.Println("INFO: garageViewHandler(): No garage id req...
[ -0.4650934934616089, -0.3176770806312561, 0.6798737645149231, -0.08633401244878769, -0.6290152668952942, -0.06796448677778244, -0.008744270540773869, -0.1908508539199829, 0.2044871300458908, -0.5730105042457581, 1.361440658569336, 0.4473307430744171, -0.012264922261238098, 0.85156577825546...
func interfaceToFile(path string, structIn interface{}) error { // Create a lock and then defer the unlock until function exit filewritelock.Lock() defer filewritelock.Unlock() //Create os.File and defer close file, err := os.Create(string(path)) if err != nil { return err } defer file.Close() // Create a...
[ 0.2842352092266083, -0.4963495433330536, 0.8452812433242798, -0.5989101529121399, 0.7592902779579163, 0.5189182162284851, 0.7556285262107849, 0.07280446588993073, -0.6057538390159607, 0.5830016732215881, 0.38422107696533203, -0.13392770290374756, -0.2455003708600998, -0.9748951196670532, ...
func fileToInterface(path string, structOut interface{}) error { // Lock and defer the unlock until function exit filewritelock.Lock() defer filewritelock.Unlock() log.Println("INFO: Loading " + path) fileOut, err := os.Open(path) if err != nil { log.Println("ERROR: fileToInterface() " + err.Error() + " whil...
[ 0.18877601623535156, -0.61655193567276, 0.7886303067207336, -1.0209746360778809, 0.35901448130607605, 0.12645457684993744, 0.8046472072601318, 0.3071608543395996, -1.2580621242523193, 0.16996490955352783, 0.13661153614521027, -0.3100954592227936, -0.3303215205669403, -0.3049567639827728, ...
func LoadTestEnv() error { _, b, _, _ := runtime.Caller(0) d := path.Join(path.Dir(b)) err := godotenv.Load(fmt.Sprintf("%s/.env.test", filepath.Dir(d))) if err != nil { log.Fatal("failed to load test env config: ", err) } return err }
[ -0.07376429438591003, 0.1791333109140396, 0.5149610042572021, -0.13405141234397888, 0.5268476605415344, 0.36979326605796814, 0.6907755136489868, -0.6300597190856934, -0.25487178564071655, 0.29366469383239746, -0.46273350715637207, 0.8613337874412537, -0.902198851108551, 0.30031731724739075...
func InitTestDB() (*gorm.DB, error) { if err := LoadTestEnv(); err != nil { panic(err) } config := configs.New() db := database.New(&config.Database, false) database.AutoMigrate(db) if conn, ok := db.DB(); ok != nil { defer conn.Close() } return db, nil }
[ 0.22290045022964478, 0.654327929019928, 0.6305983066558838, 0.844501256942749, 0.3216318190097809, 0.3996039628982544, 0.9007781744003296, -0.2517218291759491, 0.09616443514823914, 0.22750718891620636, -0.13504654169082642, 0.07300230860710144, -1.6518628597259521, 0.8552769422531128, -0...
func (w *responseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) { if w.size < 0 { w.size = 0 } return w.ResponseWriter.(http.Hijacker).Hijack() }
[ 0.6682674884796143, -0.5312504768371582, 0.6178273558616638, 1.134629249572754, 0.5923110842704773, -0.5574696063995361, 0.4659375548362732, 0.5230653285980225, -0.06959831714630127, -1.6683365106582642, 0.34836745262145996, -1.0027436017990112, -0.8323126435279846, 0.0690399631857872, 0...
func (w *responseWriter) CloseNotify() <-chan bool { return w.ResponseWriter.(http.CloseNotifier).CloseNotify() }
[ -0.9242956042289734, 0.09517020732164383, 0.25303763151168823, -0.20171789824962616, -0.10082799196243286, -0.19842061400413513, -0.3068709373474121, -0.8564205765724182, -0.407808393239975, -0.25860509276390076, -0.10793210566043854, -0.7376722693443298, -0.8120429515838623, 0.83843874931...
func (w *responseWriter) Flush() { w.WriteHeaderNow() w.ResponseWriter.(http.Flusher).Flush() }
[ -0.21445216238498688, -0.5770308971405029, 0.0502115823328495, 0.2746555507183075, 0.48860105872154236, -0.043891388922929764, 0.6797113418579102, -0.8125715851783752, -0.1281474530696869, -1.0720382928848267, 0.40983957052230835, 0.12810905277729034, 0.3301016390323639, 1.2538217306137085...
func bigramWordByCopy(str string) []string { ss := strings.Split(str, " ") // Handle unexpected string input: // ss = "" => []string{""} // ss = "foobar" => []string{"foobar"} if len(ss) <= 1 { return ss } bigram := make([]string, len(ss)-1) for i := 0; i < len(ss)-1; i++ { // Counts the length of p...
[ 0.36913320422172546, -0.09239234775304794, 0.7427391409873962, 0.23760871589183807, -0.4347706735134125, -0.20386388897895813, 0.5876840949058533, 0.4612423777580261, 0.512205183506012, 1.7575777769088745, -0.09176751971244812, 1.149893045425415, -0.3555891811847687, 0.09002077579498291, ...
func bigramWordByConcat(str string) []string { ss := strings.Split(str, " ") // Handle unexpected string input: // ss = "" => []string{""} // ss = "foobar" => []string{"foobar"} if len(ss) <= 1 { return ss } bigram := make([]string, len(ss)-1) for i := 0; i < len(ss)-1; i++ { bigram[i] = ss[i] + " "...
[ 0.9743183255195618, 0.3184851109981537, 0.9128549695014954, 0.7681801319122314, -0.1239282563328743, -0.447156697511673, -0.2227298766374588, -0.2997835576534271, -0.15731573104858398, 1.4993218183517456, 0.5506503582000732, 0.33730006217956543, -0.7577335834503174, 1.2061916589736938, -...
func bigramWordByJoin(str string) []string { ss := strings.Split(str, " ") // Handle unexpected string input: // ss = "" => []string{""} // ss = "foobar" => []string{"foobar"} if len(ss) <= 1 { return ss } bigram := make([]string, len(ss)-1) for i := 0; i < len(ss)-1; i++ { bigram[i] = strings.Join(...
[ 1.0893809795379639, 0.16958801448345184, 0.8160940408706665, 0.7981893420219421, -0.09194564819335938, -0.03134234994649887, 0.2972266376018524, 0.4102850556373596, 0.01072334498167038, 1.3479877710342407, 0.12305016815662384, 0.540653645992279, -1.5419186353683472, 0.4643876850605011, 0...
func bigramWordByAppend(str string) []string { ss := strings.Split(str, " ") // Handle unexpected string input: // ss = "" => []string{""} // ss = "foobar" => []string{"foobar"} if len(ss) <= 1 { return ss } var tmp string var bigram []string for i, s := range ss { if i != 0 { bigram = append(bi...
[ 0.913886308670044, 0.16097457706928253, 0.8132178783416748, 0.5875569581985474, -0.4761984348297119, -0.4140356183052063, -0.43036770820617676, 0.2633134722709656, 0.2632562518119812, 1.4290944337844849, 0.4976043701171875, 0.5494337677955627, -0.7307162284851074, 1.7075752019882202, 0.3...
func (api *API) GetAccounts(ctx context.Context, names ...string) ([]*Account, error) { var resp []*Account err := api.call(ctx, "get_accounts", []interface{}{names}, &resp) return resp, err }
[ -1.1844172477722168, 0.8202108144760132, 0.5260004997253418, 1.0193523168563843, 1.050753116607666, -0.591810405254364, -0.10857986658811569, -1.1658612489700317, 0.3287765383720398, -0.27448365092277527, -0.18848027288913727, 0.6324898600578308, -0.8857619762420654, 0.08609731495380402, ...
func (api *API) GetAccountsCount(ctx context.Context) (int, error) { var resp int err := api.call(ctx, "get_account_count", caller.EmptyParams, &resp) return resp, err }
[ -0.42681923508644104, 0.832324743270874, 0.9038352370262146, 0.6010574698448181, 0.6342165470123291, -0.9446269869804382, 0.598836362361908, -0.35545310378074646, 0.12839633226394653, -0.18818455934524536, 0.2837900221347809, 0.7538992762565613, -0.6798607707023621, -0.1988172084093094, ...
func (api *API) LookupAccounts(ctx context.Context, lowerBoundName string, limit uint16) ([]string, error) { var resp []string err := api.call(ctx, "lookup_accounts", []interface{}{lowerBoundName, limit}, &resp) return resp, err }
[ -0.9263808727264404, 0.29738062620162964, 0.770690381526947, -0.0813336968421936, 0.25551357865333557, -0.22686566412448883, 0.053161755204200745, -0.7144542336463928, 1.090580940246582, -0.028381558135151863, 0.19465678930282593, 0.7709643244743347, -1.0294926166534424, -0.626923918724060...
func (api *API) SetBlockAppliedCallback(notice func(header *types.BlockHeader, error error)) (err error) { err = api.setCallback("set_block_applied_callback", func(raw json.RawMessage) { var header []types.BlockHeader if err := json.Unmarshal(raw, &header); err != nil { notice(nil, err) } for _, b := range ...
[ 0.27072590589523315, -0.43495702743530273, 0.9296483993530273, -0.2488456815481186, -0.08751174062490463, -0.7081747055053711, -0.06463630497455597, 0.10199883580207825, -0.026032626628875732, 0.6442821621894836, 0.19585466384887695, 0.9186354279518127, 0.30234310030937195, 1.2594697475433...
func NewCmdConfigUseContext(out io.Writer, configAccess clientcmd.ConfigAccess) *cobra.Command { options := &useContextOptions{configAccess: configAccess} cmd := &cobra.Command{ Use: "use-context CONTEXT_NAME", DisableFlagsInUseLine: true, Short: i18n.T("Set the current-contex...
[ 0.06505651026964188, -0.3093262016773224, 0.7454041838645935, 0.011390702798962593, -0.6236556768417358, -0.972633421421051, 0.49645957350730896, 0.18628132343292236, -0.13853245973587036, 0.7523403763771057, 0.263387531042099, 0.43589669466018677, -0.18390847742557526, -0.2701942026615143...
func (m *Tweet) Validate(formats strfmt.Registry) error { var res []error if err := m.validateCreatedAt(formats); err != nil { res = append(res, err) } if err := m.validateFullText(formats); err != nil { res = append(res, err) } if err := m.validateID(formats); err != nil { res = append(res, err) } if...
[ 0.3621409237384796, -0.24336642026901245, 0.05246099457144737, -0.17112110555171967, 0.9995899796485901, 0.07033368200063705, 0.24962130188941956, -0.8004023432731628, -1.0213984251022339, -0.14158649742603302, -0.29733598232269287, 0.10490911453962326, -1.0753952264785767, 1.0644741058349...
func (client *Client) DeleteVpdGrantRule(request *DeleteVpdGrantRuleRequest) (response *DeleteVpdGrantRuleResponse, err error) { response = CreateDeleteVpdGrantRuleResponse() err = client.DoAction(request, response) return }
[ 0.03695203363895416, 0.07103079557418823, 0.26069849729537964, 0.09566409140825272, 1.0200854539871216, 0.6994804739952087, 0.2556741237640381, 0.5080157518386841, -0.4098632335662842, 0.21507123112678528, 0.7626472115516663, 0.7854723930358887, -0.7913994193077087, 0.5228599905967712, 0...
func (client *Client) DeleteVpdGrantRuleWithChan(request *DeleteVpdGrantRuleRequest) (<-chan *DeleteVpdGrantRuleResponse, <-chan error) { responseChan := make(chan *DeleteVpdGrantRuleResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) r...
[ -0.25601649284362793, -0.25303348898887634, 0.1532549113035202, -0.9031671285629272, 0.6429837346076965, 0.08579797297716141, -0.19006645679473877, -0.3577222228050232, -0.09005392342805862, 0.05864926055073738, 0.7388635277748108, 0.4636790156364441, -0.834571123123169, 0.6261767745018005...
func (client *Client) DeleteVpdGrantRuleWithCallback(request *DeleteVpdGrantRuleRequest, callback func(response *DeleteVpdGrantRuleResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteVpdGrantRuleResponse var err error defer close(result) respo...
[ 0.1293104588985443, 0.178939551115036, 0.5232725739479065, -0.2778967022895813, 0.5113756060600281, -0.21329255402088165, -0.007270107511430979, 0.2151462733745575, 0.5126535296440125, 0.3281656801700592, 0.7781985998153687, -0.19218552112579346, -0.5415483713150024, 0.7856409549713135, ...
func CreateDeleteVpdGrantRuleRequest() (request *DeleteVpdGrantRuleRequest) { request = &DeleteVpdGrantRuleRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("eflo", "2022-05-30", "DeleteVpdGrantRule", "eflo", "openAPI") request.Method = requests.POST return }
[ 0.5181031823158264, -0.375713050365448, 0.3821841776371002, -0.5883352160453796, 1.3315008878707886, 0.5548200607299805, -0.282551646232605, 0.8617156744003296, -0.7407989501953125, -0.16828341782093048, 0.9110005497932434, 0.9023198485374451, -0.0010645072907209396, 1.4683672189712524, ...
func CreateDeleteVpdGrantRuleResponse() (response *DeleteVpdGrantRuleResponse) { response = &DeleteVpdGrantRuleResponse{ BaseResponse: &responses.BaseResponse{}, } return }
[ 0.007999898865818977, -0.8042014241218567, 0.07640589028596878, -0.4564121961593628, 1.3245060443878174, -0.09528271853923798, -0.1838648021221161, 0.24609102308750153, -0.12201209366321564, 0.10876323282718658, 0.2494608759880066, -0.41431906819343567, -0.6834830045700073, 0.9535279870033...
func TestAreOpts(t *testing.T) { cases := []struct { c string isOpt bool }{ {"se", true}, {"bg", true}, {"il", true}, {"za", true}, {"ba", false}, {"12", false}, {"", false}, {"hugh", false}, } for _, i := range cases { var isCountry bool = isOptOf(i.c, countryOpts) if isCountry != i.is...
[ 0.2951699495315552, 0.21834611892700195, 0.4729577898979187, 0.029879136011004448, 0.5073715448379517, 0.6003861427307129, 0.5691917538642883, -1.0113894939422607, 1.055562138557434, 1.18043053150177, 0.8339424729347229, -0.4131229519844055, -0.14527513086795807, 0.06266943365335464, 0.1...
func (_m *MockAggregate) AggregateId() AggregateId { ret := _m.Called() var r0 AggregateId if rf, ok := ret.Get(0).(func() AggregateId); ok { r0 = rf() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(AggregateId) } } return r0 }
[ -0.03657592460513115, -0.1002214252948761, 0.23960407078266144, 0.25372713804244995, 0.7666846513748169, -0.3576967418193817, 0.7173668742179871, 0.619114875793457, 0.49896734952926636, 0.9069441556930542, 0.1617366224527359, 0.49445414543151855, -0.2689085006713867, 0.6100277900695801, ...
func (_m *MockAggregate) AggregateName() string { ret := _m.Called() var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() } else { r0 = ret.Get(0).(string) } return r0 }
[ -0.852515697479248, 0.46397629380226135, 0.40446561574935913, 0.09090495854616165, 0.1772262454032898, -1.015791654586792, 0.5127928853034973, 0.8914899230003357, -0.06124577671289444, 0.6889153122901917, -0.12488149851560593, -0.06773187965154648, -0.2499685138463974, 0.12145715206861496,...
func (_m *MockAggregate) Apply(_a0 Event) error { ret := _m.Called(_a0) var r0 error if rf, ok := ret.Get(0).(func(Event) error); ok { r0 = rf(_a0) } else { r0 = ret.Error(0) } return r0 }
[ 0.21605081856250763, -0.08107323944568634, 0.5317494869232178, -0.20820055902004242, -0.13510306179523468, -0.5031536221504211, 1.0441539287567139, 1.294488787651062, 0.12199220806360245, 0.27563169598579407, 0.808296799659729, -0.35929611325263977, 0.41805410385131836, 1.1544395685195923,...
func (_m *MockAggregate) OriginalVersion() int { ret := _m.Called() var r0 int if rf, ok := ret.Get(0).(func() int); ok { r0 = rf() } else { r0 = ret.Get(0).(int) } return r0 }
[ 0.044331811368465424, -0.23799362778663635, 0.44384175539016724, 0.1619436889886856, -0.3386000096797943, -0.11844903230667114, 1.4074184894561768, 0.9257689714431763, 0.07289433479309082, -0.01734328269958496, -0.17043109238147736, -0.08544959127902985, -0.4009148180484772, 0.256362289190...
func (_m *MockAggregate) StoreEvent(_a0 EventData) { _m.Called(_a0) }
[ 0.303711861371994, -0.0028516759630292654, 0.10722871869802475, -0.5959064364433289, -0.10214654356241226, 0.96639484167099, 1.4553285837173462, 0.7192436456680298, 0.4392271339893341, -0.18737779557704926, 0.028108326718211174, 0.46253660321235657, 0.6983931064605713, 0.9267736673355103, ...
func (_m *MockAggregate) Version() int { ret := _m.Called() var r0 int if rf, ok := ret.Get(0).(func() int); ok { r0 = rf() } else { r0 = ret.Get(0).(int) } return r0 }
[ -0.9015805721282959, -0.16094790399074554, 0.4488040804862976, 0.22987039387226105, 0.7209585905075073, -0.32711663842201233, 1.4721390008926392, 0.5181528329849243, -0.3448532223701477, 0.35524824261665344, -0.5363131761550903, -0.3720715343952179, -0.4656101167201996, 0.8579667806625366,...
func (_m *MockAggregate) clearUncommittedEvents() { _m.Called() }
[ 0.3209694027900696, 0.3011069893836975, 0.3575705885887146, 0.3832434415817261, -0.12185076624155045, 0.5693787336349487, 1.1054575443267822, 0.09252730756998062, 0.13458973169326782, 0.5738782286643982, 0.1610402911901474, 0.3714454472064972, -0.1814277470111847, -0.2750842571258545, -0...
func (_m *MockAggregate) getUncommittedEvents() []Event { ret := _m.Called() var r0 []Event if rf, ok := ret.Get(0).(func() []Event); ok { r0 = rf() } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]Event) } } return r0 }
[ 0.02473757043480873, -0.05241129547357559, 0.7733927965164185, 0.32326555252075195, 0.9984309673309326, -0.37156176567077637, 1.1294273138046265, 0.7229210138320923, -0.09578759968280792, -0.5649941563606262, -0.2765326201915741, 0.24121221899986267, -0.9622910022735596, 0.4283543527126312...
func (_m *MockAggregate) incrementVersion() { _m.Called() }
[ -0.6865845918655396, -0.0825837105512619, 0.20829814672470093, 1.0166685581207275, 0.10544174909591675, -0.06266292929649353, 1.1686888933181763, 0.2520187795162201, -0.028485720977187157, 0.33323153853416443, -0.4210835099220276, -0.19273124635219574, 0.37374794483184814, 0.67812186479568...
func (_m *MockAggregate) setVersion(_a0 int) { _m.Called(_a0) }
[ 0.055288296192884445, -0.2731015086174011, 0.20919209718704224, 0.23860745131969452, 0.15974614024162292, 0.17694300413131714, 1.8252286911010742, 1.2133435010910034, 0.07104436308145523, 0.9901699423789978, -0.4346405267715454, -0.22235418856143951, 0.3354248106479645, 1.1921179294586182,...
func New(s string) *Exp { exp := &Exp{context: s} exp.init() return exp }
[ 1.043440580368042, -1.5065408945083618, -0.05845058709383011, -0.0802726075053215, -1.2681418657302856, -0.21879349648952484, 0.0151981171220541, 0.7690259218215942, 1.1979327201843262, 0.17515525221824646, -0.44026491045951843, 0.9686866998672485, 0.1726137399673462, -0.5200885534286499, ...
func (e *Exp) Eval() float64 { e.init() result, _ := e.eval(e.opTree) return result }
[ 0.13887640833854675, 0.21627800166606903, 0.2638896405696869, 0.07081714272499084, 0.34049344062805176, 0.27557435631752014, 0.38366687297821045, 1.6085039377212524, 0.17856168746948242, 0.5432301163673401, 0.2039613276720047, 0.3205161392688751, -0.10602729022502899, 0.36169523000717163, ...
func (e *Exp) tokenize() []string { siz := len(e.context) tokens := make([]string, 0, 1) for i := 0; i < siz; i++ { ch := e.context[i] switch { case e.isSpace(ch): continue case ch == '(': tokens = append(tokens, "(") case ch == ')': tokens = append(tokens, ")") default: isOperator, op := e....
[ -1.16680908203125, 0.26777544617652893, 0.9730232357978821, 0.3071368336677551, 0.31217724084854126, -0.7324157357215881, -0.04841236025094986, 0.434101939201355, 0.8613900542259216, 0.6152597665786743, 0.4371481239795685, 0.3229854106903076, -0.6096980571746826, 0.4508362114429474, -0.2...
func main() { /**This is the shortform syntax for declaring a variable. It infers the type automatically, but still adheres to the precepts of static typing; NO implicit type casting. NOTE: This only works INSIDE functions, you cannot define global scope variables this way*/ name := "John Doe" greet(name, greeting...
[ 0.49264270067214966, 0.006346903741359711, 0.7042542099952698, 0.7301634550094604, -0.16176767647266388, 0.09814975410699844, 0.4626462757587433, -0.19299598038196564, 0.25885555148124695, 0.2792544364929199, -0.7863693237304688, 1.2165323495864868, -0.14290471374988556, 0.4145540893077850...
func greet(name string, greeting string) { fmt.Println(greeting, name) }
[ 0.9382433891296387, -0.5946866273880005, 0.48097482323646545, 0.10226011276245117, -1.0429285764694214, 0.7195895910263062, -1.0424491167068481, -0.020075170323252678, -0.6639191508293152, -0.22762812674045563, -0.40463900566101074, 1.274875521659851, -0.24431560933589935, 0.36100140213966...
func NewInterRegionTrafficQosQueue(ctx *pulumi.Context, name string, args *InterRegionTrafficQosQueueArgs, opts ...pulumi.ResourceOption) (*InterRegionTrafficQosQueue, error) { if args == nil { return nil, errors.New("missing one or more required arguments") } if args.Dscps == nil { return nil, errors.New("inv...
[ 0.05911550670862198, 0.17255926132202148, 0.4213324189186096, -0.8396295309066772, 0.21328653395175934, -0.16686248779296875, -0.26207149028778076, -0.6225908994674683, 0.27624285221099854, 0.683048665523529, -0.5308328866958618, -0.07552104443311691, -0.5376850962638855, -0.64775812625885...
func GetInterRegionTrafficQosQueue(ctx *pulumi.Context, name string, id pulumi.IDInput, state *InterRegionTrafficQosQueueState, opts ...pulumi.ResourceOption) (*InterRegionTrafficQosQueue, error) { var resource InterRegionTrafficQosQueue err := ctx.ReadResource("alicloud:cen/interRegionTrafficQosQueue:InterRegionTra...
[ 0.3667747676372528, -0.2287263423204422, 0.3829565942287445, -0.8903874158859253, -0.028880147263407707, -0.5283803939819336, -0.3294762969017029, -0.7882518172264099, 0.9773997664451599, 0.33375152945518494, -0.1574719101190567, 0.8098589181900024, -0.4137507379055023, -1.3716003894805908...
func (o InterRegionTrafficQosQueueOutput) Dscps() pulumi.StringArrayOutput { return o.ApplyT(func(v *InterRegionTrafficQosQueue) pulumi.StringArrayOutput { return v.Dscps }).(pulumi.StringArrayOutput) }
[ -0.8439511656761169, 0.2952565550804138, 0.5896725058555603, -0.8325257301330566, 0.4429325759410858, 0.06093535199761391, -0.6187167763710022, -0.9775684475898743, 0.675589919090271, 0.5020555257797241, -0.9435010552406311, 0.4928951859474182, 0.22513632476329803, -1.3551849126815796, -...
func (o InterRegionTrafficQosQueueOutput) InterRegionTrafficQosQueueDescription() pulumi.StringPtrOutput { return o.ApplyT(func(v *InterRegionTrafficQosQueue) pulumi.StringPtrOutput { return v.InterRegionTrafficQosQueueDescription }).(pulumi.StringPtrOutput) }
[ 0.5825170874595642, -0.34615007042884827, 0.538773238658905, -1.2286604642868042, 0.12080305814743042, 0.18887859582901, -0.5609555840492249, -0.4314323961734772, 0.7616280317306519, 0.6861358880996704, -0.02567812241613865, 1.0350903272628784, -0.5438591837882996, -1.034938097000122, -0...
func (o InterRegionTrafficQosQueueOutput) InterRegionTrafficQosQueueName() pulumi.StringPtrOutput { return o.ApplyT(func(v *InterRegionTrafficQosQueue) pulumi.StringPtrOutput { return v.InterRegionTrafficQosQueueName }).(pulumi.StringPtrOutput) }
[ 0.15867555141448975, -0.7947299480438232, 0.663875937461853, -1.1274617910385132, -0.35567566752433777, 0.1554206758737564, -0.47039735317230225, -0.3807205259799957, 0.650489330291748, 1.1646664142608643, -0.23848333954811096, 0.5389889478683472, -0.1707516461610794, -1.0772978067398071, ...
func (o InterRegionTrafficQosQueueOutput) RemainBandwidthPercent() pulumi.IntOutput { return o.ApplyT(func(v *InterRegionTrafficQosQueue) pulumi.IntOutput { return v.RemainBandwidthPercent }).(pulumi.IntOutput) }
[ 0.8923966288566589, -0.5994333028793335, 0.6670705080032349, -0.7128384709358215, 0.12241435796022415, 1.4121663570404053, 0.424064964056015, -0.3599974811077118, 1.2303260564804077, -0.43738606572151184, -0.2446548044681549, -0.34262123703956604, -1.394147276878357, -0.6150774359703064, ...
func (o InterRegionTrafficQosQueueOutput) Status() pulumi.StringOutput { return o.ApplyT(func(v *InterRegionTrafficQosQueue) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput) }
[ 0.5614614486694336, -0.9338464736938477, 0.2886945605278015, -1.1492397785186768, -0.061309780925512314, 0.5996947288513184, -0.580490231513977, 0.049337293952703476, 0.9556552171707153, 0.5762881636619568, -0.7679131627082825, 0.7233015298843384, 0.06747522205114365, -1.1601884365081787, ...
func (o InterRegionTrafficQosQueueOutput) TrafficQosPolicyId() pulumi.StringOutput { return o.ApplyT(func(v *InterRegionTrafficQosQueue) pulumi.StringOutput { return v.TrafficQosPolicyId }).(pulumi.StringOutput) }
[ 1.065927505493164, -0.6575712561607361, 0.03627985715866089, -1.3393982648849487, -0.13590413331985474, 0.9229866862297058, -0.5105890035629272, -0.5710658431053162, 1.1645416021347046, 0.7236337065696716, -0.17533394694328308, 0.44190889596939087, -0.11292310804128647, -1.3871898651123047...
func getHTTPRecoder(t *testing.T, update bool) (client *http.Client, cleanup func(), err error) { recorderMode := recorder.ModeReplaying if update { recorderMode = recorder.ModeRecording } // Setup recorder and scw client r, err := recorder.NewAsMode(getTestFilePath(t, ".cassette"), recorderMode, &SocketPassthr...
[ 0.13515762984752655, -0.053151436150074005, 0.7829685211181641, 0.3488959074020386, -0.49615535140037537, 0.29978296160697937, 0.022650649771094322, 0.1505974531173706, 0.02702333964407444, -0.1184767335653305, 0.19958779215812683, 0.2981197237968445, -0.7305307388305664, -0.22740890085697...
func AddSSLKeys(w http.ResponseWriter, r *http.Request) { inf, userErr, sysErr, errCode := api.NewInfo(r, nil, nil) if userErr != nil || sysErr != nil { api.HandleErr(w, r, inf.Tx.Tx, errCode, userErr, sysErr) return } defer inf.Close() if !inf.Config.RiakEnabled { api.HandleErr(w, r, inf.Tx.Tx, http.StatusI...
[ -0.49536359310150146, 0.2565632164478302, 0.8622558116912842, 0.2924403250217438, -0.06304290145635605, 0.03694421425461769, -0.0934569388628006, -0.05797058716416359, -0.23784929513931274, 0.2104194313287735, -0.2473505139350891, 0.1964057832956314, -0.028355728834867477, 0.42735475301742...
func GetSSLKeysByHostName(w http.ResponseWriter, r *http.Request) { inf, userErr, sysErr, errCode := api.NewInfo(r, []string{"hostname"}, nil) if userErr != nil || sysErr != nil { api.HandleErr(w, r, inf.Tx.Tx, errCode, userErr, sysErr) return } defer inf.Close() if inf.Config.RiakEnabled == false { api.Han...
[ -0.07740017026662827, 0.060146208852529526, 0.8860642910003662, 0.05686070770025253, -0.15062586963176727, -0.3688930869102478, -0.1158812940120697, 0.41632771492004395, -0.8066993355751038, 0.2249871790409088, -0.08698058128356934, -0.005158288404345512, -0.5090280771255493, 0.61554616689...
func GetSSLKeysByXMLID(w http.ResponseWriter, r *http.Request) { inf, userErr, sysErr, errCode := api.NewInfo(r, []string{"xmlid"}, nil) if userErr != nil || sysErr != nil { api.HandleErr(w, r, inf.Tx.Tx, errCode, userErr, sysErr) return } defer inf.Close() if inf.Config.RiakEnabled == false { api.HandleErr(...
[ -0.14534030854701996, -0.3187100291252136, 0.41364821791648865, 0.2935028076171875, 0.0013852299889549613, -0.28418663144111633, -0.23412057757377625, -0.6541047096252441, 0.20912517607212067, 0.9220990538597107, 0.06391113996505737, 0.39754167199134827, -0.9609286189079285, 0.490430206060...
func getCDNIDByDomainname(domainName string, tx *sql.Tx) (int64, bool, error) { cdnID := int64(0) if err := tx.QueryRow(`SELECT id from cdn WHERE domain_name = $1`, domainName).Scan(&cdnID); err != nil { if err == sql.ErrNoRows { return 0, false, nil } return 0, false, err } return cdnID, true, nil }
[ -0.3510831892490387, 0.3020226061344147, 0.853195071220398, 0.06723073124885559, -0.02452603355050087, -0.17819906771183014, 0.39020562171936035, 0.065256267786026, -0.43467429280281067, 0.020773256197571754, -0.5985367298126221, 0.14427156746387482, -0.7980355620384216, 0.4762600958347320...
func getXMLID(cdnID int64, hostRegex string, tx *sql.Tx) (string, bool, error) { q := ` SELECT ds.xml_id from deliveryservice ds JOIN deliveryservice_regex dr on ds.id = dr.deliveryservice AND ds.cdn_id = $1 JOIN regex r on r.id = dr.regex WHERE r.pattern = $2 ` xmlID := "" if err := tx.QueryRow(q, cdnID, hostRegex)...
[ 0.6560660600662231, 0.39339596033096313, 0.8389196395874023, -0.3638949692249298, -0.7151544094085693, -0.06774068623781204, -0.6060827970504761, 0.5459855198860168, 0.18468590080738068, 0.0395040400326252, 0.2983528673648834, -0.12800537049770355, -0.24065981805324554, 0.13325516879558563...
func matchPattern(fp string, patterns []MapPattern) (string, bool, error) { fp, err := realpath.Realpath(fp) if err != nil { return "", false, Err(fmt.Errorf("failed to get the real path: %w", err).Error()) } for _, pattern := range patterns { if pattern.Regex.MatchString(fp) { matches := pattern.Regex.F...
[ -0.1125788688659668, -0.9197588562965393, 0.7484419941902161, -0.03689198195934296, -0.36090874671936035, -0.32133370637893677, 0.13088259100914001, 0.6375793218612671, -0.18171140551567078, 0.3267466127872467, 0.15279296040534973, -0.7570371627807617, 0.0245392844080925, 0.714458584785461...
func (m Map) String() string { return "project-map-detector" }
[ -0.018133103847503662, -1.298495888710022, 0.1911940574645996, 0.5826142430305481, -0.6732045412063599, 1.5098522901535034, -0.06932545453310013, -0.6195672154426575, 0.15593038499355316, -0.4430411458015442, 0.6534563899040222, 0.30984553694725037, 0.588549792766571, 0.18934236466884613, ...
func (d *DependencyDisableAutoOnline) Disrupt(s string) bool { return s == "DisableGatewayAutoOnline" }
[ 0.37518310546875, -0.40873849391937256, 0.226497620344162, 0.05450204387307167, -1.2982771396636963, 0.8342381715774536, -0.1451781690120697, 0.707371175289154, 0.35280841588974, 0.1515335589647293, -0.07392643392086029, -0.132100909948349, -0.32601258158683777, 0.581742525100708, -0.311...
func NewRobertaLMHead(p *nn.Path, config *bert.BertConfig) *RobertaLMHead { dense := nn.NewLinear(p.Sub("dense"), config.HiddenSize, config.HiddenSize, nn.DefaultLinearConfig()) layerNormConfig := nn.DefaultLayerNormConfig() layerNormConfig.Eps = 1e-12 layerNorm := nn.NewLayerNorm(p.Sub("layer_norm"), []int64{conf...
[ 0.5374384522438049, -0.7935134768486023, 0.7190026640892029, -0.11752965301275253, -0.6529257297515869, 0.39358389377593994, -0.07452265173196793, 0.0378306545317173, 0.038052696734666824, 0.25453832745552063, -0.722784161567688, 0.6942626237869263, -0.3512013554573059, -0.1576593965291977...
func (rh *RobertaLMHead) Forward(hiddenStates *ts.Tensor) *ts.Tensor { gelu := util.NewGelu() appliedDense := hiddenStates.Apply(rh.dense) geluFwd := gelu.Fwd(appliedDense) appliedLN := geluFwd.Apply(rh.layerNorm) appliedDecoder := appliedLN.Apply(rh.decoder) appliedBias := appliedDecoder.MustAdd(rh.bias, true) ...
[ 0.6499269008636475, -0.08562052249908447, 0.5689113736152649, -0.23303833603858948, 0.12010928243398666, 0.775716245174408, 0.20451003313064575, 0.24842435121536255, 0.38111940026283264, -0.9538246989250183, -0.42174863815307617, 0.58918297290802, -0.21791334450244904, -0.03519505262374878...
func NewRobertaForMaskedLM(p *nn.Path, config *bert.BertConfig) *RobertaForMaskedLM { roberta := bert.NewBertModel(p.Sub("roberta"), config) lmHead := NewRobertaLMHead(p.Sub("lm_head"), config) return &RobertaForMaskedLM{ roberta: roberta, lmHead: lmHead, } }
[ 0.6403698325157166, -0.708921492099762, 0.16873040795326233, 0.5861358046531677, -0.1156219094991684, -0.3627452850341797, 0.33297258615493774, -0.6979053616523743, -0.6879925727844238, -0.3760930895805359, -0.3657008707523346, 0.23918737471103668, -0.2141391783952713, 0.17770588397979736,...
func (mlm *RobertaForMaskedLM) Load(modelNameOrPath string, config interface{ pretrained.Config }, params map[string]interface{}, device gotch.Device) error { var urlOrFilename string // If modelName, infer to default configuration filename: if modelFile, ok := pretrained.RobertaModels[modelNameOrPath]; ok { urlOr...
[ -0.23977696895599365, -0.08034997433423996, 0.5363738536834717, 0.19764524698257446, -0.7473154067993164, 0.5175198316574097, 0.24313239753246307, 0.5173690915107727, -0.536959171295166, -0.08172657340765, -0.6273350119590759, 0.001126863295212388, -0.391319215297699, 0.18518085777759552, ...
func (mlm *RobertaForMaskedLM) Forward(inputIds, mask, tokenTypeIds, positionIds, inputEmbeds, encoderHiddenStates, encoderMask *ts.Tensor, train bool) (output *ts.Tensor, hiddenStates, attentions []*ts.Tensor, err error) { hiddenState, _, allHiddenStates, allAttentions, err := mlm.roberta.ForwardT(inputIds, mask, to...
[ 0.11984208971261978, 0.1744098961353302, 0.4081651568412781, 0.12488513439893723, -0.20789267122745514, 0.21643012762069702, 0.17477551102638245, -0.2516212463378906, -0.29317736625671387, -0.3737097382545471, -0.5534912943840027, 0.7555441856384277, 0.2743634581565857, 0.20602303743362427...
func NewRobertaClassificationHead(p *nn.Path, config *bert.BertConfig) *RobertaClassificationHead { dense := nn.NewLinear(p.Sub("dense"), config.HiddenSize, config.HiddenSize, nn.DefaultLinearConfig()) numLabels := int64(len(config.Id2Label)) outProj := nn.NewLinear(p.Sub("out_proj"), config.HiddenSize, numLabels, n...
[ -0.39601534605026245, -0.5470093488693237, 0.5622819066047668, 0.35800108313560486, -0.23565278947353363, 0.5895420908927917, 0.30568134784698486, -0.00012396507372613996, -0.6814599633216858, 0.4039614796638489, -0.6892286539077759, 0.6912470459938049, -0.2158699631690979, -0.210336312651...
func (ch *RobertaClassificationHead) ForwardT(hiddenStates *ts.Tensor, train bool) *ts.Tensor { appliedDO1 := hiddenStates.MustSelect(1, 0, false).ApplyT(ch.dropout, train) appliedDense := appliedDO1.Apply(ch.dense) tanhTs := appliedDense.MustTanh(false) appliedDO2 := tanhTs.ApplyT(ch.dropout, train) retVal := app...
[ 0.3684059679508209, 0.31072527170181274, 0.7055882215499878, -0.6131287813186646, 0.06690080463886261, 0.7775059938430786, 0.487542062997818, -0.27567851543426514, -0.8072180151939392, 0.007416543550789356, -0.32091155648231506, 0.10823693126440048, 0.6279898285865784, -0.4449688792228699,...
func NewRobertaForSequenceClassification(p *nn.Path, config *bert.BertConfig) *RobertaForSequenceClassification { roberta := bert.NewBertModel(p.Sub("roberta"), config) classifier := NewRobertaClassificationHead(p.Sub("classifier"), config) return &RobertaForSequenceClassification{ roberta: roberta, classifi...
[ -0.5475443005561829, -0.8884660005569458, 0.15085181593894958, 0.08585887402296066, 0.30071696639060974, -0.7927014231681824, 0.6709312796592712, 0.3179233968257904, -0.2664000689983368, -0.24169862270355225, -0.7069597840309143, 0.9960464835166931, -0.127225860953331, 0.3011712431907654, ...
func (sc *RobertaForSequenceClassification) Load(modelNameOrPath string, config interface{ pretrained.Config }, params map[string]interface{}, device gotch.Device) error { var urlOrFilename string // If modelName, infer to default configuration filename: if modelFile, ok := pretrained.RobertaModels[modelNameOrPath];...
[ -0.7706264853477478, -0.24557502567768097, 0.5592941045761108, 0.2295333296060562, -0.0293539147824049, 0.24052897095680237, 0.6423127055168152, 0.7503117918968201, -0.6818149089813232, 0.04862326383590698, -0.7997052073478699, 0.21934640407562256, -0.222245991230011, 0.318816602230072, ...
func (sc *RobertaForSequenceClassification) ForwardT(inputIds, mask, tokenTypeIds, positionIds, inputEmbeds *ts.Tensor, train bool) (labels *ts.Tensor, hiddenStates, attentions []*ts.Tensor, err error) { hiddenState, _, hiddenStates, attentions, err := sc.roberta.ForwardT(inputIds, mask, tokenTypeIds, positionIds, in...
[ -0.22950029373168945, 0.04920826479792595, 0.43736380338668823, -0.47868046164512634, 0.36700284481048584, 0.20363309979438782, 0.3752899169921875, -0.6724015474319458, -0.7078807950019836, 0.3158053755760193, -0.7476295232772827, 0.36038580536842346, 0.610934853553772, -0.4149158298969269...
func NewRobertaForMultipleChoice(p *nn.Path, config *bert.BertConfig) *RobertaForMultipleChoice { roberta := bert.NewBertModel(p.Sub("roberta"), config) dropout := util.NewDropout(config.HiddenDropoutProb) classifier := nn.NewLinear(p.Sub("classifier"), config.HiddenSize, 1, nn.DefaultLinearConfig()) return &Rober...
[ -0.301685094833374, -0.6195077300071716, 0.34519287943840027, 0.40357524156570435, 0.5247595906257629, 0.3484417498111725, -0.024377163499593735, -0.2208377718925476, -0.9518064260482788, 0.21275368332862854, -0.7086670398712158, 0.412125825881958, 0.14699038863182068, 0.47739410400390625,...
func (mc *RobertaForMultipleChoice) Load(modelNameOrPath string, config interface{ pretrained.Config }, params map[string]interface{}, device gotch.Device) error { var urlOrFilename string // If modelName, infer to default configuration filename: if modelFile, ok := pretrained.RobertaModels[modelNameOrPath]; ok { ...
[ -0.6785867810249329, -0.14284466207027435, 0.6582748889923096, 0.2177029401063919, -0.15993192791938782, 0.6388630270957947, 0.3964480459690094, 0.4820871651172638, -0.6100301742553711, 0.20839281380176544, -0.6252458691596985, 0.2361934930086136, -0.24163560569286346, 0.3860223591327667, ...
func (mc *RobertaForMultipleChoice) ForwardT(inputIds, mask, tokenTypeIds, positionIds *ts.Tensor, train bool) (output *ts.Tensor, hiddenStates, attentions []*ts.Tensor, err error) { numChoices := inputIds.MustSize()[1] inputIdsSize := inputIds.MustSize() flatInputIds := inputIds.MustView([]int64{-1, inputIdsSize[...
[ -0.25121980905532837, -0.22996342182159424, 0.8559117317199707, -0.8856936693191528, -0.06952758878469467, -0.016922002658247948, 1.0983966588974, -0.547823965549469, -0.4673243761062622, -0.06816762685775757, -0.029045533388853073, 1.0036524534225464, 0.31468144059181213, -0.3112264871597...
func NewRobertaForTokenClassification(p *nn.Path, config *bert.BertConfig) *RobertaForTokenClassification { roberta := bert.NewBertModel(p.Sub("roberta"), config) dropout := util.NewDropout(config.HiddenDropoutProb) numLabels := int64(len(config.Id2Label)) classifier := nn.NewLinear(p.Sub("classifier"), config.Hidd...
[ -0.1268049031496048, -0.45049312710762024, 0.16494536399841309, -0.26215073466300964, 0.0018496554112061858, -0.37359923124313354, -0.13017712533473969, 0.05477933585643768, -0.8371726274490356, -0.45348256826400757, -0.782684862613678, 0.7249476313591003, 0.18865346908569336, 0.3669300973...
func (tc *RobertaForTokenClassification) Load(modelNameOrPath string, config interface{ pretrained.Config }, params map[string]interface{}, device gotch.Device) error { var urlOrFilename string // If modelName, infer to default configuration filename: if modelFile, ok := pretrained.RobertaModels[modelNameOrPath]; ok...
[ -0.6546895503997803, -0.14650855958461761, 0.6395753622055054, -0.2383251041173935, -0.3577151894569397, 0.40307649970054626, 0.31268957257270813, 0.6449666023254395, -0.8491374254226685, 0.006586914416402578, -0.8546888828277588, 0.276644229888916, -0.11318028718233109, 0.2158458232879638...
func (tc *RobertaForTokenClassification) ForwardT(inputIds, mask, tokenTypeIds, positionIds, inputEmbeds *ts.Tensor, train bool) (output *ts.Tensor, hiddenStates, attentions []*ts.Tensor, err error) { hiddenState, _, hiddenStates, attentions, err := tc.roberta.ForwardT(inputIds, mask, tokenTypeIds, positionIds, inputE...
[ 0.021132394671440125, 0.21577684581279755, 0.4776645302772522, -0.4641624391078949, 0.0432620532810688, 0.16656602919101715, 0.40713322162628174, -0.5325106382369995, -0.773563027381897, 0.1057698205113411, -0.6911668181419373, 0.44697877764701843, 0.748419463634491, -0.3135325014591217, ...
func NewRobertaForQuestionAnswering(p *nn.Path, config *bert.BertConfig) *RobertaForQuestionAnswering { roberta := bert.NewBertModel(p.Sub("roberta"), config) numLabels := int64(2) qaOutputs := nn.NewLinear(p.Sub("qa_outputs"), config.HiddenSize, numLabels, nn.DefaultLinearConfig()) return &RobertaForQuestionAnswe...
[ 0.4516987204551697, -0.7675996422767639, 0.13222920894622803, 0.1345502883195877, -0.29833748936653137, 0.07688408344984055, 0.7459100484848022, -0.45378443598747253, -0.8580567836761475, -0.9527649879455566, -0.1802065074443817, 0.05760059505701065, -0.5425949692726135, -0.113008603453636...
func (qa *RobertaForQuestionAnswering) Load(modelNameOrPath string, config interface{ pretrained.Config }, params map[string]interface{}, device gotch.Device) error { var urlOrFilename string // If modelName, infer to default configuration filename: if modelFile, ok := pretrained.RobertaModels[modelNameOrPath]; ok {...
[ -0.07967986911535263, -0.40871667861938477, 0.6027047634124756, 0.0009098590817302465, -0.6902878880500793, 0.5881605744361877, 0.703507125377655, 0.03651459887623787, -0.5507664084434509, -0.33828428387641907, -0.3423319160938263, -0.19869859516620636, -0.42048609256744385, 0.016563508659...
func (qa *RobertaForQuestionAnswering) ForwardT(inputIds, mask, tokenTypeIds, positionIds, inputEmbeds *ts.Tensor, train bool) (startScores, endScores *ts.Tensor, hiddenStates, attentions []*ts.Tensor, err error) { hiddenState, _, hiddenStates, attentions, err := qa.roberta.ForwardT(inputIds, mask, tokenTypeIds, posit...
[ 0.044429417699575424, -0.3477747142314911, 0.5979933738708496, -0.46752387285232544, -0.011051268316805363, 0.4038959741592407, 0.5742979049682617, -1.246148943901062, -0.6474749445915222, 0.23789292573928833, -0.3140600323677063, 0.18054187297821045, 0.06651875376701355, -0.36290967464447...
func (a *App) NotifyWithHipchat(body string, statusCode int) { if a.HipchatRoom == "" || a.HipchatToken == "" { return } url := "https://api.hipchat.com/v2/room/" + a.HipchatRoom + "/notification?auth_token=" + a.HipchatToken color := "red" if statusCode == 200 { color = "green" } input, err := json.Marsha...
[ -0.06305527687072754, -0.9642845988273621, 0.7944709658622742, -0.22129522264003754, 0.1493542492389679, -0.024621939286589622, -0.658481776714325, -0.2579285204410553, -0.05941712111234665, 0.05375991761684418, -1.1939045190811157, 0.6600862741470337, 0.6807307004928589, 1.186670780181884...
func (a *App) NotifyWithMail(body string, statusCode int) { from := a.HealthcheckNotifier.MailAddressFrom server := a.HealthcheckNotifier.SMTPServer to := a.MailAddressToDown subject := "[DOWN] " + a.Name if statusCode == 200 { to = a.MailAddressToUp subject = "[UP] " + a.Name } if server == "" || from == ""...
[ 0.21853990852832794, -0.1887388825416565, 0.7417489886283875, -0.17064152657985687, -0.172321155667305, 0.13680729269981384, -0.5203841328620911, 0.10278692096471786, 0.05893506854772568, 0.1979638636112213, -0.601384162902832, 1.4061237573623657, 0.14758922159671783, 0.5888535380363464, ...
func Run(cfg config.Config, store storage.Store, back backend.Backend, logger log.Logger) int { // Build queue writer. qw, err := sqs.NewWriter(cfg.SQSWriter.ARN, cfg.SQSWriter.Endpoint, logger) if err != nil { logger.Errorf("error creating SQS writer: %+v", err) return 1 } // Build queue reader. var maxTime...
[ -0.1877228319644928, -0.7257273197174072, 0.7970321178436279, -0.5172251462936401, -0.5504950881004333, -1.053933024406433, 0.44654712080955505, -0.2104683816432953, 0.29933813214302063, 0.19683390855789185, -0.09180395305156708, 0.293590247631073, -0.24025139212608337, -0.3132891058921814...
func RunWithQueues(cfg config.Config, store storage.Store, back backend.Backend, statesQueue queue.Writer, jobsQueue AgentQueueReader, logger log.Logger) int { // Build state updater. stateUpdater := stateupdater.New(statesQueue) updater := struct { *stateupdater.Updater storage.Store }{stateUpdater, store} /...
[ -0.2083476185798645, -0.4693400263786316, 0.7328653335571289, -0.7779425978660583, -0.5168511271476746, -0.9807493090629578, -0.12378853559494019, -0.28645965456962585, 0.10654887557029724, 0.3016860783100128, -0.031018882989883423, -0.07976409047842026, 0.18618981540203094, 0.556216001510...
func newJobRunner(cfg config.Config, back backend.Backend, updater jobrunner.CheckStateUpdater, logger log.Logger) (*jobrunner.Runner, error) { // Build the aborted checks component that will be used to know if a check // has been aborted or not before starting to execute it. var ( err error abortedChe...
[ 0.6231797337532043, -0.5764718055725098, 0.6871128678321838, 0.42237237095832825, -0.9673846960067749, 0.24969032406806946, -0.20596875250339508, 0.32087981700897217, 0.045079778879880905, -0.3994479179382324, 0.5907480120658875, 0.4034276604652405, -0.7126417756080627, 0.35224780440330505...
func run(cfg config.Config, jrunner *jobrunner.Runner, updater api.CheckStateUpdater, jobsQueue queue.Reader, logger log.Logger) error { // Build metrics component. metrics := metrics.NewMetrics(logger, cfg.DataDog, jrunner) // Create a context to orchestrate the shutdown of the // different components. ctx, canc...
[ 0.05014300346374512, -0.7975280284881592, 0.8673111796379089, -0.4206864833831787, 0.0796302855014801, -0.054225191473960876, 0.022178737446665764, 0.059823647141456604, 0.10516946017742157, -0.002638955367729068, 0.07062659412622452, 0.6287417411804199, 0.471814900636673, 0.55384349822998...
func NewStorageConfig(ctx context.Context, c client.Reader, ns string) (*StorageConfig, error) { var configMap corev1.ConfigMap key := client.ObjectKey{ Name: constants.ConfigMapS3Storage, Namespace: ns, } if err := c.Get(ctx, key, &configMap); errors.IsNotFound(err) { // Try koalja-system namespace ke...
[ 0.24639911949634552, -0.6047524213790894, 0.4414369761943817, 0.3566623628139496, -0.9093268513679504, -0.33973005414009094, -0.31954920291900635, -0.6122525334358215, 0.14622703194618225, 1.1717807054519653, -0.5222044587135315, -0.16403573751449585, 0.14655011892318726, 0.750062525272369...
func (sc StorageConfig) Equals(other StorageConfig) bool { return reflect.DeepEqual(sc, other) }
[ -0.7643111944198608, -0.002506260760128498, 0.29560643434524536, 0.3688950538635254, 0.07652366906404495, -0.29804539680480957, -0.6363415718078613, -0.810401201248169, -0.08916213363409042, 0.35078123211860657, -1.6799476146697998, 0.24919705092906952, 0.18319982290267944, 0.3801509439945...
func newStorageConfigFromConfigMap(ctx context.Context, configMap *corev1.ConfigMap, c client.Reader, ns string) (*StorageConfig, error) { var sc StorageConfig hasDefault := false for k, v := range configMap.Data { var bc BucketConfig err := yaml.Unmarshal([]byte(v), &bc) if err != nil { return nil, err }...
[ 0.17289216816425323, -0.31696048378944397, 0.41491103172302246, 0.44933828711509705, 0.2216143012046814, -0.5581712126731873, -0.3382143974304199, -0.40274778008461, -0.23950627446174622, 0.8684842586517334, -0.817082941532135, -0.31663575768470764, -0.3028320074081421, 0.4831036329269409,...
func (bc *BucketConfig) fixEndpoint() { if u, err := url.Parse(bc.Endpoint); err == nil { bc.Endpoint = u.Host if strings.ToLower(u.Scheme) == "https" { bc.Secure = true } } }
[ -0.040716223418712616, -0.19213145971298218, 0.5254876613616943, 0.8517639636993408, 0.9793723821640015, 0.2986323833465576, -0.1669909954071045, 1.1193516254425049, -0.6881972551345825, 0.31961238384246826, -0.6138995289802551, 0.5626329779624939, -0.6133051514625549, 0.689180314540863, ...
func (bc BucketConfig) hash() string { source := strings.ToLower(bc.Name + "/" + bc.Endpoint) hash := sha1.Sum([]byte(source)) return strings.ToLower(hex.EncodeToString(hash[0:6])) }
[ 0.5534164309501648, 0.07317423820495605, 0.5298250913619995, -0.011835066601634026, -0.15489904582500458, 0.9317393898963928, -0.4055006504058838, 0.3406677544116974, -0.3228680491447449, 0.1496748924255371, -0.9705556631088257, 0.4450263977050781, -0.32456403970718384, -0.5183056592941284...