text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (registry *Registry) Len() int {
registry.lock.RLock()
defer registry.lock.RUnlock()
return len(registry.db)
} | [
-0.19706393778324127,
0.9438914060592651,
0.09852180629968643,
-0.4538451135158539,
0.6274804472923279,
-0.5440166592597961,
1.2140315771102905,
1.0762358903884888,
-0.14647719264030457,
0.22179332375526428,
-1.1436095237731934,
0.5557787418365479,
-0.5823692679405212,
0.33466795086860657,... |
func CreateMark(prefix string) Mark {
return &CommonMark{
used: false,
begin: len(prefix),
}
} | [
-0.07576985657215118,
0.11431009322404861,
0.15419824421405792,
-0.30919143557548523,
0.7427822351455688,
-0.058220356702804565,
0.26147738099098206,
-0.006757511757314205,
0.667594850063324,
-0.4356669485569,
-0.2735341489315033,
-0.20882131159305573,
-0.8092555403709412,
-0.3545892834663... |
func NewMigration(migrationLocation string) *Migration {
return &Migration{
migrationFileLocation: migrationLocation,
name: migrationName(migrationLocation),
}
} | [
-0.5036270618438721,
-1.045501470565796,
0.0029217891860753298,
0.15838830173015594,
-1.0397694110870361,
-0.1506548374891281,
0.06905334442853928,
0.2763383388519287,
-0.0002843499241862446,
0.24177558720111847,
-0.9015998840332031,
-0.6399983763694763,
-0.014161375351250172,
-0.199434965... |
func (m *Migration) Up() (string, error) {
migrationContent, err := m.content()
if err != nil {
return "", err
}
upAndDownArray := strings.Split(migrationContent, downSection)
return strings.Replace(upAndDownArray[0], upSection, "", 1), nil
} | [
-0.3945366144180298,
-0.40810421109199524,
0.6871989369392395,
-0.06764889508485794,
-0.32556357979774475,
0.3536512553691864,
0.4927457273006439,
0.11016671359539032,
-0.037051789462566376,
0.9708371162414551,
0.3129945993423462,
0.21290723979473114,
-0.6199703216552734,
-0.04901064932346... |
func (m *Migration) Down() (string, error) {
migrationContent, err := m.content()
if err != nil {
return "", err
}
upAndDownArray := strings.Split(migrationContent, downSection)
return strings.Replace(upAndDownArray[1], downSection, "", 1), nil
} | [
0.23738056421279907,
-0.3091962933540344,
0.6731067895889282,
0.001092802849598229,
-0.17551974952220917,
0.850269079208374,
0.5275486707687378,
0.040258679538965225,
0.12689946591854095,
0.2990175187587738,
0.5986387729644775,
0.2964431941509247,
-1.1096478700637817,
0.46282708644866943,
... |
func isSymbolChar(c byte) bool {
return (symchars[c>>5] & (uint32(1) << (c & 0x1F))) != 0
} | [
-0.08584994077682495,
-0.1899011880159378,
0.5378041863441467,
-0.160694882273674,
0.0555025078356266,
-0.25580424070358276,
0.9015457034111023,
-0.41102999448776245,
1.1757724285125732,
-0.29759085178375244,
-1.4270321130752563,
0.36082783341407776,
-0.1947898119688034,
1.339593529701233,... |
func toHex(c byte) int {
if c >= '0' && c <= '9' {
return int(c) - '0'
} else if c >= 'A' && c <= 'F' {
return 10 + int(c) - 'A'
} else if c >= 'a' && c <= 'f' {
return 10 + int(c) - 'a'
} else {
return -1
}
} | [
-0.5391991138458252,
-0.6168355345726013,
0.7598471641540527,
-0.6767313480377197,
0.3002833425998688,
0.26321184635162354,
0.5210920572280884,
1.0079920291900635,
0.16297374665737152,
0.5244870185852051,
-0.744296669960022,
-0.3838253915309906,
-0.1789979785680771,
0.02967657707631588,
... |
func scanNumber(s string, out *float64) bool {
v, err := strconv.ParseFloat(s, 64)
if err != nil {
return false
}
*out = v
return true
} | [
0.1404390186071396,
0.5041254758834839,
0.6562178134918213,
1.223855972290039,
-2.029644727706909,
-0.06591024994850159,
-0.29527875781059265,
0.5762640237808228,
-0.014900410547852516,
-0.79280024766922,
-0.27206000685691833,
-0.1523446887731552,
-0.12825314700603485,
0.001012550666928291... |
func WithCloseStdio(tos *TraceOptionSet) error {
tos.CloseStdio = true
return nil
} | [
0.9896951913833618,
-0.40223515033721924,
0.6933320164680481,
0.06161190941929817,
-0.6194947957992554,
0.6170347332954407,
1.354552984237671,
-1.777470588684082,
-0.08543647825717926,
0.04584074020385742,
-0.5309888124465942,
-0.30474817752838135,
0.2420078068971634,
0.4149596393108368,
... |
func (*EnumerateServicesRequest) Descriptor() ([]byte, []int) {
return file_faultinjector_proto_rawDescGZIP(), []int{0}
} | [
-1.4288556575775146,
0.5934373140335083,
0.5918673872947693,
-0.6302736401557922,
0.034267608076334,
-0.988008439540863,
0.35130006074905396,
-0.7374510765075684,
-0.10701846331357956,
-0.7803401350975037,
0.2789716422557831,
-0.9256204962730408,
-0.2385304719209671,
0.0981035828590393,
... |
func (*EnumerateServicesResponse) Descriptor() ([]byte, []int) {
return file_faultinjector_proto_rawDescGZIP(), []int{1}
} | [
-0.6461347937583923,
0.4364686906337738,
0.027120620012283325,
-0.7667887806892395,
0.05468413978815079,
-1.3098598718643188,
0.8385471701622009,
-0.765195369720459,
0.1626581996679306,
-0.459191232919693,
-0.3231998085975647,
-1.3199526071548462,
-0.9857650399208069,
-0.7357458472251892,
... |
func (*Service) Descriptor() ([]byte, []int) {
return file_faultinjector_proto_rawDescGZIP(), []int{2}
} | [
-1.0936604738235474,
0.4248797595500946,
0.3931996524333954,
0.1143336147069931,
-0.06987610459327698,
-0.2998292148113251,
0.0511346235871315,
-0.4122234284877777,
-0.05508112907409668,
-1.0382546186447144,
-0.8292589783668518,
0.449603408575058,
-0.586846649646759,
0.7846497893333435,
... |
func (*Method) Descriptor() ([]byte, []int) {
return file_faultinjector_proto_rawDescGZIP(), []int{3}
} | [
-0.897891104221344,
1.7495163679122925,
0.43835243582725525,
0.03581678867340088,
-0.06775584071874619,
-0.8142493963241577,
0.646443784236908,
-0.2979164719581604,
-0.2633506655693054,
-0.6912546157836914,
0.06715036928653717,
-0.21553181111812592,
0.18666763603687286,
0.8798243403434753,... |
func (*RegisterFaultRequest) Descriptor() ([]byte, []int) {
return file_faultinjector_proto_rawDescGZIP(), []int{4}
} | [
-0.7325598001480103,
1.635675072669983,
0.37137287855148315,
0.6955855488777161,
0.7581538558006287,
-1.0398131608963013,
0.5812591910362244,
0.13442963361740112,
-0.6415864825248718,
-0.621910035610199,
-0.7643442153930664,
0.8291062116622925,
-0.36819759011268616,
1.6806085109710693,
0... |
func (*RegisterFaultResponse) Descriptor() ([]byte, []int) {
return file_faultinjector_proto_rawDescGZIP(), []int{5}
} | [
-0.3801359236240387,
0.9276372194290161,
-0.03771215304732323,
0.31297945976257324,
1.307973027229309,
-1.3805365562438965,
0.7326480150222778,
-0.39907199144363403,
-0.18512356281280518,
-1.019045114517212,
-1.5022064447402954,
-0.1599794626235962,
-1.010669469833374,
0.7590412497520447,
... |
func (*RemoveFaultRequest) Descriptor() ([]byte, []int) {
return file_faultinjector_proto_rawDescGZIP(), []int{6}
} | [
-0.12299301475286484,
0.5617722272872925,
0.6009249687194824,
0.2859048545360565,
-0.4597252607345581,
-1.3469899892807007,
0.7201080322265625,
0.6557555794715881,
-0.12271139770746231,
-0.23407788574695587,
-0.628620982170105,
-0.15273506939411163,
-0.35860368609428406,
1.4636781215667725... |
func (*RemoveFaultResponse) Descriptor() ([]byte, []int) {
return file_faultinjector_proto_rawDescGZIP(), []int{7}
} | [
0.1149195209145546,
0.20481842756271362,
0.26642662286758423,
-0.1396905928850174,
-0.013760351575911045,
-1.4553669691085815,
1.0429062843322754,
0.3488019108772278,
0.2655235826969147,
-0.42051956057548523,
-1.16646409034729,
-0.9277954697608948,
-1.021367073059082,
0.3247910737991333,
... |
func (*ListenRequest) Descriptor() ([]byte, []int) {
return file_faultinjector_proto_rawDescGZIP(), []int{8}
} | [
-0.2303052395582199,
0.31476837396621704,
0.5795503258705139,
-0.2855595648288727,
0.09616602212190628,
-0.39771130681037903,
0.3136793076992035,
-0.05977572128176689,
0.05996551737189293,
-0.914969265460968,
0.24516038596630096,
0.5820209383964539,
-0.27811169624328613,
0.6175491213798523... |
func (*ListenResponse) Descriptor() ([]byte, []int) {
return file_faultinjector_proto_rawDescGZIP(), []int{9}
} | [
0.5401233434677124,
-0.1896800994873047,
0.5264702439308167,
-0.5544037818908691,
0.3666251003742218,
-0.5929928421974182,
0.48971423506736755,
-0.1977754384279251,
0.5064210295677185,
-1.0723991394042969,
-0.49339911341667175,
-0.24463705718517303,
-1.1877994537353516,
-0.2651253640651703... |
func get_span_by_trace(traceId string) *structs.CassandraSpan {
query := fmt.Sprintf("SELECT JSON chapter_id, user_id, session_id, trigger_route FROM project.spans WHERE trace_id='%s' LIMIT 1;", traceId)
j := enumerate_query(query)
var cspan *structs.CassandraSpan
if len(j) > 0 {
json.Unmarshal([]byte(j[0]), &c... | [
0.5263920426368713,
0.31483587622642517,
0.1789689064025879,
-0.1671261489391327,
-0.1776002049446106,
-0.5874330401420593,
0.37714776396751404,
-0.8941975235939026,
1.0817530155181885,
-0.03921394795179367,
-0.3452528119087219,
-0.2823358476161957,
0.3402409553527832,
-0.18042811751365662... |
func SetConfDir(dir string) {
confDir = dir
} | [
-0.18094289302825928,
-0.7056303024291992,
0.39324256777763367,
0.5438291430473328,
-0.5490289330482483,
-0.16880252957344055,
0.7014786601066589,
0.6650274991989136,
-0.1682869791984558,
-0.6621032357215881,
-0.8913453817367554,
-0.21671642363071442,
0.0049652052111923695,
2.2340879440307... |
func SetDB(db *config.DatabaseCfg) {
dbc = db
} | [
0.43961045145988464,
0.8108850121498108,
0.13990367949008942,
1.1853053569793701,
0.6646270751953125,
0.9001010656356812,
0.6171992421150208,
0.5731053948402405,
0.13804195821285248,
-0.2620936334133148,
-0.391813725233078,
0.19318154454231262,
-0.02021338976919651,
1.3780314922332764,
0... |
func SetLogger(l *logrus.Logger) {
log = l
} | [
-0.48880136013031006,
0.30728620290756226,
0.1215168908238411,
0.29981493949890137,
-0.39941734075546265,
0.17620672285556793,
-0.2570791244506836,
1.162479043006897,
0.3130147457122803,
-1.2089471817016602,
-0.883003830909729,
0.4514691233634949,
0.19519414007663727,
2.1381406784057617,
... |
func NewExport(info *ExportInfo) *ExportData {
if len(agent.Version) > 0 {
info.AgentVersion = agent.Version
} else {
info.AgentVersion = "debug"
}
info.ExportVersion = "1.0"
info.CreationDate = time.Now()
return &ExportData{
Info: info,
}
} | [
-0.21890251338481903,
-0.9070406556129456,
0.3206597566604614,
0.8117811679840088,
-0.9891815185546875,
0.32657739520072937,
-1.054534912109375,
-0.11094458401203156,
0.38033050298690796,
0.31316304206848145,
-0.11718404293060303,
0.0987451821565628,
-0.27299216389656067,
0.703844964504241... |
func (e *ExportData) PrependObject(obj *ExportObject) {
if checkIfExistOnArray(e.Objects, obj.ObjectTypeID, obj.ObjectID) == true {
return
}
e.tmpObjects = append([]*ExportObject{obj}, e.tmpObjects...)
} | [
-0.11962562799453735,
-0.42132920026779175,
0.6771122217178345,
0.150151789188385,
-0.057186949998140335,
0.9790096879005432,
0.13377855718135834,
-0.30184251070022583,
1.1700693368911743,
0.7640399932861328,
-0.6729212999343872,
-0.004939674399793148,
0.08214292675256729,
0.83640754222869... |
func (e *ExportData) UpdateTmpObject() {
//we need remove duplicated objects on the auxiliar array
objectList := []*ExportObject{}
for i := 0; i < len(e.tmpObjects); i++ {
v := e.tmpObjects[i]
if checkIfExistOnArray(objectList, v.ObjectTypeID, v.ObjectID) == false {
objectList = append(objectList, v)
}
}
... | [
-0.4019779562950134,
-1.2808716297149658,
0.6862887144088745,
-0.6584551930427551,
-0.5242546796798706,
0.42311426997184753,
0.07285755127668381,
0.1856098473072052,
0.3179442286491394,
1.7265796661376953,
-0.7046939134597778,
-0.12752516567707062,
-0.31485164165496826,
-0.0056785326451063... |
func NewStorage(s map[string]interface{}) (Storage, error) {
stype, ok := s["Type"].(string)
if !ok || stype == "" {
return nil, errors.New("Template do not have Storage type")
}
switch stype {
case "Local":
return newStorageLocal(s), nil
case "S3":
return newStorageS3(s)
default:
return nil, fmt.Errorf... | [
-0.07861325889825821,
-0.2767757773399353,
0.6758579015731812,
1.0353535413742065,
-0.8802668452262878,
-0.5018388032913208,
0.4339827001094818,
-0.5792558193206787,
0.1352750062942505,
0.3351763188838959,
0.3207286298274994,
-0.34505900740623474,
-0.22797028720378876,
0.6128787398338318,
... |
func (m *IoK8sAPIAutoscalingV2beta2HPAScalingPolicy) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validatePeriodSeconds(formats); err != nil {
res = append(res, err)
}
if err := m.validateType(formats); err != nil {
res = append(res, err)
}
if err := m.validateValue(formats); err !... | [
-0.17064768075942993,
-0.3402966558933258,
0.4746673107147217,
-0.7381442785263062,
0.26258382201194763,
0.5104601383209229,
-0.4027744233608246,
-0.2904750108718872,
-0.8386258482933044,
1.0270607471466064,
0.5240501165390015,
0.44454795122146606,
-0.6396408677101135,
0.9354217648506165,
... |
func TestStatusFailedList(t *testing.T) {
t.Parallel()
conn := db.New()
podsClient := &mocks.PodInterface{}
containerToStatus := map[string]string{
"host1": "foo",
"host2": "bar",
}
conn.Txn(db.ContainerTable).Run(func(view db.Database) error {
for host, status := range containerToStatus {
dbc := view.I... | [
-0.36734792590141296,
0.13558486104011536,
0.48041459918022156,
0.058775801211595535,
1.0443713665008545,
-0.28998157382011414,
-0.1012849509716034,
0.3374277353286743,
0.22812166810035706,
-0.40458717942237854,
-1.4406626224517822,
-0.2957730293273926,
-0.0866866335272789,
0.6166093945503... |
func (mnrrp *MetricNumRRPairs) ExportClusters(protocolKey common.ProtocolKeyType) *common.ExportUnivariateClusterFormat {
return mnrrp.rrPairs.ExportClusters(protocolKey)
} | [
-0.9092573523521423,
1.101746916770935,
0.0004663373401854187,
0.03472523018717766,
-0.066989004611969,
-0.12664411962032318,
0.9858500957489014,
-1.3555067777633667,
0.8553840517997742,
0.3241164982318878,
0.31955766677856445,
-0.12114867568016052,
-1.857124924659729,
-0.10448148846626282... |
func (mnrrp *MetricNumRRPairs) GetProtocols() []common.Protocol {
return mnrrp.rrPairs.GetProtocols()
} | [
-0.19521063566207886,
1.084083080291748,
0.3824999928474426,
0.742448627948761,
0.2559109628200531,
0.376434326171875,
0.6400034427642822,
-1.6874102354049683,
0.5885643362998962,
-0.10447845607995987,
0.14031265676021576,
-0.30448320508003235,
-1.5058213472366333,
0.07374222576618195,
-... |
func (mnrrp *MetricNumRRPairs) Name() string {
return "NumRRPairs"
} | [
-0.08612998574972153,
0.04307352751493454,
0.45666956901550293,
-0.3739841878414154,
-0.9923849105834961,
0.5555519461631775,
0.8859881162643433,
-0.3100528120994568,
0.1163564994931221,
1.0436981916427612,
0.009474465623497963,
-0.765687882900238,
-0.803286075592041,
0.03744060546159744,
... |
func (mnrrp *MetricNumRRPairs) PrintStatistic(verbose bool) {
fmt.Println("Metric Number of RR Pairs:")
fmt.Print(mnrrp.rrPairs.GetStatistics(verbose))
} | [
0.7695503234863281,
1.4864331483840942,
0.5646587014198303,
0.8651695251464844,
0.3033205568790436,
-0.012159503065049648,
0.2264348864555359,
-0.4067116677761078,
-0.9954725503921509,
0.9040459394454956,
0.22960889339447021,
0.7834572196006775,
-0.2842141389846802,
-0.3165808916091919,
... |
func (r *reconciler) ensureLoadBalancerService(ci *operatorv1.IngressController, deploymentRef metav1.OwnerReference, platformStatus *configv1.PlatformStatus) (bool, *corev1.Service, error) {
wantLBS, desiredLBService, err := desiredLoadBalancerService(ci, deploymentRef, platformStatus)
if err != nil {
return false... | [
-0.2702309489250183,
-0.5249741673469543,
0.9609570503234863,
-0.2115294635295868,
0.3283011019229889,
0.1756453961133957,
-0.15522393584251404,
-0.692581295967102,
0.3972276449203491,
0.08932467550039291,
0.43752342462539673,
0.15829303860664368,
-1.64393150806427,
0.9096261858940125,
0... |
func isServiceOwnedByIngressController(service *corev1.Service, ic *operatorv1.IngressController) bool {
if service != nil && service.Labels[manifests.OwningIngressControllerLabel] == ic.Name {
return true
}
return false
} | [
0.509190559387207,
-0.47284287214279175,
0.33889392018318176,
0.9424411654472351,
-0.20868541300296783,
0.27636396884918213,
-0.0678912103176117,
-0.505962610244751,
-0.14228323101997375,
-0.032687798142433167,
0.5264609456062317,
0.43233010172843933,
-0.736560046672821,
-0.018275097012519... |
func desiredLoadBalancerService(ci *operatorv1.IngressController, deploymentRef metav1.OwnerReference, platform *configv1.PlatformStatus) (bool, *corev1.Service, error) {
if ci.Status.EndpointPublishingStrategy.Type != operatorv1.LoadBalancerServiceStrategyType {
return false, nil, nil
}
service := manifests.LoadB... | [
-0.6331176161766052,
-0.5175246000289917,
0.726757287979126,
-0.45109835267066956,
0.3339226543903351,
0.6178908944129944,
-0.7193685173988342,
-0.3707095980644226,
-0.41293948888778687,
0.20706923305988312,
0.6873435974121094,
0.7812978029251099,
-1.9288946390151978,
0.9222740530967712,
... |
func shouldUseLocalWithFallback(ic *operatorv1.IngressController, service *corev1.Service) (bool, error) {
// By default, use local-with-fallback when using the "Local" external
// traffic policy.
if service.Spec.ExternalTrafficPolicy != corev1.ServiceExternalTrafficPolicyTypeLocal {
return false, nil
}
// Allo... | [
0.5401160717010498,
0.1132841408252716,
0.6959431171417236,
-0.19281795620918274,
-0.679711103439331,
-0.31592729687690735,
-0.32756859064102173,
-0.0849170982837677,
0.12099331617355347,
-0.15338784456253052,
0.041772834956645966,
0.02269393764436245,
-0.9579587578773499,
0.22252590954303... |
func (r *reconciler) currentLoadBalancerService(ci *operatorv1.IngressController) (bool, *corev1.Service, error) {
service := &corev1.Service{}
if err := r.client.Get(context.TODO(), controller.LoadBalancerServiceName(ci), service); err != nil {
if errors.IsNotFound(err) {
return false, nil, nil
}
return fal... | [
-0.6991554498672485,
-1.1174278259277344,
0.6358049511909485,
-0.8974322080612183,
0.13532006740570068,
0.35694679617881775,
-0.8557083010673523,
-0.5817328095436096,
-0.25741294026374817,
0.6324729323387146,
-0.0633082315325737,
0.4025265872478485,
-1.846492052078247,
0.8659945726394653,
... |
func (r *reconciler) normalizeLoadBalancerServiceAnnotations(service *corev1.Service) (bool, error) {
// On AWS, the service.beta.kubernetes.io/aws-load-balancer-internal
// annotation can have either the value "0.0.0.0/0" or the value "true"
// to indicate that the service load-balancer should be internal.
// Open... | [
-0.11320710927248001,
-0.4624744653701782,
0.9402962327003479,
-0.3968680799007416,
-1.022928237915039,
0.43412601947784424,
-0.06099997088313103,
-0.03157712146639824,
0.023745859041810036,
0.633272111415863,
-0.3383234739303589,
0.3997793197631836,
-0.9575595855712891,
0.7300258278846741... |
func (r *reconciler) createLoadBalancerService(service *corev1.Service) error {
if err := r.client.Create(context.TODO(), service); err != nil {
return fmt.Errorf("failed to create load balancer service %s/%s: %v", service.Namespace, service.Name, err)
}
log.Info("created load balancer service", "namespace", servi... | [
-0.012906370684504509,
-0.24901877343654633,
0.04837847128510475,
-1.0654679536819458,
0.8925516605377197,
0.874453067779541,
-1.0142557621002197,
-1.1976878643035889,
-0.10191551595926285,
0.3593243658542633,
-0.5045235753059387,
0.4260507822036743,
-1.7731777429580688,
1.0568286180496216... |
func (r *reconciler) deleteLoadBalancerService(service *corev1.Service, options *crclient.DeleteOptions) error {
if err := r.client.Delete(context.TODO(), service, options); err != nil {
if errors.IsNotFound(err) {
return nil
}
return fmt.Errorf("failed to delete load balancer service %s/%s: %v", service.Name... | [
0.387678861618042,
-0.720524787902832,
0.05927165597677231,
-0.5225864052772522,
0.759960412979126,
0.09442885965108871,
-0.7304368615150452,
-0.8607447147369385,
0.4277167022228241,
-0.4215576648712158,
-0.3668265640735626,
0.3380297124385834,
-1.6558237075805664,
0.8041839599609375,
-0... |
func (r *reconciler) updateLoadBalancerService(current, desired *corev1.Service, platform *configv1.PlatformStatus, deleteIfScopeChanged bool) (bool, error) {
_, platformHasMutableScope := platformsWithMutableScope[platform.Type]
if !platformHasMutableScope && deleteIfScopeChanged && !scopeEqual(current, desired, pla... | [
-0.9111927151679993,
-0.44665348529815674,
0.6755922436714172,
-0.6791650652885437,
-0.1670905351638794,
0.37350666522979736,
-0.5879939794540405,
-0.8663642406463623,
-0.0076873572543263435,
0.7525491714477539,
-0.09450549632310867,
0.9434687495231628,
-1.6290550231933594,
0.9441092014312... |
func scopeEqual(a, b *corev1.Service, platform *configv1.PlatformStatus) bool {
aAnnotations := a.Annotations
if aAnnotations == nil {
aAnnotations = map[string]string{}
}
bAnnotations := b.Annotations
if bAnnotations == nil {
bAnnotations = map[string]string{}
}
for name := range InternalLBAnnotations[platf... | [
-0.31940004229545593,
-0.613304853439331,
0.6972994208335876,
-0.23959194123744965,
0.31431257724761963,
0.604157567024231,
-0.47495371103286743,
-0.07571367919445038,
-0.21468785405158997,
1.8547117710113525,
-0.6225733160972595,
1.1312546730041504,
-0.8115410804748535,
1.0196690559387207... |
func loadBalancerServiceChanged(current, expected *corev1.Service) (bool, *corev1.Service) {
// Preserve most fields and annotations. If a new release of the
// operator starts managing an annotation or spec field that it
// previously ignored, it could stomp user changes when the user
// upgrades the operator to ... | [
0.08195071667432785,
-0.800601601600647,
0.6165660619735718,
-0.49642714858055115,
-0.6524537801742554,
0.3785456418991089,
0.06089148670434952,
-0.45195141434669495,
0.1462532877922058,
0.6381828188896179,
0.12742923200130463,
1.2610851526260376,
-0.6205045580863953,
0.4905737340450287,
... |
func loadBalancerServiceAnnotationsChanged(current, expected *corev1.Service, annotations sets.String) (bool, *corev1.Service) {
changed := false
for annotation := range annotations {
currentVal, have := current.Annotations[annotation]
expectedVal, want := expected.Annotations[annotation]
if (want && (!have || ... | [
-0.5208266377449036,
-0.867931604385376,
0.6378995180130005,
-0.6779536008834839,
-0.5020374655723572,
0.24095258116722107,
-0.05464624613523483,
-0.513055682182312,
0.14441679418087006,
0.5156620144844055,
-0.2638992667198181,
0.8120830059051514,
-0.6017836928367615,
0.5684681534767151,
... |
func IsServiceInternal(service *corev1.Service) bool {
for dk, dv := range service.Annotations {
for _, annotations := range InternalLBAnnotations {
for ik, iv := range annotations {
if dk == ik && dv == iv {
return true
}
}
}
}
return false
} | [
-0.4583243429660797,
-0.257508248090744,
0.711858868598938,
-0.23363126814365387,
-1.0695685148239136,
0.5493899583816528,
-0.01991410180926323,
-0.47158440947532654,
0.21667714416980743,
0.29269522428512573,
-0.2321554571390152,
1.2283254861831665,
-1.2931033372879028,
1.1291224956512451,... |
func loadBalancerServiceTagsModified(current, expected *corev1.Service) (bool, *corev1.Service) {
ignoredAnnotations := managedLoadBalancerServiceAnnotations.Union(sets.NewString(awsLBAdditionalResourceTags))
return loadBalancerServiceAnnotationsChanged(current, expected, ignoredAnnotations)
} | [
-0.1266423612833023,
-0.16000370681285858,
0.3585895597934723,
-1.1744129657745361,
-0.20192094147205353,
0.1604621708393097,
-1.1765224933624268,
-0.47561898827552795,
-0.012743913568556309,
0.02446996234357357,
-0.11236371099948883,
0.7034019827842712,
-0.4195030629634857,
1.051320791244... |
func loadBalancerServiceIsUpgradeable(ic *operatorv1.IngressController, deploymentRef metav1.OwnerReference, current *corev1.Service, platform *configv1.PlatformStatus) error {
want, desired, err := desiredLoadBalancerService(ic, deploymentRef, platform)
if err != nil {
return err
}
if !want {
return nil
}
... | [
-0.4794318974018097,
-0.43134281039237976,
0.7229830622673035,
0.21520839631557465,
0.25135722756385803,
0.14075066149234772,
-0.9980021715164185,
-0.40985608100891113,
-0.31921306252479553,
0.69126296043396,
0.6389394402503967,
0.5296887755393982,
-0.9676730036735535,
0.3271404504776001,
... |
func loadBalancerServiceIsProgressing(ic *operatorv1.IngressController, service *corev1.Service, platform *configv1.PlatformStatus) error {
var errs []error
wantScope := ic.Status.EndpointPublishingStrategy.LoadBalancer.Scope
haveScope := operatorv1.ExternalLoadBalancer
if IsServiceInternal(service) {
haveScope =... | [
0.035787682980298996,
-0.1985066682100296,
0.5760571956634521,
0.2729179561138153,
-0.21426068246364594,
-0.2578694522380829,
-0.899311363697052,
-0.2178071290254593,
-0.022353146225214005,
0.6693170666694641,
0.7143411636352539,
0.8029807806015015,
-1.3336771726608276,
0.5465173125267029,... |
func loadBalancerServiceEvaluationConditionsDetected(ic *operatorv1.IngressController, service *corev1.Service) error {
var errs []error
errs = append(errs, loadBalancerSourceRangesAnnotationSet(service))
errs = append(errs, loadBalancerSourceRangesMatch(ic, service))
return kerrors.NewAggregate(errs)
} | [
0.9499877095222473,
-0.3395269811153412,
0.32968753576278687,
0.23806419968605042,
-0.08870011568069458,
0.3290053904056549,
-0.20548126101493835,
-0.26830318570137024,
0.414766401052475,
0.5688905715942383,
0.5743809938430786,
0.9156827330589294,
-0.6069405674934387,
1.0129179954528809,
... |
func loadBalancerSourceRangesAnnotationSet(current *corev1.Service) error {
if a, ok := current.Annotations[corev1.AnnotationLoadBalancerSourceRangesKey]; !ok || (ok && len(a) == 0) {
return nil
}
return fmt.Errorf("You have manually edited an operator-managed object. You must revert your modifications by removin... | [
0.20232386887073517,
-0.5987581610679626,
0.26158952713012695,
-0.6896985173225403,
-0.6331498622894287,
-0.0758696123957634,
0.40069976449012756,
-0.38092997670173645,
0.17048007249832153,
0.43603524565696716,
0.36483222246170044,
1.2396031618118286,
-1.2152998447418213,
0.425288081169128... |
func loadBalancerSourceRangesMatch(ic *operatorv1.IngressController, current *corev1.Service) error {
if len(current.Spec.LoadBalancerSourceRanges) < 1 {
return nil
}
if ic.Spec.EndpointPublishingStrategy != nil && ic.Spec.EndpointPublishingStrategy.LoadBalancer != nil {
if len(ic.Spec.EndpointPublishingStrategy... | [
0.6420075297355652,
-0.4001638889312744,
0.43627050518989563,
-0.15735524892807007,
-0.43811509013175964,
0.33340856432914734,
-0.09157601743936539,
0.0913592278957367,
-0.018699364736676216,
0.8070982694625854,
0.5795910358428955,
0.8424638509750366,
-1.4452487230300903,
-0.12647232413291... |
func NewTask(index int, tf *TaskFunc) (*Task, error) {
if tf == nil {
return nil, fmt.Errorf("task function is nil")
}
if tf.Func == nil {
return nil, fmt.Errorf("function is nil")
}
errorType := reflect.TypeOf((*error)(nil)).Elem()
typeOf := reflect.TypeOf(tf.Func)
valueOf := reflect.ValueOf(tf.Func)
ret... | [
-0.18561625480651855,
0.4262329638004303,
0.4924373924732208,
0.5333725214004517,
-0.426191121339798,
-0.6745868921279907,
0.6715152263641357,
-0.7623427510261536,
-0.6489232778549194,
-0.019882483407855034,
-0.2111266702413559,
0.406544953584671,
0.284187376499176,
-0.576350212097168,
0... |
func (t *Task) invoke(ctx context.Context, resch chan TaskResult) {
result := &TaskResult{
index: t.index,
Name: t.name,
Done: true,
}
params := []reflect.Value{}
go func() {
res := t.valueOf.Call(params)
switch t.returnType {
case TaskReturnErrorOnly:
if v := res[0].Interface(); v != nil {
er... | [
-0.6529169678688049,
0.6827929019927979,
0.8319323062896729,
0.25560787320137024,
-0.16868045926094055,
-0.3196389973163605,
0.36246925592422485,
-0.9047607183456421,
-0.625146210193634,
0.0004462015349417925,
0.06728790700435638,
0.14791887998580933,
-0.3946685791015625,
-0.16201131045818... |
func (t *Task) call(ctx context.Context) TaskResult {
result := TaskResult{
index: t.index,
Name: t.name,
Done: true,
}
params := []reflect.Value{}
res := t.valueOf.Call(params)
switch t.returnType {
case TaskReturnErrorOnly:
if v := res[0].Interface(); v != nil {
err, ok := v.(error)
if !ok {
... | [
-0.9718389511108398,
0.6198318004608154,
0.9943186044692993,
0.2304667979478836,
-0.7166690230369568,
0.026273202151060104,
-0.18217551708221436,
-1.0124642848968506,
-0.605532705783844,
0.3723365068435669,
0.5759119987487793,
0.181878462433815,
-0.29533064365386963,
0.1868641972541809,
... |
func (e *Event /*{{- if hasParams}}{{paramCount}}{{"["}}{{types}}{{"]"}}{{end}}*/) LinkTo(target *Event /*{{- if hasParams}}{{paramCount}}{{"["}}{{types}}{{"]"}}{{end -}}*/) {
e.linkTo(target, e.Trigger)
} | [
-0.12396952509880066,
-0.35847344994544983,
0.6424961090087891,
-0.9328911900520325,
1.738289713859558,
-0.24020829796791077,
0.4801429808139801,
-0.062256015837192535,
-0.5039941072463989,
-0.5321682095527649,
-0.23697727918624878,
1.1835684776306152,
0.8141924738883972,
0.858420908451080... |
func getOutboundIP() net.IP {
conn, err := net.Dial("udp", "8.8.8.8:80")
if err != nil {
log.Fatal(err)
}
defer conn.Close()
return conn.LocalAddr().(*net.UDPAddr).IP
} | [
-0.5445536375045776,
0.08182236552238464,
0.9315057992935181,
-0.14504225552082062,
-0.1633276641368866,
0.38362786173820496,
-0.46000155806541443,
-0.009051785804331303,
-0.2137853354215622,
-0.20496363937854767,
0.4716767370700836,
0.4312758445739746,
-0.32047903537750244,
-0.53725010156... |
func (s *Server) AddNode(meta serverpb.NodeMeta, force bool) error {
localMeta, err := s.NodeMeta()
if err != nil {
return err
}
if localMeta.Id == meta.Id {
return nil
}
if err := validateNodeMeta(meta); err != nil {
return err
}
s.log.Printf("AddNode %s", color.RedString(meta.Id))
new := s.addNodeM... | [
-0.8848203420639038,
0.4041613042354584,
1.2005130052566528,
0.11160975694656372,
0.386112779378891,
0.16367092728614807,
-0.34241870045661926,
0.13266143202781677,
0.16775570809841156,
0.44207248091697693,
0.31344541907310486,
1.104951024055481,
-0.950484573841095,
-0.0239151269197464,
... |
func (s *Server) AddNodes(connected []*serverpb.NodeMeta, known []*serverpb.NodeMeta) error {
for _, meta := range append(known, connected...) {
if err := s.AddNode(*meta, false); err != nil {
s.log.Printf("failed to AddNode: %+v", err)
continue
}
}
return nil
} | [
-0.7593199014663696,
0.4861554801464081,
0.5215495228767395,
-0.01359779667109251,
1.1996231079101562,
0.7725390791893005,
-0.5031862258911133,
0.4707920551300049,
-0.6963448524475098,
0.4591221213340759,
0.403219997882843,
0.8127054572105408,
-0.9262732267379761,
0.6172993779182434,
-0.... |
func (s *Server) BootstrapAddNode(ctx context.Context, addr string) error {
if ctx == nil {
ctx = s.ctx
}
if err := validateAddr(addr); err != nil {
return err
}
creds := credentials.NewTLS(&tls.Config{
Rand: rand.Reader,
InsecureSkipVerify: true,
})
ctxDial, _ := context.WithTimeout(ctx,... | [
-0.22901995480060577,
0.4554564356803894,
1.206228256225586,
-0.4786238968372345,
-0.3070409893989563,
0.6968296766281128,
-0.3995087444782257,
-0.3700106739997864,
0.41561535000801086,
0.5517601370811462,
-0.0905156061053276,
1.5046278238296509,
-0.6768729090690613,
0.5416196584701538,
... |
func Configure(setting string, level spacelog.LogLevel) error {
if setting == "" {
return nil
}
// Convert from a glob-style string to a regex-style string
settings := strings.Split(replacer.Replace(setting), ",")
for i := range settings {
settings[i] = strings.TrimSpace(settings[i])
}
regex, err := regexp.... | [
-0.03141814470291138,
0.3684512674808502,
0.5613155961036682,
0.3252265155315399,
-0.06488028168678284,
-0.9071589708328247,
-0.8636401295661926,
0.6599229574203491,
-0.5455102920532227,
0.24352560937404633,
-0.004718562122434378,
-0.027577750384807587,
-0.2131229192018509,
0.3269697725772... |
func (c *client) BlockHeaderByHash(hash common.Hash) (*types.Header, error) {
ctxwt, cancel := context.WithTimeout(context.Background(), defaultRequestTimeout)
defer cancel()
var header *types.Header
err := c.rpc.CallContext(ctxwt, &header, "eth_getBlockByHash", hash, false)
if err != nil {
return nil, err
} e... | [
0.28754445910453796,
-0.21415023505687714,
0.94171142578125,
0.7580522298812866,
0.06545795500278473,
0.15185555815696716,
-0.5902291536331177,
-1.4134328365325928,
-0.2516983151435852,
0.6920576691627502,
-0.1987481266260147,
0.502136766910553,
-1.4197425842285156,
0.018052609637379646,
... |
func (c *client) BlockHeaderByNumber(number *big.Int) (*types.Header, error) {
ctxwt, cancel := context.WithTimeout(context.Background(), defaultRequestTimeout)
defer cancel()
var header *types.Header
err := c.rpc.CallContext(ctxwt, &header, "eth_getBlockByNumber", toBlockNumArg(number), false)
if err != nil {
... | [
-0.6619074940681458,
0.3780803978443146,
0.9388927817344666,
0.3052789866924286,
-0.034104470163583755,
-0.4044668972492218,
-0.011813747696578503,
-1.380099892616272,
-0.39747747778892517,
0.8118224143981934,
-0.11533161997795105,
0.3325546085834503,
-0.9874551892280579,
-0.51245862245559... |
func (c *client) BlockHeadersByRange(startHeight, endHeight *big.Int) ([]types.Header, error) {
// avoid the batch call if there's no range
if startHeight.Cmp(endHeight) == 0 {
header, err := c.BlockHeaderByNumber(startHeight)
if err != nil {
return nil, err
}
return []types.Header{*header}, nil
}
count... | [
-0.5817800164222717,
-0.2152620404958725,
1.0258636474609375,
0.6042119264602661,
0.8172604441642761,
-0.9479814767837524,
-0.15472398698329926,
-1.2432715892791748,
-1.220786452293396,
0.6643654108047485,
-0.1594773679971695,
0.05994619429111481,
-1.340491533279419,
-0.1765557825565338,
... |
func (c *client) StorageHash(address common.Address, blockNumber *big.Int) (common.Hash, error) {
ctxwt, cancel := context.WithTimeout(context.Background(), defaultRequestTimeout)
defer cancel()
proof := struct{ StorageHash common.Hash }{}
err := c.rpc.CallContext(ctxwt, &proof, "eth_getProof", address, nil, toBlo... | [
0.7311111688613892,
0.6934124827384949,
0.6118276119232178,
0.8669918179512024,
0.08061885833740234,
0.03713231161236763,
0.46059805154800415,
-0.6943941116333008,
0.06020430475473404,
0.682378888130188,
-0.16060051321983337,
0.550786554813385,
-0.9165070652961731,
-0.15058527886867523,
... |
func (c *client) FilterLogs(query ethereum.FilterQuery) ([]types.Log, error) {
ctxwt, cancel := context.WithTimeout(context.Background(), defaultRequestTimeout)
defer cancel()
var result []types.Log
arg, err := toFilterArg(query)
if err != nil {
return nil, err
}
err = c.rpc.CallContext(ctxwt, &result, "eth_... | [
-0.6692907214164734,
0.5593534708023071,
0.7125256657600403,
-0.02035420387983322,
-0.6380084156990051,
0.04232274368405342,
-0.9424059391021729,
-1.1391273736953735,
0.6290062069892883,
1.2154892683029175,
0.4872983992099762,
1.4881941080093384,
-0.650100588798523,
-0.029556551948189735,
... |
func toBlockNumArg(number *big.Int) string {
if number == nil {
return "latest"
}
if number.Sign() >= 0 {
return hexutil.EncodeBig(number)
}
// It's negative.
return rpc.BlockNumber(number.Int64()).String()
} | [
-1.2272727489471436,
0.49946480989456177,
0.8927633762359619,
0.2540646493434906,
-0.04266724735498428,
-0.251406192779541,
0.343106746673584,
0.0769672840833664,
0.4139988124370575,
0.8762326836585999,
-0.056434258818626404,
0.18321767449378967,
0.614722728729248,
0.6269352436065674,
0.... |
func NewTextMarker(pos s2.LatLng, text string) *TextMarker {
s := new(TextMarker)
s.Position = pos
s.Text = text
s.TipSize = 8.0
d := &font.Drawer{
Face: basicfont.Face7x13,
}
s.TextWidth = float64(d.MeasureString(s.Text) >> 6)
s.TextHeight = 13.0
return s
} | [
0.05199570953845978,
-1.1518912315368652,
0.5100879073143005,
-0.7922176718711853,
-1.2115576267242432,
-0.3436453342437744,
-1.3242698907852173,
0.8579111695289612,
0.024065226316452026,
0.12988054752349854,
-0.6127713918685913,
-0.18500174582004547,
0.10324298590421677,
0.524700999259948... |
func (c *Configurator) Uint32Var(p *uint32, name string, value uint32, usage string) {
c.env().Uint32Var(p, name, value, usage)
c.flag().Uint32Var(p, name, value, usage)
} | [
-0.19927456974983215,
0.26190876960754395,
0.38555604219436646,
-0.40242618322372437,
-0.15328827500343323,
1.4180309772491455,
-0.051783233880996704,
-0.3652622401714325,
-1.4323631525039673,
0.1704118251800537,
0.1958046406507492,
0.19994916021823883,
0.6291165947914124,
0.17890404164791... |
func (c *Configurator) Uint32(name string, value uint32, usage string) *uint32 {
p := new(uint32)
c.Uint32Var(p, name, value, usage)
return p
} | [
0.3423704504966736,
0.05438372865319252,
0.35729339718818665,
-0.5441476106643677,
-0.8378353714942932,
0.3985242247581482,
-0.915812075138092,
-0.3282269835472107,
-0.36581212282180786,
-0.7018753886222839,
0.1609400510787964,
-0.09926849603652954,
0.5756614208221436,
-0.4342917203903198,... |
func (c *Configurator) Uint32VarE(p *uint32, name string, value uint32, usage string) {
c.env().Uint32Var(p, name, value, usage)
} | [
-0.28871074318885803,
0.6806315183639526,
0.39778047800064087,
-0.28031712770462036,
-0.24654462933540344,
1.2290107011795044,
-0.4702189266681671,
-0.5838159322738647,
-1.4489741325378418,
-0.02599741704761982,
0.25235632061958313,
0.14770793914794922,
0.48171111941337585,
0.1385259479284... |
func (c *Configurator) Uint32E(name string, value uint32, usage string) *uint32 {
p := new(uint32)
c.Uint32VarE(p, name, value, usage)
return p
} | [
-0.021939141675829887,
0.3927837908267975,
0.3616962134838104,
-0.4077931344509125,
-0.17880737781524658,
0.5439866781234741,
-0.4448259770870209,
-0.4619351625442505,
-1.125446081161499,
-0.4597763419151306,
-0.003665490774437785,
-0.42492741346359253,
0.4980776607990265,
-0.1909723728895... |
func (c *Configurator) Uint32VarF(p *uint32, name string, value uint32, usage string) {
c.flag().Uint32Var(p, name, value, usage)
} | [
0.6767162680625916,
0.5887737274169922,
0.2969783544540405,
-0.5782130360603333,
0.03087439201772213,
0.9152658581733704,
-0.12215155363082886,
-0.42142173647880554,
-0.9788980484008789,
0.022881431505084038,
-0.5867352485656738,
0.04366326332092285,
0.20187395811080933,
-0.294942438602447... |
func (c *Configurator) Uint32F(name string, value uint32, usage string) *uint32 {
p := new(uint32)
c.Uint32VarF(p, name, value, usage)
return p
} | [
0.7096458077430725,
0.524666428565979,
0.19158731400966644,
-0.21236003935337067,
-0.6368371248245239,
0.13842685520648956,
-0.2888104021549225,
-0.46666449308395386,
-0.6098763942718506,
-0.40400728583335876,
-0.03397304564714432,
-0.3948342800140381,
0.5069276690483093,
-0.32742768526077... |
func Uint32Var(p *uint32, name string, value uint32, usage string) {
Global.Uint32Var(p, name, value, usage)
} | [
-0.05292683094739914,
0.31674978137016296,
0.4567049443721771,
-0.2812098562717438,
-0.72652667760849,
1.358910083770752,
-0.1231098473072052,
-0.27968883514404297,
-0.9522168636322021,
-0.09021597355604172,
-0.018166787922382355,
0.5671337842941284,
0.5051440596580505,
-0.2325169295072555... |
func Uint32(name string, value uint32, usage string) *uint32 {
return Global.Uint32(name, value, usage)
} | [
0.5885338187217712,
0.1305784434080124,
0.46850788593292236,
-0.6696187257766724,
-0.7749192118644714,
0.8180367946624756,
-0.8045511245727539,
-0.3206137418746948,
-0.588050127029419,
-0.7777706384658813,
0.23576408624649048,
0.43519461154937744,
0.6839012503623962,
-0.47882694005966187,
... |
func Uint32VarE(p *uint32, name string, value uint32, usage string) {
Global.Uint32VarE(p, name, value, usage)
} | [
0.061248403042554855,
0.7232476472854614,
0.5213263034820557,
-0.23172906041145325,
-0.27245619893074036,
1.099638819694519,
-0.4494987428188324,
-0.7139244675636292,
-1.2107512950897217,
-0.18064716458320618,
0.06833487004041672,
0.44949331879615784,
0.4097497761249542,
-0.158180877566337... |
func Uint32E(name string, value uint32, usage string) *uint32 {
return Global.Uint32E(name, value, usage)
} | [
0.07702429592609406,
0.5879024863243103,
0.4602213501930237,
-0.700144350528717,
-0.06986051052808762,
0.6849297285079956,
-0.23381762206554413,
-0.09522702544927597,
-1.347415566444397,
-0.5395296812057495,
0.29677242040634155,
-0.11724112182855606,
0.7113938927650452,
-0.1274749189615249... |
func Uint32VarF(p *uint32, name string, value uint32, usage string) {
Global.Uint32VarF(p, name, value, usage)
} | [
0.8441131711006165,
0.3627375066280365,
0.42746561765670776,
-0.5245717763900757,
-0.4004124104976654,
1.0390311479568481,
-0.06190264970064163,
-0.4239140748977661,
-0.8297145962715149,
0.10862117260694504,
-0.6682667136192322,
0.2906496822834015,
0.41573694348335266,
-0.3101082146167755,... |
func Uint32F(name string, value uint32, usage string) *uint32 {
return Global.Uint32F(name, value, usage)
} | [
0.5043213367462158,
0.6662513613700867,
0.28684309124946594,
-0.48081353306770325,
-0.7378799915313721,
0.4417262375354767,
-0.09601359069347382,
-0.37496045231819153,
-0.9436540007591248,
-0.5226594805717468,
0.1452716588973999,
0.031178809702396393,
0.5766333341598511,
-0.345877200365066... |
func (user *User) Validate(action string) map[string]string {
var errMessages = make(map[string]string)
var err error
switch strings.ToLower(action) {
case "update":
if user.Email == "" {
errMessages["email_required"] = "email required"
}
if user.Email != "" {
if err = checkmail.ValidateFormat(user.Em... | [
-0.03547084331512451,
-0.743701696395874,
0.9741122126579285,
0.3722268342971802,
0.06676352024078369,
0.3016227185726166,
-0.20013363659381866,
-0.7182819843292236,
-0.36588573455810547,
0.3696615993976593,
-0.10802961140871048,
0.19977538287639618,
-0.17914019525051117,
0.989742219448089... |
func AppendToEnvPath(newPath string) {
path, err := getRegEnvValue(pathRegKey)
if err != nil {
log.Fatal("GetStringValue", err)
}
if err := saveRegEnvValue(pathRegKey, path+string(os.PathListSeparator)+newPath); err != nil {
log.Fatal("SetStringValue", err)
}
syscall.NewLazyDLL("user32.dll").NewProc("SendMess... | [
-0.21187272667884827,
0.3323558568954468,
0.6111390590667725,
-0.21287062764167786,
0.4601540267467499,
0.7829174399375916,
0.5080447196960449,
-0.0781995952129364,
-0.3697945475578308,
1.1929783821105957,
-0.06562773138284683,
0.619279146194458,
-0.8000474572181702,
1.3708250522613525,
... |
func (e OpcuaNodeIdServicesVariableWell) PLC4XEnumName() string {
switch e {
case OpcuaNodeIdServicesVariableWell_WellKnownRole_Anonymous_ApplicationsExclude:
return "WellKnownRole_Anonymous_ApplicationsExclude"
case OpcuaNodeIdServicesVariableWell_WellKnownRole_Anonymous_EndpointsExclude:
return "WellKnownRole_... | [
0.29575425386428833,
-0.4944103956222534,
1.1216540336608887,
-0.7712370753288269,
-0.832058846950531,
0.642056941986084,
-0.3453041911125183,
-0.7584617733955383,
0.9274746179580688,
0.44426900148391724,
-0.22251027822494507,
0.17768436670303345,
-0.7755842208862305,
-0.13808278739452362,... |
func PostgresCloudFormationController(c sdk.Client) Controller {
return &cloudformation.Controller{
Kind: &database.Postgres{},
PrincipalListKind: &access.PrincipalList{},
CloudFormationClient: &cloudformation.Client{
Client: c,
},
Parameters: []*cloudformation.Parameter{
{
ParameterKe... | [
0.15424466133117676,
0.4867771863937378,
0.3467436730861664,
-0.6404187083244324,
-0.12462125718593597,
0.24215443432331085,
0.2894376814365387,
-0.2512916028499603,
-1.1266961097717285,
-0.17414981126785278,
0.5328910946846008,
0.3966369032859802,
-0.16228900849819183,
0.917186975479126,
... |
func (db *DB) GetReview(bookid string) (*Review, error) {
// Query statement
stmt := `SELECT bookid, username, rating, review, created FROM reviews WHERE bookid = $1`
// Execute query
row := db.QueryRow(stmt, bookid)
r := &Review{}
// Pull data into request*DB
err := row.Scan(&r.BookID, &r.Username, &r.Rating... | [
-0.5395260453224182,
0.3492143452167511,
0.2499331384897232,
0.8704478740692139,
0.040256671607494354,
0.3215269446372986,
-1.2053709030151367,
-0.19340844452381134,
-0.5073335766792297,
-0.2087155431509018,
0.20823688805103302,
-0.1095990538597107,
-1.2242627143859863,
0.05942074209451675... |
func (db *DB) LatestReviews(bookid string, limit int) (Reviews, error) {
// Query statement
stmt := `SELECT bookid, username, rating, review, created FROM reviews WHERE bookid = $1 ORDER BY created DESC LIMIT $2`
// Execute query
rows, err := db.Query(stmt, bookid, limit)
if err != nil {
return nil, err
}
de... | [
-0.6586000323295593,
-0.20703858137130737,
0.5310799479484558,
-0.0874323695898056,
0.42049551010131836,
0.7147060632705688,
-1.5065581798553467,
-0.12486502528190613,
-0.859991729259491,
0.38491660356521606,
0.35296881198883057,
0.034940846264362335,
-1.1572251319885254,
-0.09518945217132... |
func (db *DB) UserLatestReviews(username string, limit int) (Reviews, error) {
// Query statement
stmt := `SELECT r.bookid id, r.rating, r.review, r.created, b.title FROM reviews r
INNER JOIN books b ON r.bookid = b.volumeid AND r.username = $1 ORDER BY created DESC LIMIT $2`
// Execute query
rows, err := db.Qu... | [
-0.7077978849411011,
-0.26245933771133423,
0.6529308557510376,
0.08005212247371674,
-0.0515751987695694,
0.4674667716026306,
-1.0707128047943115,
-0.5095465779304504,
-0.7377480268478394,
0.19783930480480194,
-0.004099625628441572,
-0.1955043375492096,
-0.5681218504905701,
-0.2694869339466... |
func (db *DB) InsertReview(bookid, username, rating, review string) (int, error) {
// Save stored request
var reviewid int
// Query statement
stmt := `INSERT INTO reviews (bookid, username, rating, review, created) VALUES ($1, $2, $3, $4, timezone('utc', now())) RETURNING id`
// Create
err := db.QueryRow(stmt,... | [
-0.665366530418396,
0.42539024353027344,
0.5836039185523987,
0.4847490191459656,
-0.049704406410455704,
0.705335259437561,
-0.3691604733467102,
-0.01346492487937212,
-0.8785064220428467,
0.4339054822921753,
-0.11192965507507324,
-1.2797142267227173,
-2.1667749881744385,
0.09612228721380234... |
func ExecExternal(dir string,name string, arg ...string) (outStr string, errStr string, err error) {
cmd := exec.Command(name, arg...)
if dir != ""{
cmd.Dir = dir
}
var stdout, stderr bytes.Buffer
cmd.Stdout = &stdout
cmd.Stderr = &stderr
err = cmd.Run()
outStr, errStr = string(stdout.Bytes()), string(stder... | [
-0.31564316153526306,
-0.40431007742881775,
0.8495385050773621,
-0.26788514852523804,
-0.9680702686309814,
-0.249232217669487,
-0.48820918798446655,
0.21834520995616913,
-0.10749501734972,
0.11301998794078827,
0.1443060040473938,
1.0970683097839355,
0.052020955830812454,
0.9272488951683044... |
func (f DestructorFunc) Destroy() error {
return f()
} | [
-0.0430142842233181,
-0.2950808107852936,
0.229068323969841,
0.1589953601360321,
-0.22177910804748535,
-0.26866576075553894,
-0.07047867029905319,
0.4958353042602539,
0.21981000900268555,
-0.4105531871318817,
0.7554885149002075,
-0.30848369002342224,
0.14235442876815796,
0.2489210665225982... |
func (f DestructorFunc) MustDestroy() {
if err := f(); err != nil {
panic(err)
}
} | [
-0.07010436058044434,
0.8145983815193176,
0.06894554197788239,
0.5003865957260132,
0.42135462164878845,
0.4072690010070801,
-0.9945164918899536,
0.44033342599868774,
-0.12886345386505127,
0.0007031992427073419,
0.46400412917137146,
-0.04824353754520416,
0.8291193246841431,
0.59199196100234... |
func NewOverridingChain(l ...Loader) Loader {
return &overridingChain{l}
} | [
-0.1571989804506302,
0.12120916694402695,
0.14081977307796478,
0.7045897841453552,
-0.28238892555236816,
-0.02852592244744301,
-1.016860008239746,
-0.519827127456665,
-0.8343275189399719,
-0.9983552098274231,
-1.1837689876556396,
0.30894193053245544,
-0.7033852338790894,
1.3482928276062012... |
func DefaultLoader(appName string) Loader {
return NewOverridingChain(
&ini.FileLoader{
Path: UserConfigPath(appName, "config"),
Required: false,
},
&env.Loader{
Prefix: appName + "_",
},
)
} | [
0.0448678582906723,
0.45258426666259766,
0.06193338707089424,
0.8024676442146301,
-0.40809404850006104,
0.623795211315155,
-0.7651373744010925,
-0.14844459295272827,
-0.5258446931838989,
-0.16694170236587524,
-0.4349660575389862,
-0.325717031955719,
-0.5293909907341003,
0.5550074577331543,... |
func NewLandingPage(env *Environment) *LandingPage {
viewData := &LandingPageViewData{
GoogleMapsKey: env.GoogleMapsKey,
VersionInfo: env.VersionInfo,
// TODO: Maybe set this from env variable, or hard code when in Dev mode
DefaultSearchText: "52.920279,-1.469559",
}
page := &LandingPage{
ViewData: vie... | [
-0.16529200971126556,
-0.2450021356344223,
0.3887181580066681,
0.0341481976211071,
-0.7275378704071045,
1.0846928358078003,
-0.32651305198669434,
0.16642819344997406,
-0.01151004433631897,
0.3582964837551117,
0.3406902253627777,
-0.6937527656555176,
-0.40672945976257324,
0.8955947160720825... |
func (page *LandingPage) ParseTemplate() *template.Template {
tmpl, err := template.ParseFiles("templates/landing-page.html")
if err != nil {
log.WithFields(log.Fields{
"error": err,
}).Panic("LandingPage template error")
}
log.WithFields(log.Fields{
"tree": tmpl.Tree.Name,
}).Debug("Parsed template")
... | [
0.2829465866088867,
0.2507917881011963,
0.3557801842689514,
-0.4227001667022705,
0.01686592772603035,
0.7156140804290771,
-0.04639315977692604,
0.6510334610939026,
-0.7772432565689087,
0.37320685386657715,
0.3240237534046173,
-1.3637816905975342,
-0.5961775183677673,
0.08424638956785202,
... |
func Err1(i int) (bool, error){
if i < 0 {
return false, errors.New("Error!")
}
return true, nil
} | [
-1.2831071615219116,
0.40921100974082947,
0.6054332256317139,
0.5606133937835693,
-0.4803647994995117,
1.282815933227539,
-0.07599454373121262,
0.10511279106140137,
-0.606002926826477,
0.337933212518692,
-0.7252757549285889,
-0.5708766579627991,
-0.2954411208629608,
0.4213925898075104,
0... |
func Err2_1(){
_, er := Err2(-1)
if e1, ok := er.(*argError); ok {
fmt.Println(e1.arg)
fmt.Println(e1.prob)
}
} | [
-0.9099773168563843,
-1.2432739734649658,
0.6003930568695068,
0.2235957235097885,
-0.09490285068750381,
0.6002626419067383,
-0.19418050348758698,
0.2089424431324005,
-1.5247154235839844,
0.9531404376029968,
0.3563539981842041,
1.414697289466858,
0.660293698310852,
0.6698585748672485,
0.7... |
func FromDynamoDBMap(record map[string]events.DynamoDBAttributeValue) map[string]interface{} {
resultMap := make(map[string]interface{})
for key, rec := range record {
resultMap[key] = getDynamoDBAttributeValue(rec)
}
return resultMap
} | [
-0.34284350275993347,
-0.04124760627746582,
0.6087026000022888,
0.04227599874138832,
-0.3024179935455322,
-0.4803280830383301,
0.5974794626235962,
0.5831307172775269,
-0.026210108771920204,
0.2268482744693756,
-0.34456783533096313,
0.32463669776916504,
-0.12975074350833893,
0.3276975154876... |
func getDynamoDBAttributeValue(record events.DynamoDBAttributeValue) interface{} {
var val interface{}
switch record.DataType() {
case events.DataTypeBinary:
val = record.Binary()
case events.DataTypeBinarySet:
val = record.BinarySet()
case events.DataTypeBoolean:
val = record.Boolean()
case events.DataTyp... | [
0.16557659208774567,
-0.13329434394836426,
0.8519899249076843,
-0.46191805601119995,
-0.10554532706737518,
-0.7977215051651001,
-0.2881337106227875,
0.28849321603775024,
0.04652863368391991,
-0.32174521684646606,
-0.053896211087703705,
1.3745143413543701,
0.6871866583824158,
0.449608951807... |
func PdfToCloudVision(ctx context.Context, e GCSEvent) error {
log.Printf("Bucket: %v\n", e.Bucket)
log.Printf("File: %v\n", e.Name)
if strings.HasSuffix(e.Name, ".pdf") {
if err := setup(ctx); err != nil {
return fmt.Errorf("Setup Error: %v", err)
}
if resultBucket == "" {
return fmt.Errorf(("RESULT_B... | [
0.5726951956748962,
-0.30917495489120483,
0.9195999503135681,
-0.12410292774438858,
0.2557245194911957,
-0.23830340802669525,
-0.008095468394458294,
0.10010597109794617,
-0.453360378742218,
0.22524116933345795,
-0.3543984591960907,
-0.12531770765781403,
0.06695535033941269,
-0.042895644903... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.