text
stringlengths
11
6.3k
embedding
listlengths
768
768
func newTPMManagerBinary(r CmdRunner) *tpmManagerBinary { return &tpmManagerBinary{r} }
[ -0.17656658589839935, -1.3437784910202026, 0.13525760173797607, 0.18641427159309387, -0.8109707832336426, 0.4983782172203064, -0.8837851285934448, -0.8163714408874512, -0.5010220408439636, -0.582963228225708, -0.6616111993789673, -0.21886228024959564, -0.8717329502105713, 1.617529273033142...
func (c *tpmManagerBinary) call(ctx context.Context, args ...string) ([]byte, error) { return c.runner.Run(ctx, "tpm_manager_client", args...) }
[ -0.5616145730018616, 0.2554011642932892, 0.4854438900947571, -0.5121337175369263, -0.18120475113391876, 0.6780450344085693, -0.6398452520370483, -1.0240957736968994, -1.1065633296966553, 0.13014627993106842, -0.25670409202575684, 0.44942450523376465, -1.115225076675415, 0.6716141700744629,...
func (c *tpmManagerBinary) defineSpace(ctx context.Context, size int, bindToPCR0 bool, index, attributes, password string) ([]byte, error) { args := []string{"define_space", "--index=" + index, "--size=" + strconv.Itoa(size)} if bindToPCR0 { args = append(args, "--bind_to_pcr0") } if attributes != "" { args = a...
[ -0.05483384430408478, -0.07057635486125946, 0.7888112664222717, 0.19082093238830566, -0.028683913871645927, -0.42195671796798706, -0.27380964159965515, -0.7405135631561279, 0.7695409655570984, -0.6505602598190308, -0.3468056917190552, 0.04950953274965286, -0.8072201609611511, 1.07054865360...
func (c *tpmManagerBinary) destroySpace(ctx context.Context, index string) ([]byte, error) { return c.call(ctx, "destroy_space", "--index="+index) }
[ -0.7247903347015381, 0.9136232137680054, 0.5847254991531372, -0.2966224253177643, 0.6779775023460388, -0.4437739849090576, 0.03572310507297516, -1.121065616607666, 0.8427470326423645, -0.22970683872699738, -0.861072301864624, -0.07635319232940674, -1.166346788406372, 0.773497998714447, 0...
func (c *tpmManagerBinary) writeSpace(ctx context.Context, index, file, password string) ([]byte, error) { args := []string{"write_space", "--index=" + index, "--file=" + file} if password != "" { args = append(args, "--password="+password) } return c.call(ctx, args...) }
[ -0.6908611059188843, -0.0540466383099556, 0.5894901156425476, 0.044478002935647964, 0.713819682598114, -0.06161839887499809, 0.05456428602337837, -0.3267258107662201, 0.19038334488868713, -0.28492245078086853, 0.06796342134475708, 0.2843848764896393, -1.125386357307434, 0.8189491033554077,...
func (c *tpmManagerBinary) readSpace(ctx context.Context, index, file, password string) ([]byte, error) { args := []string{"read_space", "--index=" + index, "--file=" + file} if password != "" { args = append(args, "--password="+password) } return c.call(ctx, args...) }
[ -0.025986261665821075, 0.3567849099636078, 0.7846955060958862, 0.5141103267669678, 0.2364317923784256, 0.11958940327167511, -0.6257434487342834, -0.3457919657230377, 0.14950443804264069, -0.1075001135468483, 0.40887609124183655, 0.5400336384773254, -0.7969980835914612, 0.26150956749916077,...
func (c *tpmManagerBinary) getDAInfo(ctx context.Context) ([]byte, error) { return c.call(ctx, "get_da_info") }
[ -0.11268824338912964, 0.6383355259895325, 0.47726520895957947, 0.48294147849082947, 0.32107609510421753, 0.5616120100021362, 0.28410935401916504, -0.9864928126335144, -0.7823507189750671, -1.2741808891296387, -0.6826326847076416, 0.3114646077156067, -0.14830535650253296, 1.016516923904419,...
func (c *tpmManagerBinary) resetDALock(ctx context.Context) ([]byte, error) { return c.call(ctx, "reset_da_lock") }
[ -0.43859732151031494, 1.454186201095581, 0.47109952569007874, 0.15997247397899628, 0.6451758146286011, 0.0312221497297287, 0.6144558191299438, 0.33369359374046326, 0.00847999844700098, -0.5626572966575623, -0.26759013533592224, 1.170636773109436, -0.5420261025428772, -0.2541361451148987, ...
func (c *tpmManagerBinary) takeOwnership(ctx context.Context) ([]byte, error) { return c.call(ctx, "take_ownership") }
[ 0.28953227400779724, 0.4109664559364319, 0.4341726303100586, 1.3753753900527954, 0.42949366569519043, -0.2984308898448944, 0.6869285702705383, -0.8012784123420715, 0.3058476150035858, -0.3303511440753937, -0.4696924388408661, -0.17717614769935608, -1.0574607849121094, 0.18949678540229797, ...
func (c *tpmManagerBinary) status(ctx context.Context) ([]byte, error) { return c.call(ctx, "status") }
[ -0.419705867767334, -0.3863353729248047, 0.2827495336532593, -0.09767553955316544, 0.34851253032684326, 0.34781232476234436, -0.5659082531929016, -0.6714965105056763, 0.18734830617904663, -0.09119344502687454, -0.9709885120391846, 0.21254798769950867, -1.1825114488601685, 1.447805047035217...
func (c *tpmManagerBinary) nonsensitiveStatus(ctx context.Context) ([]byte, error) { return c.call(ctx, "status", "--nonsensitive") }
[ 0.05055772513151169, -0.14818063378334045, 0.24012291431427002, -0.7210631966590881, -0.2216135412454605, 0.6572745442390442, -0.8645460605621338, -1.0253698825836182, -0.30504652857780457, 0.06903960555791855, -0.8548939228057861, -0.2780992090702057, -0.9009687900543213, 0.83221030235290...
func (c *tpmManagerBinary) nonsensitiveStatusIgnoreCache(ctx context.Context) ([]byte, error) { return c.call(ctx, "status", "--nonsensitive", "--ignore_cache") }
[ -0.18475310504436493, 0.38251322507858276, 0.3073107600212097, -0.08352114260196686, -0.5622959136962891, 1.1093369722366333, -0.5946635603904724, -0.7994776368141174, 0.1211124062538147, 0.21436531841754913, -0.8734799027442932, -0.5936595797538757, -0.5867387056350708, 0.5132532715797424...
func (c *tpmManagerBinary) clearOwnerPassword(ctx context.Context) ([]byte, error) { return c.call(ctx, "clear_owner_password") }
[ -0.287184476852417, 0.03855818137526512, 0.5069110989570618, 1.5355972051620483, -0.47142624855041504, 0.24487587809562683, 0.4694445729255676, -1.1244745254516602, 0.2418859750032425, 0.7546043992042542, -0.6348631381988525, 0.8981302976608276, -0.24124658107757568, 0.7583367824554443, ...
func (r *NodeReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, err error) { var node filecoinv1alpha1.Node if err = r.Client.Get(ctx, req.NamespacedName, &node); err != nil { err = client.IgnoreNotFound(err) return } // default the node if webhooks are disabled if !shared.IsWe...
[ -0.4214255213737488, 0.6240587830543518, 0.7086341977119446, -0.42082974314689636, 0.7438017129898071, -0.4716726839542389, -0.24533167481422424, 0.6483113169670105, -0.46798571944236755, 0.030589018017053604, 0.3847561180591583, -0.24801796674728394, -1.0092406272888184, 1.041731953620910...
func (r *NodeReconciler) updateStatus(ctx context.Context, node *filecoinv1alpha1.Node) error { // TODO: update after multi-client support node.Status.Client = "lotus" if err := r.Status().Update(ctx, node); err != nil { r.Log.Error(err, "unable to update filecoin node status") return err } return nil }
[ -0.319138765335083, 0.15226684510707855, 0.3016713261604309, -0.9328726530075073, 0.20697429776191711, -0.15645426511764526, -0.15506090223789215, 0.9373701214790344, -0.34664681553840637, 0.34794387221336365, -0.3919253349304199, 0.505151093006134, -0.4319106340408325, 0.39010804891586304...
func (r *NodeReconciler) reconcilePVC(ctx context.Context, node *filecoinv1alpha1.Node) error { pvc := &corev1.PersistentVolumeClaim{ ObjectMeta: metav1.ObjectMeta{ Name: node.Name, Namespace: node.Namespace, }, } _, err := ctrl.CreateOrUpdate(ctx, r.Client, pvc, func() error { if err := ctrl.SetCo...
[ 0.17418798804283142, -0.23772020637989044, 0.8623484969139099, -1.1005492210388184, 0.4771513044834137, -0.1720602810382843, -0.014167138375341892, 0.23463083803653717, 0.1468297243118286, -0.12304480373859406, 0.4833609461784363, -0.055015742778778076, -0.018091389909386635, 0.63157916069...
func (r *NodeReconciler) specPVC(node *filecoinv1alpha1.Node, pvc *corev1.PersistentVolumeClaim) { request := corev1.ResourceList{ corev1.ResourceStorage: resource.MustParse(node.Spec.Resources.Storage), } // spec is immutable after creation except resources.requests for bound claims if !pvc.CreationTimestamp.Is...
[ 0.31950777769088745, -0.5589532256126404, 0.7643117308616638, -1.2677717208862305, 0.050853125751018524, 0.22527064383029938, -0.14024655520915985, 0.2910219728946686, 0.13040870428085327, 0.04786776751279831, 0.6498922109603882, 0.7081906199455261, 0.6731336712837219, -0.3576449155807495,...
func (r *NodeReconciler) reconcileService(ctx context.Context, node *filecoinv1alpha1.Node) error { svc := &corev1.Service{ ObjectMeta: metav1.ObjectMeta{ Name: node.Name, Namespace: node.Namespace, }, } _, err := ctrl.CreateOrUpdate(ctx, r.Client, svc, func() error { if err := ctrl.SetControllerR...
[ -0.20054768025875092, 0.22660724818706512, 0.6617568731307983, -1.1069201231002808, 1.0011353492736816, -0.0934080109000206, 0.18560069799423218, -0.04234211891889572, -0.00945037417113781, 0.057273589074611664, 0.2646997272968292, -0.12995900213718414, -0.46816587448120117, 0.910973966121...
func (r *NodeReconciler) specConfigmap(node *filecoinv1alpha1.Node, configmap *corev1.ConfigMap, configToml string) { labels := map[string]string{ "name": "node", "instance": node.Name, } configmap.ObjectMeta.Labels = labels if configmap.Data == nil { configmap.Data = map[string]string{} } configmap....
[ -1.103600263595581, -0.10186509788036346, 0.3965754806995392, -1.2942683696746826, 0.16993854939937592, -0.5005688071250916, -0.11693913489580154, 1.0432683229446411, -0.09071756154298782, 0.7566333413124084, -0.31329041719436646, -0.09951375424861908, 0.4910914897918701, 0.030220760032534...
func (r *NodeReconciler) reconcileConfigmap(ctx context.Context, node *filecoinv1alpha1.Node) error { configmap := &corev1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ Name: node.Name, Namespace: node.Namespace, }, } // filecoin generates config.toml file from node spec configToml, err := ConfigFromSp...
[ -0.7615078687667847, 0.12245415896177292, 0.605626106262207, -0.615515410900116, 0.7094193696975708, -0.5909222960472107, 0.38609033823013306, 0.5658267140388489, -0.13836529850959778, 0.6724942922592163, -0.472537100315094, -0.4227071702480316, -0.14325442910194397, 0.8712928891181946, ...
func (r *NodeReconciler) reconcileStatefulSet(ctx context.Context, node *filecoinv1alpha1.Node) error { sts := &appsv1.StatefulSet{ ObjectMeta: metav1.ObjectMeta{ Name: node.Name, Namespace: node.Namespace, }, } _, err := ctrl.CreateOrUpdate(ctx, r.Client, sts, func() error { if err := ctrl.SetCont...
[ 0.17310333251953125, 0.35195764899253845, 0.6195894479751587, -1.1114202737808228, -0.1336294561624527, -0.607787013053894, 0.09278464317321777, -0.3866065442562103, 0.06282086670398712, 0.35813769698143005, 0.02080458216369152, -0.3411467373371124, 0.129232257604599, 0.7365113496780396, ...
func (r *NodeReconciler) specService(node *filecoinv1alpha1.Node, svc *corev1.Service) { labels := map[string]string{ "name": "node", "instance": node.Name, } svc.ObjectMeta.Labels = labels svc.Spec.Ports = []corev1.ServicePort{ { Name: "api", Port: int32(node.Spec.APIPort), TargetP...
[ -0.5157120823860168, -0.3077189028263092, 0.5386737585067749, -2.232038736343384, 0.24991825222969055, 0.08818542957305908, 0.22320929169654846, 0.24693609774112701, -0.6460676193237305, 0.35260918736457825, 0.2461753785610199, 0.6240350604057312, 0.13537123799324036, -0.1732083559036255, ...
func (r *NodeReconciler) specStatefulSet(node *filecoinv1alpha1.Node, sts *appsv1.StatefulSet) error { labels := map[string]string{ "name": "node", "instance": node.Name, } image, err := LotusImage(node.Spec.Network) if err != nil { return err } sts.ObjectMeta.Labels = labels sts.Spec = appsv1.State...
[ 0.2114362269639969, -0.3711960017681122, 0.6636339426040649, -1.4586461782455444, -0.29170966148376465, -0.3143203854560852, -0.14687886834144592, -0.07284849882125854, -0.2571975886821747, 0.5762307047843933, -0.01782381162047386, 0.9334942102432251, 1.0267250537872314, 0.0852328613400459...
func (r *NodeReconciler) SetupWithManager(mgr ctrl.Manager) error { return ctrl.NewControllerManagedBy(mgr). For(&filecoinv1alpha1.Node{}). Owns(&appsv1.StatefulSet{}). Owns(&corev1.Service{}). Owns(&corev1.PersistentVolumeClaim{}). Complete(r) }
[ 0.49703022837638855, 0.10252027213573456, 0.6502909064292908, -0.8362246155738831, 0.05916009843349457, -1.2686750888824463, 0.05567733198404312, -0.28788211941719055, -0.35422393679618835, 0.05834587663412094, 0.6965817213058472, -0.3306152820587158, 0.04951360449194908, 1.183823943138122...
func (zap ChZap) Duration(provided *ChZap) time.Duration { //added *! //TODO write this method (1p) // my_duration := zap.Time //- provided.Time // fmt.Println(my_duration) duration := zap.Time.Sub(provided.Time) if duration < 0 { return provided.Time.Sub(zap.Time) } return duration }
[ -0.29723235964775085, -1.1255730390548706, 0.5029399991035461, 1.1991593837738037, -0.10296928882598877, 0.6849272847175598, 1.5865118503570557, 0.6129125952720642, 0.7893282175064087, 0.5229621529579163, -0.3783107101917267, -0.2123442143201828, -0.3611298203468323, 1.09260094165802, 0....
func New(client docker.Client, config *api.Config, fs fs.FileSystem, scripts build.ScriptsHandler, overrides build.Overrides) (*Layered, error) { excludePattern, err := regexp.Compile(config.ExcludeRegExp) if err != nil { return nil, err } d := docker.New(client, config.PullAuthentication, config.PushAuthenticat...
[ -0.008559470996260643, -0.052597127854824066, 0.4130054712295532, -0.1676594316959381, -0.9859472513198853, 0.8619317412376404, 0.38106656074523926, 0.45309916138648987, -0.11613960564136505, -0.7199768424034119, -0.6395896673202515, 0.14218029379844666, 0.02610738016664982, 1.064663767814...
func getDestination(config *api.Config) string { destination := config.Destination if len(destination) == 0 { destination = defaultDestination } return destination }
[ -0.8728542327880859, 0.34519869089126587, 0.5196393728256226, 0.44732746481895447, 1.1602756977081299, -0.4724869728088379, 0.08529046177864075, 0.6719061732292175, 0.07759250700473785, 1.0084456205368042, -0.1022953987121582, -0.4020146131515503, -0.04168566316366196, 0.34519141912460327,...
func checkValidDirWithContents(name string) bool { items, err := ioutil.ReadDir(name) if os.IsNotExist(err) { glog.Warningf("Unable to access directory %q: %v", name, err) } return !(err != nil || len(items) == 0) }
[ -0.2826448678970337, -0.2510915994644165, 0.7329450845718384, -0.014413569122552872, -0.9100260734558105, -0.020205654203891754, -0.12787827849388123, -0.44300007820129395, 0.565247118473053, -0.8123462200164795, 0.42561328411102295, -0.47097405791282654, 0.12168856710195541, 1.05864310264...
func (builder *Layered) CreateDockerfile(config *api.Config) error { buffer := bytes.Buffer{} user, err := builder.docker.GetImageUser(builder.config.BuilderImage) if err != nil { return err } scriptsDir := filepath.Join(getDestination(config), "scripts") sourcesDir := filepath.Join(getDestination(config), "s...
[ 0.3434115946292877, -0.2286752313375473, 0.7638969421386719, 0.12680748105049133, -0.19272473454475403, 0.31425395607948303, 1.227766752243042, -0.12189527601003647, -0.08008909225463867, 0.19237114489078522, 0.1777515411376953, 0.7542126178741455, 0.46589741110801697, 1.2676373720169067, ...
func (builder *Layered) Build(config *api.Config) (*api.Result, error) { buildResult := &api.Result{} if config.HasOnBuild && config.BlockOnBuild { buildResult.BuildInfo.FailureReason = utilstatus.NewFailureReason( utilstatus.ReasonOnBuildForbidden, utilstatus.ReasonMessageOnBuildForbidden, ) return buil...
[ 0.1451500654220581, 0.26604342460632324, 0.8161781430244446, 0.8202955722808838, -0.6081105470657349, 0.009484558366239071, 1.056740641593933, -0.18437090516090393, -0.6068631410598755, 0.14799314737319946, -0.45314598083496094, 0.47069084644317627, 0.11478567868471146, 1.3299205303192139,...
func (_m *StatusController) Healthz(w http.ResponseWriter, req *http.Request) { _m.Called(w, req) }
[ -0.849717378616333, -0.8853278756141663, 0.3557251989841461, 0.8322719931602478, 0.15812456607818604, 0.426306813955307, 1.1782116889953613, -0.45910537242889404, 0.8488802909851074, -0.7540708184242249, 0.15933489799499512, 0.2951067090034485, 0.9075605869293213, 0.775845468044281, -0.5...
func NewHTTPSRedirectServer(addr string) *http.Server { return newServer(addr, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { u := r.URL u.Scheme = "https" http.Redirect(w, r, u.String(), http.StatusMovedPermanently) })) }
[ -0.9373524188995361, -0.288021445274353, 0.40221524238586426, -0.41808590292930603, -0.5157393217086792, 0.2865411341190338, 0.5989789366722107, -0.387649267911911, 0.5071207880973816, -0.5709341168403625, -0.5470017790794373, 0.43175193667411804, 0.13833771646022797, 0.8364517092704773, ...
func Integer(number []byte) (value int) { num_len := len(number) if num_len < INTEGER_SIZE { number = append( make([]byte, INTEGER_SIZE-num_len), number..., ) } value = int(binary.BigEndian.Uint64(number)) return }
[ 0.18514059484004974, 0.8781061172485352, 0.5301778316497803, 0.32735148072242737, 0.08584354817867279, 0.39597970247268677, 0.27058055996894836, 0.21555432677268982, 0.46061357855796814, -0.22099977731704712, -0.5656782984733582, 0.1397610902786255, -0.2484963983297348, 1.1955602169036865,...
func NewPortRegistry(gameServers mpsv1alpha1.GameServerList, min, max int32, setupLog logr.Logger) (*PortRegistry, error) { pr := &PortRegistry{ HostPorts: make(map[int32]bool, max-min+1), Indexes: make([]int32, max-min+1), Min: min, Max: max, portRequests: make(chan struct{}, ...
[ -0.6758103966712952, 0.5653722286224365, 0.7303917407989502, -1.0613890886306763, 0.679931104183197, -0.7392820119857788, 0.22106879949569702, -0.5700754523277283, -0.1620631366968155, 0.07048734277486801, -0.7772770524024963, 0.7914369106292725, -0.013838344253599644, -0.01039662305265665...
func (pr *PortRegistry) GetNewPort() (int32, error) { pr.portRequests <- struct{}{} port := <-pr.portResponses if port == -1 { return -1, errors.New("cannot register a new port. No available ports") } return port, nil }
[ -0.024234581738710403, 0.768735945224762, 0.47396206855773926, 0.0000045615506678586826, 1.2793298959732056, -0.4277873635292053, 0.8232048153877258, -0.37577980756759644, 0.02330636978149414, -1.0534952878952026, -0.1820792257785797, 0.8207496404647827, -1.0778106451034546, 0.558039069175...
func (pr *PortRegistry) Stop() { close(pr.portRequests) close(pr.portResponses) }
[ -0.3974542021751404, -0.5052884817123413, 0.1960264891386032, -1.051936149597168, 1.1311136484146118, 1.3152354955673218, 0.9696899056434631, 0.6365416646003723, -0.3456689119338989, -0.5371017456054688, -0.004916689824312925, 0.5020920634269714, -0.8793556094169617, 0.22894713282585144, ...
func (pr *PortRegistry) DeregisterServerPorts(ports []int32) { for i := 0; i < len(ports); i++ { pr.HostPorts[ports[i]] = false } }
[ 0.02878638543188572, 0.3146319091320038, 0.4633657932281494, -0.2359265685081482, 0.6457028388977051, 1.0057342052459717, 1.1621391773223877, 0.17779690027236938, -0.1700553596019745, 0.28057801723480225, -1.2264816761016846, 0.3110634386539459, -1.5484755039215088, 0.396366685628891, -0...
func loadConfig() { file, err := os.Open("config.json") if err != nil { log.Fatalln("Cannot open config file", err) } decoder := json.NewDecoder(file) config = Configuration{} err = decoder.Decode(&config) if err != nil { log.Fatalln("Cannot get configuration from file", err) } }
[ 0.2675817310810089, -0.6710906624794006, 0.4716913402080536, -0.2463124394416809, -0.08500518649816513, 0.2752947211265564, -0.5464550256729126, 1.0342015027999878, -1.0951752662658691, 0.9054639339447021, -0.9219905734062195, 0.2468930035829544, -0.06642643362283707, 0.776728093624115, ...
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { client, endpoint, err := htransport.NewClient(ctx, opts...) if err != nil { return nil, err } s, err := New(client) if err != nil { return nil, err } if endpoint != "" { s.BasePath = endpoint } return s, nil }
[ 0.7979872822761536, -0.07137197256088257, 0.36163845658302307, 0.9688165783882141, 0.006810931488871574, 0.2543420195579529, 0.18590371310710907, -0.8061097860336304, -0.11680629104375839, 0.13265323638916016, -0.20734092593193054, 0.19352588057518005, -0.5449346303939819, -0.0237754024565...
func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } s := &Service{client: client, BasePath: basePath} s.Projects = NewProjectsService(s) return s, nil }
[ 0.23855382204055786, -0.07357656210660934, 0.10078996419906616, -0.1128607839345932, -0.4171268343925476, 0.5795781016349792, 0.702849268913269, -0.5645678043365479, -0.579829216003418, -0.3180004954338074, -0.040928784757852554, 0.5764301419258118, -0.133445143699646, 0.6508457660675049, ...
func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall { c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c }
[ -1.1168829202651978, 0.2940950393676758, 0.35523438453674316, -0.22209535539150238, -0.13076260685920715, 0.2549394369125366, 0.5604180693626404, -0.08951322734355927, -0.019680792465806007, -0.14378443360328674, -0.34294819831848145, 0.19250981509685516, -0.20180518925189972, -0.403282225...
func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c }
[ -0.8901963233947754, 0.9252799153327942, 0.19878336787223816, -0.7394738793373108, 1.1730905771255493, 1.1493719816207886, 0.04652121663093567, 0.04878167435526848, -0.05192059651017189, -0.5917701721191406, 0.2694997787475586, -0.2919537127017975, -0.13347145915031433, 0.14005494117736816...
func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall { c.ifNoneMatch_ = entityTag return c }
[ 0.10486064851284027, 0.6591694951057434, 0.14066970348358154, -0.6543235182762146, 0.5068526864051819, -0.1172323077917099, 0.4927908778190613, 0.24758504331111908, -0.030699508264660835, -0.25022393465042114, -0.025818338617682457, -0.5066441893577576, -0.08321766555309296, 1.054838895797...
func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall { c.ctx_ = ctx return c }
[ -0.15839843451976776, 0.3885137736797333, 0.26239195466041565, -0.6006773114204407, 0.3886899948120117, 1.4331097602844238, 0.46704262495040894, 0.05098328739404678, 0.9923486113548279, -0.7889798283576965, -0.1962742656469345, 0.5982874035835266, 0.9297121167182922, -0.13432416319847107, ...
func (c *ProjectsLocationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ }
[ -0.0540039949119091, 0.4054502248764038, 0.3692288100719452, 0.10611163824796677, -0.2185640037059784, 0.9804127216339111, 0.41971641778945923, 0.10763363540172577, 0.6001684069633484, -1.0399394035339355, 0.6101497411727905, 0.20558154582977295, -0.2239505648612976, -0.5501385927200317, ...
func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall { c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c }
[ -0.880460262298584, -0.04420679807662964, 0.5080710053443909, 0.23997658491134644, -0.1636183261871338, 0.35848599672317505, 0.7030194401741028, 0.3058066666126251, 0.5929737687110901, 0.021961864084005356, -0.9519802331924438, -0.3466918170452118, -0.09544061124324799, -0.2368347793817520...
func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall { c.urlParams_.Set("filter", filter) return c }
[ -0.6267825961112976, 0.6288599967956543, 0.1346108764410019, 0.2038198560476303, -0.20144639909267426, 1.1323961019515991, 0.8049602508544922, 1.193774700164795, 0.30903056263923645, -0.2980005145072937, -0.2308928221464157, 0.12012176960706711, -0.07615108042955399, 0.7219273447990417, ...
func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c }
[ -0.9420045614242554, 0.8881443738937378, 0.2844001054763794, -0.3857089877128601, 0.560533344745636, 0.7794011235237122, 0.4774395525455475, 0.6484689712524414, 0.8106792569160461, -0.00421483488753438, 0.3193945586681366, -0.19812095165252686, -0.21338188648223877, 0.2783317565917969, -...
func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall { c.urlParams_.Set("pageToken", pageToken) return c }
[ -0.5011600852012634, 0.11265601217746735, 0.2105226367712021, -0.39177876710891724, 0.576592206954956, 0.874222993850708, 0.3939262628555298, 1.5931978225708008, 0.7467987537384033, -0.4584295451641083, -0.5494717955589294, 0.31013864278793335, 0.1710186004638672, 0.19737860560417175, -0...
func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c }
[ -1.031134843826294, 0.7496691346168518, 0.18657252192497253, -0.6324257850646973, 1.0662410259246826, 1.2188150882720947, 0.223979651927948, 0.47859662771224976, 0.3078949451446533, -0.6561746597290039, -0.14656609296798706, -0.4686051905155182, -0.14939554035663605, 0.15715323388576508, ...
func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall { c.ifNoneMatch_ = entityTag return c }
[ -0.10788962244987488, 0.7245879173278809, 0.1112847551703453, -0.46914878487586975, 0.6276923418045044, 0.02134222723543644, 0.6958635449409485, 0.5610668063163757, 0.18634460866451263, -0.35470321774482727, -0.3791320323944092, -0.6553279161453247, -0.13996148109436035, 1.233137845993042,...
func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall { c.ctx_ = ctx return c }
[ -0.3975539207458496, 0.1717194765806198, 0.166805699467659, -0.21701760590076447, 0.1662728488445282, 1.4849982261657715, 0.6256440281867981, 0.44980689883232117, 1.5208543539047241, -0.893151581287384, -0.6881141662597656, 0.4435480535030365, 0.8773652911186218, -0.03697507083415985, -1...
func (c *ProjectsLocationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ }
[ -0.246993750333786, 0.24756452441215515, 0.3362087905406952, 0.2499297857284546, -0.1956518143415451, 0.8382277488708496, 0.1999824494123459, 0.4569633901119232, 0.9293813705444336, -1.0759156942367554, 0.02413039468228817, -0.06550468504428864, -0.2932072579860687, -0.32275041937828064, ...
func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { x, err := c.Do() if err != nil { return err } if err := f(x); err != nil { return err } ...
[ -0.6517486572265625, 0.23468008637428284, 0.23081625998020172, -0.44960522651672363, -0.009455191902816296, 0.1975444257259369, 0.13594354689121246, 0.17054630815982819, 0.9663289785385132, -0.41177842020988464, 0.904678463935852, -0.44427183270454407, -0.03668956458568573, -0.102602422237...
func Solution002() string { fib_0 := 1 fib_1 := 2 answer := 2 for fib_0 + fib_1 < 4000000 { fib_next := fib_0 + fib_1 fib_0 = fib_1 fib_1 = fib_next if (fib_next % 2 == 0) { answer += fib_next } } return fmt.Sprint(answer) }
[ 0.5732141137123108, 0.15568919479846954, 0.6960941553115845, 0.4202573001384735, 0.08192536979913712, -0.8186725974082947, 0.3252738118171692, -0.0016508732223883271, -0.3626498281955719, -0.23745056986808777, -0.2525426149368286, 0.02820863388478756, -0.5745818018913269, 1.770953536033630...
func (ds *DijkstraSolver) _initAll(n int) (dp []Value, colors []int) { dp, colors = make([]Value, n), make([]int, n) for i := 0; i < n; i++ { dp[i] = ds.vinf colors[i] = WHITE } return dp, colors }
[ -0.7596317529678345, 0.5635499954223633, 0.46588563919067383, -1.4329586029052734, 0.07992618530988693, -0.9368754029273987, 0.07508430629968643, -0.5700345039367676, 0.5725921988487244, 0.7944576144218445, -0.5171957015991211, 0.6319482922554016, 0.695557177066803, 1.1684114933013916, 0...
func (ds *DijkstraSolver) _initStartPoint(S []StartPoint, dp []Value, colors []int) *VertexPQ { pq := NewVertexPQ() for _, sp := range S { pq.push(&Vertex{id: sp.id, v: sp.vzero}) dp[sp.id] = sp.vzero colors[sp.id] = GRAY } return pq }
[ -0.512458324432373, -0.5478162169456482, 0.41428738832473755, -0.11840540915727615, -0.8373209834098816, -0.03828660398721695, -0.2327089011669159, 0.27297747135162354, 0.7167163491249084, 0.8669776320457458, -0.4012294113636017, 0.15034979581832886, -0.18222340941429138, -0.03489013016223...
func (spec *HostedProgramSpec) Cleanup() error { var err error if spec.Stdin != nil { if e := spec.Stdin.Close(); e != nil { err = e } } if spec.Stdout != nil { if e := spec.Stdout.Close(); e != nil { err = e } } if spec.Stderr != nil { if e := spec.Stderr.Close(); e != nil { err = e } } re...
[ 0.3541310429573059, -0.8245174288749695, 0.7669651508331299, -0.7707392573356628, 0.08871383965015411, 0.4316433370113373, 0.7700220346450806, -0.1794481724500656, -0.2352529615163803, 0.04958184063434601, 0.5254624485969543, 0.06455356627702713, -0.39932963252067566, 1.0566153526306152, ...
func (p *HostedProgramInfo) Spec() HostedProgramSpec { return p.spec }
[ 0.45244482159614563, -0.44916167855262756, 0.2514278292655945, 0.14872704446315765, -0.1530219465494156, 1.7586506605148315, 0.7415464520454407, 0.3297826647758484, -0.3765181005001068, -0.07541196793317795, 0.08868943899869919, 0.7224645018577576, -0.4547026753425598, -0.7685269713401794,...
func (p *HostedProgramInfo) WaitChan() <-chan bool { return p.Done }
[ -0.6623346209526062, -0.26996782422065735, 0.47185859084129333, -0.6704063415527344, 0.7873330116271973, 1.7754888534545898, 0.3697219491004944, 0.2807920575141907, -0.8508355617523193, -0.5425691604614258, -0.40985873341560364, 0.11405501514673233, -0.9637354612350464, -0.3872487246990204...
func (p *HostedProgramInfo) Channel() io.ReadWriteCloser { return p.TaoChannel }
[ -0.5002405047416687, -0.648496150970459, 0.17602378129959106, -0.1308451145887375, -0.047262709587812424, 2.2509496212005615, 0.7205144166946411, 0.5427835583686829, -0.4127458930015564, -0.8243064284324646, 1.4357562065124512, 0.9273068308830261, -0.04371745511889458, 0.32585492730140686,...
func (p *HostedProgramInfo) Subprin() auth.SubPrin { return p.subprin }
[ 0.11391948908567429, -0.5956590175628662, 0.4247876703739166, 0.3987995386123657, -1.520460605621338, 1.8158800601959229, -0.22933058440685272, 0.2031787484884262, 0.3874342143535614, -1.0213685035705566, -0.006975774187594652, 1.4310272932052612, -1.216907262802124, -1.274556040763855, ...
func (p *HostedProgramInfo) Extend(ext auth.SubPrin) { p.subprin = append(p.subprin, ext...) }
[ 0.15652243793010712, 0.2369663268327713, 0.5664408206939697, 0.6682621836662292, -0.9143950939178467, 2.384963274002075, -1.621870756149292, 0.5461629033088684, 0.44166430830955505, -0.06614305078983307, -1.1215407848358154, 1.36644446849823, -0.9477059245109558, -0.4569787085056305, 0.6...
func (this *RaftNode) BootstrapCluster() error { if err := this.setupRaft(); err != nil { return fmt.Errorf("could not to setup raft node: %v", err) } configuration := raft.Configuration{ Servers: []raft.Server{ { ID: raft.ServerID(this.opts.Raft), Address: this.raftTransport.LocalAddr(), }, ...
[ 0.21582043170928955, 0.4561534523963928, 0.555188000202179, -0.7576724290847778, 0.6470405459403992, -0.4335668683052063, 0.9127588868141174, 0.1899026483297348, -0.08285918831825256, 0.20440316200256348, 0.11558330059051514, 1.6092578172683716, -0.7427204847335815, 0.3078732490539551, -...
func (this *RaftNode) Stop() error { this.srv.Stop() if this.leader != nil { return this.leader.Close() } return nil }
[ -0.9501010775566101, 0.17100133001804352, 0.5504157543182373, -0.25537109375, 0.18802383542060852, 0.10023073107004166, 0.457023561000824, -0.08036157488822937, -0.1492651402950287, 0.4006636440753937, -0.05196819826960564, 1.0249035358428955, -1.5066543817520142, 0.40835607051849365, 1....
func (this *RaftNode) whenLeaderChanged(funcs ...func(isLeader bool) error) { for isLeader := range this.raft.LeaderCh() { wg := new(sync.WaitGroup) wg.Add(len(funcs)) for _, f := range funcs { go func(f func(isLeader bool) error) { defer wg.Done() if err := f(isLeader); err != nil { this.log.Inf...
[ -0.15723919868469238, 0.3216165006160736, 0.590753436088562, 0.1838800609111786, 0.3375926911830902, -0.007078258786350489, -0.1936313658952713, -0.10056435316801071, -0.4125347137451172, 0.19831983745098114, -0.6779478788375854, 0.7047263979911804, -0.5831637382507324, 0.7207806706428528,...
func NewOSDUpgrader(c client.Client, cfm configmanager.ConfigManager, mc metrics.Metrics, notifier eventmanager.EventManager) (*osdUpgrader, error) { cfg := &upgraderConfig{} err := cfm.Into(cfg) if err != nil { return nil, err } m, err := maintenance.NewBuilder().NewClient(c) if err != nil { return nil, err...
[ -0.7983543276786804, 0.17773117125034332, 0.6857181787490845, 0.3110816478729248, -0.05000840872526169, 0.03140512481331825, 0.1259240359067917, -0.250624418258667, -0.5781967043876648, 0.3825853765010834, -0.48868927359580994, 0.33703455328941345, -0.13124823570251465, 1.4100005626678467,...
func (u *osdUpgrader) UpgradeCluster(ctx context.Context, upgradeConfig *upgradev1alpha1.UpgradeConfig, logger logr.Logger) (upgradev1alpha1.UpgradePhase, error) { u.upgradeConfig = upgradeConfig // OSD upgrader enforces a 'failure' policy if the upgrade does not commence within a time period if cancelUpgrade, _ :=...
[ -0.8521487712860107, -0.1657969355583191, 0.3979092836380005, 0.4418068826198578, 0.046591129153966904, -0.05557038262486458, 0.3752884864807129, -0.1979508101940155, 0.3984142541885376, 0.41270700097084045, -0.20926779508590698, 0.4545999765396118, -0.06318727880716324, 0.0479923672974109...
func shouldFailUpgrade(cvClient cv.ClusterVersion, cfg *upgraderConfig, upgradeConfig *upgradev1alpha1.UpgradeConfig) (bool, error) { commenced, err := cvClient.HasUpgradeCommenced(upgradeConfig) if err != nil { return false, err } // If the upgrade has commenced, there's no going back if commenced { return fa...
[ -0.22778257727622986, -0.13279929757118225, 0.7964019179344177, 0.6501114368438721, -0.3748873770236969, 0.13304084539413452, -0.2194788157939911, 0.3655215799808502, -0.566048800945282, 0.7373290657997131, -0.4548566937446594, 0.3614717125892639, -1.2059659957885742, 1.1038610935211182, ...
func performUpgradeFailure(c client.Client, metricsClient metrics.Metrics, s scaler.Scaler, nc eventmanager.EventManager, upgradeConfig *upgradev1alpha1.UpgradeConfig, logger logr.Logger) (upgradev1alpha1.UpgradePhase, error) { // Set up return condition h := upgradeConfig.Status.History.GetHistory(upgradeConfig.Spec...
[ -0.49337971210479736, 0.3201669454574585, 0.5975250005722046, -0.10638938844203949, -0.4040279984474182, 0.28964823484420776, 0.5210405588150024, -0.0746152251958847, -0.44790881872177124, 0.9976617097854614, 0.17073318362236023, -0.17998887598514557, -0.5547034740447998, 0.399873852729797...
func NewBookController() *BookController { return new(BookController) }
[ 0.6898924112319946, -0.5374577045440674, -0.013701002113521099, 0.8512911796569824, -1.2089718580245972, 0.22560666501522064, 0.011067947372794151, -0.6367687582969666, -0.6485772728919983, -0.17952340841293335, -0.47263312339782715, -0.3246123790740967, 0.22665393352508545, 0.570998191833...
func ArgMin(list []float64) (int, float64) { argmin := -1 min := math.Inf(+1) for i, v := range list { if v < min { min = v argmin = i } } return argmin, min }
[ -1.1407511234283447, -1.039904236793518, 0.39951756596565247, 0.5793725252151489, -0.5026347637176514, 0.36126789450645447, -0.4078289568424225, 0.2493029236793518, -0.053311340510845184, 0.1749419867992401, -0.16528652608394623, 0.7058766484260559, -1.0074656009674072, 1.081048607826233, ...
func ArgMax(list []float64) (int, float64) { argmax := -1 max := math.Inf(-1) for i, v := range list { if v > max { max = v argmax = i } } return argmax, max }
[ -1.1001523733139038, -0.30054986476898193, 0.4549582600593567, 0.9739691615104675, 0.03310025483369827, 0.1483219861984253, -0.6025217771530151, 1.0971708297729492, -0.43607667088508606, 0.7042892575263977, -0.35830721259117126, 0.5654482245445251, -0.5588184595108032, 0.9270390272140503, ...
func Mean(list []float64) float64 { sum := 0.0 for _, v := range list { sum += v } return sum / float64(len(list)) }
[ -0.7582982778549194, 0.6197093725204468, 0.1538596749305725, 0.48181262612342834, -0.1113755851984024, 0.6246713399887085, -0.22009152173995972, 0.5490613579750061, 0.586736261844635, 0.8593119382858276, -0.8902384042739868, -0.061326202005147934, -0.9829667806625366, 1.0930266380310059, ...
func ColorToHex(c color.RGBA) string { return fmt.Sprintf("%02X%02X%02X", c.R, c.G, c.B) }
[ -0.11382969468832016, -1.0683434009552002, 0.7032351493835449, -0.8575654029846191, 0.8904165029525757, 1.0021569728851318, -0.11592140793800354, 0.14707955718040466, -0.30128344893455505, 0.38054415583610535, -0.736383855342865, -0.14533646404743195, 0.3953941762447357, 0.0674227178096771...
func (l *Link) SetTitle(title string) *Link { l.Title = title return l }
[ -0.10796140134334564, 0.5505189895629883, -0.08097897469997406, 0.7167528867721558, 0.23058198392391205, 0.049099862575531006, -0.23864483833312988, 0.8983704447746277, 0.780890941619873, -1.0413216352462769, -0.4406641721725464, 0.0912436842918396, -1.0122021436691284, 0.01996861398220062...
func (l *Link) SetDeprication(deprecation string) *Link { l.Deprecation = deprecation return l }
[ -0.7443504929542542, 0.3089416027069092, -0.000507500022649765, 0.08640020340681076, 0.06485624611377716, -0.1713171750307083, -0.27953967452049255, 0.7421847581863403, 0.015995599329471588, -0.7072365880012512, -0.5052627921104431, 0.1246461272239685, 0.11399375647306442, 1.11963641643524...
func (l *Link) SetHref(href string) *Link { l.Href = href return l }
[ 0.8839739561080933, 0.8916087746620178, 0.10305743664503098, 0.5577830672264099, 0.12965863943099976, 0.5262570381164551, 0.2376827597618103, 1.2298178672790527, 0.24850399792194366, -0.4098171591758728, -0.44316524267196655, 0.06480076909065247, -0.1602541208267212, 0.1050768718123436, ...
func (l *Link) SetHrefLang(lang string) *Link { l.HrefLang = lang return l }
[ 0.6280329823493958, 0.7182676792144775, 0.31626901030540466, 0.09000825136899948, -0.02701968140900135, 0.40338394045829773, -0.017713159322738647, 0.285319983959198, 0.2504462003707886, -1.2496006488800049, -1.171680212020874, 0.4319778084754944, 0.12346433103084564, 0.6325554847717285, ...
func (l *Link) SetProfile(profile string) *Link { l.Profile = profile return l }
[ 0.18791022896766663, 0.32672372460365295, 0.04099009186029434, 1.042122721672058, 0.7979633808135986, 0.4560353755950928, 0.4194011092185974, 0.29130125045776367, 0.4945921301841736, -0.9610376954078674, -0.4818284809589386, -0.3866433799266815, -1.2748793363571167, 0.2928381860256195, -...
func (l *Link) SetTemplated(templated bool) *Link { l.Templated = templated return l }
[ 0.09816969186067581, 0.04806024581193924, 0.20969973504543304, -0.5565671324729919, 0.1581655889749527, 0.48567473888397217, 0.6447829604148865, 1.524648666381836, 0.06281394511461258, -1.5520262718200684, -0.7492168545722961, 0.50925213098526, -0.22455163300037384, 0.8319039940834045, -...
func (l *Link) SetType(linkType string) *Link { l.Type = linkType return l }
[ -0.2265736609697342, 0.5130435824394226, -0.1416308432817459, 1.2775756120681763, 1.340852975845337, 0.453189879655838, -0.1100974753499031, 0.5706328749656677, 0.8824235796928406, -0.8232575058937073, -0.3309834599494934, 1.0373122692108154, -0.9695420265197754, 0.9603817462921143, 0.06...
func (l *Links) AddCurie(curie *Curie) error { if l.Curies == nil { l.Curies = &[]Curie{} } *l.Curies = append(*l.Curies, *curie) return nil }
[ -0.3487298786640167, -0.09619519114494324, 0.4816614091396332, -0.5985085964202881, 0.8591738343238831, -0.1597406268119812, -0.4505624771118164, 0.569096028804779, 0.398810476064682, -0.7398622632026672, -0.053086716681718826, 0.8532124161720276, -1.2976433038711548, 1.0651957988739014, ...
func (l *Links) AddLink(reltype string, link *Link) error { // Check if curied and that if curied, curie exists curieExists := false if strings.Index(reltype, ":") > 0 { parts := strings.Split(reltype, ":") var curies *[]Curie curies = l.Curies if curies == nil { return ErrNoCurie } for _, curie := ra...
[ -0.37030234932899475, -0.36426687240600586, 0.6369375586509705, 0.05568153038620949, 0.9400274753570557, 0.5531708598136902, -0.10720034688711166, 0.04579673334956169, 0.3633020520210266, -0.18757310509681702, 0.33530503511428833, 0.7045803666114807, -1.2007811069488525, 0.0507256984710693...
func (l *Links) MarshalJSON() ([]byte, error) { // @TODO sort keys var bufferData []string if l.Self != nil { jsonValue, err := json.Marshal(l.Self) if err != nil { return nil, err } bufferData = append(bufferData, fmt.Sprintf("\"%s\": %s", SELF, string(jsonValue))) } if l.Curies != nil { jsonValue, e...
[ -0.5277888178825378, -0.46085044741630554, 0.6300952434539795, -1.633700966835022, -0.18636858463287354, -0.32028529047966003, 0.04343460127711296, -0.38850101828575134, 0.10575898736715317, -0.7254309058189392, 0.08294198662042618, 0.9111152291297913, -0.5127671360969543, 0.38412708044052...
func (l *Links) UnmarshalJSON(b []byte) error { var temp = make(map[string]interface{}) err := json.Unmarshal(b, &temp) if err != nil { return err } if _, ok := temp[CURIES]; ok { var mycuries []Curie for _, curies := range temp[CURIES].([]interface{}) { var curie Curie for k, v := range curies.(map[st...
[ -0.9616433382034302, 0.013810033909976482, 0.7115040421485901, -1.6509125232696533, -0.393187940120697, -0.44632434844970703, 0.41307878494262695, 0.20400002598762512, 0.08193829655647278, -1.1001560688018799, -0.1027384102344513, 0.6537932753562927, -0.185663104057312, 0.08970228582620621...
func NewLinks() *Links { l := &Links{} l.Relations = make(map[string][]*Link) return l }
[ -0.45885413885116577, -0.4331420958042145, -0.17539776861667633, -0.4168824851512909, -0.2465144842863083, -0.30442455410957336, -0.37305086851119995, -0.2640511095523834, 0.08061612397432327, -1.621527075767517, 0.4220445156097412, 0.6573801636695862, -0.7122619152069092, 0.02533343806862...
func UpdateLoop() { for { up, ok := <-ostent.Updates.Get() if ok { connections.update(up) lastCopy.set(up) } } }
[ -0.8043653964996338, -1.0664770603179932, 0.4669058620929718, -0.04923290014266968, 0.04956652969121933, 0.181356281042099, -0.5181347727775574, -0.6863247752189636, -0.4465107023715973, 1.090569257736206, 0.83840411901474, -0.1531970053911209, -0.6396253705024719, -0.5331519246101379, -...
func (sw ServeWS) IndexWS(w http.ResponseWriter, req *http.Request) { // Upgrader.Upgrade() has Origin check if .CheckOrigin is nil upgrader := &websocket.Upgrader{HandshakeTimeout: 5 * time.Second} wsconn, err := upgrader.Upgrade(w, req, nil) if err != nil { // Upgrade() does http.Error() to the client return }...
[ -0.3351777493953705, -0.38896653056144714, 0.6843212842941284, -0.0726953074336052, -0.1844528466463089, -0.45626866817474365, 0.6008821725845337, -0.35748279094696045, -0.007913497276604176, 0.2961689531803131, 0.4044126570224762, 1.2326748371124268, 0.02661026269197464, 0.311825275421142...
func PreloadImage(e *Context) error { for n := e.DOM.BodyNode; n != nil; n = htmlnode.Next(n) { if isNodeHiddenInLayout(n) { continue } if n.Data == "amp-img" { if imgsrcset, ok := candidateImageForPreloading(n); ok { srcsetToPreloadData(imgsrcset, e) } } else if n.Data == "amp-video" || n.Data =...
[ -0.956497073173523, 0.6150434017181396, 0.7412648797035217, 0.15983755886554718, -0.4491066336631775, 0.06303059309720993, -0.26008471846580505, 0.18089160323143005, 0.5181691646575928, 0.5860057473182678, 0.22766423225402832, 0.5658636689186096, 0.3369096517562866, 1.5082764625549316, 0...
func srcsetToPreloadData(srcset string, e *Context) { type imageWithTargetSize struct { imgURL *url.URL size int } srcSets := strings.FieldsFunc(strings.TrimSpace(srcset), func(c rune) bool { return c == ',' }) srcSetsSize := len(srcSets) imgSet := []imageWithTargetSize{} for _, src := range srcSets { i...
[ -0.9901773929595947, -0.07275687158107758, 0.6571488380432129, -1.2718113660812378, -0.11282777786254883, -1.1142269372940063, -0.13230429589748383, -1.0925408601760864, 0.46184951066970825, 0.1519162803888321, 0.730889081954956, 0.33435750007629395, 0.780903160572052, 0.47374027967453003,...
func candidateImageForPreloading(n *html.Node) (string, bool) { // amp-image under following containers do not qualify for preloading. imgsrcset, hasSrcset := htmlnode.GetAttributeVal(n, "", "srcset") // Ignores images with no src attribute. // These can be css images inside class definition. if !hasSrcset || len...
[ -1.117501139640808, 0.08269231766462326, 0.7731974124908447, -0.9237574934959412, -1.1530214548110962, -0.25517895817756653, 0.9863072633743286, -0.2691863179206848, 0.368306428194046, 0.2152472734451294, 0.8725846409797668, -0.13373570144176483, 0.4313803017139435, 0.9399263262748718, 0...
func isAspectRatioDimensions(n *html.Node, width int, height int) bool { // Aspect ratio doesn't work in fixed layout types. layoutType := layout.ParseAMPLayout(n) if !(layoutType == amppb.AmpLayout_FIXED || layoutType == amppb.AmpLayout_FIXED_HEIGHT) { return false } return new(big.Int).GCD(nil, nil, big.NewIn...
[ -0.46090301871299744, 0.41237500309944153, 0.5777198076248169, -0.05257157236337662, -0.7908268570899963, -0.29026126861572266, 0.3901531994342804, -0.8745558261871338, 0.7651845812797546, 0.16270527243614197, 0.8621751070022583, -0.07348628342151642, -0.30852454900741577, 0.67826527357101...
func isTinyNode(width, height int) bool { return (width > 0 && width < minImageSize) || (height > 0 && height < minImageSize) }
[ -0.7757946848869324, 0.10028362274169922, 0.7243203520774841, -0.0675363838672638, -0.01724187657237053, -0.6701998710632324, -0.335747629404068, -0.6696230173110962, 0.3329731523990631, -0.126061350107193, -0.036199577152729034, 0.9085466265678406, -1.0691663026809692, 0.12454381585121155...
func main() { args := os.Args[1:] if len(args) < 2 { panic(fmt.Errorf("Usage: jira <source_id> <board_id>")) } sourceId, err := strconv.ParseUint(args[0], 10, 64) if err != nil { panic(fmt.Errorf("error paring source_id: %w", err)) } boardId, err := strconv.ParseUint(args[1], 10, 64) if err != nil { panic...
[ 1.3031578063964844, 0.7659339904785156, 0.9403653144836426, 0.315505713224411, 0.581834614276886, -0.6409383416175842, 0.5482379198074341, 0.22581247985363007, -0.4525218904018402, 0.06011870503425598, -0.09467122703790665, 1.1330748796463013, 0.0528610423207283, -0.13695289194583893, -0...
func CleanQuery(query string) string { ret := strings.Replace(query, "\n", "", -1) ret = reRemoveExtraSpace.ReplaceAllString(ret, " ") return ret }
[ 0.31133148074150085, -0.88409423828125, 0.450141578912735, 0.0068191480822861195, -1.1533854007720947, 0.01651889458298683, -1.3129090070724487, 0.5693036317825317, 0.6788449287414551, 0.3900117874145508, 0.7955570816993713, 0.38580581545829773, -0.14161869883537292, 1.1415207386016846, ...
func (c Client) InfluxClient() client.Client { return c.client }
[ 1.0080736875534058, -0.6097366213798523, -0.20983676612377167, 0.4338032305240631, -0.4332340359687805, 0.551868736743927, 1.094909906387329, 0.22831086814403534, 0.03983013331890106, -0.7576127052307129, -0.4023928642272949, 1.0748505592346191, -0.18510432541370392, -1.0063790082931519, ...
func (c Client) Query(db, cmd string, result interface{}) (err error) { query := client.Query{ Command: cmd, Database: db, Chunked: false, ChunkSize: 100, } var response *client.Response response, err = c.client.Query(query) if response.Error() != nil { return response.Error() } if err != nil {...
[ -0.14281857013702393, 0.7136929035186768, 0.6235476732254028, 0.5978063344955444, 0.060953304171562195, -0.48599445819854736, -0.3068712651729584, -0.6191008687019348, 0.10323075950145721, -0.633576512336731, 0.07408137619495392, 0.32034415006637573, -0.649587094783783, 0.07334300130605698...
func (c Client) WritePoint(db, measurement string, data interface{}) error { t, tags, fields, err := encode(data) if err != nil { return err } return c.WritePointTagsFields(db, measurement, tags, fields, t) }
[ -0.12225518375635147, -0.18369024991989136, 0.20426951348781586, 0.36068081855773926, 0.6391414403915405, 0.5766299962997437, -0.5104131102561951, -0.13458894193172455, -0.3766886293888092, -0.039431825280189514, 0.025184210389852524, -0.5488619208335876, -1.0460113286972046, 0.68626350164...
func (c Client) WritePointTagsFields(db, measurement string, tags map[string]string, fields map[string]interface{}, t time.Time) error { bp, err := client.NewBatchPoints(client.BatchPointsConfig{ Database: db, Precision: c.precision, }) if err != nil { return err } pt, err := client.NewPoint(measurement, ...
[ -0.15303319692611694, 0.47800949215888977, 0.3137798607349396, 0.080607108771801, 1.1291086673736572, 0.5182488560676575, -0.9118788838386536, -0.1173996776342392, -1.3480510711669922, -0.03477490320801735, -1.141191005706787, -0.7757018804550171, -0.6417434811592102, 0.04061596095561981, ...