text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (t *Driver) KeysWhereSQL(col string, WhereSQL string) ([]string, error) {
err := t.TryCreateTable(col)
if err != nil {
return nil, err
}
/// FIXME:
data, err := t.DB().GetISession().Query(fmt.Sprintf("SELECT id FROM %s WHERE %s", t.TableName(col), WhereSQL))
if err != nil {
... | [
-0.4855852723121643,
0.05201500281691551,
0.3575514554977417,
-0.2934577763080597,
0.16813752055168152,
-0.6193979978561401,
-1.1442290544509888,
-0.6991872787475586,
-0.6264896392822266,
1.5900264978408813,
-0.9664158821105957,
-0.02543730102479458,
-0.11307255178689957,
-0.03212304413318... |
func (t *Driver) TryCreateTable(col string) error {
if _, ok := t.ExistsCol.Load(col); ok != true {
/// FIXME: Table name should be escaped.
_, err := t.DB().Execute(fmt.Sprintf("CREATE TABLE IF NOT EXISTS `%s` ( `aid` BIGINT NOT NULL AUTO_INCREMENT, `id` VARCHAR(128) NOT NULL, j LONGTEXT NOT NULL, ... | [
0.2870694398880005,
0.8190333247184753,
0.7194654941558838,
-0.348530650138855,
0.8360166549682617,
0.022011838853359222,
0.030195020139217377,
-1.8238939046859741,
-0.7530035972595215,
0.5915557146072388,
-0.028272287920117378,
-0.7803122997283936,
-0.14273473620414734,
0.6242300271987915... |
func DeepEqualRaw(a, b []byte) bool {
var aj, bj map[string]interface{}
var err error
err = jsoniter.Unmarshal(a, &aj)
if err != nil {
return false
}
err = jsoniter.Unmarshal(b, &bj)
if err != nil {
return false
}
return reflect.DeepEqual(aj, bj)
} | [
-0.8222593665122986,
0.13627594709396362,
1.176955223083496,
-0.648665726184845,
-1.0343801975250244,
0.15477599203586578,
-0.46076729893684387,
0.08473873138427734,
-0.512535572052002,
0.05612124875187874,
-0.4294300973415375,
0.12888002395629883,
0.09499187022447586,
0.15250442922115326,... |
func Validate(payloads []*v1alpha1.File) error {
for i := range payloads {
if err := validatePath(payloads[i].Path); err != nil {
return err
}
if filepath.Clean(payloads[i].Path) != payloads[i].Path {
return fmt.Errorf("invalid filepath: %q", payloads[i].Path)
}
}
return nil
} | [
0.1941259652376175,
-0.3520989418029785,
0.6642001271247864,
0.09116596728563309,
0.24933409690856934,
0.7235566973686218,
0.3822324573993683,
-0.601320207118988,
-0.8081747889518738,
0.43051257729530334,
0.970146656036377,
-0.756447434425354,
0.093621626496315,
0.8990103006362915,
-0.43... |
func WritePayloads(path string, payloads []*v1alpha1.File) error {
if err := Validate(payloads); err != nil {
return err
}
// cleanup any payload paths that may have been written by a previous
// version of the driver/provider.
if err := cleanupProviderFiles(path, payloads); err != nil {
return fmt.Errorf("cl... | [
-0.48324909806251526,
0.060946427285671234,
0.3929063379764557,
0.023209668695926666,
0.341949462890625,
-0.1794550120830536,
-0.27110159397125244,
-0.10984668135643005,
-0.02184292860329151,
0.9539093375205994,
0.3050968050956726,
-0.5332966446876526,
-0.5299805998802185,
-0.2953717708587... |
func cleanupProviderFiles(path string, payloads []*v1alpha1.File) error {
for i := range payloads {
// AtomicWriter only symlinks the top file or directory
firstComponent := strings.Split(payloads[i].GetPath(), string(os.PathSeparator))[0]
p := filepath.Join(path, firstComponent)
info, err := os.Lstat(p)
if... | [
0.05548807233572006,
-0.14961032569408417,
0.828399121761322,
-0.4541819989681244,
0.0035382199566811323,
-0.20718273520469666,
1.1011905670166016,
0.670211672782898,
0.645313024520874,
0.4823448061943054,
1.0209527015686035,
-0.3338457942008972,
-0.6558324694633484,
0.4718080461025238,
... |
func Example() *specs.Spec {
return &specs.Spec{
Version: specs.Version,
Root: &specs.Root{
Path: "rootfs",
Readonly: true,
},
Process: &specs.Process{
Terminal: true,
User: specs.User{},
Args: []string{
"sh",
},
Env: []string{
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin... | [
0.8627057671546936,
-0.6518293023109436,
0.9664421081542969,
0.0655721053481102,
-0.23165202140808105,
-0.1615912914276123,
-0.015761958435177803,
-0.016992902383208275,
0.04414829984307289,
-0.13972023129463196,
-0.29091113805770874,
0.9498710632324219,
0.569651186466217,
0.14947861433029... |
func ToRootless(spec *specs.Spec, opts *RootlessOpts) error {
var err error
ctx := RootlessContext{}
ctx.EUID = uint32(os.Geteuid())
ctx.EGID = uint32(os.Getegid())
ctx.SubUIDs, err = user.CurrentUserSubUIDs()
if err != nil && !os.IsNotExist(err) {
return err
}
ctx.SubGIDs, err = user.CurrentGroupSubGIDs()
i... | [
0.36874863505363464,
-1.0105684995651245,
0.7342168688774109,
-0.29970404505729675,
-0.08580539375543594,
-0.031707752496004105,
0.9091009497642517,
-0.6242536902427673,
0.38952094316482544,
-0.11680879443883896,
0.08814505487680435,
0.9497663378715515,
-0.18759778141975403,
0.123321473598... |
func ToRootlessWithContext(ctx RootlessContext, spec *specs.Spec, opts *RootlessOpts) error {
if opts == nil {
opts = &RootlessOpts{}
}
var namespaces []specs.LinuxNamespace
// Remove networkns from the spec.
for _, ns := range spec.Linux.Namespaces {
switch ns.Type {
case specs.NetworkNamespace, specs.User... | [
0.2293916791677475,
-0.1921238750219345,
0.6473198533058167,
-0.3648117482662201,
-0.5501124262809753,
-0.09041250497102737,
0.17880941927433014,
-0.4117211699485779,
1.387010097503662,
-0.6403664350509644,
-0.08899091184139252,
0.24143455922603607,
0.12911319732666016,
0.40186429023742676... |
func Render(r *sdl.Renderer, w *World) {
width := float64(r.GetViewport().W)
height := float64(r.GetViewport().H)
renderedVertices := [][2]int{}
for _, obj := range w.Objects {
for _, vertex := range obj.Geometry.Vertices {
renderCoordinates := AsRelativeToSystem(w.ActiveCamera.ObjSys, ToSystem(obj.ObjSys, v... | [
0.27369070053100586,
-0.44688332080841064,
0.8072425127029419,
0.030735114589333534,
-0.30957654118537903,
0.3266480565071106,
0.491293728351593,
-0.26369258761405945,
0.59797203540802,
0.6814934611320496,
0.016075221821665764,
-0.2511844336986542,
-0.0713447853922844,
0.25132501125335693,... |
func (p *Partition) GetFullPath() string {
return p.Device + p.Name
} | [
1.1855270862579346,
-0.8452017307281494,
0.7847768664360046,
0.9486263990402222,
-1.024056315422058,
1.03574800491333,
-0.4263218343257904,
0.15522710978984833,
0.2551787495613098,
-0.272746205329895,
0.3754114806652069,
-0.5443874597549438,
-0.32270848751068115,
0.24614189565181732,
1.7... |
func NewPartitionOperationsImpl(e command.CmdExecutor, log *logrus.Logger) *PartitionOperationsImpl {
var partMetrics = metrics.NewMetrics(prometheus.HistogramOpts{
Name: "partition_operations_duration",
Help: "partition operations methods duration",
Buckets: metrics.ExtendedDefBuckets,
}, "method")
if e... | [
-0.019999636337161064,
0.8895527720451355,
0.630859911441803,
0.32396015524864197,
-0.4781695604324341,
-0.5487856268882751,
0.8759744763374329,
0.35522252321243286,
-0.21982935070991516,
0.3054348826408386,
-0.20077145099639893,
-1.2543730735778809,
0.4495066702365875,
-0.3979707956314087... |
func (d *PartitionOperationsImpl) PreparePartition(p Partition) (*Partition, error) {
defer d.metrics.EvaluateDurationForMethod("PreparePartition")()
ll := d.log.WithFields(logrus.Fields{
"method": "PreparePartition",
"volumeID": p.PartUUID,
})
ll.Debugf("Processing for partition %#v", p)
exist, err := d.Is... | [
-0.533574640750885,
0.12583331763744354,
0.9268639087677002,
-0.1129656657576561,
0.03000820428133011,
-0.20858052372932434,
0.5741839408874512,
-0.09890002012252808,
0.5453139543533325,
0.4705873727798462,
0.5609924793243408,
-0.6616764068603516,
0.12596604228019714,
0.13576658070087433,
... |
func (d *PartitionOperationsImpl) ReleasePartition(p Partition) error {
defer d.metrics.EvaluateDurationForMethod("ReleasePartition")()
d.log.WithFields(logrus.Fields{
"method": "ReleasePartition",
"volumeID": p.PartUUID,
}).Infof("Processing for %v", p)
exist, err := d.IsPartitionExists(p.Device, p.Num)
if... | [
-0.8768594264984131,
-0.08407235145568848,
0.6275730729103088,
-0.38958820700645447,
-0.2378445565700531,
-0.7736536264419556,
0.5565804839134216,
0.0733724907040596,
0.7268567681312561,
0.3857696056365967,
0.6291980743408203,
-0.3838171064853668,
-0.7171815633773804,
0.16753946244716644,
... |
func (d *PartitionOperationsImpl) SearchPartName(device, partUUID string) string {
defer d.metrics.EvaluateDurationForMethod("SearchPartName")()
ll := d.log.WithFields(logrus.Fields{
"method": "SearchPartName",
"volumeID": partUUID,
})
ll.Debugf("Search partition number for device %s and uuid %s", device, par... | [
-0.012175416573882103,
-0.09192479401826859,
0.7103551626205444,
0.1242469847202301,
-1.2912912368774414,
-0.5365579724311829,
-0.166788712143898,
-0.46985048055648804,
-0.6604335308074951,
0.5061913132667542,
0.7784941792488098,
-0.045940957963466644,
-0.33730289340019226,
-0.650305032730... |
func (path *PATH) Source() string {
body := []string{}
var last *pathPart
for _, p := range path.parts {
leadSymbol := false
if p.Typ == "Z" || p.Typ == "z" {
body = append(body, p.Typ)
last = p
continue
}
s := p.drawPart()
if p.Typ == "V" || p.Typ == "v" || p.Typ == "H" || p.Typ == "h" {
le... | [
-0.4353772699832916,
-0.36732229590415955,
0.5699012279510498,
-0.21808187663555145,
-0.932527482509613,
0.09973452240228653,
0.6715950965881348,
-0.2655943036079407,
0.24332396686077118,
0.37991639971733093,
-0.26328080892562866,
-0.38542410731315613,
-0.48136624693870544,
0.0851315557956... |
func (path *PATH) H(x float64) *PATH {
return path.AddPart("H", x)
} | [
0.03709178790450096,
1.311708927154541,
0.37421754002571106,
0.10993871837854385,
-0.13984423875808716,
1.9918338060379028,
0.33475667238235474,
-0.059509653598070145,
-0.22036977112293243,
-1.107653021812439,
-0.2733270823955536,
-0.2124967873096466,
0.6484218835830688,
-0.360939294099807... |
func (path *PATH) Hh(x float64) *PATH {
return path.AddPart("h", x)
} | [
0.4543449878692627,
1.2985923290252686,
0.46890348196029663,
0.5021677017211914,
-0.03177544102072716,
1.9974236488342285,
-0.10170464962720871,
-0.4642671048641205,
-0.07672475278377533,
-1.0124664306640625,
-0.1097780391573906,
-0.47656288743019104,
0.45142561197280884,
-0.21255016326904... |
func (path *PATH) V(y float64) *PATH {
return path.AddPart("V", y)
} | [
-0.044743914157152176,
0.013665626756846905,
0.44688713550567627,
-0.1837882250547409,
0.06571649014949799,
0.6940521597862244,
0.9143685698509216,
-0.7903195023536682,
0.3979845345020294,
-0.24979521334171295,
-0.23400866985321045,
0.1765393316745758,
0.7779669761657715,
0.155651479959487... |
func (path *PATH) Vv(y float64) *PATH {
return path.AddPart("v", y)
} | [
0.22677592933177948,
0.09143900126218796,
0.4936247169971466,
-0.06106825917959213,
-0.06704919040203094,
0.5939791202545166,
-0.005757938139140606,
-0.9748060703277588,
0.2888546884059906,
0.3300930857658386,
-0.15977591276168823,
0.5073934197425842,
0.9080195426940918,
0.1231451779603958... |
func (path *PATH) A(rx, ry, xAxisRotation, largeArcFlag, sweepFlag, x, y float64) *PATH {
return path.AddPart("A", rx, ry, xAxisRotation, largeArcFlag, sweepFlag, x, y)
} | [
-0.142888605594635,
-0.009197517298161983,
0.5936211347579956,
-1.2803497314453125,
0.5456438660621643,
0.7990098595619202,
1.082141399383545,
0.04650341719388962,
0.5242257118225098,
-1.2705838680267334,
0.25137490034103394,
-0.30235016345977783,
0.9036955833435059,
-0.08536236733198166,
... |
func (path *PATH) Aa(rx, ry, xAxisRotation, largeArcFlag, sweepFlag, x, y float64) *PATH {
return path.AddPart("a", rx, ry, xAxisRotation, largeArcFlag, sweepFlag, x, y)
} | [
-0.11431814730167389,
-0.3807423412799835,
0.6378445625305176,
-1.4784144163131714,
0.5731817483901978,
0.6907144784927368,
1.089245080947876,
-0.0805032029747963,
0.946305513381958,
-0.8359633684158325,
0.5206472277641296,
-0.224450945854187,
1.112398624420166,
-0.07785450667142868,
0.3... |
func (path *PATH) S(x2, y2, x, y float64) *PATH {
return path.AddPart("S", x2, y2, x, y)
} | [
0.3513120710849762,
0.09385404735803604,
0.2979970872402191,
-0.23133599758148193,
-0.48116520047187805,
-0.07376434653997421,
-0.0933791846036911,
-0.7791088223457336,
-0.6228431463241577,
-0.7645550966262817,
-0.5306889414787292,
0.2745237350463867,
1.354392170906067,
-0.8785833716392517... |
func (path *PATH) Ss(x2, y2, x, y float64) *PATH {
return path.AddPart("s", x2, y2, x, y)
} | [
0.12563414871692657,
0.09738926589488983,
0.3492845892906189,
-0.6414397954940796,
-0.4413459599018097,
-0.07189951092004776,
-0.6754953265190125,
-1.1677634716033936,
-0.2138846516609192,
-0.7126333713531494,
-0.7013343572616577,
0.6287919878959656,
1.0471054315567017,
-0.6399572491645813... |
func grabLoopParams() loopParams {
loopM.Lock()
defer loopM.Unlock()
return loop
} | [
0.05441832169890404,
0.017145812511444092,
0.2907264530658722,
0.37560519576072693,
-0.6432982087135315,
1.0251504182815552,
-0.2455669790506363,
-0.4478418231010437,
-0.4675523638725281,
0.004123020451515913,
0.26313477754592896,
0.01678287237882614,
-0.6688860654830933,
0.628795146942138... |
func fetchLoopParams(ctx context.Context) {
// Note: these are eventually controlled through /admin/portal/archivist.
set := coordinator.GetSettings(ctx)
loopM.Lock()
defer loopM.Unlock()
if set.ArchivistBatchSize != 0 {
loop.batchSize = set.ArchivistBatchSize
}
if set.ArchivistLeaseTime != 0 {
loop.deadline... | [
0.0009511515963822603,
0.13792619109153748,
0.2568027675151825,
-0.2634778320789337,
-0.10251675546169281,
0.3424519896507263,
-0.9716375470161438,
-0.5451615452766418,
-0.5245242118835449,
0.5886234045028687,
-0.029119927436113358,
0.9432970285415649,
0.5216183066368103,
0.463989377021789... |
func loopParamsUpdater(ctx context.Context) {
for {
if clock.Sleep(ctx, 5*time.Minute).Err != nil {
break // the context is canceled, the process is exiting
}
fetchLoopParams(ctx)
}
} | [
-0.002748328261077404,
-1.012001872062683,
0.5477743744850159,
-0.09266219288110733,
-1.4579832553863525,
1.4733998775482178,
-1.1634182929992676,
-1.01712965965271,
0.0025773849338293076,
0.929313063621521,
0.37779104709625244,
0.00849374569952488,
-0.8035571575164795,
0.5192846655845642,... |
func NewKubernetesDeployer(binaryPath string) *KubernetesDeployer {
return &KubernetesDeployer{
binaryPath: binaryPath,
}
} | [
0.2711837887763977,
-1.394396185874939,
0.1482522338628769,
-0.22715310752391815,
-1.180328607559204,
0.08871904015541077,
-0.6508833169937134,
-0.16226844489574432,
0.521429181098938,
-0.3236537277698517,
-0.3638468384742737,
-1.0662723779678345,
0.13535422086715698,
0.9056394100189209,
... |
func (deployer *KubernetesDeployer) Deploy(endpoint *portainer.Endpoint, data string, composeFormat bool, namespace string) ([]byte, error) {
if composeFormat {
convertedData, err := deployer.convertComposeData(data)
if err != nil {
return nil, err
}
data = string(convertedData)
}
token, err := ioutil.Re... | [
-0.22786378860473633,
-0.7216532230377197,
0.9634494185447693,
0.36433738470077515,
-0.6163020730018616,
-0.4983840584754944,
-0.43329086899757385,
-0.09880099445581436,
-0.3853939473628998,
0.2847192883491516,
0.6786208152770996,
0.6250234842300415,
-0.7705929279327393,
0.1401734203100204... |
func addSemverPrefix(s string) string {
if !strings.HasPrefix(s, "v") && !strings.HasPrefix(s, "go") {
return "v" + s
}
return s
} | [
-0.2648080289363861,
0.3308332860469818,
0.7037718892097473,
0.12809310853481293,
-0.32889872789382935,
-0.04586867243051529,
-0.8095014095306396,
0.5473961234092712,
2.358670949935913,
0.7165283560752869,
-0.7560113072395325,
0.38669970631599426,
0.37012550234794617,
0.9415522217750549,
... |
func removeSemverPrefix(s string) string {
s = strings.TrimPrefix(s, "v")
s = strings.TrimPrefix(s, "go")
return s
} | [
-0.33152908086776733,
-0.36377155780792236,
0.6322914361953735,
-0.4720378518104553,
-1.255549669265747,
-0.3264424800872803,
-0.20254260301589966,
1.3642067909240723,
1.808684229850769,
0.9852926135063171,
-1.3412597179412842,
0.5914020538330078,
-0.3108474612236023,
0.006026922259479761,... |
func canonicalizeSemverPrefix(s string) string {
return addSemverPrefix(removeSemverPrefix(s))
} | [
0.301048219203949,
-0.679729700088501,
0.3755852282047272,
0.35621508955955505,
-1.0604585409164429,
-0.4964354336261749,
0.14657112956047058,
0.6311622858047485,
1.8626351356506348,
1.0625091791152954,
-0.8838582634925842,
0.5349387526512146,
0.4020511209964752,
-0.009378653019666672,
-... |
func Less(v1, v2 string) bool {
return semver.Compare(canonicalizeSemverPrefix(v1), canonicalizeSemverPrefix(v2)) < 0
} | [
0.36774200201034546,
-0.761468768119812,
0.3168734908103943,
-0.5004343390464783,
-0.8688868284225464,
-0.04455340653657913,
-0.9769154787063599,
-0.7990242838859558,
0.6977866888046265,
0.4414868950843811,
-0.637140154838562,
0.38821130990982056,
0.08279606699943542,
0.1474665254354477,
... |
func Valid(v string) bool {
return semver.IsValid(canonicalizeSemverPrefix(v))
} | [
0.43610432744026184,
-0.816136360168457,
0.33667176961898804,
0.12577207386493683,
-1.301817536354065,
0.8957748413085938,
0.2289104461669922,
0.4949590563774109,
1.0707036256790161,
0.5328027606010437,
-0.6390533447265625,
0.1660422682762146,
0.04619718715548515,
0.000340661674272269,
-... |
func GoTagToSemver(tag string) string {
if tag == "" {
return ""
}
tag = strings.Fields(tag)[0]
// Special cases for go1.
if tag == "go1" {
return "v1.0.0"
}
if tag == "go1.0" {
return ""
}
m := tagRegexp.FindStringSubmatch(tag)
if m == nil {
return ""
}
version := "v" + m[1]
if m[2] != "" {
ver... | [
-0.17644712328910828,
-0.3423493504524231,
0.3926769196987152,
-0.45486435294151306,
-0.2550601065158844,
-0.3175571858882904,
0.6678306460380554,
-0.5114497542381287,
0.07385244220495224,
1.323806881904602,
-0.5183735489845276,
0.7204906940460205,
-0.3921300172805786,
0.18415768444538116,... |
func (d Document) Raw() map[interface{}]interface{} { return d.raw } | [
-1.5986452102661133,
-0.08488728851079941,
0.34742188453674316,
-0.163747638463974,
-1.5917513370513916,
0.5278401374816895,
-0.32528021931648254,
-0.569580078125,
0.0806398093700409,
-1.0907273292541504,
-0.11419552564620972,
0.47065824270248413,
1.5203617811203003,
0.4680132269859314,
... |
func (d Document) MarshalYAML() (interface{}, error) {
return d.raw, nil
} | [
0.16416309773921967,
0.7519971132278442,
0.2796393930912018,
0.6341517567634583,
-1.16690194606781,
0.3307643532752991,
0.5733750462532043,
0.5292548537254333,
0.7535266280174255,
-0.41881293058395386,
-0.20702922344207764,
0.7232922315597534,
0.633000910282135,
-0.2990213930606842,
-0.8... |
func (d *Document) UnmarshalYAML(unmarshal func(interface{}) error) error {
if err := unmarshal(&d.raw); err != nil {
return err
}
if err := d.init(); err != nil {
return fmt.Errorf("verifying YAML data: %s", err)
}
return nil
} | [
-0.04252695292234421,
0.9489887952804565,
0.6373138427734375,
-0.19228079915046692,
-0.6050065159797668,
-0.6771256923675537,
0.9374588131904602,
0.7002612948417664,
0.20217584073543549,
0.05265665426850319,
-0.25221627950668335,
0.5390850901603699,
0.4643447995185852,
0.22203226387500763,... |
func (d Document) IsList() bool { return d.apiVersion == "v1" && d.kind == "List" } | [
-0.9584262371063232,
-0.36195871233940125,
0.23222242295742035,
0.5350337624549866,
0.3068702816963196,
0.10127222537994385,
-1.2693312168121338,
0.7053515911102295,
1.6806617975234985,
0.6914946436882019,
-0.8349213600158691,
1.0876059532165527,
-0.5951752662658691,
0.7130854725837708,
... |
func (d Document) APIVersion() string { return d.apiVersion } | [
-0.7459567189216614,
-0.4237124025821686,
-0.23956887423992157,
-0.7171834111213684,
-0.6959450840950012,
0.1798209697008133,
0.23773786425590515,
0.517776370048523,
0.15498049557209015,
0.20338058471679688,
-0.7540643811225891,
-0.4191704988479614,
-0.21171031892299652,
-0.162072628736495... |
func (d Document) Kind() string { return d.kind } | [
-0.12849077582359314,
0.2207757979631424,
-0.06545442342758179,
-0.5506554245948792,
-1.0111510753631592,
1.1556415557861328,
0.37357792258262634,
-0.9147332906723022,
-0.06095805764198303,
0.5351927280426025,
0.6655542850494385,
1.0950679779052734,
0.0892147496342659,
-0.01474612206220626... |
func (d Document) Type() string { return fmt.Sprintf("%s.%s", d.apiVersion, d.kind) } | [
-0.5327720642089844,
-0.3589348793029785,
0.1680273711681366,
-0.8402860760688782,
-0.018611788749694824,
0.5988269448280334,
-0.12570542097091675,
-0.9709718823432922,
0.38527777791023254,
0.4267033040523529,
0.5406618714332581,
0.6881243586540222,
-0.5098387598991394,
0.4353112578392029,... |
func (d Document) Name() string { return d.name } | [
-1.0430147647857666,
-0.17372334003448486,
0.051098164170980453,
-0.36654603481292725,
-1.6287627220153809,
0.15370526909828186,
0.02052418142557144,
-0.5894400477409363,
-0.21275702118873596,
0.6606296896934509,
-0.11999230086803436,
0.028789501637220383,
0.19248279929161072,
0.2632119953... |
func (d Document) Labels() map[interface{}]interface{} { return d.labels } | [
-1.3505367040634155,
-0.4330943524837494,
0.29837948083877563,
-0.9815375208854675,
-0.8560869097709656,
0.7461178302764893,
-0.7850728034973145,
0.00039555630064569414,
0.024842819198966026,
-0.48072004318237305,
-0.14497621357440948,
-0.4324236512184143,
0.09147962927818298,
0.9357072710... |
func (d Document) Annotations() map[interface{}]interface{} { return d.annotations } | [
-0.4410781264305115,
-0.08249079436063766,
0.4208396077156067,
-0.155097097158432,
-0.7321351170539856,
-0.1843254417181015,
0.4117042124271393,
-0.15820607542991638,
0.059963393956422806,
-0.25544270873069763,
-0.9903599619865417,
-0.3443215489387512,
0.2914726734161377,
0.980338394641876... |
func (d Document) Documents() []Document { return d.documents } | [
-0.9460671544075012,
0.041805949062108994,
-0.14555954933166504,
-0.10847271233797073,
-0.2748606204986572,
0.354483425617218,
-0.12369198352098465,
-0.49272140860557556,
0.8694716095924377,
-0.5073285698890686,
-0.03673156723380089,
0.4579998552799225,
-0.16583698987960815,
0.441388607025... |
func (d Document) AsFlatList() (documents []Document) {
if d.IsList() {
for _, document := range d.Documents() {
documents = append(documents, document.AsFlatList()...)
}
} else {
documents = append(documents, d)
}
return
} | [
-0.6163037419319153,
0.1784384399652481,
0.5491327047348022,
0.13797065615653992,
-0.07233455032110214,
-0.038455285131931305,
-0.4680635631084442,
0.015151477418839931,
1.107730507850647,
0.20719467103481293,
0.03115348517894745,
0.16875500977039337,
-0.12037305533885956,
1.40165627002716... |
func (d Document) Release() string {
value, _ := d.labels[releaseLabel].(string)
return value
} | [
-1.3233319520950317,
-0.21841098368167877,
0.02751501463353634,
-0.10827256739139557,
-0.3574508726596832,
0.42761003971099854,
-0.577610194683075,
-0.8635493516921997,
0.04991992563009262,
0.6542698740959167,
0.6165040731430054,
-0.00762439239770174,
-0.3594423830509186,
0.010454371571540... |
func (d Document) DeploymentUnit() string {
value, _ := d.labels[deploymentUnitLabel].(string)
return value
} | [
-0.6850662231445312,
-0.7413946986198425,
0.06468574702739716,
-1.8583005666732788,
-0.6468279361724854,
1.2700644731521606,
-0.16419169306755066,
-0.002619406208395958,
0.5144232511520386,
0.19272632896900177,
0.41943997144699097,
0.22598101198673248,
-0.43127158284187317,
-0.618564963340... |
func GetClub(w http.ResponseWriter, r *http.Request) {
id, err := utils.GetId(r)
if err != nil {
log.Errorf("Error calling servie Get(Single)Club: %v", err)
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
club, _ := service.GetClub(id)
utils.SendJson(w, club)
} | [
-1.207722544670105,
0.45889613032341003,
0.6688111424446106,
1.1081383228302002,
0.7519605755805969,
-0.1028996929526329,
0.6120149493217468,
-0.5530650019645691,
-0.13029401004314423,
-0.9233765602111816,
0.4081742763519287,
1.7653326988220215,
-0.25327828526496887,
0.12209345400333405,
... |
func OpenDB(dbName string) (err error) {
if dbName == "" {
return errors.New("empty dbName provided")
}
db, err = leveldb.OpenFile(dbName, nil)
return err
} | [
0.013272026553750038,
0.8130735158920288,
0.5328264832496643,
0.46791523694992065,
-0.12658311426639557,
1.125038743019104,
0.7210561633110046,
0.9213660359382629,
-0.24631930887699127,
-0.36571091413497925,
0.41585856676101685,
0.20344723761081696,
-1.2058652639389038,
0.8393190503120422,... |
func CloseDB() error {
if db == nil {
return errors.New("database not initialized")
}
return db.Close()
} | [
-0.03952142968773842,
0.5057293772697449,
0.42902112007141113,
1.2798213958740234,
0.2487499862909317,
0.6782928705215454,
-0.370450496673584,
-0.05710470303893089,
0.7474263906478882,
-0.221981480717659,
1.146638035774231,
0.14389826357364655,
-0.81694495677948,
1.8998879194259644,
1.51... |
func Insert(key []byte, value []byte) error {
if db == nil {
return errors.New("database not initialized")
}
if len(key) == 0 {
return errors.New("empty key provided")
}
return db.Put(key, value, nil)
} | [
-0.6205357909202576,
1.739598274230957,
0.44131219387054443,
0.022864334285259247,
-0.3410522937774658,
0.25725021958351135,
-0.262471079826355,
0.7201087474822998,
-0.6455178260803223,
0.6874740719795227,
-0.6089534163475037,
-0.4358035624027252,
-1.9219787120819092,
0.8973576426506042,
... |
func ReadValue(key []byte) ([]byte, error) {
if db == nil {
return nil, errors.New("database not initialized")
}
if len(key) == 0 {
return nil, errors.New("empty key provided")
}
return db.Get(key, nil)
} | [
-0.8297131061553955,
0.8762803673744202,
0.7046930193901062,
0.8512133359909058,
-0.23872385919094086,
-0.06682220101356506,
-0.5923566818237305,
0.06235319748520851,
-0.19210995733737946,
0.9259946942329407,
0.8523505926132202,
0.06477446109056473,
-0.7367551326751709,
1.0969223976135254,... |
func InitTestDB() error {
if db == nil {
return errors.New("database not initialized")
}
for i := 0; i < 1000; i++ {
key := intToByteArray(i)
value := GetByteArray("hello from "+strconv.Itoa(i), "string")
err := Insert(key, value)
if err != nil {
return err
}
}
return nil
} | [
-0.30700522661209106,
0.8978991508483887,
0.6802078485488892,
0.11614425480365753,
0.6232740879058838,
0.028290532529354095,
0.7913021445274353,
0.006220409180969,
0.06570021063089371,
0.2696392238140106,
-0.9530889391899109,
0.06751542538404465,
-1.291213870048523,
0.7782191634178162,
-... |
func NewEncodingTree(freq map[uint8]uint) *Node {
var head Node // Fictitious head
for i, v := range freq {
node := &Node{
value: i,
weight: v,
}
head.insert(node)
}
for head.next != nil && head.next.next != nil {
l := head.popFirst()
r := head.popFirst()
node := join(l, r)
head.insert(node)... | [
-0.7722606658935547,
0.5670424699783325,
0.5492069721221924,
-0.2188875526189804,
-1.4481019973754883,
-0.6006922721862793,
0.39128994941711426,
-0.26513415575027466,
0.2488725632429123,
0.7273266315460205,
0.1700911521911621,
-0.6201812624931335,
-0.938789427280426,
0.6517141461372375,
... |
func (head *Node) fillTable(table code.Table, c code.Code) {
if head == nil {
return
}
if head.left == nil && head.right == nil {
table[head.value] = c
return
}
if head.left != nil {
lc := code.Code{
Code: c.Code << 1,
Len: c.Len + 1,
}
head.left.fillTable(table, lc)
}
if head.right != nil ... | [
0.5249064564704895,
0.8959844708442688,
0.7764879465103149,
0.06491870433092117,
-0.0162639282643795,
0.15434712171554565,
0.623156726360321,
-0.21988040208816528,
-0.2836611568927765,
0.3280772566795349,
-0.5691884756088257,
0.5254501700401306,
-0.2402528077363968,
1.6128666400909424,
0... |
func (head *Node) WriteHeader(w *bitio.Writer, freq map[uint8]uint) (err error) {
var nEncoded uint32
for _, v := range freq {
nEncoded += uint32(v)
}
// Write total number of encoded symbols
w.TryWriteBitsUnsafe(uint64(nEncoded), 32)
// Write total number of symbols in graph
w.TryWriteBitsUnsafe(uint64(len(... | [
-1.2613089084625244,
0.26175761222839355,
0.6284142732620239,
-0.07653545588254929,
0.4431644082069397,
-0.17701399326324463,
1.2382112741470337,
-0.5533629059791565,
-0.4270537197589874,
-0.1323166787624359,
-0.0298486165702343,
-0.238551065325737,
-0.2352442741394043,
0.46319580078125,
... |
func DecodeHeader(r *bitio.Reader) (nEncoded uint32, root *Node, err error) {
var buf uint64
buf, err = r.ReadBits(32)
nEncoded = uint32(buf)
if err != nil {
return 0, nil, err
}
buf, err = r.ReadBits(8)
nTree := byte(buf)
if err != nil {
return 0, nil, err
}
root, err = decodeTree(r, nTree)
if err != ... | [
-0.21870890259742737,
-0.10523443669080734,
0.8378109335899353,
0.07899916917085648,
-0.8774833083152771,
0.04502030834555626,
-0.010074267163872719,
0.11635134369134903,
0.16317667067050934,
0.11604157835245132,
-0.3096015453338623,
0.34325656294822693,
-0.5266265273094177,
0.985867798328... |
func decodeTree(r *bitio.Reader, nTree byte) (root *Node, err error) {
var head Node
var nodes byte
var leaves byte
var u uint64
for nodes < nTree {
u, err = r.ReadBits(1)
if err != nil {
return nil, err
}
if u == 1 {
leaves++
symbol, err := r.ReadBits(8)
if err != nil {
return nil, err
... | [
-0.1303272396326065,
0.10162003338336945,
0.5908276438713074,
-0.34171339869499207,
-1.156458854675293,
-0.3620604872703552,
-0.00020940335525665432,
-0.4679145812988281,
0.38742879033088684,
0.5409055948257446,
-0.047717463225126266,
-0.0616469606757164,
-1.3634908199310303,
0.87856715917... |
func (head *Node) insert(node *Node) {
if head == nil {
return
}
after := head
for after.next != nil && node.weight >= after.next.weight {
after = after.next
}
node.prev = after
node.next = after.next
if after.next != nil {
after.next.prev = node
}
after.next = node
} | [
-0.08485354483127594,
1.3441280126571655,
0.5529786944389343,
-0.5030271410942078,
-0.33766230940818787,
0.168065145611763,
0.8964740037918091,
0.4404982030391693,
-0.27728471159935,
0.1429082453250885,
-0.9069361686706543,
0.14437679946422577,
-1.3743170499801636,
1.030037522315979,
-0.... |
func (head *Node) pushBack(node *Node) {
if head == nil {
return
}
after := head
for after.next != nil {
after = after.next
}
node.prev = after
node.next = nil
after.next = node
} | [
0.1207057386636734,
1.2593022584915161,
0.9804295897483826,
-0.3373095691204071,
-0.08774520456790924,
-0.46758705377578735,
0.6609923243522644,
0.5771549344062805,
0.3824644386768341,
1.2108927965164185,
0.2982800304889679,
0.7167437672615051,
-1.0702934265136719,
0.7473801374435425,
0.... |
func (head *Node) popFirst() *Node {
if head == nil {
return nil
}
node := head.next
if node == nil {
return nil
}
head.next = nil
if node.next != nil {
node.next.prev = head
head.next = node.next
}
node.next = nil
node.prev = nil
return node
} | [
0.7753884196281433,
0.8357428908348083,
0.6538230776786804,
-0.6832433342933655,
0.39615681767463684,
-1.550994873046875,
-0.34929001331329346,
0.4012039303779602,
0.20924191176891327,
1.4536163806915283,
-0.3073060214519501,
0.5755144953727722,
-0.6141025424003601,
0.7339456677436829,
-... |
func (head *Node) popLast() *Node {
if head == nil {
return nil
}
node := head.next
if node == nil {
return nil
}
for node.next != nil {
node = node.next
}
node.prev.next = nil
node.prev = nil
return node
} | [
0.7338975071907043,
0.8656442761421204,
0.9875093698501587,
-0.4738878607749939,
0.4885430634021759,
-0.9239063858985901,
-0.3297562897205353,
0.11852047592401505,
0.8542488217353821,
1.4266033172607422,
0.13081012666225433,
-0.10246818512678146,
-0.8992628455162048,
0.10440108180046082,
... |
func join(l, r *Node) *Node {
var node Node
if l != nil {
node.weight += l.weight
node.left = l
}
if r != nil {
node.weight += r.weight
node.right = r
}
return &node
} | [
1.1254640817642212,
0.1045941486954689,
0.5697978138923645,
-0.4926380217075348,
-0.4399035573005676,
0.6377924680709839,
-1.2270623445510864,
0.39202484488487244,
0.15526366233825684,
0.5152726769447327,
-0.06826317310333252,
0.22793933749198914,
-0.9447084069252014,
0.15246239304542542,
... |
func (head *Node) DecodeNext(r *bitio.Reader) (b byte, err error) {
if head == nil {
return
}
var u uint64
node := head
for node.left != nil && node.right != nil { // or node.value == 0
u, err = r.ReadBits(1)
if err != nil {
return 0, err
}
if u == 0 {
node = node.left
} else {
node = node.... | [
-0.10217437148094177,
0.5789324045181274,
0.8757957816123962,
0.5459610223770142,
-0.834496796131134,
-0.14895418286323547,
-0.11318683624267578,
0.07063904404640198,
0.10644067078828812,
-0.20160889625549316,
-0.40140485763549805,
0.5180289149284363,
-0.6877214908599854,
0.683684885501861... |
func GetMD5Hash(text string) string {
hash := md5.Sum([]byte(text))
return hex.EncodeToString(hash[:])
} | [
1.2550300359725952,
-0.18337658047676086,
0.31052708625793457,
0.5945646166801453,
-1.432178020477295,
0.7635961174964905,
-0.08578991144895554,
-0.07741639018058777,
-0.14380598068237305,
0.6728836297988892,
-1.1273787021636963,
0.5449385643005371,
-1.1174697875976562,
-0.2842671871185303... |
func (t *JSONTime) MarshalJSON() ([]byte, error) {
//do your serializing here
stamp := fmt.Sprintf("\"%s\"", t.Time.Format("2006-01-02 15:04"))
return []byte(stamp), nil
} | [
-0.21650801599025726,
-0.8935357332229614,
0.7709824442863464,
0.0612596832215786,
-0.8209300637245178,
-0.456781804561615,
-0.9405909180641174,
0.04138334095478058,
0.6252739429473877,
0.44946736097335815,
-0.7265098094940186,
0.8617610931396484,
-0.3321235477924347,
0.7493711709976196,
... |
func (t *JSONTime) UnmarshalJSON(buf []byte) error {
tt, err := time.Parse("2006-01-02 15:04", strings.Trim(string(buf), `"`))
if err != nil {
return err
}
t.Time = tt
return nil
} | [
-0.05338667333126068,
-0.1375477910041809,
0.7433999180793762,
-1.2207883596420288,
-0.7177234292030334,
-0.27544546127319336,
-0.15971769392490387,
-0.269691526889801,
-0.44245806336402893,
0.8666561841964722,
-1.0568125247955322,
-0.3476319909095764,
-0.3037954568862915,
0.71348440647125... |
func Substring(value string, start, end uint) string {
runes := []rune(value)
result := string(runes[start:end])
return result
} | [
-0.0809297263622284,
0.195974662899971,
0.35056740045547485,
-0.25099125504493713,
-0.6522692441940308,
0.24558715522289276,
-0.058759164065122604,
-0.3466443121433258,
-1.0352036952972412,
0.5275334119796753,
0.07311273366212845,
0.09294340014457703,
0.11967989057302475,
-1.50608539581298... |
func CreateSQLCache(queriesLocation ...string) (map[string]string, error) {
if len(queriesLocation) == 0 {
queriesLocation = append(queriesLocation, "./queries/*.sql")
}
myCache := map[string]string{}
var queries []string
var err error
for _, queryPath := range queriesLocation {
queries, err = filepath.Glo... | [
0.2083662897348404,
-0.7654938697814941,
0.6146788001060486,
-0.43077248334884644,
-0.8393421173095703,
0.35606977343559265,
-0.6317514777183533,
-0.4352274239063263,
-0.38621798157691956,
0.6960248351097107,
0.37123116850852966,
-1.0406832695007324,
-0.016132015734910965,
0.50418126583099... |
func (p *PathMapper) ApplyMappingToTextProtocol(protocol []byte) []byte {
return p.doTextPathMapping(protocol)
} | [
-0.7568742632865906,
-0.04821157455444336,
0.4783805012702942,
-0.12809547781944275,
-1.2950544357299805,
1.1461181640625,
0.3772829473018646,
0.9259945154190063,
1.051735281944275,
0.3593307137489319,
0.09019311517477036,
-1.061292052268982,
-0.8849592208862305,
0.010180825367569923,
-0... |
func (p *PathMapper) ApplyMappingToXML(xml []byte) []byte {
xml = p.doXmlPathMapping(xml)
//update xml length count
s := strings.Split(string(xml), "\x00")
i, err := strconv.Atoi(s[0])
errorhandler.PanicHandling(err)
l := len(s[1])
if i != l {
xml = bytes.Replace(xml, []byte(strconv.Itoa(i)), []byte(strconv.I... | [
-0.554965615272522,
-0.0753488764166832,
0.6475934386253357,
0.12777765095233917,
-0.542843222618103,
0.2828200161457062,
0.2631179392337799,
1.0384589433670044,
1.325765609741211,
-0.003592269029468298,
0.6056285500526428,
-0.9922534823417664,
0.23895783722400665,
-0.12135932594537735,
... |
func (p *PathMapper) getRealFilename(path string) string {
return strings.TrimPrefix(path, "file://")
} | [
-0.06569179147481918,
-0.7373237609863281,
0.6379901170730591,
0.20608101785182953,
-0.9253376722335815,
0.2849780023097992,
-0.15557941794395447,
1.1037020683288574,
0.22151793539524078,
-0.24882180988788605,
0.30140528082847595,
-0.8195969462394714,
0.7758493423461914,
-0.347416788339614... |
func findSmallest(in []int) int {
var smallest = in[0]
var i = 0
for n, v := range in[1:] {
if v < smallest {
smallest = v
i = n + 1
}
}
return i
} | [
-0.24621260166168213,
-0.24800533056259155,
0.5301681756973267,
-0.05420227721333504,
-0.5758845806121826,
-0.1691291630268097,
0.8511312007904053,
-1.2582508325576782,
0.19996808469295502,
-0.4444509446620941,
-0.7075744271278381,
0.33467552065849304,
-1.3390734195709229,
0.97181659936904... |
func HelloWorld() string {
return "Hello, World!"
} | [
0.5345910787582397,
-0.30816054344177246,
0.43487077951431274,
0.6067720651626587,
-0.18486082553863525,
0.9670695662498474,
-0.32135438919067383,
0.44797998666763306,
0.3923187851905823,
0.6789382696151733,
-0.038739170879125595,
0.31287258863449097,
0.42936575412750244,
-0.74918544292449... |
func EqualAssert(v1,v2 int) bool{
if v1 == v2 {
return true
} else {
if show == true {
fmt.Printf("Failed! %d and %d are not equal : \n",v1,v2)
}
return false
}
} | [
-0.5759536623954773,
-0.5700337886810303,
0.4650280475616455,
-0.6014298796653748,
-0.824677050113678,
0.4949430525302887,
0.030527185648679733,
-0.33658409118652344,
-0.17617985606193542,
0.4401835501194,
-0.20625337958335876,
1.3078036308288574,
-1.3667231798171997,
-0.20785468816757202,... |
func SameAssert(v1,v2 string) bool{
if v1 == v2 {
return true
} else {
if show == true {
fmt.Printf("Failed! %s and %s are not same : \n",v1,v2)
}
return false
}
} | [
-0.5089866518974304,
-1.2039824724197388,
0.5666358470916748,
-0.32370173931121826,
-1.2539674043655396,
0.24604761600494385,
0.17469611763954163,
-0.4476088285446167,
0.1796206384897232,
0.09098902344703674,
0.11917401850223541,
1.72955322265625,
-1.8508496284484863,
-0.2065066248178482,
... |
func TrueAssert(v bool) bool {
if v == true {
return true
} else {
if show == true {
fmt.Printf("Failed! %v is not TRUE : \n",v)
}
return false
}
} | [
-0.6324521899223328,
0.11945630609989166,
0.3089151382446289,
-0.6830661296844482,
-1.7103923559188843,
0.5563034415245056,
0.6402117013931274,
-0.01673188805580139,
0.12017661333084106,
-0.1649026870727539,
-0.46323683857917786,
0.3644773066043854,
-1.5447674989700317,
0.17031671106815338... |
func FalseAssert(v bool) bool {
if v == true {
return true
} else {
if show == true {
fmt.Printf("Failed! %v is not FALSE : \n",v)
}
return false
}
} | [
-0.764194130897522,
0.08754934370517731,
0.2774956226348877,
-0.8077751994132996,
-1.4596384763717651,
0.5821189284324646,
0.47716087102890015,
-0.3238283693790436,
0.20359162986278534,
-0.5958759188652039,
0.05904821306467056,
0.5103474855422974,
-1.6434749364852905,
0.6482274532318115,
... |
func GreaterThanAssert(v1,v2 int) bool{
if v1 > v2 {
return true
} else {
if show == true {
fmt.Printf("Failed! %d isn't greater than %d : \n",v1,v2)
}
return false
}
} | [
-0.18574640154838562,
-0.3332270383834839,
0.4156802296638489,
-0.04711803048849106,
-0.649067223072052,
1.032297968864441,
-0.3666924238204956,
-0.7960630655288696,
-0.4422643482685089,
-0.17262671887874603,
0.18709522485733032,
1.105956792831421,
-0.935196578502655,
0.09717776626348495,
... |
func LessThanAssert(v1,v2 int) bool{
if v1 < v2 {
return true
} else {
if show == true {
fmt.Printf("Failed! %d isn't greater than %d : \n",v1,v2)
}
return false
}
} | [
0.5960589647293091,
-0.7185850143432617,
0.3325769901275635,
-0.8606240153312683,
-0.6135169863700867,
0.6788181066513062,
-0.4056592285633087,
-0.8461605310440063,
-0.10815446823835373,
-0.4221833050251007,
0.037653688341379166,
1.0870164632797241,
-1.1083186864852905,
0.48549342155456543... |
func CountStringArrayAssert(lenght int,array []string) bool{
if lenght == len(array) {
return true
} else {
if show == true {
fmt.Printf("Failed! %v and %v are not equal : \n",lenght,array)
}
return false
}
} | [
0.4232354462146759,
-0.6959465742111206,
0.5738720893859863,
-0.9894181489944458,
0.39840129017829895,
0.7089121341705322,
-0.1302756667137146,
0.0066997515968978405,
0.15657900273799896,
0.7816827297210693,
0.28557732701301575,
0.3395530879497528,
-0.5631322264671326,
1.0212318897247314,
... |
func CountIntArrayAssert(lenght int,array []int) bool{
if lenght == len(array) {
return true
} else {
if show == true {
fmt.Printf("Failed! %v and %v are not equal : \n",lenght,array)
}
return false
}
} | [
0.16724640130996704,
-0.9776920676231384,
0.5823699235916138,
-0.5770412683486938,
0.036010462790727615,
1.2521698474884033,
-0.14594580233097076,
0.1653561294078827,
0.43731093406677246,
0.8131392598152161,
0.2419721782207489,
0.3892877995967865,
-1.4323134422302246,
1.054992914199829,
... |
func CountFloatArrayAssert(lenght int,array []float32) bool{
if lenght == len(array) {
return true
} else {
if show == true {
fmt.Printf("Failed! %v and %v are not equal : \n",lenght,array)
}
return false
}
} | [
0.3945862054824829,
-0.5256860852241516,
0.6088446378707886,
-0.5533413290977478,
0.1359342783689499,
1.266473650932312,
0.30788663029670715,
0.15830378234386444,
0.2912966310977936,
0.16863997280597687,
0.07153051346540451,
0.32882609963417053,
-1.1031827926635742,
1.5482842922210693,
-... |
func CountBoolArrayAssert(lenght int,array []bool) bool{
if lenght == len(array) {
return true
} else {
if show == true {
fmt.Printf("Failed! %v and %v are not equal : \n",lenght,array)
}
return false
}
} | [
0.06665679812431335,
-0.9545738697052002,
0.4658085107803345,
-0.4994223117828369,
0.0038802132476121187,
1.2848531007766724,
-0.0023650957737118006,
0.3131832480430603,
-0.012648042291402817,
0.8182788491249084,
0.0952148288488388,
0.5789827704429626,
-0.8496993780136108,
0.96361958980560... |
func RegexpAssert(str string,regex string) bool{
var Regex_x = regexp.MustCompile(regex)
if Regex_x.MatchString(str) == true {
return true
} else {
if show == true {
fmt.Printf("Failed! %v and %v are not equal : \n")
}
return false
}
} | [
0.06681392341852188,
-0.18377740681171417,
0.7440687417984009,
0.010727948509156704,
-0.02660134993493557,
0.5121080875396729,
-0.2854835093021393,
0.48563352227211,
-0.24866308271884918,
0.7947109937667847,
0.38574957847595215,
0.5583877563476562,
-1.3592555522918701,
-0.07833534479141235... |
func fileinfo_atime(fi os.FileInfo) time.Time {
if stat_t, ok := fi.Sys().(*syscall.Stat_t); ok {
secs, nsec := stat_t.Atim.Unix()
return time.Unix(secs, nsec)
}
// Fallback: last modification time
return fi.ModTime()
} | [
0.8976588249206543,
-0.9996228814125061,
0.5699074268341064,
-0.6977676749229431,
-0.3475863039493561,
-0.5756891369819641,
0.030855653807520866,
0.12084021419286728,
-0.7221546173095703,
0.656408429145813,
0.5135039687156677,
-0.273872047662735,
0.3582540452480316,
0.7570709586143494,
-... |
func (p *SAParser) Parse(tokens []string) error {
if len(tokens) < 3 {
return fmt.Errorf("Bad format")
}
args := &parseSAArgs{
rp: GetRootParser(),
selector: &sad.SASelector{},
value: &sad.SAValue{},
}
var mgr *sad.Mgr
switch tokens[0] {
case "in":
mgr = sad.GetMgr(ipsec.DirectionTypeIn)
ca... | [
-0.13422292470932007,
0.5322208404541016,
0.694054365158081,
0.015480506233870983,
-0.5582758188247681,
-0.34238338470458984,
-0.15548019111156464,
-0.5945277214050293,
0.021548766642808914,
0.3094640076160431,
-0.010138459503650665,
0.16170699894428253,
0.49636000394821167,
0.652654588222... |
func CipherAlgos() map[string]ipsec.CipherAlgoType {
return cipherAlgos
} | [
0.021050315350294113,
0.6411179900169373,
0.38316240906715393,
-0.26062873005867004,
-1.7021015882492065,
0.4547657370567322,
-0.08833257108926773,
-0.22302106022834778,
-0.09205738455057144,
0.547089695930481,
-1.102433443069458,
0.7172626256942749,
0.24232026934623718,
0.1279513835906982... |
func AuthAlgos() map[string]ipsec.AuthAlgoType {
return authAlgos
} | [
0.28894633054733276,
0.5303728580474854,
0.4273095726966858,
0.2929389476776123,
-0.7045609951019287,
0.3412708342075348,
-0.4919793903827667,
-0.08500704914331436,
-0.525375485420227,
0.363543838262558,
-0.9734725952148438,
0.7512266635894775,
1.0205535888671875,
0.2043677717447281,
0.2... |
func AeadAlgos() map[string]ipsec.AeadAlgoType {
return aeadAlgos
} | [
0.4746050238609314,
0.5591510534286499,
0.4552907347679138,
-0.5862207412719727,
-0.6755327582359314,
0.4009665250778198,
-0.5607919096946716,
-0.11570961773395538,
0.30067378282546997,
0.846991777420044,
-0.506598174571991,
0.2599214017391205,
1.2141237258911133,
0.8837634921073914,
0.1... |
func (res ItemsResource) List(w http.ResponseWriter, r *http.Request) {
render.JSON(w, r, items)
} | [
-0.9549210071563721,
-1.4414823055267334,
0.24057112634181976,
-0.6609610915184021,
0.41727033257484436,
-0.5746546387672424,
-0.5680095553398132,
0.6679683923721313,
-0.04979860782623291,
0.23733216524124146,
-0.5662394762039185,
-0.8741880059242249,
0.6233545541763306,
-0.010185437276959... |
func (res ItemsResource) Update(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("Todo item update by id"))
} | [
-0.9096521735191345,
-0.9054087996482849,
0.23361524939537048,
0.16202017664909363,
-0.022840389981865883,
-0.006746348924934864,
0.21420250833034515,
-0.2323836386203766,
-0.024279195815324783,
0.28915148973464966,
-0.2578177750110626,
-0.7042109370231628,
0.11641770601272583,
-0.57604277... |
func RegisterAdminRoutes(services *ewserver.Services, e *gin.Engine) {
// setup admin routes
apiRoutes := e.Group("api/v1")
userRoutes := apiRoutes.Group("/admin/users")
userRoutes.GET("/details/:user", AdminUserDetails(services.UserService, services.LogService, e))
userRoutes.GET("/list", AdminUsersDetails(servic... | [
-0.36382758617401123,
0.8937086462974548,
0.8462615609169006,
-0.3413328230381012,
0.633364200592041,
-0.018262719735503197,
-0.09049221128225327,
-0.7385566234588623,
-0.2160743772983551,
0.047855034470558167,
-0.5383731722831726,
0.7607733607292175,
-0.10957782715559006,
1.15569341182708... |
func RegisterUserRoutes(services *ewserver.Services, e *gin.Engine) {
userRoutes := e.Group("api/v1/user")
userRoutes.GET("/profile", UserProfile(services.UserService, e))
} | [
-0.17864196002483368,
1.1896568536758423,
0.42357635498046875,
0.8169996738433838,
0.5574899315834045,
-0.029473893344402313,
-0.016479160636663437,
-0.17473623156547546,
-0.3646225035190582,
0.3489062488079071,
-1.1638338565826416,
0.6510370969772339,
0.1456550806760788,
0.350748449563980... |
func RegisterAuthnRoutes(authnService ewserver.AuthnService, logService ewserver.LogService, e *gin.Engine) {
routes := e.Group("/")
e.LoadHTMLGlob("../../web/templates/**/*")
routes.GET(LoginPath, LoginPage(e))
routes.POST(LoginPath, Authenticate(authnService, logService, e))
routes.GET("/logout", Logout(authnSer... | [
-0.9981721043586731,
0.05607479438185692,
0.5379644632339478,
0.1919572353363037,
0.4016759395599365,
-0.4885728359222412,
-0.21358011662960052,
0.17267531156539917,
0.23437289893627167,
-0.31435123085975647,
-0.8810142278671265,
0.8591006994247437,
0.41139304637908936,
0.9056833386421204,... |
func FolderDetailsTypePtr(in FolderDetailsType) *FolderDetailsType { return &in } | [
0.6445503234863281,
0.04743678867816925,
0.39099639654159546,
-0.3217319846153259,
0.17459142208099365,
1.0782756805419922,
0.14941422641277313,
-0.7311439514160156,
0.48807859420776367,
-0.7546973824501038,
0.7614628672599792,
0.10231366753578186,
-0.9431493878364563,
0.5063393115997314,
... |
func FolderDetailsTypeFromPtr(in *FolderDetailsType) FolderDetailsType {
if in == nil {
return 0
}
return *in
} | [
0.3646261990070343,
-0.25546735525131226,
0.2471177875995636,
0.5331896543502808,
0.6856493353843689,
0.7284683585166931,
0.8522952198982239,
-0.6929917931556702,
-0.0676179900765419,
-1.228974461555481,
0.32252246141433716,
-0.3944792151451111,
-0.5041782855987549,
1.1232450008392334,
1... |
func New(getkey func(value interface{}) interface{}, vtype string) *SSet {
var set SSet
set.list = arraylist.New()
set.m = hashmap.New()
set.m_index = make(map[interface{}]int)
set.f = getkey
set.item_type = vtype
set.createline = time.Now().Unix()
return &set
} | [
-0.01680123060941696,
0.028232334181666374,
0.4930416941642761,
0.04475465416908264,
-1.0452290773391724,
-0.7461927533149719,
-0.25844019651412964,
-0.1395932137966156,
-0.7881605625152588,
0.3832152783870697,
-0.07409489154815674,
0.692407488822937,
0.4340507388114929,
0.328334242105484,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.