text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func min(a, b int) int {
if b < a {
return b
}
return a
} | [
0.18921279907226562,
-0.26176100969314575,
0.1920144408941269,
-0.21038246154785156,
-0.8848903179168701,
0.4574066698551178,
-0.9401307702064514,
-0.97532719373703,
-0.4554394483566284,
-0.4743635058403015,
0.6988058090209961,
1.0426764488220215,
-0.1500844806432724,
-0.004083118867129087... |
func hash(s string) string {
hash := fnv.New32a()
hash.Write([]byte(s))
intHash := hash.Sum32()
result := fmt.Sprintf("%08x", intHash)
return result
} | [
0.9952943325042725,
0.44315212965011597,
0.7318460941314697,
-0.42522865533828735,
-0.8295183777809143,
0.906716525554657,
-0.06739720702171326,
0.054858170449733734,
0.38362446427345276,
-0.5857428908348083,
-0.6981555223464966,
0.7285254597663879,
0.01474639493972063,
-0.7466577291488647... |
func defaultGOPATH() string {
env := "HOME"
if runtime.GOOS == "windows" {
env = "USERPROFILE"
} else if runtime.GOOS == "plan9" {
env = "home"
}
if home := os.Getenv(env); home != "" {
def := filepath.Join(home, "go")
if filepath.Clean(def) == filepath.Clean(runtime.GOROOT()) {
// Don't set the default... | [
0.7652078866958618,
0.8401024341583252,
0.40671151876449585,
1.0892279148101807,
0.5510385632514954,
0.6038833260536194,
0.12038136273622513,
-0.4100504219532013,
-0.8155738711357117,
0.3317466080188751,
-0.3182215392589569,
0.28683406114578247,
-1.1752833127975464,
0.83823162317276,
-0.... |
func NewCustomerInfoResponse() *CustomerInfoResponse {
this := CustomerInfoResponse{}
var corporate bool = false
this.Corporate = &corporate
return &this
} | [
0.8118773102760315,
-1.8559589385986328,
-0.033161699771881104,
0.1739577353000641,
-0.9421949982643127,
-0.1436944603919983,
0.6143582463264465,
-0.04173406958580017,
-0.16017131507396698,
-0.7340498566627502,
-0.9302425384521484,
-0.8265661597251892,
-0.7324636578559875,
-0.0489473901689... |
func NewCustomerInfoResponseWithDefaults() *CustomerInfoResponse {
this := CustomerInfoResponse{}
var corporate bool = false
this.Corporate = &corporate
return &this
} | [
0.8096830248832703,
-1.1407105922698975,
-0.03881847858428955,
0.23818093538284302,
0.16686709225177765,
-0.2768999934196472,
0.006095597520470619,
-0.11278102546930313,
-0.15952789783477783,
-1.1329156160354614,
-1.1392478942871094,
-1.7827723026275635,
-1.1217552423477173,
0.099644780158... |
func (o *CustomerInfoResponse) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
} | [
0.2849237322807312,
0.06576530635356903,
0.03549101948738098,
0.7535838484764099,
-0.604178786277771,
-0.8994163870811462,
0.46269187331199646,
-0.6910408735275269,
0.2870735824108124,
0.18274502456188202,
-0.5654962062835693,
-1.8881367444992065,
-0.5094192028045654,
0.9006497859954834,
... |
func (o *CustomerInfoResponse) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
} | [
-0.02423492632806301,
0.027314890176057816,
0.4426882863044739,
0.46203577518463135,
-0.6927794814109802,
0.0144702373072505,
-0.04820610582828522,
-0.21700534224510193,
-0.1994122564792633,
1.1855947971343994,
-1.3326947689056396,
-1.0390359163284302,
0.08686890453100204,
0.57787621021270... |
func (o *CustomerInfoResponse) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
} | [
0.4046141505241394,
0.016764163970947266,
-0.06226269528269768,
0.3374879062175751,
-0.2829716205596924,
-0.3837575614452362,
-0.2898840606212616,
-0.37059956789016724,
0.10599508136510849,
0.4411561191082001,
-1.0143827199935913,
-1.4875280857086182,
-0.27359539270401,
0.35085171461105347... |
func (o *CustomerInfoResponse) SetName(v string) {
o.Name = &v
} | [
0.29105082154273987,
-0.44987261295318604,
-0.326651006937027,
-0.23902112245559692,
-1.4984190464019775,
-0.6371904611587524,
-0.3317717909812927,
-1.0575178861618042,
-0.17895616590976715,
0.4629710018634796,
-0.7527773976325989,
-0.03645404055714607,
-0.4343184232711792,
-0.118888825178... |
func (o *CustomerInfoResponse) GetEmail() string {
if o == nil || IsNil(o.Email) {
var ret string
return ret
}
return *o.Email
} | [
0.2691846191883087,
0.4343458116054535,
0.17436331510543823,
0.9685882329940796,
-0.30305081605911255,
-0.10296805948019028,
0.7231227159500122,
-0.2534252405166626,
0.45864027738571167,
-0.5153623819351196,
0.2126854956150055,
-1.2866395711898804,
-0.362013041973114,
0.27705642580986023,
... |
func (o *CustomerInfoResponse) GetEmailOk() (*string, bool) {
if o == nil || IsNil(o.Email) {
return nil, false
}
return o.Email, true
} | [
0.09805238246917725,
0.2539477050304413,
0.36893847584724426,
0.8130851984024048,
-0.3680751919746399,
-0.2631476819515228,
0.5144045352935791,
1.129498839378357,
0.598602294921875,
0.18213361501693726,
-0.7189926505088806,
-0.47137346863746643,
0.27017465233802795,
-0.15589915215969086,
... |
func (o *CustomerInfoResponse) HasEmail() bool {
if o != nil && !IsNil(o.Email) {
return true
}
return false
} | [
0.3215640187263489,
0.6812960505485535,
0.07701623439788818,
0.8256890773773193,
0.32018715143203735,
0.02478296309709549,
0.09592369198799133,
0.5853365659713745,
-0.030975762754678726,
-0.7015482187271118,
-0.22718974947929382,
-0.8947104215621948,
-0.10562104731798172,
-0.22455750405788... |
func (o *CustomerInfoResponse) SetEmail(v string) {
o.Email = &v
} | [
0.2104610949754715,
-0.35088664293289185,
-0.2943107485771179,
0.20274420082569122,
-1.2276147603988647,
-0.1564851850271225,
-0.2393556386232376,
-0.8118106722831726,
-0.20171479880809784,
-0.19277629256248474,
0.13354803621768951,
0.7979853749275208,
-0.41729792952537537,
-0.734706759452... |
func (o *CustomerInfoResponse) GetPhone() string {
if o == nil || IsNil(o.Phone) {
var ret string
return ret
}
return *o.Phone
} | [
0.5978887677192688,
0.48165997862815857,
-0.027270406484603882,
1.2271232604980469,
-0.2526867091655731,
-0.10532933473587036,
0.3451223373413086,
-0.8333020210266113,
1.0791653394699097,
-0.38731032609939575,
0.5880979299545288,
-1.8935070037841797,
-0.3689764440059662,
0.9496628642082214... |
func (o *CustomerInfoResponse) GetPhoneOk() (*string, bool) {
if o == nil || IsNil(o.Phone) {
return nil, false
}
return o.Phone, true
} | [
0.3115123510360718,
0.17874258756637573,
0.22227337956428528,
1.1710140705108643,
0.1584167629480362,
0.2258361577987671,
0.07962657511234283,
0.5953031778335571,
0.6967527866363525,
0.6346567869186401,
-0.3260871171951294,
-1.585452675819397,
-0.17685773968696594,
0.7819967269897461,
0.... |
func (o *CustomerInfoResponse) HasPhone() bool {
if o != nil && !IsNil(o.Phone) {
return true
}
return false
} | [
0.6323713064193726,
0.6851480603218079,
0.020751653239130974,
0.9652600884437561,
0.6290732622146606,
0.0550740584731102,
-0.42137396335601807,
-0.003320482559502125,
0.7694471478462219,
-0.6363776326179504,
0.2293117642402649,
-1.8705183267593384,
-0.11257891356945038,
0.47805678844451904... |
func (o *CustomerInfoResponse) SetPhone(v string) {
o.Phone = &v
} | [
0.40920349955558777,
-0.017674876376986504,
-0.3462587893009186,
0.31671836972236633,
-0.931175947189331,
-0.17351655662059784,
-0.6286442875862122,
-1.0717686414718628,
0.5903315544128418,
-0.33656495809555054,
0.4300873875617981,
-0.13055312633514404,
-0.45876890420913696,
0.077696867287... |
func (o *CustomerInfoResponse) GetCorporate() bool {
if o == nil || IsNil(o.Corporate) {
var ret bool
return ret
}
return *o.Corporate
} | [
0.43456196784973145,
0.1626385599374771,
0.4288729429244995,
1.0369951725006104,
-0.4756251573562622,
-0.1777048110961914,
-0.033055078238248825,
0.09203150868415833,
-0.2744942307472229,
-0.27692103385925293,
0.16594040393829346,
-0.8510991930961609,
-1.4893951416015625,
0.957027316093444... |
func (o *CustomerInfoResponse) GetCorporateOk() (*bool, bool) {
if o == nil || IsNil(o.Corporate) {
return nil, false
}
return o.Corporate, true
} | [
0.25921204686164856,
-0.33382710814476013,
0.5254042148590088,
1.0167771577835083,
0.14381448924541473,
0.4451286494731903,
0.6286643147468567,
0.7658005952835083,
-0.2407393902540207,
0.8330280184745789,
-0.6797157526016235,
-0.1370009034872055,
-0.4302545487880707,
1.3638023138046265,
... |
func (o *CustomerInfoResponse) HasCorporate() bool {
if o != nil && !IsNil(o.Corporate) {
return true
}
return false
} | [
1.1933660507202148,
0.049947842955589294,
0.23906874656677246,
0.608368992805481,
0.6399484276771545,
-0.5411689877510071,
-0.45567452907562256,
0.5072717666625977,
-0.48234716057777405,
-0.18606038391590118,
-0.3065968155860901,
-1.0578374862670898,
-1.0784865617752075,
1.160926103591919,... |
func (o *CustomerInfoResponse) SetCorporate(v bool) {
o.Corporate = &v
} | [
0.7369738221168518,
0.13657376170158386,
0.16322413086891174,
0.49202069640159607,
-0.6857193112373352,
-0.2402046173810959,
-0.4827004075050354,
-0.3747759759426117,
-0.9589343667030334,
0.38373079895973206,
0.5373862385749817,
0.1827133595943451,
-1.2017927169799805,
0.28181177377700806,... |
func (o *CustomerInfoResponse) GetObject() string {
if o == nil || IsNil(o.Object) {
var ret string
return ret
}
return *o.Object
} | [
0.6484184265136719,
0.05071916803717613,
0.2702391445636749,
0.6512873768806458,
-0.45988646149635315,
0.15290558338165283,
0.94162917137146,
-0.7531107664108276,
0.4261482059955597,
-0.7450365424156189,
-0.3536171019077301,
-1.5685869455337524,
0.13130202889442444,
0.049314528703689575,
... |
func (o *CustomerInfoResponse) GetObjectOk() (*string, bool) {
if o == nil || IsNil(o.Object) {
return nil, false
}
return o.Object, true
} | [
-0.06504055857658386,
-0.3876401484012604,
0.6003279089927673,
0.20646783709526062,
0.06388887017965317,
0.7898696660995483,
0.2746218144893646,
0.13775256276130676,
-0.060056548565626144,
0.7622626423835754,
-1.3140196800231934,
-1.0280563831329346,
0.31283271312713623,
-0.352442771196365... |
func (o *CustomerInfoResponse) HasObject() bool {
if o != nil && !IsNil(o.Object) {
return true
}
return false
} | [
0.6502406597137451,
0.013570433482527733,
0.2473273128271103,
0.25197529792785645,
0.23589415848255157,
0.4440020024776459,
0.17085370421409607,
0.3002511262893677,
0.09471150487661362,
-1.0212401151657104,
-1.1235495805740356,
-1.3233311176300049,
0.3163912892341614,
-0.27294909954071045,... |
func (o *CustomerInfoResponse) SetObject(v string) {
o.Object = &v
} | [
0.7899343967437744,
-0.6702406406402588,
-0.26783838868141174,
-0.7018643021583557,
-1.26353919506073,
0.39180880784988403,
0.03803528845310211,
-0.6995167136192322,
-0.16561253368854523,
-0.7018190622329712,
-0.8187831044197083,
0.27106937766075134,
0.00038213201332837343,
-0.869029641151... |
func Something(i string) string{
return "app connected" + i
} | [
-0.5321156978607178,
-0.9906048774719238,
0.5349128246307373,
-0.6989151239395142,
-0.03703991696238518,
0.8131550550460815,
-1.1754084825515747,
-0.5613799095153809,
-0.2334470897912979,
0.32047373056411743,
-0.36282774806022644,
-0.0006706223939545453,
-0.07816892862319946,
-0.8058230280... |
func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } | [
-0.3877120912075043,
0.0752408355474472,
0.438302606344223,
-0.18016588687896729,
-0.49159491062164307,
0.1980893611907959,
0.5243645906448364,
0.7386409640312195,
-0.46554917097091675,
0.12324512004852295,
-0.13936474919319153,
-0.6625957489013672,
0.8528310656547546,
0.24637335538864136,... |
func (p *PostProcessor) Configure(raws ...interface{}) error {
err := config.Decode(&p.config, &config.DecodeOpts{
PluginType: BuilderIdRegistry,
Interpolate: true,
InterpolateContext: &p.config.ctx,
InterpolateFilter: &interpolate.RenderFilter{
Exclude: []string{},
},
}, raws...)
if err ... | [
0.26053386926651,
0.4104668200016022,
0.5261874794960022,
0.6046470403671265,
-0.06008133664727211,
-0.5743013620376587,
0.04023032262921333,
0.46685683727264404,
-0.9341127872467041,
0.1657421737909317,
-0.7351886630058289,
-0.010026616044342518,
-0.6342738270759583,
0.6056550741195679,
... |
func (p *PostProcessor) PostProcess(ctx context.Context, ui packer.Ui, artifact packer.Artifact) (packer.Artifact, bool, bool, error) {
if artifact.BuilderId() != anka.BuilderId {
err := fmt.Errorf(
"unknown artifact type: %s\ncan only import from anka artifacts",
artifact.BuilderId())
return nil, false, fal... | [
0.1400633305311203,
0.14328791201114655,
0.8183359503746033,
-0.6942616701126099,
-0.3080449402332306,
0.4181591272354126,
0.36615604162216187,
0.3002193868160248,
0.17401452362537384,
1.0666919946670532,
-0.921955406665802,
0.3510857820510864,
-0.6560320854187012,
0.23879018425941467,
1... |
func New(cmdstr string, restart bool, env Environment) *ExternalCmd {
e := &ExternalCmd{
cmdstr: cmdstr,
restart: restart,
env: env,
terminate: make(chan struct{}),
done: make(chan struct{}),
}
go e.run()
return e
} | [
0.06965704262256622,
-0.4955992102622986,
0.4754406809806824,
0.05268348008394241,
-0.9577675461769104,
-0.1241048127412796,
-0.10536374896764755,
0.2684718072414398,
-0.6815149188041687,
-0.33006951212882996,
0.16307492554187775,
0.9868612885475159,
0.3298119902610779,
0.18606700003147125... |
func (e *ExternalCmd) Close() {
close(e.terminate)
<-e.done
} | [
-0.13099560141563416,
0.17258606851100922,
0.5925419926643372,
0.1393892616033554,
0.06958775967359543,
1.0579800605773926,
-0.16774627566337585,
-0.36553770303726196,
-0.866259753704071,
-0.6324090361595154,
0.10771915316581726,
0.05119786038994789,
-0.3046981990337372,
1.3485592603683472... |
func Rep(P string, SB ...string) Predicate {
if len(SB)&1 != 0 {
panic("mismatched Scalar")
}
t := make([]term, len(SB)/2)
for i := range t {
t[i].S = SB[i*2]
t[i].B = SB[i*2+1]
}
return &repPred{P, t}
} | [
-0.1251431256532669,
0.26909253001213074,
0.5520995259284973,
-0.1983886957168579,
-1.098889946937561,
0.5715868473052979,
0.19900251924991608,
0.9724949598312378,
-0.8077161908149719,
1.2031705379486084,
0.13295741379261017,
1.0137925148010254,
-0.1818883866071701,
-1.5264109373092651,
... |
func (rp *repPred) String() string {
return rp.precString(precNone)
} | [
0.854703426361084,
-0.7080433368682861,
0.34577950835227966,
-1.0687602758407593,
-0.6350387930870056,
0.6807894706726074,
0.21297013759613037,
-0.7733749747276306,
-0.009513163939118385,
0.21675227582454681,
0.3368871808052063,
0.7495023608207703,
-0.8420400619506836,
-0.7570610642433167,... |
func And(sub ...Predicate) Predicate {
and := andPred(sub)
return &and
} | [
0.2495993673801422,
-1.0006250143051147,
0.4921165108680725,
0.11681242287158966,
-1.2955021858215332,
1.392930507659912,
-0.7381064891815186,
1.179323434829712,
-0.3071150481700897,
-1.0406420230865479,
0.3357958495616913,
0.9983658790588379,
0.10477878153324127,
0.4722490608692169,
-0.... |
func (ap *andPred) String() string {
return ap.precString(precNone)
} | [
0.9372838735580444,
-1.257502794265747,
0.23792771995067596,
-0.8257301449775696,
-1.0707348585128784,
0.6831619143486023,
0.1788787543773651,
-0.6559646129608154,
0.0024352073669433594,
-0.3936675786972046,
1.125141978263855,
0.7090938091278076,
-0.13285380601882935,
0.14777523279190063,
... |
func Or(sub ...Predicate) Predicate {
or := orPred(sub)
return &or
} | [
-0.40977931022644043,
-0.17972634732723236,
0.15032659471035004,
0.2970036566257477,
-0.8551133275032043,
1.1053054332733154,
-1.1967668533325195,
0.9883894324302673,
-0.3797968029975891,
-0.737106204032898,
0.8669818043708801,
0.025354206562042236,
0.7784525752067566,
-0.49150651693344116... |
func (op *orPred) String() string {
return op.precString(precNone)
} | [
0.7711459994316101,
-0.8105835318565369,
0.287339985370636,
-0.5889397859573364,
-0.9629639387130737,
0.11623476445674896,
0.4567151367664337,
-0.6911441683769226,
-0.11138087511062622,
-0.03124157153069973,
0.9315100312232971,
0.2107924520969391,
-0.18305306136608124,
-0.7147713899612427,... |
func (op *orPred) getCommits(prf *proof, pr []abstract.Scalar) error {
sub := []Predicate(*op)
for i := range sub {
if e := sub[i].getCommits(prf, nil); e != nil {
return e
}
}
return nil
} | [
0.1359087973833084,
0.5421192049980164,
0.6344065070152283,
1.067598581314087,
0.7846893668174744,
-0.3041771948337555,
-0.1627250462770462,
0.05365927889943123,
-0.6441336870193481,
-0.13638634979724884,
0.9038688540458679,
0.6005098819732666,
-0.9331467151641846,
0.6799950003623962,
-0... |
func (prf *proof) makeScalars(pr []abstract.Scalar) []abstract.Scalar {
if pr == nil {
return make([]abstract.Scalar, prf.nsvars)
}
return pr
} | [
-0.41399407386779785,
0.4140695035457611,
0.1417384296655655,
-0.20805589854717255,
-0.24321246147155762,
0.7837318778038025,
-0.6759991645812988,
-0.280120313167572,
0.4290531575679779,
-0.08601954579353333,
-0.13636989891529083,
0.34277665615081787,
-0.1981663852930069,
1.116842985153198... |
func (prf *proof) sendResponses(pr []abstract.Scalar, r []abstract.Scalar) error {
if pr == nil {
for i := range r {
// Send responses only for variables
// that were used in this OR-domain.
if r[i] != nil {
if e := prf.pc.Put(r[i]); e != nil {
return e
}
}
}
}
return nil
} | [
-0.29802456498146057,
-0.3915095329284668,
0.2880174517631531,
-0.11749830842018127,
0.8570458889007568,
-0.6336740255355835,
0.7595103979110718,
-1.0002353191375732,
0.822307288646698,
0.23759464919567108,
0.30633869767189026,
-0.26665154099464417,
-1.0328168869018555,
0.2545478641986847,... |
func (prf *proof) getResponses(pr []abstract.Scalar, r []abstract.Scalar) error {
if pr == nil {
for i := range r {
if r[i] != nil {
if e := prf.vc.Get(r[i]); e != nil {
return e
}
}
}
}
return nil
} | [
0.38543200492858887,
-0.4505729079246521,
0.5108701586723328,
0.4136722981929779,
1.914612889289856,
-1.1427172422409058,
0.08146373927593231,
-0.5654467940330505,
0.7540791630744934,
0.35230904817581177,
0.601113498210907,
0.08274432271718979,
-1.2430052757263184,
0.23614756762981415,
0... |
func (prf *proof) prover(p Predicate, sval map[string]abstract.Scalar,
pval map[string]abstract.Point,
choice map[Predicate]int) Prover {
return Prover(func(ctx ProverContext) error {
return prf.prove(p, sval, pval, choice, ctx)
})
} | [
0.3747534155845642,
-0.47854676842689514,
0.277221143245697,
0.8463526964187622,
-1.0478121042251587,
0.6584559679031372,
-0.15244509279727936,
0.36709871888160706,
0.15896464884281158,
-0.12122910469770432,
0.7546652555465698,
-0.23430491983890533,
0.6093207597732544,
0.8988482356071472,
... |
func (prf *proof) verifier(p Predicate, pval map[string]abstract.Point) Verifier {
return Verifier(func(ctx VerifierContext) error {
return prf.verify(p, pval, ctx)
})
} | [
0.9095175862312317,
-0.45827922224998474,
0.1894090175628662,
0.6252344846725464,
0.015925798565149307,
1.2436308860778809,
-0.6582764387130737,
1.0231040716171265,
-0.4586747884750366,
-0.5210984945297241,
-0.2989616394042969,
0.4811209738254547,
0.8246996402740479,
0.8204769492149353,
... |
func NewKingdom(name string, emblem string) *kingdom {
return &kingdom{Name: name, Emblem: emblem}
} | [
0.5479992628097534,
-1.0452555418014526,
0.07978533953428268,
0.6217268705368042,
-1.3800057172775269,
-0.3765460252761841,
-0.5907991528511047,
-0.13861627876758575,
-0.25404825806617737,
-0.018488246947526932,
-0.5237447023391724,
1.1054447889328003,
0.2261127233505249,
-0.19630889594554... |
func GetKindomData(key string) kingdom {
return Kingdoms[key]
} | [
-0.009967140853404999,
-0.49552038311958313,
0.024714266881346703,
0.392585426568985,
-1.1914180517196655,
0.777217447757721,
-0.9535772204399109,
-0.4723946452140808,
-0.8256245851516724,
0.6238319277763367,
-0.5115476846694946,
1.187378168106079,
-0.10344213992357254,
-0.0839530155062675... |
func (p *TaxCalculationParams) AddExpand(f string) {
p.Expand = append(p.Expand, &f)
} | [
1.0529460906982422,
0.1849011927843094,
0.5167721509933472,
0.1203562319278717,
-0.40354177355766296,
1.1618894338607788,
-0.34323543310165405,
-0.35688725113868713,
-0.7618991732597351,
-0.765498697757721,
0.8617616295814514,
-0.4262959063053131,
0.21164537966251373,
1.0727486610412598,
... |
func (p *TaxCalculationListLineItemsParams) AddExpand(f string) {
p.Expand = append(p.Expand, &f)
} | [
0.8971870541572571,
-0.24954895675182343,
0.42655181884765625,
0.20356078445911407,
-0.16720035672187805,
0.9642848372459412,
-0.8925668597221375,
0.007909665815532207,
-0.5602343678474426,
-1.1437485218048096,
0.5210075974464417,
-0.6707993149757385,
0.2431057244539261,
0.9365906119346619... |
func NewOwnerCheckerFactory(resolver Resolver, logger logr.Logger) CheckerFactory {
return &ownerCheckerFactory{
resolver: resolver,
logger: logger,
}
} | [
-0.5016104578971863,
-1.3984588384628296,
0.29436853528022766,
0.9716308116912842,
-0.25663432478904724,
0.009164968505501747,
0.8719741106033325,
0.4907432496547699,
-0.08348642289638519,
-1.102278470993042,
-0.16260451078414917,
-0.5048360228538513,
-0.15668058395385742,
0.32184779644012... |
func (f *ownerCheckerFactory) NewChecker(ctx context.Context, c client.Client, namespace, shootName string) (Checker, error) {
ownerName, ownerID, err := extensionscontroller.GetOwnerNameAndID(ctx, c, namespace, shootName)
if err != nil {
return nil, err
}
if ownerName == "" && ownerID == "" {
return nil, nil
... | [
-0.3775077164173126,
-0.6780244708061218,
0.38435259461402893,
1.2084225416183472,
-0.33240944147109985,
0.0947350412607193,
-0.2614564299583435,
-0.5323182940483093,
0.48422205448150635,
-0.3273731470108032,
0.4624217450618744,
0.5487179756164551,
-0.07567404210567474,
1.0699414014816284,... |
func NewLoadOptions() *LoadOptions {
lo := &LoadOptions{}
lo.Depth = 1
return lo
} | [
0.2484242469072342,
-0.025883225724101067,
0.49420857429504395,
-0.13775403797626495,
-1.1058220863342285,
-0.8226093053817749,
-0.0764816403388977,
-1.2184631824493408,
0.48249778151512146,
-0.7458411455154419,
-1.3254499435424805,
0.34099408984184265,
-0.4928784966468811,
0.7101733088493... |
func NewSaveOptions() *SaveOptions {
so := &SaveOptions{}
so.Depth = 0
return so
} | [
-0.4223668575286865,
-0.058582935482263565,
0.20274223387241364,
1.1427500247955322,
0.09785117954015732,
-0.9321598410606384,
0.19533616304397583,
-0.8611346483230591,
0.07638858258724213,
0.3375268578529358,
-1.407788872718811,
-0.6124026775360107,
-0.6769402027130127,
0.9326724410057068... |
func (_m *Usecase) Create(ctx context.Context, _a1 *models.Category) error {
ret := _m.Called(ctx, _a1)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *models.Category) error); ok {
r0 = rf(ctx, _a1)
} else {
r0 = ret.Error(0)
}
return r0
} | [
-0.6062814593315125,
0.3088178038597107,
0.24661435186862946,
0.12750953435897827,
0.37578335404396057,
0.5353220701217651,
0.2559756338596344,
-0.5449815988540649,
-0.5243081450462341,
-0.32364675402641296,
-0.11726604402065277,
-0.8212523460388184,
0.4605315029621124,
0.5628389120101929,... |
func (_m *Usecase) Delete(ctx context.Context, id int64) error {
ret := _m.Called(ctx, id)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, int64) error); ok {
r0 = rf(ctx, id)
} else {
r0 = ret.Error(0)
}
return r0
} | [
-0.2152692675590515,
-0.39860212802886963,
0.5060446262359619,
0.43968459963798523,
0.13765554130077362,
0.09300462156534195,
0.0741560086607933,
0.3024570047855377,
0.9479041695594788,
-0.34659239649772644,
-0.08807636797428131,
-0.11696074903011322,
-0.6585570573806763,
-0.09298295527696... |
func (_m *Usecase) GetByID(ctx context.Context, id int64) (*models.Category, error) {
ret := _m.Called(ctx, id)
var r0 *models.Category
if rf, ok := ret.Get(0).(func(context.Context, int64) *models.Category); ok {
r0 = rf(ctx, id)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*models.Category)
}
}
v... | [
-0.433338463306427,
-0.1886717677116394,
0.36063235998153687,
0.24849244952201843,
-0.18905280530452728,
-0.42159155011177063,
0.3690761625766754,
-0.2662884294986725,
0.5005570650100708,
-0.7069607973098755,
-0.5596961975097656,
0.4762057065963745,
0.08920606225728989,
0.35523688793182373... |
func (_m *Usecase) Search(ctx context.Context, query *string, offset int64, limit int64) ([]*models.Category, int64, error) {
ret := _m.Called(ctx, query, offset, limit)
var r0 []*models.Category
if rf, ok := ret.Get(0).(func(context.Context, *string, int64, int64) []*models.Category); ok {
r0 = rf(ctx, query, of... | [
-1.1719613075256348,
0.008946488611400127,
0.5344040989875793,
-0.11362893134355545,
-0.1713581383228302,
0.6059045791625977,
0.208537295460701,
-0.1656157672405243,
-0.04353058710694313,
-0.6196417212486267,
-0.06204028055071831,
0.07274943590164185,
0.2776004374027252,
-0.405694127082824... |
func (_m *Usecase) Update(ctx context.Context, _a1 *models.Category) error {
ret := _m.Called(ctx, _a1)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *models.Category) error); ok {
r0 = rf(ctx, _a1)
} else {
r0 = ret.Error(0)
}
return r0
} | [
-0.982078492641449,
-0.2795810103416443,
0.42249464988708496,
-0.3472196161746979,
-0.10391004383563995,
0.5513198375701904,
0.39994096755981445,
-0.25877833366394043,
-0.11382745206356049,
0.1361672282218933,
-0.11647174507379532,
-0.639661431312561,
0.19722719490528107,
0.094707421958446... |
func (u User) String() string {
ju, _ := json.Marshal(u)
return string(ju)
} | [
-0.6862476468086243,
-0.4070080518722534,
0.15237456560134888,
-0.16408416628837585,
-1.2312471866607666,
0.5010250210762024,
0.5905575156211853,
-0.9889990091323853,
0.2682506740093231,
-0.4065207839012146,
-0.5160617828369141,
1.1989588737487793,
-0.13693885505199432,
-0.813064455986023,... |
func (u Users) String() string {
ju, _ := json.Marshal(u)
return string(ju)
} | [
-0.9235377907752991,
-0.47839489579200745,
0.08410900831222534,
-0.34184375405311584,
-1.0339933633804321,
0.373831570148468,
0.5098704099655151,
-0.5395776033401489,
0.2423611879348755,
-0.04953111335635185,
-0.07351841032505035,
1.4074172973632812,
-0.471589058637619,
-0.5715047717094421... |
func (u *User) Create(tx *pop.Connection) (*validate.Errors, error) {
u.Email = strings.ToLower(u.Email)
u.Username = strings.ToLower(u.Username)
verrs, err := tx.ValidateAndCreate(u)
if err != nil || verrs.HasAny() {
log.Errorf("verrs %v", verrs)
log.Errorf("errs %v", err)
return verrs, err
}
log.Info("Use... | [
-0.6381288170814514,
0.34879717230796814,
0.9097890853881836,
0.20270487666130066,
0.6113119125366211,
0.9058037996292114,
-0.1380905658006668,
-0.4162277579307556,
-0.06644873321056366,
0.3156938850879669,
-0.2559760510921478,
-0.004038963001221418,
-0.30326077342033386,
0.361561775207519... |
func (u *User) Update(tx *pop.Connection) (*validate.Errors, error) {
u.Email = strings.ToLower(u.Email)
// TODO add ldap chpw functionality
return tx.ValidateAndUpdate(u)
} | [
-0.12831206619739532,
-0.6347444653511047,
0.33554431796073914,
-0.0415385402739048,
-0.5115149617195129,
0.5524126291275024,
-0.39881259202957153,
0.15684999525547028,
0.3434433043003082,
0.19215551018714905,
-0.15287645161151886,
0.15468865633010864,
-0.7159920334815979,
-1.0221451520919... |
func (u *User) Validate(tx *pop.Connection) (*validate.Errors, error) {
return validate.Validate(
&validators.RegexMatch{Name: "Username", Field: u.Username, Expr: "[a-zA-Z]+"},
&validators.StringLengthInRange{Name: "Username", Field: u.Username, Min: 6, Max: 64},
&validators.StringIsPresent{Field: u.Email, Name... | [
-0.1492210477590561,
0.012495285831391811,
0.6620373129844666,
0.18940980732440948,
-0.24862363934516907,
0.13245272636413574,
-0.15408124029636383,
-0.01801753044128418,
-0.2800130546092987,
-0.14778509736061096,
-0.8225852847099304,
-0.5712748765945435,
-0.3108924329280853,
-0.0183576717... |
func (u *User) ValidateCreate(tx *pop.Connection) (*validate.Errors, error) {
return validate.Validate(
&NotTaken{Name: "Email", Field: u.Email, tx: tx},
&NotTaken{Name: "Username", Field: u.Username, tx: tx},
), nil
} | [
-0.01959015615284443,
0.7285211682319641,
0.40708646178245544,
0.4112441837787628,
0.13422618806362152,
0.8721469640731812,
0.05651500076055527,
-0.583394467830658,
-1.5032068490982056,
0.02491004392504692,
-0.19126051664352417,
-0.8882231116294861,
-0.5836243629455566,
-0.0570334084331989... |
func (u *User) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error) {
return validate.NewErrors(), nil
} | [
-0.5913129448890686,
-0.5985732674598694,
0.4709552824497223,
1.098763346672058,
-0.4696919918060303,
0.2962234318256378,
-0.36401641368865967,
-0.5954963564872742,
-0.06874456256628036,
0.3218293786048889,
0.18791422247886658,
-0.8567585349082947,
-0.7905345559120178,
0.22502045333385468,... |
func (u *User) Authenticate(tx *pop.Connection) error {
log.Info("Authenticating " + u.Username)
if err := u.Load(tx); err != nil {
return err
}
ldap := ldap.Client{}
if err := ldap.Connect(); err != nil {
return err
}
err := ldap.Authenticate(u.Username, u.Password)
if err != nil {
return err
}
return... | [
-0.47191134095191956,
0.37216290831565857,
0.5229548811912537,
0.33143287897109985,
0.3532645106315613,
-0.2796367108821869,
-0.3566438853740692,
-0.07980609685182571,
0.18863196671009064,
0.7088598608970642,
-0.6640282869338989,
0.0144082335755229,
-0.17997194826602936,
-0.556266188621521... |
func (u *User) SendResetToken(tx *pop.Connection) error {
if err := u.Load(tx); err != nil {
return err
}
// set reset token
log.Info("Setting reset token for " + u.Email)
token, err := uuid.NewV4()
if err == nil {
// save token to user in db
u.ResetToken = token
tx.Update(u)
}
// TODO email token to ... | [
-0.8408318758010864,
-0.0034611858427524567,
0.3986338973045349,
0.16373729705810547,
0.2957395315170288,
-0.4087633192539215,
0.1796978861093521,
0.4863537847995758,
-0.38802921772003174,
0.8707327246665955,
-1.7039620876312256,
0.5325305461883545,
-0.03347962722182274,
-0.937687397003173... |
func (u *User) ChangePassword(tx *pop.Connection) (*validate.Errors, error) {
// find user by email
query := tx.Where("email = ?", u.Email)
queryUser := User{}
err := query.First(&queryUser)
if err != nil {
return nil, errors.New("User not found")
}
log.Infof("%s == %s\n", u.ResetTokenConfirm, queryUser.ResetT... | [
0.1513487696647644,
0.14505039155483246,
0.5527608394622803,
0.47867465019226074,
0.1977599710226059,
-0.08941833674907684,
0.007477649953216314,
0.1781071424484253,
-0.2939304709434509,
1.293743371963501,
-0.11134108901023865,
0.6059683561325073,
-0.3904791474342346,
-0.34524625539779663,... |
func ClearCache(urlstr []byte, p IPage) {
if DisablePageCache {
return
}
u, err := url.Parse(util.Bytes2Str(urlstr))
if err != nil {
panic(err)
}
attr := p.Attr()
var src []byte
switch attr.CacheOption.PageMode {
case CacheModePage:
src = util.Str2Bytes(attr.Dir + attr.Name)
case CacheModePageURI:
... | [
-0.45300742983818054,
-0.03635448217391968,
0.6573154926300049,
0.062248870730400085,
-0.7640193700790405,
0.43349772691726685,
0.2012249231338501,
0.6506944298744202,
0.43967747688293457,
0.8748393654823303,
0.9109475016593933,
-0.1529345065355301,
-0.22764496505260468,
0.0359759740531444... |
func TryCache(ctx *fasthttp.RequestCtx, p IPage) bool {
if DisablePageCache {
return false
}
attr := p.Attr()
var src []byte
var last string
switch attr.CacheOption.Store {
case CacheStoreNone:
return false
case CacheStoreMem:
key := pageCachedKey(ctx, attr)
v, isFound := pageCacheMap.Load(key)
if... | [
-0.8696812391281128,
-0.12096887826919556,
1.0301973819732666,
0.07998087257146835,
-0.4187767803668976,
0.06197330728173256,
-0.09078748524188995,
0.037502989172935486,
0.09831663966178894,
0.5086720585823059,
0.7747414112091064,
-0.6611995697021484,
-0.6875827312469482,
0.449278980493545... |
func tryStaticHTML(ctx *fasthttp.RequestCtx, p IPage) error {
if !p.Attr().CacheOption.IsStaticHTML {
return nil
}
filename := util.Bytes2Str(ctx.RequestURI())
l := len(filename)
if l < 1 {
return nil
}
if filename[l-1] == '/' {
filename += "index.html"
} else {
filename += ".html"
}
file, err := o... | [
-0.7080270051956177,
0.38552325963974,
0.6381489038467407,
1.1483137607574463,
-0.11808805167675018,
0.23867879807949066,
0.5765092968940735,
-0.5661934614181519,
-0.4690830111503601,
0.33747637271881104,
0.3863585889339447,
0.06430764496326447,
-0.5231691598892212,
0.2534335255622864,
-... |
func RunCommand(cmdStr string) error {
cmd := exec.Command("bash", "-c", cmdStr)
log.Printf("bash -c %s", cmdStr)
if err := cmd.Start(); err != nil {
return err
}
return cmd.Wait()
} | [
0.06907422095537186,
0.036723289638757706,
0.8958680629730225,
0.07572931051254272,
-0.5511308908462524,
1.0023986101150513,
0.030259456485509872,
0.5508110523223877,
-0.17095984518527985,
-1.121405005455017,
-0.029504215344786644,
0.6458379030227661,
0.30103686451911926,
0.184931948781013... |
func (lv *LazyValue) Ready() bool {
lv.Lock()
defer lv.Unlock()
return lv.ready
} | [
-0.15703244507312775,
0.04349756985902786,
0.48171547055244446,
-0.639277994632721,
-0.6251805424690247,
0.3183932304382324,
-0.3145584762096405,
0.4070238471031189,
-0.16896551847457886,
-0.10976283997297287,
-0.7607691287994385,
0.8559231162071228,
0.12117432057857513,
0.5896785855293274... |
func (lv *LazyValue) Read() (core.Value, error) {
lv.Lock()
defer lv.Unlock()
if !lv.ready {
lv.load()
}
return lv.value, lv.err
} | [
-0.30962371826171875,
-0.32059183716773987,
0.5337162017822266,
-0.8912390470504761,
-0.656470000743866,
0.4359017312526703,
-0.355955570936203,
-0.38429808616638184,
0.1347903162240982,
-0.34588733315467834,
0.2803186774253845,
1.1359275579452515,
-0.1678103804588318,
0.6991901397705078,
... |
func (lv *LazyValue) Write(writer func(v core.Value, err error)) {
lv.Lock()
defer lv.Unlock()
if !lv.ready {
lv.load()
}
writer(lv.value, lv.err)
} | [
-0.8705689907073975,
0.2916487753391266,
0.3030036389827728,
-0.48157456517219543,
0.4219369888305664,
-0.02691848948597908,
0.4203275740146637,
0.39280131459236145,
0.02849205769598484,
-0.14777886867523193,
-0.538341760635376,
0.1335921436548233,
0.4550461769104004,
1.1971344947814941,
... |
func (lv *LazyValue) Reset() {
lv.Lock()
defer lv.Unlock()
lv.ready = false
lv.value = values.None
lv.err = nil
} | [
-0.02525678463280201,
-0.11663281917572021,
-0.0008453201153315604,
-0.9669507145881653,
0.47141754627227783,
-0.27631857991218567,
-0.0060931844636797905,
-0.09190969169139862,
-0.43289148807525635,
-0.46691399812698364,
-0.5468899607658386,
1.4731419086456299,
0.21094268560409546,
0.4977... |
func (hs host) HostRouting(ctx *raptor.Context) error {
// Check if a http.Handler is registered for the given host.
// If yes, use it to handle the request.
if cb := hosts[string(ctx.Host())]; cb != nil {
return cb(ctx)
}
return ctx.Response().Forbidden(fmt.Errorf("not able to access"))
} | [
-0.595548689365387,
0.6445490717887878,
0.7105626463890076,
0.51545649766922,
0.01965571939945221,
-0.09520882368087769,
0.5090429782867432,
0.09350195527076721,
-0.5420723557472229,
0.13447757065296173,
0.3345455229282379,
-0.15491776168346405,
0.014410377480089664,
-0.24566896259784698,
... |
func Subscribe(subscription *pubsub.Subscription) {
ctx := context.Background()
bufCh := make(chan TaxiData, bufferCount)
go batchWriter(bufCh)
err := subscription.Receive(ctx, func(ctx context.Context, msg *pubsub.Message) {
var data TaxiData
var err error
if err = json.Unmarshal(msg.Data, &data); err != ni... | [
1.431296706199646,
0.3673213720321655,
0.6803514957427979,
-0.22295738756656647,
0.15531425178050995,
-0.1866786628961563,
-1.07403564453125,
-0.588681161403656,
-1.1773325204849243,
-0.7929391264915466,
-0.5352985858917236,
0.9286158680915833,
-0.14341284334659576,
-0.22219577431678772,
... |
func (m *Offload) UnmarshalJSON(raw []byte) error {
// AO0
var aO0 OffloadPost
if err := swag.ReadJSON(raw, &aO0); err != nil {
return err
}
m.OffloadPost = aO0
// AO1
var aO1 ResourceNoID
if err := swag.ReadJSON(raw, &aO1); err != nil {
return err
}
m.ResourceNoID = aO1
// AO2
var aO2 OffloadOAIGenAl... | [
-0.42245787382125854,
-0.03384280577301979,
0.764640748500824,
-1.414878249168396,
-0.9409987330436707,
-0.21001310646533966,
0.4782450497150421,
-0.4968564808368683,
-0.37821540236473083,
0.16267697513103485,
0.06743981689214706,
-0.1764610856771469,
-0.09021144360303879,
0.78106087446212... |
func (m Offload) MarshalJSON() ([]byte, error) {
_parts := make([][]byte, 0, 3)
aO0, err := swag.WriteJSON(m.OffloadPost)
if err != nil {
return nil, err
}
_parts = append(_parts, aO0)
aO1, err := swag.WriteJSON(m.ResourceNoID)
if err != nil {
return nil, err
}
_parts = append(_parts, aO1)
aO2, err := ... | [
0.08595883846282959,
-0.40520185232162476,
0.5385303497314453,
-0.47151485085487366,
-0.6602683663368225,
-0.2167157679796219,
0.09692434221506119,
-0.37202751636505127,
-0.32207563519477844,
0.25382187962532043,
-0.04059239849448204,
0.734685480594635,
-0.4673314690589905,
0.9733301401138... |
func (m *Offload) Validate(formats strfmt.Registry) error {
var res []error
// validation for a type composition with OffloadPost
if err := m.OffloadPost.Validate(formats); err != nil {
res = append(res, err)
}
// validation for a type composition with ResourceNoID
if err := m.ResourceNoID.Validate(formats); e... | [
-0.34707197546958923,
-0.2352253645658493,
0.6059091687202454,
-0.5566872358322144,
0.008192925713956356,
0.022148218005895615,
0.5506387948989868,
-1.3135024309158325,
-0.7856853008270264,
-0.11221299320459366,
1.0279597043991089,
-0.06817324459552765,
-1.0976611375808716,
1.0638250112533... |
func (v AnnotationValue) AsInt() int64 {
return v.Value.(int64)
} | [
-0.36500388383865356,
-0.3621346652507782,
0.050313979387283325,
-0.3880886435508728,
-0.9939191937446594,
0.08281712234020233,
0.25152021646499634,
-0.8298790454864502,
-0.43974506855010986,
0.5174797773361206,
0.5459208488464355,
0.09635472297668457,
0.34975185990333557,
0.22500860691070... |
func (v AnnotationValue) AsUint() uint64 {
return v.Value.(uint64)
} | [
-0.5793902277946472,
-0.5669174194335938,
0.47441014647483826,
-0.6992670893669128,
-0.5743861198425293,
0.0299011692404747,
-0.0174421314150095,
-0.22908075153827667,
0.6058341264724731,
-0.17609131336212158,
0.1857399344444275,
0.4542712867259979,
0.9879618287086487,
0.2049190253019333,
... |
func (v AnnotationValue) AsFloat() float64 {
return v.Value.(float64)
} | [
0.3270472586154938,
0.11826310306787491,
0.1852368414402008,
-0.11895192414522171,
-0.24615029990673065,
-0.10206533223390579,
0.3262289762496948,
-0.5867555141448975,
0.23403243720531464,
-0.14567957818508148,
0.5373311042785645,
0.21787038445472717,
0.4976106584072113,
1.0615544319152832... |
func (v AnnotationValue) AsComplex() complex128 {
return v.Value.(complex128)
} | [
-0.48351696133613586,
-0.6869608759880066,
0.2595781683921814,
0.22601281106472015,
-0.5297061204910278,
0.3251607120037079,
0.5469327569007874,
-1.064096212387085,
0.6261491179466248,
0.16842414438724518,
0.370225191116333,
0.2768575847148895,
0.5394197106361389,
0.15128593146800995,
-0... |
func (v AnnotationValue) AsString() string {
return v.Value.(string)
} | [
-0.6912516355514526,
-0.6975316405296326,
0.0898209735751152,
-0.3781183958053589,
-0.5496321320533752,
0.9054293632507324,
0.45260900259017944,
-0.6926054358482361,
0.202483668923378,
0.8493799567222595,
0.5830812454223633,
0.6145152449607849,
0.8770895600318909,
0.1719789355993271,
-0.... |
func (v AnnotationValue) AsBool() bool {
return v.Value.(bool)
} | [
-0.29278239607810974,
-0.18404310941696167,
0.25095438957214355,
0.4224880337715149,
-0.48637843132019043,
0.8053749799728394,
0.18707524240016937,
-0.11243300139904022,
0.26565659046173096,
1.4225929975509644,
0.1090708076953888,
0.18536673486232758,
0.9838412404060364,
0.0376867428421974... |
func (v AnnotationValue) AsFunc() *types.Func {
return v.Value.(*types.Func)
} | [
0.10017430782318115,
0.03150106966495514,
0.1502397507429123,
0.27463439106941223,
-0.5318836569786072,
-0.346327006816864,
1.122314691543579,
-0.682503342628479,
0.3385428488254547,
0.18923255801200867,
0.48452460765838623,
1.284973382949829,
1.4760324954986572,
0.37702834606170654,
-0.... |
func (v AnnotationValue) AsSlice() []AnnotationValue {
return v.Value.([]AnnotationValue)
} | [
-0.6686228513717651,
-0.8972911238670349,
0.197662353515625,
0.09414548426866531,
-0.05306323245167732,
-0.21459829807281494,
-0.5370169878005981,
-0.10625297576189041,
-0.15732020139694214,
0.9947933554649353,
-0.1950574815273285,
1.1718108654022217,
0.6431337594985962,
0.7445434927940369... |
func (v AnnotationValue) AsMap() []AnnotationMapEntry {
return v.Value.([]AnnotationMapEntry)
} | [
-0.4962814450263977,
-0.6995480060577393,
0.3067200183868408,
0.49678274989128113,
-0.3292546272277832,
0.5816344618797302,
0.37053295969963074,
-0.4638749063014984,
0.9935404062271118,
0.91998690366745,
0.08987972885370255,
0.41456079483032227,
1.0939453840255737,
0.8219264149665833,
-0... |
func (v AnnotationValue) AsStruct() []AnnotationStructEntry {
return v.Value.([]AnnotationStructEntry)
} | [
-0.19327783584594727,
-0.7301484942436218,
0.20281077921390533,
-0.38472333550453186,
-0.25034600496292114,
-0.04350591450929642,
0.025069084018468857,
-0.46500250697135925,
0.4863666594028473,
0.10348182171583176,
-0.15188279747962952,
0.6609674096107483,
0.6470881700515747,
0.80750674009... |
func (e *AnnotatedElement) IsElementType(et annogo.ElementType) bool {
for _, e := range e.ApplicableTypes {
if e == et {
return true
}
}
return false
} | [
-1.0798077583312988,
-0.08747630566358566,
0.38885554671287537,
0.6223931312561035,
-0.43406856060028076,
0.6022526621818542,
0.029896022751927376,
0.13379916548728943,
1.5323723554611206,
1.07565438747406,
0.03044430911540985,
0.05225362256169319,
0.05645895376801491,
1.672914981842041,
... |
func (e *AnnotatedElement) GetDeclaringFilename() string {
p := e.Context.Program.Fset.Position(e.File.Package)
return p.Filename
} | [
0.5495851039886475,
0.13805344700813293,
0.7895550727844238,
0.5978069305419922,
-0.005280564539134502,
0.7103099822998047,
0.6980816721916199,
1.601969599723816,
-0.5297116637229919,
-0.223822221159935,
0.6741422414779663,
-0.16715970635414124,
0.437858521938324,
0.606194019317627,
0.22... |
func (e *AnnotatedElement) FindAnnotations(packagePath, name string) []AnnotationMirror {
return findAnnotations(e.Annotations, packagePath, name)
} | [
-0.28311219811439514,
0.2939612865447998,
0.40141284465789795,
0.23815922439098358,
-0.1129504144191742,
-0.3258884847164154,
0.16971328854560852,
-0.59676593542099,
0.3846592307090759,
0.8327325582504272,
-0.5628082156181335,
-0.3603324890136719,
-0.530277669429779,
1.5390193462371826,
... |
func unixPath(s string) string {
s = filepath.Clean(s)
s = strings.Replace(s, "\\", "/", -1)
// Duplicate clean for trailing slashes that were previously windows ones.
return filepath.Clean(s)
} | [
0.8711769580841064,
-0.6822608113288879,
0.33935287594795227,
0.32090523838996887,
-0.5831223726272583,
-0.30857470631599426,
0.9971666932106018,
0.7575811147689819,
-0.07226546108722687,
0.5783094763755798,
0.2579532861709595,
-0.010113331489264965,
0.04726720601320267,
-0.261090606451034... |
func stripExt(s string) string {
ext := filepath.Ext(s)
if len(ext) > 0 {
return s[:len(s)-len(ext)]
}
return s
} | [
0.20974206924438477,
0.05685983598232269,
0.619584321975708,
-0.681962251663208,
-0.9739492535591125,
0.8891763091087341,
-0.5711548328399658,
-0.04968719556927681,
1.0727348327636719,
0.8300999402999878,
0.0596129409968853,
0.9914460778236389,
-0.2754867374897003,
-0.8819193840026855,
0... |
func slug(s string) string {
s = strings.ToLower(s)
fields := strings.FieldsFunc(s, func(c rune) bool {
return !unicode.IsLetter(c)
})
return strings.Join(fields, "-")
} | [
0.5800612568855286,
0.07335121929645538,
0.4886540472507477,
-1.198319673538208,
-0.521332859992981,
0.5864224433898926,
-0.11545997112989426,
0.6614423394203186,
-0.3218136429786682,
-0.7288914322853088,
-0.5001875758171082,
0.28436511754989624,
-0.029321158304810524,
-1.2101359367370605,... |
func comments(c string) []string {
var (
scanner = bufio.NewScanner(bytes.NewBufferString(c))
segments []string
s []byte
)
for scanner.Scan() {
text := scanner.Text()
if len(s) > 0 && len(strings.TrimSpace(text)) == 0 {
// Blank line, we begin a new segment.
segments = append(segments, string... | [
-0.07069507241249084,
-0.7507129907608032,
0.7816630601882935,
-1.126535177230835,
0.19305424392223358,
-0.4391830265522003,
0.27907517552375793,
-0.4675046503543854,
0.24812012910842896,
0.09204477816820145,
-0.06198570132255554,
-0.31683048605918884,
-0.3850657045841217,
0.26403805613517... |
func (f *tmplFuncs) funcMap() template.FuncMap {
return map[string]interface{}{
"cleanLabel": f.cleanLabel,
"cleanType": f.cleanType,
"fieldType": f.fieldType,
"dict": f.dict,
"ext": filepath.Ext,
"dir": func(s string) string {
dir, _ := path.Split(s)
return dir
},
"trimExt": ... | [
-0.6661419868469238,
-0.7859598994255066,
0.6181645393371582,
-1.1131675243377686,
0.15651990473270416,
-0.7569026947021484,
0.7203065752983093,
0.8462828397750854,
0.08494250476360321,
-0.23196536302566528,
-0.5147309303283691,
-0.2713194191455841,
0.8654896020889282,
0.5833987593650818,
... |
func (f *tmplFuncs) cleanLabel(l *descriptor.FieldDescriptorProto_Label) string {
switch int32(*l) {
case 1:
return "optional"
case 2:
return "required"
case 3:
return "repeated"
default:
panic("unknown label")
}
} | [
-0.585460901260376,
-0.12823811173439026,
0.34539633989334106,
-0.6927734017372131,
-0.191961869597435,
1.1056851148605347,
-0.02083260752260685,
0.3209979236125946,
-0.15093067288398743,
1.1879761219024658,
0.06123778596520424,
-0.45551857352256775,
0.22008413076400757,
0.0565239377319812... |
func (f *tmplFuncs) cleanType(path string) string {
split := strings.Split(path, ".")
return split[len(split)-1]
} | [
-0.6406993865966797,
-0.08012820035219193,
0.7843453884124756,
-0.06674958020448685,
0.17952699959278107,
-0.15869246423244476,
1.0046696662902832,
-0.3850540220737457,
0.10514860600233078,
0.9476999640464783,
-0.05395786091685295,
-0.022644080221652985,
-0.7183173298835754,
-0.15290179848... |
func (f *tmplFuncs) fieldType(field *descriptor.FieldDescriptorProto) string {
if field.TypeName != nil {
return f.cleanType(*field.TypeName)
}
return util.FieldTypeName(field.Type)
} | [
0.2786442041397095,
0.5429425239562988,
0.28170764446258545,
-0.8910267353057861,
0.5840181708335876,
-0.27524060010910034,
0.42534324526786804,
0.06341370940208435,
-0.11050651222467422,
0.38315272331237793,
-0.04881127178668976,
-0.06276645511388779,
0.19037015736103058,
1.16690063476562... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.