text
stringlengths
11
6.3k
embedding
listlengths
768
768
func ReadFile(input string) (file *os.File, err error) { goPaths := filepath.SplitList("GOPATH") if len(goPaths) == 0 { return nil, errors.New("GOPATH environment variable is not set or empty") } goRoot := runtime.GOROOT() if goRoot == "" { return nil, errors.New("GOROOT environment variable is not set or emp...
[ 0.1498778611421585, 0.1810944825410843, 0.964472234249115, 0.5883983969688416, 0.6440773606300354, 1.320313572883606, 0.6936002969741821, 0.12989240884780884, -1.4918526411056519, 0.09684086591005325, 1.377678394317627, 0.23196722567081451, -0.5330748558044434, 0.6432598829269409, 0.4473...
func ReadContent(file *os.File) (header []string, body [][]string, err error) { r := csv.NewReader(file) // 逐行读取 records, err := r.ReadAll() if err != nil { return nil, nil, err } header = records[0] body = records[1:] return header, body, nil }
[ -0.28958243131637573, -0.8893624544143677, 0.8910410404205322, -0.2448686957359314, -0.2695668041706085, 0.7014022469520569, -0.02744799107313156, -0.1360556185245514, -1.1377400159835815, 0.9717078804969788, -0.06581563502550125, 0.3908286988735199, -0.7058398127555847, -0.362951427698135...
func fiat_bls575_addcarryx_u64(x uint64, y uint64, carry fiat_bls575_uint1) (uint64, fiat_bls575_uint1) { var sum uint64 var carryOut uint64 sum, carryOut = bits.Add64(x, y, uint64(carry)) return sum, fiat_bls575_uint1(carryOut) }
[ -0.4377598464488983, 0.5142063498497009, 0.8492188453674316, 0.9308222532272339, 0.03176386281847954, 0.15804444253444672, -0.3255981206893921, -0.5782148838043213, -0.8043378591537476, -0.560256838798523, -0.6173039674758911, -0.43849167227745056, 0.17360548675060272, 0.1285729855298996, ...
func fiat_bls575_subborrowx_u64(x uint64, y uint64, carry fiat_bls575_uint1) (uint64, fiat_bls575_uint1) { var sum uint64 var carryOut uint64 sum, carryOut = bits.Sub64(x, y, uint64(carry)) return sum, fiat_bls575_uint1(carryOut) }
[ -0.4326847791671753, 0.888788640499115, 0.6732028126716614, 1.218618631362915, -0.5779628753662109, -0.10033433139324188, -0.014315051957964897, -0.3452893793582916, -0.7594073414802551, -0.29919829964637756, -0.9591904282569885, -0.5260807871818542, -0.251046359539032, -0.2827526330947876...
func fiat_bls575_cmovznz_u1(out1 *fiat_bls575_uint1, arg1 fiat_bls575_uint1, arg2 fiat_bls575_uint1, arg3 fiat_bls575_uint1) { var x1 fiat_bls575_uint1 = ((arg1 & arg3) | ((^arg1) & arg2)) *out1 = x1 }
[ -0.6279298067092896, 0.3029642105102539, 0.4754619002342224, 1.3634111881256104, -0.5584246516227722, 0.5866587162017822, 1.0460947751998901, 1.16266667842865, -0.48732268810272217, 0.2359492927789688, -0.84498530626297, 0.43101122975349426, 0.05151422321796417, 0.035824622958898544, -0....
func fiat_bls575_cmovznz_u64(out1 *uint64, arg1 fiat_bls575_uint1, arg2 uint64, arg3 uint64) { var x1 uint64 = (uint64(arg1) * 0xffffffffffffffff) var x2 uint64 = ((x1 & arg3) | ((^x1) & arg2)) *out1 = x2 }
[ -0.7282926440238953, 0.45949724316596985, 0.359512597322464, 1.530010461807251, -0.5454288721084595, -0.2024923413991928, 0.7656809687614441, 0.43374747037887573, -0.7792478203773499, -0.19490036368370056, -0.7097926139831543, -0.071007139980793, -0.2208612710237503, 0.4601154029369354, ...
func fiat_bls575_selectznz(out1 *[9]uint64, arg1 fiat_bls575_uint1, arg2 *[9]uint64, arg3 *[9]uint64) { var x1 uint64 fiat_bls575_cmovznz_u64(&x1, arg1, (arg2[0]), (arg3[0])) var x2 uint64 fiat_bls575_cmovznz_u64(&x2, arg1, (arg2[1]), (arg3[1])) var x3 uint64 fiat_bls575_cmovznz_u64(&x3, arg1, (arg2[2]), (a...
[ -0.13536711037158966, -0.5051601529121399, 0.6509155631065369, 0.6653421521186829, -0.35066720843315125, -0.8753385543823242, 1.0876649618148804, -0.013688995502889156, -0.3160117268562317, 0.6658808588981628, -0.9130581021308899, 0.03241067752242088, -0.30566778779029846, 0.11591050773859...
func (c *Client) GetISvcsHealth(IServiceNames []string) ([]isvcs.IServiceHealthResult, error) { results := []isvcs.IServiceHealthResult{} if err := c.call("GetISvcsHealth", IServiceNames, &results); err != nil { return nil, err } return results, nil }
[ -0.8912566900253296, 0.7986336350440979, 0.6585468649864197, 0.937370240688324, -0.15612053871154785, -0.3290552496910095, -0.8525875210762024, -1.094547152519226, 0.6890302300453186, 0.30469223856925964, -0.46345898509025574, 0.29289937019348145, -0.9910631775856018, 0.10484933108091354, ...
func (c *Client) GetServicesHealth() (map[string]map[int]map[string]health.HealthStatus, error) { results := make(map[string]map[int]map[string]health.HealthStatus) err := c.call("GetServicesHealth", empty, &results) return results, err }
[ -0.867497980594635, -0.02106318436563015, 0.6775140166282654, 0.645073413848877, -0.6311061382293701, 0.28468120098114014, -0.2272070348262787, -1.19282066822052, -0.08837933093309402, -0.4014159142971039, -0.9832067489624023, 0.4488883912563324, -0.3985556662082672, 0.717503011226654, -...
func (c *Client) ReportHealthStatus(key health.HealthStatusKey, value health.HealthStatus, expires time.Duration) error { request := HealthStatusRequest{ Key: key, Value: value, Expires: expires, } return c.call("ReportHealthStatus", request, nil) }
[ -0.4531738758087158, 0.6155039668083191, 0.32789453864097595, -0.07533234357833862, 0.0824713483452797, -0.36570844054222107, -0.9727616310119629, -0.42879238724708557, -0.02020847052335739, -0.08405464142560959, -0.8959445357322693, 0.8696578741073608, 0.06815407425165176, 0.7523708343505...
func (c *Client) ReportInstanceDead(serviceID string, instanceID int) error { request := ReportDeadInstanceRequest{ ServiceID: serviceID, InstanceID: instanceID, } return c.call("ReportInstanceDead", request, nil) }
[ -0.9722630381584167, 0.06902948021888733, 0.4287014603614807, -0.9405946135520935, 0.3780365586280823, 0.7653595805168152, -0.07792077213525772, -0.004292226396501064, -0.056846410036087036, -0.06078055500984192, 0.07027324289083481, 1.6718082427978516, -1.337412714958191, 0.50925749540328...
func GetBlockTime(slot int64, cfg *config.Config) (types.BlockTime, error) { log.Println("Getting block time...") var result types.BlockTime ops := types.HTTPOptions{ Endpoint: cfg.Endpoints.RPCEndpoint, Method: http.MethodPost, Body: types.Payload{Jsonrpc: "2.0", Method: "getBlockTime", ID: 1, Params: [...
[ -0.9157949090003967, 0.6858413219451904, 1.0508050918579102, 0.21418467164039612, -0.018081769347190857, -0.16801492869853973, 0.007372110616415739, -1.5625966787338257, -0.6056796908378601, 1.5661848783493042, -0.3969483971595764, 0.3860592246055603, -1.4878761768341064, 1.351846694946289...
func ExpandEnumBool(v interface{}) *bool { s, ok := v.(string) if !ok { return nil } switch { case strings.EqualFold(s, "true"): return boolPtr(true) case strings.EqualFold(s, "false"): return boolPtr(false) default: return nil } }
[ -0.7138455510139465, 0.7181786894798279, 0.7849884033203125, 0.19208690524101257, -0.26163575053215027, -0.23679345846176147, -0.2521035969257355, 0.13165666162967682, 0.2624445855617523, 0.4988831877708435, -0.06654822826385498, -0.39951056241989136, -0.8689336776733398, 0.117951758205890...
func boolPtr(b bool) *bool { return &b }
[ 0.5048654675483704, -0.055136874318122864, 0.23087099194526672, -0.26578471064567566, -0.5850686430931091, 0.7497426271438599, -0.4392285645008087, -0.15804339945316315, -0.11349508911371231, -0.0028173262253403664, 0.1967521607875824, -0.5458070635795593, -0.5241993069648743, -0.929296910...
func CmdWhois(ctx *system.Context) { var ( m = ctx.Msg b = ctx.Ses guild *discordgo.Guild user *discordgo.User presence *discordgo.Presence member *discordgo.Member embed = dream.NewEmbed() err error ) if len(m.Mentions) > 0 { user = m.Mentions[0] } else if ctx.Args...
[ 0.25102823972702026, -0.04659395292401314, 1.0949761867523193, 0.1391095668077469, -0.2586991488933563, 0.7996964454650879, -0.3505512475967407, -0.5104584693908691, 0.740776002407074, 0.0842161774635315, 0.2498241513967514, 1.1197893619537354, 0.17131373286247253, 0.630474865436554, 0.1...
func NewTransportWith(t http.RoundTripper, r *consul.Resolver) http.RoundTripper { return &transport{ base: t, rslv: r, } }
[ 0.43443164229393005, -1.7254494428634644, 0.46283847093582153, 0.05695552006363869, -0.5205476880073547, -0.5170753002166748, -1.3433470726013184, -1.0814143419265747, 0.13795770704746246, 0.12056594341993332, -0.6855456829071045, 0.1499844640493393, 0.2368553876876831, -0.1041740998625755...
func NewCmdArgoPromote() (*cobra.Command, *Options) { o := &Options{} cmd := &cobra.Command{ Use: "argo", Aliases: []string{"argocd"}, Short: "Promotes a new Application version in an ArgoCD git repository", Long: cmdLong, Example: cmdExample, Run: func(cmd *cobra.Command, args []string) { er...
[ 0.2954682409763336, -0.9060879349708557, 0.8316414952278137, 0.16555960476398468, -0.11378847062587738, -0.17735886573791504, -0.4980091452598572, 0.6894060373306274, -0.7373030781745911, 0.2800427973270416, 0.18315176665782928, 0.9674854874610901, -0.0690072774887085, 0.4807182550430298, ...
func (o *Options) Run() error { err := o.Validate() if err != nil { return errors.Wrapf(err, "failed to validate options") } err = o.upgradeRepository(o.TargetGitURL) if err != nil { return errors.Wrapf(err, "failed to create Pull Request on repository %s", o.TargetGitURL) } return nil }
[ -0.5557569265365601, -0.039966680109500885, 0.6620973944664001, -0.11050847917795181, 1.2544032335281372, 0.2723432779312134, 0.20877590775489807, -0.0736403614282608, 0.06941083073616028, 0.21466858685016632, -0.13500970602035522, -0.04288499429821968, -0.037774939090013504, -0.0804787352...
func (e *ErrorBag) Get(key string) []Error { err, ok := e.errors[key] if !ok { return []Error{} } return err }
[ -1.1871761083602905, -0.34938180446624756, 0.5755042433738708, 0.3544516861438751, 0.8503821492195129, 0.07131034135818481, -1.262269139289856, -0.42118772864341736, -0.19552400708198547, 0.5614978075027466, -0.8535701036453247, 0.8880162835121155, -0.11592672765254974, 0.5722097754478455,...
func (e *ErrorBag) Failed() bool { return len(e.errors) > 0 }
[ -0.7040511965751648, -0.08612126111984253, 0.48451289534568787, 0.10919859260320663, 0.7263945937156677, 0.4328783452510834, -0.6948727965354919, -0.0838027223944664, 0.4162861704826355, -0.9548165202140808, -1.288022518157959, -0.9102901220321655, -0.4766613841056824, 1.2586865425109863, ...
func (cc *Cluster) IsQuorum(v uint64) bool { for _, q := range cc.Quorums { if v&q == q { return true } } return false }
[ -0.869362473487854, -0.20855659246444702, 0.49793875217437744, 0.4557676911354065, 0.10036025196313858, -0.8293418884277344, -0.46850350499153137, -0.8720542192459106, 1.3643136024475098, 0.7607389092445374, -0.12267960608005524, 0.7316847443580627, -0.39571982622146606, -0.177218511700630...
func (s StepAPIType) IsEffectiveStepType() bool { for _, v := range EffectiveStepType { if s == v { return true } } return false }
[ -1.0107181072235107, 0.019076313823461533, -0.016170084476470947, 0.9407888054847717, 0.20068778097629547, -0.04743839427828789, -0.6810230016708374, -0.5344783067703247, -0.2363099753856659, 0.73689866065979, -1.0954722166061401, -0.4648752808570862, -0.15715424716472626, 1.56172645092010...
func (e *RicEntry) Key() string { return e.Rt }
[ 0.41758355498313904, -0.5157251954078674, 0.36740463972091675, -0.3769213557243347, 0.8373152017593384, 1.3204123973846436, -0.2570194602012634, -0.08342543989419937, 0.20445236563682556, 0.8518955707550049, 0.37974342703819275, -0.17839285731315613, -0.233324334025383, -0.0187556687742471...
func NewRicTable() *RicTable { return &RicTable{ Entries: make(map[string]*RicEntry), } }
[ 0.9844701290130615, -0.5303654670715332, 0.017321940511465073, 0.05704626813530922, -0.388400673866272, -0.41008496284484863, 0.17042823135852814, -0.21435976028442383, -0.8557138442993164, 0.4002304673194885, -0.5248165726661682, 0.4956461191177368, -0.22407332062721252, -0.19334971904754...
func (t *RicTable) Add(c *RicEntry) { t.Mutex.Lock() defer t.Mutex.Unlock() t.Entries[c.Rt] = c }
[ 0.48175278306007385, -0.38268470764160156, 0.12482618540525436, -0.5148703455924988, 0.7860518097877502, 0.8426990509033203, 0.14172090590000153, -0.024349713698029518, -0.3869810104370117, 0.2651573717594147, -0.3006451427936554, 0.33684295415878296, -0.7479708194732666, 0.470953732728958...
func (t *RicTable) Delete(rt string) *RicEntry { t.Mutex.Lock() defer t.Mutex.Unlock() if entry, ok := t.Entries[rt]; ok { delete(t.Entries, rt) return entry } return nil }
[ 1.4788367748260498, -0.2544804513454437, 0.09645155072212219, 0.029670115560293198, 0.1004604771733284, -0.43691468238830566, 0.07813889533281326, -0.2937559485435486, 0.2744218707084656, 0.3995169699192047, 0.3835928738117218, -0.14872416853904724, -0.8665257692337036, -0.0067870896309614...
func (t *RicTable) Select(rt string, f func(*RicEntry)) bool { t.Mutex.RLock() defer t.Mutex.RUnlock() if e, ok := t.Entries[rt]; ok { f(e) return true } return false }
[ 0.24121125042438507, -0.32096680998802185, 0.23568806052207947, -0.3852403461933136, -0.057954948395490646, -0.6322534084320068, 0.03366147726774216, -0.4492988884449005, -0.8285391330718994, 0.5000441074371338, 0.15332013368606567, -0.09558796882629395, -0.018940774723887444, -0.699173331...
func (t *RicTable) Update(rt string, f func(*RicEntry)) bool { t.Mutex.Lock() defer t.Mutex.Unlock() if e, ok := t.Entries[rt]; ok { f(e) return true } return false }
[ -0.044752392917871475, -0.25714409351348877, 0.24091793596744537, -0.5365551114082336, -0.3139668107032776, -0.12568582594394684, -0.3793596029281616, 0.12462623417377472, -1.1911535263061523, 0.841007649898529, 0.05282256379723549, -0.6233586668968201, -0.2172996550798416, -0.357863277196...
func (t *RicTable) Range(f func(string, *RicEntry) error) error { t.Mutex.RLock() defer t.Mutex.RUnlock() for key, entry := range t.Entries { if err := f(key, entry); err != nil { return err } } return nil }
[ -0.3485475480556488, 0.0883130356669426, 0.22305512428283691, 0.842647910118103, 0.4734049439430237, -0.4194653034210205, 0.3359001874923706, 0.4787656366825104, -1.6242363452911377, 0.3960237205028534, 0.36955973505973816, -0.23281773924827576, 0.2406798154115677, -0.10843951255083084, ...
func SystemStatsOIDs() []*GoSNMPServer.PDUValueControlItem { toRet := []*GoSNMPServer.PDUValueControlItem{ { OID: "1.3.6.1.4.1.2021.11.1", Type: gosnmp.Integer, OnGet: func() (value interface{}, err error) { return GoSNMPServer.Asn1IntegerWrap(0), nil }, Document: "ssIndex", }, { OID: ...
[ -0.3873228430747986, 0.16300953924655914, 0.6126683950424194, -0.6623802185058594, -0.5335493683815002, -0.33840516209602356, -0.30232977867126465, -1.4924525022506714, 0.2775583863258362, -0.06736413389444351, -0.5278108716011047, 0.6775018572807312, -0.07330964505672455, 0.07997272163629...
func (ls *LocalStorage) createPVs(ctx context.Context, apiObject *api.ArangoLocalStorage, unboundClaims []v1.PersistentVolumeClaim) error { log := ls.deps.Log // Find provisioner clients clients, err := ls.createProvisionerClients() if err != nil { return maskAny(err) } if len(clients) == 0 { // No provisione...
[ -0.23849965631961823, -0.25813645124435425, 0.6508955359458923, -0.4358532726764679, 0.7098583579063416, -0.2822539806365967, -0.18864805996418, -0.5962467193603516, 0.26571542024612427, -0.015153366141021252, 1.2597163915634155, 0.0641554594039917, -0.14867949485778809, 0.6891305446624756...
func (ls *LocalStorage) createPV(ctx context.Context, apiObject *api.ArangoLocalStorage, clients []provisioner.API, clientsOffset int, volSize int64, claim v1.PersistentVolumeClaim, deploymentName, role string) error { log := ls.deps.Log // Try clients for clientIdx := 0; clientIdx < len(clients); clientIdx++ { cl...
[ 0.051490772515535355, -0.6761595010757446, 0.7946328520774841, -0.29542961716651917, 0.5410782694816589, 0.28787121176719666, 0.08578777313232422, -0.06669744104146957, -0.02007967047393322, 0.3725445568561554, 0.9114938378334045, 0.04132264479994774, 0.23400698602199554, -0.06644547730684...
func createValidEndpointList(list *v1.EndpointsList) []string { result := make([]string, 0, len(list.Items)) for _, ep := range list.Items { for _, subset := range ep.Subsets { for _, ip := range subset.Addresses { addr := net.JoinHostPort(ip.IP, strconv.Itoa(provisioner.DefaultPort)) result = append(res...
[ -0.9225383400917053, -0.5548058748245239, 0.5778512358665466, 0.5064600706100464, 0.6205897331237793, 0.24651990830898285, -0.5235036015510559, 0.11873063445091248, -0.17453891038894653, 1.1031696796417236, -0.20767627656459808, -0.8526939749717712, -0.14824584126472473, 0.1397289484739303...
func createNodeSelector(nodeName string) *v1.NodeSelector { return &v1.NodeSelector{ NodeSelectorTerms: []v1.NodeSelectorTerm{ v1.NodeSelectorTerm{ MatchExpressions: []v1.NodeSelectorRequirement{ v1.NodeSelectorRequirement{ Key: "kubernetes.io/hostname", Operator: v1.NodeSelectorOpIn, ...
[ -0.7024086713790894, -0.6211423873901367, 0.24596714973449707, -0.8564482927322388, -0.2727526128292084, 0.00739245256409049, -0.9396803379058838, -0.09446698427200317, -0.19922874867916107, 0.48827069997787476, -0.009217540733516216, 0.8436287641525269, -0.5419349670410156, 0.166323840618...
func createNodeClientMap(ctx context.Context, clients []provisioner.API) map[string]provisioner.API { result := make(map[string]provisioner.API) for _, c := range clients { if info, err := c.GetNodeInfo(ctx); err == nil { result[info.NodeName] = c } } return result }
[ -1.0023071765899658, -0.8409446477890015, 0.2987481355667114, -0.8116995692253113, 0.41461944580078125, 0.1713685244321823, 0.3655429482460022, -1.3450889587402344, -0.756136417388916, 0.580906867980957, 0.21652090549468994, 0.004264615476131439, 0.045101314783096313, 0.9207682609558105, ...
func getDeploymentInfo(pvc v1.PersistentVolumeClaim) (string, string, bool) { deploymentName := pvc.GetLabels()[k8sutil.LabelKeyArangoDeployment] role := pvc.GetLabels()[k8sutil.LabelKeyRole] enforceAntiAffinity, _ := strconv.ParseBool(pvc.GetAnnotations()[constants.AnnotationEnforceAntiAffinity]) // If annotation e...
[ -0.07540842890739441, -0.6581465601921082, 0.43884173035621643, -0.4211004972457886, 0.49365103244781494, 0.21623624861240387, -0.39388027787208557, 0.09438851475715637, -0.5642219185829163, 1.3406398296356201, 0.2564651072025299, -0.16776907444000244, 0.2925909161567688, 0.173362761735916...
func (ls *LocalStorage) filterAllowedNodes(clients map[string]provisioner.API, deploymentName, role string) ([]provisioner.API, error) { // Find all PVs for given deployment & role list, err := ls.deps.KubeCli.CoreV1().PersistentVolumes().List(metav1.ListOptions{ LabelSelector: fmt.Sprintf("%s=%s,%s=%s", k8sutil.La...
[ -0.2632530927658081, -0.5338545441627502, 0.6092272400856018, -0.7062631845474243, -1.1464345455169678, 0.5981780886650085, -0.2286601960659027, -0.7061468958854675, -0.08952614665031433, 1.3626859188079834, 1.1632460355758667, 1.2906931638717651, -0.6927611231803894, 0.14239615201950073, ...
func (ls *LocalStorage) bindClaimToVolume(claim v1.PersistentVolumeClaim, volumeName string) error { log := ls.deps.Log.With().Str("pvc-name", claim.GetName()).Str("volume-name", volumeName).Logger() pvcs := ls.deps.KubeCli.CoreV1().PersistentVolumeClaims(claim.GetNamespace()) for attempt := 0; attempt < 10; attemp...
[ 0.06008308008313179, -1.349671721458435, 0.9803602695465088, -0.24363502860069275, 0.41566893458366394, -0.11463195830583572, -0.7890333533287048, -0.7481399178504944, 0.39447203278541565, 0.5356987714767456, 0.8049301505088806, 0.8535493612289429, -0.14227867126464844, -0.0568766333162784...
func shortHash(name string) string { h := sha1.Sum([]byte(name)) return fmt.Sprintf("%0x", h)[:6] }
[ 1.726076602935791, -0.3408846855163574, 0.5392623543739319, -0.009092587977647781, -1.0289099216461182, 1.2373528480529785, -0.4927176237106323, -0.26467975974082947, 0.4578835070133209, 0.5703599452972412, -0.21528246998786926, 0.16010679304599762, -0.19046857953071594, -1.116122484207153...
func (win *winInfo) setTitle(position int, total int, path string) { win.window.SetTitle(winTitle + " - " + strconv.Itoa(position) + "/" + strconv.Itoa(total) + " - " + filepath.Base(path)) }
[ 0.31107887625694275, -1.026224970817566, 0.39028608798980713, -0.18623574078083038, -0.22427833080291748, 0.33251142501831055, -0.3113008439540863, -0.008547343313694, -0.634723961353302, -0.06401792913675308, -0.46730369329452515, -0.29822272062301636, -0.3567599058151245, -0.449273139238...
func (win *winInfo) renderText(text string) (*sdl.Texture, error) { surface, err := win.font.RenderUTF8Shaded(text, sdlColorBlack, sdlColorWhite) defer surface.Free() if err != nil { return nil, err } texture, err := win.renderer.CreateTextureFromSurface(surface) if err != nil { return nil, err } return t...
[ -0.0267357025295496, 0.1425197273492813, 0.19580534100532532, -0.26294001936912537, -1.1653081178665161, 0.1533569097518921, -0.372185617685318, -0.20122794806957245, 1.3093360662460327, 0.5407506823539734, -0.40428778529167175, -0.5919827222824097, -1.6618117094039917, -0.3962582647800445...
func (win *winInfo) displayLoading() { texture, _ := win.renderText("Loading...") ww, wh := win.window.GetSize() win.renderer.Copy(texture, nil, &sdl.Rect{X: int32(ww/2 - 50), Y: int32(wh/2 - 1), W: 65, H: 20}) texture.Destroy() win.renderer.Present() }
[ 0.4341108798980713, -0.5260195732116699, 0.5364284515380859, -1.014498233795166, -1.1176939010620117, 0.9931511282920837, 0.4737243354320526, 0.027687493711709976, -0.032937273383140564, 0.5832691192626953, 0.07557623088359833, 0.06755240261554718, -0.10813002288341522, 0.4412400722503662,...
func (win *winInfo) displayPictureInfo() { /* Display exif information */ go func(path string) { exif.Open(path) }(curImg().path) msg := filepath.Base(curImg().path) texture, _ := win.renderText(msg) width := int32(len(msg) * 8) win.renderer.Copy(texture, nil, &sdl.Rect{X: 2, Y: 2, W: width, H: 20}) texture...
[ 0.23828932642936707, -0.8995867371559143, 0.6027233004570007, -0.6931089758872986, -0.7889714241027832, 0.8712290525436401, 1.3540555238723755, 0.46803879737854004, 0.11855759471654892, 0.1882065385580063, -0.028774458914995193, 0.15314091742038727, 0.0006691848393529654, 0.333446890115737...
func init() { runtime.LockOSThread() // Video only if err := sdl.Init(sdl.INIT_VIDEO); err != nil { logger.Warning(err.Error()) } }
[ -0.0475936196744442, 0.2494254857301712, 0.4953209161758423, 1.484097957611084, 0.2267700582742691, 0.06857294589281082, -0.12253174185752869, -0.2038026601076126, 0.661042332649231, -0.4237562417984009, -0.17052775621414185, 1.0609325170516968, 0.11361827701330185, 0.5845012664794922, -...
func MainLoop(fullScreen bool, slideshow bool) int { var event sdl.Event var src, dst sdl.Rect var err error var flags uint32 = sdl.WINDOW_SHOWN | sdl.WINDOW_RESIZABLE | sdl.WINDOW_ALLOW_HIGHDPI // Load the font library if err := ttf.Init(); err != nil { logger.Warning("Unable to open font lib") } window.wi...
[ -0.1441771537065506, 0.3008207678794861, 1.1403981447219849, 0.20137657225131989, -0.782052218914032, -0.16296543180942535, 0.9365903735160828, 0.21254833042621613, 0.38405662775039673, -0.324214905500412, -0.20720437169075012, -0.3712916076183319, -0.11103326827287674, 0.4388154447078705,...
func ReceiveMsg(queue string) UpdatesChannel { chs := make(chan interface{}) var m interface{} go func() { conn, err := amqp.Dial(os.Getenv("RABBIT_URL")) failOnError(err, "Failed to connect to RabbitMQ") defer conn.Close() ch, err := conn.Channel() failOnError(err, "Failed to open a channel") defer ch...
[ -0.31232762336730957, -0.6947367787361145, 1.022486925125122, -0.769295334815979, 0.13840453326702118, -0.4263114631175995, -0.8461844325065613, -0.3003065288066864, -0.6685296297073364, 0.3634580671787262, 0.6226612329483032, 0.507193386554718, -0.35815462470054626, 1.059285283088684, 0...
func CachedPageHandler(c *gin.Context) { /* In this handler we will load in a html file as a string and return the contents to the browser This allows use to edit the index file and serve it with out having to make changes to the server */ content, err := ioutil.ReadFile("index.html") if err != nil { log...
[ 0.0006449222564697266, -0.6899964809417725, 0.6919193863868713, 0.24087651073932648, -0.4671613872051239, 0.7195402383804321, 0.4990331828594208, 0.5797258019447327, -0.20558960735797882, 0.19534853100776672, 0.036911774426698685, -0.2222924828529358, -0.5537428259849548, -0.16275198757648...
func (ps Paths) Has(path string) bool { for _, p := range ps { if p == path { return true } } return false }
[ 0.15994197130203247, 0.06759857386350632, 0.14472784101963043, 0.2880765199661255, 0.18581576645374298, 0.2988387644290924, -0.6033294796943665, 0.528563380241394, -0.9041035175323486, -0.5464842915534973, -0.443021297454834, -0.6273754835128784, -0.5909292697906494, 0.3375173807144165, ...
func (ps Paths) Permit(fields ...string) Paths { pms := mapset.NewSetFromSlice(InterfaceSlice(ps)) fms := mapset.NewSetFromSlice(InterfaceSlice(fields)) ms := pms.Intersect(fms) s := ms.ToSlice() l := len(s) paths := make(Paths, l) for i := 0; i < l; i++ { paths[i] = s[i].(string) } return paths }
[ -0.7482324242591858, 0.6105267405509949, 0.7315559983253479, 0.34245482087135315, -0.07271780073642731, 0.4969419836997986, -0.059977613389492035, -0.26860442757606506, -1.1325889825820923, -0.17554394900798798, 1.0970709323883057, -0.32523804903030396, -0.8141388297080994, 0.0013895522570...
func (ps Paths) Append(fields ...string) Paths { ps = append(ps, fields...) return ps }
[ -0.055481184273958206, 0.7220697402954102, 0.28422772884368896, 0.5576688051223755, -0.0205177441239357, 0.612777590751648, -0.5373958945274353, 0.39332908391952515, -0.6648666858673096, -0.8091902732849121, 0.10309212654829025, -0.8118102550506592, -0.326316773891449, 0.3245261311531067, ...
func CounterByNameSlice(files *[]string, f func(filename string) (int64, error)) (*map[string]int64, int64, []error) { countMap := make(map[string]int64) errs := []error{} if len(*files) == 0 { return &countMap, 0, nil } var wg sync.WaitGroup var total int64 var lock sync.Mutex wg.Add(len(*files)) for i :=...
[ 0.00843324325978756, -0.39970946311950684, 1.021885871887207, -0.6620035767555237, -0.055558498948812485, -0.6323267221450806, 0.9854609370231628, -0.6590975522994995, -0.7582841515541077, 0.6113836169242859, 0.1220146119594574, -0.22753995656967163, 0.33293646574020386, 0.7870786786079407...
func LineCounter(r io.Reader) (int64, error) { var newLineChr byte var readSizeTmp int var readSize int64 var err error var count int64 buf := make([]byte, 1024) newLineChr = '\n' for { readSizeTmp, err = r.Read(buf) readSize = int64(readSizeTmp) if err != nil { break } var buffPosition int64 f...
[ 0.5338056087493896, -1.0845470428466797, 0.9498502016067505, -0.09334030002355576, -0.4413341283798218, -0.1841687560081482, 0.3917616009712219, 0.32549118995666504, 0.07634451985359192, -0.680558979511261, 0.18110674619674683, -0.7365210056304932, -0.17145474255084991, 1.2834564447402954,...
func LineCounterByName(filename string) (int64, error) { var err error var count int64 if _, err := os.Stat(filename); os.IsNotExist(err) { return -1, err } var r *os.File if r, err = os.Open(filename); err != nil { return -1, err } count, err = LineCounter(r) if err != nil { return -1, err } return co...
[ 0.047991033643484116, -1.0210456848144531, 0.8065791726112366, -0.40483397245407104, -0.286673367023468, -0.2803940176963806, 0.7098660469055176, 0.1823626309633255, -0.7638976573944092, 0.3200379014015198, -0.30950963497161865, -0.5969268679618835, -0.49922415614128113, 1.259454369544983,...
func LineCounterByNameSlice(files []string) (*map[string]int64, int64, []error) { return CounterByNameSlice(&files, LineCounterByName) }
[ -0.33206453919410706, -1.2561659812927246, 0.21274997293949127, 0.04596579074859619, -0.0063306717202067375, -0.27084964513778687, -0.1826084852218628, -0.5353920459747314, -0.17187286913394928, -0.031419314444065094, -0.3180435001850128, -0.8397624492645264, 0.4226292073726654, 1.59994482...
func BytesCounter(r io.Reader) (int64, error) { var readSizeTmp int var err error buf := make([]byte, 1024) var total int64 for { readSizeTmp, err = r.Read(buf) total = total + int64(readSizeTmp) if err != nil { break } if err == io.EOF { return total, nil } } return total, err }
[ 0.34769248962402344, -0.6090167760848999, 0.7435817122459412, -0.7769973278045654, -0.6079291105270386, 0.010439397767186165, 0.19178679585456848, -0.046498317271471024, 0.19994986057281494, 0.002226627664640546, -0.14985716342926025, -1.0604138374328613, 0.2839266061782837, 1.279502153396...
func BytesCounterByName(filename string) (int64, error) { if _, err := os.Stat(filename); os.IsNotExist(err) { return -1, err } fileInfo, err := os.Stat(filename) if err != nil { return -1, err } return fileInfo.Size(), nil }
[ -0.1978214532136917, -0.9716535210609436, 0.7681649923324585, -0.928249180316925, -0.43440982699394226, 0.09788525849580765, 0.40610820055007935, 0.033554818481206894, -0.803657054901123, 0.1415298730134964, -0.9022426009178162, -0.597812294960022, -0.48845288157463074, 1.2620126008987427,...
func BytesCounterByNameSlice(files []string) (*map[string]int64, int64, []error) { return CounterByNameSlice(&files, BytesCounterByName) }
[ -0.628986656665802, -0.6717143654823303, 0.21310468018054962, -0.46128779649734497, -0.2225618213415146, -0.5258410573005676, -0.3522367477416992, -0.6687001585960388, -0.1125350147485733, 0.04041628539562225, -0.7750033736228943, -0.32236942648887634, 0.029199901968240738, 1.4110039472579...
func (o *GetDevicesAircubesIDNetworkReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewGetDevicesAircubesIDNetworkOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err ...
[ 0.2072141319513321, -0.4492185711860657, 0.7346246838569641, 0.3080701231956482, 0.15895065665245056, -0.7510693073272705, 0.17947138845920563, -0.717232346534729, 0.7581292986869812, -0.2811863124370575, 0.23690366744995117, -0.6118294596672058, -0.695274293422699, -0.5240684747695923, ...
func NewGetDevicesAircubesIDNetworkOK() *GetDevicesAircubesIDNetworkOK { return &GetDevicesAircubesIDNetworkOK{} }
[ 0.5143120288848877, 1.0184500217437744, 0.458833247423172, 1.6367849111557007, -0.00697037810459733, 0.1350092738866806, 0.9194324016571045, -0.728844940662384, 0.3178442120552063, -0.6232755780220032, -0.6219556331634521, -0.20877990126609802, 0.6793501973152161, -0.3910275399684906, 0....
func NewGetDevicesAircubesIDNetworkBadRequest() *GetDevicesAircubesIDNetworkBadRequest { return &GetDevicesAircubesIDNetworkBadRequest{} }
[ 0.2771930396556854, 1.0672249794006348, 0.6410603523254395, 1.4404869079589844, 0.5100521445274353, -0.4232121407985687, -0.04132147505879402, -0.95687335729599, 0.15569287538528442, -1.5841621160507202, 0.19735214114189148, 0.7480832934379578, -0.09122684597969055, 0.015691392123699188, ...
func NewGetDevicesAircubesIDNetworkUnauthorized() *GetDevicesAircubesIDNetworkUnauthorized { return &GetDevicesAircubesIDNetworkUnauthorized{} }
[ 0.3337951898574829, 0.9082919955253601, 0.6488566994667053, 1.3102049827575684, -0.1331183761358261, -0.037132129073143005, 0.5393115878105164, -0.5258604884147644, 0.6146181225776672, -1.9178969860076904, -0.05413445085287094, 1.2628371715545654, 0.01075781136751175, -0.6195476055145264, ...
func NewGetDevicesAircubesIDNetworkForbidden() *GetDevicesAircubesIDNetworkForbidden { return &GetDevicesAircubesIDNetworkForbidden{} }
[ 0.7790567874908447, 1.4629433155059814, 0.5350120067596436, 1.543215274810791, -0.04150456190109253, 0.4758671522140503, 0.6555618047714233, -1.589034080505371, 0.31494927406311035, -1.5176715850830078, -0.24915501475334167, 0.8569216728210449, 0.07195083796977997, -0.9231691360473633, 1...
func NewGetDevicesAircubesIDNetworkNotFound() *GetDevicesAircubesIDNetworkNotFound { return &GetDevicesAircubesIDNetworkNotFound{} }
[ 0.5514101982116699, 0.338763952255249, 0.2678321301937103, 0.9033372402191162, 0.8186365365982056, 0.6312307119369507, 0.7284344434738159, -1.0770725011825562, 0.4105701148509979, -1.3867725133895874, -0.22468602657318115, 0.6509308815002441, 0.2089192271232605, -0.3134172856807709, 0.70...
func NewSkin() *Skin { return &Skin{ folder: `img`, } }
[ -0.08778784424066544, -0.5680457949638367, 0.00010352785466238856, 0.7472823858261108, -1.4674017429351807, -0.3049374222755432, 0.5810694694519043, -0.17694881558418274, -0.2552107870578766, -1.5148149728775024, -0.20505468547344208, 1.1304179430007935, 0.5894105434417725, 1.3680496215820...
func (*AllTypesOneOf) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _AllTypesOneOf_OneofMarshaler, _AllTypesOneOf_OneofUnmarshaler, _AllTypesOneOf_OneofSizer, []interface{...
[ 0.14725250005722046, 0.6910733580589294, 0.5809780955314636, -0.29196903109550476, 0.33346015214920044, -0.7090944051742554, 0.6415702700614929, -0.8463073968887329, 0.4296681880950928, -0.034080762416124344, -0.6116713881492615, -0.2798752188682556, -0.060984861105680466, 0.64111709594726...
func (*TwoOneofs) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _TwoOneofs_OneofMarshaler, _TwoOneofs_OneofUnmarshaler, _TwoOneofs_OneofSizer, []interface{}{ (*TwoOneofs...
[ -0.6714969873428345, 0.5454462766647339, 0.5878053903579712, -0.33890053629875183, 0.33999574184417725, -0.9253897070884705, 0.4917853772640228, -1.3624643087387085, -0.06193600967526436, -0.5950415730476379, -0.7740949988365173, -0.17312370240688324, -0.10449805110692978, 0.61827558279037...
func (*CustomOneof) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _CustomOneof_OneofMarshaler, _CustomOneof_OneofUnmarshaler, _CustomOneof_OneofSizer, []interface{}{ (*C...
[ -0.2514408528804779, 0.2750444710254669, 0.48125502467155457, -0.602553129196167, 0.08490854501724243, -1.288568377494812, 0.6319022178649902, -1.1286993026733398, 0.4793354272842407, -0.45915424823760986, -0.539746880531311, 0.2894108295440674, -0.5022891163825989, 0.6172148585319519, 0...
func NewWinLogWatcher() (*WinLogWatcher, error) { cHandle, err := GetSystemRenderContext() if err != nil { return nil, err } return &WinLogWatcher{ shutdown: make(chan interface{}), errChan: make(chan error), eventChan: make(chan *WinLogEvent), renderContext: cHandle, watches: ...
[ 0.047637246549129486, -0.5778639316558838, 0.48260870575904846, -0.13484033942222595, -1.2653950452804565, -0.9397081732749939, -0.4022011458873749, -0.04734135791659355, -0.07110151648521423, 0.16383272409439087, -1.1578149795532227, 1.1405932903289795, -1.1688485145568848, 1.594803690910...
func (self *WinLogWatcher) SubscribeFromBeginning(channel, query string) error { return self.subscribeWithoutBookmark(channel, query, EvtSubscribeStartAtOldestRecord) }
[ 0.9315688014030457, -1.1279414892196655, 0.48952046036720276, 0.35913243889808655, -0.2532503306865692, 0.47709381580352783, -0.5451719760894775, -0.5383972525596619, -0.31319600343704224, 0.3073505461215973, -0.10074839740991592, 1.1311757564544678, -0.37681248784065247, 0.756603419780731...
func (self *WinLogWatcher) SubscribeFromNow(channel, query string) error { return self.subscribeWithoutBookmark(channel, query, EvtSubscribeToFutureEvents) }
[ 0.8590714335441589, -0.7229648232460022, 0.39829277992248535, 0.27930504083633423, -0.5468280911445618, 0.24281100928783417, -1.3950817584991455, -0.16372236609458923, -0.25677257776260376, -0.06489890068769455, -0.5425661206245422, 0.2726149559020996, -0.03585609421133995, 0.6891391873359...
func (self *WinLogWatcher) SubscribeFromBookmark(channel, query string, xmlString string) error { self.watchMutex.Lock() defer self.watchMutex.Unlock() if _, ok := self.watches[channel]; ok { return fmt.Errorf("A watcher for channel %q already exists", channel) } callback := &LogEventCallbackWrapper{callback: se...
[ 0.8954555988311768, -0.7127711176872253, 0.445448637008667, -0.011877917684614658, 0.02411443553864956, 0.13336215913295746, -0.5699435472488403, -0.5236087441444397, -0.27707532048225403, -0.6541257500648499, -0.5137788653373718, 0.43297141790390015, -0.03328840062022209, -0.0475863963365...
func (self *WinLogWatcher) Shutdown() { close(self.shutdown) for channel, _ := range self.watches { self.RemoveSubscription(channel) } CloseEventHandle(uint64(self.renderContext)) close(self.errChan) close(self.eventChan) }
[ 0.5756068229675293, -0.9131729006767273, 0.6201882362365723, 0.23727357387542725, -0.3246244788169861, 0.38103681802749634, 0.1546720266342163, -0.2212960571050644, -0.04822121933102608, -0.18516945838928223, 0.5551533699035645, 0.9875165224075317, -0.8791263103485107, 1.124082326889038, ...
func TestGxClient(t *testing.T) { serverConfig := &diameter.DiameterServerConfig{DiameterServerConnConfig: diameter.DiameterServerConnConfig{ Addr: "127.0.0.1:3898", Protocol: "tcp"}, } clientConfig := getClientConfig() startServer(clientConfig, serverConfig) gxClient := gx.NewGxClient( clientConfig, s...
[ 0.20902018249034882, -0.025114232674241066, 0.7455260753631592, -0.3104594945907593, 0.512018620967865, 0.824946939945221, 0.36090633273124695, -0.39468973875045776, 0.2311341017484665, 0.39753612875938416, -0.19053220748901367, 0.8200652003288269, -0.7989053726196289, -0.13719700276851654...
func BenchmarkCacheContentions(b *testing.B) { for _, numKeys := range []int{1 << 8, 1 << 12, 1 << 16} { b.Run(fmt.Sprintf("Simple/keys=%d", numKeys), func(b *testing.B) { benchmarkCache(newSimpleCache(clock.RealClock{}), b, numKeys) }) b.Run(fmt.Sprintf("Striped/keys=%d", numKeys), func(b *testing.B) { be...
[ -0.20817942917346954, 0.77437824010849, 0.4229951798915863, -0.06424789875745773, -0.4159133732318878, -0.5134292840957642, 0.5371706485748291, -0.5946003198623657, -0.2117321789264679, -0.05828782916069031, -0.4351573884487152, -0.43415382504463196, -0.23743166029453278, 0.572223126888275...
func (node *Delete) Format(ctx *FmtCtx) { ctx.FormatNode(node.With) ctx.WriteString("DELETE FROM ") ctx.FormatNode(node.Table) if node.Where != nil { ctx.WriteByte(' ') ctx.FormatNode(node.Where) } if len(node.OrderBy) > 0 { ctx.WriteByte(' ') ctx.FormatNode(&node.OrderBy) } if node.Limit != nil { ctx...
[ 0.33498415350914, 0.025660553947091103, 0.6230407953262329, -0.6697742342948914, -0.022241786122322083, -0.29530003666877747, -0.16655614972114563, -0.3046177625656128, 0.3246329724788666, -0.042770132422447205, 1.4508196115493774, 0.49628186225891113, 0.04996282234787941, 0.88065481185913...
func NewRing(num int) *Ring { r := new(Ring) r.init(uint64(num)) return r }
[ -0.5639310479164124, 0.9589887261390686, 0.31513673067092896, 0.5110158920288086, -0.5839451551437378, -0.1515919417142868, 0.6284869313240051, -1.112452745437622, 0.38368526101112366, -0.33371976017951965, -0.4518939256668091, -0.1261279433965683, -0.17090420424938202, -0.0673737004399299...
func (s *shares) List() ([]Share, error) { res, err := s.c.baseRequest(http.MethodGet, routes.shares, nil) if err != nil { return nil, err } var r sharesListResponse res.JSON(&r) return r.Ocs.Data, nil }
[ -0.45257577300071716, -0.02037443220615387, 0.4366993308067322, -0.025423608720302582, 1.3639675378799438, -0.4449320137500763, -0.4784013628959656, 0.17817066609859467, 0.2587505280971527, -0.050095830112695694, -0.7156699299812317, 0.5549830794334412, -0.804704487323761, 0.18449659645557...
func (s *shares) GetFromPath(path string, reshares bool, subfiles bool) ([]Share, error) { ro := &req.RequestOptions{ Params: map[string]string{ "path": path, "reshares": strconv.FormatBool(reshares), "subfiles": strconv.FormatBool(subfiles), }, } res, err := s.c.baseRequest(http.MethodGet, routes.s...
[ 0.028639117255806923, 0.6633140444755554, 0.6115723252296448, 0.4814044237136841, 0.42346811294555664, 0.28831028938293457, -0.4254639148712158, -0.6413098573684692, -0.18611715734004974, 0.04268532618880272, -0.42381206154823303, -0.10625188797712326, -0.8474383354187012, -0.5103091001510...
func (s *shares) Get(shareID string) (Share, error) { res, err := s.c.baseRequest(http.MethodGet, routes.shares, nil, shareID) if err != nil { return Share{}, err } var r sharesListResponse res.JSON(&r) return r.Ocs.Data[0], nil }
[ -0.6796491146087646, 0.24147339165210724, 0.39548903703689575, 0.051561251282691956, 1.0859278440475464, -0.8205372095108032, -0.36033934354782104, -0.33177345991134644, 0.44344058632850647, -0.12878689169883728, -0.3658161461353302, 0.5737376809120178, -0.7171037197113037, 0.2306553870439...
func (s *shares) Create( path string, shareType ShareType, permission SharePermission, shareWith string, publicUpload bool, password string, ) (Share, error) { if (shareType == UserShare || shareType == GroupShare) && shareWith == "" { return Share{}, fmt.Errorf("shareWith cannot be empty for ShareType UserSh...
[ -0.8682582378387451, -0.08396022766828537, 0.6746655702590942, 0.9280111193656921, 0.3480291962623596, 0.26982444524765015, -0.21963374316692352, -0.6233708262443542, -0.7062511444091797, 0.07672528922557831, -0.16077983379364014, -0.09092902392148972, -1.1031981706619263, 0.24190059304237...
func (s *shares) Delete(shareID int) error { _, err := s.c.baseRequest(http.MethodDelete, routes.shares, nil, strconv.Itoa(shareID)) return err }
[ -0.0009161637863144279, 0.14838464558124542, 0.2015233188867569, 0.6844400763511658, 0.8254415392875671, -0.18409520387649536, 0.7229018211364746, 0.2787671387195587, 0.1480816900730133, 0.40902915596961975, -0.1210353896021843, 0.16611726582050323, -1.1223969459533691, 0.5021795630455017,...
func (s *shares) UpdatePublicUpload(shareID int, public bool) error { return s.baseShareUpdate(strconv.Itoa(shareID), "publicUpload", strconv.FormatBool(public)) }
[ -1.0232207775115967, -0.3006786108016968, 0.3161247968673706, 0.018516290932893753, -0.6634660363197327, 0.06129298359155655, -0.22437307238578796, 0.29168081283569336, -1.2048416137695312, 0.7247958779335022, -0.8949120044708252, 0.012829035520553589, -0.9179386496543884, 0.33496320247650...
func (s *shares) UpdatePassword(shareID int, password string) error { return s.baseShareUpdate(strconv.Itoa(shareID), "password", password) }
[ -0.5505211353302002, -0.9788517355918884, 0.39093202352523804, 0.5942137241363525, 0.013538422994315624, 0.07582899928092957, 0.21832524240016937, 0.4294106364250183, 0.13475920259952545, 0.9810576438903809, -0.10556040704250336, 0.47730231285095215, -0.6310805082321167, -0.068858794867992...
func FreePort() (int, error) { // Opens a TCP connection to a free port on the host // and closes the connection but getting the port from it // so the can be setted to a free // random port each time if no one is specified l, err := net.Listen("tcp", "") if err != nil { return 0, err } l.Close() sl := strin...
[ 0.3489782214164734, 0.22273258864879608, 0.721447765827179, -0.5347099900245667, -0.47071215510368347, -0.04798220098018646, 0.7052561640739441, 0.4604344069957733, -0.00966572854667902, -0.015460120514035225, -0.1683935523033142, 0.3171597719192505, -1.4012831449508667, 0.1118573248386383...
func NewTestClient() *Client { baseURL, _ := url.Parse(testNetClientURL) c := &Client{client: http.DefaultClient, BaseURL: baseURL} return c }
[ 0.34359803795814514, -0.908769428730011, -0.16046780347824097, -0.3858155608177185, -0.12338706851005554, -0.3684532344341278, 0.06963598728179932, -1.1377652883529663, -0.049935318529605865, -0.7171531915664673, -0.4832973778247833, -0.1823141723871231, -0.9655777215957642, -0.39672738313...
func NewClient() *Client { baseURL, _ := url.Parse(publicNetClientURL) c := &Client{client: http.DefaultClient, BaseURL: baseURL} return c }
[ 0.41895097494125366, -0.3516705632209778, -0.07431567460298538, 0.13407671451568604, -0.6591989398002625, 0.2601444721221924, -0.2932800054550171, -0.34920355677604675, -0.42289549112319946, -1.0138648748397827, -0.626030683517456, -0.001489390037022531, -0.3035900294780731, -0.49057793617...
func (institution *Institution) Delete() error { // delete institution sql := "DELETE FROM `institution` WHERE id=?" query, err := database.Connection.Prepare(sql) if err != nil { return err } _, err = query.Exec(institution.ID) return err }
[ -0.5037229657173157, 0.28744977712631226, 0.2822985053062439, 0.5152950286865234, 1.1614243984222412, 0.1163763776421547, 0.1882515251636505, 0.6777358651161194, 0.18775101006031036, 0.8349975943565369, 0.30482161045074463, 0.5847323536872864, -0.9980794787406921, -0.33860892057418823, -...
func (institution *Institution) Modify(institutionDetails map[string]interface{}) (adapter.WisplyError, error) { var problem = adapter.WisplyError{} result := hasValidInstitutionModifyDetails(institutionDetails) if !result.IsValid { problem.Data = result return problem, errors.New("It does not have valid details...
[ -2.002345561981201, -0.0386388786137104, 0.4624687731266022, 0.19460231065750122, 0.2838504910469055, 0.7714119553565979, 0.008999480865895748, 1.1424845457077026, 1.0018467903137207, 0.1198895052075386, 0.9369440674781799, -0.23196014761924744, -1.370272159576416, 0.09043136239051819, 1...
func (institution *Institution) GetRepositories() []Repository { var list []Repository fieldList := "`id`, `name`, `url`, `description`, `status`, `institution`, `category`, `public_url`, `last_process`" sql := "SELECT " + fieldList + " FROM repository WHERE institution = ?" rows, _ := database.Connection.Query(sql...
[ -0.9716162085533142, 0.2127019762992859, 0.4117641746997833, -0.10472667962312698, 1.1163183450698853, -0.6736019253730774, -1.1829279661178589, 0.33600303530693054, 0.1954185515642166, 0.08829204738140106, -0.26538974046707153, 0.3577533960342407, -0.6003557443618774, 0.8646449446678162, ...
func (institution Institution) GetEducationSubjects() []*education.Subject { list := []*education.Subject{} fieldList := "`subject`" whereClause := "WHERE `institution` = ?" sql := "SELECT DISTINCT " + fieldList + " FROM `institution_program` " + whereClause rows, _ := database.Connection.Query(sql, strconv.Itoa(i...
[ -0.5965229868888855, 0.38918793201446533, 0.5349238514900208, -0.33037182688713074, 0.2916968762874603, 0.5004681348800659, -0.03926922008395195, -0.2153901308774948, 0.3496788442134857, 0.6196057200431824, -0.09116721153259277, 1.2217364311218262, -0.05040654167532921, 0.05669264867901802...
func (institution Institution) GetProgramsBySubjectID(subjectID int) []Program { list := []Program{} allPrograms := institution.GetPrograms() for _, program := range allPrograms { if program.GetSubject().GetID() == subjectID { list = append(list, program) } } return list }
[ 0.08541963249444962, 0.0975838154554367, 0.5752444267272949, 0.27242952585220337, -0.10608211159706116, 0.232024684548378, -0.3613625764846802, -1.1375685930252075, 1.0331887006759644, 1.4673058986663818, -0.47630780935287476, 1.8242098093032837, -0.71274334192276, 0.5935062170028687, -0...
func (institution Institution) GetPrograms() []Program { var list []Program fieldList := "`id`, `institution`, `title`, `content`, `code`, `year`, `ucas_code`, `level`, `subject`" orderClause := "ORDER BY `year` DESC" whereClause := "WHERE `institution` = ?" sql := "SELECT " + fieldList + " FROM `institution_progr...
[ -0.7332987189292908, -0.165059894323349, 0.6030910015106201, 0.23376432061195374, 0.4845755994319916, 0.46898460388183594, -0.5571223497390747, -0.4102288484573364, 0.6281242966651917, 0.9392701387405396, -0.044843897223472595, 1.3197762966156006, -0.8860474228858948, -0.1543491631746292, ...
func (institution Institution) GetModules() []Module { list := []Module{} fieldList := "`id`, `title`, `content`, `code`, `credits`, `year`" sql := "SELECT " + fieldList + " FROM `institution_module` WHERE institution=? " rows, err := database.Connection.Query(sql, strconv.Itoa(institution.ID)) if err != nil { ...
[ -1.1024034023284912, 0.06544531136751175, 0.4120822548866272, 0.11843334138393402, 1.4261192083358765, 0.5728370547294617, -0.863601565361023, -0.4176533818244934, 0.39030686020851135, 0.9178053140640259, -0.02075016498565674, 1.2160195112228394, -0.5752724409103394, 0.5419213175773621, ...
func PrefixPaths(paths []string, prefix string) []string { result := make([]string, len(paths)) for i, path := range paths { result[i] = filepath.Join(prefix, path) } return result }
[ 0.28537777066230774, -0.08803396672010422, 0.29097259044647217, 0.7464638948440552, 0.2565865218639374, -0.1182028204202652, -0.3482859134674072, 0.3240503966808319, 0.41040417551994324, 0.6747481226921082, 0.5865237712860107, 0.08617578446865082, -0.0549362488090992, 0.2415185123682022, ...
func NewKubernetesNodeGroupProfile(classId string, objectType string) *KubernetesNodeGroupProfile { this := KubernetesNodeGroupProfile{} this.ClassId = classId this.ObjectType = objectType var type_ string = "instance" this.Type = &type_ var action string = "No-op" this.Action = &action var desiredsize int64 = ...
[ -0.6834001541137695, 0.6023066639900208, 0.4207170903682709, -0.2689048945903778, -0.43685218691825867, -0.40417107939720154, -0.016462944447994232, -1.140984058380127, -0.5021582841873169, 0.3545520305633545, -0.2295198291540146, -0.017507053911685944, -0.9186627268791199, 0.4160770475864...
func NewKubernetesNodeGroupProfileWithDefaults() *KubernetesNodeGroupProfile { this := KubernetesNodeGroupProfile{} var classId string = "kubernetes.NodeGroupProfile" this.ClassId = classId var objectType string = "kubernetes.NodeGroupProfile" this.ObjectType = objectType var desiredsize int64 = 3 this.Desiredsi...
[ -0.3482825458049774, 0.8491380214691162, 0.2521267533302307, -0.09956015646457672, 0.5855053067207336, -0.32250192761421204, -0.6115009188652039, -1.3560208082199097, -0.42399272322654724, -0.39644095301628113, -0.4716189205646515, -1.3154021501541138, -0.9946346879005432, 0.39432692527770...
func (o *KubernetesNodeGroupProfile) GetClassId() string { if o == nil { var ret string return ret } return o.ClassId }
[ 0.3987870216369629, -0.09572665393352509, 0.016205020248889923, 0.6669532656669617, 0.3801405727863312, 0.8787795305252075, 0.31480342149734497, -0.18577983975410461, 1.040891170501709, -0.4809674620628357, 0.6216580867767334, -0.26763948798179626, -0.6332850456237793, 0.3634626865386963, ...
func (o *KubernetesNodeGroupProfile) GetClassIdOk() (*string, bool) { if o == nil { return nil, false } return &o.ClassId, true }
[ -0.517984926700592, 0.47151002287864685, 0.675239086151123, 0.9445213079452515, 0.5832037925720215, 0.7234635353088379, 0.614906370639801, 0.47196242213249207, 0.4915669560432434, -0.030523357912898064, -0.7504258751869202, -0.5449615716934204, -0.1711205244064331, 0.7094594836235046, -0...
func (o *KubernetesNodeGroupProfile) SetClassId(v string) { o.ClassId = v }
[ 0.11100597679615021, -0.1495545506477356, -0.018114805221557617, -0.022988930344581604, -0.3592331111431122, 0.5434497594833374, 0.013292881660163403, -0.08805406838655472, 0.6197527050971985, 0.6120882630348206, 0.24638107419013977, 0.49796637892723083, -0.5531893372535706, 0.204732343554...
func (o *KubernetesNodeGroupProfile) GetObjectType() string { if o == nil { var ret string return ret } return o.ObjectType }
[ 0.26502132415771484, 0.5210184454917908, -0.09323891997337341, -0.057764291763305664, 0.8286455273628235, 0.5296972393989563, 0.014755885116755962, -0.6408910751342773, -0.06118306145071983, 0.11184819042682648, 0.032193414866924286, -0.987646758556366, -1.0175286531448364, -0.337417423725...