text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func NewDeleteUserUnauthorized() *DeleteUserUnauthorized {
return &DeleteUserUnauthorized{}
} | [
-1.0792583227157593,
-0.8461976647377014,
0.03560219332575798,
0.7864894270896912,
-0.9541247487068176,
-0.768978476524353,
0.012617193162441254,
1.0772629976272583,
-0.1297522485256195,
-1.2323672771453857,
0.012523352168500423,
1.1550421714782715,
0.14512766897678375,
-0.3391308188438415... |
func NewDeleteUserForbidden() *DeleteUserForbidden {
return &DeleteUserForbidden{}
} | [
0.24965758621692657,
0.08875151723623276,
-0.17035500705242157,
1.5704413652420044,
-0.882526695728302,
-0.42141836881637573,
0.33300521969795227,
-0.26361697912216187,
-0.242616206407547,
-0.6312868595123291,
-0.2803071439266205,
0.5920417904853821,
0.05844409018754959,
-0.719091713428497... |
func NewDeleteUserNotFound() *DeleteUserNotFound {
return &DeleteUserNotFound{}
} | [
-0.5596492886543274,
-1.6250163316726685,
-0.4755810797214508,
0.4844193756580353,
-0.19791652262210846,
0.16870860755443573,
0.730103075504303,
0.3266170024871826,
0.31185832619667053,
-0.19272901117801666,
0.06165585294365883,
-0.13224470615386963,
0.19330433011054993,
0.0847577378153801... |
func (nt *NullTime) Scan(value interface{}) error {
nt.Time, nt.Valid = value.(time.Time)
return nil
} | [
-0.467456191778183,
0.6224959492683411,
0.2979077696800232,
0.19058391451835632,
-0.580902636051178,
0.09913717210292816,
-0.6707810163497925,
-0.8224779963493347,
0.5776321887969971,
-0.4213394522666931,
-0.7569810152053833,
0.282760888338089,
-0.026176178827881813,
1.2906932830810547,
... |
func (nt NullTime) Value() (driver.Value, error) {
if !nt.Valid {
return nil, nil
}
return nt.Time, nil
} | [
-0.28743788599967957,
0.0430590994656086,
0.36119475960731506,
0.39270490407943726,
0.46143782138824463,
-0.12073743343353271,
-0.42403626441955566,
-0.8448001146316528,
1.0573488473892212,
0.783689558506012,
0.3471713662147522,
-0.03427713364362717,
-0.4435959458351135,
0.9492265582084656... |
func NewForest(r io.Reader) (Forest, error) {
csvr := csv.NewReader(r)
records, err := csvr.ReadAll()
if err != nil {
return Forest{}, fmt.Errorf("unable to read layout to generate forest")
}
forest := Forest{}
trees := make(map[Location]struct{})
for i, rec := range records {
row := strings.TrimSpace(rec[0]... | [
0.2390356957912445,
-0.8598987460136414,
0.4322691559791565,
-0.21931424736976624,
-1.166397213935852,
-0.733235239982605,
0.2412571907043457,
-0.45023155212402344,
0.2088330239057541,
-0.5321377515792847,
0.17828825116157532,
-0.252352774143219,
0.13298361003398895,
-0.026488160714507103,... |
func (f Forest) CountTrees(s Slope) int {
location := TopLeft
result := 0
for f.IsLocationInsideForest(location) {
if f.IsTreeInLocation(location) {
result++
}
location = f.Relocate(location, s)
}
return result
} | [
0.14315782487392426,
0.0953299030661583,
0.5879055857658386,
0.2056836634874344,
0.16498731076717377,
-0.6942047476768494,
0.6314565539360046,
0.5747108459472656,
-0.35373273491859436,
0.1924019157886505,
-0.6020470261573792,
-0.7739603519439697,
-0.23705676198005676,
0.7011338472366333,
... |
func (f Forest) IsLocationInsideForest(location Location) bool {
if location.Y > f.Height-1 {
return false
}
return true
} | [
-0.7342159152030945,
-0.21692784130573273,
0.4805203080177307,
0.7304260730743408,
-0.46861732006073,
0.16885033249855042,
0.4103831946849823,
0.13161224126815796,
-0.10097173601388931,
-0.6802065968513489,
-0.23954690992832184,
-0.35900214314460754,
-0.6949747800827026,
0.2458000183105468... |
func (f Forest) IsTreeInLocation(location Location) bool {
_, treeInLocation := f.Trees[location]
return treeInLocation
} | [
-0.5063694715499878,
-0.7326821088790894,
0.3760928213596344,
-0.41671085357666016,
0.12811556458473206,
-0.34772881865501404,
-0.49907007813453674,
1.1539980173110962,
-0.1065109446644783,
0.7086626291275024,
-0.6524299383163452,
-0.1287527084350586,
-0.6657965779304504,
0.353208094835281... |
func (f Forest) Relocate(location Location, s Slope) Location {
newX := location.X + s.Right
newY := location.Y + s.Down
// wrap around X
if newX > f.Width-1 {
newX = newX - f.Width
}
return Location{X: newX, Y: newY}
} | [
-0.2631863057613373,
-0.1388726681470871,
0.6059893369674683,
0.3279848098754883,
-0.30173954367637634,
-0.463206946849823,
0.08192266523838043,
-0.35799163579940796,
0.20927166938781738,
-0.5755784511566162,
0.16166284680366516,
-0.44042423367500305,
-0.1772301346063614,
-1.01611649990081... |
func (Policy_GlobalPolicyEvaluationMode) EnumDescriptor() ([]byte, []int) {
return file_google_cloud_binaryauthorization_v1_resources_proto_rawDescGZIP(), []int{0, 0}
} | [
0.4326286017894745,
0.23524820804595947,
0.44493699073791504,
0.11890740692615509,
0.6055799126625061,
1.102730393409729,
0.033345308154821396,
0.14153119921684265,
-0.34514129161834717,
0.31930503249168396,
-0.8638204336166382,
0.670129656791687,
-0.4611085057258606,
0.8485001921653748,
... |
func (AdmissionRule_EvaluationMode) EnumDescriptor() ([]byte, []int) {
return file_google_cloud_binaryauthorization_v1_resources_proto_rawDescGZIP(), []int{2, 0}
} | [
-0.09109602123498917,
0.5312451720237732,
0.4025611877441406,
-1.0394364595413208,
0.3446464538574219,
0.5484868884086609,
-0.41986605525016785,
0.7892710566520691,
-0.9714301824569702,
0.9079980850219727,
0.31853413581848145,
0.024527736008167267,
-0.18728969991207123,
0.6035169959068298,... |
func (AdmissionRule_EnforcementMode) EnumDescriptor() ([]byte, []int) {
return file_google_cloud_binaryauthorization_v1_resources_proto_rawDescGZIP(), []int{2, 1}
} | [
0.30451124906539917,
0.21336629986763,
0.38349801301956177,
-0.3358252942562103,
0.709869384765625,
0.2631533741950989,
0.49173298478126526,
0.775157630443573,
-1.2078101634979248,
0.5142297744750977,
0.5079037547111511,
0.12374599277973175,
0.033268287777900696,
1.4221683740615845,
1.46... |
func (PkixPublicKey_SignatureAlgorithm) EnumDescriptor() ([]byte, []int) {
return file_google_cloud_binaryauthorization_v1_resources_proto_rawDescGZIP(), []int{5, 0}
} | [
-0.08197446912527084,
0.5476037263870239,
0.39197808504104614,
0.6264728903770447,
-0.6753286123275757,
-0.2130839228630066,
-0.17085182666778564,
0.5876973271369934,
-0.07333988696336746,
-0.05505593121051788,
-0.9734189510345459,
-0.524413526058197,
-0.14919278025627136,
0.64009475708007... |
func (*Policy) Descriptor() ([]byte, []int) {
return file_google_cloud_binaryauthorization_v1_resources_proto_rawDescGZIP(), []int{0}
} | [
-0.35455745458602905,
0.5361399054527283,
0.30729401111602783,
0.37667009234428406,
0.17166651785373688,
0.5047987699508667,
0.30133840441703796,
0.3497826159000397,
0.0882120281457901,
-1.0062460899353027,
-0.3319697082042694,
-0.45904290676116943,
-0.16200339794158936,
0.7687433958053589... |
func (*AdmissionWhitelistPattern) Descriptor() ([]byte, []int) {
return file_google_cloud_binaryauthorization_v1_resources_proto_rawDescGZIP(), []int{1}
} | [
-0.7123721837997437,
0.15147359669208527,
0.3078024685382843,
-1.3452033996582031,
0.087090402841568,
-0.17798545956611633,
0.5717718005180359,
0.3250696659088135,
0.13580620288848877,
0.2781577408313751,
-0.47823816537857056,
0.8141036033630371,
0.023981638252735138,
1.3633582592010498,
... |
func (*AdmissionRule) Descriptor() ([]byte, []int) {
return file_google_cloud_binaryauthorization_v1_resources_proto_rawDescGZIP(), []int{2}
} | [
0.21602091193199158,
0.6556966304779053,
0.34635129570961,
-0.4718320667743683,
0.11097146570682526,
0.44452959299087524,
0.13569018244743347,
0.927661120891571,
-1.4218217134475708,
-0.1730273962020874,
0.40738508105278015,
0.6375122666358948,
-0.5966591835021973,
1.2146137952804565,
1.... |
func (*Attestor) Descriptor() ([]byte, []int) {
return file_google_cloud_binaryauthorization_v1_resources_proto_rawDescGZIP(), []int{3}
} | [
-0.2766381800174713,
0.10071759670972824,
0.4738437235355377,
-0.2511701285839081,
-0.5933420658111572,
-0.32971835136413574,
0.7740949392318726,
0.6474685668945312,
-0.2120538204908371,
-0.2655848264694214,
-0.6450557708740234,
0.0032595889642834663,
-0.11037226021289825,
-0.1479006856679... |
func (*UserOwnedGrafeasNote) Descriptor() ([]byte, []int) {
return file_google_cloud_binaryauthorization_v1_resources_proto_rawDescGZIP(), []int{4}
} | [
0.7785539627075195,
0.3493369221687317,
0.05597615987062454,
0.25526127219200134,
0.7898202538490295,
-0.11121948063373566,
0.7273597717285156,
-0.5627744197845459,
-1.0689557790756226,
-0.4303814470767975,
-0.09171190112829208,
0.3998706042766571,
0.3449966609477997,
1.1222783327102661,
... |
func (*PkixPublicKey) Descriptor() ([]byte, []int) {
return file_google_cloud_binaryauthorization_v1_resources_proto_rawDescGZIP(), []int{5}
} | [
-0.14105801284313202,
0.7514790892601013,
0.08668041974306107,
0.3982880413532257,
-0.38678687810897827,
0.11872531473636627,
-0.5166259407997131,
-0.14744114875793457,
-0.8358944058418274,
-0.22549323737621307,
-0.3962259590625763,
-0.2791033089160919,
-0.3999016284942627,
0.6134392619132... |
func (*AttestorPublicKey) Descriptor() ([]byte, []int) {
return file_google_cloud_binaryauthorization_v1_resources_proto_rawDescGZIP(), []int{6}
} | [
0.19108611345291138,
-0.056160569190979004,
0.08266060054302216,
-0.4045201539993286,
0.04136522859334946,
-0.4194035232067108,
0.1748712807893753,
0.29303377866744995,
-0.44526708126068115,
0.4952254593372345,
-0.027585791423916817,
0.5952853560447693,
0.29449811577796936,
0.7113761305809... |
func NewCarIO() pieceio.CarIO {
return &carIO{}
} | [
1.0151643753051758,
-0.9367616772651672,
-0.08482468873262405,
0.8846050500869751,
-1.4744058847427368,
0.2402842491865158,
-0.4589499533176422,
-0.48050180077552795,
-1.4076271057128906,
-0.518849790096283,
-1.2395869493484497,
0.6392468214035034,
-0.007578557822853327,
0.3389602303504944... |
func NewDeadMock(id string) provider.Provider {
return &deadMock{id: id}
} | [
-1.1105787754058838,
0.1715872883796692,
-0.023044155910611153,
0.410752534866333,
-0.21777214109897614,
0.7398321032524109,
-0.687958836555481,
0.5335384011268616,
0.5718530416488647,
-0.12713369727134705,
-0.1785106658935547,
0.45510128140449524,
0.008444270119071007,
-0.4372597932815552... |
func Tabla(valor int) func() int {
numero := valor //la primera ejecucion va a ejecutar linea57 y 58
secuencia := 0
return func() int { //cuando se llama y se asigna a una variable, la variable solo toma la parte que se retorna.
secuencia++
return numero * secuencia
}
} | [
0.608146071434021,
0.2795390784740448,
0.6160095930099487,
0.7449085116386414,
0.05791996419429779,
0.09641790390014648,
0.6229844093322754,
0.01859149895608425,
-0.2677857577800751,
-0.4926646053791046,
-0.3899599015712738,
-0.06344287097454071,
0.5602757930755615,
-0.545570433139801,
0... |
func uno(numero int) int {
return numero * 2
} | [
-0.45191144943237305,
0.21658754348754883,
0.5655122399330139,
0.11930987983942032,
-0.4131625294685364,
0.45211729407310486,
1.1068874597549438,
0.6347864866256714,
-0.21113109588623047,
-1.0726890563964844,
-0.690095067024231,
0.6403548121452332,
0.967393696308136,
-0.2502319812774658,
... |
func dos(numero int) (int, bool) {
if numero == 5 {
return 5, true
}
return 10, false
} | [
-1.0104410648345947,
1.1203949451446533,
0.5668217539787292,
-0.525200605392456,
0.09797772020101547,
-0.11907893419265747,
-0.1507967859506607,
-1.0491095781326294,
-0.05063597112894058,
0.17194963991641998,
-1.1174778938293457,
0.3405122458934784,
0.2113325446844101,
-0.01578347757458687... |
func calculo(numero ...int) int {
total := 0
//usaremos for con range
//range devuelve dos valores pos/valor. pero si no quiero usar uno de esos valores se le pone _ guion bajo.
for pos, valor := range numero {
total = +valor
fmt.Printf("\nPos [%d]\n", pos)
}
return total
} | [
0.4795093834400177,
0.6604766845703125,
0.688072681427002,
0.49242329597473145,
0.2237117886543274,
-0.20202422142028809,
0.16806529462337494,
0.13039684295654297,
-1.2781318426132202,
-0.03870328515768051,
-0.6682686805725098,
-0.8636767268180847,
0.41532355546951294,
0.12312034517526627,... |
func (s Static) Get(ctx context.Context) ([]string, error) {
return s.versions, nil
} | [
-0.8543844223022461,
-0.05481722578406334,
0.07501190900802612,
0.17494504153728485,
0.9477764368057251,
0.4961805045604706,
-0.7308028340339661,
-0.851215124130249,
0.31798699498176575,
0.8959485292434692,
-0.4253908395767212,
0.9553961753845215,
0.4004419147968292,
0.1974293440580368,
... |
func (o *AdminDeleteBulkGameSessionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewAdminDeleteBulkGameSessionsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
... | [
-0.178544819355011,
-0.5198888778686523,
0.7606081962585449,
-0.3293398916721344,
0.36452725529670715,
-0.86639803647995,
-0.03366441652178764,
-1.1794242858886719,
0.9778304696083069,
1.1928596496582031,
0.30013975501060486,
0.11950790882110596,
-0.7050470113754272,
-0.11910606175661087,
... |
func NewAdminDeleteBulkGameSessionsOK() *AdminDeleteBulkGameSessionsOK {
return &AdminDeleteBulkGameSessionsOK{}
} | [
0.5058773159980774,
-0.2576153576374054,
0.484157919883728,
-0.08271722495555878,
0.14073356986045837,
-0.43106570839881897,
0.29344528913497925,
-0.5914206504821777,
0.58743816614151,
1.9796385765075684,
-0.4002886414527893,
0.06684162467718124,
0.32010024785995483,
0.2298947274684906,
... |
func NewAdminDeleteBulkGameSessionsBadRequest() *AdminDeleteBulkGameSessionsBadRequest {
return &AdminDeleteBulkGameSessionsBadRequest{}
} | [
0.1263679713010788,
-0.5326141119003296,
0.7718061208724976,
-0.1949775516986847,
0.1585177779197693,
-0.5942944884300232,
-0.5663230419158936,
-0.047074757516384125,
0.5196070671081543,
0.5088038444519043,
0.30952396988868713,
0.649371325969696,
-0.40407463908195496,
0.8161633014678955,
... |
func NewAdminDeleteBulkGameSessionsUnauthorized() *AdminDeleteBulkGameSessionsUnauthorized {
return &AdminDeleteBulkGameSessionsUnauthorized{}
} | [
0.09438756108283997,
-0.3246513307094574,
0.7525479197502136,
-0.2443038374185562,
-0.2636930048465729,
-0.6848577857017517,
-0.006049998104572296,
0.40546074509620667,
0.8559525609016418,
0.5471268892288208,
0.0688699260354042,
1.1779299974441528,
0.007383613381534815,
-0.0803700238466262... |
func NewAdminDeleteBulkGameSessionsForbidden() *AdminDeleteBulkGameSessionsForbidden {
return &AdminDeleteBulkGameSessionsForbidden{}
} | [
0.9525737762451172,
-0.2330043762922287,
0.5693468451499939,
0.13837634027004242,
0.23935453593730927,
-0.44351261854171753,
0.3681424856185913,
-0.7122646570205688,
0.6393437385559082,
0.9168070554733276,
0.08886775374412537,
0.8681228160858154,
-0.22650286555290222,
-0.138973206281662,
... |
func numHashes(fn string) (int64, error) {
fi, err := os.Stat(fn)
if err != nil {
return 0, err
}
size := fi.Size()
return size / hashSize, nil
} | [
0.9259176254272461,
0.4084559679031372,
0.6925947666168213,
0.37454983592033386,
-0.5779638886451721,
0.5557895302772522,
0.8026845455169678,
-0.5917527079582214,
-0.3462170958518982,
-0.5305302143096924,
-0.26114732027053833,
-1.0017374753952026,
0.18210755288600922,
0.26570191979408264,
... |
func bloomFilterParams(n int64, p float64) (m, k uint) {
if n <= 0 || p <= 0 || p >= 1 {
return 1, 0
}
c := 0.6185 // 0.5 ^ (m/n * ln 2) ~= 0.6185 ^ (m/n)
nf := float64(n)
mf := math.Log(p) / math.Log(c) * nf
m = uint(math.Ceil(mf))
kf := mf / nf * math.Log(2)
k = uint(math.Floor(kf))
return
} | [
-0.11045724898576736,
0.2701546549797058,
0.6085813641548157,
0.4558536112308502,
-0.7792743444442749,
0.3886837065219879,
0.24761657416820526,
0.07559218257665634,
-0.7811869978904724,
-0.19576770067214966,
-0.6659382581710815,
0.743073046207428,
-0.6146687865257263,
1.1638303995132446,
... |
func getBloomFilterSizes(hashfile string) ([]int64, error) {
rates := []float64{0.005, 0.01, 0.02, 0.05, 0.1}
sizes := make([]int64, len(rates))
fi, err := os.Stat(hashfile)
if err != nil {
return nil, err
}
hashsize := fi.Size()
fmt.Printf("Size hash file \t num hashes \t err rate \t m \t k \t size of bloom... | [
0.32651713490486145,
0.5067532658576965,
0.8916946053504944,
-0.21962492167949677,
0.32467222213745117,
0.1215963363647461,
0.9144943356513977,
-0.3201294243335724,
-1.2180209159851074,
0.1842585653066635,
-1.3933167457580566,
-0.013595493510365486,
-1.2904539108276367,
1.1797401905059814,... |
func (c *Client) Init() error {
if !c.initialized {
cfg := c.Config
log.Debugf("Initializing client with config %+v", cfg)
cspDir, err := util.MakeFileAbs("csp", c.HomeDir)
if err != nil {
return err
}
c.cspDir = cspDir
keyDir := filepath.Join(cspDir, "keystore")
err = os.MkdirAll(keyDir, 0700)
... | [
0.033682554960250854,
-0.1723327934741974,
0.6009864211082458,
-0.12515969574451447,
-0.04785965010523796,
1.1139734983444214,
0.7489961981773376,
-0.32398316264152527,
-0.08321689814329147,
-0.5575377345085144,
-0.5912265181541443,
-0.09078197926282883,
0.043501850217580795,
0.29885870218... |
func (c *Client) Register(req *api.RegistrationRequest) (rr *api.RegistrationResponse, err error) {
log.Debugf("Register %+v", req)
if req.Name == "" {
return nil, errors.New("Register was called without a Name set")
}
reqBody, err := util.Marshal(req, "RegistrationRequest")
if err != nil {
return nil, err
... | [
-1.663253664970398,
0.9587145447731018,
0.7704795002937317,
0.6657981276512146,
0.3600538372993469,
-0.933305561542511,
-0.266679048538208,
-0.6210145950317383,
-0.14597313106060028,
-0.03576336428523064,
-0.6326547265052795,
0.47728872299194336,
-1.2475130558013916,
0.6131440997123718,
... |
func (c *Client) Enroll(req *api.EnrollmentRequest, saveOnDisk bool) (*api.EnrollmentResponse, error) {
log.Debugf("Enrolling %+v", req)
err := c.Init()
if err != nil {
return nil, err
}
return c.handleX509Enroll(req, saveOnDisk)
} | [
-0.711957573890686,
0.5443477034568787,
0.5503292083740234,
0.6687688231468201,
-0.6255003809928894,
0.5746711492538452,
0.2358565330505371,
0.09828697144985199,
0.2983083426952362,
-0.45464083552360535,
-0.31451281905174255,
0.14447003602981567,
-0.4868212938308716,
0.36029574275016785,
... |
func (c *Client) GenCSR(req *api.CSRInfo, id string) ([]byte, cccsp.Key, error) {
log.Debugf("GenCSR %+v", req)
err := c.Init()
if err != nil {
return nil, nil, err
}
cr := c.newCertificateRequest(req)
cr.CN = id
if cr.KeyRequest == nil || (cr.KeyRequest.Size() == 0 && cr.KeyRequest.Algo() == "") {
cr.Key... | [
-0.5571895241737366,
-0.24671803414821625,
0.6396909356117249,
0.21806658804416656,
0.4766893684864044,
-0.0604015477001667,
-0.7339698076248169,
-0.06122793257236481,
0.028095539659261703,
-0.10059870779514313,
-0.7399669885635376,
-0.26484304666519165,
-0.7236810922622681,
0.819117963314... |
func (c *Client) newEnrollmentResponse(result *api.EnrollmentResponseNet, id string, key cccsp.Key) (*api.EnrollmentResponse, error) {
log.Debugf("newEnrollmentResponse %s", id)
certBytes, err := base64.StdEncoding.DecodeString(result.Cert)
if err != nil {
return nil, errors.WithMessage(err, "Invalid response form... | [
-0.7013556957244873,
-1.3084666728973389,
0.3087465167045593,
-0.2498091608285904,
-0.8303677439689636,
0.005909768398851156,
0.015113526955246925,
-0.5270906686782837,
0.7034558057785034,
0.6680277585983276,
-1.304717779159546,
-0.17424237728118896,
-0.4152483642101288,
0.6263121366500854... |
func (c *Client) net2LocalCAInfo(net *api.CAInfoResponseNet, local *api.GetCAInfoResponse) error {
caChain, err := base64.StdEncoding.DecodeString(net.CAChain)
if err != nil {
return errors.WithMessage(err, "Failed to decode CA chain")
}
local.CAName = net.CAName
local.CAChain = caChain
local.Version = net.Vers... | [
0.44105371832847595,
-1.462009072303772,
0.15380524098873138,
-0.7907652258872986,
0.15582072734832764,
-0.25195467472076416,
-0.2274692952632904,
-0.19805575907230377,
0.06193321943283081,
-0.3990153670310974,
-0.9351709485054016,
0.3322945833206177,
0.5727667212486267,
0.8155186176300049... |
func (c *Client) NewX509Identity(name string, cred *credential.Credential) credential.Identity {
return NewIdentity(c, name, cred)
} | [
0.8409490585327148,
-0.9361300468444824,
0.13445833325386047,
-0.15669971704483032,
-0.3949534296989441,
0.32747572660446167,
-0.6022068858146667,
-0.41237008571624756,
0.24018964171409607,
0.8987765312194824,
-1.3030537366867065,
0.22208215296268463,
-1.040071725845337,
-0.536801457405090... |
func (c *Client) GetCSP() cccsp.CCCSP {
return c.csp
} | [
1.7130405902862549,
-0.7723121047019958,
0.3321426212787628,
0.8023044466972351,
0.36767902970314026,
0.5122310519218445,
-0.18392133712768555,
-0.6796046495437622,
0.9471951723098755,
-0.26034602522850037,
0.1724754422903061,
0.4157484173774719,
-1.1634801626205444,
-0.6336687207221985,
... |
func (c *Client) SendReq(req *http.Request, result interface{}) (err error) {
urlStr := req.URL.String()
log.Debugf("Sending request %s", urlStr)
err = c.Init()
if err != nil {
return err
}
resp, err := c.httpClient.Do(req)
if err != nil {
return errors.Wrapf(err, "%s failure of request: %s", req.Method, u... | [
-1.10118567943573,
-0.12415263801813126,
1.044195294380188,
0.21114003658294678,
0.09255930781364441,
-0.4153425991535187,
-0.07125680148601532,
-0.48021310567855835,
-0.4315905272960663,
0.03532467782497406,
-0.18347713351249695,
0.24683541059494019,
0.08317041397094727,
0.750642716884613... |
func (c *Client) newPost(endpoint string, reqBody []byte) (*http.Request, error) {
curl, err := c.getURL(endpoint)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, curl, bytes.NewReader(reqBody))
if err != nil {
return nil, errors.Wrapf(err, "Failed posting to %s", curl)
}
retur... | [
0.023191748186945915,
-0.3296513557434082,
0.6038962602615356,
0.5228680968284607,
0.10161609202623367,
-0.6425833106040955,
-1.4197566509246826,
-0.21666182577610016,
0.05284343287348747,
-0.17274872958660126,
0.4979342520236969,
0.09252311289310455,
-0.352689266204834,
-0.249407976865768... |
func (c *Client) newCertificateRequest(req *api.CSRInfo) *csr.CertificateRequest {
cr := csr.CertificateRequest{}
if req != nil && req.Names != nil {
cr.Names = req.Names
}
if req != nil && req.Hosts != nil {
cr.Hosts = req.Hosts
} else {
hostname, _ := os.Hostname()
if hostname != "" {
cr.Hosts = make(... | [
-0.9262856841087341,
-0.7267005443572998,
0.43689456582069397,
0.6193538904190063,
-0.2601650357246399,
-0.654393196105957,
-0.890484094619751,
-0.02713979035615921,
-0.38755300641059875,
-0.5197214484214783,
-0.14548052847385406,
0.333794504404068,
-0.41939041018486023,
1.0987181663513184... |
func NormalizeURL(addr string) (*url.URL, error) {
addr = strings.TrimSpace(addr)
u, err := url.Parse(addr)
if err != nil {
return nil, err
}
if u.Opaque != "" {
u.Host = net.JoinHostPort(u.Scheme, u.Opaque)
u.Opaque = ""
} else if u.Path != "" && !strings.Contains(u.Path, ":") {
u.Host = net.JoinHostPort... | [
-0.11502230912446976,
0.41829541325569153,
1.0447367429733276,
-0.10330516844987869,
-0.09864574670791626,
0.402018278837204,
0.9254713654518127,
0.565451443195343,
0.32872429490089417,
0.39924758672714233,
-0.10711876302957535,
0.1544143259525299,
-0.39877787232398987,
-0.0735742896795272... |
func delete(root *BinarySearchNode, k int) *BinarySearchNode {
if root == nil {
panic("delete from nil tree")
}
if root.key > k && root.left != nil {
root.left = delete(root.left, k)
} else if root.key > k && root.left == nil {
// k is not existed, return success
return nil
} else if root.key < k && root.r... | [
0.46791407465934753,
-0.08143925666809082,
1.1100622415542603,
0.9659411907196045,
-0.7451287508010864,
-0.1031820997595787,
-0.2388981729745865,
0.37573662400245667,
0.03512916341423988,
0.5439687967300415,
-0.23911377787590027,
-0.06372024863958359,
-0.6561029553413391,
0.722387552261352... |
func NewIdle() *Idle {
return &Idle{}
} | [
0.08990161120891571,
-0.3358134627342224,
0.16500453650951385,
0.2933655381202698,
-0.5207656025886536,
-0.03581538423895836,
-0.41367197036743164,
-0.7684109210968018,
0.34931641817092896,
-1.5714919567108154,
-0.4591823220252991,
0.5373711585998535,
-1.4048315286636353,
-0.41459208726882... |
func (f *Idle) GetIdleTime() int {
if f == nil {
return 0
}
return f.getIdleTime()
} | [
-0.20955269038677216,
0.1280643790960312,
0.7456390261650085,
-0.1951897293329239,
0.7824237942695618,
-0.41442060470581055,
-0.10416790097951889,
-0.07255971431732178,
0.06848065555095673,
0.03291410207748413,
-1.0567563772201538,
-1.0511387586593628,
-1.3597486019134521,
0.32317641377449... |
func NewBoolValue(ref *bool) *BoolValue {
return (*BoolValue)(ref)
} | [
0.8120532631874084,
-0.04184836149215698,
0.4115568995475769,
0.3340725302696228,
-1.3933823108673096,
-0.1709941029548645,
-0.3387746512889862,
-0.013427814468741417,
-0.5655784010887146,
-0.08296062797307968,
-0.03511345759034157,
1.2109323740005493,
0.17671597003936768,
0.51106995344161... |
func (b *BoolValue) Set(s string) error {
v, err := strconv.ParseBool(s)
*b = BoolValue(v)
return err
} | [
-0.2471173256635666,
-0.4039725363254547,
0.04738758131861687,
-0.10677583515644073,
-0.23428936302661896,
0.17367304861545563,
-0.4006018340587616,
0.29628729820251465,
-1.4143747091293335,
0.42862996459007263,
-0.38242658972740173,
0.8313366174697876,
-0.07582741975784302,
-0.41685733199... |
func (b *BoolValue) String() string {
return fmt.Sprintf("%v", *b)
} | [
-0.20822060108184814,
-0.3402532637119293,
0.034334372729063034,
0.2399653047323227,
-0.3060106337070465,
1.1505613327026367,
0.000288294191705063,
-0.6182724833488464,
-1.2910860776901245,
0.8996039032936096,
-0.04973454773426056,
0.44154468178749084,
-0.38551095128059387,
-0.515095889568... |
func (b *BoolValue) FlagValue() string {
return "true"
} | [
0.3523365557193756,
0.42319560050964355,
0.4637860059738159,
-0.2401563972234726,
0.13898563385009766,
1.3853870630264282,
0.1322619915008545,
0.8908089995384216,
-1.312989354133606,
0.09666871279478073,
-0.6541789174079895,
0.762765645980835,
-0.007691577076911926,
0.561429500579834,
-1... |
func NewDateValue(ref *time.Time) *DateValue {
return (*DateValue)(ref)
} | [
0.10075479745864868,
0.07832768559455872,
0.5351198315620422,
0.38193318247795105,
-1.3681302070617676,
0.0573732815682888,
-1.1303808689117432,
-0.2715778052806854,
0.035528767853975296,
-0.39434996247291565,
-0.19388791918754578,
1.2975730895996094,
0.586144208908081,
1.181888461112976,
... |
func (d *DateValue) Set(s string) error {
v, err := time.Parse("2006-01-02", s)
*d = DateValue(v)
return err
} | [
-0.4788980782032013,
0.1512996107339859,
0.37077948451042175,
-0.39524045586586,
-1.3322205543518066,
0.14990340173244476,
-0.43208011984825134,
-0.1356918215751648,
-0.5007944107055664,
-0.26525935530662537,
-0.6979368329048157,
0.9701545238494873,
0.9006776809692383,
0.30424633622169495,... |
func (d *DateValue) String() string {
return (*time.Time)(d).Format("2006-01-02")
} | [
-0.3653247654438019,
-0.518259584903717,
0.4682024419307709,
0.012502468191087246,
-1.0020716190338135,
1.0263943672180176,
0.04834834113717079,
-1.254703164100647,
-0.3396899104118347,
-0.11245758086442947,
0.06752096116542816,
0.9927220940589905,
1.1635663509368896,
0.7336210608482361,
... |
func NewDurationValue(ref *time.Duration) *DurationValue {
return (*DurationValue)(ref)
} | [
0.2630571722984314,
-0.13324511051177979,
0.2637997567653656,
0.43579918146133423,
-1.2867765426635742,
-0.4225447475910187,
-0.19708140194416046,
0.006042996421456337,
-0.06658098101615906,
-0.006016727536916733,
-0.06425975263118744,
0.8756145238876343,
0.9480627179145813,
0.945981264114... |
func (d *DurationValue) Set(s string) error {
v, err := time.ParseDuration(s)
*d = DurationValue(v)
return err
} | [
-0.7877365946769714,
0.10531602799892426,
0.14101558923721313,
-0.5826879143714905,
-0.8668095469474792,
0.10831654071807861,
-0.0871833935379982,
0.11047688126564026,
-0.5266548991203308,
-0.013098589144647121,
-0.3379017412662506,
1.0453402996063232,
1.1280872821807861,
0.180493026971817... |
func (d *DurationValue) String() string {
return (*time.Duration)(d).String()
} | [
-0.5856006145477295,
-0.27831152081489563,
-0.04176708310842514,
-0.048650939017534256,
-0.8343546390533447,
0.9249866008758545,
0.34164321422576904,
-1.1689982414245605,
-0.37107521295547485,
0.2289607971906662,
0.286590039730072,
0.6245318651199341,
1.1840993165969849,
0.4213354885578155... |
func NewFloat32Value(ref *float32) *Float32Value {
return (*Float32Value)(ref)
} | [
0.897240161895752,
0.6733077168464661,
0.294452041387558,
-0.31839054822921753,
-1.3267409801483154,
0.17746557295322418,
-0.4737539291381836,
-0.6309586763381958,
-0.10451247543096542,
-0.6562683582305908,
0.1568996012210846,
0.7020211219787598,
0.14356260001659393,
0.9637323617935181,
... |
func (f *Float32Value) Set(s string) error {
v, err := strconv.ParseFloat(s, 32)
if err != nil {
return err
}
*f = Float32Value(float32(v))
return err
} | [
0.5924010276794434,
0.4195084869861603,
0.5334202647209167,
-0.9039473533630371,
-0.670944094657898,
0.070920430123806,
-0.36661791801452637,
-0.4624825119972229,
-1.3714580535888672,
-0.5913951992988586,
-0.4016140401363373,
0.6524301171302795,
0.5382227301597595,
0.0015858820406720042,
... |
func (f *Float32Value) String() string {
return fmt.Sprintf("%v", *f)
} | [
0.3543824255466461,
0.6045620441436768,
0.10855332762002945,
-0.22810621559619904,
-0.3438447117805481,
1.2496871948242188,
-0.22226397693157196,
-0.8452807664871216,
-1.3483854532241821,
-0.4132407307624817,
0.17320571839809418,
0.3986108601093292,
0.3023160994052887,
0.24960456788539886,... |
func NewFloat64Value(ref *float64) *Float64Value {
return (*Float64Value)(ref)
} | [
0.589444100856781,
0.2846043109893799,
-0.009894359856843948,
0.5945736169815063,
-1.1446242332458496,
-0.5025479793548584,
-0.01716633513569832,
-0.2203192412853241,
-0.1208513081073761,
-0.4389064311981201,
0.46926361322402954,
0.36945074796676636,
0.10965177416801453,
0.9898836612701416... |
func (f *Float64Value) Set(s string) error {
v, err := strconv.ParseFloat(s, 64)
*f = Float64Value(v)
return err
} | [
0.1826660931110382,
0.18673019111156464,
0.18238261342048645,
-0.008571370504796505,
-0.6959197521209717,
-0.5296537280082703,
-0.14844541251659393,
0.4475008547306061,
-1.049906611442566,
-0.49651122093200684,
0.1705513447523117,
0.4673127830028534,
0.6235310435295105,
0.23327092826366425... |
func (f *Float64Value) String() string {
return fmt.Sprintf("%v", *f)
} | [
0.06306816637516022,
0.40893104672431946,
0.0027553208637982607,
0.5034925937652588,
-0.2259059101343155,
0.6616706848144531,
-0.17207616567611694,
-0.5188124179840088,
-1.0951714515686035,
-0.19163253903388977,
0.5770002603530884,
0.2320355623960495,
0.46009793877601624,
0.521358132362365... |
func NewIntValue(ref *int) *IntValue {
return (*IntValue)(ref)
} | [
0.552139401435852,
-0.572975754737854,
0.2656572461128235,
-0.4882809817790985,
-1.1528133153915405,
-0.5375961065292358,
-0.7511512041091919,
-0.19128663837909698,
0.05999280884861946,
0.0713493824005127,
0.12008155137300491,
0.6897488832473755,
-0.13113120198249817,
0.5787639021873474,
... |
func (i *IntValue) Set(s string) error {
v, err := strconv.ParseInt(s, 0, 64)
*i = IntValue(v)
return err
} | [
-0.629006028175354,
-0.08540164679288864,
0.16406890749931335,
-0.6904755234718323,
-0.8080413341522217,
-0.17137466371059418,
-0.21836842596530914,
0.35420337319374084,
-0.577904999256134,
-0.09524871408939362,
-0.15427462756633759,
0.36982181668281555,
0.011979551054537296,
-0.5283614397... |
func (i *IntValue) String() string {
return fmt.Sprintf("%v", *i)
} | [
-0.31181100010871887,
-0.4446393549442291,
0.061597444117069244,
-0.49633172154426575,
-0.35434457659721375,
1.1340073347091675,
-0.09346050024032593,
-0.7076010704040527,
-0.7206177711486816,
0.18216341733932495,
-0.20227158069610596,
-0.14237567782402039,
-0.36199381947517395,
-0.5495745... |
func NewIPValue(ref *net.IP) *IPValue {
return (*IPValue)(ref)
} | [
-0.25798431038856506,
-0.268198162317276,
0.29602423310279846,
0.19779321551322937,
-1.7431879043579102,
-0.28477543592453003,
-0.5274948477745056,
-0.11099071800708771,
-0.34420356154441833,
0.07556961476802826,
0.3476739525794983,
0.1644643396139145,
0.5866643190383911,
-0.27572250366210... |
func (s *IPValue) Set(val string) error {
ip := net.ParseIP(val)
if ip == nil {
return fmt.Errorf("Invalid IP address format '%s'", val)
}
*s = IPValue(ip)
return nil
} | [
-0.3779793977737427,
0.16970743238925934,
0.08015904575586319,
-0.4106139838695526,
-1.3531732559204102,
-0.11962933838367462,
-0.5045722723007202,
0.30356931686401367,
-0.33902013301849365,
-0.26629847288131714,
0.3513864576816559,
0.0355965718626976,
0.7407467365264893,
-0.35490041971206... |
func (s *IPValue) String() string {
ip := net.IP(*s)
return ip.String()
} | [
-0.5218009352684021,
-0.6288690567016602,
-0.1677338182926178,
0.13625837862491608,
-1.2281402349472046,
0.4215255081653595,
0.12024162709712982,
-0.5053210258483887,
-0.3115077316761017,
-0.1203165352344513,
0.3843972086906433,
0.037736885249614716,
0.39218783378601074,
-0.849632203578949... |
func NewStringValue(ref *string) *StringValue {
return (*StringValue)(ref)
} | [
0.5389484763145447,
-0.6170591711997986,
0.16171792149543762,
-0.6444991230964661,
-1.4631527662277222,
-0.5208284258842468,
-0.5709922909736633,
-0.06798805296421051,
0.011060683988034725,
-0.1446038782596588,
-0.1978149116039276,
1.2582117319107056,
0.09863943606615067,
0.351055294275283... |
func (s *StringValue) Set(val string) error {
*s = StringValue(val)
return nil
} | [
0.2130552977323532,
-0.2675860524177551,
-0.13748770952224731,
-0.7591624855995178,
-0.8288968205451965,
-0.18306758999824524,
0.0563972145318985,
-0.16449742019176483,
-0.5679361820220947,
-0.7660360932350159,
-0.48293808102607727,
1.1634483337402344,
0.46367835998535156,
0.18917143344879... |
func (s *StringValue) String() string {
return fmt.Sprintf("%s", *s)
} | [
0.018210364505648613,
-0.5979934334754944,
-0.03284125402569771,
-0.23091845214366913,
-0.7150954008102417,
0.545951247215271,
0.23313315212726593,
-0.4192489981651306,
-0.6207422614097595,
-0.5699192881584167,
-0.3132885694503784,
0.6962569355964661,
0.39120933413505554,
-0.07428734749555... |
func NewURLValue(ref *url.URL) *URLValue {
return (*URLValue)(ref)
} | [
0.6172795295715332,
0.030948806554079056,
0.2892136871814728,
0.20450329780578613,
-1.265383005142212,
-0.006847809534519911,
-0.48788732290267944,
-0.5035448670387268,
-0.4046691954135895,
-0.28116440773010254,
-0.05145389214158058,
1.2056652307510376,
-0.1865730583667755,
0.6913479566574... |
func (u *URLValue) Set(val string) error {
res, err := url.Parse(val)
*u = URLValue(*res)
return err
} | [
-0.6094527244567871,
0.08878013491630554,
0.13514068722724915,
-0.46102195978164673,
-0.44721537828445435,
0.724653422832489,
-0.20488308370113373,
0.3554207682609558,
-0.5211611986160278,
-0.6691338419914246,
-0.2789212167263031,
0.8031002879142761,
0.21835221350193024,
0.3980949819087982... |
func (u *URLValue) String() string {
url := url.URL(*u)
return fmt.Sprintf("%v", url.String())
} | [
-0.6383095979690552,
-0.42662525177001953,
0.08924062550067902,
-0.17929953336715698,
-0.49282893538475037,
1.0371712446212769,
0.18536219000816345,
-0.18024340271949768,
-0.40624046325683594,
-0.2701389789581299,
0.03945581614971161,
0.5340339541435242,
-0.19959750771522522,
0.18172393739... |
func Bool(v bool) *bool {
p := new(bool)
*p = v
return p
} | [
0.3972441256046295,
0.26397693157196045,
0.11960183084011078,
0.6453531980514526,
-0.2957957684993744,
0.6823937892913818,
0.39287808537483215,
0.7111544013023376,
0.6871350407600403,
0.02772587537765503,
-0.8765808343887329,
0.5717394948005676,
0.26221951842308044,
-1.2835383415222168,
... |
func NewMemoryStore(logger *zap.SugaredLogger) (*MemoryStore, error) {
schema := &memdb.DBSchema{
Tables: map[string]*memdb.TableSchema{
tableName: &memdb.TableSchema{
Name: tableName,
Indexes: map[string]*memdb.IndexSchema{
"id": &memdb.IndexSchema{
Name: "id",
Unique: true,
In... | [
0.41236740350723267,
-0.38662460446357727,
0.4988313913345337,
-0.2387949824333191,
-1.2573597431182861,
-0.7971282005310059,
-0.6750651001930237,
-0.38909780979156494,
0.5185679793357849,
-0.12895908951759338,
-0.5671977996826172,
-0.2130655199289322,
-0.9987297654151917,
0.52660465240478... |
func (*MemoryStore) CleanUp() {} | [
0.6238833665847778,
-1.0287586450576782,
0.20789073407649994,
0.19084972143173218,
-1.3429615497589111,
-0.38163623213768005,
1.2577425241470337,
0.5933501124382019,
1.4941962957382202,
-0.9590482115745544,
-0.32248079776763916,
-0.19611048698425293,
-0.3355659544467926,
1.0264047384262085... |
func (store *MemoryStore) InsertMapping(mapping *types.DNSMapping, cb func(*types.DNSMapping) error) error {
txn := store.db.Txn(true)
defer txn.Abort()
rawRecord, err := txn.First(tableName, "id", mapping.Name, mapping.IP.String())
if err != nil {
return err
}
if rawRecord == nil {
if err = cb(mapping); er... | [
-0.7079333662986755,
1.5680959224700928,
1.0145922899246216,
-0.2831585705280304,
-0.36352264881134033,
-0.42731326818466187,
0.519607424736023,
0.3406614661216736,
0.7255561947822571,
0.48473992943763733,
-0.39701786637306213,
-1.0585174560546875,
-0.21072684228420258,
0.5499992966651917,... |
func (store *MemoryStore) RemoveMapping(mapping *types.DNSMapping, cb func(*types.DNSMapping) error) error {
txn := store.db.Txn(true)
defer txn.Abort()
rawRecord, err := txn.First(tableName, "containerid", mapping.ContainerID)
if err != nil {
return err
}
if rawRecord == nil {
store.logger.Warnw("Trying to ... | [
-0.7086051106452942,
1.3746092319488525,
0.922764778137207,
-0.2194288671016693,
-0.5883339643478394,
-0.8102787137031555,
0.5635825395584106,
0.5666400194168091,
1.062305212020874,
0.6066786050796509,
-0.21214598417282104,
-0.7082120776176453,
0.09801703691482544,
0.30510827898979187,
0... |
func (store *MemoryStore) ReplaceMappings(mappings []*types.DNSMapping, provider dns.Provider) error {
txn := store.db.Txn(false)
defer txn.Abort()
iterator, err := txn.Get(tableName, "containerid")
if err != nil {
return err
}
missingItems := []*types.DNSMapping{}
for item := iterator.Next(); item != nil; i... | [
-0.875832200050354,
0.8290824294090271,
0.7788408398628235,
0.061220843344926834,
-0.5768400430679321,
-0.6502094864845276,
0.15636000037193298,
0.8469587564468384,
0.877446711063385,
0.34078115224838257,
-0.7959697842597961,
-0.8378245830535889,
-0.47956928610801697,
0.6388869881629944,
... |
func Retry(attempts int, sleep time.Duration, fn func() bool) bool {
if err := fn(); err != true {
if attempts--; attempts > 0 {
log.Warnf("retry func error: %s. attemps #%d after %s.", "failed", attempts, sleep)
time.Sleep(60 * time.Second)
return Retry(attempts, 2*sleep, fn)
}
return err
}
//IsCon... | [
0.4702248275279999,
0.3606293499469757,
0.5777190327644348,
0.6214900612831116,
-0.5166720151901245,
0.23716893792152405,
-0.7226466536521912,
-0.1701650321483612,
-0.3771856725215912,
-0.6562609076499939,
-0.14334751665592194,
-0.12668490409851074,
0.020838044583797455,
-1.168428778648376... |
func Setup(initLayer containerfs.ContainerFS, rootIDs idtools.Identity) error {
return nil
} | [
0.1583651751279831,
-0.3354342579841614,
0.32847005128860474,
0.48465514183044434,
0.8148553967475891,
-0.8444454073905945,
0.8099306225776672,
-0.7996688485145569,
-0.22486011683940887,
-0.8369543552398682,
-0.025318892672657967,
0.4153878390789032,
-0.39676129817962646,
0.344515442848205... |
func main() {
age := 42
fmt.Println(&age)
changeMe(&age)
fmt.Println(&age)
fmt.Println(age)
} | [
-0.7225261330604553,
-0.6933767795562744,
0.7956642508506775,
-0.20953723788261414,
-0.5226846933364868,
0.5490013957023621,
0.3580346703529358,
0.35478562116622925,
-0.11713975667953491,
0.23330488801002502,
-0.15825709700584412,
1.1374423503875732,
0.4148033559322357,
1.1954436302185059,... |
func Decode(r *http.Request, v interface{}) error {
err := json.NewDecoder(r.Body).Decode(v)
if err != nil {
return &ErrJSON{err}
}
if obj, ok := v.(OK); ok {
if err := obj.OK(); err != nil {
return &ErrValidationFailed{err}
}
}
return nil
} | [
-0.7432278394699097,
-0.4400293827056885,
0.7326200604438782,
0.21164318919181824,
-0.45830535888671875,
-0.22616584599018097,
-0.7563490271568298,
-0.38473114371299744,
0.7047498822212219,
0.43074995279312134,
-0.34879252314567566,
1.1513490676879883,
-0.3768031597137451,
0.18970589339733... |
func (e *ErrValidationFailed) StatusCode() int {
return http.StatusUnprocessableEntity
} | [
-0.3121747076511383,
-0.7803899645805359,
0.25694307684898376,
0.28859493136405945,
0.004706876818090677,
0.5994022488594055,
0.34652525186538696,
1.4714242219924927,
-0.34767910838127136,
0.0306255966424942,
0.16500510275363922,
0.7004182934761047,
-0.43620389699935913,
0.2458832859992981... |
func (e *ErrJSON) StatusCode() int {
return http.StatusBadRequest
} | [
-0.7813576459884644,
-1.4040107727050781,
0.5356429815292358,
-0.3622180223464966,
-0.36904776096343994,
0.17782752215862274,
-0.6431293487548828,
0.601036548614502,
0.28191936016082764,
0.12296800315380096,
0.3499547839164734,
0.4792104661464691,
-0.05107901245355606,
0.09270811080932617,... |
func MakeMultipleHTMLfile(dir, lang string, numOfPages *int) float64 {
var fileSizes float64
allFiles, err := ioutil.ReadDir(dir)
check(err)
for _, file := range allFiles {
if file.IsDir() {
// recursive check for subdirectories
MakeMultipleHTMLfile(dir+"/"+file.Name(), lang, numOfPages)
}
if filepat... | [
0.33340704441070557,
1.0531350374221802,
1.0853655338287354,
0.38722872734069824,
-0.8025785088539124,
-0.09468003362417221,
0.2778700292110443,
0.34408190846443176,
-0.4834461212158203,
-0.03182064741849899,
-0.05136187747120857,
-0.8715829849243164,
0.016588371247053146,
1.05822527408599... |
func MakeHTMLFile(fileName, lang string, numOfPages *int) float64 {
var fileSizes float64
file, err := os.Lstat(fileName)
check(err)
fileContent, err := ioutil.ReadFile(fileName)
check(err)
fileSizes += float64(file.Size()) / float64(bytesize.KB)
translatedFileContent, err := translate.Translate(lang, string... | [
0.5080105066299438,
0.9971746206283569,
0.9177534580230713,
0.04719028249382973,
-1.0282107591629028,
0.4001747965812683,
0.04958821460604668,
0.3326350152492523,
-0.8420781493186951,
-0.09852360188961029,
0.05113443359732628,
-0.9302421808242798,
0.3609413206577301,
0.12792742252349854,
... |
func GatewayClientFromClientsetProvider(clients gateway_solo_io_v1.Clientset) gateway_solo_io_v1.GatewayClient {
return clients.Gateways()
} | [
0.049557797610759735,
-0.6710388660430908,
0.051520880311727524,
0.2726442217826843,
-0.9546836614608765,
-0.32840344309806824,
0.8356928825378418,
-1.1527708768844604,
0.31081169843673706,
0.6094281077384949,
0.48767751455307007,
0.845061182975769,
-0.16744861006736755,
0.4839718341827392... |
func GatewayClientProvider(client client.Client) gateway_solo_io_v1.GatewayClient {
return gateway_solo_io_v1.NewGatewayClient(client)
} | [
0.4719172716140747,
-0.12063650786876678,
0.10870728641748428,
0.20191261172294617,
-1.284476637840271,
0.43764495849609375,
0.9340359568595886,
-0.5723801851272583,
0.3268067240715027,
0.625089168548584,
-0.21158355474472046,
0.4099043309688568,
-0.8673086166381836,
0.10821697115898132,
... |
func RouteTableClientFromClientsetProvider(clients gateway_solo_io_v1.Clientset) gateway_solo_io_v1.RouteTableClient {
return clients.RouteTables()
} | [
-0.051024243235588074,
-0.30852010846138,
0.0460875928401947,
0.32201412320137024,
-0.6294698119163513,
-0.10963226854801178,
1.0015356540679932,
-1.3764084577560425,
-0.19467130303382874,
0.5984697937965393,
0.50551837682724,
0.8643932342529297,
-0.06882034987211227,
-0.11345268785953522,... |
func RouteTableClientProvider(client client.Client) gateway_solo_io_v1.RouteTableClient {
return gateway_solo_io_v1.NewRouteTableClient(client)
} | [
0.08392136543989182,
0.13180391490459442,
0.2501770555973053,
0.4957731366157532,
-0.8571826815605164,
0.46664485335350037,
1.1379899978637695,
-0.5712908506393433,
-0.4069337546825409,
0.5831593871116638,
-0.29893073439598083,
0.3475770652294159,
-0.7192398905754089,
-0.3434852361679077,
... |
func VirtualServiceClientFromClientsetProvider(clients gateway_solo_io_v1.Clientset) gateway_solo_io_v1.VirtualServiceClient {
return clients.VirtualServices()
} | [
0.22130218148231506,
-0.7830139994621277,
-0.12129729986190796,
0.25910651683807373,
-1.0459489822387695,
-0.23853054642677307,
0.34152546525001526,
-1.122249722480774,
0.5629333853721619,
0.7529613375663757,
0.7338830232620239,
0.3351190686225891,
0.1854632943868637,
0.19377276301383972,
... |
func VirtualServiceClientProvider(client client.Client) gateway_solo_io_v1.VirtualServiceClient {
return gateway_solo_io_v1.NewVirtualServiceClient(client)
} | [
0.5818463563919067,
-0.8056457042694092,
-0.1618434637784958,
0.4064107835292816,
-1.7958283424377441,
0.14373141527175903,
0.19507166743278503,
-0.30347388982772827,
0.37771841883659363,
0.5475293397903442,
0.23645588755607605,
0.0731649324297905,
-0.28255176544189453,
-0.2077979445457458... |
func valid(authorization []string, token string) bool {
if len(authorization) < 1 {
return false
}
return token == strings.TrimPrefix(authorization[0], "Bearer ")
} | [
0.21400845050811768,
0.025018813088536263,
0.5724640488624573,
1.1319091320037842,
-0.31168368458747864,
0.43359309434890747,
-0.9313280582427979,
0.12931422889232635,
0.3821829855442047,
0.42825907468795776,
0.6007686853408813,
0.4066394865512848,
-0.3567162752151489,
-0.24634814262390137... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.