text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func readStdin() (grid []lineRep, err error) {
scanner := bufio.NewScanner(os.Stdin)
for scanner.Scan() {
line := strings.Trim(scanner.Text(), "\r\n")
if len(line) != lineLen {
err = ErrBadLine
return
}
var lrep lineRep
for i := 0; i < lineLen; i++ {
lrep[i] = (line[i] == '#')
}
grid = append(g... | [
0.4473845064640045,
-0.0883965939283371,
0.9787079691886902,
0.2238151878118515,
-0.38909024000167847,
0.473008394241333,
-0.6043791770935059,
-0.13240893185138702,
-0.46799227595329285,
0.32780149579048157,
0.4961926341056824,
0.3824771046638489,
-0.33032795786857605,
0.5283225774765015,
... |
func simpleEC(this js.Value, inputs []js.Value) interface{} {
var suite = suites.MustFind("Ed25519")
var args map[string]interface{}
json.Unmarshal([]byte(inputs[0].String()), &args)
scalar := suite.Scalar()
scalarB, _ := base64.StdEncoding.DecodeString(args["scalar"].(string))
scalar.UnmarshalBinary(scalarB)
va... | [
-0.18062636256217957,
-0.17809917032718658,
0.6397621035575867,
-0.39811307191848755,
-0.5480430722236633,
-0.3562420904636383,
0.18012240529060364,
-0.208611860871315,
-0.50066739320755,
0.5237438082695007,
-0.17992472648620605,
-0.24897733330726624,
0.3690992593765259,
0.0765959769487381... |
func (ls *LogShipper) Ping() {
// set up new auth token
token, _ := ls.knapsack.TokenStore().Get(storage.ObservabilityIngestAuthTokenKey)
ls.sender.authtoken = string(token)
parsedUrl, err := url.Parse(ls.knapsack.LogIngestServerURL())
if err != nil {
// If we have a bad endpoint, just disable for now.
// It ... | [
-0.182573601603508,
-0.34827476739883423,
0.43064847588539124,
0.04448849335312843,
0.5034039616584778,
-0.1807519942522049,
-0.8309279680252075,
0.05117829144001007,
0.8900473117828369,
0.7410299181938171,
0.12410321086645126,
0.3870254456996918,
-0.02223907969892025,
0.2965196371078491,
... |
func filterResults(keyvals ...interface{}) {
// Consider switching on `method` as well?
for i := 0; i < len(keyvals); i += 2 {
if keyvals[i] == "results" && len(keyvals) > i+1 {
str, ok := keyvals[i+1].(string)
if ok && len(str) > 100 {
keyvals[i+1] = fmt.Sprintf(truncatedFormatString, str[0:99])
}
}... | [
-0.4677877426147461,
0.37360817193984985,
0.3678116202354431,
0.06165622919797897,
0.15778999030590057,
-0.36503908038139343,
-0.23903366923332214,
-1.299157738685608,
-0.09276902675628662,
-0.01856716349720955,
0.9528013467788696,
-0.21005110442638397,
0.13784222304821014,
0.2934880554676... |
func (ls *LogShipper) addDeviceIdentifyingAttributesToLogger() {
if deviceId, err := ls.knapsack.ServerProvidedDataStore().Get([]byte("device_id")); err != nil {
level.Debug(ls.baseLogger).Log("msg", "could not get device id", "err", err)
} else {
ls.shippingLogger = log.With(ls.shippingLogger, "k2_device_id", st... | [
-0.15503455698490143,
-0.5245360136032104,
0.6632965803146362,
0.06842122226953506,
-0.21918442845344543,
-0.03748055920004845,
-0.2741023302078247,
0.22732625901699066,
0.7336759567260742,
0.04029400274157524,
-0.3950793147087097,
0.6177891492843628,
0.689926266670227,
0.8379666805267334,... |
func (h *Helper) AddDuckEntry(entry *types.Entry) error {
query := `
INSERT INTO duck_entries (
id,
fed_time,
food,
kind_of_food,
amount_of_food,
location,
number_of_ducks
) VALUES (
$1, $2, $3, $4, $5, $6, $7
)
`
_, err := h.db.Exec(
query,
entry.ID,
entry.TimeFed,
entry.Food.... | [
-1.0729303359985352,
0.4514561891555786,
0.7776545286178589,
-0.684526264667511,
0.37804320454597473,
-0.5318358540534973,
0.47806689143180847,
-0.49961715936660767,
0.11001887917518616,
-0.01774534396827221,
-0.6407403349876404,
0.18925052881240845,
0.5566993951797485,
0.9300756454467773,... |
func EncodeAddResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error {
return func(ctx context.Context, w http.ResponseWriter, v interface{}) error {
res := v.(*stationviews.StationFull)
enc := encoder(ctx, w)
body := NewAddRespo... | [
-0.08702804148197174,
-0.5714998245239258,
0.5335133075714111,
-0.11743129044771194,
-1.2670543193817139,
0.583771288394928,
0.10908468812704086,
-0.31645843386650085,
0.5757497549057007,
0.2156752496957779,
-0.49631163477897644,
-0.8809242248535156,
0.1366664618253708,
0.10152306407690048... |
func DecodeAddRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
return func(r *http.Request) (interface{}, error) {
var (
body AddRequestBody
err error
)
err = decoder(r).Decode(&body)
if err != nil {
if err == io.EOF {
return nil, ... | [
-0.36770403385162354,
-0.13921955227851868,
0.86493319272995,
-0.03517080470919609,
-1.5293662548065186,
0.030276630073785782,
-0.8817015290260315,
-0.8909912109375,
0.7560502886772156,
0.1749548614025116,
0.46130314469337463,
0.3765623867511749,
0.0655670166015625,
0.36843785643577576,
... |
func EncodeGetResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error {
return func(ctx context.Context, w http.ResponseWriter, v interface{}) error {
res := v.(*stationviews.StationFull)
enc := encoder(ctx, w)
body := NewGetRespo... | [
-0.12680496275424957,
-0.4793003797531128,
0.475655198097229,
0.09903609752655029,
-0.7931573390960693,
-0.15302391350269318,
0.2631315588951111,
-0.44838038086891174,
0.6650688648223877,
0.40988412499427795,
-0.35420840978622437,
-0.46626999974250793,
0.1123850867152214,
-0.61460918188095... |
func DecodeGetRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
return func(r *http.Request) (interface{}, error) {
var (
id int32
auth string
err error
params = mux.Vars(r)
)
{
idRaw := params["id"]
v, err2 := strconv.ParseIn... | [
-0.709689736366272,
-0.24753053486347198,
0.9802284836769104,
-0.10893558710813522,
-1.1798930168151855,
-0.7407776117324829,
-0.5229802131652832,
-0.4647546112537384,
0.818970799446106,
0.4995701313018799,
0.2426968514919281,
0.38085269927978516,
0.08610813319683075,
-0.39852485060691833,... |
func EncodeUpdateResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error {
return func(ctx context.Context, w http.ResponseWriter, v interface{}) error {
res := v.(*stationviews.StationFull)
enc := encoder(ctx, w)
body := NewUpdat... | [
-0.708824872970581,
-0.9502160549163818,
0.5107296705245972,
0.1436372697353363,
-1.5954561233520508,
0.3191556930541992,
-0.04604616016149521,
-0.12018074840307236,
0.6058971881866455,
1.0245704650878906,
-0.8521227836608887,
-0.848784863948822,
-0.07858490943908691,
-0.3536260724067688,
... |
func DecodeUpdateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
return func(r *http.Request) (interface{}, error) {
var (
body UpdateRequestBody
err error
)
err = decoder(r).Decode(&body)
if err != nil {
if err == io.EOF {
return... | [
-1.0227445363998413,
-0.513310968875885,
0.7544888854026794,
-0.1514020711183548,
-1.6700512170791626,
-0.24668963253498077,
-0.5512783527374268,
-0.7874717712402344,
0.9232690930366516,
0.9403703808784485,
0.1303231418132782,
0.3546677231788635,
-0.07493972778320312,
-0.031917162239551544... |
func EncodeListMineResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error {
return func(ctx context.Context, w http.ResponseWriter, v interface{}) error {
res := v.(*stationviews.StationsFull)
enc := encoder(ctx, w)
body := NewLi... | [
-0.13271859288215637,
-0.9268621206283569,
0.2618662416934967,
-0.037593431770801544,
-1.0294573307037354,
0.20294703543186188,
-0.08782026916742325,
-0.3165213167667389,
0.6575211882591248,
0.4790036976337433,
-1.0317343473434448,
-0.9482282400131226,
-0.2973402440547943,
0.51658344268798... |
func DecodeListMineRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
return func(r *http.Request) (interface{}, error) {
var (
auth string
err error
)
auth = r.Header.Get("Authorization")
if auth == "" {
err = goa.MergeErrors(err, goa.M... | [
-0.8003213405609131,
-0.5503661036491394,
0.7484492063522339,
-0.013485345058143139,
-1.5611401796340942,
-0.286990225315094,
-0.8492625951766968,
-0.6227641701698303,
0.6112279295921326,
0.37208789587020874,
0.051843151450157166,
0.4145791530609131,
-0.1788613647222519,
0.1554011702537536... |
func EncodeListProjectResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error {
return func(ctx context.Context, w http.ResponseWriter, v interface{}) error {
res := v.(*stationviews.StationsFull)
enc := encoder(ctx, w)
body := Ne... | [
-0.18741558492183685,
-0.3827427625656128,
0.22375649213790894,
0.07774680107831955,
-1.1839638948440552,
0.14689022302627563,
0.11058435589075089,
-0.1111152395606041,
0.7212247252464294,
0.5078335404396057,
-0.6915432810783386,
-0.7864168882369995,
-0.3534642159938812,
0.1560598164796829... |
func DecodeListProjectRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
return func(r *http.Request) (interface{}, error) {
var (
id int32
auth string
err error
params = mux.Vars(r)
)
{
idRaw := params["id"]
v, err2 := strconv... | [
-0.9508846998214722,
-0.0619019940495491,
0.6261083483695984,
-0.16098205745220184,
-1.7041128873825073,
-0.4983476996421814,
-0.6198367476463318,
-0.2216610610485077,
0.8917864561080933,
0.31442713737487793,
-0.40301892161369324,
0.2546839714050293,
-0.3553963303565979,
-0.098127916455268... |
func EncodePhotoResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error {
return func(ctx context.Context, w http.ResponseWriter, v interface{}) error {
res := v.(*station.PhotoResult)
val := res.Length
lengths := strconv.FormatIn... | [
-0.4452377259731293,
-0.5561323761940002,
0.20912803709506989,
-0.1539517194032669,
-0.6950540542602539,
-0.31917351484298706,
0.17925293743610382,
-0.48686471581459045,
0.8437952399253845,
-0.0929872915148735,
-1.246315836906433,
-0.7626546025276184,
-0.18765783309936523,
0.29506692290306... |
func DecodePhotoRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) {
return func(r *http.Request) (interface{}, error) {
var (
id int32
auth string
err error
params = mux.Vars(r)
)
{
idRaw := params["id"]
v, err2 := strconv.Parse... | [
-1.1494393348693848,
-0.6736230254173279,
0.6101283431053162,
0.017951998859643936,
-1.484717607498169,
-0.8755983114242554,
-0.5275458097457886,
-0.8038362860679626,
1.0526270866394043,
-0.28943881392478943,
-0.5968347191810608,
0.0369226410984993,
0.25451773405075073,
0.12971654534339905... |
func marshalStationviewsStationOwnerViewToStationOwnerResponseBody(v *stationviews.StationOwnerView) *StationOwnerResponseBody {
res := &StationOwnerResponseBody{
ID: *v.ID,
Name: *v.Name,
}
return res
} | [
-0.425758421421051,
-0.5776242017745972,
0.3075850307941437,
0.1968727707862854,
-0.7894163727760315,
-0.15713657438755035,
0.5257186889648438,
-0.31658628582954407,
0.7652387022972107,
-0.5214545726776123,
0.08962336927652359,
0.5512486100196838,
0.2416902631521225,
-1.100894570350647,
... |
func marshalStationviewsStationUploadViewToStationUploadResponseBody(v *stationviews.StationUploadView) *StationUploadResponseBody {
res := &StationUploadResponseBody{
ID: *v.ID,
Time: *v.Time,
UploadID: *v.UploadID,
Size: *v.Size,
URL: *v.URL,
Type: *v.Type,
}
if v.Blocks != nil {... | [
-0.20839935541152954,
-0.4800645411014557,
0.4073115289211273,
-0.705809473991394,
-0.26928552985191345,
-0.7004184126853943,
0.08127430826425552,
-0.9498183727264404,
0.27329114079475403,
0.32468339800834656,
0.06325159966945648,
0.06746210902929306,
0.09961660206317902,
-0.29705119132995... |
func marshalStationviewsImageRefViewToImageRefResponseBody(v *stationviews.ImageRefView) *ImageRefResponseBody {
res := &ImageRefResponseBody{
URL: *v.URL,
}
return res
} | [
-0.17740465700626373,
0.2603156566619873,
0.1751706302165985,
-0.6364202499389648,
-0.30889928340911865,
-0.5898862481117249,
0.07005161792039871,
-0.5397546291351318,
0.797032356262207,
0.20953820645809174,
0.7993307113647461,
0.2832889258861542,
0.2982023358345032,
0.4814366400241852,
... |
func marshalStationviewsStationPhotosViewToStationPhotosResponseBody(v *stationviews.StationPhotosView) *StationPhotosResponseBody {
res := &StationPhotosResponseBody{
Small: *v.Small,
}
return res
} | [
-0.5248533487319946,
-0.3758161664009094,
0.14440590143203735,
0.09038367122411728,
-0.5736520290374756,
-0.624961256980896,
0.3203030228614807,
-0.5443819165229797,
1.118343472480774,
0.26291534304618835,
-0.14146725833415985,
0.3010026514530182,
0.626632571220398,
-0.1867404729127884,
... |
func marshalStationviewsStationConfigurationsViewToStationConfigurationsResponseBody(v *stationviews.StationConfigurationsView) *StationConfigurationsResponseBody {
res := &StationConfigurationsResponseBody{}
if v.All != nil {
res.All = make([]*StationConfigurationResponseBody, len(v.All))
for i, val := range v.A... | [
-0.6492403149604797,
0.22677147388458252,
0.17716896533966064,
0.09606178849935532,
-0.4833824932575226,
-0.7050812840461731,
0.6421834826469421,
-0.7945965528488159,
0.5490108728408813,
0.34802040457725525,
-0.01120743714272976,
-0.5528553128242493,
0.5615078806877136,
-0.0899266302585601... |
func marshalStationviewsStationConfigurationViewToStationConfigurationResponseBody(v *stationviews.StationConfigurationView) *StationConfigurationResponseBody {
res := &StationConfigurationResponseBody{
ID: *v.ID,
Time: *v.Time,
ProvisionID: *v.ProvisionID,
MetaRecordID: v.MetaRecordID,
So... | [
-0.6851997971534729,
-0.22482506930828094,
0.13551010191440582,
-0.32092422246932983,
-0.4051092863082886,
-0.47595763206481934,
0.4800213575363159,
-0.3461470305919647,
0.4971345365047455,
0.7259308099746704,
-0.05657769367098808,
-0.09372563660144806,
0.3139294981956482,
-0.1313171982765... |
func marshalStationviewsStationModuleViewToStationModuleResponseBody(v *stationviews.StationModuleView) *StationModuleResponseBody {
res := &StationModuleResponseBody{
ID: *v.ID,
HardwareID: v.HardwareID,
MetaRecordID: v.MetaRecordID,
Name: *v.Name,
Position: *v.Position,
Flags: ... | [
-0.6369332075119019,
-0.586640477180481,
0.31215763092041016,
-0.6795731782913208,
-0.4028274714946747,
0.17529353499412537,
0.20507203042507172,
-0.5903667211532593,
0.7917494773864746,
0.606583833694458,
0.2585659325122833,
0.09905418008565903,
-0.22472861409187317,
0.2399253100156784,
... |
func marshalStationviewsStationSensorViewToStationSensorResponseBody(v *stationviews.StationSensorView) *StationSensorResponseBody {
res := &StationSensorResponseBody{
Name: *v.Name,
UnitOfMeasure: *v.UnitOfMeasure,
Key: *v.Key,
}
if v.Reading != nil {
res.Reading = marshalStationviewsSens... | [
-0.27366164326667786,
-0.32635053992271423,
0.050948407500982285,
-0.31124264001846313,
-0.2003580629825592,
-0.38358572125434875,
-0.01343789417296648,
-1.1342803239822388,
1.025337815284729,
-0.25846385955810547,
0.33513015508651733,
-0.378446489572525,
0.42124226689338684,
-0.1585263907... |
func marshalStationviewsSensorReadingViewToSensorReadingResponseBody(v *stationviews.SensorReadingView) *SensorReadingResponseBody {
if v == nil {
return nil
}
res := &SensorReadingResponseBody{
Last: *v.Last,
Time: *v.Time,
}
return res
} | [
0.2397395223379135,
0.2600725591182709,
0.1887577921152115,
-0.2391187697649002,
-0.6045317649841309,
-0.5279693007469177,
-0.37685489654541016,
-0.9072617888450623,
1.118579626083374,
-0.21852397918701172,
0.8496473431587219,
-0.4998147189617157,
0.16379602253437042,
-0.4680589735507965,
... |
func marshalStationviewsSensorRangeViewToSensorRangeResponseBody(v *stationviews.SensorRangeView) *SensorRangeResponseBody {
res := &SensorRangeResponseBody{
Minimum: *v.Minimum,
Maximum: *v.Maximum,
}
return res
} | [
-0.5469598770141602,
-0.17886318266391754,
0.08910989761352539,
-0.5200514197349548,
-0.8237930536270142,
-0.4221664369106293,
-0.3799959719181061,
-0.8185691833496094,
1.321881651878357,
-0.5941959023475647,
0.2893604636192322,
-0.2253505140542984,
-0.17750804126262665,
-0.378083467483520... |
func marshalStationviewsStationLocationViewToStationLocationResponseBody(v *stationviews.StationLocationView) *StationLocationResponseBody {
if v == nil {
return nil
}
res := &StationLocationResponseBody{
Latitude: *v.Latitude,
Longitude: *v.Longitude,
}
return res
} | [
-0.02309351973235607,
-0.8002027869224548,
0.16009704768657684,
-0.20955121517181396,
-0.30135437846183777,
-0.5156987309455872,
0.6491122841835022,
-0.04578797519207001,
1.1181989908218384,
0.3622247874736786,
-0.0894031971693039,
-0.26987597346305847,
0.7983841300010681,
-0.5016129016876... |
func marshalStationviewsStationFullViewToStationFullResponseBody(v *stationviews.StationFullView) *StationFullResponseBody {
res := &StationFullResponseBody{
ID: *v.ID,
Name: *v.Name,
DeviceID: *v.DeviceID,
ReadOnly: *v.ReadOnly,
Battery: v.Battery... | [
-0.24626819789409637,
-0.7400836944580078,
0.33267849683761597,
-0.4979349672794342,
-0.5094870924949646,
-0.43562376499176025,
0.290565550327301,
-0.5390152335166931,
0.7722281813621521,
0.17831985652446747,
-0.472461998462677,
-0.18839433789253235,
0.11138810217380524,
0.1379131376743316... |
func NewConditionCommand() *ConditionCommand {
return &ConditionCommand{}
} | [
0.5490151643753052,
-1.0102747678756714,
0.04174034669995308,
0.9350404143333435,
0.003922710195183754,
-0.01967194676399231,
0.8242104053497314,
0.21460086107254028,
0.1550333946943283,
-0.6148508191108704,
-0.02100364677608013,
0.6677736639976501,
-0.6701481342315674,
0.7000855803489685,... |
func (cmd *ConditionCommand) AddFlaggySubcommand() *flaggy.Subcommand {
cmd.subcommand = flaggy.NewSubcommand("condition")
cmd.subcommand.Description = "Condition and/or convert a mGuard configuration file"
cmd.subcommand.String(&cmd.inFilePath, "", "in", "File containing the mGuard configuration to condition (ATV ... | [
0.8932961821556091,
-0.3199765682220459,
1.0547088384628296,
-0.1642473340034485,
0.018327580764889717,
1.061251163482666,
-0.013689187355339527,
0.07390483468770981,
-0.5988490581512451,
-0.7034820318222046,
0.41791439056396484,
0.8296642303466797,
-0.5279420614242554,
0.5790486931800842,... |
func (cmd *ConditionCommand) IsSubcommandUsed() bool {
return cmd.subcommand.Used
} | [
0.10028903186321259,
-0.44475799798965454,
0.7516587376594543,
-0.16901053488254547,
0.16572390496730804,
0.3929404616355896,
0.989837646484375,
0.2655675709247589,
-0.16969339549541473,
-1.038423776626587,
-0.7529294490814209,
1.1648989915847778,
-0.5824035406112671,
-0.06175771728157997,... |
func (cmd *ConditionCommand) ValidateArguments() error {
// ensure that the specified files exist and are readable
files := []string{cmd.inFilePath}
for _, path := range files {
if len(path) > 0 {
file, err := os.Open(path)
if err != nil {
return err
}
file.Close()
}
}
return nil
} | [
-0.6301755905151367,
-0.7017094492912292,
0.4801747798919678,
0.06195051968097687,
0.7293867468833923,
1.0538840293884277,
1.0637400150299072,
0.36241084337234497,
-1.3425991535186768,
0.6917235255241394,
1.4178013801574707,
-0.49877381324768066,
-1.5489535331726074,
0.543543815612793,
-... |
func (cmd *ConditionCommand) ExecuteCommand() error {
fileWritten := false
// load configuration file (can be ATV or ECS)
// (the configuration is always loaded into an ECS container, missing parts are filled with defaults)
ecs, err := loadConfigurationFile(cmd.inFilePath)
if err != nil {
return err
}
// wr... | [
-0.2173732966184616,
-0.9202283024787903,
0.9819766283035278,
-0.22974489629268646,
1.2011749744415283,
0.7123405337333679,
0.6902751922607422,
-0.04800717160105705,
-0.9284359216690063,
-0.00001711548065941315,
1.1083904504776,
-0.46960389614105225,
0.11825956404209137,
0.1662405878305435... |
func (c *Client) DeleteBot(ctx context.Context, params *DeleteBotInput, optFns ...func(*Options)) (*DeleteBotOutput, error) {
if params == nil {
params = &DeleteBotInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteBot", params, optFns, addOperationDeleteBotMiddlewares)
if err != nil {
return nil... | [
-0.6124098896980286,
1.1172621250152588,
0.5224326848983765,
0.5978878736495972,
0.3283575773239136,
-0.3362356424331665,
0.717109203338623,
-0.9585687518119812,
0.23227164149284363,
-0.5026353597640991,
-0.3079022169113159,
1.6365866661071777,
-0.7970710396766663,
-0.45951202511787415,
... |
func (m *TemplateUpdateRequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateEnv(formats); err != nil {
res = append(res, err)
}
if err := m.validateLabels(formats); err != nil {
res = append(res, err)
}
if err := m.validateRepository(formats); err != nil {
res = append(r... | [
-0.9049507975578308,
-0.48208940029144287,
0.40868210792541504,
-0.46326085925102234,
-0.5718214511871338,
-0.17495691776275635,
0.00043425560579635203,
-0.651190459728241,
-0.8547317981719971,
0.4253566861152649,
0.4630846679210663,
0.11778699606657028,
-0.3363688886165619,
1.347525596618... |
func waitWorkflows(ctx context.Context, serviceClient workflowpkg.WorkflowServiceClient, namespace string, workflowNames []string, ignoreNotFound, quiet bool) {
var wg sync.WaitGroup
wfSuccessStatus := true
for _, name := range workflowNames {
wg.Add(1)
go func(name string) {
if !waitOnOne(serviceClient, ctx... | [
-0.46442025899887085,
0.13731683790683746,
0.5234376192092896,
0.09433628618717194,
0.3732316493988037,
0.32044824957847595,
-0.20700256526470184,
-0.6643355488777161,
-0.2704417109489441,
0.16977271437644958,
-0.881369411945343,
-0.2683430016040802,
-0.914188802242279,
0.36587318778038025... |
func NewEapAkaService(config *mconfig.EapAkaConfig) (*EapAkaSrv, error) {
service := &EapAkaSrv{
sessions: map[string]*SessionCtx{},
plmnFilter: plmn_filter.PlmnIdVals{},
timeouts: defaultTimeouts,
mncLen: 3,
}
if config != nil {
if config.Timeout != nil {
if config.Timeout.ChallengeMs > 0 {
... | [
-0.5795041918754578,
-0.7541833519935608,
0.8451042175292969,
0.011211770586669445,
-0.9764171242713928,
0.03577427938580513,
-0.029989825561642647,
-0.26516732573509216,
0.975091278553009,
0.7634518146514893,
0.203950896859169,
0.33177390694618225,
-0.3093380033969879,
0.7738727927207947,... |
func (s *EapAkaSrv) SetPlmnIdFilter(plmnIds []string) {
s.plmnFilter = plmn_filter.GetPlmnVals(plmnIds, "EAP-AKA")
} | [
-1.2386956214904785,
-0.86274653673172,
0.07746417820453644,
-0.4875634014606476,
-0.8859456777572632,
0.24509337544441223,
-1.0651402473449707,
-0.06497146189212799,
0.6862603425979614,
-0.20480366051197052,
-0.7073757648468018,
0.9562976360321045,
-0.3188841938972473,
0.6543462872505188,... |
func (s *EapAkaSrv) CheckPlmnId(imsi aka.IMSI) bool {
return s == nil || s.plmnFilter.Check(string(imsi))
} | [
-0.30536922812461853,
-0.7238554358482361,
0.18289978802204132,
-0.035248588770627975,
-0.6424048542976379,
-0.43173977732658386,
-1.680782437324524,
-0.2736578583717346,
1.2687503099441528,
-0.30417951941490173,
-0.15745893120765686,
0.7409478425979614,
-0.33342042565345764,
0.92361152172... |
func (lockedCtx *UserCtx) Unlock() {
if !lockedCtx.locked {
panic("Expected locked")
}
lockedCtx.locked = false
lockedCtx.mu.Unlock()
} | [
-0.4138244092464447,
0.5544981956481934,
0.10030179470777512,
0.6046137809753418,
-0.10791924595832825,
1.0412181615829468,
0.986503005027771,
0.6434592008590698,
0.33728334307670593,
-0.9413274526596069,
0.42870157957077026,
0.5228596329689026,
-0.3813827633857727,
-1.1958917379379272,
... |
func (lockedCtx *UserCtx) State() (aka.AkaState, time.Time) {
if !lockedCtx.locked {
panic("Expected locked")
}
return lockedCtx.state, lockedCtx.stateTime
} | [
-0.3692525625228882,
-0.37372222542762756,
0.29815781116485596,
0.569114089012146,
-0.5942365527153015,
0.45382946729660034,
0.5633692741394043,
-0.4543907046318054,
1.0292365550994873,
0.28763920068740845,
-0.29790419340133667,
0.35419002175331116,
0.05070042237639427,
-0.2490048855543136... |
func (lockedCtx *UserCtx) SetState(s aka.AkaState) {
if !lockedCtx.locked {
panic("Expected locked")
}
lockedCtx.state, lockedCtx.stateTime = s, time.Now()
} | [
-0.6358683705329895,
0.1430882215499878,
0.18770352005958557,
0.6312812566757202,
-0.5166270732879639,
0.6733963489532471,
0.5783777832984924,
0.07879775762557983,
1.0819684267044067,
-0.10010861605405807,
-0.537122905254364,
0.5019005537033081,
-0.0034690003376454115,
-0.5860214233398438,... |
func (lockedCtx *UserCtx) CreatedTime() time.Time {
return lockedCtx.created
} | [
0.6314896941184998,
-0.24341683089733124,
0.13376584649085999,
0.5928098559379578,
0.1450478583574295,
0.9856808185577393,
-0.01708211936056614,
-0.49224334955215454,
0.5830764770507812,
-0.35747411847114563,
-0.3583729863166809,
-0.26069939136505127,
-0.5887494087219238,
-0.76907187700271... |
func (lockedCtx *UserCtx) Lifetime() float64 {
return time.Since(lockedCtx.created).Seconds()
} | [
0.6647810339927673,
-0.7709093689918518,
0.3150784373283386,
0.3055421710014343,
-0.0074967616237699986,
0.7087327241897583,
-0.17868216335773468,
-0.7518953680992126,
0.12440034747123718,
-0.5803338289260864,
-0.9501733183860779,
-0.4267801344394684,
0.09202304482460022,
-0.62370389699935... |
func (s *EapAkaSrv) InitSession(sessionId string, imsi aka.IMSI) (lockedUserContext *UserCtx) {
var (
oldSessionTimer *time.Timer
oldSessionState aka.AkaState
)
// create new session with long session wide timeout
t := time.Now()
newSession := &SessionCtx{UserCtx: &UserCtx{
created: t, Imsi: imsi, state: aka... | [
-0.5647571086883545,
-0.8019121289253235,
0.7662903666496277,
-0.1308903694152832,
-1.1112291812896729,
-0.19783414900302887,
0.6490010619163513,
-0.8007863759994507,
2.4987070560455322,
0.4639991223812103,
-0.07291658967733383,
0.44693559408187866,
0.2595446705818176,
-0.46211498975753784... |
func (s *EapAkaSrv) UpdateSessionUnlockCtx(lockedCtx *UserCtx, timeout time.Duration) {
if !lockedCtx.locked {
panic("Expected locked")
}
var (
oldSession, newSession *SessionCtx
exist bool
oldTimer *time.Timer
)
newSession = &SessionCtx{UserCtx: lockedCtx}
sessionId := lock... | [
-0.7632825970649719,
-1.2014153003692627,
0.616976797580719,
-0.3493489623069763,
-1.3785979747772217,
-0.09002970904111862,
0.08023948222398758,
-0.27719298005104065,
1.624408483505249,
0.7245123982429504,
-0.2582210302352905,
0.22804275155067444,
0.23567554354667664,
-0.6538435220718384,... |
func (s *EapAkaSrv) UpdateSessionTimeout(sessionId string, timeout time.Duration) bool {
var (
newSession *SessionCtx
exist bool
oldTimer *time.Timer
)
s.rwl.Lock()
oldSession, exist := s.sessions[sessionId]
if exist {
if oldSession == nil {
exist = false
} else {
oldTimer, oldSession.Clea... | [
-0.7959040403366089,
-1.2592147588729858,
0.7060931324958801,
-0.3682995140552521,
-1.2442686557769775,
-0.294079065322876,
-0.6730319261550903,
-0.3393859565258026,
1.467669129371643,
1.5433861017227173,
-0.6374634504318237,
0.34094077348709106,
-0.1797502636909485,
0.3726905882358551,
... |
func (s *EapAkaSrv) FindSession(sessionId string) (aka.IMSI, *UserCtx, bool) {
var (
imsi aka.IMSI
lockedCtx *UserCtx
timer *time.Timer
)
s.rwl.RLock()
sessionCtx, exist := s.sessions[sessionId]
if exist && sessionCtx != nil {
lockedCtx, timer, sessionCtx.CleanupTimer = sessionCtx.UserCtx, session... | [
-0.931088387966156,
-0.8126540780067444,
0.521416962146759,
-0.2562791109085083,
-0.742317795753479,
-0.5410580635070801,
0.5978585481643677,
-1.4594794511795044,
1.679783821105957,
0.48226019740104675,
-0.3142639696598053,
-0.44555366039276123,
-0.3372161388397217,
0.22493231296539307,
... |
func (s *EapAkaSrv) RemoveSession(sessionId string) aka.IMSI {
var (
timer *time.Timer
imsi aka.IMSI
)
s.rwl.Lock()
sessionCtx, exist := s.sessions[sessionId]
if exist {
delete(s.sessions, sessionId)
if sessionCtx != nil {
imsi, timer, sessionCtx.CleanupTimer, sessionCtx.UserCtx =
sessionCtx.Imsi, ... | [
-1.0051579475402832,
-0.8140162229537964,
0.41171708703041077,
-0.6719169020652771,
-1.0984125137329102,
-0.8479379415512085,
0.6215068101882935,
-0.821645200252533,
2.360936403274536,
0.2764173746109009,
-0.20840102434158325,
-0.32197603583335876,
-0.4093817174434662,
0.4521615207195282,
... |
func (s *EapAkaSrv) FindAndRemoveSession(sessionId string) (aka.IMSI, bool) {
var (
imsi aka.IMSI
timer *time.Timer
)
s.rwl.Lock()
sessionCtx, exist := s.sessions[sessionId]
if exist {
delete(s.sessions, sessionId)
if sessionCtx != nil {
imsi, timer, sessionCtx.CleanupTimer = sessionCtx.Imsi, sessionCt... | [
-0.47907334566116333,
-0.7985820770263672,
0.5472288131713867,
-0.6397386789321899,
-1.0887881517410278,
-1.0975680351257324,
0.3844301402568817,
-1.167030930519104,
1.9311448335647583,
1.0109096765518188,
-0.26697754859924316,
-0.8637850284576416,
-0.5755174160003662,
1.163711667060852,
... |
func (s *EapAkaSrv) ResetSessionTimeout(sessionId string, newTimeout time.Duration) {
var oldTimer *time.Timer
s.rwl.Lock()
session, exist := s.sessions[sessionId]
if exist {
if session != nil {
oldTimer, session.CleanupTimer = session.CleanupTimer, time.AfterFunc(newTimeout, func() {
sessionTimeoutCleanu... | [
-0.03898874670267105,
-1.0481560230255127,
0.25409436225891113,
-0.16680695116519928,
-0.4183593988418579,
-1.2421234846115112,
-0.12247927486896515,
0.2816893756389618,
1.3056458234786987,
1.4725064039230347,
-0.5031308531761169,
1.1704519987106323,
0.10562863945960999,
0.2740186154842376... |
func (a AnyMessage) Action() Action {
if action, ok := a[KeyAction].(string); ok {
return Action(action)
}
return ActionEmpty
} | [
-0.08328182995319366,
-0.9010306000709534,
0.2101433277130127,
0.10399629175662994,
0.2537318766117096,
-0.5791543126106262,
0.4428132176399231,
-0.3774661719799042,
0.933454692363739,
0.26691123843193054,
0.2916329801082611,
0.978689432144165,
-0.8835820555686951,
0.14474254846572876,
-... |
func ConvertAnyMessage(m AnyMessage) (ActionMessage, error) {
a := m.Action()
switch a {
// TODO support other Actions?
case ActionChatMessage:
return ParseChatMessage(m, a)
case ActionReadMessage:
return ParseReadMessage(m, a)
case ActionTypeStart:
return ParseTypeStart(m, a)
case ActionTypeEnd:
return ... | [
-0.9605416655540466,
-1.5960196256637573,
0.7526156306266785,
0.3002128601074219,
-0.10787983238697052,
-0.9694557189941406,
-0.3700859248638153,
-0.6179244518280029,
0.4483869671821594,
-0.10256651043891907,
-0.08138975501060486,
0.28880172967910767,
-0.7500961422920227,
1.322055101394653... |
func (ef *EmbdFields) ParseFields(m AnyMessage) {
ef.ActionName = m.Action()
} | [
0.24466939270496368,
0.3223070204257965,
0.22465558350086212,
0.10812069475650787,
1.0851608514785767,
-0.9016459584236145,
0.6029685139656067,
-0.1086287871003151,
-0.1734754592180252,
-0.3809133768081665,
-0.5056107044219971,
0.0823669508099556,
-0.5530955195426941,
1.1875547170639038,
... |
func (fields *ChatActionFields) ParseFields(m AnyMessage) {
fields.SenderID = uint64(m.Number(KeySenderID))
fields.RoomID = uint64(m.Number(KeyRoomID))
} | [
-0.28681421279907227,
-0.11712031066417694,
0.1792973279953003,
0.05363234877586365,
0.3591260313987732,
-0.45761874318122864,
-0.17527905106544495,
-0.5115589499473572,
-0.4998205900192261,
-0.2178134024143219,
-0.7003692984580994,
-0.020489389076828957,
-0.7760359048843384,
0.88883423805... |
func NewQuoteGuestCartManagementV1AssignCustomerPutParams() *QuoteGuestCartManagementV1AssignCustomerPutParams {
var ()
return &QuoteGuestCartManagementV1AssignCustomerPutParams{
timeout: cr.DefaultTimeout,
}
} | [
-0.9270066618919373,
-1.104703664779663,
0.429686039686203,
0.02883836254477501,
-0.5777146220207214,
-0.08557241410017014,
1.4586564302444458,
-0.34345725178718567,
-1.1532777547836304,
1.093324899673462,
-0.13817152380943298,
-0.18523620069026947,
-0.48181837797164917,
0.4591245353221893... |
func NewQuoteGuestCartManagementV1AssignCustomerPutParamsWithTimeout(timeout time.Duration) *QuoteGuestCartManagementV1AssignCustomerPutParams {
var ()
return &QuoteGuestCartManagementV1AssignCustomerPutParams{
timeout: timeout,
}
} | [
-0.020502906292676926,
-1.0776644945144653,
0.44798073172569275,
0.2580290138721466,
-0.6212186813354492,
0.3234698474407196,
0.34524038434028625,
-0.15960319340229034,
-0.971795916557312,
1.535919189453125,
0.017375851050019264,
0.3469797670841217,
-0.5104037523269653,
0.8274250626564026,... |
func NewQuoteGuestCartManagementV1AssignCustomerPutParamsWithContext(ctx context.Context) *QuoteGuestCartManagementV1AssignCustomerPutParams {
var ()
return &QuoteGuestCartManagementV1AssignCustomerPutParams{
Context: ctx,
}
} | [
-0.5034383535385132,
-0.8157088160514832,
0.6944974064826965,
-0.3202173411846161,
-0.32334262132644653,
0.4078662395477295,
0.7744197845458984,
-0.8509916663169861,
-0.6498426198959351,
1.149004340171814,
-0.2789570391178131,
-0.4976581633090973,
-0.3953899145126343,
0.20661862194538116,
... |
func NewQuoteGuestCartManagementV1AssignCustomerPutParamsWithHTTPClient(client *http.Client) *QuoteGuestCartManagementV1AssignCustomerPutParams {
var ()
return &QuoteGuestCartManagementV1AssignCustomerPutParams{
HTTPClient: client,
}
} | [
-0.4270000457763672,
-1.0899513959884644,
0.5680157542228699,
-0.061083462089300156,
-0.12456347048282623,
0.29907727241516113,
1.4204975366592407,
-0.2662487030029297,
-1.2539746761322021,
0.8392400145530701,
-0.2138725370168686,
-0.39234039187431335,
-0.3256843686103821,
0.17571960389614... |
func (o *QuoteGuestCartManagementV1AssignCustomerPutParams) WithTimeout(timeout time.Duration) *QuoteGuestCartManagementV1AssignCustomerPutParams {
o.SetTimeout(timeout)
return o
} | [
0.1101585403084755,
-0.8567720055580139,
0.2936597168445587,
0.046117715537548065,
-0.666830837726593,
-0.23272795975208282,
0.6381460428237915,
-0.4184117317199707,
-0.40502312779426575,
1.315531849861145,
0.5267499685287476,
0.29415950179100037,
0.3351091146469116,
0.8012166023254395,
... |
func (o *QuoteGuestCartManagementV1AssignCustomerPutParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
} | [
-0.22479493916034698,
-0.5836124420166016,
0.2172287404537201,
0.22251658141613007,
-0.22944268584251404,
0.5674070119857788,
1.0800912380218506,
-0.004314282909035683,
-0.9030173420906067,
1.1899431943893433,
0.5485072135925293,
0.13722500205039978,
-0.0826491117477417,
0.7708012461662292... |
func (o *QuoteGuestCartManagementV1AssignCustomerPutParams) WithContext(ctx context.Context) *QuoteGuestCartManagementV1AssignCustomerPutParams {
o.SetContext(ctx)
return o
} | [
-0.6067601442337036,
-0.8146555423736572,
0.518181562423706,
-0.2157396674156189,
-0.6221135854721069,
-0.07627879083156586,
0.4875227212905884,
-0.8612210154533386,
-0.08315037935972214,
0.77889484167099,
0.28421470522880554,
-0.15040996670722961,
-0.17951755225658417,
0.1531854122877121,... |
func (o *QuoteGuestCartManagementV1AssignCustomerPutParams) SetContext(ctx context.Context) {
o.Context = ctx
} | [
-0.6597091555595398,
-0.40493136644363403,
0.35552793741226196,
0.3125331997871399,
-0.17375782132148743,
0.5361520648002625,
0.9468941688537598,
-0.5553811192512512,
-0.2581460177898407,
0.731691837310791,
0.1942981481552124,
-0.22668758034706116,
-0.3424827456474304,
0.29785916209220886,... |
func (o *QuoteGuestCartManagementV1AssignCustomerPutParams) WithHTTPClient(client *http.Client) *QuoteGuestCartManagementV1AssignCustomerPutParams {
o.SetHTTPClient(client)
return o
} | [
-0.31015342473983765,
-1.589280128479004,
0.39985522627830505,
-0.21822766959667206,
-0.4643399715423584,
-0.23953917622566223,
1.2851535081863403,
-0.5870260000228882,
-0.8494408130645752,
0.5948393940925598,
0.1781841516494751,
-0.10177307575941086,
0.16985847055912018,
-0.04941285774111... |
func (o *QuoteGuestCartManagementV1AssignCustomerPutParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
} | [
-0.13375180959701538,
-1.0524775981903076,
0.25898829102516174,
-0.3702397346496582,
-0.45177334547042847,
-0.08756919205188751,
1.5391056537628174,
-0.47241494059562683,
-1.2183125019073486,
0.591425895690918,
-0.06821892410516739,
0.18457312881946564,
-0.2024017870426178,
-0.041076440364... |
func (o *QuoteGuestCartManagementV1AssignCustomerPutParams) WithCartID(cartID string) *QuoteGuestCartManagementV1AssignCustomerPutParams {
o.SetCartID(cartID)
return o
} | [
0.4680686593055725,
-1.7438899278640747,
0.29362213611602783,
-0.5241373181343079,
-0.6224483251571655,
0.1270604431629181,
0.21565669775009155,
-1.0591405630111694,
-0.6604337096214294,
1.1965924501419067,
0.09726390987634659,
0.4331512153148651,
0.353705495595932,
0.37368112802505493,
... |
func (o *QuoteGuestCartManagementV1AssignCustomerPutParams) SetCartID(cartID string) {
o.CartID = cartID
} | [
-0.1500321477651596,
-1.498759150505066,
0.24534867703914642,
-0.27496537566185,
-0.6568204760551453,
0.5062006115913391,
0.8475281000137329,
-0.6341342329978943,
-0.7315708994865417,
1.2841455936431885,
-0.07549777626991272,
0.7857905626296997,
-0.36897268891334534,
0.5455610156059265,
... |
func (o *QuoteGuestCartManagementV1AssignCustomerPutParams) WithQuoteGuestCartManagementV1AssignCustomerPutBody(quoteGuestCartManagementV1AssignCustomerPutBody QuoteGuestCartManagementV1AssignCustomerPutBody) *QuoteGuestCartManagementV1AssignCustomerPutParams {
o.SetQuoteGuestCartManagementV1AssignCustomerPutBody(quot... | [
-0.889395534992218,
-1.3182411193847656,
0.6501845121383667,
0.05339207872748375,
-0.21697819232940674,
-0.0042765215039253235,
1.114302635192871,
-0.836135983467102,
0.02550653927028179,
1.025766134262085,
-0.1803450882434845,
-0.4493475556373596,
-0.3522232174873352,
0.47572076320648193,... |
func (o *QuoteGuestCartManagementV1AssignCustomerPutParams) SetQuoteGuestCartManagementV1AssignCustomerPutBody(quoteGuestCartManagementV1AssignCustomerPutBody QuoteGuestCartManagementV1AssignCustomerPutBody) {
o.QuoteGuestCartManagementV1AssignCustomerPutBody = quoteGuestCartManagementV1AssignCustomerPutBody
} | [
-0.8619588017463684,
-1.2356014251708984,
0.7120994925498962,
-0.12038692086935043,
-0.22699744999408722,
0.013214089907705784,
1.2513408660888672,
-0.7542085647583008,
-0.2140093445777893,
1.2266461849212646,
-0.27785491943359375,
-0.31284648180007935,
-0.3556242883205414,
0.3456811010837... |
func (o *QuoteGuestCartManagementV1AssignCustomerPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// path param cartId
if err := r.SetPathParam("cartId", o.CartID); err != nil {
return err
}
if err ... | [
-1.273030400276184,
-0.8409540057182312,
0.6631619334220886,
-0.39946553111076355,
0.616182804107666,
-0.23842930793762207,
1.3575036525726318,
-0.16628628969192505,
-0.868718147277832,
0.9011952877044678,
0.3220885097980499,
0.19765953719615936,
-0.3275836110115051,
0.35843637585639954,
... |
func NewGeoLoc(raw string) *GeoLoc {
return &GeoLoc{
Located: false,
Raw: raw,
}
} | [
0.7898111939430237,
-0.690507173538208,
0.2705802917480469,
-0.259912371635437,
-1.3396754264831543,
0.28028473258018494,
0.33402639627456665,
0.3262682557106018,
-0.20037637650966644,
-0.4080659747123718,
0.03616835176944733,
0.41620683670043945,
1.0163233280181885,
-0.9298133850097656,
... |
func NewUnlocatedGeoLoc(row *sql.Rows) (*GeoLoc, error) {
loc := NewGeoLoc("")
// Parse
if err := row.Scan(&loc.ID, &loc.Raw); err != nil {
return nil, fmt.Errorf("error reading field values from row: %s",
err.Error())
}
// Success
return loc, nil
} | [
0.763607919216156,
-0.06828926503658295,
0.6018630862236023,
-0.5476083159446716,
-0.6715890169143677,
-0.257360577583313,
0.8866562843322754,
-0.119785375893116,
-0.3039126694202423,
-0.30348682403564453,
0.19600246846675873,
-0.08479100465774536,
0.7992441654205322,
-0.6266583204269409,
... |
func (l *GeoLoc) Query() error {
// Get db instance
db, err := dstore.NewDB()
if err != nil {
return fmt.Errorf("error retrieving db instance: %s",
err.Error())
}
// Query
row := db.QueryRow("SELECT id FROM geo_locs WHERE raw = $1", l.Raw)
// Get ID
err = row.Scan(&l.ID)
// Check if row found
if err =... | [
0.19717547297477722,
0.21827390789985657,
0.4680540859699249,
-0.3467959761619568,
-0.33643603324890137,
0.2657327353954315,
0.07283452898263931,
0.3448118567466736,
0.38034066557884216,
0.11808764189481735,
0.641315758228302,
-0.21751432120800018,
-0.27980971336364746,
0.05295142531394958... |
func (l GeoLoc) Update() error {
// Get database instance
db, err := dstore.NewDB()
if err != nil {
return fmt.Errorf("error retrieving database instance: %s",
err.Error())
}
// Update
var row *sql.Row
// If not located
if !l.Located {
row = db.QueryRow("UPDATE geo_locs SET located = $1, raw = "+
"$... | [
-0.2561732828617096,
-0.8027549386024475,
0.6761903762817383,
-0.5270338654518127,
-0.5080997347831726,
0.45944708585739136,
0.3108662962913513,
-0.057450540363788605,
0.3464966118335724,
0.4188459515571594,
0.2744631767272949,
-0.12488284707069397,
-0.024527179077267647,
0.218290299177169... |
func QueryUnlocatedGeoLocs() ([]*GeoLoc, error) {
locs := []*GeoLoc{}
// Get db
db, err := dstore.NewDB()
if err != nil {
return locs, fmt.Errorf("error retrieving database instance: %s",
err.Error())
}
// Query
rows, err := db.Query("SELECT id, raw FROM geo_locs WHERE located = " +
"false")
// Check ... | [
0.11013904213905334,
-0.10368217527866364,
0.5095112323760986,
-0.33692190051078796,
0.11949723213911057,
0.08915413171052933,
0.37662824988365173,
-0.18856628239154816,
0.0695061907172203,
-0.3102272152900696,
0.8291915655136108,
-0.3601911664009094,
-0.1298765391111374,
0.669881820678710... |
func (l *GeoLoc) Insert() error {
// Get db instance
db, err := dstore.NewDB()
if err != nil {
return fmt.Errorf("error retrieving DB instance: %s",
err.Error())
}
// Insert
var row *sql.Row
// Check if GeoLoc has been parsed
if l.Located {
// Check accuracy value
if l.Accuracy == AccuracyErr {
re... | [
-0.2628899812698364,
0.5560383796691895,
0.8534286618232727,
-0.5271275639533997,
0.016982238739728928,
0.3347975015640259,
0.4778479337692261,
0.09137048572301865,
0.06525440514087677,
-0.0922885313630104,
-0.3345237672328949,
-0.787659227848053,
-0.5516929626464844,
0.480297714471817,
... |
func NewMetrics(ns string) *Metrics {
res := &Metrics{
Info: promauto.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: ns,
Name: "info",
Help: "Informations about given repository, value always 1",
},
[]string{"module", "goversion"},
),
Deprecated: promauto.NewGaugeVec(
prometheus.... | [
-0.23881515860557556,
0.5335001349449158,
0.6109633445739746,
-0.9709804654121399,
0.39961180090904236,
-0.17926259338855743,
-0.427156925201416,
-0.6276727318763733,
-0.11048207432031631,
0.3508850038051605,
-0.06259894371032715,
0.6273747086524963,
0.03155973553657532,
0.3997251987457275... |
func setMutexProfileFraction(int) int { return 0 } | [
-0.4092792570590973,
0.2931375205516815,
0.437037855386734,
0.6332608461380005,
-0.2159081995487213,
-0.3710043132305145,
0.28440430760383606,
-0.4229567050933838,
0.6411925554275513,
-0.6617990732192993,
-0.7641274929046631,
-1.28543221950531,
-0.9975664615631104,
0.6126863360404968,
0.... |
func toLowerCase(str string) string {
var strBuilder strings.Builder
var r rune
var ch string // Holds the character to add to the builder
for _, c := range str {
if 'A' <= c && c <= 'Z' {
r = c - 'A' + 'a'
ch = string(r)
} else {
ch = string(c)
}
strBuilder.WriteString(ch)
}
lowerStr := strBuil... | [
0.34525883197784424,
-1.036501169204712,
0.4549240469932556,
-0.4058808386325836,
0.20216618478298187,
-0.2231782227754593,
0.3649580776691437,
-0.4274666905403137,
0.9864433407783508,
0.023198507726192474,
0.32176655530929565,
0.1099693700671196,
-1.1827025413513184,
-0.3088799715042114,
... |
func Contains(substr, operand string) bool { return strings.Contains(operand, substr) } | [
0.5626609325408936,
-1.0378913879394531,
0.24673569202423096,
0.06330665946006775,
-1.6353123188018799,
0.9830933213233948,
-0.7581360936164856,
-1.119829535484314,
-0.20907099545001984,
-0.40380558371543884,
0.6840991377830505,
1.5155422687530518,
0.11259600520133972,
-0.5765528678894043,... |
func ContainsAny(chars, operand string) bool { return strings.ContainsAny(operand, chars) } | [
-0.5606957077980042,
-0.7864709496498108,
0.40808385610580444,
0.1603184938430786,
-1.0523544549942017,
-0.538611888885498,
-1.4942145347595215,
-0.3576684892177582,
-0.6250707507133484,
-0.42531245946884155,
-0.09390232712030411,
0.6156061887741089,
-0.3123660981655121,
-0.670721232891082... |
func Count(str, operand string) int { return strings.Count(operand, str) } | [
0.6160609126091003,
-1.4708242416381836,
0.19521522521972656,
-0.3072158992290497,
-1.486464023590088,
0.550495982170105,
0.0807555764913559,
-0.19153140485286713,
-0.738227367401123,
0.713581383228302,
0.41697371006011963,
0.8279828429222107,
0.14502429962158203,
-0.4258035123348236,
1.... |
func Fields(operand string) []string { return strings.Fields(operand) } | [
-0.5811517834663391,
0.051948077976703644,
0.11156417429447174,
-1.2414326667785645,
-0.7844460010528564,
0.7577382922172546,
-0.3375082015991211,
-0.43817371129989624,
0.33476999402046204,
-0.06795387715101242,
-0.47685641050338745,
0.39366164803504944,
-0.42790308594703674,
-1.1761075258... |
func HasPrefix(prefix, operand string) bool { return strings.HasPrefix(operand, prefix) } | [
0.619669497013092,
-0.6400592923164368,
0.4982546865940094,
-0.12220121175050735,
-0.7680354118347168,
-0.7833450436592102,
-0.7722156047821045,
0.3871327042579651,
0.30419155955314636,
0.0012708386639133096,
0.1863514930009842,
1.076846718788147,
0.48220744729042053,
0.09910078346729279,
... |
func HasSuffix(suffix, operand string) bool { return strings.HasSuffix(operand, suffix) } | [
0.9325482249259949,
-0.2754669189453125,
0.4136026203632355,
0.24600981175899506,
-0.9968419671058655,
-0.3719688355922699,
-0.518297016620636,
1.0652236938476562,
-0.31282833218574524,
-0.5561392307281494,
-0.809211790561676,
1.2133169174194336,
0.5128072500228882,
0.3043917417526245,
0... |
func Index(substr, operand string) int { return strings.Index(operand, substr) } | [
0.2754831314086914,
-0.8430892825126648,
0.07901671528816223,
-0.239219531416893,
-1.373997688293457,
0.6400668025016785,
0.6826498508453369,
0.3401296138763428,
-0.6649445295333862,
0.46064621210098267,
0.6873453259468079,
1.6361640691757202,
-0.01268490869551897,
-1.4126832485198975,
0... |
func IndexAny(chars, operand string) int { return strings.IndexAny(operand, chars) } | [
-1.1382948160171509,
-0.7206444144248962,
0.17429812252521515,
0.2965482473373413,
-0.9527880549430847,
-1.3016988039016724,
-0.4592379629611969,
0.11717730760574341,
-0.6754183769226074,
-0.0439361110329628,
-0.11046743392944336,
0.7937807440757751,
-0.544618546962738,
-0.9014912247657776... |
func Join(sep string, operand []string) string { return strings.Join(operand, sep) } | [
0.694768488407135,
-0.3170170783996582,
0.43765437602996826,
0.5894173979759216,
-1.2156578302383423,
0.9211512804031372,
-0.820213258266449,
-0.5208384394645691,
-0.3660411238670349,
0.23073597252368927,
0.6804771423339844,
0.26048675179481506,
-0.5140998363494873,
-0.8423953652381897,
... |
func LastIndex(substr, operand string) int { return strings.LastIndex(operand, substr) } | [
-0.12851248681545258,
-0.6423476934432983,
0.398050993680954,
-0.42862945795059204,
-1.2692642211914062,
0.2838723659515381,
0.6130046248435974,
0.11264580488204956,
-0.03482744097709656,
-0.10078346729278564,
0.15110188722610474,
0.6598014831542969,
-0.2859407067298889,
-1.271257877349853... |
func LastIndexAny(chars, operand string) int { return strings.LastIndexAny(operand, chars) } | [
-1.5708119869232178,
-0.9515501260757446,
0.368309885263443,
-0.13049224019050598,
-0.8072225451469421,
-1.3740310668945312,
-0.15694306790828705,
0.09719325602054596,
0.04897698014974594,
0.028240399435162544,
-0.20582996308803558,
0.07929784804582596,
-0.7410262823104858,
-0.559676766395... |
func Lines(operand string) (lines []string, err error) {
// TODO: Give thought to eliminating error return
reader := strings.NewReader(operand)
scanner := bufio.NewScanner(reader)
for scanner.Scan() {
lines = append(lines, scanner.Text())
}
err = scanner.Err()
return
} | [
-0.6825845837593079,
-0.8309721350669861,
0.5225968956947327,
-0.185452401638031,
-1.1086481809616089,
0.6262103915214539,
-1.0158061981201172,
-0.2850746512413025,
0.13065849244594574,
-0.6651655435562134,
0.7947156429290771,
0.2059360295534134,
-0.4159526228904724,
-0.18812450766563416,
... |
func Quote(operand string) string { return strconv.Quote(operand) } | [
-0.42974984645843506,
-1.3013460636138916,
0.10305933654308319,
-0.19273075461387634,
-1.0466853380203247,
0.5835235714912415,
-0.7107388377189636,
-0.2372676134109497,
0.18412984907627106,
0.7727689146995544,
0.759574294090271,
1.085871934890747,
-0.062386684119701385,
-0.6941146850585938... |
func Repeat(count int, operand string) string { return strings.Repeat(operand, count) } | [
-0.11832965910434723,
-0.2284209132194519,
0.33195364475250244,
-0.42781907320022583,
-1.2508065700531006,
0.7453579306602478,
-0.3550376892089844,
-1.0478296279907227,
-0.8941066265106201,
0.5157227516174316,
0.29544299840927124,
0.34522855281829834,
-0.2027253955602646,
-1.73820233345031... |
func Replace(old, new string, n int, operand string) string {
return strings.Replace(operand, old, new, n)
} | [
-0.3677349388599396,
-0.6109316349029541,
0.29085901379585266,
-0.21138255298137665,
-1.4199881553649902,
-0.5448322892189026,
-0.8558445572853088,
0.05428280308842659,
-0.1331484019756317,
0.15987223386764526,
-0.26984864473342896,
0.22428108751773834,
-0.3525916039943695,
-0.660666286945... |
func Split(sep, operand string) []string { return strings.Split(operand, sep) } | [
-0.3101217448711395,
0.016265494748950005,
0.3006669580936432,
1.3271064758300781,
-0.815324068069458,
0.3798350393772125,
-0.3338780999183655,
-0.09544483572244644,
0.027257513254880905,
0.29803091287612915,
0.048490408807992935,
0.7005981802940369,
-0.30969610810279846,
-0.87605559825897... |
func SplitAfter(sep, operand string) []string { return strings.SplitAfter(operand, sep) } | [
0.081938736140728,
-0.40201523900032043,
0.3399369716644287,
1.0453834533691406,
-1.3716055154800415,
0.23809222877025604,
-0.5400561690330505,
0.05698910355567932,
0.5226978659629822,
-0.22989782691001892,
-0.48860424757003784,
0.046396404504776,
-0.03646424785256386,
-0.6451848149299622,... |
func SplitAfterN(sep string, n int, operand string) []string {
return strings.SplitAfterN(operand, sep, n)
} | [
-0.4915839731693268,
0.19063667953014374,
0.4186228811740875,
0.2183854877948761,
-1.8418420553207397,
-0.05365123599767685,
-0.3908821642398834,
-0.0209187101572752,
0.46977823972702026,
-0.6158084273338318,
-0.7359663844108582,
0.18121179938316345,
0.015543997287750244,
-0.32209074497222... |
func SplitN(sep string, n int, operand string) []string { return strings.SplitN(operand, sep, n) } | [
-0.9201423525810242,
-0.3271026015281677,
0.4825457036495209,
1.621726155281067,
-0.8303993344306946,
-0.7596950531005859,
-0.031136326491832733,
-0.14270560443401337,
0.24692489206790924,
-0.07094374299049377,
-0.7816594243049622,
-0.05662790685892105,
0.19205324351787567,
-0.381216406822... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.