text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (e Entry) Int64Default(def int64) (int64, error) {
v := e.ValueRaw
if v == nil {
return def, errFindParse.Format("int64", e.Key)
}
if vint64, ok := v.(int64); ok {
return vint64, nil
}
if vint, ok := v.(int); ok {
return int64(vint), nil
}
if vstring, sok := v.(string); sok {
return strconv.Pars... | [
-0.4348132908344269,
0.16674137115478516,
0.19671911001205444,
0.19172078371047974,
0.523288905620575,
-0.8595533967018127,
-0.7294110655784607,
0.7688856720924377,
0.4105454385280609,
0.6722182631492615,
0.06153421849012375,
0.2576022744178772,
-0.5506513714790344,
0.5810045003890991,
-... |
func (e Entry) Float64Default(def float64) (float64, error) {
v := e.ValueRaw
if v == nil {
return def, errFindParse.Format("float64", e.Key)
}
if vfloat32, ok := v.(float32); ok {
return float64(vfloat32), nil
}
if vfloat64, ok := v.(float64); ok {
return vfloat64, nil
}
if vint, ok := v.(int); ok {
... | [
0.3738633990287781,
0.37067729234695435,
0.3729575276374817,
0.3577701151371002,
0.5246824026107788,
-1.1695241928100586,
-0.542442798614502,
0.40586405992507935,
0.31731078028678894,
0.31094422936439514,
-0.11563001573085785,
0.1736927479505539,
-0.46087926626205444,
0.9602067470550537,
... |
func (e Entry) Float32Default(key string, def float32) (float32, error) {
v := e.ValueRaw
if v == nil {
return def, errFindParse.Format("float32", e.Key)
}
if vfloat32, ok := v.(float32); ok {
return vfloat32, nil
}
if vfloat64, ok := v.(float64); ok {
return float32(vfloat64), nil
}
if vint, ok := v.... | [
0.6897580623626709,
0.45593494176864624,
0.6051948666572571,
-0.36813539266586304,
0.36143237352371216,
-0.5208096504211426,
-0.9096142053604126,
-0.13882885873317719,
-0.2944243848323822,
0.3810272216796875,
-0.39087191224098206,
0.47557616233825684,
-0.5668957233428955,
0.826757848262786... |
func (e Entry) BoolDefault(def bool) (bool, error) {
v := e.ValueRaw
if v == nil {
return def, errFindParse.Format("bool", e.Key)
}
if vBoolean, ok := v.(bool); ok {
return vBoolean, nil
}
if vString, ok := v.(string); ok {
b, err := strconv.ParseBool(vString)
if err != nil {
return def, err
}
re... | [
-0.1461114138364792,
0.14124169945716858,
0.702150285243988,
0.02414875477552414,
-0.3100971579551697,
-0.45083731412887573,
-0.1560153216123581,
0.5210322141647339,
0.1806211620569229,
0.265717476606369,
-0.6985903382301331,
1.0502488613128662,
-0.5672949552536011,
0.5962635278701782,
-... |
func (e Entry) Value() interface{} {
if e.immutable {
// take its value, no pointer even if setted with a reference.
vv := reflect.Indirect(reflect.ValueOf(e.ValueRaw))
// return copy of that slice
if vv.Type().Kind() == reflect.Slice {
newSlice := reflect.MakeSlice(vv.Type(), vv.Len(), vv.Cap())
reflec... | [
-0.46121883392333984,
-0.32138994336128235,
0.6468068361282349,
-0.09625903517007828,
-0.330132395029068,
0.16829745471477509,
0.5016999840736389,
-0.06075448542833328,
1.2360576391220093,
0.35724252462387085,
0.5117527842521667,
1.1597156524658203,
0.11191565543413162,
0.5160107612609863,... |
func homePage(w http.ResponseWriter, r *http.Request){
fmt.Fprintf(w, "Welcome to the default page!")
fmt.Println("Endpoint Hit: root")
} | [
0.7106309533119202,
0.1638508439064026,
0.6545794606208801,
0.5833040475845337,
0.8553982973098755,
-0.1357949823141098,
0.44426852464675903,
0.08165087550878525,
-0.46938270330429077,
0.7185856103897095,
1.2406007051467896,
-0.1774473935365677,
-1.046644687652588,
-0.23925577104091644,
... |
func handleRequests() {
http.HandleFunc("/", homePage)
http.HandleFunc("/movies", getAllMoviesSortedDetails)
log.Fatal(http.ListenAndServe(":8081", nil))
} | [
-0.6250643134117126,
-0.21197381615638733,
0.31701743602752686,
0.8414660096168518,
1.044040560722351,
0.4627503454685211,
0.11135706305503845,
0.12896212935447693,
-0.27710533142089844,
-0.7434431910514832,
0.560635507106781,
0.05057144537568092,
-0.005989315919578075,
0.3630947172641754,... |
func NewController(
chopClient chopClientSet.Interface,
extClient apiExtensions.Interface,
kubeClient kube.Interface,
chopInformerFactory chopInformers.SharedInformerFactory,
kubeInformerFactory kubeInformers.SharedInformerFactory,
) *Controller {
// Initializations
_ = chopClientSetScheme.AddToScheme(scheme.Sc... | [
-0.010244425386190414,
0.15447913110256195,
0.5908960103988647,
0.16259844601154327,
0.2544722557067871,
-0.25545862317085266,
0.5659765601158142,
0.28926190733909607,
-0.10910538583993912,
-0.02762577496469021,
0.22404208779335022,
0.12473668903112411,
-0.2238602489233017,
0.8015997409820... |
func (c *Controller) isTrackedObject(objectMeta *metaV1.ObjectMeta) bool {
return chop.Config().IsWatchedNamespace(objectMeta.Namespace) && chopModels.IsCHOPGeneratedObject(objectMeta)
} | [
-0.06477484107017517,
-0.04696184769272804,
0.7845481634140015,
0.6434656381607056,
0.059123482555150986,
0.7635316252708435,
1.0673390626907349,
-0.6041860580444336,
-0.15152066946029663,
-0.10511565953493118,
-0.9685755372047424,
0.5993427634239197,
0.41061151027679443,
0.269747287034988... |
func (c *Controller) Run(ctx context.Context) {
defer utilRuntime.HandleCrash()
defer func() {
for i := range c.queues {
//c.queues[i].ShutDown()
c.queues[i].Close()
}
}()
log.V(1).Info("Starting ClickHouseInstallation controller")
if !waitForCacheSync(
ctx,
"ClickHouseInstallation",
c.chiListerSy... | [
-0.5559937953948975,
-0.23357811570167542,
0.8297101259231567,
0.7029141783714294,
1.1350619792938232,
0.031288422644138336,
0.8565911650657654,
0.4273136556148529,
-0.2786789834499359,
0.1990622580051422,
-0.36412733793258667,
-0.36346209049224854,
-0.42854753136634827,
0.6966016292572021... |
func (c *Controller) enqueueObject(obj queue.PriorityQueueItem) {
handle := []byte(obj.Handle().(string))
index := 0
enqueue := false
switch command := obj.(type) {
case *ReconcileCHI:
variants := len(c.queues) - chiV1.DefaultReconcileSystemThreadsNumber
index = chiV1.DefaultReconcileSystemThreadsNumber + util... | [
0.7684276700019836,
-0.27616575360298157,
0.702433168888092,
-0.10221163928508759,
0.955329954624176,
0.2109113484621048,
-0.48025816679000854,
-0.07223502546548843,
0.5737229585647583,
-0.22679631412029266,
-0.7484108209609985,
-0.02701008878648281,
-0.7739182710647583,
-0.061919353902339... |
func (c *Controller) patchCHIFinalizers(ctx context.Context, chi *chiV1.ClickHouseInstallation) error {
if util.IsContextDone(ctx) {
log.V(2).Info("task is done")
return nil
}
// TODO fix this with verbosity update
// Start Debug object
//js, err := json.MarshalIndent(chiV1, "", " ")
//if err != nil {
// l... | [
-0.5231431126594543,
-1.0603293180465698,
0.604468584060669,
-0.14181488752365112,
-0.027914199978113174,
0.37872254848480225,
0.39203864336013794,
0.3052707612514496,
0.11922241002321243,
0.78123939037323,
-0.6035307049751282,
0.1574351191520691,
-0.8021124005317688,
0.33220937848091125,
... |
func (c *Controller) updateCHIObjectStatus(ctx context.Context, chi *chiV1.ClickHouseInstallation, opts UpdateCHIStatusOptions) (err error) {
if util.IsContextDone(ctx) {
log.V(2).Info("task is done")
return nil
}
for retry, attempt := true, 1; retry; attempt++ {
if attempt >= 5 {
retry = false
}
err ... | [
-0.8045535683631897,
-0.6297426819801331,
0.5969883799552917,
0.5235183238983154,
0.28506338596343994,
0.5755406618118286,
0.2977883815765381,
-0.11522013694047928,
-0.025020822882652283,
1.108211636543274,
-0.8586395382881165,
0.24211901426315308,
-0.9519241452217102,
0.21253876388072968,... |
func (c *Controller) doUpdateCHIObjectStatus(ctx context.Context, chi *chiV1.ClickHouseInstallation, opts UpdateCHIStatusOptions) error {
if util.IsContextDone(ctx) {
log.V(2).Info("task is done")
return nil
}
namespace, name := util.NamespaceName(chi.ObjectMeta)
log.V(2).M(chi).F().Info("Update CHI status")
... | [
-0.684089720249176,
-1.5532151460647583,
0.6799654364585876,
0.5418714284896851,
-0.05077873542904854,
0.7265998721122742,
0.18236896395683289,
0.11712482571601868,
0.02528315596282482,
1.2357282638549805,
-0.6290315985679626,
0.37049582600593567,
-0.16900299489498138,
-0.22375065088272095... |
func (c *Controller) handleObject(obj interface{}) {
// TODO review
object, ok := obj.(metaV1.Object)
if !ok {
ts, ok := obj.(cache.DeletedFinalStateUnknown)
if !ok {
utilRuntime.HandleError(fmt.Errorf(messageUnableToDecode))
return
}
object, ok = ts.Obj.(metaV1.Object)
if !ok {
utilRuntime.Handle... | [
-0.08949975669384003,
-0.07162372767925262,
0.858553409576416,
0.4683021605014801,
0.7331425547599792,
0.14212854206562042,
0.9371121525764465,
0.18274444341659546,
0.5799514055252075,
0.41912785172462463,
0.19717401266098022,
-0.47726160287857056,
0.04501499608159065,
0.593319296836853,
... |
func waitForCacheSync(ctx context.Context, name string, cacheSyncs ...cache.InformerSynced) bool {
log.V(1).F().Info("Syncing caches for %s controller", name)
if !cache.WaitForCacheSync(ctx.Done(), cacheSyncs...) {
utilRuntime.HandleError(fmt.Errorf(messageUnableToSync, name))
return false
}
log.V(1).F().Info("... | [
-0.15950743854045868,
1.2388156652450562,
0.478280246257782,
0.3834095299243927,
-0.45071467757225037,
-0.25179657340049744,
-0.5097541213035583,
-0.0681890919804573,
-0.6319593787193298,
-0.2305486500263214,
-0.9316280484199524,
-0.6438039541244507,
0.9250421524047852,
0.30418160557746887... |
func Load() Config {
if config != nil {
return *config
}
file, e := ioutil.ReadFile(getFilename())
if e != nil {
log.Fatalf("Error while reading config file: %v\n", e)
}
config = &Config{}
if json.Unmarshal(file, config) != nil {
log.Fatalf("Error while parsing config file: %v\n", e)
}
return *config
} | [
-0.23840957880020142,
-0.5860917568206787,
0.5354607105255127,
-0.6027560234069824,
-0.4705602526664734,
-0.30068159103393555,
-0.438818097114563,
0.3357495963573456,
-0.855071485042572,
0.43210136890411377,
-0.1781904399394989,
-0.3948120176792145,
-0.3589577078819275,
-0.2798030972480774... |
func (config *Config) LoadAPIKey() {
config.MasterWorker.APIKeys.OpenExchangeRates = getOpenExchangeRatesAPIKey()
} | [
-0.2530151903629303,
0.17965608835220337,
0.2932564914226532,
-0.12273457646369934,
-0.027407128363847733,
-0.3868387043476105,
-0.37823209166526794,
1.01112961769104,
0.33564770221710205,
1.2537317276000977,
-0.5493840575218201,
-0.2734646499156952,
-0.814010739326477,
0.6562448143959045,... |
func Tabla(valor int) func() int {
// datos fuera de la funcion
numero := valor
secuencia := 0
return func() int {
secuencia++
return numero * secuencia
}
} | [
0.397658109664917,
0.6461697220802307,
0.6119257211685181,
1.352942705154419,
-0.012791214510798454,
0.3232298195362091,
0.6588689684867859,
-0.23531869053840637,
-0.448511004447937,
-0.4728781580924988,
-0.7385455369949341,
-0.06854739040136337,
0.848693311214447,
-0.5112915635108948,
0... |
func (cc *Chaincode) InstallChaincode(name, version, path, peer, org string) error {
var err error
defer func(now time.Time) {
if err == nil {
common.TrackCount(CC_INSTALL, 1)
common.TrackTime(now, CC_INSTALL)
}
}(time.Now())
var ccPkg *resource.CCPackage
if (lang == "node") {
ccPkg, err = packager.New... | [
-0.10159456729888916,
-0.8056575655937195,
0.9496150016784668,
-0.3405319154262543,
0.24355311691761017,
-0.371574342250824,
0.05124291405081749,
0.1685730665922165,
-0.825659453868866,
0.9232699275016785,
-0.27548664808273315,
-0.5186980366706848,
-0.7530975937843323,
0.21365965902805328,... |
func TestParsingVariable(t *testing.T) {
ast := Node{Token: "OP_AND", Row: 3, Col: 1, Data: map[string]interface{}{
"LeftHandSide": Node{Token: "IDENTIFIER", Row: 1, Col: 1, Data: map[string]interface{}{"Value": "a"}},
"RightHandSide": Node{Token: "BOOL", Row: 7, Col: 1, Data: map[string]interface{}{"Value": ... | [
0.6437522172927856,
0.13448791205883026,
0.6937408447265625,
-0.12399495393037796,
-0.07758985459804535,
-0.3599955439567566,
0.4605545401573181,
-0.5475841164588928,
-0.31614673137664795,
0.4679802656173706,
-0.22922268509864807,
0.32180672883987427,
-1.3761738538742065,
0.701216876506805... |
func TestAssigningVariable(t *testing.T) {
ast := []Node{
Node{Token: "ASSIGNMENT", Row: 3, Col: 1, Data: map[string]interface{}{"Names": "a", "Values": []Node{}}},
Node{Token: "BOOL", Row: 3, Col: 1, Data: map[string]interface{}{"Value": true}},
}
stack := []*StackFrame{
&StackFrame{
Variables... | [
0.10843033343553543,
0.06811704486608505,
0.548276960849762,
-0.03902479261159897,
-0.23397552967071533,
-0.3272216022014618,
0.5897753238677979,
-0.4372817575931549,
-0.19517381489276886,
0.6407185196876526,
-0.17146596312522888,
0.7428982853889465,
-0.9855256676673889,
0.739296019077301,... |
func TestAssigningVariableToInvokedBlock(t *testing.T) {
ast := []Node{
Node{Token: "ASSIGNMENT", Row: 3, Col: 1, Data: map[string]interface{}{"Names": "a", "Values": []Node{}}},
Node{
Token: "INVOCATION",
Row: 3,
Col: 1,
Data: map[string]interface{}{"Name": "foo"},
Children: &[]... | [
0.46468886733055115,
0.21598634123802185,
0.8547717332839966,
-0.07375019788742065,
0.05129805579781532,
-0.2996993064880371,
0.7899475693702698,
-0.5272157192230225,
-1.0070583820343018,
0.35957062244415283,
-0.6513106226921082,
1.0287926197052002,
-1.1889033317565918,
0.9545743465423584,... |
func TestAssigningVariableToInvokedBlockWithMultipleValues(t *testing.T) {
ast := []Node{
Node{Token: "ASSIGNMENT", Row: 3, Col: 1, Data: map[string]interface{}{"Names": "a b", "Values": []Node{}}},
Node{
Token: "INVOCATION",
Row: 3,
Col: 1,
Data: map[string]interface{}{"Name": "foo"},... | [
0.29851895570755005,
0.25701749324798584,
0.909930944442749,
0.2321246713399887,
-0.0469355583190918,
-0.16727524995803833,
0.6011396050453186,
-0.36200767755508423,
-1.0927252769470215,
0.31458887457847595,
-0.7692020535469055,
0.7948469519615173,
-1.0674515962600708,
1.14048171043396,
... |
func TestAssigningVariableToInvokedBlockWithMultipleValuesAcrossMultipleTokens(t *testing.T) {
ast := []Node{
Node{
Token: "ASSIGNMENT",
Row: 3,
Col: 1,
Data: map[string]interface{}{
"Names": "a b c",
"Values": []Node{},
},
},
Node{
Token: "INVOCATION",
... | [
0.5532922148704529,
0.2545250654220581,
0.9398069381713867,
0.0020364576485008,
-0.30761459469795227,
-0.149721160531044,
0.32991841435432434,
-0.36823102831840515,
-0.9355447292327881,
0.3540915846824646,
-0.9101023077964783,
0.7733466029167175,
-1.1755716800689697,
1.0952192544937134,
... |
func TestAssigningVariableToInvokedBlockWithMultipleValuesAcrossMultipleInvocations(t *testing.T) {
ast := []Node{
Node{
Token: "ASSIGNMENT",
Row: 3,
Col: 1,
Data: map[string]interface{}{
"Names": "a b c d",
"Values": []Node{},
},
},
Node{
Token: "INVOCA... | [
0.5462465882301331,
0.2849201560020447,
0.9562764763832092,
0.11321420222520828,
-0.45339566469192505,
-0.40502384305000305,
0.4603743553161621,
-0.2786821722984314,
-0.8853986263275146,
0.28731822967529297,
-0.3414645493030548,
0.5686337351799011,
-1.0299257040023804,
1.036219835281372,
... |
func TestThrowawayVariable(t *testing.T) {
ast := []Node{
Node{Token: "ASSIGNMENT", Row: 3, Col: 1, Data: map[string]interface{}{"Names": "_ b", "Values": []Node{}}},
Node{
Token: "INVOCATION",
Row: 3,
Col: 1,
Data: map[string]interface{}{"Name": "foo"},
Children: &[]Node{
... | [
0.5966575741767883,
0.4777001142501831,
0.8733938932418823,
-0.22616499662399292,
-0.3041408061981201,
0.012757903896272182,
0.7226254343986511,
-0.3808844983577728,
-1.0387511253356934,
0.577961266040802,
-0.45083141326904297,
1.0805583000183105,
-1.0829048156738281,
0.48354944586753845,
... |
func Load(filename string) (*Config, error) {
b, err := ioutil.ReadFile(filename)
if err != nil {
return nil, err
}
var config Config
if err = yaml.Unmarshal(b, &config); err != nil {
return nil, err
}
return &config, nil
} | [
-0.04386236146092415,
-0.2733192443847656,
0.47062957286834717,
-0.7315244078636169,
-0.7534042596817017,
-0.4828643798828125,
-0.26912009716033936,
0.968258798122406,
-0.8902680277824402,
0.3779528737068176,
-0.5657433271408081,
-0.31243398785591125,
-0.6101471185684204,
-0.08914861083030... |
func NewConfig(file string) (*Config, error) {
var c Config
if file != "" {
cf, err := os.Open(file)
json.NewDecoder(cf).Decode(&c)
return &c, err
}
return &c, nil
} | [
0.18760670721530914,
-0.5472398996353149,
0.4382997453212738,
0.06345192342996597,
-0.824904203414917,
0.22672419250011444,
-0.16381599009037018,
1.1282685995101929,
-1.060094952583313,
0.5265389680862427,
-0.4006633460521698,
0.15752339363098145,
0.37446078658103943,
0.22646048665046692,
... |
func NewServer() *Server {
return &Server{}
} | [
-0.7622126936912537,
-1.584428071975708,
-0.03427664190530777,
0.3811868727207184,
-0.5363913774490356,
0.4495236575603485,
-0.00183027982711792,
-0.1160312369465828,
0.42289429903030396,
-0.9896654486656189,
-0.6258680820465088,
0.9771565198898315,
-1.1222662925720215,
0.24504299461841583... |
func (server *Server) Accept(lis net.Listener) {
for {
conn, err := lis.Accept()
if err != nil {
log.Println("rpc server: accept error:", err)
return
}
// 每个connection使用一个goroutine来handle
go server.ServeConn(conn)
}
} | [
-1.0053741931915283,
-0.5488133430480957,
0.8720409870147705,
-0.05222676321864128,
0.2460417002439499,
1.2369227409362793,
-0.06664107739925385,
0.29377827048301697,
-1.015337586402893,
0.5100358724594116,
-0.28392624855041504,
-0.35834914445877075,
-1.4485708475112915,
1.3791407346725464... |
func Accept(lis net.Listener) { DefaultServer.Accept(lis) } | [
-1.0081592798233032,
0.0347229540348053,
0.31320270895957947,
0.005808589048683643,
0.00021803095296490937,
1.6045202016830444,
0.04422954469919205,
0.3769201636314392,
-0.350582093000412,
0.427324116230011,
-0.8235624432563782,
-0.4581198990345001,
-0.8356187343597412,
1.979851484298706,
... |
func (d *Domus) Login() error {
resp, err := d.Get("/Mobile/Login", map[string]string{
"site_key": string(d.config.SiteKey),
"user_key": string(d.config.UserKey),
"password": d.config.Password,
})
if err != nil {
return err
}
defer resp.Body.Close()
var n int
body := make([]byte, sessionKeyLen+10)
if n,... | [
-0.8218307495117188,
0.021743394434452057,
0.6941811442375183,
0.4336473047733307,
-0.6637608408927917,
-0.4551072120666504,
-0.434219092130661,
-0.26340967416763306,
0.6969823837280273,
-0.035424597561359406,
-0.684955358505249,
0.8123205304145813,
0.11811026930809021,
-0.291451096534729,... |
func (d *Domus) LoginInfos() (LoginInfos, error) {
var infos LoginInfos
resp, err := d.Get("/Mobile/LoginInfos", map[string]string{
"site_key": string(d.config.SiteKey),
"user_key": string(d.config.UserKey),
"password": d.config.Password,
})
if err != nil {
return infos, err
}
defer resp.Body.Close()
if ... | [
-1.3346236944198608,
-0.6225152015686035,
0.6439105272293091,
0.2513863742351532,
-1.225097894668579,
-0.5889072418212891,
-1.2049721479415894,
-1.1279546022415161,
0.6103055477142334,
-0.14357806742191315,
-1.3597581386566162,
0.6552985310554504,
-0.24781781435012817,
-0.4479218125343323,... |
func (mm *MutexMap) Lock(key string) func() {
mm.self.Lock()
if mm.entries == nil {
mm.entries = make(map[string]*sync.Mutex)
}
if _, found := mm.entries[key]; !found {
mm.entries[key] = &sync.Mutex{}
}
entry := mm.entries[key]
entry.Lock()
mm.self.Unlock()
return entry.Unlock
} | [
-0.47340288758277893,
0.1851091831922531,
0.45968353748321533,
-0.2096814513206482,
-0.8261860609054565,
-0.6985570788383484,
0.5430522561073303,
-0.5345701575279236,
0.9393438696861267,
-0.374560683965683,
-0.027798762544989586,
-0.45214220881462097,
-0.9415687918663025,
-0.21360148489475... |
func ExecCmdAndGetOutput(cmd string) string {
fields, err := shlex.Split(cmd)
if err != nil {
log.Fatal(err)
}
bytes, err := exec.Command(fields[0], fields[1:]...).Output() // waits for it to complete
s := strings.TrimSpace(string(bytes))
if err != nil {
log.Fatal(err)
}
return s
} | [
0.3448299765586853,
-0.5473024845123291,
0.3905943036079407,
-0.2644445300102234,
-1.0363500118255615,
-0.6310551166534424,
0.23424124717712402,
-0.8283728361129761,
-0.45047610998153687,
-0.5386085510253906,
0.1901991218328476,
-0.39413782954216003,
-0.03614591434597969,
0.572494626045227... |
func ExecCmdAndSeeOutput(command string) {
fields, err := shlex.Split(command)
if err != nil {
log.Fatal(err)
}
cmd := exec.Command(fields[0], fields[1:]...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err = cmd.Run() // waits for it to complete
if err != nil {
log.Fatal(err)
}
} | [
0.4758893549442291,
-0.48079073429107666,
0.7986656427383423,
-0.4111136198043823,
-0.23802544176578522,
-0.18031486868858337,
0.1444794088602066,
-0.021481871604919434,
0.2518083453178406,
-0.7248238921165466,
-0.20027229189872742,
0.06863755732774734,
0.49920499324798584,
0.5636816620826... |
func ExecCmdWithoutOutput(command string) {
fields, err := shlex.Split(command)
if err != nil {
log.Fatal(err)
}
cmd := exec.Command(fields[0], fields[1:]...)
err = cmd.Run() // waits for it to complete
if err != nil {
log.Fatal(err)
}
} | [
0.14753404259681702,
-0.874305009841919,
0.7393783330917358,
-0.004146639723330736,
-0.1563122570514679,
0.6184924244880676,
0.4102005064487457,
-0.04808657616376877,
-0.3399015963077545,
-0.9746332764625549,
0.028754299506545067,
-0.46589747071266174,
0.12382753938436508,
0.60233402252197... |
func ExecCmdWithoutOutputOnWindows(fields []string) {
cmd := exec.Command(fields[0], fields[1:]...)
err := cmd.Run()
if err != nil {
log.Fatal(err)
}
} | [
0.25944116711616516,
-1.2803659439086914,
0.6530206203460693,
0.7328649759292603,
-0.17728064954280853,
1.0099951028823853,
0.6228981018066406,
-0.15677504241466522,
-1.0892188549041748,
-0.15810564160346985,
-0.04000958055257797,
-0.2366659790277481,
-0.797585129737854,
1.3434842824935913... |
func ExecCmdInBackground(command string) {
if IsWindows() {
// it'll start the command in the background
fields := []string{"cmd.exe", "/C", "start", "/b", "", command}
ExecCmdWithoutOutputOnWindows(fields)
} else {
newCommand := fmt.Sprintf("sh -c \"%s &\"", command)
ExecCmdWithoutOutput(newCommand)
}
} | [
0.8526706695556641,
-0.7156356573104858,
0.9011268615722656,
0.6026253700256348,
-0.32308465242385864,
0.5821344256401062,
0.45371267199516296,
0.7038906812667847,
0.24696528911590576,
0.049375779926776886,
0.4795003831386566,
0.9740148782730103,
-1.1848111152648926,
1.1765273809432983,
... |
func (r *UnitOfMeasureRequest) Get(ctx context.Context) (resObj *UnitOfMeasure, err error) {
var query string
if r.query != nil {
query = "?" + r.query.Encode()
}
err = r.JSONRequest(ctx, "GET", query, nil, &resObj)
return
} | [
-0.8828480839729309,
0.17176629602909088,
0.5402315258979797,
-0.6667702198028564,
0.6620926260948181,
-0.7478692531585693,
-0.04064576327800751,
-0.9456473588943481,
0.5542723536491394,
-0.681962788105011,
0.5746124982833862,
-0.06573878973722458,
-0.22161754965782166,
0.05885002017021179... |
func (r *UnitOfMeasureRequest) Update(ctx context.Context, reqObj *UnitOfMeasure) error {
return r.JSONRequest(ctx, "PATCH", "", reqObj, nil)
} | [
-0.9450358152389526,
-0.8892021179199219,
0.3329244554042816,
-0.387638121843338,
0.1700202375650406,
0.4356069564819336,
0.3808574676513672,
-0.8603762984275818,
0.7708922028541565,
-0.4011119306087494,
0.42873305082321167,
-0.0762324333190918,
-0.31621378660202026,
0.44810158014297485,
... |
func (r *UnitOfMeasureRequest) Delete(ctx context.Context) error {
return r.JSONRequest(ctx, "DELETE", "", nil, nil)
} | [
-0.3280922770500183,
0.4036156237125397,
0.5036476254463196,
-0.22713756561279297,
0.9718701839447021,
-0.3651382327079773,
0.12300283461809158,
-0.6236157417297363,
0.7649056911468506,
-0.23839721083641052,
0.9264866709709167,
0.3027256429195404,
-0.3749410808086395,
0.8187240958213806,
... |
func (m *EUIBlock) BeforeAppendModel(ctx context.Context, query bun.Query) error {
if err := m.Model.BeforeAppendModel(ctx, query); err != nil {
return err
}
return nil
} | [
0.039627555757761,
0.4216024875640869,
0.6141809821128845,
-0.02416955679655075,
0.22263121604919434,
0.4868062734603882,
-0.20643596351146698,
-1.0334339141845703,
-0.17047372460365295,
0.8517134189605713,
0.5586976408958435,
-0.9387375116348267,
-0.2637377381324768,
1.663793921470642,
... |
func (f *Finding) Normalize() error {
if f.Category == "" {
return fmt.Errorf("category must be set for finding: %#+v", f)
}
if f.Message == "" {
return fmt.Errorf("message must be set for finding: %#+v", f)
}
// It's okay for Path to not be set, in which case the finding will be
// interpreted as applying ... | [
-0.37939855456352234,
-0.06298600882291794,
0.7926937937736511,
-0.17193931341171265,
0.03451377898454666,
-0.8219041228294373,
0.7386027574539185,
-0.6463176608085632,
-0.857571005821228,
-0.22813785076141357,
1.0856637954711914,
0.17077788710594177,
-0.10148546099662781,
0.74854046106338... |
func BuildPathToCheckoutPath(path, buildDir, checkoutDir string) (string, error) {
absPath := filepath.Clean(filepath.Join(buildDir, path))
path, err := filepath.Rel(checkoutDir, absPath)
if err != nil {
return "", err
}
return filepath.ToSlash(path), nil
} | [
0.30059266090393066,
-0.6292961239814758,
0.5330405831336975,
0.22042402625083923,
-0.35176995396614075,
0.6448274850845337,
0.8503525257110596,
0.052073389291763306,
-0.04948922619223595,
0.5262789130210876,
0.41759738326072693,
-0.08236096799373627,
0.1427064836025238,
-0.240859091281890... |
func (c *Client) BuildQueryRequest(ctx context.Context, v interface{}) (*http.Request, error) {
u := &url.URL{Scheme: c.scheme, Host: c.host, Path: QueryResourcePath()}
req, err := http.NewRequest("GET", u.String(), nil)
if err != nil {
return nil, goahttp.ErrInvalidURL("resource", "Query", u.String(), err)
}
if... | [
-0.9818770289421082,
-0.46495240926742554,
0.48577868938446045,
-0.3665259778499603,
-0.18452520668506622,
-0.2697702646255493,
0.003494203556329012,
0.0193959828466177,
0.3585834503173828,
-0.13410770893096924,
0.1586940437555313,
1.011662483215332,
-0.013767411932349205,
-0.1033415049314... |
func EncodeQueryRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
return func(req *http.Request, v interface{}) error {
p, ok := v.(*resource.QueryPayload)
if !ok {
return goahttp.ErrInvalidType("resource", "Query", "*resource.QueryPayload", v)
}
values := req.URL... | [
-0.5017274618148804,
-0.4491615891456604,
0.5167320370674133,
-0.5387367010116577,
-0.557547390460968,
0.2053353488445282,
-0.826945960521698,
-0.46819937229156494,
-0.36352482438087463,
-0.1379430592060089,
-0.21351167559623718,
0.3994606137275696,
0.6074784994125366,
0.6665447354316711,
... |
func (c *Client) BuildListRequest(ctx context.Context, v interface{}) (*http.Request, error) {
u := &url.URL{Scheme: c.scheme, Host: c.host, Path: ListResourcePath()}
req, err := http.NewRequest("GET", u.String(), nil)
if err != nil {
return nil, goahttp.ErrInvalidURL("resource", "List", u.String(), err)
}
if ct... | [
-1.3204933404922485,
-0.43834954500198364,
0.7718911170959473,
-0.2856757640838623,
-0.05949755385518074,
-0.855481743812561,
-0.3051186501979828,
0.44206634163856506,
0.9906567931175232,
0.25968024134635925,
-0.29722854495048523,
0.756637454032898,
0.07666861265897751,
0.12591741979122162... |
func EncodeListRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
return func(req *http.Request, v interface{}) error {
p, ok := v.(*resource.ListPayload)
if !ok {
return goahttp.ErrInvalidType("resource", "List", "*resource.ListPayload", v)
}
values := req.URL.Que... | [
-0.6630964279174805,
-0.3716283440589905,
0.7792141437530518,
-0.2998908758163452,
-0.7894262075424194,
-0.07814215123653412,
-0.7753193974494934,
0.05850232020020485,
1.0135111808776855,
0.13575735688209534,
-0.12727640569210052,
0.4749161899089813,
0.6035155653953552,
0.8941406607627869,... |
func (c *Client) BuildVersionsByIDRequest(ctx context.Context, v interface{}) (*http.Request, error) {
var (
id uint
)
{
p, ok := v.(*resource.VersionsByIDPayload)
if !ok {
return nil, goahttp.ErrInvalidType("resource", "VersionsByID", "*resource.VersionsByIDPayload", v)
}
id = p.ID
}
u := &url.URL{Sc... | [
-0.9424769878387451,
-0.41736453771591187,
0.40485966205596924,
-0.49919766187667847,
-0.09538783878087997,
-0.10879308730363846,
-0.06874247640371323,
-1.2617257833480835,
0.781963586807251,
0.2768893539905548,
0.38200798630714417,
0.5005961060523987,
-0.09707963466644287,
0.3077471554279... |
func (c *Client) BuildByCatalogKindNameVersionRequest(ctx context.Context, v interface{}) (*http.Request, error) {
var (
catalog string
kind string
name string
version string
)
{
p, ok := v.(*resource.ByCatalogKindNameVersionPayload)
if !ok {
return nil, goahttp.ErrInvalidType("resource", "ByCat... | [
-1.0911463499069214,
-0.892562985420227,
0.27733367681503296,
-0.2465791553258896,
-0.3635443449020386,
-0.45442962646484375,
-0.683657705783844,
-0.7103688716888428,
-0.4124622941017151,
0.8802570104598999,
-0.1267484724521637,
1.099529504776001,
-0.2792609632015228,
-0.04047633707523346,... |
func (c *Client) BuildByCatalogKindNameVersionReadmeRequest(ctx context.Context, v interface{}) (*http.Request, error) {
var (
catalog string
kind string
name string
version string
)
{
p, ok := v.(*resource.ByCatalogKindNameVersionReadmePayload)
if !ok {
return nil, goahttp.ErrInvalidType("resou... | [
-1.523496389389038,
-1.0167039632797241,
0.4078693389892578,
-0.5520628094673157,
-0.44776517152786255,
-0.3065190613269806,
-1.0385141372680664,
-0.11294075101613998,
-0.15471990406513214,
0.7237408757209778,
0.5693498253822327,
0.9259173274040222,
-0.49708321690559387,
-0.232535973191261... |
func (c *Client) BuildByCatalogKindNameVersionYamlRequest(ctx context.Context, v interface{}) (*http.Request, error) {
var (
catalog string
kind string
name string
version string
)
{
p, ok := v.(*resource.ByCatalogKindNameVersionYamlPayload)
if !ok {
return nil, goahttp.ErrInvalidType("resource"... | [
-0.6241859197616577,
-1.1353899240493774,
0.5815361738204956,
-0.5867006182670593,
-0.36633989214897156,
-0.5899131298065186,
-0.5696013569831848,
-0.027269314974546432,
-0.03546012565493584,
0.5964415669441223,
-0.14953017234802246,
1.1685324907302856,
0.20968425273895264,
0.0604958944022... |
func (c *Client) BuildByVersionIDRequest(ctx context.Context, v interface{}) (*http.Request, error) {
var (
versionID uint
)
{
p, ok := v.(*resource.ByVersionIDPayload)
if !ok {
return nil, goahttp.ErrInvalidType("resource", "ByVersionId", "*resource.ByVersionIDPayload", v)
}
versionID = p.VersionID
}
... | [
-0.8176085352897644,
-1.061094045639038,
0.36099374294281006,
-0.26508447527885437,
-0.2772480249404907,
-0.5161395072937012,
0.07725007086992264,
-0.7240566611289978,
0.4107804000377655,
0.3461862802505493,
0.2593567669391632,
1.0423493385314941,
-0.4323364198207855,
-0.19218535721302032,... |
func (c *Client) BuildByCatalogKindNameRequest(ctx context.Context, v interface{}) (*http.Request, error) {
var (
catalog string
kind string
name string
)
{
p, ok := v.(*resource.ByCatalogKindNamePayload)
if !ok {
return nil, goahttp.ErrInvalidType("resource", "ByCatalogKindName", "*resource.ByCat... | [
-1.2382054328918457,
-0.6177553534507751,
0.3483634889125824,
-0.7886437177658081,
-0.24682512879371643,
-0.6038133502006531,
-0.6734933853149414,
-0.7742934226989746,
-0.23822903633117676,
0.5464159250259399,
0.3237294852733612,
1.362855076789856,
-0.06559689342975616,
0.40376046299934387... |
func EncodeByCatalogKindNameRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {
return func(req *http.Request, v interface{}) error {
p, ok := v.(*resource.ByCatalogKindNamePayload)
if !ok {
return goahttp.ErrInvalidType("resource", "ByCatalogKindName", "*resource.ByCat... | [
-1.2095341682434082,
-0.32012802362442017,
0.18334907293319702,
-0.8154031038284302,
-0.443235844373703,
0.012674056924879551,
-0.958012044429779,
-0.8098075985908508,
-0.40163472294807434,
0.6180345416069031,
0.22362811863422394,
0.8837436437606812,
0.5306013822555542,
0.9652013778686523,... |
func (c *Client) BuildByIDRequest(ctx context.Context, v interface{}) (*http.Request, error) {
var (
id uint
)
{
p, ok := v.(*resource.ByIDPayload)
if !ok {
return nil, goahttp.ErrInvalidType("resource", "ById", "*resource.ByIDPayload", v)
}
id = p.ID
}
u := &url.URL{Scheme: c.scheme, Host: c.host, Pa... | [
-0.596713662147522,
-0.7635055780410767,
0.49577927589416504,
-0.6854559183120728,
-0.1993103325366974,
-0.5963671207427979,
0.29785066843032837,
-0.7226357460021973,
0.6290256381034851,
-0.34911489486694336,
0.09056282043457031,
1.1382595300674438,
-0.20105017721652985,
-0.337341219186782... |
func (c *Client) BuildGetRawYamlByCatalogKindNameVersionRequest(ctx context.Context, v interface{}) (*http.Request, error) {
var (
catalog string
kind string
name string
version string
)
{
p, ok := v.(*resource.GetRawYamlByCatalogKindNameVersionPayload)
if !ok {
return nil, goahttp.ErrInvalidTyp... | [
-1.0935556888580322,
-0.8460969924926758,
0.5423779487609863,
-0.4907580018043518,
-0.5439005494117737,
-0.6526179313659668,
-0.6411824822425842,
-0.4827495813369751,
-0.2556646168231964,
0.49112415313720703,
-0.261149525642395,
1.2117390632629395,
0.10676247626543045,
0.12862031161785126,... |
func (c *Client) BuildGetLatestRawYamlByCatalogKindNameRequest(ctx context.Context, v interface{}) (*http.Request, error) {
var (
catalog string
kind string
name string
)
{
p, ok := v.(*resource.GetLatestRawYamlByCatalogKindNamePayload)
if !ok {
return nil, goahttp.ErrInvalidType("resource", "GetL... | [
-1.1941953897476196,
-0.664082944393158,
0.6377101540565491,
-0.6958864331245422,
0.25046950578689575,
-0.5840550065040588,
-0.7671687602996826,
-0.6279634833335876,
-0.21282441914081573,
0.5394942164421082,
0.027953023090958595,
1.120443344116211,
-0.004760060925036669,
0.6808053255081177... |
func unmarshalResourceDataResponseBodyToResourceviewsResourceDataView(v *ResourceDataResponseBody) *resourceviews.ResourceDataView {
res := &resourceviews.ResourceDataView{
ID: v.ID,
Name: v.Name,
Kind: v.Kind,
HubURLPath: v.HubURLPath,
HubRawURLPath: v.HubRawURLPath,
Rating... | [
0.14053505659103394,
-0.26505130529403687,
0.15859849750995636,
-1.5935481786727905,
-0.69241863489151,
0.08103552460670471,
-0.09743894636631012,
0.08257313817739487,
0.215498149394989,
-0.3313326835632324,
0.008401178754866123,
-0.37648943066596985,
-0.08750486373901367,
-0.0050408584065... |
func unmarshalCatalogResponseBodyToResourceviewsCatalogView(v *CatalogResponseBody) *resourceviews.CatalogView {
res := &resourceviews.CatalogView{
ID: v.ID,
Name: v.Name,
Type: v.Type,
URL: v.URL,
Provider: v.Provider,
}
return res
} | [
0.5622187852859497,
0.2797682285308838,
0.35922420024871826,
-1.4771299362182617,
-1.0543291568756104,
-0.28776299953460693,
-1.0396876335144043,
0.47932669520378113,
0.3038159906864166,
-0.08050338923931122,
0.46327126026153564,
0.1234729215502739,
1.3784806728363037,
-0.8191671967506409,... |
func unmarshalCategoryResponseBodyToResourceviewsCategoryView(v *CategoryResponseBody) *resourceviews.CategoryView {
res := &resourceviews.CategoryView{
ID: v.ID,
Name: v.Name,
}
return res
} | [
0.20986126363277435,
-0.08807165920734406,
0.23870854079723358,
-1.223409652709961,
-1.0672177076339722,
-0.5891713500022888,
-0.12354621291160583,
-0.3877085745334625,
0.5928740501403809,
-0.7469969391822815,
0.6482487320899963,
-0.1503298133611679,
1.3002606630325317,
-0.3758766651153564... |
func unmarshalResourceVersionDataResponseBodyToResourceviewsResourceVersionDataView(v *ResourceVersionDataResponseBody) *resourceviews.ResourceVersionDataView {
res := &resourceviews.ResourceVersionDataView{
ID: v.ID,
Version: v.Version,
DisplayName: v.DisplayName,
Deprecat... | [
0.07164065539836884,
-0.39723101258277893,
0.07641054689884186,
-1.0807902812957764,
-0.9120548963546753,
-0.24478405714035034,
-0.06655526161193848,
-0.07082540541887283,
0.2015535682439804,
-0.3201858699321747,
-0.08831790089607239,
-0.5932193398475647,
-0.0890202596783638,
-0.0062261838... |
func unmarshalPlatformResponseBodyToResourceviewsPlatformView(v *PlatformResponseBody) *resourceviews.PlatformView {
res := &resourceviews.PlatformView{
ID: v.ID,
Name: v.Name,
}
return res
} | [
0.41618818044662476,
-0.3315649628639221,
0.17189013957977295,
-1.0943987369537354,
-1.2234731912612915,
0.13230375945568085,
-0.18106336891651154,
0.46229779720306396,
0.10130411386489868,
-0.5688571929931641,
0.37827804684638977,
-1.2104287147521973,
-0.4733544588088989,
-0.2701475620269... |
func unmarshalTagResponseBodyToResourceviewsTagView(v *TagResponseBody) *resourceviews.TagView {
res := &resourceviews.TagView{
ID: v.ID,
Name: v.Name,
}
return res
} | [
-0.1437196135520935,
0.10118181258440018,
0.2512523829936981,
-1.6664105653762817,
-0.6307124495506287,
-0.5828754901885986,
-0.5755918025970459,
-0.44452419877052307,
-0.5690421462059021,
-0.24872583150863647,
0.036208365112543106,
-0.7073025703430176,
0.5951957702636719,
-0.5338597893714... |
func unmarshalVersionsResponseBodyToResourceviewsVersionsView(v *VersionsResponseBody) *resourceviews.VersionsView {
res := &resourceviews.VersionsView{}
res.Latest = unmarshalResourceVersionDataResponseBodyToResourceviewsResourceVersionDataView(v.Latest)
res.Versions = make([]*resourceviews.ResourceVersionDataView,... | [
-0.04671020060777664,
-0.0788368284702301,
-0.05979352816939354,
-1.4265848398208618,
-0.5871006846427917,
-0.13837166130542755,
-0.2091107964515686,
-0.38797318935394287,
0.920147180557251,
0.01972336508333683,
0.47949469089508057,
-0.9978392124176025,
0.4083802402019501,
-0.3968372046947... |
func unmarshalResourceContentResponseBodyToResourceviewsResourceContentView(v *ResourceContentResponseBody) *resourceviews.ResourceContentView {
res := &resourceviews.ResourceContentView{
Readme: v.Readme,
Yaml: v.Yaml,
}
return res
} | [
0.4677245020866394,
-0.8117828369140625,
0.02491476945579052,
-1.4002087116241455,
-0.6037371754646301,
-0.5752516388893127,
0.36784401535987854,
0.01096635777503252,
0.27966636419296265,
-0.6799509525299072,
0.6142120361328125,
-0.7730332016944885,
-0.19741342961788177,
-0.174505338072776... |
func MortonHash(lon, lat float64) uint64 {
return numeric.Interleave(scaleLon(lon), scaleLat(lat))
} | [
0.797602117061615,
-0.31873056292533875,
0.4679291844367981,
-0.1503528654575348,
-0.12854616343975067,
0.6918955445289612,
-0.8898192048072815,
-0.9438117146492004,
-0.6693412661552429,
0.3520929515361786,
0.4057515561580658,
-0.5868261456489563,
-0.7454577088356018,
-0.7053685784339905,
... |
func MortonUnhashLon(hash uint64) float64 {
return unscaleLon(numeric.Deinterleave(hash))
} | [
1.1739006042480469,
-0.059683457016944885,
0.38254693150520325,
-0.33104196190834045,
-0.9151562452316284,
-0.2685129940509796,
-0.8277371525764465,
0.4059811234474182,
-0.3422805070877075,
-0.001144302194006741,
-0.36302751302719116,
-0.7194993495941162,
-0.760028600692749,
0.000405429047... |
func MortonUnhashLat(hash uint64) float64 {
return unscaleLat(numeric.Deinterleave(hash >> 1))
} | [
0.7143211960792542,
0.16497594118118286,
0.3572583794593811,
-0.6067480444908142,
-0.8310204744338989,
0.2718821167945862,
-0.3662431538105011,
-0.4744672179222107,
-0.8933701515197754,
-0.2711913287639618,
0.5522587895393372,
-0.9691171646118164,
-0.7594163417816162,
0.019128678366541862,... |
func compareGeo(a, b float64) float64 {
compare := a - b
if math.Abs(compare) <= geoTolerance {
return 0
}
return compare
} | [
1.9124518632888794,
-0.0065518091432750225,
0.4295821487903595,
0.35367351770401,
-0.5621783137321472,
1.1384509801864624,
-0.5077267289161682,
-0.02722107619047165,
-1.1317819356918335,
0.5515609383583069,
0.489675372838974,
0.03151213377714157,
0.09483225643634796,
0.22061316668987274,
... |
func RectIntersects(aMinX, aMinY, aMaxX, aMaxY, bMinX, bMinY, bMaxX, bMaxY float64) bool {
return !(aMaxX < bMinX || aMinX > bMaxX || aMaxY < bMinY || aMinY > bMaxY)
} | [
0.5828109383583069,
-0.2685915529727936,
0.7376633882522583,
-0.37122398614883423,
0.13265566527843475,
0.3818884789943695,
-0.13380898535251617,
-0.8113138675689697,
-0.381390780210495,
0.1378597915172577,
-0.30462995171546936,
-0.5803996920585632,
-1.646417498588562,
-0.9135915637016296,... |
func RectWithin(aMinX, aMinY, aMaxX, aMaxY, bMinX, bMinY, bMaxX, bMaxY float64) bool {
rv := !(aMinX < bMinX || aMinY < bMinY || aMaxX > bMaxX || aMaxY > bMaxY)
return rv
} | [
0.972129762172699,
-1.0489355325698853,
0.8230095505714417,
-0.26649320125579834,
-0.7527883052825928,
0.6677127480506897,
-0.2911820411682129,
-0.44921645522117615,
-0.3800698518753052,
0.0038776881992816925,
-0.386622816324234,
0.4083195924758911,
-1.0705641508102417,
-0.4906713962554931... |
func BoundingBoxContains(lon, lat, minLon, minLat, maxLon, maxLat float64) bool {
return compareGeo(lon, minLon) >= 0 && compareGeo(lon, maxLon) <= 0 &&
compareGeo(lat, minLat) >= 0 && compareGeo(lat, maxLat) <= 0
} | [
0.2734673321247101,
-0.6544888615608215,
0.5978026986122131,
0.11036885529756546,
0.21374167501926422,
0.7157906293869019,
-1.5709693431854248,
-0.4393962025642395,
-0.8726621866226196,
-1.1263459920883179,
-0.28140848875045776,
0.17445892095565796,
-0.2243041843175888,
0.08543740957975388... |
func ComputeBoundingBox(centerLon, centerLat,
radius float64) (upperLeftLon float64, upperLeftLat float64,
lowerRightLon float64, lowerRightLat float64) {
_, tlat := pointFromLonLatBearing(centerLon, centerLat, 0, radius)
rlon, _ := pointFromLonLatBearing(centerLon, centerLat, 90, radius)
_, blat := pointFromLonLa... | [
0.04832860827445984,
-0.3099135160446167,
0.6403387784957886,
0.03536675497889519,
-0.18162426352500916,
-0.08010193705558777,
-0.17671427130699158,
0.8763415217399597,
0.15372394025325775,
-0.09967286884784698,
-0.29383131861686707,
-0.4137430787086487,
-0.12075968086719513,
0.33802625536... |
func DegreesToRadians(d float64) float64 {
return d * degreesToRadian
} | [
-0.708023726940155,
1.0794785022735596,
-0.06654474139213562,
-1.8002864122390747,
-0.8453587889671326,
-0.29361140727996826,
-0.7408538460731506,
-0.7989856600761414,
0.025592945516109467,
-0.22672775387763977,
-0.4848719537258148,
0.7782797813415527,
0.4550766348838806,
0.210475191473960... |
func RadiansToDegrees(r float64) float64 {
return r * radiansToDegrees
} | [
-0.16017210483551025,
0.6001257300376892,
0.06279365718364716,
-1.3469880819320679,
-0.6730896830558777,
0.1312686651945114,
-0.7721808552742004,
-1.0181337594985962,
0.07501392066478729,
1.252055287361145,
-0.5573935508728027,
-0.4275904893875122,
-0.3370125889778137,
-0.03757112845778465... |
func pointFromLonLatBearing(lon, lat, bearing,
dist float64) (float64, float64) {
alpha1 := DegreesToRadians(bearing)
cosA1 := math.Cos(alpha1)
sinA1 := math.Sin(alpha1)
tanU1 := (1 - flattening) * math.Tan(DegreesToRadians(lat))
cosU1 := 1 / math.Sqrt(1+tanU1*tanU1)
sinU1 := tanU1 * cosU1
sig1 := math.Atan2(t... | [
0.697677731513977,
-0.28691115975379944,
0.7272243499755859,
-0.002513292944058776,
-0.8472344279289246,
0.3725479543209076,
-0.05322432890534401,
0.5173054337501526,
0.49095192551612854,
0.4826015532016754,
-0.5679389834403992,
-0.557241678237915,
0.02282816730439663,
0.26253488659858704,... |
func normalizeLon(lonDeg float64) float64 {
if lonDeg >= -180 && lonDeg <= 180 {
return lonDeg
}
off := math.Mod(lonDeg+180, 360)
if off < 0 {
return 180 + off
} else if off == 0 && lonDeg > 0 {
return 180
}
return -180 + off
} | [
-0.16105224192142487,
-0.6217496991157532,
0.5805874466896057,
-1.2729899883270264,
-1.22423255443573,
0.38631942868232727,
-1.017952799797058,
0.052308812737464905,
0.6067589521408081,
-0.6745530366897583,
-0.2897496819496155,
0.06173734366893768,
-0.6480533480644226,
0.1271710842847824,
... |
func normalizeLat(latDeg float64) float64 {
if latDeg >= -90 && latDeg <= 90 {
return latDeg
}
off := math.Abs(math.Mod(latDeg+90, 360))
if off <= 180 {
return off - 90
}
return (360 - off) - 90
} | [
-0.15171441435813904,
-0.05223045498132706,
0.46021249890327454,
-1.714982509613037,
-1.421748399734497,
0.8393896818161011,
-0.5194598436355591,
0.051710113883018494,
-0.11514656245708466,
-0.693566620349884,
0.7797666788101196,
-0.5206909775733948,
-0.1214214637875557,
-0.065192781388759... |
func (m *OrdersCountFull) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateStatuses(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
} | [
1.0232105255126953,
0.6095081567764282,
0.31993111968040466,
0.05851180478930473,
-0.1323537677526474,
-0.07454199343919754,
0.6657933592796326,
-0.038774438202381134,
-1.0069200992584229,
0.5054600238800049,
0.4466966688632965,
-0.2354167103767395,
-0.1591469645500183,
0.7393914461135864,... |
func (c *JWTAuth) GetUser(req *http.Request, key string) error {
bearerSchema := "Bearer "
tokenString := req.Header.Get("Authorization")
claims := jwt.MapClaims{}
_, _ = jwt.ParseWithClaims(tokenString[len(bearerSchema):], claims, func(token *jwt.Token) (interface{}, error) {
return []byte(key), nil
})
userD... | [
-0.6241139769554138,
-0.3141323924064636,
0.8724894523620605,
0.798983097076416,
-0.5781254172325134,
-0.2081766426563263,
-0.6589309573173523,
-0.5974412560462952,
0.16764651238918304,
0.14224883913993835,
-0.27209821343421936,
0.589654266834259,
0.316896915435791,
-0.10496141761541367,
... |
func (c *JWTAuth) NewToken(key string, duration time.Duration) (string, bool) {
c.Password = ""
userDataString, _ := json.Marshal(c)
token := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{
"user": string(userDataString),
"exp": time.Now().Add(duration).Unix(),
"iat": time.Now().Unix(),
})
tokenS... | [
-0.7311201691627502,
-0.8029829263687134,
0.819438636302948,
-0.1006741002202034,
-1.3825138807296753,
0.6262275576591492,
-0.594354510307312,
0.37328293919563293,
-0.05853988230228424,
0.8318508267402649,
-0.8734571933746338,
0.5606762766838074,
0.3261886239051819,
0.010588867589831352,
... |
func (c *JWTAuth) RefreshToken(req http.ResponseWriter, key string) bool {
expirationTime := time.Now().Add(5 * time.Minute)
userDataString, _ := json.Marshal(c)
token := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{
"user": string(userDataString),
"exp": expirationTime,
"iat": time.Now().Unix(),
... | [
-0.6307905316352844,
-0.44410836696624756,
0.6500176191329956,
0.4080505073070526,
-1.1910592317581177,
0.3110309839248657,
-0.6591396927833557,
-0.39594027400016785,
0.21444746851921082,
0.291849285364151,
-0.9213960766792297,
0.6569733023643494,
0.1449919044971466,
0.2845924198627472,
... |
func NewLibDRMAAContext() *wfl.Context {
return NewLibDRMAAContextByCfg(Config{})
} | [
-0.28242647647857666,
-0.7894612550735474,
0.1951153427362442,
-0.70840984582901,
-0.5612243413925171,
-0.5894854664802551,
0.7779762744903564,
-0.201350599527359,
0.8552961349487305,
-0.049041543155908585,
-0.5945037007331848,
-0.5898604393005371,
-0.12359941750764847,
0.18852108716964722... |
func NewLibDRMAAContextByCfg(cfg Config) *wfl.Context {
if cfg.DBFile == "" {
cfg.DBFile = wfl.TmpFile()
}
if cfg.JobDBFile == "" {
sm, err := drmaa2os.NewLibDRMAASessionManager(cfg.DBFile)
return &wfl.Context{
SM: sm,
DefaultTemplate: cfg.DefaultTemplate,
CtxCreationErr: err}
}
retu... | [
0.1158377155661583,
-0.7999116778373718,
0.47549721598625183,
-0.2694459557533264,
-0.40869230031967163,
-0.3534640669822693,
1.5375792980194092,
0.350527822971344,
0.4895293414592743,
0.10494273900985718,
-0.2709202468395233,
-1.2804299592971802,
-0.5858774781227112,
0.5141929388046265,
... |
func NewLibDRMAAContextByCfgWithInitParams(cfg Config, params libdrmaa.LibDRMAASessionParams) *wfl.Context {
if cfg.DBFile == "" {
cfg.DBFile = wfl.TmpFile()
}
sm, err := drmaa2os.NewLibDRMAASessionManagerWithParams(params, cfg.DBFile)
return &wfl.Context{
SM: sm,
SMType: wfl.LibDRMAASes... | [
-0.027010275050997734,
-1.0357261896133423,
0.34897497296333313,
-0.5790398120880127,
-0.040055613964796066,
-0.22025005519390106,
1.0911290645599365,
0.5780589580535889,
0.33475086092948914,
0.22758619487285614,
-0.25751879811286926,
-0.9035572409629822,
-0.31595057249069214,
0.8673149943... |
func (l *LargeSizeChar) Display() {
// ˅
fmt.Println(l.displayData)
// ˄
} | [
0.9572558999061584,
-0.6179453134536743,
0.32551226019859314,
-0.6705396771430969,
-0.3480774164199829,
1.038609266281128,
0.6604912877082825,
-0.09000898897647858,
0.5285438895225525,
-0.5904185175895691,
-0.32824042439460754,
0.7895841002464294,
-0.6411229372024536,
0.48520469665527344,
... |
func newRoom(id int) *room {
return &room{
ID: id,
clients: make(map[*client]bool),
messages: make(chan string), //initialize channel, or...deadlock
joining: make(chan *client), //initialize channel, or...deadlock
leaving: make(chan *client), //initialize channel, or...deadlock
}
} | [
-0.3385809063911438,
-0.610926628112793,
0.33504724502563477,
0.24979224801063538,
-0.7083516120910645,
0.050384171307086945,
0.11007418483495712,
-1.5096887350082397,
0.577508270740509,
-0.33700674772262573,
0.39178526401519775,
0.49763256311416626,
-0.6324516534805298,
0.714807391166687,... |
func (ro *room) run() {
log.Println("Starting up the room with ID = ", ro.ID)
for {
select {
//any new incomming messages to the room ?
case msg := <-ro.messages:
fmt.Printf("room%v: %v\n", ro.ID, msg)
//create a reference of the client in the room struct, and set its value to true
//to indicate that th... | [
-0.3887447416782379,
-1.0462168455123901,
0.4561939835548401,
-0.32497555017471313,
0.5136175155639648,
0.34023168683052063,
0.82877516746521,
-0.1226956844329834,
-0.3515418767929077,
0.1193360835313797,
-0.5617632269859314,
0.7934619784355164,
-0.8159546852111816,
0.9452569484710693,
0... |
func (c *client) joinRoom(ro *room) {
c.room = ro
log.Printf("joinRoom: client1.ID =%v, is now in the room client.room.ID = %v\n", c.ID, c.room.ID)
c.room.messages <- "Hello, I'm client1, and entering the room"
//set the client active in the room
c.room.joining <- c
} | [
0.35259270668029785,
-0.6498548984527588,
0.37416231632232666,
0.46738293766975403,
0.15228290855884552,
0.7804406881332397,
0.9040135145187378,
0.470719575881958,
-0.4354354739189148,
0.35452035069465637,
-0.16968266665935516,
0.7339662313461304,
-0.9752791523933411,
0.5958998203277588,
... |
func newClient(id int) *client {
return &client{
ID: id,
msg: make(chan string),
}
} | [
0.2977112829685211,
-0.5694342255592346,
0.10293307900428772,
-0.684927225112915,
-0.8352426886558533,
-0.20866255462169647,
0.2959837019443512,
-1.1636197566986084,
0.12875930964946747,
-0.4511977434158325,
-0.618121325969696,
1.3092244863510132,
-0.3421436548233032,
-0.29462912678718567,... |
func (m *ConditionalAccessRequestBuilder) AuthenticationContextClassReferences()(*ConditionalAccessAuthenticationContextClassReferencesRequestBuilder) {
return NewConditionalAccessAuthenticationContextClassReferencesRequestBuilderInternal(m.pathParameters, m.requestAdapter)
} | [
-0.9335343241691589,
-0.3572582006454468,
0.7393037676811218,
0.48952075839042664,
-0.4963366389274597,
0.8829913139343262,
0.3582150638103485,
-1.0145303010940552,
0.9148766994476318,
-0.2124769389629364,
0.8765329122543335,
0.2057473361492157,
-0.6000394225120544,
0.5956874489784241,
0... |
func (m *ConditionalAccessRequestBuilder) AuthenticationContextClassReferencesById(id string)(*ConditionalAccessAuthenticationContextClassReferencesAuthenticationContextClassReferenceItemRequestBuilder) {
urlTplParams := make(map[string]string)
for idx, item := range m.pathParameters {
urlTplParams[idx]... | [
-0.9662480354309082,
-0.24873851239681244,
0.35204681754112244,
0.16531772911548615,
-0.2888045310974121,
0.44022616744041443,
0.20643427968025208,
-0.7309117913246155,
0.8476539254188538,
0.3804413080215454,
0.5340840816497803,
0.5271333456039429,
-0.7127529978752136,
1.1001020669937134,
... |
func NewConditionalAccessRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ConditionalAccessRequestBuilder) {
m := &ConditionalAccessRequestBuilder{
}
m.urlTemplate = "{+baseurl}/identity/conditionalAcce... | [
-0.3656819760799408,
-0.8297978639602661,
0.3560774028301239,
0.2013605237007141,
-1.5081950426101685,
0.6717485189437866,
0.5081415772438049,
0.6069988012313843,
0.1448473483324051,
-0.5720500349998474,
0.6888098120689392,
0.4803043305873871,
-0.7907708883285522,
0.15793921053409576,
0.... |
func NewConditionalAccessRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ConditionalAccessRequestBuilder) {
urlParams := make(map[string]string)
urlParams["request-raw-url"] = rawUrl
return NewConditionalAccessRequestBuilderInte... | [
-0.5787663459777832,
-0.8164405226707458,
0.3151063621044159,
0.7084053754806519,
-1.9281708002090454,
0.24265553057193756,
0.04764329642057419,
0.6812949180603027,
0.827130913734436,
-1.1558560132980347,
0.8864157795906067,
0.3620014786720276,
0.036083199083805084,
0.431220680475235,
0.... |
func (m *ConditionalAccessRequestBuilder) Delete(ctx context.Context, requestConfiguration *ConditionalAccessRequestBuilderDeleteRequestConfiguration)(error) {
requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);
if err != nil {
return err
}
errorMapping := i2ae4187f7daee... | [
0.3877963423728943,
-0.15012674033641815,
0.8352367281913757,
-0.03870619460940361,
-0.3405686318874359,
0.4040902853012085,
0.8866171836853027,
0.00605188449844718,
0.30133312940597534,
0.008909349329769611,
0.8233427405357361,
0.44258835911750793,
-0.1771925538778305,
0.2687668204307556,... |
func (m *ConditionalAccessRequestBuilder) Get(ctx context.Context, requestConfiguration *ConditionalAccessRequestBuilderGetRequestConfiguration)(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.ConditionalAccessRootable, error) {
requestInfo, err := m.ToGetRequestInformation(ctx, requestConfigurati... | [
0.5034719109535217,
-0.2636629045009613,
0.8023916482925415,
-0.28083744645118713,
-0.2702694237232208,
0.15829624235630035,
0.6801374554634094,
-0.3837962746620178,
-0.5509346723556519,
-0.20363052189350128,
0.9502084255218506,
1.1368604898452759,
-0.316969633102417,
0.339958518743515,
... |
func (m *ConditionalAccessRequestBuilder) NamedLocations()(*ConditionalAccessNamedLocationsRequestBuilder) {
return NewConditionalAccessNamedLocationsRequestBuilderInternal(m.pathParameters, m.requestAdapter)
} | [
-0.4301772117614746,
-0.08345825225114822,
0.4861672818660736,
0.057740092277526855,
-1.3168363571166992,
-0.033672966063022614,
0.977493405342102,
-0.37846148014068604,
0.9487425684928894,
-0.8902522325515747,
-0.053781285881996155,
-0.09837868809700012,
-0.2554134428501129,
0.43763691186... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.