text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (m *StatisticMutation) StatisticName() (r string, exists bool) {
v := m._StatisticName
if v == nil {
return
}
return *v, true
} | [
-0.6464313268661499,
1.233719825744629,
0.5962560176849365,
0.9597525596618652,
-0.6726118922233582,
-0.8325891494750977,
0.5095880627632141,
-0.13118191063404083,
0.15645697712898254,
1.2513535022735596,
-0.34377536177635193,
-1.400878667831421,
0.3934037387371063,
-0.9035868644714355,
... |
func (m *StatisticMutation) OldStatisticName(ctx context.Context) (v string, err error) {
if !m.op.Is(OpUpdateOne) {
return v, fmt.Errorf("OldStatisticName is allowed only on UpdateOne operations")
}
if m.id == nil || m.oldValue == nil {
return v, fmt.Errorf("OldStatisticName requires an ID field in the mutation... | [
-0.08737245947122574,
0.41543856263160706,
0.3870009481906891,
0.5332032442092896,
-0.3550778925418854,
-0.3623615801334381,
0.6030181050300598,
-0.8634302020072937,
0.12517455220222473,
0.6717366576194763,
0.5860663652420044,
-0.47399795055389404,
0.4949647784233093,
-0.20272669196128845,... |
func (m *StatisticMutation) ResetStatisticName() {
m._StatisticName = nil
} | [
0.38469183444976807,
0.493455708026886,
-0.013714626431465149,
1.5825340747833252,
-0.4998215436935425,
-0.22846610844135284,
0.8607544898986816,
-0.4258972108364105,
-0.6989317536354065,
0.36731183528900146,
0.05665077269077301,
0.44660690426826477,
0.18432706594467163,
-0.931958794593811... |
func (m *StatisticMutation) AddAreaIDs(ids ...int) {
if m.area == nil {
m.area = make(map[int]struct{})
}
for i := range ids {
m.area[ids[i]] = struct{}{}
}
} | [
-1.4609832763671875,
0.20519639551639557,
0.4016084671020508,
-0.5969530344009399,
-0.35149049758911133,
0.21047140657901764,
-0.3073428273200989,
-0.2739311158657074,
0.7475232481956482,
0.20077753067016602,
0.365194708108902,
-0.1524641066789627,
0.10332903265953064,
0.6757160425186157,
... |
func (m *StatisticMutation) RemoveAreaIDs(ids ...int) {
if m.removedarea == nil {
m.removedarea = make(map[int]struct{})
}
for i := range ids {
m.removedarea[ids[i]] = struct{}{}
}
} | [
-1.3787120580673218,
-0.11429310590028763,
0.3191024959087372,
-0.6897640824317932,
-1.22059166431427,
-0.10696914047002792,
0.21181358397006989,
0.42581385374069214,
0.5900236964225769,
0.5247290730476379,
-0.27182313799858093,
-0.3111044466495514,
-0.24547472596168518,
0.3987762033939361... |
func (m *StatisticMutation) RemovedAreaIDs() (ids []int) {
for id := range m.removedarea {
ids = append(ids, id)
}
return
} | [
-0.43059083819389343,
-0.4542416036128998,
0.33609580993652344,
-0.4172714650630951,
-0.9264231324195862,
-0.07371143251657486,
0.3679770529270172,
0.11796370893716812,
1.175037145614624,
0.345540851354599,
-0.25439298152923584,
0.5905510187149048,
-0.2938157916069031,
0.8785132169723511,
... |
func (m *StatisticMutation) AreaIDs() (ids []int) {
for id := range m.area {
ids = append(ids, id)
}
return
} | [
-0.7630197405815125,
-0.2885902523994446,
0.05236298218369484,
0.2398325651884079,
-0.37973901629447937,
0.12601949274539948,
-0.3363615572452545,
-0.033246960490942,
1.2966216802597046,
1.0471915006637573,
0.30909934639930725,
0.7114982008934021,
0.05814672261476517,
0.5108931064605713,
... |
func (m *StatisticMutation) ResetArea() {
m.area = nil
m.removedarea = nil
} | [
-0.2120421826839447,
0.1878228336572647,
0.29263752698898315,
0.720308244228363,
0.5343309640884399,
-0.9524642825126648,
1.5632944107055664,
0.6569799780845642,
0.320193350315094,
-0.6097828149795532,
0.8143125772476196,
0.23463165760040283,
0.06828030198812485,
1.0594446659088135,
0.13... |
func (m *StatisticMutation) Op() Op {
return m.op
} | [
-0.4288705289363861,
0.35569116473197937,
0.08998902887105942,
1.334378957748413,
-0.3452915847301483,
0.8114070296287537,
1.5219480991363525,
0.02154143713414669,
0.5223318934440613,
0.38197359442710876,
0.5381961464881897,
-0.7311827540397644,
0.546091616153717,
-1.0467218160629272,
-0... |
func (m *StatisticMutation) Type() string {
return m.typ
} | [
0.09840545058250427,
-0.09217381477355957,
-0.029825551435351372,
1.2284338474273682,
0.5702403783798218,
0.5625604391098022,
1.2748537063598633,
-1.5169100761413574,
0.8840548992156982,
0.19624201953411102,
0.6889250874519348,
-0.28201043605804443,
0.02550635300576687,
-0.0029234574176371... |
func (m *StatisticMutation) Fields() []string {
fields := make([]string, 0, 1)
if m._StatisticName != nil {
fields = append(fields, statistic.FieldStatisticName)
}
return fields
} | [
-0.480003297328949,
0.735486626625061,
0.12365611642599106,
0.16387228667736053,
0.44898808002471924,
0.07751203328371048,
-0.06684602051973343,
-0.5735138654708862,
0.6813018918037415,
0.22501212358474731,
-0.3063221871852875,
-0.6158169507980347,
0.056301675736904144,
-0.1425954103469848... |
func (m *StatisticMutation) Field(name string) (ent.Value, bool) {
switch name {
case statistic.FieldStatisticName:
return m.StatisticName()
}
return nil, false
} | [
-0.7090756893157959,
0.8835009336471558,
0.5360087752342224,
0.3622685968875885,
-0.3789501190185547,
0.43167224526405334,
-0.5322081446647644,
-0.4786263108253479,
0.22342589497566223,
0.06994139403104782,
-0.08935508877038956,
-0.835676372051239,
0.38227948546409607,
0.20187433063983917,... |
func (m *StatisticMutation) OldField(ctx context.Context, name string) (ent.Value, error) {
switch name {
case statistic.FieldStatisticName:
return m.OldStatisticName(ctx)
}
return nil, fmt.Errorf("unknown Statistic field %s", name)
} | [
0.2653043568134308,
0.7572427988052368,
0.2937501072883606,
0.034904785454273224,
0.02006686106324196,
0.4431668519973755,
0.2773329019546509,
-0.9433559775352478,
0.09188768267631531,
-0.02196938917040825,
0.3042892813682556,
-0.10918160527944565,
0.45328471064567566,
-0.20924139022827148... |
func (m *StatisticMutation) SetField(name string, value ent.Value) error {
switch name {
case statistic.FieldStatisticName:
v, ok := value.(string)
if !ok {
return fmt.Errorf("unexpected type %T for field %s", value, name)
}
m.SetStatisticName(v)
return nil
}
return fmt.Errorf("unknown Statistic field ... | [
-0.5177637934684753,
0.990424633026123,
0.42935141921043396,
0.4640771448612213,
-0.43230170011520386,
0.8747936487197876,
-0.33128851652145386,
-0.5334332585334778,
-0.1174793466925621,
0.1811663806438446,
-0.08325622230768204,
-0.4925437867641449,
0.5044974684715271,
0.5221112966537476,
... |
func (m *StatisticMutation) AddedFields() []string {
return nil
} | [
0.18148700892925262,
0.7328696250915527,
0.46265682578086853,
0.20965984463691711,
0.10361641645431519,
0.7912946343421936,
0.5921775102615356,
-0.3282998502254486,
1.2444560527801514,
-1.0459249019622803,
-0.1473487913608551,
-0.4380008578300476,
-0.9597270488739014,
0.13656099140644073,
... |
func (m *StatisticMutation) AddedField(name string) (ent.Value, bool) {
return nil, false
} | [
-1.0299386978149414,
0.983285665512085,
0.7089402079582214,
-0.06093023717403412,
-0.3956447243690491,
1.1670234203338623,
-0.0556911826133728,
-0.19413650035858154,
0.6165515184402466,
-0.5154563188552856,
-0.4887409508228302,
-1.2357637882232666,
-1.189845085144043,
0.08430645614862442,
... |
func (m *StatisticMutation) AddField(name string, value ent.Value) error {
switch name {
}
return fmt.Errorf("unknown Statistic numeric field %s", name)
} | [
-0.4349680542945862,
0.8767362236976624,
0.5454192757606506,
0.5466578602790833,
-0.2621791660785675,
1.3045986890792847,
-0.5478995442390442,
-0.5453102588653564,
-0.2620782256126404,
-0.05222141742706299,
0.2434316873550415,
-0.9714704155921936,
0.34617099165916443,
0.13099558651447296,
... |
func (m *StatisticMutation) ClearedFields() []string {
return nil
} | [
0.17952744662761688,
1.114846110343933,
0.38751256465911865,
0.229895681142807,
-0.5805731415748596,
0.5698342323303223,
0.5031338930130005,
-0.6767791509628296,
0.996278703212738,
0.4691675901412964,
0.0022574826143682003,
-0.34890466928482056,
-0.611477255821228,
-0.732398509979248,
-0... |
func (m *StatisticMutation) FieldCleared(name string) bool {
_, ok := m.clearedFields[name]
return ok
} | [
-0.38623666763305664,
0.5864546298980713,
0.7151342034339905,
-0.11548343300819397,
-0.3617217242717743,
0.37282511591911316,
-0.4880177080631256,
-0.13807977735996246,
0.051308512687683105,
-0.13330717384815216,
-0.7527926564216614,
-0.5139918923377991,
0.5218561291694641,
-0.471673220396... |
func (m *StatisticMutation) ClearField(name string) error {
return fmt.Errorf("unknown Statistic nullable field %s", name)
} | [
0.2877272069454193,
1.2193067073822021,
0.45186111330986023,
0.22553478181362152,
-0.7968471050262451,
0.697238028049469,
-0.20316556096076965,
-0.7556002736091614,
0.23573172092437744,
0.9119241237640381,
-0.09755722433328629,
-0.6557349562644958,
0.4094194769859314,
-0.008323256857693195... |
func (m *StatisticMutation) ResetField(name string) error {
switch name {
case statistic.FieldStatisticName:
m.ResetStatisticName()
return nil
}
return fmt.Errorf("unknown Statistic field %s", name)
} | [
-0.12653091549873352,
1.4218288660049438,
0.2782454788684845,
0.8985421061515808,
-0.013363780453801155,
0.33033591508865356,
0.5761833190917969,
-0.5416760444641113,
-0.11002513766288757,
0.45018434524536133,
-0.026106256991624832,
-0.27184489369392395,
0.017667492851614952,
-0.3730776309... |
func (m *StatisticMutation) AddedEdges() []string {
edges := make([]string, 0, 1)
if m.area != nil {
edges = append(edges, statistic.EdgeArea)
}
return edges
} | [
-0.23335784673690796,
0.066404327750206,
0.31636589765548706,
0.4577447175979614,
0.1006138026714325,
0.1559828817844391,
-0.49771416187286377,
-0.3470427393913269,
1.4480983018875122,
0.2781895697116852,
1.0743401050567627,
0.030924590304493904,
-0.47394949197769165,
1.0112168788909912,
... |
func (m *StatisticMutation) AddedIDs(name string) []ent.Value {
switch name {
case statistic.EdgeArea:
ids := make([]ent.Value, 0, len(m.area))
for id := range m.area {
ids = append(ids, id)
}
return ids
}
return nil
} | [
-0.5381584763526917,
-0.1737534999847412,
0.22799904644489288,
-0.49317601323127747,
-0.0421978160738945,
0.4396801292896271,
-0.41466715931892395,
-0.3933333456516266,
0.9787791967391968,
0.34881848096847534,
0.6629410982131958,
0.20768634974956512,
-0.04961332678794861,
0.748451054096221... |
func (m *StatisticMutation) RemovedEdges() []string {
edges := make([]string, 0, 1)
if m.removedarea != nil {
edges = append(edges, statistic.EdgeArea)
}
return edges
} | [
0.013752877712249756,
0.008022136986255646,
0.5524587035179138,
0.5054285526275635,
-0.35872581601142883,
-0.3905331790447235,
0.137590229511261,
0.23954026401042938,
1.2655608654022217,
0.3662855625152588,
0.3417150378227234,
0.16212795674800873,
-0.7537077069282532,
0.7801966071128845,
... |
func (m *StatisticMutation) RemovedIDs(name string) []ent.Value {
switch name {
case statistic.EdgeArea:
ids := make([]ent.Value, 0, len(m.removedarea))
for id := range m.removedarea {
ids = append(ids, id)
}
return ids
}
return nil
} | [
-0.24454383552074432,
-0.24381941556930542,
0.4726797938346863,
-0.35228288173675537,
-0.15875676274299622,
-0.13793118298053741,
-0.20008786022663116,
0.24219007790088654,
0.8765740394592285,
0.6348704695701599,
-0.18729570508003235,
0.24587446451187134,
-0.2870762050151825,
0.43168649077... |
func (m *StatisticMutation) ClearedEdges() []string {
edges := make([]string, 0, 1)
return edges
} | [
-0.5553490519523621,
0.12689143419265747,
0.3662949800491333,
0.683341920375824,
-0.7316134572029114,
0.0682070180773735,
-0.5932998061180115,
-0.8230181932449341,
0.848756730556488,
1.4709498882293701,
0.5409693121910095,
0.6896315217018127,
-0.5290743112564087,
-0.46984732151031494,
-0... |
func (m *StatisticMutation) EdgeCleared(name string) bool {
switch name {
}
return false
} | [
-0.6793680787086487,
0.22437605261802673,
0.5635225772857666,
0.029891083016991615,
-0.780864953994751,
0.6192472577095032,
-0.33853879570961,
-0.5449956655502319,
0.04215983301401138,
0.3799053132534027,
0.08342377096414566,
-0.47184857726097107,
-0.3975459635257721,
0.10151137411594391,
... |
func (m *StatisticMutation) ClearEdge(name string) error {
switch name {
}
return fmt.Errorf("unknown Statistic unique edge %s", name)
} | [
-0.43494242429733276,
1.4004640579223633,
0.3617904484272003,
1.1866555213928223,
-0.5665870308876038,
0.2800251245498657,
0.04739869013428688,
0.16622871160507202,
0.10101097077131271,
0.8797152638435364,
0.3565545976161957,
-0.10750128328800201,
0.3099142909049988,
0.4598373770713806,
... |
func (m *StatisticMutation) ResetEdge(name string) error {
switch name {
case statistic.EdgeArea:
m.ResetArea()
return nil
}
return fmt.Errorf("unknown Statistic edge %s", name)
} | [
-0.6350303888320923,
1.0962464809417725,
0.31628841161727905,
1.5291576385498047,
0.27084881067276,
-0.4590798616409302,
0.5948231816291809,
0.4003758132457733,
-0.1641644984483719,
0.9155448079109192,
0.5477780699729919,
-0.07489286363124847,
-0.1789504736661911,
0.40127426385879517,
0.... |
func (m *ItemCalendarViewBookingAppointmentItemRequestBuilder) Cancel()(*ItemCalendarViewItemCancelRequestBuilder) {
return NewItemCalendarViewItemCancelRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter)
} | [
-0.1487501561641693,
-0.674356997013092,
0.6247340440750122,
0.9239934086799622,
-1.150147795677185,
1.1029822826385498,
0.056607071310281754,
1.1186323165893555,
0.07631316781044006,
-0.2445794641971588,
1.1455330848693848,
0.4962586462497711,
-0.4895932674407959,
-0.41170012950897217,
... |
func NewItemCalendarViewBookingAppointmentItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCalendarViewBookingAppointmentItemRequestBuilder) {
m := &ItemCalendarViewBookingAppointmentItemRequestBuilder{... | [
-0.8868505358695984,
-0.6482117772102356,
0.6513575911521912,
0.050530124455690384,
-1.04595947265625,
1.0074092149734497,
0.11739859730005264,
0.4289690852165222,
-0.5957553386688232,
-0.7339137196540833,
0.8113559484481812,
0.5111556053161621,
-0.8597784638404846,
-0.719049334526062,
0... |
func NewItemCalendarViewBookingAppointmentItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCalendarViewBookingAppointmentItemRequestBuilder) {
urlParams := make(map[string]string)
urlParams["request-raw-url"] = rawUrl
ret... | [
-1.2805225849151611,
-0.6713882684707642,
0.3123107850551605,
0.7429749369621277,
-1.0864171981811523,
0.9875738024711609,
-0.06654174625873566,
0.7904861569404602,
0.10908755660057068,
-0.9114508032798767,
1.0769320726394653,
0.04724998399615288,
-0.31958866119384766,
-0.6233249306678772,... |
func (m *ItemCalendarViewBookingAppointmentItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemCalendarViewBookingAppointmentItemRequestBuilderDeleteRequestConfiguration)(error) {
requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);
if err != nil {
return er... | [
-0.3359505832195282,
-0.20302975177764893,
0.8129759430885315,
0.3913978636264801,
-0.7411057949066162,
1.0717401504516602,
0.23648318648338318,
0.5797255039215088,
0.16005662083625793,
0.24624037742614746,
1.0285762548446655,
0.5523435473442078,
-0.4212879538536072,
-0.2138526290655136,
... |
func (m *ItemCalendarViewBookingAppointmentItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemCalendarViewBookingAppointmentItemRequestBuilderGetRequestConfiguration)(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.BookingAppointmentable, error) {
requestInfo, err := m.ToGetReq... | [
-0.9743632674217224,
-0.14075341820716858,
0.8933015465736389,
0.34856778383255005,
-0.6573432683944702,
1.0570586919784546,
0.15168923139572144,
0.6095065474510193,
-0.7763552665710449,
0.30114173889160156,
0.7382218241691589,
0.7695286273956299,
-0.3743487298488617,
-0.20085766911506653,... |
func (m *ItemCalendarViewBookingAppointmentItemRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.BookingAppointmentable, requestConfiguration *ItemCalendarViewBookingAppointmentItemRequestBuilderPatchRequestConfiguration)(ie233ee762e29b4ba6970aa2a2efce4b7f... | [
-0.7354955673217773,
-0.6673925518989563,
0.8960211277008057,
0.20355865359306335,
-1.3890444040298462,
1.4172272682189941,
0.17889605462551117,
1.0028995275497437,
0.06158291921019554,
0.6129201054573059,
0.6316031813621521,
0.5827385783195496,
0.16760076582431793,
-0.216963529586792,
1... |
func (m *ItemCalendarViewBookingAppointmentItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemCalendarViewBookingAppointmentItemRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
request... | [
-0.5192230939865112,
-0.6073734164237976,
1.031572937965393,
-0.6855382919311523,
-0.8526503443717957,
0.969473123550415,
-0.11103666573762894,
0.4104750454425812,
0.06719642877578735,
0.013920863159000874,
0.8438730239868164,
0.5486146211624146,
-0.1927914172410965,
-0.24478110671043396,
... |
func (m *ItemCalendarViewBookingAppointmentItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemCalendarViewBookingAppointmentItemRequestBuilderGetRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
requestInfo :... | [
-1.1358991861343384,
-0.4247731864452362,
0.970795214176178,
-0.41481199860572815,
-0.44545990228652954,
0.6837929487228394,
-0.22439084947109222,
0.0022089018020778894,
-0.12080507725477219,
-0.16888080537319183,
0.6382502913475037,
0.5479999780654907,
-0.386462926864624,
-0.2567089498043... |
func (m *ItemCalendarViewBookingAppointmentItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.BookingAppointmentable, requestConfiguration *ItemCalendarViewBookingAppointmentItemRequestBuilderPatchRequestConfiguration)(*i2ae4187f7dae... | [
-1.0148167610168457,
-0.789114236831665,
1.1210523843765259,
-0.3352063298225403,
-0.9594500064849854,
0.9380438327789307,
0.22577844560146332,
0.06305505335330963,
-0.5861364603042603,
0.4069543182849884,
0.9365395307540894,
0.17020539939403534,
-0.3686683773994446,
-0.5768663287162781,
... |
func (time *CueTime) SetValue(value string) {
val := strings.ToLower(strings.Replace(value, " ", "", -1))
if val != "" {
res := time.format(val)
if !res {
log.Println("Unable to format time " + value)
}
}
} | [
0.2981114983558655,
-0.1959301084280014,
0.6771219968795776,
-0.31009912490844727,
-0.08119239658117294,
-0.12604975700378418,
-0.48024025559425354,
-0.14967676997184753,
0.07627509534358978,
1.1582194566726685,
0.3743472397327423,
0.49035000801086426,
-0.6732754111289978,
1.83587884902954... |
func (time CueTime) Convert() string {
ret := ""
if time.Validate() {
if time.down != (Time{}) && time.up != (Time{}) {
ret += "Up " + time.up.Convert()
ret += "Down " + time.down.Convert()
} else if time.up != (Time{}) {
ret += "Up " + time.up.Convert()
if time.delay != (Delay{}) {
ret += time.d... | [
-1.0334913730621338,
-0.4562128484249115,
0.8638033866882324,
0.004250125493854284,
-0.2982952892780304,
0.47931918501853943,
-0.04870593547821045,
-1.0842357873916626,
0.16385802626609802,
1.3332276344299316,
0.13180656731128693,
-0.41677865386009216,
-0.5284872651100159,
1.06673049926757... |
func (time CueTime) Validate() bool {
ret := true
if ret == true && time.up != (Time{}) {
ret = time.up.Validate()
}
if ret == true && time.down != (Time{}) {
ret = time.down.Validate()
}
if ret == true && time.delay != (Delay{}) {
ret = time.delay.Validate()
}
if ret == true && time.follow != (Follow{... | [
-0.6940596103668213,
0.2614334523677826,
0.8421002626419067,
0.3625015318393707,
-0.25759077072143555,
0.7544783353805542,
0.01171819493174553,
-1.190875768661499,
-0.6153496503829956,
0.5327876806259155,
0.13847030699253082,
-0.925940752029419,
-1.6174840927124023,
1.2875666618347168,
0... |
func TestTree(t *testing.T) {
var tree RWTree
assert.Equal(t, 3, tree.GetIndex("_faster", "key", "info.json")) // 1 2 3
assert.Equal(t, 5, tree.GetIndex("http", "GET /robots.txt")) // 4 5
assert.Equal(t, 6, tree.GetIndex("http", "GET /favicon.ico")) // 4 6
assert.Equal(t, 7, tree.GetIndex("_faster", "key",... | [
-0.9838700890541077,
0.17448414862155914,
0.8222694993019104,
-0.21330004930496216,
0.1482241451740265,
0.09033509343862534,
0.17286033928394318,
-0.02985415793955326,
-0.6731179356575012,
-0.49137812852859497,
-0.661756694316864,
-0.14318715035915375,
-0.04371708631515503,
0.4580787420272... |
func (f GeneratorFunc) Generate(rng *rand.Rand) interface{} { return f(rng) } | [
-1.2768296003341675,
-0.07538947463035583,
0.27665871381759644,
0.19512833654880524,
-0.5550704002380371,
0.44546082615852356,
0.8220351338386536,
0.39745986461639404,
-0.0397200845181942,
-0.7805607914924622,
-0.48025959730148315,
-0.7098727822303772,
0.9059644937515259,
0.578676521778106... |
func GeneratePopulation(gen Generator, count int, rng *rand.Rand) []interface{} {
pop := make([]interface{}, count)
for i := 0; i < count; i++ {
pop[i] = gen.Generate(rng)
}
return pop
} | [
-1.9311378002166748,
0.6876829862594604,
0.5893751978874207,
0.4343573749065399,
0.1558561623096466,
0.4540075361728668,
0.49444815516471863,
-0.1784590631723404,
-0.13994181156158447,
0.801510751247406,
-0.906358540058136,
-0.7709766030311584,
0.3248993456363678,
0.93559330701828,
0.194... |
func SeedPopulation(gen Generator, count int, seeds []interface{}, rng *rand.Rand) ([]interface{}, error) {
if len(seeds) > count {
return nil, ErrTooManySeedCandidates
}
// directory add the generated candidates to the backing array of seeds,
// but seeds won't be modified
for i := len(seeds); i < count; i++ {... | [
-1.1859103441238403,
0.02271880954504013,
0.4613693058490753,
0.4076206386089325,
0.0078355073928833,
-0.23643386363983154,
0.6875200271606445,
0.2812899351119995,
-0.029889866709709167,
0.3358682692050934,
0.38776183128356934,
-0.49667638540267944,
-0.14699161052703857,
1.0146064758300781... |
func QuickCheckStrings(t *testing.T, pred func(string) bool) {
QuickCheckStringsN(t, 0 /*Use Default*/, pred)
} | [
0.47197580337524414,
-0.08351777493953705,
0.1823095679283142,
0.5968078374862671,
-0.07057380676269531,
-0.26743826270103455,
-0.13186027109622955,
0.0298166386783123,
0.18302398920059204,
-0.788763701915741,
0.017673898488283157,
0.199050635099411,
0.49743080139160156,
0.202114999294281,... |
func QuickCheckStringsN(t *testing.T, n int, pred func(string) bool) {
cfg := quick.Config{
MaxCount: n,
}
if err := quick.Check(pred, &cfg); err != nil {
t.Error(err)
}
} | [
0.8094955682754517,
0.25305530428886414,
0.25510361790657043,
0.3610255718231201,
-0.08344023674726486,
-0.3265663683414459,
-0.6128742098808289,
0.36826759576797485,
0.3591555058956146,
-1.0480197668075562,
-0.3361136019229889,
0.2545875608921051,
0.6328869462013245,
0.09038430452346802,
... |
func Download(link string, ch chan string) {
log.Println("Got request to download", link)
resp, err := http.Get(link)
if err != nil {
log.Println("ERROR: fetching link", link, err)
ch <- "ERROR"
return
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
log.Println("Got body for link", link)
... | [
0.43142661452293396,
-0.6905059814453125,
0.9786806702613831,
-0.11572183668613434,
0.35671567916870117,
0.01743343472480774,
-0.04349086061120033,
0.35377615690231323,
-0.39554402232170105,
-0.5874357223510742,
-0.3274257481098175,
0.279294490814209,
-0.22154490649700165,
-0.0609629154205... |
func TestMain(m *testing.M) {
// Note: The setup will provision a single K8s env and
// all the tests need to create and use a separate namespace
// setup env test
if err := setupSuite(); err != nil {
panic(err)
}
// run tests
code := m.Run()
// tear down test env
if err := tearDownSuite(); err != nil {
... | [
-0.10668344795703888,
0.050109196454286575,
0.7007741928100586,
0.6618855595588684,
0.4190930724143982,
0.8312856554985046,
0.7389315962791443,
0.15595784783363342,
0.46780988574028015,
0.4733067750930786,
0.45332664251327515,
0.2674487829208374,
-0.8878390192985535,
0.05999055132269859,
... |
func parseRangeLine(line string) *note {
parts := strings.Split(line, ": ")
bes := strings.Split(parts[1], " or ")
beginEnds := make([]*beginEnd, 0)
for _, secondPart := range bes {
vals := strings.Split(secondPart, "-")
start, err := strconv.Atoi(vals[0])
if err != nil {
panic(err)
}
end, err := str... | [
-0.2847348749637604,
-0.9921614527702332,
0.5976529121398926,
-0.3165070712566376,
-0.4320748448371887,
-0.024806678295135498,
-0.17036285996437073,
-0.15297988057136536,
-0.5348730087280273,
0.5100285410881042,
-1.024062991142273,
-0.3751527965068817,
-0.4176638722419739,
-1.0542175769805... |
func NewSorter(target KademliaID, size int) *contactSorter {
return &contactSorter{
target: target,
contacts: make([]Contact, size),
}
} | [
-0.029530305415391922,
-0.6746630072593689,
0.07987454533576965,
-0.08668449521064758,
-1.5688785314559937,
-0.4112730324268341,
-0.47255635261535645,
-1.0748584270477295,
0.1670379638671875,
-0.31976407766342163,
0.03622439503669739,
0.05748552083969116,
-0.5261412858963013,
0.42848768830... |
func (s *contactSorter) InsertContact(contactToInsert Contact) bool {
contactToInsert.CalcDistance(&s.target)
// We start by checking edge cases :
for i, c := range s.contacts {
if c.ID == nil {
// If one of the contact is empty, it means that there is room in the sorter
s.contacts[i] = contactToInsert
r... | [
-0.6958015561103821,
0.5610682368278503,
0.9111543297767639,
-0.17693816125392914,
-0.31545108556747437,
0.43912309408187866,
0.1624661386013031,
-0.46397319436073303,
-0.21969492733478546,
-0.17766229808330536,
-0.22190679609775543,
-1.2109489440917969,
-1.4004300832748413,
0.642567455768... |
func (s *contactSorter) GetContacts() []Contact {
newList := make([]Contact, 0)
for _, c := range s.contacts {
if c.ID != nil {
newList = append(newList, c)
}
}
return newList
} | [
-0.6310239434242249,
-1.1694148778915405,
0.4889823794364929,
0.8966936469078064,
0.7096226215362549,
-0.26427802443504333,
-0.2574670910835266,
-1.2371739149093628,
0.8523162603378296,
-0.5313259363174438,
-0.18882602453231812,
0.006763187237083912,
-1.0446234941482544,
1.2302273511886597... |
func (g *GenericNode) PrintXML() {
p := printer{pretty: false}
p.printStructure(g)
} | [
-0.7958405017852783,
0.40167421102523804,
0.16416843235492706,
-0.4802591800689697,
0.057173170149326324,
0.781417727470398,
-0.3089982271194458,
-0.1401112824678421,
-0.5330564975738525,
-0.5583060383796692,
0.7348588705062866,
1.3383232355117798,
-0.25984805822372437,
0.5603811144828796,... |
func (g *GenericNode) PrintXMLPretty() {
p := printer{pretty: true}
p.printStructure(g) // Not implemented yet
} | [
-0.38973599672317505,
0.07617998868227005,
0.4714414179325104,
-0.4052225649356842,
-0.022743044421076775,
-0.2556597888469696,
-0.842735767364502,
-0.4574287533760071,
-0.9611631631851196,
-0.2460201233625412,
0.16489411890506744,
1.1582947969436646,
0.12301488220691681,
0.299966245889663... |
func (p *printer) printStructure(gn *GenericNode) {
// traverse siblings
for s := gn; s != nil; s = s.next {
switch s.NodeType {
case Declaration:
// print attributes
case Element:
if p.pretty {
fmt.Println("")
}
// can have children and siblings which must be handled
fmt.Print("<" + string(s... | [
-0.5486412048339844,
-0.513443112373352,
0.7745279669761658,
-0.9804326891899109,
-0.5072709321975708,
0.6273240447044373,
0.23471954464912415,
-0.5052992701530457,
0.18454068899154663,
-0.5900644063949585,
0.23321528732776642,
0.611260712146759,
-0.09915629774332047,
0.6198486089706421,
... |
func NewTSOffset(milliseconds uint32) TSOffset {
return TSOffset{
milliseconds: milliseconds,
}
} | [
0.42653167247772217,
0.13470222055912018,
0.33052879571914673,
-0.6743170619010925,
-1.7417083978652954,
0.16649161279201508,
-0.028389252722263336,
-0.7518534660339355,
0.6407227516174316,
0.10019902884960175,
-0.5049303770065308,
0.5198541283607483,
-0.16902177035808563,
-0.2456924617290... |
func (offset TSOffset) TSVal(now tcpip.MonotonicTime) uint32 {
return uint32(now.Sub(tcpip.MonotonicTime{}).Milliseconds()) + offset.milliseconds
} | [
0.1980968862771988,
0.5431037545204163,
0.5204821228981018,
-1.6884946823120117,
-1.2814041376113892,
0.6020180583000183,
-0.7625457644462585,
-0.0679951086640358,
-0.3502749800682068,
-0.026044903323054314,
-0.33392301201820374,
0.22840264439582825,
-0.14798812568187714,
-0.34857112169265... |
func (offset TSOffset) Elapsed(now tcpip.MonotonicTime, tsEcr uint32) time.Duration {
return time.Duration(offset.TSVal(now)-tsEcr) * time.Millisecond
} | [
0.6011161804199219,
0.1222727820277214,
0.3348998427391052,
-1.1138795614242554,
-0.3215586841106415,
1.0103144645690918,
-0.5478018522262573,
0.428926557302475,
0.18272677063941956,
0.29895076155662537,
-0.1806606650352478,
0.12803903222084045,
0.9416164755821228,
-0.27867093682289124,
... |
func (c2d *C2DMatrix) M11() float64 { return c2d.matrix.m11 } | [
-0.6220319867134094,
-0.7991184592247009,
0.06377585232257843,
0.22019878029823303,
-0.09117564558982849,
1.3399358987808228,
0.28369131684303284,
-0.05940026044845581,
0.5915182828903198,
0.4528309404850006,
1.05221688747406,
1.2177094221115112,
-0.015964914113283157,
0.34549811482429504,... |
func (c2d *C2DMatrix) Identity() {
c2d.matrix.m11 = 1
c2d.matrix.m12 = 0
c2d.matrix.m13 = 0
c2d.matrix.m21 = 0
c2d.matrix.m22 = 1
c2d.matrix.m23 = 0
c2d.matrix.m31 = 0
c2d.matrix.m32 = 0
c2d.matrix.m33 = 1
} | [
-1.375793218612671,
-1.4699044227600098,
0.43426576256752014,
-0.06922144442796707,
1.0314817428588867,
1.0786328315734863,
1.5165292024612427,
0.8867245316505432,
0.5859929919242859,
-0.0714874267578125,
-0.16036151349544525,
0.04309035837650299,
-0.3849896192550659,
0.6620009541511536,
... |
func (c2d *C2DMatrix) Translate(x, y float64) {
var mat Matrix
mat.m11 = 1
mat.m12 = 0
mat.m13 = 0
mat.m21 = 0
mat.m22 = 1
mat.m23 = 0
mat.m31 = x
mat.m32 = y
mat.m33 = 1
//and multiply
c2d.MatrixMultiply(mat)
} | [
-0.540972888469696,
-0.6475445032119751,
0.45138832926750183,
-0.06892309337854385,
-0.6003340482711792,
-0.0037025390192866325,
-0.7368923425674438,
0.19963715970516205,
0.4093821048736572,
-0.4025091230869293,
-0.07462990283966064,
0.32962098717689514,
0.4800242781639099,
-0.574691593647... |
func (c2d *C2DMatrix) Scale(xScale, yScale float64) {
var mat Matrix
mat.m11 = xScale
mat.m12 = 0
mat.m13 = 0
mat.m21 = 0
mat.m22 = yScale
mat.m23 = 0
mat.m31 = 0
mat.m32 = 0
mat.m33 = 1
//and multiply
c2d.MatrixMultiply(mat)
} | [
-0.7641221284866333,
-0.9509226679801941,
0.6181009411811829,
-0.5515446066856384,
0.07549817115068436,
0.42211368680000305,
-1.1938276290893555,
-0.19432556629180908,
-0.5083035826683044,
0.4347192049026489,
0.45113468170166016,
0.04027286544442177,
0.4748922288417816,
0.46444985270500183... |
func (c2d *C2DMatrix) Rotate(rot float64) {
var mat Matrix
var Sin float64 = math.Sin(rot)
var Cos float64 = math.Cos(rot)
mat.m11 = Cos
mat.m12 = Sin
mat.m13 = 0
mat.m21 = -Sin
mat.m22 = Cos
mat.m23 = 0
mat.m31 = 0
mat.m32 = 0
mat.m33 = 1
//and multiply
c2d.MatrixMultiply(mat)
} | [
-0.8668204545974731,
-0.2073507457971573,
0.3705262839794159,
-0.233428955078125,
0.31815826892852783,
-0.30703985691070557,
0.3820059299468994,
0.005330526735633612,
0.451841801404953,
-0.9397423267364502,
0.14413577318191528,
-0.0833299309015274,
-0.5984493494033813,
-0.24669188261032104... |
func (c2d *C2DMatrix) Rotate2(fwd, side Vector2d) {
var mat Matrix
mat.m11 = fwd.X
mat.m12 = fwd.Y
mat.m13 = 0
mat.m21 = side.X
mat.m22 = side.Y
mat.m23 = 0
mat.m31 = 0
mat.m32 = 0
mat.m33 = 1
//and multiply
c2d.MatrixMultiply(mat)
} | [
-0.7860704660415649,
-0.6756617426872253,
0.5551742911338806,
-0.8712939620018005,
-0.24135200679302216,
-0.163268581032753,
-0.25992289185523987,
-0.5598433017730713,
-0.25538399815559387,
-0.8470323085784912,
0.05578242242336273,
0.33208605647087097,
0.022160863503813744,
0.0912637412548... |
func (h Hello) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// Fprint function prints to a writer object
fmt.Fprint(w, "<h1>Hello from the Go web server!!!</h1>")
} | [
0.1539323329925537,
0.08017819374799728,
0.5339261889457703,
0.6453778147697449,
0.10381477326154709,
0.6275791525840759,
0.3686915636062622,
0.4411158263683319,
-1.0706688165664673,
-0.2023089975118637,
-0.47398263216018677,
0.09340554475784302,
-0.27943888306617737,
0.09605789929628372,
... |
func (m *Metadata) ReadInt(reader io.Reader) int {
val := 0
byteLength := 8
sign := ReadExactInt(reader, 1)
buf := make([]byte, m.IntSize)
if _, err := reader.Read(buf); err != nil {
log.Fatalf("err reading int: %v", err)
}
for len(buf) > 0 {
v := buf[len(buf)-1]
buf = buf[:len(buf)-1]
val = (val << by... | [
-0.2656359374523163,
0.08280272781848907,
0.5277844071388245,
-0.6863176226615906,
-0.8429206609725952,
0.2753288745880127,
-0.6300849318504333,
-0.2860265076160431,
-0.9982914328575134,
0.5828616619110107,
0.5367973446846008,
0.3345814049243927,
-0.27687913179397583,
0.38528427481651306,
... |
func (m *Metadata) ReadString(reader io.Reader) string {
val := ""
if length := m.ReadInt(reader); length > 0 {
buf := make([]byte, length)
if _, err := reader.Read(buf); err != nil {
log.Fatalf("err reading string: %v", err)
}
val = string(buf)
}
return val
} | [
-0.3185662627220154,
0.1282123625278473,
0.2523973286151886,
-0.7309719920158386,
-0.346248596906662,
0.2579135000705719,
-0.30057239532470703,
-0.8560992479324341,
-0.6280544996261597,
0.49684494733810425,
1.4153655767440796,
0.20755302906036377,
0.07230006158351898,
-0.49678683280944824,... |
func (m *Metadata) ToJSON() ([]byte, error) {
json, err := json.Marshal(m)
if err != nil {
err = fmt.Errorf("err dumping JSON: %w", err)
return []byte{}, err
}
return json, nil
} | [
-0.6055918335914612,
-0.08946873247623444,
0.6934385895729065,
0.1313893347978592,
0.18155956268310547,
0.06377805769443512,
-0.012349629774689674,
0.08979833871126175,
0.09046611189842224,
1.2512459754943848,
-0.597484290599823,
1.1641706228256226,
-0.793590784072876,
0.22145065665245056,... |
func NewMetadata(reader io.Reader) (Metadata, error) {
formats := []string{"UNKNOWN", "CUSTOM", "FILE", "TAR", "NULL", "DIRECTORY"}
yearStart := 1900
metadata := Metadata{}
r := bufio.NewReader(reader)
magicBytes := 5
magicString, err := ReadExactString(r, magicBytes)
if err != nil {
return metadata, fmt.Err... | [
-0.31163471937179565,
-0.6803856492042542,
0.7381306886672974,
-0.7685359716415405,
-0.6411562561988831,
0.11502116918563843,
-0.48388803005218506,
-0.3111337423324585,
-0.0008445219718851149,
0.6184733510017395,
0.33705586194992065,
0.5071749687194824,
0.22920474410057068,
0.1014182642102... |
func ReadExactString(reader io.Reader, numBytes int) (string, error) {
buf := make([]byte, numBytes)
n, err := reader.Read(buf)
if err != nil {
return "", fmt.Errorf("err reading exact string: %w", err)
}
return string(buf[0:n]), nil
} | [
0.3532719910144806,
0.11243871599435806,
0.2984994053840637,
-1.0655094385147095,
-0.9026204347610474,
0.6869030594825745,
0.14580565690994263,
-0.5606245398521423,
-0.19556736946105957,
1.1525647640228271,
0.7522826790809631,
0.3059368133544922,
-0.10740134865045547,
-0.21893440186977386,... |
func ReadExactInt(reader io.Reader, numBytes int) uint8 {
buf := make([]byte, numBytes)
n, err := reader.Read(buf)
if err != nil {
log.Fatalf("err reading exact int: %v", err)
}
return buf[0:n][0]
} | [
0.3341081142425537,
0.044585321098566055,
0.35988467931747437,
-1.3779593706130981,
-0.5345779657363892,
0.5404411554336548,
-0.33824989199638367,
-0.048730362206697464,
-0.3994417190551758,
0.9367091059684753,
0.49335724115371704,
0.023157428950071335,
-0.6067548394203186,
-0.109367243945... |
func GetUserFromToken(ctx context.Context, config *oauth2.Config, tok *oauth2.Token) (*User, error) {
u := new(User)
client := config.Client(ctx, tok)
srv, err := api.New(client)
if err != nil {
return nil, err
}
info, err := srv.Tokeninfo().AccessToken(tok.AccessToken).Do()
if err != nil {
return nil, err
... | [
0.5257604718208313,
-0.26077499985694885,
0.21213725209236145,
0.09939561784267426,
-0.1798444390296936,
-0.012206225655972958,
-0.849596381187439,
-0.6286576986312866,
-0.3396969437599182,
-0.6525697112083435,
-0.4350440502166748,
1.2959762811660767,
0.2775411605834961,
-0.728623509407043... |
func (DefaultCounter) Actions(int, int, int) {
} | [
-0.33102527260780334,
-0.3637324869632721,
0.34880557656288147,
0.39188867807388306,
1.0512025356292725,
-0.24938051402568817,
1.56132173538208,
-0.4816800355911255,
0.41398075222969055,
-0.5429638624191284,
-0.5122360587120056,
-0.308331161737442,
-0.3695993423461914,
-0.2283158302307129,... |
func (DefaultCounter) SendTotal(int) {
} | [
-0.5485541820526123,
0.008699323982000351,
0.47323811054229736,
-0.2044219970703125,
0.37403208017349243,
-0.5184168815612793,
1.0343029499053955,
-0.7459673881530762,
0.1531846970319748,
0.36155903339385986,
-1.5622241497039795,
-0.3526707887649536,
-0.6377834677696228,
-0.158864051103591... |
func (DefaultCounter) Trouble() {
} | [
0.5686579942703247,
-0.1644475907087326,
0.28663527965545654,
0.6951141357421875,
0.8974177837371826,
0.27772286534309387,
1.2329031229019165,
-0.23751692473888397,
0.20951972901821136,
-1.2968043088912964,
-1.1137322187423706,
-0.1719709187746048,
-0.722886860370636,
1.2151492834091187,
... |
func (DefaultCounter) BatchTime(time.Duration) {
} | [
0.7011165618896484,
-0.041102707386016846,
0.24783369898796082,
1.0465352535247803,
0.38943609595298767,
0.1029420867562294,
-0.5428138971328735,
0.4858996570110321,
-0.6534245610237122,
0.11279305070638657,
-1.2992147207260132,
-0.10419514775276184,
-0.03405658155679703,
1.362716674804687... |
func targetTag() (port int, err error) {
port, err = loadPort(dataDir)
if err == nil {
return port, nil
}
err = nil
_ = filepath.Walk(filepath.Dir(dataDir), func(path string, info os.FileInfo, err error) error {
if port != 0 {
return filepath.SkipDir
}
// ignore error
if err != nil {
return nil
... | [
-0.24525834619998932,
-0.11088800430297852,
0.8496730327606201,
-0.34066635370254517,
0.7404500246047974,
-0.09464288502931595,
1.5547266006469727,
-0.24368295073509216,
-0.7445200085639954,
0.1894681453704834,
0.02811063453555107,
-0.21991653740406036,
-0.038965050131082535,
0.39910814166... |
func (fn ResourceInfoHandlerFunc) Handle(params ResourceInfoParams) middleware.Responder {
return fn(params)
} | [
0.16212022304534912,
-0.8065513968467712,
0.25626426935195923,
-0.08771657198667526,
0.2302561104297638,
0.6672133803367615,
0.2834798991680145,
-0.00969135295599699,
-0.39072084426879883,
-1.182844638824463,
0.45968809723854065,
-0.9873166680335999,
-0.24022196233272552,
-0.21083049476146... |
func NewResourceInfo(ctx *middleware.Context, handler ResourceInfoHandler) *ResourceInfo {
return &ResourceInfo{Context: ctx, Handler: handler}
} | [
0.623374342918396,
-1.1507738828659058,
-0.08021026849746704,
-0.5460128784179688,
-0.7317574620246887,
0.6831473708152771,
-0.32200419902801514,
-0.0722440853714943,
-0.26852187514305115,
-0.04301853105425835,
-0.9880234599113464,
-0.01345089077949524,
0.3636101186275482,
0.55268633365631... |
func (o *ResourceInfoNotFoundBody) Validate(formats strfmt.Registry) error {
return nil
} | [
0.3177551329135895,
-0.16304856538772583,
-0.12793321907520294,
-0.7379933595657349,
1.1276847124099731,
0.8293445706367493,
0.4626932740211487,
-0.4770340621471405,
-0.575415849685669,
-0.641871988773346,
-0.060864053666591644,
-0.5649726986885071,
-1.2666330337524414,
1.5624455213546753,... |
func (o *ResourceInfoOKBody) Validate(formats strfmt.Registry) error {
var res []error
if err := o.validateResults(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
} | [
0.16297109425067902,
-0.13834461569786072,
0.029723474755883217,
-0.7615881562232971,
0.32889828085899353,
-0.2638685405254364,
0.27439606189727783,
-0.8234923481941223,
-0.5483684539794922,
0.6937012076377869,
0.49331751465797424,
-1.1465673446655273,
-0.9971714615821838,
0.90219408273696... |
func parent(i int) int {
return (i - 1) / 2
} | [
-0.4540797770023346,
0.46717867255210876,
0.5580666661262512,
0.11115814745426178,
-1.3174065351486206,
-0.26009002327919006,
1.8819130659103394,
-1.1231790781021118,
-0.415458619594574,
-0.07342638075351715,
-0.19342827796936035,
-0.7968267798423767,
0.08634424954652786,
0.097421728074550... |
func ToBytes(bits []bool) []byte {
bs := make([]byte, (len(bits)+7)/8)
for i := 0; i < len(bits); i++ {
if bits[i] {
bs[i/8] |= (1 << 7) >> uint(i%8)
}
}
return bs
} | [
-0.4496470093727112,
0.7966110706329346,
0.7789934873580933,
0.20218618214130402,
0.1625959277153015,
0.0010200981050729752,
-0.2749522924423218,
-0.842825174331665,
0.49286359548568726,
0.9447030425071716,
-0.5688026547431946,
0.39739397168159485,
-0.7365455627441406,
0.5611037611961365,
... |
func ToBits(bs []byte) []bool {
bits := make([]bool, len(bs)*8)
for i := 0; i < len(bits); i++ {
bits[i] = (bs[i/8]<<uint(i%8))&(1<<7) > 0
}
return bits
} | [
-0.6066754460334778,
-0.07623948156833649,
0.9212459921836853,
0.2984318137168884,
0.3588624596595764,
0.5153769850730896,
0.25485584139823914,
-0.12152869254350662,
1.2615480422973633,
1.1873563528060913,
-1.0981364250183105,
0.7595937252044678,
-0.7130383849143982,
0.046293266117572784,
... |
func WithDB(f func(kv.DB)) {
dir, err := ioutil.TempDir("", "merkletree")
if err != nil {
panic(err)
}
defer os.RemoveAll(dir)
db, err := leveldb.OpenFile(dir, nil)
if err != nil {
panic(err)
}
defer db.Close()
f(leveldbkv.Wrap(db))
} | [
-0.05143684893846512,
0.04590539634227753,
0.9891199469566345,
0.44097480177879333,
-0.1503623127937317,
0.7989397644996643,
0.6801083087921143,
0.1524902880191803,
-0.736219048500061,
0.6558408141136169,
0.9960312247276306,
0.10067146271467209,
0.29001903533935547,
0.5875762104988098,
-... |
func (r *reader) GetDNSOverTLS() (DNSOverTLS bool, err error) { //nolint:gocritic
return r.envParams.GetOnOff("DOT", libparams.Default("on"))
} | [
-0.872160792350769,
1.3104134798049927,
0.5547738075256348,
-0.6213714480400085,
-0.9896778464317322,
0.11235256493091583,
-0.37445777654647827,
-0.9017003774642944,
0.2512250244617462,
0.3584247827529907,
-0.7382364273071289,
-0.2970679700374603,
-0.7590056657791138,
-0.2390596717596054,
... |
func (r *reader) GetDNSOverTLSProviders() (providers []models.DNSProvider, err error) {
s, err := r.envParams.GetEnv("DOT_PROVIDERS", libparams.Default("cloudflare"))
if err != nil {
return nil, err
}
for _, word := range strings.Split(s, ",") {
provider := models.DNSProvider(word)
switch provider {
case co... | [
-1.1613247394561768,
0.6080019474029541,
0.19957664608955383,
-0.46097251772880554,
-0.3954261243343353,
0.23193810880184174,
-0.5890403985977173,
-0.8208633065223694,
0.45079511404037476,
0.7164483070373535,
-0.6795793175697327,
0.26132136583328247,
-0.4214898645877838,
-0.149072140455245... |
func (r *reader) GetDNSOverTLSVerbosity() (verbosityLevel uint8, err error) {
n, err := r.envParams.GetEnvIntRange("DOT_VERBOSITY", 0, 5, libparams.Default("1"))
return uint8(n), err
} | [
-0.5863844752311707,
0.9312236905097961,
0.4920283555984497,
-0.40035298466682434,
-0.3971518278121948,
-0.022336289286613464,
0.322333425283432,
-1.34932541847229,
-0.03161590173840523,
-0.16283796727657318,
-0.4868798851966858,
0.3581588864326477,
0.11378724128007889,
0.18338742852210999... |
func (r *reader) GetDNSOverTLSVerbosityDetails() (verbosityDetailsLevel uint8, err error) {
n, err := r.envParams.GetEnvIntRange("DOT_VERBOSITY_DETAILS", 0, 4, libparams.Default("0"))
return uint8(n), err
} | [
-0.03977478668093681,
0.7843198776245117,
0.40286070108413696,
-0.6928349733352661,
-0.046969808638095856,
0.2661483883857727,
-0.005416076630353928,
-1.3935632705688477,
0.17317534983158112,
-0.49007001519203186,
-0.5347058176994324,
0.47577211260795593,
0.12886491417884827,
0.16441273689... |
func (r *reader) GetDNSOverTLSValidationLogLevel() (validationLogLevel uint8, err error) {
n, err := r.envParams.GetEnvIntRange("DOT_VALIDATION_LOGLEVEL", 0, 2, libparams.Default("0"))
return uint8(n), err
} | [
-0.9371423721313477,
0.6050466299057007,
0.5399029850959778,
-0.5302817225456238,
-1.2052747011184692,
0.6918957233428955,
0.07438131421804428,
-1.207764744758606,
-0.11355124413967133,
-0.049030739814043045,
-0.7399982810020447,
0.18340016901493073,
0.49870985746383667,
-0.240757390856742... |
func (r *reader) GetDNSMaliciousBlocking() (blocking bool, err error) {
return r.envParams.GetOnOff("BLOCK_MALICIOUS", libparams.Default("on"))
} | [
-0.4484719932079315,
1.2587300539016724,
0.4555906057357788,
0.4708004593849182,
-0.9657309651374817,
0.02704993635416031,
-1.2067111730575562,
-0.05481803044676781,
-0.4765009880065918,
0.1740877479314804,
-0.47232988476753235,
0.1460360884666443,
-0.5048224925994873,
-0.10100977122783661... |
func (r *reader) GetDNSSurveillanceBlocking() (blocking bool, err error) {
// Retro-compatibility
s, err := r.envParams.GetEnv("BLOCK_NSA")
if err != nil {
return false, err
} else if len(s) != 0 {
r.logger.Warn("You are using the old environment variable BLOCK_NSA, please consider changing it to BLOCK_SURVEILL... | [
-0.09374798089265823,
1.4313396215438843,
0.8172982931137085,
0.4252103269100189,
-0.34105855226516724,
-0.10127314925193787,
-0.19042424857616425,
-0.5407751202583313,
0.25639083981513977,
0.24828176200389862,
-0.5024915337562561,
0.24810218811035156,
-0.2993127405643463,
0.50990176200866... |
func (r *reader) GetDNSAdsBlocking() (blocking bool, err error) {
return r.envParams.GetOnOff("BLOCK_ADS", libparams.Default("off"))
} | [
-0.8045498132705688,
1.7545380592346191,
0.4906236529350281,
-0.20126572251319885,
-0.9064452648162842,
0.4621678292751312,
-0.40458428859710693,
-0.747969925403595,
-0.37157878279685974,
0.524623453617096,
-0.22199112176895142,
0.6290302276611328,
-0.6136791110038757,
0.45440682768821716,... |
func (r *reader) GetDNSUnblockedHostnames() (hostnames []string, err error) {
s, err := r.envParams.GetEnv("UNBLOCK")
if err != nil {
return nil, err
} else if len(s) == 0 {
return nil, nil
}
hostnames = strings.Split(s, ",")
for _, hostname := range hostnames {
if !r.verifier.MatchHostname(hostname) {
r... | [
-0.7966250777244568,
1.0662035942077637,
0.7866430282592773,
0.756923258304596,
-0.14139586687088013,
0.025473134592175484,
-0.2732987701892853,
0.36044842004776,
-0.1714714616537094,
-0.21435827016830444,
-0.7679691314697266,
0.21401256322860718,
-0.9138378500938416,
-0.08476313948631287,... |
func (r *reader) GetDNSOverTLSCaching() (caching bool, err error) {
return r.envParams.GetOnOff("DOT_CACHING")
} | [
-1.1682833433151245,
1.4123588800430298,
0.5453234314918518,
-0.537088930606842,
-1.1902803182601929,
0.5390021800994873,
-0.16331829130649567,
-0.46090754866600037,
0.14597143232822418,
0.2949973940849304,
-0.5654359459877014,
-0.5193544626235962,
-0.09940246492624283,
-0.0056956978514790... |
func (r *reader) GetDNSOverTLSPrivateAddresses() (privateAddresses []string, err error) {
s, err := r.envParams.GetEnv("DOT_PRIVATE_ADDRESS")
if err != nil {
return nil, err
} else if len(s) == 0 {
return nil, nil
}
privateAddresses = strings.Split(s, ",")
for _, address := range privateAddresses {
ip := ne... | [
-1.4365874528884888,
0.24507971107959747,
0.6301443576812744,
-0.30470675230026245,
-0.13287103176116943,
-0.6046234369277954,
-0.28541484475135803,
-0.4454765021800995,
0.8158251643180847,
0.04739341884851456,
-0.29277947545051575,
-0.009724116884171963,
-0.6967796683311462,
-0.3681976199... |
func (r *reader) GetDNSOverTLSIPv6() (ipv6 bool, err error) {
return r.envParams.GetOnOff("DOT_IPV6", libparams.Default("off"))
} | [
-1.2745078802108765,
0.6070497632026672,
0.637780487537384,
-0.49111995100975037,
-0.7908283472061157,
0.22614260017871857,
-0.033901724964380264,
-0.36267590522766113,
0.5777794718742371,
0.5734003782272339,
-0.9526918530464172,
-0.44661325216293335,
0.4611337184906006,
-0.705510497093200... |
func (r *reader) GetDNSUpdatePeriod() (period time.Duration, err error) {
s, err := r.envParams.GetEnv("DNS_UPDATE_PERIOD", libparams.Default("24h"))
if err != nil {
return period, err
}
return time.ParseDuration(s)
} | [
-0.529931366443634,
0.6064637899398804,
0.45086339116096497,
-0.019496750086545944,
-0.6291599273681641,
0.5469489693641663,
-0.5095269680023193,
-0.38590484857559204,
0.6244341135025024,
0.554855465888977,
0.05161799490451813,
0.4741517901420593,
-0.5353108644485474,
-0.2108147293329239,
... |
func (r *reader) GetDNSPlaintext() (ip net.IP, err error) {
s, err := r.envParams.GetEnv("DNS_PLAINTEXT_ADDRESS", libparams.Default("1.1.1.1"))
if err != nil {
return nil, err
}
ip = net.ParseIP(s)
if ip == nil {
return nil, fmt.Errorf("DNS plaintext address %q is not a valid IP address", s)
}
return ip, nil... | [
-0.7156833410263062,
0.6415404081344604,
0.6825897097587585,
0.10804568231105804,
-1.346160650253296,
0.04325588792562485,
-0.1310296505689621,
0.12067228555679321,
0.984897792339325,
-0.08889161795377731,
0.028401006013154984,
-0.36612388491630554,
-0.7581527829170227,
-0.9904934763908386... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.