text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (r *ByteRange) flock(lockType int16) error {
lk := &unix.Flock_t{
Type: lockType,
Whence: io.SeekStart,
Start: r.start,
Len: r.len,
}
err := unix.FcntlFlock(uintptr(r.fd), setLk, lk)
if err == unix.EAGAIN || err == unix.EACCES {
return ErrByteRangeAcquired
} else if err == unix.ENOLCK {
ret... | [
0.07299261540174484,
-0.44481635093688965,
0.6035189032554626,
-0.19457942247390747,
-0.01094077993184328,
0.6072515249252319,
0.685461163520813,
-1.144496202468872,
0.12848247587680817,
-0.5019420981407166,
-0.29485148191452026,
1.751747727394104,
0.30755019187927246,
0.9798909425735474,
... |
func (r *ByteRange) Lock() error {
return r.flock(unix.F_WRLCK)
} | [
-0.03652359917759895,
0.45096543431282043,
0.198984295129776,
-0.11466608196496964,
0.5687772631645203,
0.32606351375579834,
1.052909016609192,
-0.891189694404602,
-0.2966364026069641,
-2.0569324493408203,
-0.7002084255218506,
1.075124979019165,
-0.8894195556640625,
0.6472743153572083,
-... |
func (r *ByteRange) RLock() error {
return r.flock(unix.F_RDLCK)
} | [
0.054620757699012756,
0.5916182398796082,
0.3117097020149231,
0.11457240581512451,
0.144452765583992,
-0.043297141790390015,
0.5673457384109497,
-0.864212155342102,
-0.40947797894477844,
-1.0859652757644653,
-0.3057948350906372,
1.1962038278579712,
-0.5089061260223389,
0.7871953845024109,
... |
func (r *ByteRange) Unlock() error {
return r.flock(unix.F_UNLCK)
} | [
-0.05892280489206314,
0.318825900554657,
0.2273867279291153,
0.031375396996736526,
0.17901356518268585,
-0.21022723615169525,
1.0394492149353027,
0.2117767482995987,
-0.48269811272621155,
-1.3960117101669312,
-0.523212194442749,
0.7412651777267456,
-0.45981717109680176,
0.14461955428123474... |
func NewThermostat(id string) *Thermostat {
ts := new(Thermostat)
ts.Component = New(id, TypeThermostat)
ts.CurrentTemperature = attribute.NewTemperature("CurrentTemperature")
ts.AddAttribute(ts.CurrentTemperature.Attribute)
ts.TargetTemperature = attribute.NewTemperature("TargetTemperature")
ts.AddAttribute(t... | [
-0.14275267720222473,
-0.8204318881034851,
0.5870839953422546,
-1.5370837450027466,
-0.7136368751525879,
-0.37706702947616577,
-0.8192353248596191,
-0.15466934442520142,
0.2797752022743225,
0.17788240313529968,
-0.5693659782409668,
-0.10888832807540894,
-0.8482977151870728,
-0.198007240891... |
func (c *Thermostat) MarshalJSON() ([]byte, error) {
p := thermostatPayload{
Attributes: thermostatAttributesPayload{
CurrentTemperature: c.CurrentTemperature,
TargetTemperature: c.TargetTemperature,
},
}
return json.Marshal(p)
} | [
0.09288496524095535,
-0.21995386481285095,
0.36294254660606384,
-1.2824240922927856,
-0.25086963176727295,
0.08769461512565613,
-0.22304083406925201,
0.46773266792297363,
0.09117598086595535,
0.6411400437355042,
-0.4636114835739136,
0.1272311806678772,
-0.9354759454727173,
-0.0687673091888... |
func NewResourceData(t *testing.T, params ResDataParams) *schema.ResourceData {
t.Helper()
if err := params.Validate(); err != nil {
t.Fatal(err)
}
return resourceDataRaw(t,
params.ID, params.Schema, params.State, params.Change,
)
} | [
-0.1633102297782898,
-0.29317009449005127,
0.023509031161665916,
-0.47486141324043274,
-0.5167685747146606,
0.6192410588264465,
-0.23918715119361877,
-0.05182914063334465,
0.4700333774089813,
-0.17910514771938324,
-0.24166128039360046,
-0.09581389278173447,
-0.10584200173616409,
0.22100511... |
func resourceDataRaw(t *testing.T, id string, schemaMap map[string]*schema.Schema, current, desired map[string]interface{}) *schema.ResourceData {
t.Helper()
result := generateRD(t, schemaMap, current, nil)
result.SetId(id)
if len(desired) == 0 {
return result
}
return generateRD(t, schemaMap, desired, result... | [
-0.9688920378684998,
0.0724196508526802,
0.5034700036048889,
-1.0016422271728516,
-0.44220930337905884,
0.6293124556541443,
-0.5555631518363953,
0.6207005381584167,
0.2253190129995346,
-0.8710338473320007,
0.350425660610199,
0.5721932649612427,
0.4416022300720215,
-0.12409606575965881,
-... |
func fromGinContext(ctx *gin.Context) types.Context {
return nil
} | [
-0.38482943177223206,
-0.35895898938179016,
0.3589528203010559,
0.056091874837875366,
-0.32533788681030273,
0.471345990896225,
0.23970988392829895,
-0.6997745633125305,
0.26649990677833557,
-0.42623841762542725,
-0.5806986689567566,
0.12685522437095642,
-1.1733100414276123,
0.2515289783477... |
func (c *Recipients) showLoadedContent() {
for _, rec := range c.RecipientList {
TraceLoaded.Printf("recipient: %s\n", rec.Address)
}
} | [
0.7401782870292664,
-0.5767420530319214,
0.43024730682373047,
-1.8319982290267944,
-0.48670679330825806,
0.19023427367210388,
0.34982967376708984,
-0.021636173129081726,
0.2632908821105957,
0.632625937461853,
-0.7208930253982544,
1.1244118213653564,
-0.01918637380003929,
0.7983347773551941... |
func (u *URL) UnmarshalYAML(unmarshal func(interface{}) error) error {
var s string
if err := unmarshal(&s); err != nil {
return err
}
urlp, err := url.Parse(s)
if err != nil {
return err
}
u.URL = urlp
return nil
} | [
-0.22368267178535461,
0.6674339771270752,
0.6921695470809937,
-0.46452611684799194,
-0.403481662273407,
-0.6205244064331055,
0.4778343141078949,
1.3605560064315796,
0.5450919270515442,
0.015295661985874176,
0.03860897570848465,
1.0578057765960693,
0.5318748950958252,
-0.29571351408958435,
... |
func (u URL) MarshalYAML() (interface{}, error) {
if u.URL != nil {
return u.String(), nil
}
return nil, nil
} | [
0.25020942091941833,
0.19590535759925842,
0.3291686773300171,
0.257861852645874,
-0.16729594767093658,
0.07016023248434067,
0.3188337981700897,
1.2014272212982178,
1.333414077758789,
-0.32349035143852234,
-0.007347687613219023,
0.6249986290931702,
0.25581273436546326,
0.15303291380405426,
... |
func (re *Regexp) UnmarshalYAML(unmarshal func(interface{}) error) error {
var s string
if err := unmarshal(&s); err != nil {
return err
}
r, err := NewRegexp(s)
if err != nil {
return err
}
*re = r
return nil
} | [
0.789398193359375,
0.38642555475234985,
0.8490940928459167,
-0.4877026379108429,
-0.2831069231033325,
-1.052671194076538,
0.7885147333145142,
0.9069510102272034,
0.92049241065979,
0.5342698693275452,
0.3541843891143799,
0.722588837146759,
-0.06424249708652496,
-0.8815733194351196,
0.7842... |
func (re Regexp) MarshalYAML() (interface{}, error) {
if re.original != "" {
return re.original, nil
}
return nil, nil
} | [
1.1195337772369385,
0.17250899970531464,
0.4968176782131195,
0.41143307089805603,
-0.3322051763534546,
0.1633812040090561,
0.8825380206108093,
1.2916312217712402,
0.8826967477798462,
0.14207683503627777,
0.23163507878780365,
0.7494853138923645,
-0.2315886914730072,
-0.6564388275146484,
-... |
func NewRegexp(s string) (Regexp, error) {
regex, err := regexp.Compile(s)
return Regexp{
Regexp: regex,
original: s,
}, err
} | [
0.9160144329071045,
-1.138077735900879,
0.20288687944412231,
0.3781697154045105,
-0.8720943331718445,
-0.010823792777955532,
-0.053653620183467865,
0.8341856598854065,
0.6179834604263306,
0.24394209682941437,
-0.616815984249115,
0.8652015924453735,
0.1903795748949051,
-0.9113603830337524,
... |
func MustNewRegexp(s string) Regexp {
re, err := NewRegexp(s)
if err != nil {
panic(err)
}
return re
} | [
0.4590579867362976,
-0.4749301075935364,
0.5284201502799988,
0.31646227836608887,
-0.29845181107521057,
0.8755478858947754,
-1.0130783319473267,
-0.4761911630630493,
0.13956791162490845,
0.2729105055332184,
-0.7029582858085632,
0.494615375995636,
-0.21083374321460724,
0.048920564353466034,... |
func ParseCfgFile(cfgFile string) (*Config, error) {
logrus.Info("**** FILE PROVIDED**** ", cfgFile)
if cfgFile == "" {
return nil, fmt.Errorf("no config file provided")
}
filename, err := getAbsFilename(cfgFile)
if err != nil {
return nil, err
}
yamlFile, err := ioutil.ReadFile(filename)
if err != nil {... | [
0.41540056467056274,
-0.06657348573207855,
0.6811360716819763,
0.22951652109622955,
-0.20133225619792938,
0.12539604306221008,
0.7650356888771057,
0.657894492149353,
-1.3958382606506348,
0.8161069750785828,
-0.44528135657310486,
-0.458402544260025,
-0.3460908532142639,
1.3135565519332886,
... |
func (*Room) Descriptor() ([]byte, []int) {
return file_internal_pkg_delivery_grpc_hotel_service_proto_scheme_proto_rawDescGZIP(), []int{0}
} | [
-0.9435145854949951,
0.29027166962623596,
0.4093729555606842,
0.47838443517684937,
-0.36370065808296204,
0.40873146057128906,
0.1531064659357071,
0.7057694792747498,
-0.3303460478782654,
-0.641004204750061,
-0.3563060462474823,
0.17106389999389648,
-0.03395950794219971,
1.495931625366211,
... |
func (*Hotel) Descriptor() ([]byte, []int) {
return file_internal_pkg_delivery_grpc_hotel_service_proto_scheme_proto_rawDescGZIP(), []int{1}
} | [
-1.0178041458129883,
0.49696066975593567,
0.3484872579574585,
0.31855615973472595,
-0.32977017760276794,
0.625516414642334,
0.5129121541976929,
0.9141921401023865,
-1.0622336864471436,
-0.11729026585817337,
-0.4951865077018738,
0.15454056859016418,
-0.21967630088329315,
0.7478486895561218,... |
func (*HotelsResponse) Descriptor() ([]byte, []int) {
return file_internal_pkg_delivery_grpc_hotel_service_proto_scheme_proto_rawDescGZIP(), []int{2}
} | [
-0.6464402675628662,
0.19271233677864075,
-0.3291848301887512,
-0.17159658670425415,
0.14264671504497528,
-0.6811689734458923,
0.8553555011749268,
-0.1910611242055893,
-0.6024913787841797,
-0.08562714606523514,
-1.1150180101394653,
-0.6281704902648926,
-0.5898362398147583,
-0.0456764809787... |
func (*RoomsResponse) Descriptor() ([]byte, []int) {
return file_internal_pkg_delivery_grpc_hotel_service_proto_scheme_proto_rawDescGZIP(), []int{3}
} | [
-0.4042906165122986,
0.30619218945503235,
-0.3125191628932953,
-0.29125475883483887,
-0.22818899154663086,
-0.6764430999755859,
0.6166762113571167,
-0.405850887298584,
-0.27774691581726074,
-0.2232077419757843,
-1.0063947439193726,
-0.9094281196594238,
-0.7340630292892456,
0.36972764134407... |
func NewTaskPane(projectRepo repository.ProjectRepository, taskRepo repository.TaskRepository) *TaskPane {
pane := TaskPane{
Flex: tview.NewFlex().SetDirection(tview.FlexRow),
list: tview.NewList().ShowSecondaryText(false),
newTask: makeLightTextInput("+[New Task]"),
projectRepo: projectRepo,... | [
0.36367207765579224,
0.5085713863372803,
0.6137464642524719,
0.017946528270840645,
-0.5017442107200623,
0.489227294921875,
0.04069739207625389,
-0.006300491746515036,
-0.613330066204071,
0.5977157354354858,
-0.6610514521598816,
-0.13902132213115692,
0.41762906312942505,
1.0124088525772095,... |
func (pane *TaskPane) ClearList() {
pane.list.Clear()
pane.tasks = nil
pane.activeTask = nil
pane.RemoveItem(pane.newTask)
} | [
0.05060078576207161,
-0.28271061182022095,
0.13964033126831055,
-0.12092979997396469,
-0.5754093527793884,
0.6610468626022339,
0.4093014895915985,
0.43512365221977234,
0.09689690917730331,
0.4706338047981262,
-1.042263150215149,
-0.09710299223661423,
0.7215333580970764,
0.5717533230781555,... |
func (pane *TaskPane) SetList(tasks []model.Task) {
pane.ClearList()
pane.tasks = tasks
for i := range pane.tasks {
pane.addTaskToList(i)
}
} | [
-0.16496139764785767,
0.3278524875640869,
0.36769264936447144,
0.3297004699707031,
-0.4313000738620758,
0.7916857004165649,
0.2835886478424072,
0.766632616519928,
0.1966889351606369,
0.21341323852539062,
-1.3521051406860352,
-0.3109150230884552,
0.6396419405937195,
1.1229106187820435,
-0... |
func (pane *TaskPane) LoadProjectTasks(project model.Project) {
var tasks []model.Task
var err error
if tasks, err = taskRepo.GetAllByProject(project); err != nil && err != storm.ErrNotFound {
statusBar.showForSeconds("[red::]Error: "+err.Error(), 5)
} else {
pane.SetList(tasks)
}
pane.RemoveItem(pane.hint)... | [
0.1725122332572937,
1.108324408531189,
0.6129980683326721,
0.03055754490196705,
-0.24088379740715027,
0.758094072341919,
0.3864746391773224,
0.03683629259467125,
-0.38601428270339966,
0.7619202136993408,
-1.1123279333114624,
-0.8432106971740723,
-0.8382288813591003,
0.5648398399353027,
-... |
func (pane *TaskPane) LoadDynamicList(logic string) {
var tasks []model.Task
var err error
today := toDate(time.Now())
zeroTime := time.Time{}
rangeDesc := ""
switch logic {
case "today":
tasks, err = pane.taskRepo.GetAllByDateRange(zeroTime, today)
rangeDesc = "Today (and overdue)"
case "tomorrow":
to... | [
0.11364313215017319,
0.4443170130252838,
0.6891381144523621,
0.01543272752314806,
-0.06321815401315689,
0.34619489312171936,
0.7090855836868286,
-0.22364328801631927,
-0.6943755745887756,
0.23593248426914215,
0.26576584577560425,
0.010721787810325623,
0.2675817608833313,
0.734978973865509,... |
func (pane *TaskPane) ActivateTask(idx int) {
removeThirdCol()
pane.activeTask = &pane.tasks[idx]
taskDetailPane.SetTask(pane.activeTask)
contents.AddItem(taskDetailPane, 0, 3, false)
} | [
-0.6054072976112366,
-0.09499615430831909,
0.3368401527404785,
-0.26469630002975464,
0.30015379190444946,
0.37270137667655945,
0.5381139516830444,
0.7884640097618103,
-0.021809171885252,
-0.16016384959220886,
-1.1902215480804443,
0.6429926156997681,
0.19698143005371094,
-0.6152164340019226... |
func (pane *TaskPane) ClearCompletedTasks() {
count := 0
for i, task := range pane.tasks {
if task.Completed && pane.taskRepo.Delete(&pane.tasks[i]) == nil {
pane.list.RemoveItem(i)
count++
}
}
statusBar.showForSeconds(fmt.Sprintf("[yellow]%d tasks cleared!", count), 5)
} | [
0.5059160590171814,
0.5742092728614807,
0.17297284305095673,
0.1989789456129074,
-0.9815099835395813,
0.44550594687461853,
1.3780171871185303,
0.16045255959033966,
-0.4268497824668884,
0.4126065671443939,
-0.8192182779312134,
-0.0919213742017746,
0.3430878520011902,
1.1781952381134033,
-... |
func (pane *TaskPane) ReloadCurrentTask() {
pane.list.SetItemText(pane.list.GetCurrentItem(), makeTaskListingTitle(*pane.activeTask), "")
taskDetailPane.SetTask(pane.activeTask)
} | [
-0.8037728667259216,
-0.7368885278701782,
0.4590820372104645,
0.23001834750175476,
-0.9141758680343628,
0.7980965375900269,
0.13323839008808136,
0.5106165409088135,
-0.6348780989646912,
0.2876586616039276,
-0.270367830991745,
1.0801761150360107,
0.057480450719594955,
0.09546925872564316,
... |
func SetRoutes(server *fiber.App) {
SetUserRoutes(server.Group("/users"))
SetProductRoutes(server.Group("/products"))
SetOrderRoutes(server.Group("/orders"))
} | [
0.04347174987196922,
0.5771905183792114,
0.323159396648407,
1.2317779064178467,
0.7820519804954529,
-0.04724231734871864,
0.08791285008192062,
-0.19698108732700348,
-0.18488647043704987,
-0.2153187096118927,
-0.3246956765651703,
0.6397970914840698,
0.23575285077095032,
1.3477561473846436,
... |
func NewHandler(userHelper *Helper, allowUserCreation bool) *Handler {
//Build a new User Handler
handler := Handler{
userHelper: userHelper,
allowUserCreation: allowUserCreation,
}
return &handler
} | [
0.3056333363056183,
0.0018117838772013783,
-0.1048576757311821,
1.7953987121582031,
-1.3080322742462158,
1.2722259759902954,
0.699126124382019,
0.6366072297096252,
-0.020924078300595284,
-1.260560393333435,
0.6886913776397705,
0.2395588904619217,
-0.06119544804096222,
-0.40575486421585083,... |
func (handler *Handler) GetRoutes() []routing.Route {
//Provide the user update and documentation by default
var routes = make([]routing.Route, 0)
//If the user can create users append the routes
if handler.allowUserCreation {
routes = append(routes,
routing.Route{ //Now for the user info
Name: "... | [
-0.10396069288253784,
0.5797218680381775,
0.7860735058784485,
0.8745598196983337,
-0.17788825929164886,
0.38094890117645264,
0.16303540766239166,
0.3833317458629608,
0.4051946997642517,
-0.3979300856590271,
-0.15598557889461517,
-0.22194336354732513,
0.3404885232448578,
0.6837098002433777,... |
func (handler *Handler) handleUserCreate(w http.ResponseWriter, r *http.Request) {
//Create an empty new user
newUser := handler.userHelper.NewEmptyUser()
/**
Define a struct for just updating password
*/
type newUserStruct struct {
Email string `json:"email"`
Password string `json:"password"`
}
//Cre... | [
-0.39534327387809753,
-0.3231297731399536,
0.6593345999717712,
0.5081791281700134,
0.629643976688385,
0.3519939184188843,
-0.37694206833839417,
-0.49723246693611145,
-0.06914622336626053,
-0.1521562784910202,
-0.457096666097641,
-1.005115270614624,
0.03690546378493309,
0.7956278324127197,
... |
func (handler *Handler) handleUserLogin(w http.ResponseWriter, r *http.Request) {
/**
Define a struct for just updating password
*/
type loginUserStruct struct {
Email string `json:"email"`
Password string `json:"password"`
}
userCred := &loginUserStruct{}
//decode the request body into struct and fail... | [
-0.4572264552116394,
-0.048524972051382065,
0.7369074821472168,
0.5435291528701782,
-0.1662416309118271,
0.36943522095680237,
-0.14419183135032654,
-0.21932335197925568,
0.13198165595531464,
-0.29811346530914307,
-0.2693362236022949,
-0.5714378952980042,
0.03089829906821251,
0.201826244592... |
func (handler *Handler) handleUserUpdate(w http.ResponseWriter, r *http.Request) {
//We have gone through the auth, so we should know the id of the logged in user
loggedInUser := r.Context().Value("user").(int) //Grab the id of the user that send the request
//Now load the current user from the repo
user, err := ... | [
-0.5494557023048401,
-0.14951179921627045,
0.5624136924743652,
0.4965757727622986,
0.06184365600347519,
0.010285042226314545,
-0.03470241650938988,
-0.006333963014185429,
0.1300833523273468,
-0.1471470296382904,
-0.027539236471056938,
-0.7722352743148804,
-0.31612253189086914,
0.1961110234... |
func (handler *Handler) handleUserGet(w http.ResponseWriter, r *http.Request) {
//We have gone through the auth, so we should know the id of the logged in user
loggedInUser := r.Context().Value("user").(int) //Grab the id of the user that send the request
//Get the user
user, err := handler.userHelper.GetUser(log... | [
-0.8018323183059692,
-0.3012295365333557,
0.5365815758705139,
0.6374672651290894,
0.2823335826396942,
-0.3563699424266815,
-0.137750044465065,
-0.3723580837249756,
0.05298447608947754,
-0.40736153721809387,
0.41346442699432373,
-0.9115580320358276,
-0.4139343500137329,
0.4060152769088745,
... |
func (handler *Handler) handlePasswordUpdate(w http.ResponseWriter, r *http.Request) {
//We have gone through the auth, so we should know the id of the logged in user
loggedInUser := r.Context().Value("user").(int) //Grab the id of the user that send the request
//Create a new password change object
info := updat... | [
-0.15285122394561768,
-0.4935517907142639,
0.6186286807060242,
0.7538334727287292,
0.2543049454689026,
-0.07793090492486954,
-0.36358195543289185,
-0.15173310041427612,
0.19479072093963623,
0.391184002161026,
-0.0062209228053689,
-0.17968271672725677,
-0.2190263867378235,
0.696092903614044... |
func (handler *Handler) handlePasswordResetGet(w http.ResponseWriter, r *http.Request) {
//Now get the email that was passed in
keys, ok := r.URL.Query()["email"]
//Only take the first one
if !ok || len(keys[0]) < 1 {
utils.ReturnJsonStatus(w, http.StatusUnprocessableEntity, false, "password_change_missing_emai... | [
-0.5918792486190796,
0.008501754142343998,
0.7143049240112305,
-0.3110165297985077,
0.5812489986419678,
-1.2402654886245728,
-0.4945850074291229,
0.20591121912002563,
-0.41133028268814087,
0.6963291168212891,
0.6643775105476379,
0.5174911618232727,
-0.636344313621521,
-0.1806277334690094,
... |
func (handler *Handler) handlePasswordResetPut(w http.ResponseWriter, r *http.Request) {
//Define a local struct to get the email out of the request
type ResetGet struct {
Email string `json:"email"`
ResetToken string `json:"reset_token"`
Password string `json:"password"`
}
//Create a new password ch... | [
-0.3717920184135437,
0.2581571340560913,
0.7032418847084045,
-0.3645452558994293,
0.47007662057876587,
-0.8269649744033813,
0.059695757925510406,
-0.4298383593559265,
-0.4538619816303253,
0.5980623364448547,
-0.2575919032096863,
0.13092638552188873,
-0.5613780617713928,
-0.1723180115222931... |
func (handler *Handler) handleUserActivationPut(w http.ResponseWriter, r *http.Request) {
//Define a local struct to get the email out of the request
type ActivationGet struct {
Email string `json:"email"`
ActToken string `json:"activation_token"`
}
//Create a new password change object
info := Activation... | [
-0.4356273114681244,
-0.04485082998871803,
0.6345359683036804,
-0.00612018583342433,
0.09435953199863434,
-0.7508442401885986,
0.3074333667755127,
-0.07049212604761124,
-0.28947508335113525,
0.21384455263614655,
-0.35554179549217224,
0.011315297335386276,
-0.13854968547821045,
-0.235253602... |
func (handler *Handler) handleUserActivationGet(w http.ResponseWriter, r *http.Request) {
//Now get the email that was passed in
keys, ok := r.URL.Query()["email"]
//Only take the first one
if !ok || len(keys[0]) < 1 {
utils.ReturnJsonStatus(w, http.StatusUnprocessableEntity, false, "activation_token_missing_em... | [
-0.5994335412979126,
-0.460134357213974,
0.7084989547729492,
0.30638858675956726,
-0.06294151395559311,
-1.0208234786987305,
-0.18490585684776306,
0.2637563943862915,
-0.10881984233856201,
-0.06413255631923676,
0.5536895990371704,
0.03423396497964859,
0.0012035826221108437,
-0.408263146877... |
func decideAndDownloadStarterProject(devObj parser.DevfileObj, projectPassed string, token string, interactive bool, contextDir string) error {
if projectPassed == "" && !interactive {
return nil
}
// Retrieve starter projects
starterProjects, err := devObj.Data.GetStarterProjects(parsercommon.DevfileOptions{})
... | [
0.6930984854698181,
-0.9451690316200256,
0.5660068988800049,
0.40418216586112976,
-0.19128860533237457,
0.2716999053955078,
0.40208154916763306,
0.14153197407722473,
0.27033522725105286,
-0.9054833650588989,
0.3872053921222687,
-0.11218499392271042,
-1.1659762859344482,
0.01158126629889011... |
func (co *CreateOptions) DevfileJSON() error {
envInfo, err := envinfo.NewEnvSpecificInfo(co.contextFlag)
if err != nil {
return err
}
// Ignore the error as we want other information if connection to cluster is not possible
var c kclient.ClientInterface
client, _ := kclient.New()
if client != nil {
c = cli... | [
0.6014595627784729,
-0.3360583782196045,
0.7427497506141663,
-0.7932499647140503,
0.26750999689102173,
0.2958700954914093,
0.26315444707870483,
-0.45370692014694214,
-1.2665756940841675,
0.15768864750862122,
-0.16328871250152588,
-0.020647969096899033,
0.08940480649471283,
0.15467430651187... |
func (w *Worker) getAndExecute(tasks chan *ReadTaskOp, store chan *WriteStoreOp, service chan *ComplainOp) {
read := &ReadTaskOp{resp: make(chan *Task)}
tasks <- read
w.executed = <-read.resp
w.execute(service)
write := &WriteStoreOp{
newResult: w.executed.result,
resp: make(chan bool)}
store <- writ... | [
-0.3316040635108948,
-0.635566234588623,
0.6453241109848022,
0.06508257240056992,
0.4262121617794037,
-0.48349958658218384,
-0.009431129321455956,
-0.5517694354057312,
0.03103547729551792,
-0.3220578730106354,
-0.05341535434126854,
-0.16630464792251587,
-0.424894779920578,
-0.4488865733146... |
func (w *Worker) execute(service chan *ComplainOp) {
request := &SendToMachineOp{current: w.executed, resp: make(chan bool)}
doneNotPatient := false
done := false
amount := 0
for !done {
switch w.executed.op {
case "*":
index := rand.Intn(config.MulMachineNo)
machine := w.machines.mulMachines[index]
... | [
-0.7448158860206604,
0.29285699129104614,
1.1178081035614014,
0.3445797860622406,
0.36695486307144165,
0.506934404373169,
-0.22638365626335144,
-0.9352046847343445,
-0.24103842675685883,
0.6271683573722839,
-0.4420870244503021,
-0.5862188339233398,
-0.47102752327919006,
0.3570404052734375,... |
func (w *Worker) sendComplain(machineIndex int, machineType int, collisionNumber int, service chan *ComplainOp) {
complain := &ComplainOp{machineType: machineType, machineIndex: machineIndex, collisionNo: collisionNumber}
service <- complain
} | [
-0.6076597571372986,
-0.38965296745300293,
0.5863904356956482,
-0.027166875079274178,
-0.036821700632572174,
0.11426317691802979,
-0.3666445016860962,
-0.4267694354057312,
-0.3756641149520874,
0.512663722038269,
-0.7690656185150146,
0.4270215332508087,
-1.0914580821990967,
0.27226418256759... |
func (w *Worker) run(tasks chan *ReadTaskOp, store chan *WriteStoreOp, service chan *ComplainOp) {
for {
time.Sleep(time.Duration(config.WorkerSpeed * time.Millisecond))
number := rand.Int() % 100
if number < config.WorkerSensitive {
w.getAndExecute(tasks, store, service)
}
}
} | [
-0.4414331316947937,
0.01959996670484543,
0.47098508477211,
0.4578516483306885,
-0.2823904752731323,
0.4538500905036926,
0.4653444290161133,
-0.22328728437423706,
0.3138970732688904,
-0.07041632384061813,
0.02971799671649933,
-0.03789384663105011,
-0.5235185027122498,
0.1377963274717331,
... |
func (b *Boss) createTask(tasks chan *WriteTaskOp) {
var operator string
number := rand.Int() % 3
switch number {
case 0:
operator = "+"
case 1:
operator = "-"
case 2:
operator = "*"
}
write := &WriteTaskOp{
newTask: Task{op: operator, first: 1 + rand.Int()%100, second: 1 + rand.Int()%100},
resp: ... | [
-1.0543922185897827,
0.26407939195632935,
0.6915358304977417,
0.6582514643669128,
0.6343786716461182,
0.403633177280426,
0.6046392917633057,
-0.36611002683639526,
-0.13627812266349792,
0.3138332664966583,
-0.7599703669548035,
-0.4979739785194397,
-0.34096261858940125,
-0.046862129122018814... |
func (b *Boss) run(tasks chan *WriteTaskOp) {
for {
time.Sleep(time.Duration(config.BossSpeed * time.Millisecond))
number := rand.Int() % 100
if number < config.BossSensitive {
b.createTask(tasks)
}
}
} | [
-0.5797731280326843,
0.4930872619152069,
0.47824573516845703,
1.127827763557434,
0.26886555552482605,
1.1092479228973389,
0.5803095102310181,
0.15758873522281647,
-0.38917750120162964,
-0.14570453763008118,
-0.8960791230201721,
0.024087222293019295,
-0.6050211787223816,
0.4754957854747772,... |
func (c *Client) getProduct(store chan *ReadStoreOp) {
numberOfProducts := 1 + rand.Int()%config.ClientsProductsMaxNo
var temp [config.ClientsProductsMaxNo]int
iterator := 0
read := &ReadStoreOp{resp: make(chan int)}
for iterator < numberOfProducts {
if rand.Int()%100 < 50 {
store <- read
temp[iterator] =... | [
-0.9483873844146729,
0.23042073845863342,
0.3936398923397064,
-0.14764036238193512,
0.2593725323677063,
0.3638048470020294,
0.7988036870956421,
-0.7603244781494141,
0.8236873149871826,
-0.13061664998531342,
0.11898711323738098,
0.6660406589508057,
-0.527211606502533,
-0.5128172636032104,
... |
func (c *Client) run(store chan *ReadStoreOp) {
for {
time.Sleep(time.Duration(config.ClientSpeed * time.Millisecond))
number := rand.Int() % 100
if number < config.ClientSensitive {
c.getProduct(store)
}
}
} | [
-0.37884587049484253,
-0.05021957680583,
0.3887764513492584,
0.289187490940094,
-0.440014511346817,
0.8043878078460693,
0.5436275601387024,
-0.5927436351776123,
0.5468709468841553,
0.45102792978286743,
-0.24162529408931732,
0.1868949681520462,
-0.750873863697052,
-0.5527791380882263,
0.5... |
func (c *Client) UpdateInstance(ctx context.Context, params *UpdateInstanceInput, optFns ...func(*Options)) (*UpdateInstanceOutput, error) {
if params == nil {
params = &UpdateInstanceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateInstance", params, optFns, addOperationUpdateInstanceMiddlewares)... | [
-1.6251194477081299,
0.15950801968574524,
0.7342416048049927,
-0.22105586528778076,
-0.4121050238609314,
-0.2006494104862213,
0.7619088292121887,
-0.22037692368030548,
0.6737414598464966,
0.6583744287490845,
-0.3181860148906708,
0.8733450174331665,
-1.464237928390503,
-1.3803478479385376,
... |
func (s *snapshot) TypeCheck(ctx context.Context, ids ...PackageID) ([]source.Package, error) {
pkgs := make([]source.Package, len(ids))
var (
needIDs []PackageID // ids to type-check
indexes []int // original index of requested ids
)
// Check for existing active packages.
//
// Since gopls can't depe... | [
-1.5001314878463745,
-0.4124169647693634,
0.6257201433181763,
-0.17180489003658295,
0.5088241100311279,
-0.45104214549064636,
0.1698215752840042,
-0.017263324931263924,
1.0088025331497192,
0.4458969831466675,
-0.25057536363601685,
-0.04067138954997063,
0.1924685537815094,
0.295315772294998... |
func (s *snapshot) getImportGraph(ctx context.Context) *importGraph {
if !preserveImportGraph {
return nil
}
s.mu.Lock()
// Evaluate the shared import graph for the snapshot. There are three major
// codepaths here:
//
// 1. importGraphDone == nil, importGraph == nil: it is this goroutine's
// responsib... | [
0.48479875922203064,
0.5040265917778015,
0.7666788101196289,
0.6227216124534607,
-1.0201680660247803,
-1.0116151571273804,
0.6943358182907104,
-0.2610189914703369,
0.7802222967147827,
0.30072706937789917,
-0.1965188831090927,
0.1708427518606186,
-0.8922631144523621,
-0.5799771547317505,
... |
func (s *snapshot) resolveImportGraph() (*importGraph, error) {
ctx := s.backgroundCtx
ctx, done := event.Start(event.Detach(ctx), "cache.resolveImportGraph")
defer done()
if err := s.awaitLoaded(ctx); err != nil {
return nil, err
}
s.mu.Lock()
meta := s.meta
lastImportGraph := s.importGraph
s.mu.Unlock()
... | [
-0.11803321540355682,
0.15771980583667755,
0.6249054670333862,
0.35607200860977173,
-0.7492645978927612,
-0.29119881987571716,
1.1552201509475708,
0.07651043683290482,
0.43132686614990234,
0.2910652160644531,
-0.41893941164016724,
-0.19650287926197052,
-0.16177116334438324,
-0.350229173898... |
func (s *snapshot) forEachPackage(ctx context.Context, ids []PackageID, pre preTypeCheck, post postTypeCheck) error {
ctx, done := event.Start(ctx, "cache.forEachPackage", tag.PackageCount.Of(len(ids)))
defer done()
if len(ids) == 0 {
return nil // short cut: many call sites do not handle empty ids
}
impGraph ... | [
-1.1816452741622925,
0.9266132712364197,
0.4208906292915344,
0.8119428753852844,
0.06589473783969879,
-0.4531794488430023,
0.6977676749229431,
-0.5716421008110046,
0.6902151703834534,
0.5382298827171326,
-0.21525828540325165,
0.3165764808654785,
0.29292067885398865,
1.0371408462524414,
-... |
func (s *snapshot) forEachPackageInternal(ctx context.Context, importGraph *importGraph, importIDs, syntaxIDs []PackageID, pre preTypeCheck, post postTypeCheck) (*typeCheckBatch, error) {
b := &typeCheckBatch{
s: s,
pre: pre,
post: post,
fset: fileSetWithBase(reserve... | [
-0.5701329708099365,
0.2303876280784607,
0.656514585018158,
0.22508765757083893,
-0.04446694254875183,
-0.572138786315918,
0.25710514187812805,
-0.3802153468132019,
-0.655254065990448,
-0.17841389775276184,
0.0579276978969574,
0.23533593118190765,
0.16574601829051971,
0.371746689081192,
... |
func (b *typeCheckBatch) getImportPackage(ctx context.Context, id PackageID) (pkg *types.Package, err error) {
b.mu.Lock()
f, ok := b.importPackages[id]
if ok {
b.mu.Unlock()
select {
case <-ctx.Done():
return nil, ctx.Err()
case <-f.done:
return f.v.pkg, f.v.err
}
}
f = &futurePackage{done: make... | [
-0.33050644397735596,
0.36691799759864807,
0.6452929973602295,
0.561591625213623,
0.15153783559799194,
-0.279004842042923,
0.27002543210983276,
-0.6949077248573303,
0.7940250039100647,
0.3376115560531616,
0.5251293778419495,
0.3847368657588959,
-0.5030021667480469,
-0.1472168117761612,
-... |
func (b *typeCheckBatch) handleSyntaxPackage(ctx context.Context, i int, id PackageID) (pkg *types.Package, err error) {
b.mu.Lock()
f, ok := b.syntaxPackages[id]
if ok {
b.mu.Unlock()
<-f.done
return f.v.pkg, f.v.err
}
f = &futurePackage{done: make(chan struct{})}
b.syntaxPackages[id] = f
b.mu.Unlock()
... | [
-0.31719541549682617,
0.5753818154335022,
0.8326540589332581,
0.819328784942627,
0.4199604392051697,
-0.5296774506568909,
0.33538439869880676,
-0.3228011727333069,
0.07436808943748474,
-0.16741855442523956,
-0.11216705292463303,
-0.3194575607776642,
-0.19233274459838867,
0.0039615384303033... |
func (b *typeCheckBatch) importPackage(ctx context.Context, m *source.Metadata, data []byte) (*types.Package, error) {
ctx, done := event.Start(ctx, "cache.typeCheckBatch.importPackage", tag.Package.Of(string(m.ID)))
defer done()
impMap := b.importMap(m.ID)
var firstErr error // TODO(rfindley): unused: revisit or... | [
0.23312851786613464,
0.23867517709732056,
0.6519203186035156,
0.6133198142051697,
0.26715168356895447,
-0.5002031326293945,
0.6141289472579956,
-0.8100273013114929,
0.21851220726966858,
0.3943171203136444,
-0.028144169598817825,
0.292892724275589,
-0.34519603848457336,
-0.47240149974823,
... |
func (b *typeCheckBatch) checkPackageForImport(ctx context.Context, ph *packageHandle) (*types.Package, error) {
ctx, done := event.Start(ctx, "cache.typeCheckBatch.checkPackageForImport", tag.Package.Of(string(ph.m.ID)))
defer done()
onError := func(e error) {
// Ignore errors for exporting.
}
cfg := b.typesCo... | [
0.21283812820911407,
0.5083568096160889,
0.7093154191970825,
0.16069863736629486,
0.3436715602874756,
-0.07939591258764267,
0.022204948589205742,
-0.8095019459724426,
-0.0668674036860466,
0.7034687399864197,
0.2912725508213043,
0.25052428245544434,
-0.40230631828308105,
0.41139039397239685... |
func (b *typeCheckBatch) checkPackage(ctx context.Context, ph *packageHandle) (*Package, error) {
ctx, done := event.Start(ctx, "cache.typeCheckBatch.checkPackage", tag.Package.Of(string(ph.m.ID)))
defer done()
// TODO(rfindley): refactor to inline typeCheckImpl here. There is no need
// for so many layers to buil... | [
-0.4344613552093506,
0.09773708879947662,
0.4968888759613037,
0.38171517848968506,
0.5964565277099609,
0.08925019204616547,
0.19823452830314636,
-0.7105583548545837,
0.23917114734649658,
0.22141702473163605,
0.5007779598236084,
0.29482048749923706,
-0.511695146560669,
0.07781674712896347,
... |
func (b *typeCheckBatch) awaitPredecessors(ctx context.Context, m *source.Metadata) error {
// await predecessors concurrently, as some of them may be non-syntax
// packages, and therefore will not have been started by the type-checking
// batch.
var g errgroup.Group
for _, depID := range m.DepsByPkgPath {
depID... | [
-1.0664076805114746,
0.5114542245864868,
0.48409757018089294,
0.4848151206970215,
0.04535963758826256,
0.22114259004592896,
0.008071104064583778,
0.07337991148233414,
-0.4699839949607849,
0.42989444732666016,
-0.23485589027404785,
0.39971908926963806,
-0.2504059076309204,
0.916709482669830... |
func (b *typeCheckBatch) importMap(id PackageID) map[string]source.PackageID {
impMap := make(map[string]source.PackageID)
var populateDeps func(m *source.Metadata)
populateDeps = func(parent *source.Metadata) {
for _, id := range parent.DepsByPkgPath {
m := b.meta.metadata[id]
if _, ok := impMap[string(m.Pk... | [
-0.4280855059623718,
-0.021846700459718704,
0.6868772506713867,
-0.11054497957229614,
0.27812114357948303,
0.30462536215782166,
0.6045261025428772,
0.3330160677433014,
0.919959306716919,
0.7838103771209717,
-0.33193284273147583,
-0.21297849714756012,
0.28903478384017944,
0.3634955286979675... |
func (s *snapshot) buildPackageHandle(ctx context.Context, id PackageID) (*packageHandle, error) {
s.mu.Lock()
entry, hit := s.packages.Get(id)
m := s.meta.metadata[id]
s.mu.Unlock()
if m == nil {
return nil, fmt.Errorf("no metadata for %s", id)
}
if hit {
return entry.(*packageHandle), nil
}
inputs, er... | [
-0.5336644053459167,
-0.33070188760757446,
0.4274179935455322,
0.02802067995071411,
0.24914614856243134,
-0.35586264729499817,
0.3297824263572693,
-0.3134707808494568,
0.15247714519500732,
-0.017966987565159798,
0.4612043499946594,
-0.11883710324764252,
-0.29843100905418396,
-0.40958151221... |
func readFiles(ctx context.Context, fs source.FileSource, uris []span.URI) (_ []source.FileHandle, err error) {
fhs := make([]source.FileHandle, len(uris))
for i, uri := range uris {
fhs[i], err = fs.ReadFile(ctx, uri)
if err != nil {
return nil, err
}
}
return fhs, nil
} | [
-0.5158054828643799,
0.91215580701828,
0.26323726773262024,
-0.0492851696908474,
0.30388179421424866,
0.2264436036348343,
0.12568433582782745,
0.26497882604599,
-0.49565666913986206,
-0.5845218300819397,
1.3372479677200317,
-0.6808169484138489,
-0.27498042583465576,
-0.5153968930244446,
... |
func computePackageKey(s *snapshot, inputs typeCheckInputs) source.Hash {
hasher := sha256.New()
// In principle, a key must be the hash of an
// unambiguous encoding of all the relevant data.
// If it's ambiguous, we risk collisions.
// package identifiers
fmt.Fprintf(hasher, "package: %s %s %s\n", inputs.id, ... | [
-0.6107894778251648,
0.027941228821873665,
0.7027816772460938,
-0.5162061452865601,
0.17868004739284515,
0.1353025883436203,
0.3911714553833008,
0.1385018229484558,
-0.5286397337913513,
0.6720306277275085,
-0.7179763317108154,
-0.24874567985534668,
0.4122390151023865,
0.8106000423431396,
... |
func typeCheckImpl(ctx context.Context, b *typeCheckBatch, inputs typeCheckInputs) (*syntaxPackage, error) {
ctx, done := event.Start(ctx, "cache.typeCheck", tag.Package.Of(string(inputs.id)))
defer done()
pkg, err := doTypeCheck(ctx, b, inputs)
if err != nil {
return nil, err
}
pkg.methodsets = methodsets.New... | [
-0.241629958152771,
0.2681255042552948,
0.7137778997421265,
0.27973106503486633,
0.19084326922893524,
0.42537808418273926,
0.6587169766426086,
-0.2405143529176712,
0.14188852906227112,
0.16921831667423248,
0.3050411343574524,
-0.3485165536403656,
-0.028733357787132263,
0.05598568171262741,... |
func ImageAttentionHandler(solutionCtor api.SolutionStorageCtor, metaCtor api.MetadataStorageCtor) func(http.ResponseWriter, *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
dataset := pat.Param(r, "dataset")
d3mIndex := pat.Param(r, "index")
colorScale := pat.Param(r, "color-scale")
opac... | [
-0.5750735402107239,
-0.21737262606620789,
0.6609544157981873,
-0.48917779326438904,
-0.10559960454702377,
0.029276764020323753,
0.9853370785713196,
-0.33605995774269104,
0.23114444315433502,
1.281920075416565,
0.6074147820472717,
0.2803003489971161,
0.5806527137756348,
0.46683692932128906... |
func apply(
test func(t *testing.T, conf interface{}, opts ...option),
conf interface{}, opts ...option,
) func(*testing.T) {
return func(t *testing.T) {
test(t, conf, opts...)
}
} | [
0.47450771927833557,
-0.11859974265098572,
0.3303138017654419,
0.1121993139386177,
-0.3345358073711395,
-0.1204865425825119,
0.581123948097229,
0.8527930974960327,
0.3930351138114929,
0.3811523914337158,
-0.27542558312416077,
-0.22391842305660248,
0.288875013589859,
0.10089483112096786,
... |
func (m *metricSshcheckDuration) init() {
m.data.SetName("sshcheck.duration")
m.data.SetDescription("Measures the duration of SSH connection.")
m.data.SetUnit("ms")
m.data.SetEmptyGauge()
} | [
0.685833215713501,
0.4494825601577759,
0.47177815437316895,
-0.016716502606868744,
0.6282961368560791,
1.5127345323562622,
-0.20804692804813385,
0.35606256127357483,
-0.8645235896110535,
0.3365992307662964,
0.14928679168224335,
1.0397355556488037,
1.0055338144302368,
1.056463360786438,
-... |
func (m *metricSshcheckDuration) updateCapacity() {
if m.data.Gauge().DataPoints().Len() > m.capacity {
m.capacity = m.data.Gauge().DataPoints().Len()
}
} | [
0.3916466236114502,
0.07901205122470856,
0.3455584645271301,
0.6001068949699402,
0.009680982679128647,
0.3808271288871765,
0.8353061079978943,
0.010509611107409,
-0.7229229211807251,
1.2681424617767334,
0.7303766012191772,
0.6095320582389832,
0.9637476801872253,
0.9323108196258545,
0.133... |
func (m *metricSshcheckDuration) emit(metrics pmetric.MetricSlice) {
if m.settings.Enabled && m.data.Gauge().DataPoints().Len() > 0 {
m.updateCapacity()
m.data.MoveTo(metrics.AppendEmpty())
m.init()
}
} | [
-0.09103009849786758,
1.3740323781967163,
0.166560098528862,
0.6854888200759888,
0.5531996488571167,
1.1974211931228638,
0.004572099074721336,
0.03141293302178383,
-0.3008914887905121,
0.8937215209007263,
0.03040171228349209,
0.5542817115783691,
-0.10923602432012558,
0.7108864784240723,
... |
func (m *metricSshcheckError) init() {
m.data.SetName("sshcheck.error")
m.data.SetDescription("Records errors occurring during SSH check.")
m.data.SetUnit("{error}")
m.data.SetEmptySum()
m.data.Sum().SetIsMonotonic(false)
m.data.Sum().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
m.data.Sum... | [
0.65231853723526,
0.3657982051372528,
0.6472241282463074,
-0.5743210911750793,
0.6843422651290894,
1.467336654663086,
0.13164924085140228,
0.3679955303668976,
-1.130028247833252,
-0.0821499451994896,
0.5652034878730774,
1.2136071920394897,
1.0452011823654175,
0.49684715270996094,
0.20865... |
func (m *metricSshcheckError) updateCapacity() {
if m.data.Sum().DataPoints().Len() > m.capacity {
m.capacity = m.data.Sum().DataPoints().Len()
}
} | [
0.5881092548370361,
-0.08436280488967896,
0.49522706866264343,
0.3521713316440582,
0.42768874764442444,
0.24902844429016113,
0.9325646758079529,
-0.016334492713212967,
-0.3748461604118347,
0.6953262090682983,
0.7424045205116272,
0.8901717066764832,
0.978334903717041,
0.4057506024837494,
... |
func (m *metricSshcheckError) emit(metrics pmetric.MetricSlice) {
if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 {
m.updateCapacity()
m.data.MoveTo(metrics.AppendEmpty())
m.init()
}
} | [
0.11273647099733353,
1.1297967433929443,
0.1667211502790451,
0.28149428963661194,
0.9050700068473816,
1.0176692008972168,
-0.018294930458068848,
0.1639532744884491,
-0.12902191281318665,
0.30155932903289795,
-0.02935975231230259,
0.8335193991661072,
-0.19751812517642975,
0.4425678551197052... |
func (m *metricSshcheckSftpDuration) init() {
m.data.SetName("sshcheck.sftp_duration")
m.data.SetDescription("Measures SFTP request duration.")
m.data.SetUnit("ms")
m.data.SetEmptyGauge()
} | [
0.6523634195327759,
0.6172009706497192,
0.5354191660881042,
-0.31697481870651245,
0.40977558493614197,
1.195641279220581,
-0.3679046332836151,
0.2819986939430237,
-0.7025251984596252,
0.03959474340081215,
0.31775715947151184,
0.9783638119697571,
0.9045434594154358,
0.9626054167747498,
-0... |
func (m *metricSshcheckSftpDuration) updateCapacity() {
if m.data.Gauge().DataPoints().Len() > m.capacity {
m.capacity = m.data.Gauge().DataPoints().Len()
}
} | [
0.2394714057445526,
0.08620831370353699,
0.36277303099632263,
0.3167669475078583,
-0.23050305247306824,
0.09823839366436005,
0.7789720892906189,
-0.14686930179595947,
-0.6672176718711853,
0.9786320328712463,
0.9219670295715332,
0.33714863657951355,
1.0664693117141724,
1.1283550262451172,
... |
func (m *metricSshcheckSftpDuration) emit(metrics pmetric.MetricSlice) {
if m.settings.Enabled && m.data.Gauge().DataPoints().Len() > 0 {
m.updateCapacity()
m.data.MoveTo(metrics.AppendEmpty())
m.init()
}
} | [
-0.028348702937364578,
1.475791335105896,
0.18707211315631866,
0.4314627945423126,
0.21814508736133575,
0.7329939007759094,
-0.04049467295408249,
-0.12875162065029144,
-0.41382771730422974,
0.5916000604629517,
0.18062497675418854,
0.2421310544013977,
0.1930766999721527,
0.7996575832366943,... |
func (m *metricSshcheckSftpError) init() {
m.data.SetName("sshcheck.sftp_error")
m.data.SetDescription("Records errors occurring during SFTP check.")
m.data.SetUnit("{error}")
m.data.SetEmptySum()
m.data.Sum().SetIsMonotonic(false)
m.data.Sum().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
... | [
0.758613109588623,
0.3385588824748993,
0.6745678782463074,
-0.6368255615234375,
0.31722012162208557,
1.1225391626358032,
0.11085028946399689,
0.3246469497680664,
-0.8649947643280029,
0.025432901456952095,
0.62737637758255,
1.0364068746566772,
0.714828610420227,
0.498346209526062,
0.23780... |
func (m *metricSshcheckSftpError) updateCapacity() {
if m.data.Sum().DataPoints().Len() > m.capacity {
m.capacity = m.data.Sum().DataPoints().Len()
}
} | [
0.5547983050346375,
0.04148281738162041,
0.48780176043510437,
0.47456449270248413,
0.12334375828504562,
0.02591696009039879,
0.9543839693069458,
-0.11531871557235718,
-0.46515658497810364,
0.6898528337478638,
0.7621904611587524,
0.5724385380744934,
1.1256742477416992,
0.6109007596969604,
... |
func (m *metricSshcheckSftpError) emit(metrics pmetric.MetricSlice) {
if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 {
m.updateCapacity()
m.data.MoveTo(metrics.AppendEmpty())
m.init()
}
} | [
0.1954047828912735,
1.2844337224960327,
0.16213510930538177,
0.3981265127658844,
0.6638341546058655,
0.7170292735099792,
0.05685669183731079,
-0.07209527492523193,
-0.28694596886634827,
0.28472602367401123,
0.10129459202289581,
0.5100058913230896,
0.10721778869628906,
0.6265337467193604,
... |
func (m *metricSshcheckSftpStatus) init() {
m.data.SetName("sshcheck.sftp_status")
m.data.SetDescription("1 if the SFTP server replied to request, otherwise 0.")
m.data.SetUnit("1")
m.data.SetEmptySum()
m.data.Sum().SetIsMonotonic(false)
m.data.Sum().SetAggregationTemporality(pmetric.AggregationTemporalityCumulat... | [
0.6016297340393066,
0.2109585702419281,
0.5998983383178711,
-0.7052402496337891,
0.26382941007614136,
1.262290120124817,
0.23154279589653015,
0.4102511703968048,
-0.5940496325492859,
-0.19344653189182281,
0.3794527053833008,
0.7323035001754761,
0.39035114645957947,
0.820114016532898,
-0.... |
func (m *metricSshcheckSftpStatus) updateCapacity() {
if m.data.Sum().DataPoints().Len() > m.capacity {
m.capacity = m.data.Sum().DataPoints().Len()
}
} | [
0.4370966851711273,
0.06283430755138397,
0.44522061944007874,
0.49821993708610535,
-0.025732489302754402,
0.29623568058013916,
0.8317849636077881,
0.07368708401918411,
-0.3561141788959503,
0.7034658789634705,
0.6154049038887024,
0.1821410208940506,
1.0036163330078125,
0.6744130253791809,
... |
func (m *metricSshcheckSftpStatus) emit(metrics pmetric.MetricSlice) {
if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 {
m.updateCapacity()
m.data.MoveTo(metrics.AppendEmpty())
m.init()
}
} | [
0.06344899535179138,
1.2557560205459595,
0.1613316684961319,
0.43963563442230225,
0.3202948272228241,
0.8547077178955078,
-0.08738682419061661,
0.07798700779676437,
-0.20812183618545532,
0.3319176435470581,
-0.12596213817596436,
0.08400342613458633,
0.007673292886465788,
0.6165133118629456... |
func (m *metricSshcheckStatus) init() {
m.data.SetName("sshcheck.status")
m.data.SetDescription("1 if the SSH client successfully connected, otherwise 0.")
m.data.SetUnit("1")
m.data.SetEmptySum()
m.data.Sum().SetIsMonotonic(false)
m.data.Sum().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
} | [
0.7263678908348083,
0.20326519012451172,
0.48189058899879456,
-0.5572773814201355,
0.49341389536857605,
1.4896830320358276,
0.2151700258255005,
0.5170808434486389,
-1.047732949256897,
-0.1675812304019928,
0.25011974573135376,
0.63386470079422,
0.841728925704956,
0.7275837659835815,
-0.32... |
func (m *metricSshcheckStatus) updateCapacity() {
if m.data.Sum().DataPoints().Len() > m.capacity {
m.capacity = m.data.Sum().DataPoints().Len()
}
} | [
0.6271816492080688,
-0.02267315238714218,
0.44228416681289673,
0.5396840572357178,
0.3310861587524414,
0.32948559522628784,
0.8891674280166626,
0.1875876784324646,
-0.335080087184906,
0.7597674131393433,
0.5332552194595337,
0.39397069811820984,
0.9324283003807068,
0.5532153844833374,
-0.... |
func (m *metricSshcheckStatus) emit(metrics pmetric.MetricSlice) {
if m.settings.Enabled && m.data.Sum().DataPoints().Len() > 0 {
m.updateCapacity()
m.data.MoveTo(metrics.AppendEmpty())
m.init()
}
} | [
0.10926471650600433,
1.1540911197662354,
0.1475697010755539,
0.35173845291137695,
0.8127824664115906,
0.9966004490852356,
-0.08152524381875992,
0.3269091546535492,
-0.10397030413150787,
0.39439427852630615,
-0.250911682844162,
0.37357470393180847,
-0.16205117106437683,
0.5955607295036316,
... |
func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption {
return func(mb *MetricsBuilder) {
mb.startTime = startTime
}
} | [
1.2032256126403809,
-0.43426093459129333,
0.21499355137348175,
0.5655066967010498,
0.07885908335447311,
0.6783062815666199,
1.1372742652893066,
-0.10845214873552322,
0.5298794507980347,
0.4423459470272064,
0.3010234832763672,
-0.8012542128562927,
-0.2433791160583496,
0.11947979778051376,
... |
func (mb *MetricsBuilder) updateCapacity(rm pmetric.ResourceMetrics) {
if mb.metricsCapacity < rm.ScopeMetrics().At(0).Metrics().Len() {
mb.metricsCapacity = rm.ScopeMetrics().At(0).Metrics().Len()
}
if mb.resourceCapacity < rm.Resource().Attributes().Len() {
mb.resourceCapacity = rm.Resource().Attributes().Len(... | [
-0.014105523936450481,
-0.544409990310669,
0.5388486385345459,
0.006760421209037304,
-0.24315500259399414,
0.7721487879753113,
1.5241191387176514,
-0.4612477421760559,
-0.19629190862178802,
0.8254203796386719,
1.0152084827423096,
0.16635894775390625,
0.4026990234851837,
0.8892942667007446,... |
func WithSSHEndpoint(val string) ResourceMetricsOption {
return func(ras ResourceAttributesSettings, rm pmetric.ResourceMetrics) {
if ras.SSHEndpoint.Enabled {
rm.Resource().Attributes().PutStr("ssh.endpoint", val)
}
}
} | [
1.4409493207931519,
-0.3518432080745697,
0.6201182007789612,
-0.3505459129810333,
-0.4031495749950409,
1.0216996669769287,
0.21777774393558502,
-0.0709303468465805,
-0.0870908796787262,
0.32283830642700195,
0.14204876124858856,
-0.33281028270721436,
0.06920175999403,
0.9230750203132629,
... |
func WithStartTimeOverride(start pcommon.Timestamp) ResourceMetricsOption {
return func(ras ResourceAttributesSettings, rm pmetric.ResourceMetrics) {
var dps pmetric.NumberDataPointSlice
metrics := rm.ScopeMetrics().At(0).Metrics()
for i := 0; i < metrics.Len(); i++ {
switch metrics.At(i).Type() {
case pme... | [
0.5062835812568665,
0.6798986196517944,
0.8875983357429504,
-0.6847378611564636,
-0.012823336757719517,
0.032167304307222366,
0.22376292943954468,
-0.9705438017845154,
0.05744192376732826,
0.3929886519908905,
0.42845723032951355,
-0.4497312605381012,
0.36482834815979004,
-0.095357231795787... |
func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption) {
rm := pmetric.NewResourceMetrics()
rm.Resource().Attributes().EnsureCapacity(mb.resourceCapacity)
ils := rm.ScopeMetrics().AppendEmpty()
ils.Scope().SetName("otelcol/sshcheckreceiver")
ils.Scope().SetVersion(mb.buildInfo.Version)
ils.Metric... | [
0.5793453454971313,
0.22074364125728607,
0.3868436813354492,
-0.07048521190881729,
0.14594964683055878,
0.31468912959098816,
0.6826910972595215,
-0.16828231513500214,
-0.9610770344734192,
0.2339174598455429,
-0.20177598297595978,
0.01409037597477436,
0.370842844247818,
1.1438997983932495,
... |
func (mb *MetricsBuilder) Emit(rmo ...ResourceMetricsOption) pmetric.Metrics {
mb.EmitForResource(rmo...)
metrics := mb.metricsBuffer
mb.metricsBuffer = pmetric.NewMetrics()
return metrics
} | [
0.2889827787876129,
0.2686980366706848,
0.3532048165798187,
0.09502310305833817,
0.5187605619430542,
1.1608442068099976,
0.5882449746131897,
-0.6849269866943359,
0.05020403489470482,
-0.29769453406333923,
-0.045331235975027084,
0.33394479751586914,
-0.610842764377594,
0.5622283220291138,
... |
func (mb *MetricsBuilder) RecordSshcheckDurationDataPoint(ts pcommon.Timestamp, val int64) {
mb.metricSshcheckDuration.recordDataPoint(mb.startTime, ts, val)
} | [
0.7435480356216431,
0.5559403300285339,
0.3383423686027527,
0.46819621324539185,
0.5934659242630005,
1.3572938442230225,
-0.09295357763767242,
0.308786541223526,
0.03828336298465729,
0.4157782196998596,
-0.14336276054382324,
1.130664348602295,
0.5036307573318481,
0.4992154538631439,
-0.8... |
func (mb *MetricsBuilder) RecordSshcheckSftpDurationDataPoint(ts pcommon.Timestamp, val int64) {
mb.metricSshcheckSftpDuration.recordDataPoint(mb.startTime, ts, val)
} | [
1.0806827545166016,
0.5040370225906372,
0.3263048827648163,
0.06361093372106552,
0.4164971113204956,
0.917841374874115,
-0.35187822580337524,
0.12902796268463135,
0.05417976528406143,
-0.14720115065574646,
0.18152569234371185,
0.811152458190918,
0.4303379952907562,
0.5410005450248718,
-0... |
func (mb *MetricsBuilder) RecordSshcheckSftpStatusDataPoint(ts pcommon.Timestamp, val int64) {
mb.metricSshcheckSftpStatus.recordDataPoint(mb.startTime, ts, val)
} | [
1.0363965034484863,
0.23020410537719727,
0.3719947040081024,
0.23253653943538666,
0.23203814029693604,
1.0239529609680176,
-0.5576573610305786,
0.21577921509742737,
0.017229510471224785,
-0.17567892372608185,
-0.26067548990249634,
0.9003728628158569,
0.3899253010749817,
0.6378722190856934,... |
func (mb *MetricsBuilder) RecordSshcheckStatusDataPoint(ts pcommon.Timestamp, val int64) {
mb.metricSshcheckStatus.recordDataPoint(mb.startTime, ts, val)
} | [
0.8573326468467712,
0.32105639576911926,
0.384086549282074,
0.3498687744140625,
0.5428412556648254,
1.1190423965454102,
-0.4675758481025696,
0.4400148093700409,
0.08270574361085892,
-0.0037336370442062616,
-0.5916252732276917,
1.135527491569519,
0.597848653793335,
0.596790611743927,
-0.9... |
func (mb *MetricsBuilder) Reset(options ...metricBuilderOption) {
mb.startTime = pcommon.NewTimestampFromTime(time.Now())
for _, op := range options {
op(mb)
}
} | [
0.008591088466346264,
0.4988720715045929,
0.44919297099113464,
1.5256903171539307,
0.6919456720352173,
0.8585705161094666,
1.962134838104248,
-0.18661335110664368,
-0.778505802154541,
0.3467910587787628,
0.34228888154029846,
0.38985690474510193,
-1.1954152584075928,
-0.07603254169225693,
... |
func RequireEnv(s string) string {
v := os.Getenv(s)
if v == "" {
log.Fatalf("missing required environment variable %q", s)
}
return v
} | [
-0.10604168474674225,
-0.5722327828407288,
0.343214213848114,
0.14500801265239716,
-0.5473414659500122,
0.14344888925552368,
-0.02138935960829258,
-0.7945352792739868,
0.17990742623806,
0.21351107954978943,
0.3993225693702698,
0.15054281055927277,
-0.14690662920475006,
0.6750870943069458,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.