text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (o *ListIssueGroupOfProjectVersionParams) WithFilter(filter *string) *ListIssueGroupOfProjectVersionParams {
o.SetFilter(filter)
return o
} | [
-0.23340559005737305,
-0.056904204189777374,
-0.005907378159463406,
0.005456442479044199,
-1.1465318202972412,
0.15202230215072632,
-0.2065361589193344,
-0.618299663066864,
-0.23328621685504913,
0.4279802441596985,
0.2636188864707947,
-0.13218465447425842,
0.20355400443077087,
0.2827890515... |
func (o *ListIssueGroupOfProjectVersionParams) SetFilter(filter *string) {
o.Filter = filter
} | [
-0.509499728679657,
0.13058574497699738,
-0.10441326349973679,
0.19200125336647034,
-0.8379568457603455,
0.4425557553768158,
-0.1203615739941597,
-0.09012708067893982,
-0.5998305678367615,
0.006171112880110741,
-0.10166416317224503,
0.016448182985186577,
-0.4387162923812866,
0.792312979698... |
func (o *ListIssueGroupOfProjectVersionParams) WithFilterset(filterset *string) *ListIssueGroupOfProjectVersionParams {
o.SetFilterset(filterset)
return o
} | [
-0.0028421878814697266,
-0.3310799300670624,
0.09678089618682861,
-0.5611472129821777,
-1.265077829360962,
-0.3937968611717224,
0.1792035847902298,
-1.1401077508926392,
0.14691279828548431,
0.38168904185295105,
0.5147542357444763,
0.01468022633343935,
0.0008790493593551219,
-0.210053920745... |
func (o *ListIssueGroupOfProjectVersionParams) SetFilterset(filterset *string) {
o.Filterset = filterset
} | [
-0.41818952560424805,
-0.2407955676317215,
-0.04939625784754753,
-0.5512626767158508,
-0.7777528166770935,
-0.26021936535835266,
0.22942502796649933,
-0.8414562344551086,
-0.32833075523376465,
0.1169641762971878,
0.4057573080062866,
0.2912038564682007,
-0.42346909642219543,
0.3275891542434... |
func (o *ListIssueGroupOfProjectVersionParams) WithGroupingtype(groupingtype *string) *ListIssueGroupOfProjectVersionParams {
o.SetGroupingtype(groupingtype)
return o
} | [
-0.1466931402683258,
0.034522999078035355,
0.10663742572069168,
0.5267131924629211,
-0.4879768490791321,
-0.005348360165953636,
0.1934291273355484,
-0.6305025219917297,
0.3190425634384155,
0.5948273539543152,
0.3250880539417267,
-0.8266116380691528,
-0.19822944700717926,
0.7158156037330627... |
func (o *ListIssueGroupOfProjectVersionParams) SetGroupingtype(groupingtype *string) {
o.Groupingtype = groupingtype
} | [
-0.6575893759727478,
0.22914087772369385,
0.05591394007205963,
0.5987020134925842,
-0.3132881224155426,
0.16303469240665436,
0.5359740257263184,
-0.24970373511314392,
0.13526475429534912,
0.5827723145484924,
0.016837548464536667,
-0.6508749723434448,
-0.8795853853225708,
0.8193944692611694... |
func (o *ListIssueGroupOfProjectVersionParams) WithLimit(limit *int32) *ListIssueGroupOfProjectVersionParams {
o.SetLimit(limit)
return o
} | [
-0.09672748297452927,
0.06681713461875916,
0.22189399600028992,
-0.37692973017692566,
-0.5691443085670471,
0.2246597856283188,
0.03250754997134209,
-0.5878986716270447,
0.029476061463356018,
0.5882871150970459,
0.4269901216030121,
-0.3412606418132782,
-0.09627567231655121,
-0.6622942686080... |
func (o *ListIssueGroupOfProjectVersionParams) SetLimit(limit *int32) {
o.Limit = limit
} | [
-0.20720429718494415,
0.2628897428512573,
0.16073939204216003,
-0.3781023621559143,
-0.3520946204662323,
0.6284782886505127,
0.0780630111694336,
-0.25777995586395264,
-0.3723626732826233,
0.25131553411483765,
0.38814371824264526,
-0.1871345192193985,
-0.8328384757041931,
-0.204934135079383... |
func (o *ListIssueGroupOfProjectVersionParams) WithParentID(parentID int64) *ListIssueGroupOfProjectVersionParams {
o.SetParentID(parentID)
return o
} | [
0.8031610250473022,
-0.5608978867530823,
0.005037364084273577,
-0.09761552512645721,
-0.9220159649848938,
0.3363848030567169,
0.2815055847167969,
-0.9336678385734558,
0.514853835105896,
0.805051863193512,
0.5743827223777771,
-0.5113667249679565,
-0.3524141311645508,
0.33184337615966797,
... |
func (o *ListIssueGroupOfProjectVersionParams) SetParentID(parentID int64) {
o.ParentID = parentID
} | [
0.47988221049308777,
-0.16841387748718262,
0.012990441173315048,
-0.03458421677350998,
-0.7791059017181396,
0.5190792679786682,
0.3992895781993866,
-0.7215900421142578,
0.27494099736213684,
0.5450345873832703,
0.5541168451309204,
-0.4267650842666626,
-1.1317565441131592,
0.6587134003639221... |
func (o *ListIssueGroupOfProjectVersionParams) WithQ(q *string) *ListIssueGroupOfProjectVersionParams {
o.SetQ(q)
return o
} | [
-0.9012548923492432,
-0.2498784065246582,
0.022083772346377373,
0.09000132232904434,
-0.7710632681846619,
-0.07104373723268509,
-0.6483548283576965,
-0.5241195559501648,
0.4334108233451843,
0.2621193826198578,
-0.2007821500301361,
-0.3811666667461395,
0.14078079164028168,
0.089373432099819... |
func (o *ListIssueGroupOfProjectVersionParams) SetQ(q *string) {
o.Q = q
} | [
-0.8249986171722412,
0.25585123896598816,
-0.15118761360645294,
0.33092862367630005,
-0.6228910088539124,
0.2844175696372986,
-0.664130687713623,
-0.2979203760623932,
0.15052825212478638,
0.009557380340993404,
-0.33283907175064087,
-0.32113882899284363,
-0.22241249680519104,
0.526308655738... |
func (o *ListIssueGroupOfProjectVersionParams) WithQm(qm *string) *ListIssueGroupOfProjectVersionParams {
o.SetQm(qm)
return o
} | [
-0.15450572967529297,
-0.34420692920684814,
-0.0164107084274292,
-0.15991127490997314,
-0.7337618470191956,
0.152169868350029,
0.004127856343984604,
-0.9448883533477783,
0.6523078680038452,
-0.11442258208990097,
0.3103426396846771,
-0.820345938205719,
0.15252697467803955,
-0.27184790372848... |
func (o *ListIssueGroupOfProjectVersionParams) SetQm(qm *string) {
o.Qm = qm
} | [
-0.3323401212692261,
-0.21323321759700775,
-0.09969016164541245,
0.02843472920358181,
-0.3105281591415405,
0.5953116416931152,
-0.1280204802751541,
-0.6955390572547913,
0.42575520277023315,
-0.4343181550502777,
0.24008025228977203,
-0.3546900749206543,
-0.2890155017375946,
0.23599192500114... |
func (o *ListIssueGroupOfProjectVersionParams) WithShowhidden(showhidden *bool) *ListIssueGroupOfProjectVersionParams {
o.SetShowhidden(showhidden)
return o
} | [
0.7052716016769409,
0.10721383988857269,
0.26334676146507263,
-0.5150682330131531,
-1.0679113864898682,
0.2487623244524002,
0.19414450228214264,
-0.2979602813720703,
0.6002894043922424,
0.08455614000558853,
-0.8796230554580688,
0.17111296951770782,
0.5641038417816162,
0.25830793380737305,
... |
func (o *ListIssueGroupOfProjectVersionParams) SetShowhidden(showhidden *bool) {
o.Showhidden = showhidden
} | [
0.4917481243610382,
0.2726745009422302,
0.19137968122959137,
-0.17260700464248657,
-1.078279972076416,
0.38042962551116943,
0.5962389707565308,
-0.313426673412323,
0.07499818503856659,
-0.05590381473302841,
-0.8455324769020081,
0.2919548749923706,
0.0220185499638319,
0.7090747356414795,
... |
func (o *ListIssueGroupOfProjectVersionParams) WithShowremoved(showremoved *bool) *ListIssueGroupOfProjectVersionParams {
o.SetShowremoved(showremoved)
return o
} | [
0.5243333578109741,
0.14173653721809387,
0.34735190868377686,
-0.5627459287643433,
-1.2885866165161133,
0.02123217284679413,
0.05576693266630173,
0.3080589771270752,
0.9613866209983826,
0.22867432236671448,
-0.5094221234321594,
0.07059546560049057,
0.400933176279068,
-0.09153632819652557,
... |
func (o *ListIssueGroupOfProjectVersionParams) SetShowremoved(showremoved *bool) {
o.Showremoved = showremoved
} | [
0.6225425601005554,
-0.2514546811580658,
0.14282089471817017,
-0.5029580593109131,
-1.1726317405700684,
0.7672099471092224,
0.15528371930122375,
0.3794427514076233,
0.30833229422569275,
-0.3935355246067047,
-0.9524285197257996,
0.05134665220975876,
-0.024981381371617317,
0.9323182106018066... |
func (o *ListIssueGroupOfProjectVersionParams) WithShowshortfilenames(showshortfilenames *bool) *ListIssueGroupOfProjectVersionParams {
o.SetShowshortfilenames(showshortfilenames)
return o
} | [
0.8958504796028137,
-0.1479560136795044,
0.27623647451400757,
-0.24244238436222076,
-1.585473895072937,
-0.3256564140319824,
0.272331178188324,
-0.2548190951347351,
0.5652754306793213,
-0.07527455687522888,
-0.06943762302398682,
0.3088190257549286,
0.7618494033813477,
0.33220115303993225,
... |
func (o *ListIssueGroupOfProjectVersionParams) SetShowshortfilenames(showshortfilenames *bool) {
o.Showshortfilenames = showshortfilenames
} | [
0.6733754873275757,
-0.1745244711637497,
0.20407411456108093,
-0.40265601873397827,
-1.303939938545227,
-0.08983590453863144,
0.5384311676025391,
-0.25439465045928955,
0.40986236929893494,
-0.2599184215068817,
-0.7824704051017761,
0.6447116732597351,
0.6326617002487183,
0.5401250123977661,... |
func (o *ListIssueGroupOfProjectVersionParams) WithShowsuppressed(showsuppressed *bool) *ListIssueGroupOfProjectVersionParams {
o.SetShowsuppressed(showsuppressed)
return o
} | [
-0.2308027744293213,
0.4343598484992981,
0.1794538050889969,
0.024184124544262886,
-1.9065021276474,
-0.18753682076931,
-0.06875424832105637,
0.28136223554611206,
0.4671066999435425,
0.09009873121976852,
-0.8416175246238708,
-0.30860084295272827,
0.47811684012413025,
0.06891579926013947,
... |
func (o *ListIssueGroupOfProjectVersionParams) SetShowsuppressed(showsuppressed *bool) {
o.Showsuppressed = showsuppressed
} | [
0.10001758486032486,
0.731212317943573,
0.09210798889398575,
0.09243889153003693,
-1.847433090209961,
0.3246804177761078,
0.4378426671028137,
0.3217398226261139,
-0.12938708066940308,
-0.062156762927770615,
-1.1332886219024658,
-0.32089996337890625,
-0.04455181583762169,
0.2829594612121582... |
func (o *ListIssueGroupOfProjectVersionParams) WithStart(start *int32) *ListIssueGroupOfProjectVersionParams {
o.SetStart(start)
return o
} | [
-0.11414836347103119,
-0.21411584317684174,
0.03273186460137367,
-0.3913207948207855,
-0.4914247393608093,
-0.06433947384357452,
0.12008701264858246,
-0.5518758296966553,
-0.04015873000025749,
0.4739226698875427,
-0.06121375784277916,
-0.14496292173862457,
-0.06274508684873581,
-0.33086270... |
func (o *ListIssueGroupOfProjectVersionParams) SetStart(start *int32) {
o.Start = start
} | [
-0.33799731731414795,
-0.08265555649995804,
-0.04133773595094681,
-0.09144720435142517,
-0.3527223765850067,
0.23653322458267212,
0.18768444657325745,
-0.14026136696338654,
-0.5004425048828125,
0.5118591785430908,
-0.4387167692184448,
0.13114416599273682,
-0.8059356212615967,
0.12407799810... |
func (o *ListIssueGroupOfProjectVersionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.Fields != nil {
// query param fields
var qrFields string
if o.Fields != nil {
qrFields = *o.Fields
}
... | [
-1.0493967533111572,
-0.031086266040802002,
0.7820153832435608,
-1.1787186861038208,
0.002933449111878872,
-0.4531831443309784,
0.7678173780441284,
-0.5818442702293396,
-0.18667259812355042,
0.5189092755317688,
0.027451815083622932,
0.31810757517814636,
-0.10141395777463913,
0.329230844974... |
func ParseEndpoint(ep string) (string, string, error) {
if strings.HasPrefix(strings.ToLower(ep), "unix://") {
s := strings.SplitN(ep, "://", 2)
if s[1] != "" {
return s[0], s[1], nil
}
}
return "", "", fmt.Errorf("invalid endpoint: %v", ep)
} | [
-0.4577580392360687,
-0.45026838779449463,
0.9114625453948975,
-0.03716403618454933,
-0.2594011127948761,
0.0900379940867424,
-0.2694486677646637,
0.6300265192985535,
-0.21019034087657928,
0.5701170563697815,
-0.1068577691912651,
-0.17869454622268677,
-0.37213465571403503,
-0.1847799867391... |
func UnaryServerInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
var err error
start := time.Now()
reporter, err := metrics.NewStatsReporter()
if err != nil {
return nil, fmt.Errorf("failed to create stats reporter: %w", err)
}
defe... | [
-0.7198625206947327,
0.19316306710243225,
0.9117470979690552,
-1.0433950424194336,
-0.09192591160535812,
0.38953208923339844,
0.8861314654350281,
-0.07886070013046265,
-0.024693651124835014,
-0.05263028293848038,
0.30541470646858215,
-0.37206125259399414,
-0.5350830554962158,
0.29868227243... |
func (m *MongoDB) Init() (err error) {
if m.client, err = m.connect(); err != nil {
fmt.Printf("[ERROR]: Can't connect to the host: [%s]. [Err Detail: %s]\n ", m.Host, err)
}
return
} | [
0.024695469066500664,
-0.08196529000997543,
0.612951397895813,
-0.2303621768951416,
0.11183284223079681,
1.0325729846954346,
-0.46437427401542664,
0.7077537178993225,
-1.2216805219650269,
0.1995670646429062,
0.3846021294593811,
1.0918200016021729,
-1.232742428779602,
0.28471916913986206,
... |
func (m *MongoDB) Done() (err error) {
if err = m.client.Disconnect(context.TODO()); err != nil {
fmt.Printf("[ERROR]: No connection to close. [Err Detail: %s]\n", err)
}
return
} | [
-0.18348239362239838,
0.6880368590354919,
0.6876655220985413,
-0.037482015788555145,
0.8878620266914368,
0.27390095591545105,
-0.3866666257381439,
-0.3348259925842285,
-0.6273980736732483,
0.6348974704742432,
-0.07435955107212067,
0.5449934005737305,
-0.9004047513008118,
0.4706890285015106... |
func (m *MongoDB) connect() (mongo.Client, error) {
uri := fmt.Sprintf("mongodb://%s:%s@%s:%v", m.User, m.Password, m.Host, m.Port)
clientOptions := options.Client().ApplyURI(uri)
// Connect to MongoDB
client, err := mongo.Connect(context.Background(), clientOptions)
if err != nil {
fmt.Printf("failed to con... | [
0.001404304406605661,
-0.3710331618785858,
0.5305456519126892,
0.3526182472705841,
-0.0676344633102417,
0.843045175075531,
-0.6099259853363037,
-0.6675474643707275,
-0.4181976914405823,
0.32644614577293396,
0.7975759506225586,
0.6907240748405457,
-1.5027934312820435,
-0.5331220626831055,
... |
func (m *MongoDB) Ping(connectOnFailure bool) (err error) {
if err = m.client.Ping(context.TODO(), nil); err != nil {
if connectOnFailure {
err = m.Init()
}
}
return
} | [
-0.08366364985704422,
-0.14495587348937988,
0.34935829043388367,
1.031734824180603,
0.9205853343009949,
0.6298317909240723,
-0.3033902049064636,
0.6222587823867798,
0.0356379896402359,
0.7500202655792236,
0.5886969566345215,
-0.4683738648891449,
-1.3627114295959473,
0.23941637575626373,
... |
func (m *MongoDB) Find(collection string, query interface{}, limit int64) (result []bson.M, err error) {
if err = m.Ping(true); err != nil {
return
}
options := options.Find()
options.SetLimit(limit)
col := m.client.Database(m.Database).Collection(collection)
ctx, cancel := context.WithTimeout(context.Backgro... | [
-0.3609192967414856,
0.7878806591033936,
0.6253957748413086,
0.548980176448822,
0.7768913507461548,
0.2617672383785248,
-0.5884823203086853,
-1.0081861019134521,
-0.46581682562828064,
1.0574007034301758,
0.25966334342956543,
0.23662139475345612,
-1.1358189582824707,
0.23722675442695618,
... |
func (m *MongoDB) FindAndConvert(collection string, query interface{}, sort interface{}, limit int64) (cur *mongo.Cursor, err error) {
if err = m.Ping(true); err != nil {
return
}
options := options.Find()
options.SetLimit(limit)
options.SetSort(sort)
col := m.client.Database(m.Database).Collection(collection... | [
-0.4936832785606384,
0.006194606423377991,
0.995459258556366,
-0.15620338916778564,
0.3720599114894867,
0.037728201597929,
-0.26365700364112854,
-1.000337839126587,
-0.22037643194198608,
0.8269287347793579,
0.8766451478004456,
0.04137224704027176,
-0.8507960438728333,
0.7971528172492981,
... |
func (m *MongoDB) Insert(collection string, query interface{}) error {
if err := m.Ping(true); err != nil {
return err
}
col := m.client.Database(m.Database).Collection(collection)
// TODO - TTL Index
// mod := mongo.IndexModel{
// Keys: bson.M{
// "ExpireAt": 1, // index in ascending order
// }, Optio... | [
-0.8240105509757996,
0.8827270865440369,
0.8907186388969421,
0.4517732858657837,
0.3496926426887512,
0.7757569551467896,
0.030749650672078133,
-0.7395963668823242,
-0.21999578177928925,
0.2608603537082672,
-0.7184509634971619,
-0.22872835397720337,
-1.4206610918045044,
0.03300287202000618,... |
func (m *MongoDB) UpsertMany(collection string, query interface{}, filter interface{}) {
if err := m.Ping(true); err != nil {
return
}
col := m.client.Database(m.Database).Collection(collection)
var operations []mongo.WriteModel
operation := mongo.NewUpdateOneModel()
operation.SetFilter(filter)
operation.Se... | [
-1.0796810388565063,
0.5786120891571045,
1.1857236623764038,
0.018650753423571587,
1.1048271656036377,
-0.5213528871536255,
-0.450571745634079,
0.04550718888640404,
-0.3634176552295685,
0.973728597164154,
-0.35003426671028137,
-0.3922050893306732,
-0.8493770360946655,
0.8539969325065613,
... |
func (m *MongoDB) InsertMany(collection string, query []interface{}, ordered bool) error {
if err := m.Ping(true); err != nil {
return err
}
col := m.client.Database(m.Database).Collection(collection)
opts := options.InsertManyOptions{}
opts.SetOrdered(ordered)
ctx, cancel := context.WithTimeout(context.Back... | [
-1.2681258916854858,
1.0327491760253906,
0.9358124732971191,
0.12430793046951294,
0.9642200469970703,
0.3144720494747162,
-0.9106984734535217,
-0.6610997915267944,
-0.5825116634368896,
0.7866614460945129,
-0.3117423951625824,
-0.039580948650836945,
-1.374815821647644,
0.6779528856277466,
... |
func OverrideCrypto(hashMemSize, hashTime, hashKeyLength, hashThreadCount int64) {
if hashMemSize != -1 {
defaultHashMem = uint32(hashMemSize)
}
if hashTime != -1 {
defaultHashTime = uint32(hashTime)
}
if hashKeyLength != -1 {
defaultHashKeyLen = uint32(hashKeyLength)
}
if hashThreadCount != -1 {
default... | [
0.8909074664115906,
0.8248472213745117,
0.6248917579650879,
-0.2914614677429199,
1.2787951231002808,
-0.5647255182266235,
-0.17549817264080048,
-0.5796080827713013,
-0.923989474773407,
-0.4662085771560669,
-1.0171310901641846,
0.4239499866962433,
-1.3195916414260864,
0.4789712131023407,
... |
func NewSaltString(c int) string {
return bytesToBase64(NewSaltCSRNG(c))
} | [
0.09220705181360245,
-0.003234594129025936,
0.2196197807788849,
-1.1214200258255005,
-0.9604434967041016,
-0.15691475570201874,
-0.7294594049453735,
-1.1474651098251343,
0.43206116557121277,
0.31460434198379517,
0.25684237480163574,
0.010041432455182076,
0.2600052058696747,
0.0601955205202... |
func copyTo(dst []byte, src []byte, offset int) {
for j, k := range src {
dst[offset+j] = k
}
} | [
-0.6031294465065002,
0.42148131132125854,
0.33955055475234985,
-1.3583548069000244,
-0.7207200527191162,
0.20585675537586212,
-0.5868045091629028,
0.7041682600975037,
-0.714930534362793,
0.9166437983512878,
-1.3160885572433472,
1.2520782947540283,
0.9727437496185303,
-0.33240845799446106,
... |
func compareBytes(a []byte, b []byte) bool {
if len(a) != len(b) {
return false
}
for i, j := range a {
if b[i] != j {
return false
}
}
return true
} | [
-0.004656337201595306,
-0.3287883400917053,
0.948093593120575,
-0.06869374215602875,
0.3889658451080322,
0.0936385989189148,
-0.6577538847923279,
-0.2889414429664612,
-0.17840957641601562,
0.8219233155250549,
-0.22404694557189941,
0.45359575748443604,
-1.189933180809021,
0.4155998528003692... |
func GetPasswordHash(password string, salt []byte) []byte {
return GetHash([]byte(password), salt)
} | [
1.0537922382354736,
0.5472903251647949,
0.489217609167099,
0.6049479246139526,
-0.2878299951553345,
0.20995551347732544,
-1.2163714170455933,
-0.42539510130882263,
0.1104012206196785,
0.4901655614376068,
-0.3481762111186981,
1.2964223623275757,
-0.3970421850681305,
-0.3211756646633148,
0... |
func CheckPassword(password string, salt []byte, hash []byte) bool {
if compareBytes(GetPasswordHash(password, salt), hash) {
return true
}
return false
} | [
1.1643483638763428,
-0.3267466127872467,
0.5162726044654846,
1.0429706573486328,
0.18838727474212646,
0.8696759343147278,
-1.054998755455017,
0.5589277744293213,
-0.04166513308882713,
0.5195907950401306,
0.11912762373685837,
0.9587349891662598,
-0.605575442314148,
0.4106028378009796,
-0.... |
func TestRangeIterator(t *testing.T) {
tree := NewSplayTree()
items := []Item{Int(2), Int(4), Int(6), Int(1), Int(5), Int(3), Int(0)}
tree.InsertAll(items)
for lkup := range items {
tree.Lookup(Int(lkup))
lower := Int(2)
upper := Int(4)
iter := tree.RangeIterator(lower, upper)
for item := iter(); item != ... | [
-1.0044571161270142,
-0.9339241981506348,
0.705690860748291,
0.03873550519347191,
0.25115591287612915,
0.04853904992341995,
0.4198010563850403,
-0.6734253764152527,
0.11815331131219864,
-0.3153187036514282,
-0.6770644783973694,
-0.14879000186920166,
-0.7857586145401001,
-0.0150355566293001... |
func (c *Command) Execute(ctx context.Context) error {
pctx := &commandContext{
dependencyResolver: pipeline.NewDependencyRecorder[*commandContext](),
Context: ctx,
}
p := pipeline.NewPipeline[*commandContext]().WithBeforeHooks(pipe.DebugLogger[*commandContext](c.Log), pctx.dependencyResolver.Record... | [
0.4530569911003113,
-0.2084806263446808,
0.6398053765296936,
-0.2689710557460785,
1.103935718536377,
0.44088882207870483,
0.16048991680145264,
-0.4074189364910126,
-0.6380018591880798,
-0.4277381896972656,
-0.11403021961450577,
-0.19471979141235352,
-0.03596793860197067,
0.3124736845493316... |
func Verify(h http.HandlerFunc) http.HandlerFunc {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
hmacHeader := r.Header.Get("AUTHORIZATION")
hmac := simplcrypto.HMACWithSecretAndData(token, hmacData)
hmacString := simplcrypto.Base64URLEncode(hmac)
if hmacHeader != hmacString {
fm... | [
0.37599000334739685,
0.12081901729106903,
0.34334906935691833,
0.8638226389884949,
-0.27808868885040283,
0.06070403754711151,
-0.18389995396137238,
0.36679157614707947,
-0.23114730417728424,
-0.007897579111158848,
-0.8602195382118225,
0.6466206908226013,
-0.02061983197927475,
0.24571196734... |
func ParseTime(input string) (time.Time, error) {
// validate input with regex
match, err := regexp.MatchString(`^[0-9]{1,2}\/[0-9]{1,2}\/[0-9]{1,4}$`, input)
if err != nil {
return time.Time{}, err
}
if !match {
return time.Time{}, errors.New("invalid time format")
// return error
}
inputArray := strings.... | [
-0.06050921604037285,
-0.654965877532959,
1.0453994274139404,
0.7745868563652039,
-0.8978262543678284,
0.4971679747104645,
0.2603071331977844,
-0.45593470335006714,
0.04499640688300133,
0.30191975831985474,
0.6733222007751465,
-0.6322832107543945,
-0.6721042394638062,
0.6367501616477966,
... |
func CalculateDayDifference(input1 time.Time, input2 time.Time) (int, error) {
// input1 and input 2 are the sameday
if input1.Equal(input2) {
return 0, nil
// input1 is after input2
} else if input1.After(input2) {
days := input1.Sub(input2).Hours() / 24
return int(days) + 1, nil
// input1 is before inp... | [
-1.17621910572052,
0.06481906771659851,
1.025618314743042,
0.8595249652862549,
-0.639362096786499,
0.1819649338722229,
0.3960106074810028,
-0.48537710309028625,
-0.536797821521759,
-1.1366429328918457,
-0.08621801435947418,
-0.02169550396502018,
-0.6467978954315186,
1.1617865562438965,
1... |
func Load(g *gin.Engine, mw ...gin.HandlerFunc) *gin.Engine {
// Middlewares.
g.Use(gin.Recovery())
g.Use(middleware.NoCache)
g.Use(middleware.Options)
g.Use(middleware.Secure)
g.Use(mw...)
// 404 Handler.
g.NoRoute(func(c *gin.Context) {
c.String(http.StatusNotFound, "The incorrect API route.")
})
g.POST(... | [
-0.5433182120323181,
-0.3021562695503235,
0.8029637336730957,
-0.014372539706528187,
-0.026725206524133682,
0.45478636026382446,
0.17488712072372437,
-0.33430901169776917,
-0.18165986239910126,
-0.4277048408985138,
0.17953813076019287,
0.09318853914737701,
-0.0192473866045475,
-0.056499909... |
func (*OktetoClusterHelper) Add(*credentials.Credentials) error {
return ErrNotImplemented
} | [
-0.3684866428375244,
-0.41913938522338867,
0.3113936185836792,
0.10610122978687286,
0.6491525769233704,
0.47443506121635437,
-0.20320254564285278,
-0.17622250318527222,
-0.19831420481204987,
-0.5034796595573425,
0.7315673828125,
0.4143524765968323,
-0.49830520153045654,
0.4370487332344055,... |
func (*OktetoClusterHelper) Delete(_ string) error {
return ErrNotImplemented
} | [
0.48893603682518005,
-0.11979958415031433,
0.36140069365501404,
0.29064226150512695,
0.22039908170700073,
0.16628575325012207,
0.7833331823348999,
-0.3515561819076538,
-0.3352142572402954,
0.04536912217736244,
0.4343869686126709,
0.3954465091228485,
-0.6811724901199341,
-0.3516947329044342... |
func (och *OktetoClusterHelper) Get(serverURL string) (string, string, error) {
return och.getter.GetRegistryCredentials(serverURL)
} | [
-0.9752435684204102,
-0.04887937754392624,
0.18557249009609222,
0.20894843339920044,
0.7045980095863342,
-0.6204767823219299,
-0.01764768175780773,
-0.13658927381038666,
-0.5983196496963501,
0.20395691692829132,
-0.44337308406829834,
1.5797004699707031,
-0.6505042910575867,
-0.160841405391... |
func (*OktetoClusterHelper) List() (map[string]string, error) {
return nil, ErrNotImplemented
} | [
-0.37642037868499756,
-1.16459059715271,
0.3684914708137512,
-0.2863965630531311,
0.45555147528648376,
-0.441128671169281,
-0.22387616336345673,
-0.6742168664932251,
-0.38943663239479065,
0.18035250902175903,
-0.34260326623916626,
-0.0946970134973526,
0.1627008467912674,
0.2306530773639679... |
func (tfb *TempFileBlock) Size() (int64, error) {
f, err := os.Open(tfb.TempFile)
if err != nil {
return 0, errors.Wrap(err, "Error opening file block at \""+tfb.TempFile+"\" for reading")
}
fi, err := f.Stat()
if err != nil {
return 0, errors.Wrap(err, "Error getting file info for file block at \""+tfb.TempFi... | [
-0.23080576956272125,
-0.3574821949005127,
0.7510626316070557,
-0.8635221719741821,
-0.11777181178331375,
0.17031262814998627,
0.8029670119285583,
0.02056450955569744,
-1.628422737121582,
-0.20449499785900116,
0.049438927322626114,
-0.7494895458221436,
-0.8178669214248657,
0.84430688619613... |
func (tfb *TempFileBlock) Reader() (*Reader, error) {
switch tfb.GetAlgorithm() {
case "snappy":
f, err := os.OpenFile(tfb.TempFile, os.O_RDONLY, 0600)
if err != nil {
return nil, errors.Wrap(err, "Error opening file block at \""+tfb.TempFile+"\" for reading")
}
return &Reader{Reader: snappy.NewReader(bu... | [
0.1273481249809265,
-0.9848987460136414,
0.7089210748672485,
-0.28509441018104553,
-0.7844574451446533,
0.17606854438781738,
0.769745945930481,
-0.5158665180206299,
-0.619313657283783,
-0.24940836429595947,
0.6541963219642639,
-0.4885914921760559,
-0.0038340487517416477,
0.2546145021915436... |
func (tfb *TempFileBlock) Iterator() (*BlockIterator, error) {
reader, err := tfb.Reader()
if err != nil {
return &BlockIterator{}, errors.Wrap(err, "Error creating iterator")
}
it := &BlockIterator{
Reader: reader,
BigEndian: tfb.UseBigEndian(),
}
return it, nil
} | [
-0.3000822365283966,
-1.1884657144546509,
0.45928800106048584,
-0.4488906264305115,
-0.654526948928833,
0.26053085923194885,
0.5773993134498596,
0.270692378282547,
-0.7400995492935181,
-0.028683660551905632,
0.44519180059432983,
-0.5695235133171082,
-0.23912549018859863,
0.2729713022708893... |
func (tfb *TempFileBlock) Init(b []byte) error {
tempDirExpanded, err := homedir.Expand(tfb.TempDir)
if err != nil {
return errors.Wrap(err, "Error expanding path for file block at \""+tfb.TempDir+"\"")
}
tfb.TempDirExpanded = tempDirExpanded
err = os.MkdirAll(tfb.TempDirExpanded, 0770)
if err != nil {
ret... | [
-0.06399236619472504,
-0.3175627887248993,
1.144450068473816,
-0.620573103427887,
0.30511701107025146,
0.23720477521419525,
0.8496342897415161,
0.0139191634953022,
-1.007766842842102,
0.1715129315853119,
-0.6164436936378479,
0.44071272015571594,
0.13129018247127533,
1.3301440477371216,
0... |
func (tfb *TempFileBlock) Remove() error {
return os.Remove(tfb.TempFile)
} | [
0.3359737992286682,
-0.41994234919548035,
0.42365750670433044,
-0.0988558754324913,
0.041559796780347824,
-0.0010210813488811255,
0.6384847164154053,
0.9973883628845215,
-1.4491347074508667,
0.22555291652679443,
-0.5874898433685303,
-0.8291782140731812,
-1.3408282995224,
0.9543511867523193... |
func NewTempFileBlock(algorithm string, bigEndian bool, tempDir string) *TempFileBlock {
return &TempFileBlock{
AbstractBlock: AbstractBlock{
Algorithm: algorithm,
BigEndian: bigEndian,
},
TempDir: tempDir,
}
} | [
0.43030378222465515,
-0.36468854546546936,
0.3649354577064514,
-0.4815634489059448,
-0.8725563287734985,
0.5310116410255432,
-0.07613687217235565,
0.3562689423561096,
-0.8822938203811646,
-0.20939938724040985,
-0.4297102689743042,
-0.24451664090156555,
-0.1917637288570404,
0.62825644016265... |
func runSearch(ctx context.Context, position position, depth int, ch chan move) {
// Declare the initial cutoffs for the alpha-beta pruning.
alpha := -100000
beta := 100000
for i := 1; i <= depth; i++ {
result := search(position, i, alpha, beta)
select {
case <-ctx.Done():
return
default:
ch <- resu... | [
-1.291642427444458,
0.658548891544342,
0.5822405815124512,
-0.18996092677116394,
0.599538266658783,
0.3806374967098236,
0.3513091206550598,
-0.8443378806114197,
-0.5560645461082458,
-0.09109209477901459,
-0.3702539801597595,
0.32474762201309204,
-1.1349443197250366,
-0.05698734521865845,
... |
func search(position position, depth int, alpha int, beta int) move {
// Generate all legal moves for the current position.
moves := generateLegalMoves(position)
bestScore := -100000
var bestMove move
// For each move available, run a search of its tree to the given depth, to
// identify the best outcome.
for ... | [
-0.339632123708725,
-0.1694043129682541,
0.6566498279571533,
-0.265912801027298,
0.37623557448387146,
-0.2695028781890869,
-0.04682845249772072,
-0.2552006244659424,
-0.5086380243301392,
-0.2857392132282257,
0.2996082305908203,
0.2813502252101898,
-0.7645809054374695,
0.13117268681526184,
... |
func alphaBeta(position *position, alpha int, beta int, depth int) int {
// At the bottom of the tree, return the score of the position for the attacking player.
if depth == 0 {
return evaluate(*position)
}
// Otherwise, generate all possible moves.
moves := generateLegalMoves(*position)
for _, move := range m... | [
-0.8438639044761658,
-0.40120410919189453,
0.8973957300186157,
-0.46289777755737305,
-0.010729793459177017,
-0.7072749733924866,
0.8367033004760742,
-0.16460907459259033,
-0.14555968344211578,
0.29375922679901123,
0.2603500485420227,
0.16313061118125916,
-0.5968372821807861,
-0.12219003587... |
func NewSalt() ([]byte, error) {
key := make([]byte, 60)
_, err := rand.Read(key)
if err != nil {
return nil, err
}
return key, nil
} | [
-0.3341074287891388,
-0.22837863862514496,
0.5537638068199158,
-1.039278507232666,
-0.9683734178543091,
0.1282743215560913,
-1.212726354598999,
-1.0074257850646973,
0.46032148599624634,
0.5586990714073181,
-0.5048804879188538,
0.5837664008140564,
-0.5329012274742126,
0.37612855434417725,
... |
func (z *Element22) SetUint64(v uint64) *Element22 {
z[0] = v
z[1] = 0
z[2] = 0
z[3] = 0
z[4] = 0
z[5] = 0
z[6] = 0
z[7] = 0
z[8] = 0
z[9] = 0
z[10] = 0
z[11] = 0
z[12] = 0
z[13] = 0
z[14] = 0
z[15] = 0
z[16] = 0
z[17] = 0
z[18] = 0
z[19] = 0
z[20] = 0
z[21] = 0
return z.ToMont()
} | [
-0.6182243227958679,
-0.36393266916275024,
0.4969373345375061,
-0.0994417667388916,
0.5698469877243042,
-0.7306259870529175,
0.9512450695037842,
0.008224657736718655,
0.8259967565536499,
-0.2532893419265747,
-1.1301555633544922,
-0.3728446662425995,
-0.047785770148038864,
0.834709465503692... |
func (z *Element22) Set(x *Element22) *Element22 {
z[0] = x[0]
z[1] = x[1]
z[2] = x[2]
z[3] = x[3]
z[4] = x[4]
z[5] = x[5]
z[6] = x[6]
z[7] = x[7]
z[8] = x[8]
z[9] = x[9]
z[10] = x[10]
z[11] = x[11]
z[12] = x[12]
z[13] = x[13]
z[14] = x[14]
z[15] = x[15]
z[16] = x[16]
z[17] = x[17]
z[18] = x[18]
z[1... | [
-0.28840750455856323,
-0.3642962872982025,
0.5047395825386047,
-0.5180291533470154,
-0.3135240077972412,
-0.0680098608136177,
0.5100558400154114,
-0.061176277697086334,
0.4873276650905609,
0.10158558934926987,
-1.3694257736206055,
0.8186993598937988,
0.03735550120472908,
-0.249150663614273... |
func (z *Element22) SetZero() *Element22 {
z[0] = 0
z[1] = 0
z[2] = 0
z[3] = 0
z[4] = 0
z[5] = 0
z[6] = 0
z[7] = 0
z[8] = 0
z[9] = 0
z[10] = 0
z[11] = 0
z[12] = 0
z[13] = 0
z[14] = 0
z[15] = 0
z[16] = 0
z[17] = 0
z[18] = 0
z[19] = 0
z[20] = 0
z[21] = 0
return z
} | [
-0.12280748784542084,
-0.4385913610458374,
0.6107732057571411,
0.5040086507797241,
0.44237619638442993,
-0.5623407363891602,
0.6885328888893127,
0.47719806432724,
0.49460482597351074,
-0.0015562522457912564,
-1.5746594667434692,
0.43308141827583313,
-0.4101021885871887,
0.7875410318374634,... |
func (z *Element22) SetOne() *Element22 {
z[0] = 321544845059895198
z[1] = 16541892654410287397
z[2] = 8917985439251269919
z[3] = 17940102142409130176
z[4] = 1094774535865374696
z[5] = 13232582885865497220
z[6] = 4741736040274922895
z[7] = 17714247117339573163
z[8] = 13100768513301941449
z[9] = 86634231812292... | [
-0.2139267772436142,
0.26157429814338684,
0.91196209192276,
-0.47083207964897156,
0.4592140316963196,
-1.4627772569656372,
1.736037015914917,
0.3207695484161377,
0.0963548794388771,
0.08272430300712585,
-1.6418946981430054,
0.11054873466491699,
-0.001665430492721498,
0.15741750597953796,
... |
func (z *Element22) Neg(x *Element22) *Element22 {
if x.IsZero() {
return z.SetZero()
}
var borrow uint64
z[0], borrow = bits.Sub64(9062599614324828209, x[0], 0)
z[1], borrow = bits.Sub64(952425709649632109, x[1], borrow)
z[2], borrow = bits.Sub64(13987751354083916656, x[2], borrow)
z[3], borrow = bits.Sub64(9... | [
-0.5053404569625854,
-0.04378022998571396,
1.1067991256713867,
0.05757053941488266,
-0.13915599882602692,
0.47019946575164795,
1.080186367034912,
0.5000291466712952,
0.7128601670265198,
-0.05742703750729561,
-0.7381042838096619,
0.3095974922180176,
-0.2190808653831482,
0.7007791996002197,
... |
func (z *Element22) Div(x, y *Element22) *Element22 {
var yInv Element22
yInv.Inverse(y)
z.Mul(x, &yInv)
return z
} | [
-0.7001044154167175,
-0.7777528762817383,
0.4103683829307556,
0.7581305503845215,
-0.2039751261472702,
0.20048344135284424,
0.44930028915405273,
0.20215782523155212,
0.2491784691810608,
-0.4702533185482025,
-1.078597068786621,
1.543457269668579,
0.45619556307792664,
0.320359468460083,
0.... |
func (z *Element22) Equal(x *Element22) bool {
return (z[21] == x[21]) && (z[20] == x[20]) && (z[19] == x[19]) && (z[18] == x[18]) && (z[17] == x[17]) && (z[16] == x[16]) && (z[15] == x[15]) && (z[14] == x[14]) && (z[13] == x[13]) && (z[12] == x[12]) && (z[11] == x[11]) && (z[10] == x[10]) && (z[9] == x[9]) && (z[8] =... | [
-0.18469078838825226,
-0.8659452199935913,
0.741616427898407,
0.032173559069633484,
-0.053496599197387695,
0.026201412081718445,
0.39869681000709534,
-0.5129711627960205,
0.6169915795326233,
0.49076658487319946,
-1.7243033647537231,
0.597498893737793,
-0.22196657955646515,
0.33121410012245... |
func (z *Element22) IsZero() bool {
return (z[21] | z[20] | z[19] | z[18] | z[17] | z[16] | z[15] | z[14] | z[13] | z[12] | z[11] | z[10] | z[9] | z[8] | z[7] | z[6] | z[5] | z[4] | z[3] | z[2] | z[1] | z[0]) == 0
} | [
-0.36616164445877075,
-0.651083767414093,
0.6189538240432739,
0.9630142450332642,
0.3315139710903168,
-0.6087176203727722,
0.6416521072387695,
-0.06458766758441925,
1.351440668106079,
0.08380137383937836,
-1.1289377212524414,
0.5228555798530579,
-0.6663268208503723,
0.39805546402931213,
... |
func (z *Element22) Inverse(x *Element22) *Element22 {
var _xNonMont big.Int
x.ToBigIntRegular(&_xNonMont)
_xNonMont.ModInverse(&_xNonMont, element22ModulusBigInt())
z.SetBigInt(&_xNonMont)
return z
} | [
-0.6526563167572021,
-0.2827751934528351,
0.4550570249557495,
0.25703856348991394,
-0.5140094757080078,
0.4002361297607422,
0.27667343616485596,
1.3623758554458618,
-0.3026382327079773,
-0.8505675792694092,
-1.098489761352539,
1.0462294816970825,
-0.4755820035934448,
-0.12942618131637573,
... |
func (z *Element22) SetRandom() *Element22 {
bytes := make([]byte, 1408)
io.ReadFull(rand.Reader, bytes)
z[0] = binary.BigEndian.Uint64(bytes[0:64])
z[1] = binary.BigEndian.Uint64(bytes[64:128])
z[2] = binary.BigEndian.Uint64(bytes[128:192])
z[3] = binary.BigEndian.Uint64(bytes[192:256])
z[4] = binary.BigEndian.... | [
0.006425592582672834,
-0.44463807344436646,
0.8261734843254089,
-0.36736515164375305,
0.16577494144439697,
-0.24141857028007507,
0.9894514679908752,
-0.18348366022109985,
0.94319748878479,
-0.33194491267204285,
-0.9250205159187317,
0.888408899307251,
-0.2751849591732025,
0.4895743131637573... |
func (z *Element22) Add(x, y *Element22) *Element22 {
var carry uint64
z[0], carry = bits.Add64(x[0], y[0], 0)
z[1], carry = bits.Add64(x[1], y[1], carry)
z[2], carry = bits.Add64(x[2], y[2], carry)
z[3], carry = bits.Add64(x[3], y[3], carry)
z[4], carry = bits.Add64(x[4], y[4], carry)
z[5], carry = bits.Add64(... | [
-0.15410329401493073,
-0.9531936049461365,
0.9361019730567932,
-0.098354272544384,
0.2629794478416443,
0.21697209775447845,
0.4138290584087372,
-0.5679113268852234,
0.43034958839416504,
0.20280729234218597,
-0.5816373229026794,
0.5107978582382202,
-0.3348378837108612,
0.24370528757572174,
... |
func (z *Element22) AddAssign(x *Element22) *Element22 {
var carry uint64
z[0], carry = bits.Add64(z[0], x[0], 0)
z[1], carry = bits.Add64(z[1], x[1], carry)
z[2], carry = bits.Add64(z[2], x[2], carry)
z[3], carry = bits.Add64(z[3], x[3], carry)
z[4], carry = bits.Add64(z[4], x[4], carry)
z[5], carry = bits.Add... | [
-0.229225292801857,
-0.9838815331459045,
0.8036999702453613,
-0.2328212708234787,
-0.383456289768219,
0.04817984253168106,
0.4501860439777374,
-0.023237718269228935,
0.4406302869319916,
0.037439268082380295,
-0.5248625874519348,
-0.025370333343744278,
-0.1642143428325653,
0.793130695819854... |
func (z *Element22) Double(x *Element22) *Element22 {
var carry uint64
z[0], carry = bits.Add64(x[0], x[0], 0)
z[1], carry = bits.Add64(x[1], x[1], carry)
z[2], carry = bits.Add64(x[2], x[2], carry)
z[3], carry = bits.Add64(x[3], x[3], carry)
z[4], carry = bits.Add64(x[4], x[4], carry)
z[5], carry = bits.Add64(... | [
0.031135043129324913,
-0.5407478213310242,
0.9879978895187378,
0.08088143169879913,
0.0590236596763134,
0.35173240303993225,
0.7641557455062866,
-0.5297326445579529,
0.07222560048103333,
0.3588451147079468,
-1.0226348638534546,
0.5375869274139404,
-0.237247496843338,
0.4011147618293762,
... |
func (z *Element22) Sub(x, y *Element22) *Element22 {
var b uint64
z[0], b = bits.Sub64(x[0], y[0], 0)
z[1], b = bits.Sub64(x[1], y[1], b)
z[2], b = bits.Sub64(x[2], y[2], b)
z[3], b = bits.Sub64(x[3], y[3], b)
z[4], b = bits.Sub64(x[4], y[4], b)
z[5], b = bits.Sub64(x[5], y[5], b)
z[6], b = bits.Sub64(x[6], y[... | [
0.026243558153510094,
-0.32617777585983276,
0.9531199932098389,
0.18198780715465546,
-0.5798086524009705,
0.09100756794214249,
0.7106279134750366,
-0.1062491238117218,
0.14120128750801086,
0.24857652187347412,
-0.9774169921875,
0.3688652515411377,
-0.1707870215177536,
-0.0845629945397377,
... |
func (z *Element22) SubAssign(x *Element22) *Element22 {
var b uint64
z[0], b = bits.Sub64(z[0], x[0], 0)
z[1], b = bits.Sub64(z[1], x[1], b)
z[2], b = bits.Sub64(z[2], x[2], b)
z[3], b = bits.Sub64(z[3], x[3], b)
z[4], b = bits.Sub64(z[4], x[4], b)
z[5], b = bits.Sub64(z[5], x[5], b)
z[6], b = bits.Sub64(z[6],... | [
0.03209712728857994,
-0.8409836292266846,
0.770056962966919,
0.0475102923810482,
-0.8331729769706726,
-0.21940718591213226,
0.7717772126197815,
0.3711153268814087,
0.5629141926765442,
0.3130849599838257,
-0.9068129062652588,
0.08666180074214935,
-0.16038140654563904,
0.46152740716934204,
... |
func (z *Element22) Exp(x Element22, e uint64) *Element22 {
if e == 0 {
return z.SetOne()
}
z.Set(&x)
l := bits.Len64(e) - 2
for i := l; i >= 0; i-- {
z.Square(z)
if e&(1<<uint(i)) != 0 {
z.MulAssign(&x)
}
}
return z
} | [
-0.1960315853357315,
0.2351899892091751,
0.47121745347976685,
0.8431445360183716,
-0.9045242071151733,
-0.26062455773353577,
0.4786911606788635,
0.4399869441986084,
1.2812023162841797,
0.46612104773521423,
-0.634171187877655,
0.09073258191347122,
-0.17746257781982422,
0.6163580417633057,
... |
func (z *Element22) FromMont() *Element22 {
// the following lines implement z = z * 1
// with a modified CIOS montgomery multiplication
{
// m = z[0]n'[0] mod W
m := z[0] * 2085129623399436079
C := madd0(m, 9062599614324828209, z[0])
C, z[0] = madd2(m, 952425709649632109, z[1], C)
C, z[1] = madd2(m, 1398... | [
0.870256781578064,
-0.8440277576446533,
0.5836056470870972,
-0.13227710127830505,
-0.4729279577732086,
-0.4844638407230377,
1.076094388961792,
0.24534210562705994,
0.6325984597206116,
-0.43191131949424744,
-0.29635387659072876,
0.2981988191604614,
-0.3804987967014313,
0.8036534190177917,
... |
func (z *Element22) ToMont() *Element22 {
var rSquare = Element22{
11555390936043306539,
958669060063230310,
2580977272801836257,
1403887552063632943,
13867690507567207459,
3907927833394869101,
10840458828090788374,
4883929514287350477,
15550705002284641687,
204726014467581413,
980032670681427175... | [
-0.22738970816135406,
-0.354910284280777,
1.034255027770996,
-0.981731653213501,
-0.4860227108001709,
-0.5815751552581787,
0.30682849884033203,
-0.1088036298751831,
0.9434233903884888,
0.3009171783924103,
-0.8973152041435242,
-0.26597368717193604,
0.4487144351005554,
0.37260258197784424,
... |
func (z Element22) ToRegular() Element22 {
return *z.FromMont()
} | [
0.12657329440116882,
0.005403568502515554,
0.32353514432907104,
0.28838926553726196,
-0.30384016036987305,
0.06128277629613876,
0.43924665451049805,
0.24224340915679932,
0.05622456967830658,
-0.5399525165557861,
-0.28964635729789734,
0.722061812877655,
-0.7841043472290039,
-0.5187197327613... |
func (z *Element22) String() string {
var _z big.Int
return z.ToBigIntRegular(&_z).String()
} | [
-0.08880646526813507,
-0.84630286693573,
0.13296139240264893,
0.26379355788230896,
-0.05061301216483116,
-0.2724055051803589,
1.536792516708374,
-0.47707870602607727,
0.333957701921463,
-0.5498927235603333,
-0.5649961233139038,
0.9439744353294373,
-0.20830883085727692,
-0.0885884240269661,... |
func (z *Element22) ToBigInt(res *big.Int) *big.Int {
bits := (*[22]big.Word)(unsafe.Pointer(z))
return res.SetBits(bits[:])
} | [
-0.1769573837518692,
-0.1601381003856659,
0.4906664490699768,
-0.8044524192810059,
0.17578329145908356,
-0.7077147960662842,
0.8271382451057434,
-0.2630248963832855,
0.7804357409477234,
0.2966546416282654,
-1.3928561210632324,
0.6996766328811646,
-0.5400592088699341,
-0.5417540669441223,
... |
func (z Element22) ToBigIntRegular(res *big.Int) *big.Int {
z.FromMont()
bits := (*[22]big.Word)(unsafe.Pointer(&z))
return res.SetBits(bits[:])
} | [
-0.504619300365448,
0.2594555616378784,
0.5323715209960938,
-0.5689241886138916,
-0.032248396426439285,
-0.652401864528656,
0.840255856513977,
0.4839825928211212,
0.2606635093688965,
0.05457033962011337,
-0.93278968334198,
1.3206334114074707,
-1.0739554166793823,
-0.37934210896492004,
0.... |
func (z *Element22) SetBigInt(v *big.Int) *Element22 {
z.SetZero()
zero := big.NewInt(0)
q := element22ModulusBigInt()
// copy input
vv := new(big.Int).Set(v)
// while v < 0, v+=q
for vv.Cmp(zero) == -1 {
vv.Add(vv, q)
}
// while v > q, v-=q
for vv.Cmp(q) == 1 {
vv.Sub(vv, q)
}
// if v == q, return 0... | [
-0.7512528300285339,
-0.6552232503890991,
0.6935129165649414,
-0.4476628601551056,
-0.062403831630945206,
-0.1233745813369751,
0.6635103821754456,
0.07789827883243561,
0.7727585434913635,
0.2702082395553589,
-1.0311187505722046,
0.8831632733345032,
-0.5100592374801636,
0.8429368734359741,
... |
func (z *Element22) SetString(s string) *Element22 {
x, ok := new(big.Int).SetString(s, 10)
if !ok {
panic("Element22.SetString failed -> can't parse number in base10 into a big.Int")
}
return z.SetBigInt(x)
} | [
-0.23504050076007843,
0.003960650879889727,
0.3753263056278229,
-0.10961800813674927,
0.17139209806919098,
-0.3259839713573456,
0.8611913323402405,
0.4083057940006256,
0.6221851706504822,
-0.31842613220214844,
-1.0316791534423828,
0.4899148941040039,
0.23663213849067688,
-0.281642198562622... |
func (z *Element22) Mul(x, y *Element22) *Element22 {
var t [23]uint64
var D uint64
var m, C uint64
// -----------------------------------
// First loop
C, t[0] = bits.Mul64(y[0], x[0])
C, t[1] = madd1(y[0], x[1], C)
C, t[2] = madd1(y[0], x[2], C)
C, t[3] = madd1(y[0], x[3], C)
C, t[4] = madd1(y[0], x[4], C... | [
0.5321880578994751,
-0.15107423067092896,
0.7776350975036621,
0.12128409743309021,
-0.24777469038963318,
0.32642266154289246,
0.8008344769477844,
-0.48810887336730957,
0.25051793456077576,
0.7341722846031189,
-0.5238828659057617,
-0.09777895361185074,
0.32499998807907104,
0.052071031183004... |
func (z *Element22) MulAssign(x *Element22) *Element22 {
var t [23]uint64
var D uint64
var m, C uint64
// -----------------------------------
// First loop
C, t[0] = bits.Mul64(x[0], z[0])
C, t[1] = madd1(x[0], z[1], C)
C, t[2] = madd1(x[0], z[2], C)
C, t[3] = madd1(x[0], z[3], C)
C, t[4] = madd1(x[0], z[4]... | [
0.19070304930210114,
-0.41463330388069153,
0.798607587814331,
0.11445392668247223,
-0.8290385603904724,
-0.14394977688789368,
0.5452536940574646,
0.033989425748586655,
-0.08535626530647278,
0.7372681498527527,
-1.1107231378555298,
-0.33132582902908325,
0.21747514605522156,
0.37805873155593... |
func (z *Element22) Square(x *Element22) *Element22 {
return z.Mul(x, x)
} | [
-0.8960540890693665,
-0.8150075078010559,
0.24331024289131165,
0.757095992565155,
-0.1768072098493576,
-0.3599907457828522,
0.42074689269065857,
-0.38687166571617126,
1.522098422050476,
-0.5157430171966553,
-1.3456779718399048,
0.8047002553939819,
0.42306452989578247,
0.09701544791460037,
... |
func PermutationSequence(n, k int) []int {
source := []int{}
for i := 1; i <= n; i++ {
source = append(source, i)
}
for j := 1; j < k; j++ {
source = nextPaiLieZuHe(source)
}
return source
} | [
-1.133787989616394,
0.43996167182922363,
0.5254302620887756,
0.11691229790449142,
-1.1530147790908813,
-0.8158640265464783,
-0.1498146504163742,
0.21190743148326874,
0.05492246150970459,
0.7357361912727356,
-0.8406716585159302,
-0.8632827997207642,
-0.4857199788093567,
0.6893170475959778,
... |
func (z *Big) CheckNaNs(x, y *Big) bool {
return z.invalidContext(z.Context) || z.checkNaNs(x, y, 0)
} | [
-0.7773568034172058,
0.3392423987388611,
0.21672725677490234,
1.1046972274780273,
-0.5835738182067871,
0.14507275819778442,
-0.5134967565536499,
-0.8748341798782349,
0.4251938462257385,
-0.12161147594451904,
0.2126840204000473,
1.129489779472351,
0.3657429814338684,
0.9825168251991272,
-... |
func (x *Big) isCompact() bool { return x.compact != c.Inflated } | [
0.4737861454486847,
0.3175560235977173,
0.39322561025619507,
-0.28372707962989807,
-0.36644038558006287,
0.3686957359313965,
0.22516724467277527,
-0.8569194078445435,
-0.38652849197387695,
0.28010115027427673,
-0.005502325017005205,
-0.16985364258289337,
0.2353246659040451,
0.3365517556667... |
func (z *Big) Abs(x *Big) *Big {
if debug {
x.validate()
}
if !z.invalidContext(z.Context) && !z.checkNaNs(x, x, absvalue) {
z.Context.round(z.copyAbs(x))
}
return z
} | [
-0.9562134146690369,
-0.42301425337791443,
0.3863196074962616,
0.45562437176704407,
-0.49797552824020386,
0.7073679566383362,
0.06058211252093315,
-0.5590373277664185,
0.5063269734382629,
-0.19875389337539673,
0.3328379690647125,
1.4022347927093506,
1.0026850700378418,
0.5643864274024963,
... |
func (z *Big) Add(x, y *Big) *Big { return z.Context.Add(z, x, y) } | [
-0.8334816694259644,
-0.20968741178512573,
0.38546645641326904,
0.508573591709137,
0.35902225971221924,
0.17033332586288452,
-0.23464623093605042,
-0.7941274046897888,
0.7701739072799683,
-0.3260003924369812,
-0.17165932059288025,
1.278994083404541,
-0.2794649004936218,
-0.2758825719356537... |
func (x *Big) Class() string {
if x.IsNaN(0) {
if x.IsNaN(+1) {
return "NaN"
}
return "sNaN"
}
if x.Signbit() {
if x.IsInf(0) {
return "-Infinity"
}
if x.isZero() {
return "-Zero"
}
if x.IsSubnormal() {
return "-Subnormal"
}
return "-Normal"
}
if x.IsInf(0) {
return "+Infinity"
}... | [
-1.0007163286209106,
0.13300150632858276,
0.7733973264694214,
-0.27962374687194824,
-0.567460298538208,
0.8364202380180359,
-0.6609013080596924,
0.24092331528663635,
-0.030755270272493362,
-0.24554549157619476,
-0.010262513533234596,
0.7305946946144104,
1.043036699295044,
0.606382489204406... |
func (x *Big) Cmp(y *Big) int { return cmp(x, y, false) } | [
-0.03590069338679314,
0.41311192512512207,
0.44791948795318604,
-0.2549368143081665,
-0.19516237080097198,
0.5279783606529236,
-0.008849404752254486,
-0.6936064958572388,
-0.5155648589134216,
0.327167809009552,
-0.48749840259552,
0.17014865577220917,
-0.03553519770503044,
0.344328492879867... |
func (x *Big) CmpAbs(y *Big) int { return cmp(x, y, true) } | [
-0.6145281195640564,
-0.19152536988258362,
0.4321798086166382,
-0.7760782837867737,
-1.1802068948745728,
0.8014547228813171,
-0.8498142957687378,
-1.1230149269104004,
0.20658357441425323,
0.3144870698451996,
-0.20907144248485565,
1.3326575756072998,
0.6838564276695251,
0.5822769403457642,
... |
func cmp(x, y *Big, abs bool) int {
if debug {
x.validate()
y.validate()
}
if x == y {
return 0
}
// NaN cmp x
// z cmp NaN
// NaN cmp NaN
if (x.form|y.form)&nan != 0 {
return 0
}
// Fast path: Catches non-finite forms like zero and ±Inf, possibly signed.
xs := x.ord(abs)
ys := y.ord(abs)
if xs ... | [
-0.08569300919771194,
0.018412068486213684,
0.6345247626304626,
-0.17437496781349182,
-0.635749340057373,
0.5534802079200745,
-0.3452809154987335,
-0.29567405581474304,
-0.1127425879240036,
0.1903788447380066,
0.12777650356292725,
0.23049940168857574,
0.7334351539611816,
0.3091274499893188... |
func (z *Big) Copy(x *Big) *Big {
if debug {
x.validate()
}
if z != x {
sign := x.form & signbit
z.copyAbs(x)
z.form |= sign
}
return z
} | [
-0.9378454089164734,
-0.8041602969169617,
0.2870453894138336,
1.2002339363098145,
-1.0360766649246216,
1.5791641473770142,
0.177177295088768,
-0.6894202828407288,
0.8470789790153503,
-0.19224800169467926,
-0.5699916481971741,
0.6687921285629272,
0.20260494947433472,
0.5321605205535889,
0... |
func (z *Big) copyAbs(x *Big) *Big {
if z != x {
z.precision = x.Precision()
z.exp = x.exp
z.compact = x.compact
if x.IsFinite() && x.isInflated() {
z.unscaled.Set(&x.unscaled)
}
}
z.form = x.form & ^signbit
return z
} | [
-0.7156022191047668,
-0.9373177289962769,
0.5919116735458374,
-0.179270401597023,
-1.3675287961959839,
0.639519989490509,
-0.15673920512199402,
-0.7997083067893982,
0.8613264560699463,
0.14117814600467682,
-0.18311907351016998,
0.9646693468093872,
1.1441065073013306,
0.4805949330329895,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.