text
stringlengths
11
6.3k
embedding
listlengths
768
768
func (m *Message) Bytes() ([]byte, error) { if m.nlm == nil { return nil, errors.New("no netlink message") } nlh := C.nlmsg_hdr(m.nlm) nlb := make([]byte, nlh.nlmsg_len) copy(nlb, (*[1 << 20]byte)(unsafe.Pointer(nlh))[:nlh.nlmsg_len]) return nlb, nil }
[ 0.12402623891830444, 0.40423867106437683, 0.3098454475402832, -1.2810592651367188, 0.4144570827484131, 0.03778839483857155, -0.7887417674064636, -1.2421811819076538, 0.3034404516220093, -0.9958261251449585, -0.28716838359832764, 0.7005422115325928, -1.0459399223327637, 1.327571988105774, ...
func (m *Message) Marshal(v interface{}) error { val := reflect.Indirect(reflect.ValueOf(v)) if val.Kind() != reflect.Struct { return fmt.Errorf("%v is not a struct or a pointer to a struct", reflect.TypeOf(v)) } return marshal(val, "", nil, m.nlm) }
[ 0.30751171708106995, 0.23300878703594208, 0.366956889629364, -0.7660025358200073, -0.44741714000701904, 0.6464747786521912, -0.15159854292869568, -0.6336914300918579, 0.42880162596702576, -0.6402978301048279, 0.5156733393669128, 1.3753368854522705, -0.7800412774085999, 1.3476368188858032, ...
func (m *Message) Unmarshal(v interface{}) error { val := reflect.Indirect(reflect.ValueOf(v)) if val.Kind() != reflect.Struct || !val.CanSet() { return fmt.Errorf("%v is not a pointer to a struct", reflect.TypeOf(v)) } maxAttrID, err := structMaxAttrID(val) if err != nil { return err } attrs, err := parseMe...
[ -0.1639145016670227, 0.6343243718147278, 0.5972135066986084, -1.0027610063552856, -0.9084106683731079, -0.06743123382329941, 0.6031304597854614, 0.007078210357576609, -0.09258249402046204, -0.16547201573848724, 0.581937849521637, 0.7250053286552429, -0.5934485793113708, 0.5053112506866455,...
func (m *Message) Send() error { return m.SendCallback(callbackDefault, nil) }
[ 0.6725313067436218, 0.8117407560348511, 0.15011343359947205, 1.0230443477630615, 0.7238408923149109, -0.4920477271080017, 0.1669766902923584, -0.5262005925178528, -0.31392449140548706, -0.5256953835487366, 0.20493915677070618, -0.3064192533493042, -1.3092634677886963, 1.4667785167694092, ...
func (m *Message) SendCallback(fn CallbackFunc, arg interface{}) error { s, err := newSocket() if err != nil { return err } defer s.free() if errno := C.genl_connect(s.nls); errno != 0 { return &Error{errno, "failed to connect to netlink"} } defer C.nl_close(s.nls) cbArg := &callbackArg{fn: fn, arg: arg} ...
[ 0.3113272190093994, 0.7783014178276062, 0.8556489944458008, -0.2608715295791626, -0.035857200622558594, -1.0076918601989746, 0.5467844009399414, -0.8437767028808594, 0.583957850933075, 0.22224871814250946, -0.28845033049583435, 0.006570135708898306, -0.12585735321044922, 1.4221233129501343...
func SendMessage(command, family, flags int) error { return SendMessageCallback(command, family, flags, callbackDefault, nil) }
[ 0.30686861276626587, 0.9366908073425293, 0.4332559108734131, 1.261399269104004, 0.32243552803993225, 0.1372230052947998, 0.25124460458755493, 0.0644492506980896, 0.20583920180797577, -0.1769697368144989, 0.1560623049736023, -0.5895785689353943, -0.8619922399520874, 1.5175467729568481, -0...
func SendMessageCallback(command, family, flags int, cb CallbackFunc, arg interface{}) error { msg, err := NewMessage(command, family, flags) if err != nil { return err } defer msg.Free() return msg.SendCallback(cb, arg) }
[ 0.43594714999198914, 0.5237573981285095, 0.6147878170013428, 0.5605438947677612, -0.5063830614089966, -0.2537345290184021, 0.4904358386993408, -0.49484390020370483, 0.6625469923019409, 0.8638107776641846, 0.31143301725387573, -0.33847782015800476, -0.5417235493659973, 1.344045639038086, ...
func SendMessageMarshalled(command, family, flags int, v interface{}) error { msg, err := NewMessage(command, family, flags) if err != nil { return err } defer msg.Free() if err := msg.Marshal(v); err != nil { return err } return msg.Send() }
[ 0.23718921840190887, 0.30926549434661865, 0.7336528897285461, -0.03734537959098816, -0.0015135545982047915, 0.10061528533697128, -0.7580918669700623, -0.40977010130882263, 0.7701003551483154, -0.04739021509885788, 0.19837281107902527, 0.3509119749069214, -0.7222342491149902, 1.214641094207...
func SendMessageUnmarshal(command, family, flags int, v interface{}) error { return SendMessageCallback(command, family, flags, callbackUnmarshal, v) }
[ -0.30678924918174744, 0.2144504189491272, 0.7553849816322327, -0.18487922847270966, -0.4377576410770416, -0.028386734426021576, 0.20231063663959503, 0.8209614157676697, 0.5674998164176941, -0.08671203255653381, 0.6282505393028259, 0.05700989067554474, -0.8791970610618591, 1.092019915580749...
func (game *T) Request(username string, uri string, data cast.JSON) { go game.request(&Request{ Username: username, URI: uri, Data: data, }) }
[ -2.1539440155029297, 0.4626255929470062, 0.2803034484386444, 0.045425303280353546, 0.7200278639793396, 0.44380414485931396, -0.7138830423355103, -0.26406601071357727, -0.2593894898891449, -0.17566026747226715, -0.049807287752628326, 1.027496576309204, 0.07020561397075653, -0.13104784488677...
func (game *T) Done() chan bool { return game.close }
[ -1.2163220643997192, 0.2789842188358307, 0.8116636276245117, -0.5306793451309204, 0.058198027312755585, 0.7718974947929382, -0.746845543384552, -1.02971351146698, -1.0046346187591553, 0.8385975956916809, -0.4395701289176941, 0.19869765639305115, -0.3312963843345642, 0.45120105147361755, ...
func (game *T) Close() { game.Runtime.logger.New(). // With(log.Fields{}). Info("close") // add fields later game.lock.Lock() close(game.in) game.in = nil close(game.close) game.close = nil game.lock.Unlock() game.chat.Destroy() game.Runtime.logger.Close() }
[ -0.845460832118988, -0.2526233494281769, 0.8442782759666443, -0.5415310859680176, 0.1982651948928833, 0.6341234445571899, 0.0005064898869022727, -1.1714799404144287, -1.1763747930526733, 0.3910001516342163, -0.05480516329407692, -0.4054216146469116, -0.8338134288787842, 0.9164239764213562,...
func (game *T) WriteJSON(json cast.JSON) { for _, seat := range game.Seats { seat.WriteJSON(json) } }
[ -2.532457113265991, -1.3115352392196655, 0.4752739667892456, -0.5940006375312805, 0.41898247599601746, 0.6425364017486572, -0.03904224932193756, 0.02974626049399376, -0.18948617577552795, 1.0943129062652588, -0.722512423992157, 0.39937469363212585, 0.7946469783782959, 2.031930685043335, ...
func (game *T) JSON(seat *Seat) cast.JSON { if game == nil { return nil } seats := cast.JSON{} for _, s := range game.Seats { seats[s.Username] = s.JSON() } return cast.JSON{ "id": game.ID(), // "life": seat.Life, "hand": seat.Hand.JSON(), "state": game.State.JSON(), // "elements": seat.Element...
[ -1.3562877178192139, -1.2079212665557861, 0.8917822241783142, -0.7812471985816956, -1.3506450653076172, 0.21401166915893555, -0.5228778719902039, -0.9426124691963196, 0.6289174556732178, 0.8558695316314697, -0.592734158039093, 0.7779844403266907, 0.7884948253631592, 0.803641140460968, 1....
func (svc *DoExpressCheckoutPayment) Do(cli client.Client) (*DoExpressCheckoutPaymentResponse, error) { const method = "DoExpressCheckoutPayment" svc.BaseRequest.Method = method svc.BaseRequest.Action = paymentActionSale if svc.TotalAmount == 0 { svc.TotalAmount = svc.ItemAmount + svc.TaxAmount } result := &D...
[ -0.3708532452583313, 0.5888559222221375, 0.8288750648498535, -0.0706060528755188, 0.07282538712024689, -0.285444438457489, -0.2625114321708679, -0.47053036093711853, 0.29705262184143066, 0.6630494594573975, 0.6495129466056824, 0.45328977704048157, 0.047460950911045074, 0.26106932759284973,...
func (r *DoExpressCheckoutPaymentResponse) IsSuccess() bool { return r.IsRequestSuccess() && r.IsOperationSuccess() }
[ -0.701400101184845, 0.15679045021533966, 0.6251181960105896, 0.9524653553962708, -0.20197445154190063, -0.1912798285484314, -0.18511904776096344, 0.06326132267713547, 0.7675489783287048, 0.13832131028175354, 0.5265628099441528, -0.4123135209083557, 0.1875234693288803, -0.10772766917943954,...
func (r *DoExpressCheckoutPaymentResponse) IsOperationSuccess() bool { return r.PaymentACK == ackSuccess }
[ -0.5270286202430725, 0.8321901559829712, 0.5703133940696716, -0.07620752602815628, -0.18163828551769257, -0.3843321204185486, 0.33765679597854614, -0.5439925789833069, 0.37847620248794556, 0.9076809287071228, 0.600652277469635, -1.145849585533142, 0.49088889360427856, -0.9180200099945068, ...
func (e SubjectEdges) SubjResuOrErr() ([]*Results, error) { if e.loadedTypes[0] { return e.SubjResu, nil } return nil, &NotLoadedError{edge: "subj_resu"} }
[ 0.24412009119987488, 0.33178654313087463, 0.5204927921295166, -0.4216209948062897, -0.1317354142665863, -0.14533251523971558, 0.20364588499069214, -0.1619911938905716, 0.5320521593093872, -0.23060306906700134, -0.09132560342550278, 0.1507555991411209, -0.5845183730125427, -0.41054329276084...
func (*Subject) scanValues() []interface{} { return []interface{}{ &sql.NullInt64{}, // id &sql.NullInt64{}, // code &sql.NullString{}, // subjects &sql.NullInt64{}, // creditpiont } }
[ -0.5268746614456177, 0.5836206674575806, 0.4176590144634247, 0.20720550417900085, -0.6681123375892639, -0.21956674754619598, -1.3228609561920166, -0.7360751628875732, 0.10801520943641663, -1.0850083827972412, -0.17441117763519287, 0.39223456382751465, -0.35776838660240173, 0.92909532785415...
func (s *Subject) assignValues(values ...interface{}) error { if m, n := len(values), len(subject.Columns); m < n { return fmt.Errorf("mismatch number of scan values: %d != %d", m, n) } value, ok := values[0].(*sql.NullInt64) if !ok { return fmt.Errorf("unexpected type %T for field id", value) } s.ID = int(va...
[ -0.3832060396671295, 0.16775065660476685, 0.7109373807907104, 0.02746373973786831, -0.057166457176208496, -0.008676816709339619, -0.2164074182510376, -0.20658822357654572, -0.09468036890029907, -0.5485121607780457, 0.18773126602172852, -0.19857677817344666, -0.2954077124595642, 0.820075035...
func (s *Subject) QuerySubjResu() *ResultsQuery { return (&SubjectClient{config: s.config}).QuerySubjResu(s) }
[ 0.9150948524475098, 1.024863362312317, 0.39920774102211, -0.25252407789230347, -0.16207757592201233, -1.0801992416381836, 0.1451561152935028, 0.20293211936950684, -0.062352199107408524, -1.3357490301132202, -0.06407163292169571, 0.6739166975021362, -0.6662366986274719, -0.882418692111969, ...
func (s *Subject) Update() *SubjectUpdateOne { return (&SubjectClient{config: s.config}).UpdateOne(s) }
[ 0.3453729450702667, -0.25460317730903625, 0.14586475491523743, 0.054186947643756866, -0.5670161843299866, 0.0003113659331575036, 0.09321336448192596, -0.5071604251861572, 0.42127975821495056, 0.0398000068962574, -0.03418786823749542, 0.4222700893878937, -1.2649601697921753, -0.610109806060...
func (s *Subject) Unwrap() *Subject { tx, ok := s.config.driver.(*txDriver) if !ok { panic("ent: Subject is not a transactional entity") } s.config.driver = tx.drv return s }
[ 0.0027722129598259926, 0.7986390590667725, 0.2913694679737091, -0.4069426655769348, -0.2384607344865799, -0.29789119958877563, 0.3810659348964691, 0.3038836121559143, -0.01383039727807045, 0.15066780149936676, 0.8264404535293579, 0.43262627720832825, 0.4449233412742615, -0.7028063535690308...
func (s *Subject) String() string { var builder strings.Builder builder.WriteString("Subject(") builder.WriteString(fmt.Sprintf("id=%v", s.ID)) builder.WriteString(", code=") builder.WriteString(fmt.Sprintf("%v", s.Code)) builder.WriteString(", subjects=") builder.WriteString(s.Subjects) builder.WriteString(", ...
[ 0.2971588373184204, -0.5945560932159424, 0.24818789958953857, -1.321853756904602, -0.8279280066490173, 0.5683585405349731, 0.4016183018684387, -1.3739607334136963, -0.33297109603881836, -0.08026418834924698, 0.06465506553649902, 1.161604404449463, -0.4089575707912445, -0.8059819340705872, ...
func getTimecodeRate(t *testing.T, data testdata.TimecodeData) rate.Framerate { assert := assert.New(t) ntsc := rate.NTSCNone if data.Ntsc { ntsc = rate.NTSCNonDrop } if data.DropFrame { ntsc = rate.NTSCDrop } framerate, err := rate.FromInt(data.Timebase, ntsc) if !assert.NoError(err, "parse timebase to fr...
[ 0.2259121984243393, 0.24050621688365936, 0.3772965669631958, -0.06681685894727707, -0.011656164191663265, -1.4102742671966553, -1.1788843870162964, -1.0540683269500732, -0.08086295425891876, 0.038343023508787155, 0.24977630376815796, -0.8546907305717468, -1.0741627216339111, 1.447072267532...
func TestTallySequenceTimecode(t *testing.T) { seq := testdata.ManyBasicEditsData seqRate := getTimecodeRate(t, seq.StartTime) // Current total will start at 0. currentTotal := tc.FromFrames(0, seqRate) // currentTc will start at the sequence start time. When we add the length of each // event, we should get th...
[ 0.5620908737182617, 0.43526196479797363, 0.7665622234344482, -0.7184568047523499, 0.2534690201282501, -0.7860134840011597, 0.6035791039466858, 0.516089677810669, 0.19002920389175415, 0.6048556566238403, -0.89419025182724, 0.2773418426513672, -0.15026338398456573, 0.2774246335029602, 0.24...
func getTimecodeFromData(t *testing.T, data testdata.TimecodeData) tc.Timecode { t.Helper() framerate := getTimecodeRate(t, data) timecode, err := tc.FromTimecode(data.Timecode, framerate) if !assert.NoError(t, err, "parse timecode string") { t.FailNow() } return timecode }
[ 1.0650440454483032, -0.45501405000686646, 0.35795319080352783, -0.230600506067276, -0.593726396560669, -0.518134593963623, -0.36002713441848755, -0.48683714866638184, 0.2355852723121643, 0.14040425419807434, 0.19876280426979065, 0.11802932620048523, -0.5523263216018677, 0.0963919460773468,...
func (m *Handler) initGrafana(w http.ResponseWriter, r *http.Request, p httprouter.Params, context *AuthContext) (interface{}, error) { siteDomain := p[0].Value httplib.SetGrafanaHeaders(w.Header(), siteDomain, grafanaURL, false) var resData = struct { GrafanaURL string `json:"url"` }{ GrafanaURL: grafanaURL, ...
[ -0.9912618398666382, -0.36695408821105957, 0.6198676824569702, 0.4192145764827728, 0.2679445445537567, -0.0660628154873848, 1.1127849817276, -0.44240158796310425, 0.4381953179836273, -0.13781167566776276, -0.09338558465242386, 0.7115705609321594, -0.12640686333179474, 0.5729877948760986, ...
func (h *WebHandler) grafanaServeHandler(w http.ResponseWriter, r *http.Request, p httprouter.Params, s session) { err := httplib.VerifySameOrigin(r) if err != nil { msg := "access denied" h.Warningf("%v: %v", msg, trace.DebugReport(err)) replyError(w, msg, http.StatusForbidden) return } cookie, err := r.C...
[ -0.4107162654399872, 0.19538649916648865, 0.8946115374565125, 0.23854410648345947, 0.3636215627193451, 0.39330804347991943, 1.233442783355713, -0.9085275530815125, 0.024819020181894302, 0.026471879333257675, 0.6000372767448425, 0.8052482008934021, -0.43693336844444275, 0.27365320920944214,...
func NewDeleteScriptDataParams() DeleteScriptDataParams { return DeleteScriptDataParams{} }
[ -0.7261325120925903, -0.7595056891441345, 0.34086382389068604, -0.20187318325042725, -0.021632647141814232, 0.006443008314818144, -0.5606327056884766, -0.016046736389398575, -0.22515861690044403, -0.0492125079035759, -0.2767132520675659, 1.578911542892456, 0.045364733785390854, 1.010822415...
func (o *DeleteScriptDataParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { var res []error o.HTTPRequest = r rDataID, rhkDataID, _ := route.Params.GetOK("dataId") if err := o.bindDataID(rDataID, rhkDataID, route.Formats); err != nil { res = append(res, err) } rProjectID, rhkProject...
[ -1.0908124446868896, -0.6189175248146057, 0.8415452241897583, -0.12015151977539062, 0.27876535058021545, -0.012979291379451752, -0.284900039434433, -0.1555163413286209, 0.07389094680547714, -0.11374111473560333, 0.9370303153991699, 1.1152957677841187, -0.3823453187942505, 1.282832503318786...
func (o *DeleteScriptDataParams) bindDataID(rawData []string, hasKey bool, formats strfmt.Registry) error { var raw string if len(rawData) > 0 { raw = rawData[len(rawData)-1] } // Required: true // Parameter is provided by construction from the route o.DataID = raw return nil }
[ -0.46615391969680786, -0.6599850654602051, 0.5848329067230225, -0.6060835719108582, 0.11762672662734985, 0.47255825996398926, 0.007978139445185661, 0.4949169456958771, 0.6917339563369751, 0.019388984888792038, 0.22754795849323273, 1.4959955215454102, -0.00954206008464098, 1.606241345405578...
func (o *DeleteScriptDataParams) bindProjectID(rawData []string, hasKey bool, formats strfmt.Registry) error { var raw string if len(rawData) > 0 { raw = rawData[len(rawData)-1] } // Required: true // Parameter is provided by construction from the route o.ProjectID = raw return nil }
[ -0.5554871559143066, -0.15741825103759766, 0.4575011432170868, 0.10160448402166367, 0.14383472502231598, 0.6830412149429321, -0.22838068008422852, 0.6183900833129883, 0.27539947628974915, 0.5037445425987244, 0.7147210240364075, 0.8818003535270691, -0.4481627345085144, 1.098798394203186, ...
func (o *DeleteScriptDataParams) bindScriptID(rawData []string, hasKey bool, formats strfmt.Registry) error { var raw string if len(rawData) > 0 { raw = rawData[len(rawData)-1] } // Required: true // Parameter is provided by construction from the route o.ScriptID = raw return nil }
[ -0.5124168395996094, -1.0559598207473755, 0.6235024333000183, -0.06400686502456665, 0.22045551240444183, 0.2922293245792389, -0.1547500640153885, 0.07015085965394974, 0.7495095729827881, 0.1037178486585617, 0.2296755611896515, 1.1412382125854492, -0.1331772357225418, 1.398102879524231, -...
func CreateBalancer(numWorker int) *LoadBalancer { done := make(chan *Worker, numWorker) b := &LoadBalancer{make(Pool, 0, numWorker), done} for i := 0; i < numWorker; i++ { w := &Worker{make(chan Job, JOB_BUFFER_LENGTH), 0, i} heap.Push(&b.workerPool, w) go w.work(done) } return b }
[ 0.6482022404670715, 0.1181042492389679, 0.8424634337425232, -0.12453999370336533, 0.22966483235359192, 0.6076613664627075, -0.5366877913475037, -1.5382437705993652, -0.05068696662783623, -0.18145669996738434, -0.08955635875463486, -0.1922559291124344, -1.3593343496322632, 1.083809018135070...
func (p Pool) Less(i, j int) bool { return p[i].pending < p[j].pending }
[ -0.48116230964660645, -0.26204389333724976, 0.3279387950897217, -1.2685350179672241, -0.44745928049087524, 0.6786783933639526, -0.4056595265865326, -0.9085758328437805, -1.0772640705108643, -0.09120088815689087, -0.22586892545223236, -0.03799806907773018, -0.8807516694068909, 0.40526339411...
func (p Pool) Len() int { return len(p) }
[ -0.1921762377023697, -0.07792174071073532, -0.197395458817482, -0.607015073299408, 0.6754620671272278, 0.5343274474143982, 1.0870157480239868, 0.46126097440719604, 0.07532058656215668, -0.32262590527534485, -1.32662034034729, 0.7579506635665894, -0.07089296728372574, -0.4792623519897461, ...
func (*UpstreamSpec) Descriptor() ([]byte, []int) { return file_github_com_solo_io_gloo_projects_gloo_api_v1_options_static_static_proto_rawDescGZIP(), []int{0} }
[ -0.6290367245674133, -0.18786746263504028, 0.38962307572364807, -0.9321287274360657, -0.7605857253074646, 1.2046936750411987, 0.2914445996284485, 0.056898895651102066, -0.5487676858901978, 0.6900209784507751, -0.7631048560142517, 0.8788921236991882, -0.09255672246217728, 0.4060427546501159...
func (*Host) Descriptor() ([]byte, []int) { return file_github_com_solo_io_gloo_projects_gloo_api_v1_options_static_static_proto_rawDescGZIP(), []int{1} }
[ -0.11009802669286728, 0.11010780930519104, 0.41119667887687683, 0.39564773440361023, -0.2566604018211365, 0.13622988760471344, 0.02574831061065197, 0.826617419719696, -0.9820942282676697, -0.405670702457428, -0.5274474620819092, -0.11926521360874176, -0.2190367728471756, 0.1923969537019729...
func (*Host_HealthCheckConfig) Descriptor() ([]byte, []int) { return file_github_com_solo_io_gloo_projects_gloo_api_v1_options_static_static_proto_rawDescGZIP(), []int{1, 0} }
[ 0.16017812490463257, 0.2267906218767166, 0.4341755211353302, 0.5080833435058594, 0.8959551453590393, 0.3743780255317688, 0.8914563059806824, 0.8736151456832886, -1.8528642654418945, 0.26482897996902466, -0.5165465474128723, -0.472454696893692, 0.15777108073234558, 0.6312477588653564, 0.2...
func ConfigureLogging(level string, logPath string) { if logPath != "" { infolog = glg.FileWriter(logPath, 0644) glg.Get().AddWriter(infolog) } glg.Get(). SetMode(glg.BOTH). EnableColor(). SetLevelMode(glg.LOG, glg.NONE) // Map the config log level value to an internal representation that is easier //...
[ 0.2624134421348572, -0.5935871005058289, 1.0184558629989624, -0.37300196290016174, 0.07748620957136154, 0.40414074063301086, -0.024187013506889343, -0.23766013979911804, -0.3000788390636444, -0.010669219307601452, -0.6332195997238159, -0.0671524703502655, 0.26475071907043457, 0.40133222937...
func CloseLogger() { if infolog != nil { infolog.Close() } }
[ -0.409318745136261, -0.5991028547286987, 0.37524908781051636, -0.3465125560760498, -0.5559675693511963, 0.811856210231781, -0.08253346383571625, 0.40482228994369507, -0.5997661352157593, -0.5578526258468628, 0.687303900718689, -0.3672808110713959, -0.5271706581115723, 2.9376778602600098, ...
func WithRequestID(ctx context.Context, reqid string) context.Context { return context.WithValue(ctx, reqidKey, reqid) }
[ -0.04305841773748398, -1.1529641151428223, 0.44604551792144775, -0.31555402278900146, -0.6097804307937622, 0.7319340705871582, -0.9170821905136108, -0.5687289834022522, 1.3492177724838257, 0.09406238794326782, 1.4742178916931152, 0.5229001045227051, 0.5638517737388611, -0.1519719958305359,...
func WithChiRequestID(ctx context.Context) context.Context { reqid := middleware.GetReqID(ctx) return WithRequestID(ctx, reqid) }
[ 0.7917015552520752, -1.0652334690093994, 0.5577821731567383, -0.10960759967565536, -0.21955403685569763, 0.037542689591646194, -0.8638771772384644, 0.31962788105010986, 1.119776964187622, 0.28212571144104004, 0.3456330895423889, 0.659374475479126, -0.04313580319285393, 0.45454296469688416,...
func RequestID(ctx context.Context) string { if ctx == nil { return "" } val, _ := ctx.Value(reqidKey).(string) return val }
[ -0.28468891978263855, -0.5740586519241333, 0.35086578130722046, 0.3791646659374237, 0.07417451590299606, 0.4908565580844879, -0.400450199842453, -0.7526857852935791, 1.6259429454803467, 0.10618177801370621, 1.332071304321289, 0.6049526333808899, -0.4083693027496338, 0.2814182937145233, -...
func ip6stringToIP(ip string) net.IP { var chunks = strings.Split(ip, ":") var rxIp4 = regexp.MustCompile( "([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3})") for i, chunk := range chunks { if rxIp4.MatchString(chunk) { var octet1, _ = strconv.Atoi(rxIp4.FindStrin...
[ 0.1756279170513153, -1.2860965728759766, 0.7594409584999084, -0.12627552449703217, -0.96217942237854, -0.13524143397808075, 0.10742759704589844, -0.003815355012193322, -0.15226230025291443, 0.43333032727241516, -0.29147252440452576, -0.6964117884635925, -0.2780317962169647, -2.494320154190...
func (s kafkasByName) Len() int { return len(s) }
[ 0.30570289492607117, -0.1752813756465912, 0.17910821735858917, 0.3013198673725128, -0.5745404958724976, -1.200472354888916, 0.9419990181922913, 0.7157443761825562, 0.23226763308048248, -0.006979831960052252, -1.5294654369354248, -0.2574065029621124, 0.32160377502441406, -0.1190065890550613...
func (c *Client) ListKafkas(i *ListKafkasInput) ([]*Kafka, error) { if i.Service == "" { return nil, ErrMissingService } if i.Version == 0 { return nil, ErrMissingVersion } path := fmt.Sprintf("/service/%s/version/%d/logging/kafka", i.Service, i.Version) resp, err := c.Get(path, nil) if err != nil { retu...
[ -0.988590657711029, -0.5616187453269958, 0.6807381510734558, 1.0194644927978516, -0.966073751449585, -0.9747111201286316, -0.6626033782958984, -0.6770117282867432, 0.9249553680419922, 0.3620704412460327, -0.16228950023651123, 0.7090550065040588, -1.5924344062805176, 0.5416628122329712, -...
func (c *Client) CreateKafka(i *CreateKafkaInput) (*Kafka, error) { if i.Service == "" { return nil, ErrMissingService } if i.Version == 0 { return nil, ErrMissingVersion } path := fmt.Sprintf("/service/%s/version/%d/logging/kafka", i.Service, i.Version) resp, err := c.PostForm(path, i, nil) if err != nil ...
[ -0.6029137372970581, 0.12394203245639801, 0.6236666440963745, 0.9315875768661499, -0.521692156791687, -0.2951684296131134, 0.1884879469871521, -0.6869872808456421, 0.02388526126742363, 0.16429756581783295, 0.1535491794347763, 0.18197515606880188, -1.5873366594314575, 0.28476303815841675, ...
func (c *Client) GetKafka(i *GetKafkaInput) (*Kafka, error) { if i.Service == "" { return nil, ErrMissingService } if i.Version == 0 { return nil, ErrMissingVersion } if i.Name == "" { return nil, ErrMissingName } path := fmt.Sprintf("/service/%s/version/%d/logging/kafka/%s", i.Service, i.Version, url.P...
[ -0.5098803043365479, -0.04764125868678093, 0.78883296251297, 1.0767813920974731, -0.4781021475791931, -0.8016517162322998, 0.34402528405189514, -0.6284852027893066, 0.21500098705291748, -0.18297405540943146, 0.5499823093414307, 1.0665342807769775, -1.3157167434692383, 0.17895464599132538, ...
func (c *Client) UpdateKafka(i *UpdateKafkaInput) (*Kafka, error) { if i.Service == "" { return nil, ErrMissingService } if i.Version == 0 { return nil, ErrMissingVersion } if i.Name == "" { return nil, ErrMissingName } path := fmt.Sprintf("/service/%s/version/%d/logging/kafka/%s", i.Service, i.Version,...
[ -1.1239426136016846, -0.6726110577583313, 0.7188919186592102, 0.8277139067649841, -1.3094916343688965, -0.46434712409973145, 0.4751228094100952, -0.29549577832221985, 0.22322843968868256, 0.6900830864906311, 0.17514881491661072, 0.3239800035953522, -1.7165015935897827, -0.09049100428819656...
func (c *Client) DeleteKafka(i *DeleteKafkaInput) error { if i.Service == "" { return ErrMissingService } if i.Version == 0 { return ErrMissingVersion } if i.Name == "" { return ErrMissingName } path := fmt.Sprintf("/service/%s/version/%d/logging/kafka/%s", i.Service, i.Version, url.PathEscape(i.Name)) ...
[ -0.6456460952758789, -0.39303532242774963, 0.9467400312423706, 1.0178288221359253, -0.7225973606109619, -0.5012546181678772, 0.6232550144195557, 0.011700337752699852, 0.43820253014564514, 0.3014673590660095, 0.23397794365882874, 0.5753255486488342, -1.399221658706665, 0.6869136095046997, ...
func (broker *Broker) Listen() { for { select { case s := <-broker.newClients: // A new client has connected. // Register their message channel broker.clients[s] = struct{}{} log.Printf("Client added. %d registered clients", len(broker.clients)) case s := <-broker.closingClients: // A client has...
[ 0.5359311699867249, -0.9815294742584229, 0.48267489671707153, -0.7954215407371521, 0.796980619430542, -0.275525838136673, 0.6018919348716736, -0.37350237369537354, -0.8168340921401978, 0.4250907003879547, -0.4350287914276123, 0.4748915731906891, -0.6349667310714722, 0.9478134512901306, -...
func (o *QueryUserGroupsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewQueryUserGroupsOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil...
[ -0.11137626320123672, -0.1514492630958557, 0.6778446435928345, 0.5034881234169006, -0.4912009835243225, -1.1649870872497559, 0.33046042919158936, -0.8955318331718445, 0.2850651741027832, 0.17837780714035034, 0.3918572962284088, -0.7754107117652893, -1.3068853616714478, -0.3742698132991791,...
func NewQueryUserGroupsOK() *QueryUserGroupsOK { return &QueryUserGroupsOK{} }
[ 0.3528364598751068, 0.6247783899307251, 0.06339260190725327, 1.6676019430160522, -1.4705290794372559, -0.4338718354701996, 0.3191782236099243, -0.10272323340177536, -0.21225039660930634, -0.414313405752182, -0.6407647132873535, -0.08432473987340927, 0.09276201575994492, -1.4111748933792114...
func NewQueryUserGroupsBadRequest() *QueryUserGroupsBadRequest { return &QueryUserGroupsBadRequest{} }
[ -0.15106181800365448, -0.032237712293863297, 0.3046904504299164, 1.3014400005340576, -0.9134769439697266, 0.004883131477981806, 0.23427166044712067, -0.6909474730491638, -0.41955795884132385, -0.19300630688667297, 0.5746833682060242, 1.056680679321289, -0.292481929063797, -0.31191048026084...
func NewQueryUserGroupsForbidden() *QueryUserGroupsForbidden { return &QueryUserGroupsForbidden{} }
[ 0.6162591576576233, 0.43820056319236755, -0.24506254494190216, 1.0834914445877075, -1.794964075088501, 0.0038381253834813833, 0.13522449135780334, -0.6665107607841492, -0.3799636662006378, -0.7539816498756409, -0.08920866996049881, 0.5499759912490845, -1.0804526805877686, -0.99220615625381...
func NewQueryUserGroupsTooManyRequests() *QueryUserGroupsTooManyRequests { return &QueryUserGroupsTooManyRequests{} }
[ -0.3539086580276489, 0.4635256826877594, 0.008561606518924236, 0.5580242276191711, -0.631015956401825, -0.7052255868911743, -0.7757793664932251, -0.6056455969810486, -0.24463102221488953, -0.22110022604465485, -0.12313070893287659, 0.09871076047420502, -0.20731207728385925, -0.174700841307...
func NewQueryUserGroupsDefault(code int) *QueryUserGroupsDefault { return &QueryUserGroupsDefault{ _statusCode: code, } }
[ 0.3686552941799164, 0.2826702296733856, -0.19586996734142303, 0.8040579557418823, -0.32687532901763916, 0.07003895193338394, -0.10136649012565613, -0.042766034603118896, -0.07755721360445023, -0.2393118143081665, -0.7235047817230225, -0.19542664289474487, -1.1611220836639404, -0.7328480482...
func (o *QueryUserGroupsDefault) Code() int { return o._statusCode }
[ -0.1165313571691513, 1.3098242282867432, -0.10121363401412964, 1.0563836097717285, 0.2390286773443222, -0.10412538051605225, 0.20760636031627655, 0.23956994712352753, -0.4799129366874695, -0.05832820385694504, -0.032447513192892075, -0.7839452624320984, -1.040025234222412, 0.42418217658996...
func blendAdd(S, D uint32) uint32 { add := S + D if add < 65535 { return add } else { return 65535 } }
[ 0.09865570068359375, 0.4257529079914093, 0.47623321413993835, 0.1690516471862793, -0.5622615814208984, 0.9245206713676453, -0.13134326040744781, -0.7840818762779236, 1.0372657775878906, -0.6366713047027588, 0.30411964654922485, 0.8238564133644104, -0.6201595067977905, 0.0998048409819603, ...
func NewProblemTitleController(router gin.IRouter, client *ent.Client) *ProblemTitleController { uc := &ProblemTitleController{ client: client, router: router, } uc.register() return uc }
[ -0.04100498929619789, -0.20487184822559357, 0.21577408909797668, -0.1457403302192688, -0.4719576835632324, 0.0678202360868454, -1.026197075843811, -0.22122237086296082, -0.006701021920889616, -0.2438179850578308, -0.4127883017063141, -0.09401344507932663, -0.29936346411705017, -0.129138067...
func NewListHetznerSizesParams() *ListHetznerSizesParams { return &ListHetznerSizesParams{ timeout: cr.DefaultTimeout, } }
[ 0.5315782427787781, -0.44607922434806824, 0.02107103355228901, 0.6316499710083008, 0.33701983094215393, -0.5012114644050598, -0.42307159304618835, -0.19873584806919098, -0.4272295832633972, 0.43059468269348145, -0.44906526803970337, -0.254587322473526, -0.17149733006954193, 1.4067721366882...
func NewListHetznerSizesParamsWithTimeout(timeout time.Duration) *ListHetznerSizesParams { return &ListHetznerSizesParams{ timeout: timeout, } }
[ 1.1107507944107056, -0.696185827255249, 0.30443891882896423, 0.6378742456436157, 0.3315992057323456, 0.15654096007347107, -0.94459468126297, -0.195360466837883, -0.3157280385494232, 1.4168940782546997, -0.22923724353313446, 0.06071224436163902, -0.26148873567581177, 1.5513921976089478, -...
func NewListHetznerSizesParamsWithContext(ctx context.Context) *ListHetznerSizesParams { return &ListHetznerSizesParams{ Context: ctx, } }
[ 0.5624850988388062, -0.5843666791915894, 0.3561514914035797, 0.3602774739265442, 0.7454570531845093, 0.24576213955879211, -0.9501810669898987, -0.6953111886978149, 0.167288675904274, 0.649069607257843, -0.12184277176856995, -0.1393415629863739, -0.06401122361421585, 1.2344576120376587, -...
func NewListHetznerSizesParamsWithHTTPClient(client *http.Client) *ListHetznerSizesParams { return &ListHetznerSizesParams{ HTTPClient: client, } }
[ 0.36536693572998047, -0.9393712878227234, 0.36420148611068726, 0.3009660840034485, 0.5751438140869141, 0.06339025497436523, -0.1262741982936859, -0.4522732198238373, -0.4103947877883911, 0.33152642846107483, -0.39960891008377075, -0.2206721305847168, -0.3605499863624573, 0.8711972236633301...
func (o *ListHetznerSizesParams) WithDefaults() *ListHetznerSizesParams { o.SetDefaults() return o }
[ 0.7249936461448669, 0.26599186658859253, 0.04274357110261917, 0.3282737731933594, 0.9681394100189209, -0.7402682900428772, -0.4207102358341217, -0.5959738492965698, 0.32674840092658997, -0.3995581269264221, -0.4733329713344574, -0.9500182271003723, -0.46224257349967957, 1.281873106956482, ...
func (o *ListHetznerSizesParams) SetDefaults() { // no default values defined for this parameter }
[ 0.0020198822021484375, 0.3799683153629303, 0.08028964698314667, 0.0597463995218277, 1.6125987768173218, -0.2036847025156021, 0.017112677916884422, -0.5593369007110596, -0.35816118121147156, -0.4620996415615082, -0.8667579889297485, -0.2928062379360199, -1.0309432744979858, 1.45594632625579...
func (o *ListHetznerSizesParams) WithTimeout(timeout time.Duration) *ListHetznerSizesParams { o.SetTimeout(timeout) return o }
[ 0.8442191481590271, 0.28693217039108276, 0.24065335094928741, 0.13014701008796692, 0.31493061780929565, -0.06010027602314949, -0.11287908256053925, -0.3281935155391693, 0.1822538822889328, 0.741452693939209, -0.3542044460773468, 0.0029400046914815903, 0.0007893686997704208, 1.7040246725082...
func (o *ListHetznerSizesParams) SetTimeout(timeout time.Duration) { o.timeout = timeout }
[ 0.43642234802246094, 0.19170600175857544, 0.14548835158348083, -0.10260704159736633, 0.5344866514205933, 0.35697174072265625, -0.02189710922539234, 0.11352580040693283, -0.14437922835350037, 0.7532062530517578, -0.6320911645889282, -0.0614040344953537, -0.3100431561470032, 1.88126516342163...
func (o *ListHetznerSizesParams) WithContext(ctx context.Context) *ListHetznerSizesParams { o.SetContext(ctx) return o }
[ 0.27705419063568115, 0.37336698174476624, 0.3337012827396393, -0.012707863934338093, 0.44759243726730347, -0.07074898481369019, -0.34209468960762024, -0.6613357663154602, 0.5939769744873047, 0.030118325725197792, -0.33579230308532715, -0.14208778738975525, -0.3565216660499573, 1.3190577030...
func (o *ListHetznerSizesParams) SetContext(ctx context.Context) { o.Context = ctx }
[ -0.08162642270326614, 0.3830545246601105, 0.22583681344985962, 0.07318184524774551, 0.7968629002571106, 0.12791433930397034, -0.1277001053094864, -0.4961622655391693, 0.7364093661308289, 0.0968126580119133, -0.6926308870315552, -0.13694849610328674, -0.5619326829910278, 1.5497665405273438,...
func (o *ListHetznerSizesParams) WithHTTPClient(client *http.Client) *ListHetznerSizesParams { o.SetHTTPClient(client) return o }
[ 0.3802017867565155, -0.3622238337993622, 0.31538182497024536, -0.2531016170978546, 0.29569268226623535, -0.251665860414505, 0.3578071594238281, -0.7674615383148193, -0.33680835366249084, -0.23217304050922394, -0.3136643171310425, -0.2693932354450226, 0.010799134150147438, 0.740672469139099...
func (o *ListHetznerSizesParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client }
[ 0.43739309906959534, -0.3517458736896515, 0.2054331749677658, -0.9404129385948181, -0.08600469678640366, -0.30432891845703125, 0.35437867045402527, -0.8020582795143127, -0.5647361278533936, -0.017629019916057587, -0.5831066966056824, 0.14472080767154694, -0.48757362365722656, 0.70699256658...
func (o *ListHetznerSizesParams) WithCredential(credential *string) *ListHetznerSizesParams { o.SetCredential(credential) return o }
[ 0.396829754114151, -0.16239307820796967, 0.07597915083169937, 0.4532661437988281, 0.26537710428237915, -0.06203978508710861, 0.39076077938079834, -0.07118207961320877, 0.0227688979357481, 0.18179085850715637, -0.49644964933395386, -0.04971492290496826, -0.566573441028595, 0.794630169868469...
func (o *ListHetznerSizesParams) SetCredential(credential *string) { o.Credential = credential }
[ 0.16333334147930145, -0.5247263312339783, 0.12452523410320282, 0.15502609312534332, 0.42024266719818115, 0.007786117494106293, 0.4142604172229767, 0.2940120995044708, -0.4544603228569031, 0.6512578725814819, -0.9935058355331421, 0.34561508893966675, -1.1056294441223145, 1.1866092681884766,...
func (o *ListHetznerSizesParams) WithHetznerToken(hetznerToken *string) *ListHetznerSizesParams { o.SetHetznerToken(hetznerToken) return o }
[ 0.41337525844573975, -0.5918809771537781, 0.3117373585700989, 0.2702290415763855, 0.06211889162659645, -0.3631076216697693, -0.05183500051498413, 0.07674998044967651, 0.08155255019664764, -0.4868261218070984, -0.8305952548980713, -0.26384127140045166, 0.04561447352170944, 1.081727385520935...
func (o *ListHetznerSizesParams) SetHetznerToken(hetznerToken *string) { o.HetznerToken = hetznerToken }
[ -0.034920834004879, -0.5754183530807495, 0.17772755026817322, 0.23011784255504608, 0.3477369248867035, -0.12120916694402695, 0.11500715464353561, 0.6731919050216675, -0.4628862142562866, -0.45809492468833923, -1.5087149143218994, 0.2522693872451782, -0.08150605112314224, 1.038759469985962,...
func (o *ListHetznerSizesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { if err := r.SetTimeout(o.timeout); err != nil { return err } var res []error if o.Credential != nil { // header param Credential if err := r.SetHeaderParam("Credential", *o.Credential); err != nil { ret...
[ -0.9116590023040771, -0.4700305461883545, 0.7805127501487732, -0.5382341146469116, 0.9712125062942505, -0.2952635586261749, 0.3720100522041321, -0.021086422726511955, -0.6910380721092224, 0.41879868507385254, -0.0009241517400369048, 0.10978337377309799, -0.6282113790512085, 0.8445812463760...
func fTokens() Tokens { return Tokens{ Index: -1, } }
[ -0.68196702003479, 0.12931592762470245, 0.3162255883216858, -0.6760534644126892, -0.4884399175643921, -0.5654088854789734, -0.03608575463294983, -0.31032100319862366, 0.5682481527328491, -0.25063732266426086, -1.3445807695388794, 0.44410234689712524, 0.13999758660793304, -0.640679895877838...
func fToken(value, tokenType string, parts []Part) Token { return Token{ TValue: value, TType: tokenType, Parts: parts, } }
[ 0.11437266319990158, -0.35934755206108093, 0.2525709569454193, -0.5462707877159119, -1.1485543251037598, 0.08341313898563385, -0.5850270390510559, 0.3244820535182953, -0.04548259451985359, -0.7449019551277161, -0.936095654964447, 0.1619766801595688, 0.41605910658836365, -0.2580055594444275...
func (tk *Tokens) add(value, tokenType string, parts []Part) Token { token := fToken(value, tokenType, parts) tk.addRef(token) return token }
[ -0.5653374195098877, -0.20465423166751862, 0.2472560852766037, -1.0499411821365356, -0.2974279224872589, 0.3505946397781372, -0.746528148651123, -0.24981451034545898, 0.14619727432727814, -0.7881616950035095, 0.2269894778728485, 0.2195187509059906, -0.22791171073913574, 0.6081914901733398,...
func (tk *Tokens) addRef(token Token) { if len(tk.Sections) <= tk.SectionIndex { sectionType := []string{TokenSectionPositive, TokenSectionNegative, TokenSectionZero, TokenSectionText}[tk.SectionIndex] for i := len(tk.Sections) - 1; i < tk.SectionIndex; i++ { tk.Sections = append(tk.Sections, Section{Type: sect...
[ -0.26103049516677856, -0.21440204977989197, 0.8059654235839844, -0.9975157380104065, 0.12609538435935974, 0.4953814744949341, -0.23197472095489502, 0.014763685874640942, -0.01975885219871998, 0.3669373691082001, 0.5215436220169067, -0.4919021725654602, 0.31759920716285706, 1.34763121604919...
func (tk *Tokens) reset() { tk.Index = -1 }
[ -0.9569963812828064, 0.20857718586921692, -0.03964676707983017, -0.4862869083881378, 0.33816078305244446, -0.12587441504001617, 0.8629663586616516, 0.44712063670158386, -1.2665563821792603, 0.14059217274188995, -0.33683449029922485, 0.9268233180046082, -0.30574122071266174, -0.105807602405...
func NumberFormatParser() Parser { return Parser{} }
[ 0.013103452511131763, -1.5461047887802124, 0.1348472386598587, -0.20610816776752472, -1.2131726741790771, -0.09163941442966461, -0.5009313225746155, 0.4890970289707184, 0.7342370748519897, -1.2555781602859497, -0.566875159740448, -1.1278128623962402, -0.14001351594924927, 0.797368884086608...
func (ps *Parser) EOF() bool { return ps.Offset >= len(ps.Runes) }
[ 0.7644938230514526, -0.038109589368104935, 0.49686098098754883, -1.2618814706802368, -0.4436224699020386, 0.666742742061615, -0.6153950095176697, -0.19237159192562103, -0.504997730255127, -0.10200580954551697, 0.5088375806808472, -0.004291664343327284, -0.06530056148767471, 0.3318437933921...
func (ps *Parser) getTokens() Tokens { // state-dependent character evaluation (order is important) for !ps.EOF() { if ps.InBracket { if ps.Token.TType == TokenTypeCurrencyLanguage { if ps.currentChar() != Dash && ps.currentChar() != BracketClose { if len(ps.Token.Parts) == 0 { ps.Token.Parts = ap...
[ -0.33286044001579285, -0.2985098659992218, 0.6057648658752441, -1.2411167621612549, -0.3054998815059662, -0.30588796734809875, 0.08617754280567169, 0.3441108763217926, -0.6910424828529358, -0.07241617888212204, -0.1654309779405594, 0.4660745859146118, 0.16907230019569397, 0.560096859931945...
func (ps *Parser) Parse(numFmt string) []Section { ps.NumFmt = strings.TrimSpace(numFmt) ps.Runes = []rune(ps.NumFmt) ps.Tokens = ps.getTokens() return ps.Tokens.Sections }
[ -0.24019473791122437, -0.5764082670211792, 0.5376062989234924, -0.3745340406894684, -0.26884329319000244, -0.5201960206031799, -0.3870273530483246, -0.4399794042110443, 0.11525232344865799, -1.1963623762130737, 0.163813054561615, -0.6817141175270081, -0.07670265436172485, 1.126238822937011...
func (ps *Parser) doubleChar() string { if len(ps.Runes) >= ps.Offset+2 { return string(ps.Runes[ps.Offset : ps.Offset+2]) } return "" }
[ 0.5814022421836853, -0.6008203625679016, 0.4456062614917755, -0.27991530299186707, -0.6221952438354492, 0.8954469561576843, 0.5387735366821289, -0.4238399267196655, -0.36111176013946533, -0.3253090977668762, 0.4725148379802704, 0.46386346220970154, 0.4809086322784424, 0.16120009124279022, ...
func (ps *Parser) currentChar() string { return string(ps.Runes[ps.Offset]) }
[ 0.002767192665487528, -1.6981552839279175, 0.314937949180603, -0.3362470865249634, -0.8262683749198914, 1.2962646484375, 0.4496505856513977, 0.025803955271840096, -0.7083030939102173, -0.7411084771156311, 1.3656134605407715, 0.7446917295455933, -0.22431975603103638, 0.022389089688658714, ...
func (ps *Parser) nextChar() string { if len(ps.Runes) >= ps.Offset+2 { return string(ps.Runes[ps.Offset+1 : ps.Offset+2]) } return "" }
[ 0.695075273513794, -0.5584567785263062, 0.47700852155685425, -0.020773762837052345, -1.2968430519104004, 0.9250468611717224, 0.11882106959819794, -0.3140731155872345, -0.36779871582984924, -1.2278778553009033, 1.0199625492095947, 0.6139810085296631, 0.34265604615211487, 0.05322999879717827...
func (ps *Parser) apPattern() (int, string) { for i, pattern := range AmPm { l := len(pattern) if len(ps.Runes) >= ps.Offset+l { matched := string(ps.Runes[ps.Offset : ps.Offset+l]) if strings.EqualFold(matched, pattern) { return i, matched } } } return -1, "" }
[ -0.41256529092788696, -0.6322230100631714, 0.6652523279190063, -0.9262482523918152, -1.040233850479126, -0.4117254614830017, 0.2598435878753662, 0.584793746471405, -0.14270678162574768, 0.27850356698036194, -0.02359156310558319, 0.2738686800003052, 0.29777291417121887, 0.40654516220092773,...
func (ps *Parser) generalPattern() (int, string) { l := len(TokenTypeGeneral) if len(ps.Runes) >= ps.Offset+l { matched := string(ps.Runes[ps.Offset : ps.Offset+l]) if strings.EqualFold(matched, TokenTypeGeneral) { return 0, matched } } return -1, "" }
[ -0.7843292951583862, -0.126255065202713, 0.6567751169204712, -0.3955676853656769, -0.4313802719116211, 0.736925482749939, -0.11547538638114929, 0.44573816657066345, -0.260640412569046, -0.12135767191648483, 0.2764897644519806, 0.7743210196495056, -0.16307222843170166, 0.7803738117218018, ...
func inStrSlice(a []string, x string, caseSensitive bool) int { for idx, n := range a { if !caseSensitive && strings.EqualFold(x, n) { return idx } if x == n { return idx } } return -1 }
[ -0.9474014043807983, 0.15060469508171082, 0.19052977859973907, -0.4705415964126587, -0.7249958515167236, -0.5382542610168457, -0.05184292420744896, 0.21430964767932892, -0.17515601217746735, 0.8274096846580505, 0.8299148678779602, 0.9791929721832275, -0.22882625460624695, -0.89352571964263...
func (ps *Parser) PrettyPrint() string { indent, output := 0, "" for _, section := range ps.Tokens.Sections { output += "<" + section.Type + ">" + "\n" for _, item := range section.Items { indent++ for i := 0; i < indent; i++ { output += "\t" } if len(item.Parts) == 0 { output += item.TValue +...
[ 0.4103814363479614, -1.0768038034439087, 1.0430641174316406, -0.9630320072174072, -0.23674587905406952, 0.2676294445991516, -0.978416919708252, -0.19011174142360687, -1.3169915676116943, 0.17269909381866455, 0.7447236180305481, -0.4059267044067383, -0.030573125928640366, 0.3061991035938263...
func (n *Node) String() string { name := n.Field if n.IsArray { name = "array[" + n.TypeName + "]" } if n.ChildNode != nil { return name + "." + n.ChildNode.String() } if len(n.TypeName) > 0 { return name + " : " + n.TypeName } return name }
[ -0.36330094933509827, -0.6926313042640686, 0.5648030042648315, -1.0058434009552002, -0.35066601634025574, 0.3705439269542694, 0.08018334209918976, -1.2492849826812744, -0.6316558718681335, 0.3724885880947113, -0.358688622713089, 1.0759838819503784, 0.1817825585603714, 0.034151241183280945,...
func (n *Node) AddLeafNode(toAdd *Node) *Node { if n.ChildNode == nil { n.ChildNode = toAdd } else { n.ChildNode.AddLeafNode(toAdd) } return n }
[ 0.5078381299972534, 0.13921846449375153, 0.6532250046730042, -0.48425111174583435, -0.1756713092327118, 0.6533874869346619, -0.8462971448898315, 0.7713994979858398, 0.8046572208404541, -0.40575167536735535, -0.037854842841625214, 0.850339949131012, -0.6507861018180847, 0.5394608974456787, ...
func (n Node) Copy() *Node { newNode := n if newNode.ChildNode != nil { n.ChildNode = newNode.ChildNode.Copy() } return &newNode }
[ -0.5045498609542847, -0.10982829332351685, 0.44094470143318176, 0.3971538543701172, -1.168818712234497, 0.781054675579071, 0.2338024228811264, -0.025692682713270187, 0.591138482093811, 0.6195968389511108, 0.09437330067157745, 0.59389328956604, -0.31513088941574097, 0.31078603863716125, 0...
func AbsolutePathHelper(rel string, parts ...string) (path string, err error) { abs, err := filepath.Abs(rel) if err != nil { return "", err } return filepath.Join(append([]string{abs}, parts...)...), nil }
[ 0.8807764053344727, -0.87627774477005, 0.7474406957626343, 0.06319326907396317, -0.23330053687095642, 1.2760447263717651, -0.40739506483078003, -0.3598472476005554, -0.7486085295677185, 0.6560197472572327, 0.9785043597221375, -0.7268281579017639, 0.27723419666290283, -0.18943175673484802, ...
func MakeDirectory(path string) (err error) { abs, err := filepath.Abs(path) if err != nil { return err } // if it exists we ignore the error, by not creating the dir if _, err := os.Stat(abs); os.IsNotExist(err) { os.Mkdir(abs, 0777) } return nil }
[ 0.31058743596076965, -0.018796486780047417, 0.9247233271598816, -0.29181453585624695, 0.0950908213853836, 1.1207407712936401, 0.4743824303150177, -0.5703108310699463, 0.04303876310586929, -0.7469406127929688, 0.17773154377937317, -0.2730262279510498, 0.864589512348175, 0.24050891399383545,...