text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (m *VolumeEfficiencyPolicyInlineSvm) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateLinks(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
} | [
0.3980262577533722,
-0.36207693815231323,
0.5262255668640137,
-0.6382749080657959,
1.0447055101394653,
-0.3004712760448456,
-0.36140769720077515,
0.7550428509712219,
0.27540498971939087,
0.18333061039447784,
0.2489212453365326,
0.17539554834365845,
-1.0484477281570435,
-0.11560001224279404... |
func (m *VolumeEfficiencyPolicyInlineSvm) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateLinks(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
} | [
0.42928263545036316,
-0.5339055061340332,
0.6195282340049744,
-0.3741671144962311,
0.7000424265861511,
0.010401197709143162,
-0.6447003483772278,
0.4079527258872986,
0.9459539651870728,
0.2081289440393448,
0.3572070300579071,
0.7366968989372253,
-1.2187002897262573,
-0.34728389978408813,
... |
func (m *VolumeEfficiencyPolicyInlineSvmInlineLinks) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateSelf(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
} | [
0.18890005350112915,
-0.6723593473434448,
0.14848998188972473,
-0.6867107152938843,
0.7853475213050842,
-0.30014535784721375,
-0.3833840489387512,
0.8472201824188232,
0.09965141862630844,
0.18753771483898163,
0.1489482969045639,
0.4658880829811096,
-1.5134819746017456,
-0.31024274230003357... |
func (m *VolumeEfficiencyPolicyInlineSvmInlineLinks) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateSelf(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
} | [
0.25306978821754456,
-0.6850065588951111,
0.29932472109794617,
-0.61972576379776,
0.4652377963066101,
0.05437881872057915,
-0.7110635638237,
0.43853959441185,
0.8819987177848816,
0.21219484508037567,
0.32761308550834656,
1.0055309534072876,
-1.5659598112106323,
-0.5712383985519409,
-0.49... |
func (s *session) send(buf []byte) error {
select {
case s.clientActivityC <- true:
default:
}
_, err := s.backendConn.Write(buf)
if err != nil {
return err
}
s.scheduler.IncrementTx(*s.backend, uint(len(buf)))
if s.maxRequests > 0 {
if atomic.AddUint64(&s._sentRequests, 1) >= s.maxRequests {
s.stop(... | [
-0.1546921581029892,
-0.03188344091176987,
0.5776234269142151,
0.6609849333763123,
-0.000055446900660172105,
-0.3759501576423645,
0.14784735441207886,
-0.8246126174926758,
-0.17796319723129272,
0.1599968820810318,
-0.3414139449596405,
-0.22851386666297913,
-0.8470749258995056,
-0.389297395... |
func ReconcileLabelledObject(
ctx context.Context,
logger logr.Logger,
registry k8s_registry.TypeRegistry,
client kube_client.Client,
owner kube_types.NamespacedName,
ownerMesh string,
ownedType k8s_registry.ResourceType,
ownedNamespace string,
owned map[string]core_model.ResourceSpec,
) error {
log := logger... | [
-0.35457783937454224,
-0.9917940497398376,
1.0739822387695312,
-0.26493924856185913,
0.7501780986785889,
0.3706219792366028,
0.31025469303131104,
-0.7172574400901794,
0.13201318681240082,
0.2539415657520294,
0.08258894830942154,
0.2311999499797821,
-0.32455703616142273,
0.34690284729003906... |
func ConectarBD() *mongo.Client {
client, err := mongo.Connect(context.TODO(), clientOptions) // se hace el contexto desde la librería para la memoria
if err != nil {
log.Fatal(err.Error())
return client
}
err = client.Ping(context.TODO(), nil)
if err != nil {
log.Fatal(err.Error())
return client
}
log.P... | [
0.7650294303894043,
-0.9485264420509338,
1.168997883796692,
0.11977171152830124,
0.12865817546844482,
1.4257489442825317,
-0.8138290643692017,
-0.9421563148498535,
0.2856857180595398,
0.1626761108636856,
1.7475343942642212,
1.159171223640442,
-1.0387715101242065,
-0.21420735120773315,
0.... |
func (b *Bridge) Up() error {
bridge, err := findBridge(b.Device)
if err != nil {
if err := b.create(); err != nil {
return err
}
if err := b.setIP(); err != nil {
return err
}
if err := b.setMembers(nil, false); err != nil {
return err
}
if err := b.setUp(); err != nil {
return err
}
} e... | [
-0.7507845163345337,
0.43754011392593384,
0.8269150257110596,
0.22140073776245117,
0.4780929982662201,
0.3462805151939392,
0.7381278872489929,
-0.004645594395697117,
0.7027460932731628,
-0.12530948221683502,
-0.2224009484052658,
0.3783295452594757,
-0.6423742771148682,
0.4959351420402527,
... |
func findBridge(device string) (*Bridge, error) {
cmd := exec.Command("ifconfig", device)
out, err := cmd.Output()
if err != nil {
return nil, err
}
bridge := parseIfconfig(string(out))
bridge.Device = device
return bridge, nil
} | [
-0.037663787603378296,
0.8524491190910339,
0.3981277048587799,
1.3296382427215576,
-0.25678685307502747,
0.3037320673465729,
0.4238207936286926,
-0.7169288992881775,
0.03380463272333145,
0.01253602933138609,
-0.1406688243150711,
-0.2807510495185852,
-1.8806591033935547,
1.0783259868621826,... |
func parseIfconfig(ifconfig string) *Bridge {
bridge := Bridge{}
for _, line := range strings.Split(ifconfig, "\n") {
line = strings.TrimSpace(line)
if strings.HasPrefix(line, "member:") {
kv := strings.Split(line, " ")
bridge.Members = append(bridge.Members, kv[1])
} else if strings.HasPrefix(line, "ine... | [
0.21487891674041748,
-0.12382003664970398,
0.5612098574638367,
0.10455899685621262,
-0.5230093598365784,
0.05089608207345009,
0.046165965497493744,
0.64681476354599,
0.01857195422053337,
-0.18132950365543365,
-0.39197564125061035,
-0.5224958062171936,
-0.8016055822372437,
-0.08672139793634... |
func (b *Bridge) create() error {
cmd := exec.Command("ifconfig", b.Device, "create")
fmt.Printf("cmd: %s\n", strings.Join(cmd.Args, " "))
return cmd.Run()
} | [
-0.32650357484817505,
1.0024131536483765,
0.37455955147743225,
0.8923051357269287,
0.7971351742744446,
0.9866262078285217,
0.5122190117835999,
-0.38341620564460754,
-0.7581460475921631,
-0.2862369418144226,
0.34153929352760315,
0.26162102818489075,
-1.3552618026733398,
1.3651167154312134,
... |
func (b *Bridge) Destroy() error {
cmd := exec.Command("ifconfig", b.Device, "destroy")
fmt.Printf("cmd: %s\n", strings.Join(cmd.Args, " "))
return cmd.Run()
} | [
-0.4250865578651428,
0.7879432439804077,
0.43463295698165894,
0.1308540254831314,
0.7579120993614197,
0.671032190322876,
0.42227256298065186,
0.30503392219543457,
-0.0480787567794323,
-0.03385601192712784,
0.42622125148773193,
-0.03952902927994728,
-1.749076247215271,
1.211116909980774,
... |
func (b *Bridge) setUp() error {
cmd := exec.Command("ifconfig", b.Device, "up")
fmt.Printf("cmd: %s\n", strings.Join(cmd.Args, " "))
return cmd.Run()
} | [
-0.6561932563781738,
0.7912708520889282,
0.4917193353176117,
0.32860592007637024,
0.6308854222297668,
0.2430524080991745,
1.2352622747421265,
0.19179710745811462,
0.03546898066997528,
0.16434246301651,
0.28640636801719666,
0.4044947326183319,
-1.2990691661834717,
0.9734647870063782,
-0.3... |
func (b *Bridge) setIP() error {
if b.IP == nil {
return nil
}
cmd := exec.Command("ifconfig", b.Device, b.IP.String(), "netmask", fmt.Sprintf("0x%s", b.Netmask.String()))
fmt.Printf("cmd: %s\n", strings.Join(cmd.Args, " "))
return cmd.Run()
} | [
-0.695040762424469,
1.001908302307129,
0.74723881483078,
1.3910889625549316,
0.3672301471233368,
0.32053327560424805,
0.3821197748184204,
0.17285676300525665,
0.008952420204877853,
-0.41833582520484924,
-0.0010019520996138453,
-0.4636726379394531,
-0.48950526118278503,
-0.07106075435876846... |
func (b *Bridge) setMembers(cur []string, delete bool) error {
add, del := sliceDiff(b.Members, cur)
if add != nil {
if err := addMembers(b.Device, add); err != nil {
return err
}
}
if delete && del != nil {
if err := delMembers(b.Device, del); err != nil {
return err
}
}
return nil
} | [
-0.09902370721101761,
0.38262584805488586,
0.5191613435745239,
0.2343588024377823,
0.4805082082748413,
-0.003399117849767208,
-0.09394007176160812,
0.49057671427726746,
0.546286404132843,
-0.1241600438952446,
0.4906567931175232,
0.8158615827560425,
-1.3646140098571777,
0.9967966079711914,
... |
func addMembers(device string, members []string) error {
if len(members) == 0 {
return nil
}
args := []string{device}
NextMember:
for _, member := range members {
// Ugly polling and timeout mechanism waiting for the hyperkit to bring up the tap interface.
var count int
for {
if count > 10 {
fmt.Pr... | [
-0.5339547395706177,
1.523627758026123,
0.7529272437095642,
0.041138727217912674,
0.9032295942306519,
0.016573628410696983,
-0.10946838557720184,
-0.487709641456604,
0.03164370357990265,
-0.33678218722343445,
0.5637660026550293,
-0.6529436707496643,
-1.4326757192611694,
0.9605580568313599,... |
func delMembers(device string, members []string) error {
if len(members) == 0 {
return nil
}
args := []string{device}
for _, member := range members {
args = append(args, "deletem", member)
}
cmd := exec.Command("ifconfig", args...)
fmt.Printf("cmd: %s\n", strings.Join(cmd.Args, " "))
return cmd.Run()
} | [
-0.06201791390776634,
0.9781267046928406,
0.5257986187934875,
0.2382451444864273,
0.19020450115203857,
-0.08882034569978714,
-0.3875277042388916,
0.30157411098480225,
-0.384583055973053,
0.08107532560825348,
0.624966025352478,
0.4172113835811615,
-1.7529597282409668,
0.878147304058075,
-... |
func sliceDiff(x, y []string) ([]string, []string) {
if len(x) == 0 {
return nil, y
}
if len(y) == 0 {
return x, nil
}
xMap := make(map[string]bool)
yMap := make(map[string]bool)
for _, xElem := range x {
xMap[xElem] = true
}
for _, yElem := range y {
yMap[yElem] = true
}
var diffX []string
var ... | [
-0.223176047205925,
-1.047904372215271,
0.6938804388046265,
-0.3745008409023285,
-0.27169695496559143,
0.23920290172100067,
-0.553338348865509,
0.2921874225139618,
-0.2563077211380005,
0.7461282014846802,
-0.577968955039978,
0.29755592346191406,
0.4181591272354126,
0.6520100235939026,
0.... |
func mapProtoTaskToTask(obj *proto.Task) *Task {
ulid, _ := ulid.Parse(obj.Id)
return &Task{ulid, obj.Title, obj.Description, int32(obj.Completed)}
} | [
-0.5738006830215454,
-0.5303922891616821,
0.4701312482357025,
0.08209677040576935,
-0.4018462896347046,
0.6578593850135803,
0.16506144404411316,
0.3211814761161804,
-0.106233149766922,
-0.04625265300273895,
-1.0776679515838623,
-0.13742652535438538,
0.6928787231445312,
-0.37489086389541626... |
func mapTaskListToProtoTaskCollection(ctx context.Context, taskList []*Task, dbMeta query.DBMeta) *proto.TaskCollection {
var tasks []*proto.TaskEntity
for _, task := range taskList {
taskEntity := mapTaskToProtoTaskEntity(ctx, task)
tasks = append(tasks, taskEntity)
}
taskCollection := &proto.TaskCollection{D... | [
-1.2089462280273438,
0.5235027074813843,
0.6698212623596191,
0.5278705358505249,
0.017843786627054214,
0.6782641410827637,
0.32655012607574463,
-0.43203338980674744,
0.07544723153114319,
-0.3488237261772156,
-0.42906150221824646,
-0.2377254217863083,
0.3990665078163147,
1.036482572555542,
... |
func mapTaskToProtoTaskEntity(ctx context.Context, task *Task) *proto.TaskEntity {
taskEntity := &proto.TaskEntity{}
taskEntity.Data = mapTaskToProtoTask(task)
hts := hateoas.GenerateEntityHateoas(ctx, "/tasks", task.Id.String())
hts.AddSubresource("tags")
taskEntity.Links = hts.Links
return taskEntity
} | [
-0.7190214991569519,
-0.20482158660888672,
0.6380921006202698,
-0.14242900907993317,
0.398966908454895,
0.8489165306091309,
0.17582131922245026,
0.08948070555925369,
0.3507622182369232,
-0.29295623302459717,
-0.835561990737915,
-0.7796828150749207,
0.9207596182823181,
0.8042009472846985,
... |
func mapTaskToProtoTask(task *Task) *proto.Task {
out := &proto.Task{}
out.Id = task.Id.String()
out.Title = task.Title
out.Description = task.Description
out.Completed = proto.Complete(task.Completed)
return out
} | [
-0.8782802820205688,
-0.329054594039917,
0.3500193953514099,
0.21594573557376862,
-0.993217945098877,
0.711730420589447,
-0.5391700267791748,
-0.6467074155807495,
-0.24336837232112885,
0.2973628044128418,
-1.1698272228240967,
-0.24551498889923096,
0.9597288966178894,
-0.2043471783399582,
... |
func GetArticleDetail(c *gin.Context) {
webapp := app.GinCtx{C: c}
aid, err := utils.Str(c.DefaultQuery("aid", "0")).Int64()
if err != nil {
log.Info(c, "invalid param aid,", err.Error())
webapp.MakeFailedJsonRes(http.StatusOK, err)
return
}
srv := NewArticleService(&Article{}, &ArticleModelImpl{})
srv.Dat... | [
0.06679169088602066,
0.3171636760234833,
0.5441207885742188,
-0.28403323888778687,
0.3398725688457489,
0.4270453453063965,
-0.09200336039066315,
0.02468241937458515,
-0.018314668908715248,
0.23197154700756073,
-0.061640992760658264,
0.9650161266326904,
-0.46984022855758667,
0.4434845745563... |
func NewWorker(numberOfRequests int, url, method, headers, body string, wg *sync.WaitGroup) *Worker {
return &Worker{
Url: url,
Method: method,
Headers: headers,
Body: body,
NumberOfRequests: numberOfRequests,
wg: wg,
}
} | [
-0.6956731081008911,
0.3592090606689453,
0.45001664757728577,
0.054638054221868515,
-0.7784594893455505,
0.010559200309216976,
-0.5425804257392883,
-0.2297007292509079,
0.04053201526403427,
-0.3968315124511719,
-0.17856958508491516,
-0.2674800455570221,
-0.5868129730224609,
0.5306060910224... |
func NewResponse(status int, headers, body string, start time.Time) *Response {
return &Response{
Status: status,
Headers: headers,
Body: body,
Start: start,
End: time.Now(),
}
} | [
0.03730520233511925,
-0.9259746074676514,
0.41709086298942566,
0.4956221878528595,
-0.5295700430870056,
-0.2832089364528656,
-1.1598234176635742,
-0.2334618717432022,
0.13326923549175262,
0.3785422444343567,
-0.43944135308265686,
-0.04185669496655464,
-0.17343266308307648,
-0.0903197303414... |
func (worker *Worker) Execute() {
for i := 0; i < worker.NumberOfRequests; i++ {
worker.Responses[i] = worker.DoRequest()
}
worker.wg.Done()
} | [
-0.5971030592918396,
-0.4722147583961487,
0.6681580543518066,
-0.4212474822998047,
1.2725900411605835,
0.5125258564949036,
-0.3745900094509125,
-1.0280389785766602,
-0.534012496471405,
0.22708041965961456,
-0.27020972967147827,
-0.8775309920310974,
-0.7704553008079529,
0.1465614289045334,
... |
func (worker *FetchEventsWorker) Start() {
worker.tomb.Go(func() error {
for {
select {
case <-worker.tomb.Dying():
{
worker.Logger.Info().Msg("Moira Notifier Fetching events stopped")
return nil
}
default:
{
event, err := worker.Database.FetchNotificationEvent()
if err != ni... | [
0.49531349539756775,
-0.17749810218811035,
0.7764677405357361,
-0.0466528944671154,
0.3047543168067932,
-0.1477312445640564,
0.3883512318134308,
-0.23612365126609802,
-0.32752707600593567,
0.47963565587997437,
0.0462813638150692,
1.0775437355041504,
0.42816680669784546,
0.48279333114624023... |
func (worker *FetchEventsWorker) Stop() error {
worker.tomb.Kill(nil)
return worker.tomb.Wait()
} | [
0.052147507667541504,
-0.10309969633817673,
0.6877338886260986,
0.44055455923080444,
-0.11467218399047852,
0.4450947940349579,
0.0832885280251503,
-0.11640049517154694,
-0.5433039665222168,
0.29391393065452576,
-0.8651675581932068,
-0.00009143352508544922,
-0.08225435018539429,
-0.51047837... |
func Run(path, pathSchema string) bool {
logger.Info(LC, "Starting module Config")
return make(path, pathSchema)
} | [
-0.19768714904785156,
-0.143714040517807,
0.47532743215560913,
-0.3210028111934662,
-0.21140643954277039,
0.8230150938034058,
-0.2506493926048279,
1.217881679534912,
-0.2381049394607544,
0.3901810944080353,
-0.9180710911750793,
-0.31300342082977295,
-0.7145277261734009,
-0.5167475938796997... |
func make(path, pathSchema string) bool {
schemaLoader := gojsonschema.NewReferenceLoader(fmt.Sprint(protocol, pathSchema))
documentLoader := gojsonschema.NewReferenceLoader(fmt.Sprint(protocol, path))
result, err := gojsonschema.Validate(schemaLoader, documentLoader)
if err != nil {
logger.Critical(LC, fmt.Spri... | [
-0.6664722561836243,
0.16247038543224335,
1.1646828651428223,
-0.5610079169273376,
-0.34219637513160706,
0.9590339064598083,
-0.2837102711200714,
0.42909184098243713,
-1.6801987886428833,
0.3512769043445587,
-0.1739327311515808,
-0.8106685876846313,
-0.33757293224334717,
-0.541302680969238... |
func StartGame() {
sg = tl.NewGame()
// Create titlescreen.
ts := NewTitleScreen()
ts.AddEntity(ts.Logo)
// Range options and add entities.
for _, v := range ts.OptionsText {
ts.AddEntity(v)
}
// Add entity for logo.
// Set FPS and start game.
sg.Screen().SetFps(10)
sg.Screen().SetLevel(ts)
sg.Start(... | [
-0.1971038430929184,
0.38011839985847473,
0.6333164572715759,
-0.2550535798072815,
0.4962964951992035,
0.6364017128944397,
-0.3624539077281952,
-0.5978134274482727,
-0.45829713344573975,
0.6901309490203857,
0.07994898408651352,
-0.6245465874671936,
0.4696632921695709,
0.7824366092681885,
... |
func NewTitleScreen() *Titlescreen {
// Create a title screen and its objects.
ts = new(Titlescreen)
ts.Level = tl.NewBaseLevel(tl.Cell{
Bg: tl.ColorBlack,
})
logofile, _ := ioutil.ReadFile("util/titlescreen-logo.txt")
ts.Logo = tl.NewEntityFromCanvas(10, 3, tl.CanvasFromString(string(logofile)))
ts.GameDiff... | [
-0.3972942531108856,
-0.3185011148452759,
0.6396153569221497,
-0.6829729676246643,
-0.4242342412471771,
0.13492430746555328,
-0.5036266446113586,
-1.333756446838379,
0.05009755119681358,
0.43679216504096985,
-0.6093417406082153,
-0.08413879573345184,
0.19179530441761017,
0.4189982712268829... |
func NewSidepanel() *Sidepanel {
// Create a sidepanel and its objects and return it
sp = new(Sidepanel)
sp.Instructions = []string{
"Instructions:",
"Use ← → ↑ ↓ to move the snake around",
"Pick up the food to grow bigger",
"■: 1 point/growth",
"R: 5 points (removes some speed!)",
"S: 1 point (increased... | [
0.2645692229270935,
-0.23457834124565125,
0.7641255855560303,
-0.7592000961303711,
-0.3051573634147644,
0.3196229040622711,
0.37282535433769226,
-0.6237824559211731,
0.014629753306508064,
0.15953199565410614,
-0.703235924243927,
0.46844181418418884,
-1.154036045074463,
0.7039193511009216,
... |
func UpdateScore(amount int) {
gs.Score += amount
sp.ScoreText.SetText(fmt.Sprintf("Score: %d", gs.Score))
} | [
0.07131044566631317,
-0.47329893708229065,
0.8983065485954285,
-0.2265833467245102,
-0.5030966997146606,
0.08286945521831512,
-0.28261634707450867,
-0.2503918707370758,
0.7954992055892944,
1.2647894620895386,
0.025407198816537857,
0.48951277136802673,
-0.2111089825630188,
0.279671818017959... |
func UpdateFPS() {
sg.Screen().SetFps(gs.FPS)
sp.SpeedText.SetText(fmt.Sprintf("Speed: %.0f", gs.FPS))
} | [
-0.1901492178440094,
-0.5025088787078857,
0.4577525854110718,
-0.38728219270706177,
-0.8447709083557129,
-0.4466691315174103,
-0.049750491976737976,
-0.2915501892566681,
0.21218541264533997,
0.33298149704933167,
0.3297947645187378,
0.5683771371841431,
-0.3757503628730774,
1.27340829372406,... |
func RestartGame() {
// Removes the current snake and food from the level.
gs.RemoveEntity(gs.SnakeEntity)
gs.RemoveEntity(gs.FoodEntity)
// Generate a new snake and food.
gs.SnakeEntity = NewSnake()
gs.FoodEntity = NewFood()
// Revert the score and fps to the standard.
SetDiffiultyFPS()
gs.Score = 0
// Up... | [
-0.20479482412338257,
-0.07993856072425842,
0.6683642268180847,
-0.6773127317428589,
0.6651814579963684,
-0.049685120582580566,
-0.5860682725906372,
0.15290653705596924,
-0.843377947807312,
0.8065029382705688,
-0.06350749731063843,
0.5142726302146912,
-1.0784673690795898,
0.712476670742034... |
func (s *rssBotService) Register(oldService types.Service, client *matrix.Client) error {
if len(s.Feeds) == 0 {
// this is an error UNLESS the old service had some feeds in which case they are deleting us :(
var numOldFeeds int
oldFeedService, ok := oldService.(*rssBotService)
if !ok {
log.WithField("servi... | [
-0.11103560775518417,
0.26377740502357483,
0.7799677848815918,
-0.061149343848228455,
0.5825965404510498,
-0.26494690775871277,
-0.4243592917919159,
-0.11582905799150467,
-0.7720636129379272,
-0.03629373013973236,
-0.20766185224056244,
0.5562745928764343,
-0.8043366074562073,
0.70107012987... |
func (s *rssBotService) queryFeed(feedURL string) (*gofeed.Feed, []gofeed.Item, error) {
log.WithField("feed_url", feedURL).Info("Querying feed")
var items []gofeed.Item
fp := gofeed.NewParser()
fp.Client = cachingClient
feed, err := fp.ParseURL(feedURL)
if err != nil {
return nil, items, err
}
// Work out w... | [
-0.29660171270370483,
-0.5139684081077576,
0.6170195937156677,
0.29349175095558167,
0.4077167212963104,
-0.773385226726532,
-0.6440595984458923,
-0.029281679540872574,
0.28234338760375977,
-0.37991639971733093,
-0.5129490494728088,
0.28731638193130493,
-0.6158419251441956,
0.17941443622112... |
func itemToHTML(feed *gofeed.Feed, item gofeed.Item) matrix.HTMLMessage {
return matrix.GetHTMLMessage("m.notice", fmt.Sprintf(
"<i>%s</i> posted a new article: %s ( %s )",
html.EscapeString(feed.Title), html.EscapeString(item.Title), html.EscapeString(item.Link),
))
} | [
-0.17104028165340424,
0.2744956612586975,
0.4289264678955078,
-0.9834110736846924,
0.6193937659263611,
0.04766674339771271,
-0.6834759712219238,
-0.6215936541557312,
-0.26152288913726807,
0.5108261108398438,
0.07668765634298325,
0.9225843548774719,
0.6696164011955261,
-0.43502482771873474,... |
func NewGCRA(redis Redis, key string, config *Config) *GCRA {
return &GCRA{
baseBucket: baseBucket{config: config},
script: NewScript(redis, luaGCRA),
key: key,
}
} | [
-0.7033377289772034,
-0.4915198087692261,
0.2909236252307892,
-0.03753446787595749,
-0.5556554794311523,
-0.6573421955108643,
-0.9100162386894226,
-0.7312214374542236,
-0.19948670268058777,
0.8175939917564392,
0.059673406183719635,
0.4764033854007721,
-0.3725799024105072,
0.686966359615325... |
func (g *GCRA) Transmit(amount int64) (bool, time.Duration, error) {
config := g.Config()
if amount > config.Capacity {
return false, -1, nil
}
// the interval between each arrival of one cell
emissionInterval := config.Interval
// how much earlier a cell can arrive than it would
delayVariationTolerance := ti... | [
-0.46768516302108765,
0.738578736782074,
1.0821787118911743,
0.1165674477815628,
-0.30784791707992554,
-0.3968082368373871,
0.48333340883255005,
-0.6360835433006287,
-0.6708073019981384,
0.8883734941482544,
-0.4766739308834076,
-0.4476378560066223,
-0.31890517473220825,
0.19876936078071594... |
func NewKafkaBroker(peers []string) *Kafka {
brk := new(Kafka)
brk.Servers = peers
brk.Initialize()
return brk
} | [
-0.19515730440616608,
0.29579538106918335,
0.36068159341812134,
1.438435435295105,
-0.3747722804546356,
-0.05387776345014572,
0.07267586886882782,
0.2687413990497589,
-0.03278489410877228,
0.3077048659324646,
-0.09761478006839752,
-0.18426308035850525,
-1.650480031967163,
1.203891992568969... |
func (b *Kafka) Initialize() {
for {
// Try to initialize broker backend
log.Info("BROKER", "\t", "Attempting to connect to kafka backend: ", b.Servers)
b.createTopicLock = topicLock{}
b.consumeLock = make(map[string]*topicLock)
b.Config = sarama.NewConfig()
b.Config.Consumer.Fetch.Default = 1000000
va... | [
0.0767560750246048,
0.42851507663726807,
0.7583793997764587,
1.182297945022583,
1.0070394277572632,
-0.573035478591919,
-0.0427565798163414,
-0.11649076640605927,
-0.6700504422187805,
0.8838059306144714,
-0.2773582935333252,
0.3389977514743805,
-1.0622636079788208,
0.44568806886672974,
0... |
func (b *Kafka) Consume(ctx context.Context, topic string, offset int64, imm bool, max int64) ([]string, error) {
b.lockForTopic(topic)
defer b.unlockForTopic(topic)
// Fetch offsets
newOff, err := b.Client.GetOffset(topic, 0, sarama.OffsetNewest)
if err != nil {
log.Error(err.Error())
}
oldOff, err := b.C... | [
0.0340864360332489,
-0.46480250358581543,
0.8430019617080688,
0.31485745310783386,
-0.5038615465164185,
-0.11667768657207489,
-0.025924960151314735,
-0.936103343963623,
-0.16553618013858795,
1.6261816024780273,
0.6810017228126526,
0.4723771810531616,
-0.44471144676208496,
0.436538130044937... |
func (b *Kafka) CloseConnections() {
// Close Consumer
if err := b.Consumer.Close(); err != nil {
log.Error(err)
}
// Close Client
if err := b.Client.Close(); err != nil {
log.Error(err)
}
} | [
-0.2050142139196396,
-0.5873011350631714,
0.43368077278137207,
0.7740650177001953,
-0.050465043634176254,
-0.20365333557128906,
1.006666660308838,
-0.0532560832798481,
-0.1524619609117508,
-0.16044749319553375,
1.1656358242034912,
-0.5928530097007751,
-0.9253332614898682,
0.667714893817901... |
func (a Ave) Cacarejar() string {
return "cocoricó"
} | [
-0.16700692474842072,
-0.557555615901947,
0.4979866147041321,
1.1671825647354126,
-1.1267499923706055,
1.2393896579742432,
0.8499042391777039,
0.291851282119751,
-0.6229190230369568,
0.18948931992053986,
0.48643800616264343,
-0.22250457108020782,
-0.49305030703544617,
1.3498684167861938,
... |
func (a Ave) Quack() string {
return "Quack, quack.."
} | [
-0.005326418671756983,
-0.12671664357185364,
0.6291092038154602,
-0.7811671495437622,
0.0645616352558136,
0.4700949788093567,
0.6293356418609619,
-0.8190307021141052,
0.6224056482315063,
0.18505677580833435,
0.4538072645664215,
0.7249787449836731,
0.6526445150375366,
-0.5791903138160706,
... |
func UniqMacID() string {
return ""
} | [
1.1920602321624756,
-0.4780886173248291,
0.4207576513290405,
-0.6987336277961731,
-0.07567642629146576,
0.2381264567375183,
0.2889386713504791,
0.47921016812324524,
0.7040773630142212,
-0.48088908195495605,
0.10521380603313446,
-0.18402905762195587,
-0.46941766142845154,
0.3072513937950134... |
func PathExists(path string) bool {
_, err := os.Stat(path)
if err == nil {
return true
}
if os.IsNotExist(err) {
return false
}
return false
} | [
-0.09528182446956635,
-0.25949719548225403,
0.5113025903701782,
-0.11338822543621063,
0.750336229801178,
0.8668687343597412,
-0.4106026589870453,
0.09767449647188187,
-0.1274404674768448,
-0.1355566382408142,
-0.5417544841766357,
-0.9665402173995972,
-0.5812522768974304,
0.1110574454069137... |
func NewXTimer() *XTimer {
now := time.Now().UnixNano()
return &XTimer{
bornTime: now,
latestTime: now,
}
} | [
-0.19534161686897278,
-0.48845037817955017,
0.27401939034461975,
0.06191191449761391,
-1.4619324207305908,
-0.38918864727020264,
-1.9516857862472534,
0.1267910748720169,
-0.7033737301826477,
0.0022484674118459225,
-0.9882529377937317,
0.2384360432624817,
-0.13254040479660034,
1.65048599243... |
func (timer *XTimer) Mark(tag string) {
now := time.Now().UnixNano()
delta := float64(now - timer.latestTime)
point := &MarkPoint{
tag: tag,
delta: delta,
}
timer.latestTime = now
timer.points = append(timer.points, point)
} | [
-0.04930656775832176,
0.526597261428833,
0.403127521276474,
-0.2297714501619339,
0.7653268575668335,
0.20447833836078644,
0.08769672363996506,
0.5298352241516113,
-0.10537338256835938,
0.5716667175292969,
-0.8636269569396973,
0.7696009278297424,
0.5360252261161804,
0.8681022524833679,
-0... |
func (timer *XTimer) Print() string {
now := time.Now().UnixNano()
deltaTotal := float64(now - timer.bornTime)
msg := []string{}
for _, point := range timer.points {
msg = append(msg, fmt.Sprintf("%s: %.2f ms", point.tag, point.delta/float64(time.Millisecond)))
}
msg = append(msg, fmt.Sprintf("total: %.2fms", d... | [
0.5595535635948181,
-0.24729900062084198,
0.7569462656974792,
-0.7330165505409241,
0.028877990320324898,
0.4260636270046234,
-0.7953751683235168,
-0.9496815204620361,
-0.763806939125061,
0.3788969814777374,
0.2553417682647705,
-0.07962647825479507,
-0.0438246913254261,
0.5050936937332153,
... |
func F(bytes []byte) string {
return fmt.Sprintf("%x", bytes)
} | [
0.08346002548933029,
0.2312316596508026,
0.3745116591453552,
-0.5440021753311157,
-0.46072784066200256,
0.21499797701835632,
-0.8635512590408325,
0.1491955816745758,
-0.07897555083036423,
0.12580829858779907,
0.44334661960601807,
-0.7109653353691101,
0.3719611167907715,
-0.0349030196666717... |
func Glogid() string {
glogid.Lock()
glogidid++
glogid.Unlock()
t := time.Now().UnixNano()
return fmt.Sprintf("%d_%d_%d", t, glogidid, rand.Intn(10000))
} | [
0.14197878539562225,
0.029060224071145058,
0.7063331007957458,
-0.9908308386802673,
-0.5893608331680298,
0.8254181146621704,
-0.9055712819099426,
-1.1391034126281738,
0.14070071280002594,
0.8032892942428589,
-0.4173780679702759,
0.9133499264717102,
-0.20474758744239807,
0.10523155331611633... |
func GHeader() *pb.Header {
h := &pb.Header{}
h.Logid = Glogid()
return h
} | [
0.3724128007888794,
0.2017761617898941,
0.47516950964927673,
0.3540571331977844,
-0.9034687876701355,
1.3374792337417603,
-0.15188206732273102,
-1.5002741813659668,
-0.014056967571377754,
-0.4777785539627075,
-0.5556826591491699,
0.48321449756622314,
-1.042026162147522,
0.18964020907878876... |
func GenNonce() string {
return fmt.Sprintf("%d%8d", time.Now().Unix(), rand.Intn(100000000))
} | [
-0.6171107888221741,
0.19310146570205688,
0.7701398134231567,
-0.34621936082839966,
-0.04979880154132843,
0.5505073666572571,
-0.24712231755256653,
-0.3546317517757416,
-0.14449714124202728,
0.3104971945285797,
0.30444246530532837,
-0.08144734054803848,
-0.597932755947113,
0.51042425632476... |
func SetSeed() error {
// 为math
seedByte, err := walletRand.GenerateSeedWithStrengthAndKeyLen(walletRand.KeyStrengthHard, walletRand.KeyLengthInt64)
if err != nil {
return err
}
bytesBuffer := bytes.NewBuffer(seedByte)
var seed int64
binary.Read(bytesBuffer, binary.BigEndian, &seed)
rand.Seed(seed)
return n... | [
0.8006285429000854,
-0.29745322465896606,
0.47017109394073486,
-0.28322458267211914,
0.05895672366023064,
1.0182417631149292,
-0.20610496401786804,
-0.5976395606994629,
0.5929287672042847,
-0.24152304232120514,
-0.06849391758441925,
0.6326802372932434,
-0.7975706458091736,
0.50413471460342... |
func podConfigFiles(configmap *corev1.ConfigMap, spec v1beta1.PGAdminPodSpec) []corev1.VolumeProjection {
config := append(append([]corev1.VolumeProjection{}, spec.Config.Files...),
[]corev1.VolumeProjection{
{
ConfigMap: &corev1.ConfigMapProjection{
LocalObjectReference: corev1.LocalObjectReference{
... | [
-0.6693571209907532,
-0.27625736594200134,
0.689105749130249,
-0.48106393218040466,
-0.04261666163802147,
0.32293885946273804,
-0.683102011680603,
-0.2312646508216858,
-0.2169952541589737,
0.9787392020225525,
-0.2220364511013031,
-0.31401267647743225,
-0.7598630785942078,
0.111821204423904... |
func startupCommand() []string {
// pgAdmin reads from the following file by importing its public names.
// Make sure to assign only to variables that begin with underscore U+005F.
// - https://github.com/pgadmin-org/pgadmin4/blob/REL-4_30/web/config.py#L669
// - https://docs.python.org/3/reference/simple_stmts.htm... | [
-0.8723798394203186,
-0.4847552478313446,
1.0423603057861328,
0.23618903756141663,
-0.029443252831697464,
-0.00039651841507293284,
0.48488742113113403,
-0.5508213043212891,
-0.21139118075370789,
0.528922975063324,
-0.6001760363578796,
0.39977893233299255,
-0.11887412518262863,
0.2986580729... |
func systemSettings(spec *v1beta1.PGAdminPodSpec) map[string]interface{} {
settings := *spec.Config.Settings.DeepCopy()
if settings == nil {
settings = make(map[string]interface{})
}
// SERVER_MODE must always be enabled when running on a webserver.
// - https://github.com/pgadmin-org/pgadmin4/blob/REL-4_30/web... | [
-1.1089849472045898,
0.13684365153312683,
0.5233105421066284,
0.4685330092906952,
0.1900891661643982,
-0.14618661999702454,
0.057425010949373245,
-1.3910198211669922,
-0.450762003660202,
1.3121758699417114,
-0.4657635986804962,
-0.2867984175682068,
-0.9189082980155945,
0.6412954330444336,
... |
func (s Song) ToJSON() []byte{
ToJSON, err :=json.Marshal(s)
if err !=nil{
panic(err)
}
return ToJSON
} | [
-0.5218092203140259,
-0.4533924460411072,
0.5685425996780396,
-0.20741154253482819,
-0.2411479502916336,
0.041069138795137405,
-0.14672821760177612,
-0.07942909747362137,
0.8900859355926514,
0.7349215149879456,
-1.1061055660247803,
1.146393895149231,
-0.4192999601364136,
-0.951542377471923... |
func FromJSON(data []byte) Song {
song := Song{}
err := json.Unmarshal(data, &song)
if err != nil {
panic(err)
}
return song
} | [
0.17397929728031158,
-0.6682606935501099,
0.39983436465263367,
-0.685878336429596,
-1.006463885307312,
1.0210553407669067,
-0.7432451248168945,
-0.047002557665109634,
0.831237256526947,
0.4195823073387146,
-0.5687794089317322,
0.6248233914375305,
-0.49132463335990906,
-0.5529865026473999,
... |
func AllSongs() []Song {
values := make([]Song, len(songs))
idx := 0
for _, song := range songs {
values[idx] = song
idx++
}
return values
} | [
-0.23959489166736603,
-0.17757302522659302,
0.5225332379341125,
0.8325069546699524,
0.3325628936290741,
0.4982585906982422,
-0.9669955372810364,
0.08504153788089752,
-0.05112718790769577,
0.1260116994380951,
-0.37439268827438354,
0.0334714911878109,
-0.4012836813926697,
0.28212770819664,
... |
func BindAndValid(c *gin.Context, form interface{}) (int, int) {
err := c.Bind(form)
if err != nil {
return http.StatusBadRequest, e.INVALID_PARAMS
}
config := &validator.Config{TagName: "validate"}
validate := validator.New(config)
errs := validate.Struct(form)
if errs != nil {
return http.StatusInternalSer... | [
-0.3334238827228546,
-1.4943172931671143,
1.0247678756713867,
0.5815503597259521,
-0.4554298520088196,
0.7698802947998047,
-0.4476930499076843,
0.5776843428611755,
0.033617306500673294,
-0.09440547972917557,
-0.02604597620666027,
0.018169870600104332,
-0.07576943188905716,
1.01843726634979... |
func readHandler(server *gossip.Server, request envelope.Envelope) error {
server.Logger.Debugf("Received read request")
// Unmarshal the message
readRequest := &encryption.EncryptedReadRequest{}
err := proto.Unmarshal(request.EncodedMessage, readRequest)
if err != nil {
return fmt.Errorf("unable to unmarshal ... | [
-0.26869437098503113,
-0.35649871826171875,
0.8544420003890991,
-0.2710050046443939,
-0.27321869134902954,
-0.5201519727706909,
0.48485010862350464,
-0.12705647945404053,
0.7185462713241577,
0.15552330017089844,
1.1168022155761719,
0.04436475783586502,
-0.9870448112487793,
-0.1313435286283... |
func writeHandler(server *gossip.Server, request envelope.Envelope) error {
server.Logger.Debugf("Received write request")
// Unmarshal the message
writeRequest := &encryption.EncryptedWriteRequest{}
err := proto.Unmarshal(request.EncodedMessage, writeRequest)
if err != nil {
return fmt.Errorf("unable to unmar... | [
-1.2361823320388794,
-0.3086940050125122,
0.8504461050033569,
-0.268284410238266,
0.30427828431129456,
-0.4586339592933655,
0.8110274076461792,
-0.1706816703081131,
0.30962029099464417,
0.3499677777290344,
0.23625457286834717,
0.018734930083155632,
-1.3396309614181519,
0.09916762262582779,... |
func (c *Client) BuildCreateRequest(ctx context.Context, v interface{}) (*http.Request, error) {
u := &url.URL{Scheme: c.scheme, Host: c.host, Path: CreateLogPath()}
req, err := http.NewRequest("POST", u.String(), nil)
if err != nil {
return nil, goahttp.ErrInvalidURL("log", "create", u.String(), err)
}
if ctx !... | [
-0.726536750793457,
-0.05397007241845131,
0.6626347899436951,
0.31330108642578125,
0.43233180046081543,
0.19914424419403076,
0.10305976867675781,
-0.3920603394508362,
-0.22003395855426788,
-0.05958906188607216,
0.0783449038863182,
1.1111927032470703,
-0.10507411509752274,
0.211367443203926... |
func EncodeCreateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
return func(req *http.Request, v interface{}) error {
p, ok := v.(*log.Log)
if !ok {
return goahttp.ErrInvalidType("log", "create", "*log.Log", v)
}
body := NewCreateRequestBody(p)
if err := enco... | [
-0.12909577786922455,
-0.19263654947280884,
0.5025083422660828,
0.5718006491661072,
-0.31854045391082764,
0.6172625422477722,
-0.16886502504348755,
-0.9051371812820435,
-0.33132922649383545,
0.5197282433509827,
0.29290392994880676,
0.6946237683296204,
0.5694516897201538,
0.9540271759033203... |
func (c *Client) BuildGetRequest(ctx context.Context, v interface{}) (*http.Request, error) {
var (
id int
)
{
p, ok := v.(*log.Log)
if !ok {
return nil, goahttp.ErrInvalidType("log", "get", "*log.Log", v)
}
if p.ID != nil {
id = *p.ID
}
}
u := &url.URL{Scheme: c.scheme, Host: c.host, Path: GetLo... | [
-0.8581752777099609,
-0.33279240131378174,
0.8631574511528015,
-0.27717673778533936,
0.36804839968681335,
-0.5248051881790161,
-0.1754363477230072,
-0.04138542339205742,
0.40300893783569336,
0.051428403705358505,
0.07675390690565109,
1.3635761737823486,
-0.006335970479995012,
-0.5464262962... |
func EncodeGetRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
return func(req *http.Request, v interface{}) error {
p, ok := v.(*log.Log)
if !ok {
return goahttp.ErrInvalidType("log", "get", "*log.Log", v)
}
body := NewGetRequestBody(p)
if err := encoder(req).... | [
-0.28166380524635315,
-0.15190209448337555,
0.7380869388580322,
0.19738292694091797,
-0.26802515983581543,
-0.05941947549581528,
-0.4485556185245514,
-0.603191614151001,
0.3230418264865875,
0.7366762161254883,
0.51323401927948,
1.2367842197418213,
0.4290851354598999,
0.09813524037599564,
... |
func (c *Client) BuildUpdateRequest(ctx context.Context, v interface{}) (*http.Request, error) {
var (
id int
)
{
p, ok := v.(*log.Log)
if !ok {
return nil, goahttp.ErrInvalidType("log", "update", "*log.Log", v)
}
if p.ID != nil {
id = *p.ID
}
}
u := &url.URL{Scheme: c.scheme, Host: c.host, Path:... | [
-1.0754836797714233,
-0.6523230671882629,
0.7625393867492676,
-0.09538700431585312,
-0.16520282626152039,
-0.12842942774295807,
0.1651902049779892,
-0.22574852406978607,
0.43785884976387024,
0.5065742135047913,
-0.20325720310211182,
1.085905909538269,
-0.10621809214353561,
-0.2211941331624... |
func EncodeUpdateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
return func(req *http.Request, v interface{}) error {
p, ok := v.(*log.Log)
if !ok {
return goahttp.ErrInvalidType("log", "update", "*log.Log", v)
}
body := NewUpdateRequestBody(p)
if err := enco... | [
-0.6715755462646484,
-0.6635029315948486,
0.788657546043396,
0.4824163019657135,
-1.1180540323257446,
0.539128303527832,
-0.5342771410942078,
-0.6899534463882446,
0.2068643420934677,
1.268951177597046,
0.11597924679517746,
0.8338703513145447,
0.3511844873428345,
0.5140792727470398,
0.324... |
func (c *Client) BuildDeleteRequest(ctx context.Context, v interface{}) (*http.Request, error) {
var (
id int
)
{
p, ok := v.(*log.Log)
if !ok {
return nil, goahttp.ErrInvalidType("log", "delete", "*log.Log", v)
}
if p.ID != nil {
id = *p.ID
}
}
u := &url.URL{Scheme: c.scheme, Host: c.host, Path:... | [
-0.6148141622543335,
-0.39301764965057373,
0.8099337816238403,
0.08197086304426193,
0.34264400601387024,
-0.30949899554252625,
0.054369956254959106,
-0.028489533811807632,
0.7460769414901733,
-0.2480049878358841,
0.12680509686470032,
1.3824917078018188,
0.016288110986351967,
-0.04694821313... |
func EncodeDeleteRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
return func(req *http.Request, v interface{}) error {
p, ok := v.(*log.Log)
if !ok {
return goahttp.ErrInvalidType("log", "delete", "*log.Log", v)
}
body := NewDeleteRequestBody(p)
if err := enco... | [
-0.3556797206401825,
-0.6066998839378357,
0.5273658037185669,
0.5531060099601746,
-0.6302963495254517,
0.09840056300163269,
-0.1586046665906906,
-0.12521256506443024,
0.9212110042572021,
0.066267229616642,
0.2119249552488327,
1.2130546569824219,
1.0582783222198486,
0.4131690263748169,
0.... |
func (c *Client) BuildListRequest(ctx context.Context, v interface{}) (*http.Request, error) {
u := &url.URL{Scheme: c.scheme, Host: c.host, Path: ListLogPath()}
req, err := http.NewRequest("POST", u.String(), nil)
if err != nil {
return nil, goahttp.ErrInvalidURL("log", "list", u.String(), err)
}
if ctx != nil ... | [
-1.0681105852127075,
0.0011801418149843812,
0.8955675363540649,
-0.13681936264038086,
-0.02832048200070858,
-0.6321600675582886,
-0.49693387746810913,
0.29490604996681213,
0.6796656250953674,
0.3510666489601135,
-0.4802289307117462,
1.2808245420455933,
-0.19742439687252045,
0.1736993789672... |
func EncodeListRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
return func(req *http.Request, v interface{}) error {
p, ok := v.(*log.LogListPayload)
if !ok {
return goahttp.ErrInvalidType("log", "list", "*log.LogListPayload", v)
}
body := NewListRequestBody(p)
... | [
-0.4634798467159271,
-0.5010303854942322,
0.6696112751960754,
0.06551150977611542,
-0.8554102778434753,
-0.23962993919849396,
-0.9499871730804443,
-0.21775898337364197,
0.8554839491844177,
0.5205259323120117,
-0.5718278288841248,
1.1089208126068115,
0.14973336458206177,
0.8616976141929626,... |
func DecodeListResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error) {
return func(resp *http.Response) (interface{}, error) {
if restoreBody {
b, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, err
}
resp.Body = ioutil.NopClos... | [
0.16265618801116943,
-0.8009822964668274,
0.7538279294967651,
-0.3094650208950043,
-0.9874027967453003,
-0.8373348116874695,
-0.7839223146438599,
-0.11537665128707886,
1.3117245435714722,
0.3141888976097107,
-1.2349127531051636,
-0.15303562581539154,
-0.1555374711751938,
0.0973441675305366... |
func marshalLogWeatherToWeatherRequestBody(v *log.Weather) *WeatherRequestBody {
if v == nil {
return nil
}
res := &WeatherRequestBody{
ID: v.ID,
CreatedAt: v.CreatedAt,
FireID: v.FireID,
LogID: v.LogID,
Humidity: v.Humidity,
WeatherType: v.WeatherType,
WeatherTime: v.Weather... | [
0.030877960845828056,
-0.2356032282114029,
0.6408596634864807,
0.041822876781225204,
-0.8362032771110535,
0.0863656997680664,
-0.9490364193916321,
-0.5631170272827148,
0.40309083461761475,
-0.5695446729660034,
0.24860580265522003,
0.9018914103507996,
-0.3658222556114197,
0.7295103669166565... |
func marshalLogTemperatureToTemperatureRequestBody(v *log.Temperature) *TemperatureRequestBody {
if v == nil {
return nil
}
res := &TemperatureRequestBody{
Unit: v.Unit,
Value: v.Value,
}
return res
} | [
-0.0917450413107872,
-0.020999420434236526,
0.3891325294971466,
0.030457939952611923,
0.1258297562599182,
-0.23093393445014954,
-0.45737457275390625,
-0.06673820316791534,
0.1476893275976181,
0.0790090337395668,
-0.2336345613002777,
0.20717184245586395,
-0.3123277425765991,
-0.427452862262... |
func marshalLogWindToWindRequestBody(v *log.Wind) *WindRequestBody {
if v == nil {
return nil
}
res := &WindRequestBody{
Speed: v.Speed,
Direction: v.Direction,
Unit: v.Unit,
}
return res
} | [
0.30743491649627686,
0.09090448170900345,
0.22642356157302856,
-0.22349023818969727,
-0.5904606580734253,
-0.09389978647232056,
-0.41659578680992126,
-0.29895105957984924,
0.30626338720321655,
-0.5366765260696411,
0.16934850811958313,
0.9194339513778687,
-0.8004736304283142,
0.279190987348... |
func marshalWeatherRequestBodyToLogWeather(v *WeatherRequestBody) *log.Weather {
if v == nil {
return nil
}
res := &log.Weather{
ID: v.ID,
CreatedAt: v.CreatedAt,
FireID: v.FireID,
LogID: v.LogID,
Humidity: v.Humidity,
WeatherType: v.WeatherType,
WeatherTime: v.WeatherTime,
... | [
0.7457280158996582,
-0.48829203844070435,
0.5953261256217957,
-0.5342437624931335,
-0.09016383439302444,
0.6607623100280762,
-1.151908040046692,
-0.06073518842458725,
0.23080994188785553,
-0.6521480083465576,
0.2752494215965271,
1.2858306169509888,
-0.15145215392112732,
0.8238858580589294,... |
func marshalTemperatureRequestBodyToLogTemperature(v *TemperatureRequestBody) *log.Temperature {
if v == nil {
return nil
}
res := &log.Temperature{
Unit: v.Unit,
Value: v.Value,
}
return res
} | [
0.3527070879936218,
-0.17863062024116516,
0.34098440408706665,
-0.6105183362960815,
-0.17977803945541382,
0.35278624296188354,
-1.1027073860168457,
0.5184419751167297,
0.6278764009475708,
-0.14622657001018524,
0.02865631878376007,
0.8434287309646606,
-0.05002652853727341,
-0.08645084500312... |
func marshalWindRequestBodyToLogWind(v *WindRequestBody) *log.Wind {
if v == nil {
return nil
}
res := &log.Wind{
Speed: v.Speed,
Direction: v.Direction,
Unit: v.Unit,
}
return res
} | [
0.812181830406189,
-0.2692830562591553,
0.3679857850074768,
-0.369697630405426,
-0.1140303909778595,
0.43123960494995117,
-0.7807794809341431,
0.06196291744709015,
0.7714095711708069,
-0.09424877166748047,
0.044314175844192505,
1.858915090560913,
-0.27167487144470215,
0.19644728302955627,
... |
func unmarshalWeatherResponseBodyToLogWeather(v *WeatherResponseBody) *log.Weather {
if v == nil {
return nil
}
res := &log.Weather{
ID: v.ID,
CreatedAt: v.CreatedAt,
FireID: v.FireID,
LogID: v.LogID,
Humidity: v.Humidity,
WeatherType: v.WeatherType,
WeatherTime: v.WeatherTim... | [
0.7621678709983826,
-0.7722913026809692,
0.6842522621154785,
-1.2551707029342651,
-0.5484603643417358,
0.028408115729689598,
-0.6028019785881042,
-0.17676666378974915,
0.31563475728034973,
-0.5818443894386292,
-0.24499182403087616,
-0.03442941978573799,
-0.5119529366493225,
0.3042335212230... |
func unmarshalTemperatureResponseBodyToLogTemperature(v *TemperatureResponseBody) *log.Temperature {
if v == nil {
return nil
}
res := &log.Temperature{
Unit: v.Unit,
Value: v.Value,
}
return res
} | [
0.28929707407951355,
-0.3282674252986908,
0.40033087134361267,
-1.5312572717666626,
-0.4409449100494385,
-0.2405816614627838,
-0.8718687891960144,
0.6754399538040161,
0.9677951335906982,
-0.007524474989622831,
-0.4149681329727173,
-0.47180718183517456,
-0.41990339756011963,
-0.454166471958... |
func unmarshalWindResponseBodyToLogWind(v *WindResponseBody) *log.Wind {
if v == nil {
return nil
}
res := &log.Wind{
Speed: v.Speed,
Direction: v.Direction,
Unit: v.Unit,
}
return res
} | [
0.7365396022796631,
-0.264422208070755,
0.3941468596458435,
-0.9166626930236816,
-0.45251792669296265,
-0.09238296002149582,
-0.12723377346992493,
0.07527944445610046,
1.0205957889556885,
-0.01612672582268715,
-0.22268106043338776,
0.5441561937332153,
-0.35212552547454834,
-0.1254018098115... |
func marshalLogLogFiltersToLogFiltersRequestBody(v *log.LogFilters) *LogFiltersRequestBody {
res := &LogFiltersRequestBody{}
if v.Name != nil {
res.Name = make([]*StringFilterRequestBody, len(v.Name))
for i, val := range v.Name {
res.Name[i] = marshalLogStringFilterToStringFilterRequestBody(val)
}
}
if v.S... | [
-0.43428826332092285,
0.08079366385936737,
0.5673879384994507,
-0.2770248353481293,
-0.1610826700925827,
-1.0523878335952759,
-0.9678211808204651,
-1.008050799369812,
0.23043541610240936,
-0.021388284862041473,
-0.41683951020240784,
1.1523582935333252,
-0.6914609670639038,
-0.4213291406631... |
func marshalLogStringFilterToStringFilterRequestBody(v *log.StringFilter) *StringFilterRequestBody {
if v == nil {
return nil
}
res := &StringFilterRequestBody{
Key: v.Key,
Operator: v.Operator,
Value: v.Value,
}
return res
} | [
0.26154473423957825,
-0.3240926265716553,
0.37712177634239197,
-0.003383939852938056,
-0.6129988431930542,
-0.8924797177314758,
-1.0768959522247314,
-0.44586697220802307,
-0.22481264173984528,
0.22426040470600128,
-0.0895305946469307,
1.060918927192688,
-0.25463417172431946,
-0.50576668977... |
func marshalLogTimeFilterToTimeFilterRequestBody(v *log.TimeFilter) *TimeFilterRequestBody {
if v == nil {
return nil
}
res := &TimeFilterRequestBody{
Key: v.Key,
Operator: v.Operator,
Value: v.Value,
}
return res
} | [
-0.2822685241699219,
0.4159807562828064,
0.5329518914222717,
0.22426046431064606,
-0.4531362056732178,
-0.8817775845527649,
-0.809528648853302,
-0.9017422795295715,
0.3329048156738281,
0.7526088356971741,
-0.7457439303398132,
0.36512649059295654,
-0.36230260133743286,
0.31412869691848755,
... |
func marshalLogLogSearchToLogSearchRequestBody(v *log.LogSearch) *LogSearchRequestBody {
res := &LogSearchRequestBody{
Name: v.Name,
Description: v.Description,
}
return res
} | [
-0.11410302668809891,
-0.018968340009450912,
0.2178775519132614,
-0.06161680817604065,
-0.11969788372516632,
0.09332991391420364,
-0.8540847301483154,
-0.41605344414711,
0.8466697931289673,
0.12058664113283157,
-0.49057862162590027,
1.1796693801879883,
-0.2642044126987457,
-0.2876561880111... |
func marshalLogLogSortsToLogSortsRequestBody(v *log.LogSorts) *LogSortsRequestBody {
res := &LogSortsRequestBody{
ID: v.ID,
Start: v.Start,
End: v.End,
}
return res
} | [
-0.16560935974121094,
0.19945666193962097,
0.5558164119720459,
-0.33900195360183716,
-0.48268160223960876,
0.14780989289283752,
-0.6610925793647766,
-1.11458158493042,
0.6824482083320618,
-0.3223879337310791,
-0.0990578904747963,
1.5373201370239258,
-0.1357993185520172,
-0.7695307731628418... |
func marshalLogLogPaginationToLogPaginationRequestBody(v *log.LogPagination) *LogPaginationRequestBody {
res := &LogPaginationRequestBody{
Page: v.Page,
Limit: v.Limit,
}
return res
} | [
-0.5567529201507568,
-0.026924867182970047,
0.7222172021865845,
0.07501567900180817,
0.14543572068214417,
-0.7301186919212341,
-0.5635998845100403,
0.3298634886741638,
1.4152218103408813,
0.4767908453941345,
-0.39640042185783386,
0.6082563996315002,
-0.1023702472448349,
-0.5576253533363342... |
func marshalLogFiltersRequestBodyToLogLogFilters(v *LogFiltersRequestBody) *log.LogFilters {
res := &log.LogFilters{}
if v.Name != nil {
res.Name = make([]*log.StringFilter, len(v.Name))
for i, val := range v.Name {
res.Name[i] = marshalStringFilterRequestBodyToLogStringFilter(val)
}
}
if v.Start != nil {
... | [
-0.12566021084785461,
0.0358915813267231,
0.4446795880794525,
-0.5200818777084351,
-0.03827253356575966,
-0.37569302320480347,
-0.9888764023780823,
-0.9766311645507812,
0.19561883807182312,
0.02308609150350094,
-0.5897893309593201,
1.33375883102417,
-0.4407726228237152,
-0.1122892647981643... |
func marshalStringFilterRequestBodyToLogStringFilter(v *StringFilterRequestBody) *log.StringFilter {
if v == nil {
return nil
}
res := &log.StringFilter{
Key: v.Key,
Operator: v.Operator,
Value: v.Value,
}
return res
} | [
0.29266607761383057,
-0.16451404988765717,
0.2830216586589813,
-0.498239129781723,
-0.711832582950592,
0.3110123574733734,
-1.5966826677322388,
-0.34815311431884766,
-0.025611119344830513,
0.3198052942752838,
0.13059011101722717,
1.0226422548294067,
0.15935339033603668,
-0.4843609929084778... |
func marshalTimeFilterRequestBodyToLogTimeFilter(v *TimeFilterRequestBody) *log.TimeFilter {
if v == nil {
return nil
}
res := &log.TimeFilter{
Key: v.Key,
Operator: v.Operator,
Value: v.Value,
}
return res
} | [
0.017669910565018654,
0.27216076850891113,
0.5699624419212341,
-0.3435029685497284,
-0.4515377879142761,
0.001420238520950079,
-1.6485522985458374,
-0.4272993206977844,
0.39561396837234497,
0.6314636468887329,
-0.3095459043979645,
0.9526639580726624,
-0.01799093373119831,
0.229512140154838... |
func marshalLogSearchRequestBodyToLogLogSearch(v *LogSearchRequestBody) *log.LogSearch {
res := &log.LogSearch{
Name: v.Name,
Description: v.Description,
}
return res
} | [
0.10279145836830139,
0.12370122969150543,
0.2097139060497284,
-0.44844210147857666,
0.019281910732388496,
0.7853369116783142,
-1.24925696849823,
-0.1703290492296219,
0.8014776706695557,
0.29423296451568604,
-0.2085215002298355,
1.0803594589233398,
-0.1538374423980713,
-0.3842276334762573,
... |
func marshalLogSortsRequestBodyToLogLogSorts(v *LogSortsRequestBody) *log.LogSorts {
res := &log.LogSorts{
ID: v.ID,
Start: v.Start,
End: v.End,
}
return res
} | [
0.027445640414953232,
0.10800601541996002,
0.5560517907142639,
-0.5890713930130005,
-0.05073898658156395,
0.7967261075973511,
-0.7771244645118713,
-0.8967390060424805,
0.8648865222930908,
0.06268740445375443,
-0.1345876306295395,
1.7806062698364258,
-0.28757429122924805,
-0.647559940814971... |
func marshalLogPaginationRequestBodyToLogLogPagination(v *LogPaginationRequestBody) *log.LogPagination {
res := &log.LogPagination{
Page: v.Page,
Limit: v.Limit,
}
return res
} | [
-0.553758442401886,
-0.22647753357887268,
0.5078610181808472,
-0.3679978549480438,
-0.03952273726463318,
-0.2368127554655075,
-0.7573375105857849,
0.48494231700897217,
1.411122441291809,
0.8216102719306946,
-0.4754032492637634,
1.1271272897720337,
0.035823918879032135,
-0.49087682366371155... |
func unmarshalLogResponseBodyToLogLog(v *LogResponseBody) *log.Log {
if v == nil {
return nil
}
res := &log.Log{
ID: v.ID,
CreatedAt: v.CreatedAt,
UpdatedAt: v.UpdatedAt,
Name: v.Name,
Size: v.Size,
FireID: v.FireID,
AddedAt: v.AddedAt,
}
if v.Weather != nil {
res.Weather = ... | [
0.07613566517829895,
-0.2673244774341583,
0.5825262665748596,
-1.4246692657470703,
-0.37983468174934387,
-0.012656894512474537,
-0.6696885824203491,
-0.48356330394744873,
0.01706438511610031,
-0.02368839457631111,
-0.6525362730026245,
-0.18251818418502808,
0.28619933128356934,
-0.815880477... |
func unmarshalPaginationResponseBodyToLogPagination(v *PaginationResponseBody) *log.Pagination {
if v == nil {
return nil
}
res := &log.Pagination{
Total: v.Total,
Page: v.Page,
Limit: v.Limit,
}
return res
} | [
-0.36766505241394043,
-0.24890559911727905,
0.4501447379589081,
-0.8435776829719543,
-0.12748144567012787,
-0.9725825190544128,
-0.020833196118474007,
0.41916680335998535,
1.3628464937210083,
0.5984289050102234,
-0.17234911024570465,
-0.7563827037811279,
0.23155692219734192,
-0.32465234398... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.