text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (m *ConditionalAccessRequestBuilder) NamedLocationsById(id string)(*ConditionalAccessNamedLocationsNamedLocationItemRequestBuilder) {
urlTplParams := make(map[string]string)
for idx, item := range m.pathParameters {
urlTplParams[idx] = item
}
if id != "" {
urlTplParams["namedLocatio... | [
-0.6188087463378906,
-0.34722161293029785,
0.2343965768814087,
-0.14987483620643616,
-1.5687862634658813,
-0.18627585470676422,
0.9392550587654114,
-0.4183535575866699,
0.9629634618759155,
-0.09619107842445374,
-0.4298720061779022,
0.04764781519770622,
-0.23767948150634766,
0.6936584115028... |
func (m *ConditionalAccessRequestBuilder) Patch(ctx context.Context, body iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.ConditionalAccessRootable, requestConfiguration *ConditionalAccessRequestBuilderPatchRequestConfiguration)(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.Conditi... | [
0.45037731528282166,
-0.5495380163192749,
0.8689988851547241,
-0.5804988145828247,
-1.021486759185791,
0.6116994023323059,
0.5997089743614197,
-0.10191033780574799,
0.30958685278892517,
0.0285175908356905,
0.8962164521217346,
1.0681124925613403,
0.36007800698280334,
0.4504914879798889,
0... |
func (m *ConditionalAccessRequestBuilder) Policies()(*ConditionalAccessPoliciesRequestBuilder) {
return NewConditionalAccessPoliciesRequestBuilderInternal(m.pathParameters, m.requestAdapter)
} | [
-0.15735961496829987,
0.0348614901304245,
0.3062776029109955,
-0.4182606041431427,
-0.4473365843296051,
0.8952020406723022,
0.09744682908058167,
-0.1654457449913025,
1.0289306640625,
-0.9135013222694397,
1.4488677978515625,
0.15825089812278748,
-0.08212865889072418,
-0.11101645231246948,
... |
func (m *ConditionalAccessRequestBuilder) PoliciesById(id string)(*ConditionalAccessPoliciesConditionalAccessPolicyItemRequestBuilder) {
urlTplParams := make(map[string]string)
for idx, item := range m.pathParameters {
urlTplParams[idx] = item
}
if id != "" {
urlTplParams["conditionalAcc... | [
0.20267389714717865,
-0.2509284019470215,
0.10469275712966919,
-0.7387173175811768,
-0.9981828331947327,
0.9732342958450317,
0.09268295019865036,
-0.33983078598976135,
0.8632142543792725,
-0.0026874851901084185,
0.452578067779541,
0.2117661088705063,
-0.1891949474811554,
0.0530176535248756... |
func (m *ConditionalAccessRequestBuilder) Templates()(*ConditionalAccessTemplatesRequestBuilder) {
return NewConditionalAccessTemplatesRequestBuilderInternal(m.pathParameters, m.requestAdapter)
} | [
-0.07812588661909103,
-0.367178738117218,
0.35534462332725525,
0.1844906359910965,
-0.8295244574546814,
-0.17924034595489502,
0.7466672658920288,
0.13542042672634125,
0.8528560400009155,
-0.9563857913017273,
0.9476246237754822,
0.1545475572347641,
-0.2918500602245331,
0.22890502214431763,
... |
func (m *ConditionalAccessRequestBuilder) TemplatesById(id string)(*ConditionalAccessTemplatesConditionalAccessTemplateItemRequestBuilder) {
urlTplParams := make(map[string]string)
for idx, item := range m.pathParameters {
urlTplParams[idx] = item
}
if id != "" {
urlTplParams["conditiona... | [
0.3515605628490448,
-0.5241773724555969,
0.4293270707130432,
-0.15050259232521057,
-0.9684168696403503,
-0.047285307198762894,
0.7857556343078613,
0.021157685667276382,
0.5832774043083191,
-0.03963634371757507,
-0.3634694814682007,
-0.05621705204248428,
-0.3928455412387848,
0.5161668658256... |
func (m *ConditionalAccessRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ConditionalAccessRequestBuilderDeleteRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
requestInfo := i2ae4187f7daee263371cb1c977df63981... | [
0.11746379733085632,
-0.6949276924133301,
0.9596849083900452,
-1.089991569519043,
-0.5942700505256653,
0.3760180175304413,
0.6043509840965271,
0.061213139444589615,
0.21908403933048248,
-0.29591771960258484,
0.9349579215049744,
0.5182828903198242,
-0.11103682965040207,
0.0503314808011055,
... |
func (m *ConditionalAccessRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ConditionalAccessRequestBuilderGetRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50f... | [
-0.5879201292991638,
-0.5400283932685852,
0.8813846111297607,
-0.6861681342124939,
-0.2445196658372879,
0.03724351525306702,
0.5032597780227661,
-0.30827245116233826,
0.06709853559732437,
-0.43693646788597107,
0.8409888744354248,
0.4818297028541565,
-0.27916544675827026,
0.0627133846282959... |
func (m *ConditionalAccessRequestBuilder) ToPatchRequestInformation(ctx context.Context, body iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.ConditionalAccessRootable, requestConfiguration *ConditionalAccessRequestBuilderPatchRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b743... | [
-0.2897169888019562,
-0.6048649549484253,
0.9826222658157349,
-0.8112317323684692,
-0.7354161143302917,
0.30995258688926697,
0.5658020973205566,
-0.6880866289138794,
-0.37156814336776733,
0.16964542865753174,
1.2986173629760742,
0.3067845106124878,
-0.056480325758457184,
0.0127901816740632... |
func NewRay(origin, dir Vec3) *Ray {
return &Ray{
Origin: origin,
Direction: *Unit(dir),
}
} | [
0.4446382522583008,
-0.8313701152801514,
0.16207903623580933,
0.4495871961116791,
0.17670434713363647,
0.31723520159721375,
-1.0359104871749878,
0.3224106431007385,
-0.498507022857666,
-0.5873013734817505,
-0.521014392375946,
1.306645154953003,
-0.09692959487438202,
0.37408557534217834,
... |
func (r Ray) Theta() float64 {
return math.Acos(r.Direction[2])
} | [
-0.2647840082645416,
-0.5008512139320374,
0.32103320956230164,
0.12235730141401291,
1.1125545501708984,
-0.13117702305316925,
0.6513899564743042,
-0.3100213408470154,
-0.4765016436576843,
0.9583075046539307,
-0.19602537155151367,
0.26076480746269226,
0.2872428894042969,
0.02893394790589809... |
func (r Ray) Rho() float64 {
return 1
} | [
0.17576977610588074,
0.2048380821943283,
0.5889708399772644,
1.2262483835220337,
-0.36620718240737915,
0.5407177209854126,
0.18518942594528198,
-0.8348175883293152,
-0.03969709947705269,
0.18935070931911469,
0.20014017820358276,
0.11614369601011276,
-0.7657903432846069,
0.8815338611602783,... |
func (r Ray) At(t float64) *Vec3 {
return r.Direction.SMul(t).AddSet(r.Origin)
} | [
-0.2311324030160904,
-0.43490198254585266,
0.4910871684551239,
-1.5662542581558228,
0.2579823136329651,
0.7203400731086731,
-0.649893045425415,
-0.3425474166870117,
-0.21304021775722504,
0.612828254699707,
-0.7570278644561768,
0.6044928431510925,
1.1861463785171509,
-0.32520830631256104,
... |
func (c *RestClient) GetVimTenants(ctx context.Context) (*response.Tenants, error) {
glog.Infof("Retrieving vim tenants")
c.GetClient()
resp, err := c.Client.R().SetContext(ctx).Get(c.BaseURL + apiTenants)
if err != nil {
glog.Error(err)
return nil, err
}
if c.isTrace && resp != nil {
fmt.Println(string(... | [
-0.18373331427574158,
-1.0325524806976318,
0.14464253187179565,
-0.468633770942688,
-0.05855916813015938,
-0.9103208780288696,
-0.8858269453048706,
0.1494988650083542,
-0.02470080368220806,
0.44029778242111206,
-0.6952409744262695,
1.244678258895874,
-1.4440816640853882,
-0.331185221672058... |
func (c *RestClient) GetVim(ctx context.Context, vimId string) (*response.TenantSpecs, error) {
c.GetClient()
apiReq := fmt.Sprintf(TcaVimTenant, vimId)
glog.Info("Sending request to ", apiReq)
resp, err := c.Client.R().SetContext(ctx).Get(c.BaseURL + apiReq)
if err != nil {
glog.Error(err)
return nil, err
... | [
-0.1386476755142212,
-0.4963395297527313,
0.6072383522987366,
0.23397420346736908,
0.14218474924564362,
-0.47073763608932495,
-0.3817631006240845,
-0.09635384380817413,
0.10587149858474731,
0.26175475120544434,
0.16576503217220306,
0.7898815274238586,
-0.5129169225692749,
-0.62714278697967... |
func (c *RestClient) GetTenantsQuery(f *specs.TenantsNfFilter) (*response.Tenants, error) {
c.GetClient()
resp, err := c.Client.R().SetBody(f).SetQueryString(apiTenantAction).Post(c.BaseURL + apiTenants)
if err != nil {
glog.Error(err)
return nil, err
}
if c.isTrace && resp != nil {
fmt.Println(string(resp... | [
-0.28058522939682007,
0.11784584820270538,
0.35112935304641724,
-0.5194011926651001,
-0.11154211312532425,
-0.9284757971763611,
-0.5206249356269836,
-0.3633444607257843,
-0.2703392207622528,
0.35901474952697754,
0.4867737293243408,
0.9018835425376892,
-0.4148889482021332,
0.808313190937042... |
func (c *RestClient) RegisterCloudProvider(r *specs.SpecCloudProvider) (*models.TcaTask, error) {
glog.Infof("Cloud provider registration request %s", r.HcxCloudUrl)
c.GetClient()
resp, err := c.Client.R().SetBody(r).Post(c.BaseURL + apiTenants)
if err != nil {
glog.Error(err)
return nil, err
}
if c.isTrac... | [
-1.195798397064209,
1.100369930267334,
0.5103153586387634,
0.14129838347434998,
0.45244765281677246,
0.09641597419977188,
-0.09467265754938126,
0.04325249046087265,
-0.5476515293121338,
1.0088845491409302,
-0.8626312613487244,
0.46419721841812134,
-0.771080732345581,
0.3755485713481903,
... |
func (c *RestClient) DeleteTenant(tenantCluster string) (*models.TcaTask, error) {
glog.Infof("Deleting tenant cluster %v", tenantCluster)
c.GetClient()
resp, err := c.Client.R().Delete(c.BaseURL + fmt.Sprintf(TcaDeleteTenant, tenantCluster))
if err != nil {
glog.Error(err)
return nil, err
}
if c.isTrace &... | [
0.03393198549747467,
-0.6180154085159302,
0.4484728276729584,
-0.689612865447998,
-0.7038683295249939,
-0.029598962515592575,
0.21729311347007751,
-0.3554907739162445,
0.12621460855007172,
0.3314248323440552,
-0.03987794369459152,
0.5469520092010498,
-0.5379526019096375,
-0.163499146699905... |
func (v1 Vector2) Mul(c float32) Vector2 {
return Vector2{v1.X * c, v1.Y * c}
} | [
0.9801775217056274,
0.03059016354382038,
0.36918312311172485,
0.03540615364909172,
-0.45135030150413513,
1.0233190059661865,
-0.47898319363594055,
-0.8516010046005249,
-0.04819205030798912,
0.04078083485364914,
-0.6888372302055359,
0.39471113681793213,
0.5467432737350464,
-0.30592569708824... |
func (v1 Vector2) Add(v2 Vector2) Vector2 {
return Vector2{v1.X + v2.X, v1.Y + v2.Y}
} | [
-0.577317476272583,
-1.4927037954330444,
0.6449406743049622,
-0.3648545444011688,
-0.39224016666412354,
0.6409549713134766,
-1.1109989881515503,
-0.9446625709533691,
0.5181103944778442,
0.05321810021996498,
0.10204712301492691,
1.098478078842163,
-0.2106151282787323,
-0.14560037851333618,
... |
func (v1 Vector2) Sub(v2 Vector2) Vector2 {
return Vector2{v1.X - v2.X, v1.Y - v2.Y}
} | [
-0.11143114417791367,
-0.9570268392562866,
0.41525760293006897,
-0.21079090237617493,
-1.2462096214294434,
0.6407082080841064,
-0.6934658288955688,
-0.47085636854171753,
-0.10885660350322723,
-0.28378474712371826,
-0.5478355288505554,
1.1472519636154175,
0.03502557799220085,
-0.85682600736... |
func (c *cache) read(key string) interface{} {
return c.Fields[key]
} | [
-1.1208075284957886,
0.1951349824666977,
0.4198835492134094,
-0.47406062483787537,
-1.3388341665267944,
0.5867676734924316,
-0.48425573110580444,
-0.7212042212486267,
-0.24880680441856384,
0.26958510279655457,
-0.1941336840391159,
0.0023396462202072144,
-0.2748377323150635,
-0.791211366653... |
func (c *cache) write(key string, val interface{}) {
c.Fields[key] = val
} | [
-1.4501421451568604,
0.6082839369773865,
0.25453314185142517,
-0.2534741163253784,
0.05736694112420082,
0.4457380473613739,
-0.6113340854644775,
0.4934390187263489,
-0.2876112163066864,
0.5710342526435852,
-1.0122469663619995,
0.0800478383898735,
-0.026788946241140366,
0.09793762117624283,... |
func (c *cache) delete(key string) bool {
_, ok := c.Fields[key]
if ok {
delete(c.Fields, key)
}
return ok
} | [
-0.24964678287506104,
1.2176252603530884,
0.43421825766563416,
-0.0966079831123352,
-0.35838037729263306,
0.18767693638801575,
-0.37322208285331726,
0.15168413519859314,
-0.41021737456321716,
1.0874263048171997,
-0.8800439834594727,
-1.2003834247589111,
-1.2468583583831787,
-0.123787090182... |
func (c *cache) setExpiration(key string, expires time.Duration) {
if expires != 0 {
timeStamp := time.Now().Add(expires)
heap.Push(&c.Exps, expiration{key, timeStamp})
} else {
index, ok := c.Exps.Indexes[key]
if ok {
heap.Remove(&c.Exps, index)
}
}
} | [
-0.39962059259414673,
0.42040401697158813,
0.3065981864929199,
0.4651028513908386,
-0.21666313707828522,
-0.4415789842605591,
-0.8163021206855774,
1.1456094980239868,
0.7811797857284546,
1.5756261348724365,
-0.2785191535949707,
-0.09178701788187027,
0.05495966970920563,
0.7334311008453369,... |
func (c *cache) StartCleaner() {
for {
time.Sleep(50 * time.Millisecond)
c.Exps.m.Lock()
if c.Exps.Len() != 0 {
// closest expiration
expiration := c.Exps.Expirations[0]
for ; expiration.Expires.Before(time.Now()); expiration = c.Exps.Expirations[0] {
if expiration.Expires.Before(time.Now()) {
... | [
0.3012026846408844,
-0.5617902874946594,
0.6092965602874756,
0.4335070252418518,
-0.8552307486534119,
0.0015686186961829662,
0.3252332806587219,
0.26699620485305786,
0.1062452495098114,
0.22497931122779846,
0.48941823840141296,
0.7411780953407288,
-0.4858170449733734,
1.3377765417099,
0.... |
func Add(mgr manager.Manager) error {
return add(mgr, newReconciler(mgr))
} | [
-0.24057555198669434,
0.12229465693235397,
0.46777674555778503,
-0.6655282378196716,
0.4479011595249176,
-0.17455056309700012,
-0.48020607233047485,
0.6828829646110535,
0.19666412472724915,
-0.7739230394363403,
0.224630668759346,
0.617239773273468,
-1.010264277458191,
1.3228338956832886,
... |
func newReconciler(mgr manager.Manager) reconcile.Reconciler {
return &ReconcileForwarding{client: mgr.GetClient(), scheme: mgr.GetScheme()}
} | [
0.3777715563774109,
-0.12643994390964508,
0.28187116980552673,
-0.8672053217887878,
-0.672906219959259,
-0.0769456997513771,
0.05439745634794235,
0.9370314478874207,
-0.0454135499894619,
-0.18089137971401215,
0.8095790147781372,
-0.3235352635383606,
-0.525922954082489,
0.823591947555542,
... |
func add(mgr manager.Manager, r reconcile.Reconciler) error {
// Create a new controller
c, err := controller.New("logforwarding-controller", mgr, controller.Options{Reconciler: r})
if err != nil {
return err
}
// Watch for changes to primary resource ClusterLogging
err = c.Watch(&source.Kind{Type: &logforward... | [
0.6290112733840942,
0.29298311471939087,
0.6959560513496399,
-1.3229002952575684,
0.5269439220428467,
0.02270607091486454,
-0.4064495861530304,
0.3153754472732544,
0.014483488164842129,
-0.5039362907409668,
0.6203666925430298,
0.6264318823814392,
-0.28791502118110657,
0.5760740637779236,
... |
func (r *ReconcileForwarding) Reconcile(request reconcile.Request) (reconcile.Result, error) {
logger.DebugObject("logforwarding-controller Reconciling request: %s", request)
// Fetch the LogForwarding instance
instance := &logforwarding.LogForwarding{}
logger.Debug("logforwarding-controller fetching LF instance")
... | [
-0.17114289104938507,
-0.21080254018306732,
0.8400623202323914,
-0.7476663589477539,
0.17212872207164764,
-0.5541520714759827,
-0.6334716081619263,
0.2685651183128357,
0.0015340641839429736,
-0.06219550967216492,
0.34012266993522644,
0.1758209466934204,
-0.46951979398727417,
0.297674685716... |
func (adapter *ParrotHTTPAdapter) GibeParrot(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodGet {
adapter.Logger.Printf(`nope`)
_ = marshalAndWriteErrorResponse(w, http.StatusText(http.StatusMethodNotAllowed), http.StatusMethodNotAllowed)
return
}
body, err := ioutil.ReadAll(r.Body)
defer... | [
-0.43044090270996094,
-0.04027872532606125,
1.2155195474624634,
-0.7258273959159851,
-0.1791164129972458,
0.7227622270584106,
0.08999088406562805,
-1.1001884937286377,
0.003165358677506447,
0.7069821953773499,
0.38594895601272583,
0.5020637512207031,
-1.0273747444152832,
-0.605063915252685... |
func New() Client {
c := http.DefaultClient
c.Timeout = time.Second * 10
return &client{c: c}
} | [
0.5458133816719055,
-0.7352763414382935,
0.29145994782447815,
-0.11989463120698929,
-0.4042392671108246,
0.17201374471187592,
-0.36551979184150696,
-0.04586190730333328,
-0.7837725877761841,
-0.048542290925979614,
-0.6456902623176575,
0.06801944971084595,
-0.17705143988132477,
-0.175750777... |
func RedirectAndExecute(command Command) {
// Backups
stdin := os.Stdin
stdout := os.Stdout
// error variable
var err error
// Redirect the in/out streams
if command.infile != nil {
os.Stdin, err = os.OpenFile(*command.infile, os.O_RDWR, 0755)
}
if command.outfile != nil {
if command.appendMode {
os.S... | [
0.5032861828804016,
-1.1319291591644287,
1.2241076231002808,
-0.1439168006181717,
-0.02308529242873192,
0.8598807454109192,
0.7088645696640015,
0.40167513489723206,
-0.05510296672582626,
-0.6149924397468567,
1.2609219551086426,
-0.023886684328317642,
-0.5341523885726929,
0.4815694987773895... |
func New(s *Settings) (*Factorio, error) {
datadir := s.DataDir()
if datadir == "" {
return nil, fmt.Errorf("no factorio data dir found; use --alsologtostderr for more info and --%sdatadir to specify its location", s.flagPrefix)
}
scriptOutput, err := s.ScriptOutput()
if err != nil {
return nil, err
}
binary... | [
0.21276721358299255,
-0.46596309542655945,
0.24898089468479156,
0.18512368202209473,
-1.1402169466018677,
-0.6129547357559204,
0.1356477588415146,
-0.6337200403213501,
-0.7813853621482849,
-0.10685013979673386,
-0.35116899013519287,
0.6884356141090393,
0.6448639035224915,
0.614360868930816... |
func (f *Factorio) ForceVerbose() {
f.verbose = true
} | [
0.7958624958992004,
0.9646202921867371,
0.3868637681007385,
0.6446062326431274,
1.6803065538406372,
-0.05157926678657532,
-0.7806990742683411,
-0.4067678451538086,
-1.6089719533920288,
-0.0019473149441182613,
-0.14209118485450745,
0.6037724614143372,
-0.1572258174419403,
1.0128408670425415... |
func (f *Factorio) DataDir() string {
return f.datadir
} | [
0.5837060213088989,
-0.4555937349796295,
0.06754675507545471,
-0.20611503720283508,
-0.5915502309799194,
0.8547494411468506,
-0.35493040084838867,
0.15870961546897888,
-0.2906261086463928,
-1.8013875484466553,
0.14628902077674866,
0.527258574962616,
0.7900417447090149,
1.3283567428588867,
... |
func (f *Factorio) Binary() string {
return f.binary
} | [
0.2889612019062042,
-1.2273881435394287,
0.2787918448448181,
1.3274706602096558,
0.1771882325410843,
0.7958087921142578,
-0.29816845059394836,
-1.072937250137329,
-1.0757560729980469,
-0.8915867209434509,
-0.4141576290130615,
0.2829819917678833,
0.36720559000968933,
0.21230919659137726,
... |
func (f *Factorio) ModsDir() string {
return filepath.Join(f.DataDir(), ModsDir)
} | [
-0.006945190951228142,
-0.4522738754749298,
0.31409892439842224,
-0.98457270860672,
-0.3900969326496124,
0.5507014989852905,
-0.654452919960022,
-0.35921230912208557,
-0.21676142513751984,
-1.0656543970108032,
0.4487771987915039,
0.2726847231388092,
-0.06991373747587204,
0.4286787807941437... |
func (f *Factorio) ScriptOutput() string {
return f.scriptOutput
} | [
0.4441074728965759,
-0.5579245686531067,
0.2522455155849457,
0.026325177401304245,
-0.15427036583423615,
-0.8597067594528198,
0.6181466579437256,
-0.6198800206184387,
-0.7517967224121094,
0.391146183013916,
0.029752418398857117,
0.5874013900756836,
0.42428725957870483,
0.08827151358127594,... |
func (f *Factorio) FindSaveFile(name string) (string, error) {
candidates := []string{
name,
name + ".zip",
filepath.Join(f.DataDir(), SavesDir, name+".zip"),
filepath.Join(f.DataDir(), SavesDir, name),
}
for _, c := range candidates {
_, err := os.Stat(c)
if err == nil {
glog.Infof("Looking for save ... | [
-0.3712877333164215,
-0.6147565245628357,
0.7918183207511902,
-0.49922889471054077,
0.06536274403333664,
-0.45138323307037354,
0.13857625424861908,
-0.6964133977890015,
-0.557184636592865,
0.4241979122161865,
-0.20060856640338898,
-1.0864733457565308,
-0.6011793613433838,
0.883556485176086... |
func (f *Factorio) CopyMods(dstMods string, filterOut []string) error {
srcMods := f.ModsDir()
foundModList := false
filtered := map[string]bool{}
for _, f := range filterOut {
filtered[f] = true
}
if err := os.MkdirAll(dstMods, 0755); err != nil {
return fmt.Errorf("unable to create dir %q: %w", dstMods, e... | [
-0.9720573425292969,
0.1193983405828476,
0.6797181367874146,
-0.37045130133628845,
-0.7926334142684937,
0.13781176507472992,
0.4572238326072693,
-0.6513444781303406,
0.05625779554247856,
0.6133353114128113,
-0.08335611969232559,
0.7974274158477783,
0.622935950756073,
0.659674882888794,
-... |
func (s *Settings) Register(flags *pflag.FlagSet, prefix string) *Settings {
s.flagPrefix = prefix
flags.StringVar(&s.datadir, prefix+"datadir", "", "Path to factorio data dir. Tries default locations if empty.")
flags.StringVar(&s.scriptOutput, prefix+"scriptoutput", "", "Path to factorio script-output dir. If unsp... | [
-0.32633453607559204,
0.6353511810302734,
0.43688932061195374,
-0.2878442704677582,
0.5007911920547485,
-0.4813676178455353,
-0.22616977989673615,
-0.6575560569763184,
-1.2698980569839478,
-0.6952567100524902,
-0.49474525451660156,
0.680482029914856,
0.4909787178039551,
0.5846125483512878,... |
func (s *Settings) DataDir() string {
// List is in reverse order of priority - last one will be preferred.
candidates := []string{
`/opt/factorio`,
`~/.factorio`,
`~/factorio`,
`~/Library/Application Support/factorio`,
}
if e := os.Getenv("APPDATA"); e != "" {
candidates = append(candidates, filepath.Joi... | [
0.015870289877057076,
0.1036967784166336,
0.7111591696739197,
0.46108025312423706,
-0.3726249635219574,
-0.10646229982376099,
0.5057516694068909,
-0.1417403668165207,
0.09859322756528854,
-0.6881905198097229,
1.0971035957336426,
0.5958877205848694,
0.31090182065963745,
0.8810800909996033,
... |
func (s *Settings) ScriptOutput() (string, error) {
if s.scriptOutput == "" {
dataDir := s.DataDir()
if dataDir == "" {
return "", fmt.Errorf("no factorio data dir found; use --alsologtostderr for more info; use --%sscriptoutput to specify directly the script-output location", s.flagPrefix)
}
// Don't check... | [
-0.01089189201593399,
-0.16752059757709503,
0.5454948544502258,
-0.06486453115940094,
-0.33041465282440186,
-1.3312253952026367,
0.7747771739959717,
-0.6708826422691345,
0.2230812907218933,
0.2921660244464874,
0.2975812256336212,
0.5695229172706604,
0.20758847892284393,
0.3541564643383026,... |
func (s *Settings) Binary() (string, error) {
// List is in reverse order of priority - last one will be preferred.
candidates := []string{
// Steam is a bit tricky to start/stop automatically, so ignore it for now.
// `~/Library/Application Support/Steam/steamapps/common/Factorio/factorio.app/Contents`,
`/opt/... | [
-0.0551287978887558,
-0.5410622358322144,
1.1215565204620361,
1.3040193319320679,
-0.08776950091123581,
-0.46464934945106506,
0.5207002758979797,
-0.4309137761592865,
-0.1591814160346985,
-0.12694679200649261,
0.1864997148513794,
0.011617876589298248,
0.25560906529426575,
0.752722144126892... |
func (mlist *ModList) Enable(name string) {
for _, mod := range mlist.Mods {
if mod.Name == name {
mod.Enabled = true
return
}
}
mlist.Mods = append(mlist.Mods, &ModListEntry{
Name: name,
Enabled: true,
})
} | [
-0.45766398310661316,
-0.1756846159696579,
0.5800794363021851,
-0.25528788566589355,
-0.2726481556892395,
0.4239855408668518,
-1.1900752782821655,
1.2470873594284058,
0.4111403226852417,
1.1352015733718872,
-2.0590832233428955,
0.5076075196266174,
-0.9441235065460205,
0.8577022552490234,
... |
func (mlist *ModList) Write(filename string) error {
raw, err := json.Marshal(mlist)
if err != nil {
return fmt.Errorf("unable to encode json: %w", err)
}
if err := ioutil.WriteFile(filename, raw, 0644); err != nil {
return fmt.Errorf("unable to write file %q: %w", filename, err)
}
return nil
} | [
-1.273781180381775,
-0.5896262526512146,
0.28748250007629395,
-0.4645741283893585,
0.5966134667396545,
0.07298770546913147,
-0.29126831889152527,
0.6775522232055664,
0.028053784742951393,
0.6424475312232971,
-1.220619559288025,
0.3668094873428345,
-0.20185188949108124,
0.8741925358772278,
... |
func LoadModList(filename string) (*ModList, error) {
raw, err := ioutil.ReadFile(filename)
if err != nil {
return nil, fmt.Errorf("unable to read %q: %w", filename, err)
}
data := &ModList{}
if err := json.Unmarshal(raw, data); err != nil {
return nil, fmt.Errorf("unable to decode json from %q: %w", filename... | [
-1.0257289409637451,
-0.7575820088386536,
0.4833890497684479,
-1.1864416599273682,
-0.9685655236244202,
-0.22629722952842712,
-0.6800665855407715,
0.3974190652370453,
-0.007068635430186987,
0.8907635807991028,
-1.1346783638000488,
0.01776972785592079,
-0.7633680105209351,
0.195121496915817... |
func EnableMod(modsPath string, modName string) error {
modListFile := filepath.Join(modsPath, "mod-list.json")
mlist, err := LoadModList(modListFile)
if err != nil {
return err
}
mlist.Enable(modName)
return mlist.Write(modListFile)
} | [
-0.1806042641401291,
-0.9674996733665466,
0.796137273311615,
-0.4464196264743805,
-0.0273588877171278,
0.8972352743148804,
-0.24426338076591492,
1.347432017326355,
0.6439793109893799,
0.4397147297859192,
-0.8137632608413696,
1.0641475915908813,
-0.575880765914917,
0.31146150827407837,
0.... |
func Encode(data []byte) string {
// Factorio
var b bytes.Buffer
encoder := base64.NewEncoder(base64.StdEncoding, &b)
compress := zlib.NewWriter(encoder)
compress.Write(data)
compress.Close()
encoder.Close()
return b.String()
} | [
0.7709185481071472,
-0.08555546402931213,
0.32628104090690613,
1.466658353805542,
-0.6728129982948303,
0.012096657417714596,
0.029539521783590317,
-0.17449983954429626,
-0.12260057777166367,
0.2647092640399933,
0.49766603112220764,
-0.111963652074337,
-0.5739863514900208,
0.199047803878784... |
func (a Ant) ActualizaFeromonaLocalmente(indexVertex int){
pheromone0 := (*(*a.graph).vertexes)[indexVertex].pheromone_init
pheromonei := (*(*a.graph).vertexes)[indexVertex].pheromone
(*(*a.graph).vertexes)[indexVertex].pheromone = ((1-a.pheromone_adjust)*pheromonei)+(a.pheromone_adjust*pheromone0)
} | [
0.2129492163658142,
-1.0665135383605957,
0.5877501368522644,
-0.060034822672605515,
-0.8152769207954407,
-0.20911604166030884,
-0.7417491674423218,
0.39936527609825134,
0.4907715618610382,
0.4410025179386139,
-0.32201144099235535,
0.9316434264183044,
0.08515294641256332,
0.29976886510849,
... |
func (a Ant) Paso() {
//Primero calculamos el valor aleatorio q
q := a.random.Float64()
//Calculamos el valor RN poara todos los vertices
rnvalues := a.GetVertexesRNValue()
//sumrnValues nos rive para guardar la suma de los valores rn de todos los vertices
sumrnValues := 0.0
//maxrnvalue n... | [
0.33421215415000916,
-0.031491853296756744,
0.7961574792861938,
0.3834185004234314,
-0.03732497617602348,
-0.23947051167488098,
-0.19888591766357422,
0.1041836217045784,
0.6707400679588318,
-0.2004089504480362,
-0.27942585945129395,
-0.12007737904787064,
0.507101833820343,
0.76718544960021... |
func (a Ant) PuedeDarUnPaso() bool {
peso := (*a.graph).FullWeight()
if peso != 0{
return true
}else{
return false
}
} | [
0.3237575888633728,
-0.14128178358078003,
0.755316972732544,
-0.3175458312034607,
-0.0684082955121994,
0.771931529045105,
-0.6174838542938232,
0.9041376113891602,
0.3460516929626465,
-0.11576472222805023,
-0.3808818757534027,
-0.6799559593200684,
0.4935484826564789,
0.28262001276016235,
... |
func (a Ant) GetVertexesRNValue() []float64 {
numVertex := len((*(*a.graph).vertexes))
rnvalues := make([]float64, numVertex)
//fmt.Printf("Num vertexes %d\n", numVertex)
count := 0;
for count < numVertex {
indexVertex := (*(*a.graph).vertexes)[count].index
pheromoneVertex := (*(*a.g... | [
0.002005305839702487,
-0.6370713114738464,
0.6092031598091125,
0.43962931632995605,
-0.11177116632461548,
-0.3454055190086365,
-0.32850533723831177,
-0.15128852427005768,
0.12303506582975388,
-0.2697228193283081,
-0.8307422995567322,
0.14177802205085754,
0.3042147755622864,
0.6856436729431... |
func (a Ant) BorraSolucion(){
(*a.solution) = make([]int, 0)
} | [
-0.016030535101890564,
0.10384002327919006,
0.2890561521053314,
-0.6903465390205383,
1.3225462436676025,
-1.1698286533355713,
0.7785370349884033,
-0.32360681891441345,
0.5069396495819092,
0.24376153945922852,
-0.977105438709259,
0.44823601841926575,
-0.23446130752563477,
0.0306682121008634... |
func (a Ant) AgregaASolucion(v int){
(*a.solution) = append((*a.solution),v)
} | [
-0.7599127888679504,
0.3111056685447693,
0.4429675042629242,
-0.6947993040084839,
0.08757292479276657,
-0.7599379420280457,
-0.2232992798089981,
-0.5981587171554565,
0.6779769062995911,
0.18141311407089233,
-0.6668887734413147,
-0.42053696513175964,
0.586412250995636,
0.36075812578201294,
... |
func (a Ant) PrintSolution(){
count := 0;
fmt.Printf("Solucion: ")
for count < len((*a.solution)){
fmt.Printf("%d ", (*a.solution)[count])
count = count +1
}
fmt.Printf("\n")
} | [
-0.07274829596281052,
-0.7088724374771118,
0.5438374280929565,
-0.18444734811782837,
0.9985513091087341,
-0.3290955424308777,
0.10400687158107758,
-0.43867650628089905,
-0.22212223708629608,
-0.2731420397758484,
-0.1054847240447998,
0.4331284463405609,
0.6975941061973572,
0.736474215984344... |
func (g Graph) FullWeight() float64 {
count := 0;
weight := 0.0
for count < len(*g.full) {
weight = weight + (*g.full)[count].weight
count = count + 1
}
return weight
} | [
0.7234919667243958,
-0.3405686616897583,
0.49003374576568604,
0.666449248790741,
-0.14613975584506989,
-0.17692701518535614,
0.883298933506012,
0.14575207233428955,
-0.60415118932724,
0.4092862606048584,
-0.5832635164260864,
-0.2234373390674591,
-0.45972365140914917,
0.6777825951576233,
... |
func (g Graph) FullWeightOfVertex(v int) float64 {
count := 0;
weight := 0.0
for count < len(*g.full) {
v1temp := (*g.full)[count].v1_index
v2temp := (*g.full)[count].v2_index
if (v == v1temp || v == v2temp){
weight = weight + (*g.full)[count].weight
}
... | [
0.3734956979751587,
-0.57368403673172,
0.7122711539268494,
0.5511630177497864,
-0.663211464881897,
-0.6321947574615479,
1.1493213176727295,
-0.5593395233154297,
0.10756094753742218,
0.7411250472068787,
-0.9421536326408386,
0.418351411819458,
-0.34347400069236755,
0.07763374596834183,
-0.... |
func (g Graph) FullEdgesTo0ForVertex(v int) {
count := 0;
for count < len(*g.full) {
v1temp := (*g.full)[count].v1_index
v2temp := (*g.full)[count].v2_index
if (v == v1temp || v == v2temp){
//fmt.Printf("%d ---- %d\n", v1temp, v2temp)
(*g.full)[count].weight = 0.0
... | [
0.10563033074140549,
-0.7267431616783142,
0.5940147638320923,
-0.5446469783782959,
-0.017001105472445488,
-0.24040591716766357,
1.0882331132888794,
0.37306898832321167,
-0.11292017251253128,
0.7112697958946228,
-0.8831697702407837,
0.6922614574432373,
-0.0652596652507782,
0.648342847824096... |
func (g Graph) SetEdge(v1 int, v2 int, value float64){
count := 0;
for count < len(*g.full) {
v1temp := (*g.full)[count].v1_index
v2temp := (*g.full)[count].v2_index
if (v1 == v1temp && v2 == v2temp){
//fmt.Printf("%d ---- %d\n", v1temp, v2temp)
(*g.full)[count].w... | [
-0.4116092026233673,
-0.5115675926208496,
0.7776758074760437,
0.09031763672828674,
-0.11276638507843018,
-0.06285389512777328,
0.4610248804092407,
-0.28768736124038696,
-1.1014869213104248,
1.1150785684585571,
-0.41020044684410095,
0.5463114380836487,
-0.5644409656524658,
0.313952416181564... |
func (g Graph) ExisteEnEdges(v1 int, v2 int) bool {
count := 0;
for count < len(*g.edges) {
v1temp := (*g.edges)[count].v1_index
v2temp := (*g.edges)[count].v2_index
if (v1 == v1temp && v2 == v2temp){
//fmt.Printf("%d ---- %d\n", v1temp, v2temp)
return true
... | [
-0.9232252240180969,
-0.755523681640625,
0.9253605604171753,
-0.7753655314445496,
0.24051252007484436,
0.4378410875797272,
0.024162963032722473,
-0.23005534708499908,
-0.9789609313011169,
0.970156192779541,
-0.41880422830581665,
0.4138319194316864,
-0.9853484630584717,
-0.3593932092189789,... |
func (g Graph) initFull(){
numVertex := len(*g.vertexes)
count := 0
i := 0
for i < numVertex{
j := i+1
for j < numVertex{
if g.ExisteEnEdges(i,j){
(*g.full)[count] = Edge{i,j,1}
}else{
(*g.full)[count] = Edge{i,j,0}
}
... | [
0.6245667934417725,
0.28358787298202515,
0.7696089744567871,
-0.07126622647047043,
-0.06922070682048798,
-0.1556078940629959,
0.7413642406463623,
0.8739576935768127,
0.10906209796667099,
1.087477207183838,
-1.3866934776306152,
0.4152784049510956,
0.0068392157554626465,
0.053701434284448624... |
func (g Graph) PrintFull() {
count := 0;
for count < len(*g.full) {
(*g.full)[count].Print()
count = count + 1
}
} | [
0.8460181951522827,
0.09613943099975586,
0.5148587226867676,
0.19925066828727722,
0.5380077958106995,
0.2455083578824997,
0.49520978331565857,
-0.29530808329582214,
-0.5872547626495361,
0.7610461711883545,
-0.7671658396720886,
1.0608103275299072,
0.30065351724624634,
0.30821549892425537,
... |
func (g Graph) Print() {
count := 0;
for count < len(*g.vertexes) {
(*g.vertexes)[count].Print()
count = count + 1
}
count = 0;
for count < len(*g.edges) {
(*g.edges)[count].Print()
count = count + 1
}
} | [
0.21455271542072296,
0.46085983514785767,
0.47246497869491577,
0.08707092702388763,
0.6561452150344849,
0.7466650009155273,
0.44136500358581543,
0.12000959366559982,
-0.7647995352745056,
-0.28756657242774963,
-0.25835803151130676,
0.46555671095848083,
-0.14177750051021576,
0.47880116105079... |
func (v Vertex) GetIndex() int {
return v.index
} | [
0.04760020598769188,
0.15255965292453766,
0.12281309068202972,
0.6970542073249817,
0.1782410442829132,
0.1382989138364792,
1.2404450178146362,
1.0931663513183594,
0.44919171929359436,
0.031516071408987045,
-0.8889161348342896,
0.759343147277832,
-0.4571494162082672,
-0.5265565514564514,
... |
func (v Vertex) GetPheromone() float64 {
return v.pheromone
} | [
0.12163003534078598,
0.6294239163398743,
0.351003497838974,
1.2418181896209717,
0.04899721220135689,
0.24415519833564758,
-0.43683502078056335,
0.3583313822746277,
-0.3268052339553833,
-0.310662180185318,
-0.6626144051551819,
0.6519867777824402,
-1.6829770803451538,
-0.06488046795129776,
... |
func (v Vertex) Print() {
fmt.Printf("Vertice: %d\n Feromona Ini: %f\n Feromona Act: %f\n", v.index, v.pheromone_init, v.pheromone)
} | [
0.7009971141815186,
-0.35694390535354614,
0.322686105966568,
0.45705920457839966,
0.8489037752151489,
0.35129794478416443,
-0.30998218059539795,
0.022528085857629776,
-0.5157495141029358,
-0.6335787177085876,
-0.45162487030029297,
1.3235448598861694,
-0.7415135502815247,
-0.129089295864105... |
func (e Edge) GetWeight() float64 {
return e.weight
} | [
0.39729076623916626,
0.43566352128982544,
0.654808759689331,
0.9170687198638916,
1.001160979270935,
0.21718843281269073,
0.7363629341125488,
0.1420338749885559,
-0.23319843411445618,
0.5572617650032043,
0.1918054074048996,
-0.3367636799812317,
-0.2996908128261566,
0.8576939105987549,
-0.... |
func (e Edge) GetVertex1() int {
return e.v1_index
} | [
-0.13573744893074036,
-0.02986743301153183,
0.29015910625457764,
1.260372519493103,
0.15529952943325043,
0.22560694813728333,
1.0925737619400024,
0.8604811429977417,
0.27284181118011475,
1.0842792987823486,
-0.12372970581054688,
1.2459876537322998,
-0.13862165808677673,
-0.3527171313762665... |
func (e Edge) GetVertex2() int {
return e.v2_index
} | [
-0.10224348306655884,
-0.9991483092308044,
0.2907859683036804,
0.7150552272796631,
-0.412058025598526,
-0.2039874792098999,
0.4723181426525116,
0.3336998522281647,
0.06692401319742203,
0.39790335297584534,
-0.49240806698799133,
1.3588261604309082,
-0.010479694232344627,
-0.0120833516120910... |
func (e Edge) Print() {
fmt.Printf("%d --(%f)-- %d\n", e.v1_index, e.weight, e.v2_index)
} | [
-0.1296376883983612,
-0.3466716706752777,
0.4706454575061798,
-0.3954682946205139,
0.8614532947540283,
0.701638400554657,
-0.42881909012794495,
-0.3263400197029114,
-0.8032497763633728,
0.46005237102508545,
0.4650643467903137,
0.8667015433311462,
-0.2556460499763489,
-0.18976102769374847,
... |
func main() {
//Leemos el archivo
data, err := ioutil.ReadFile("g.txt")
if err != nil {
fmt.Println("File reading error", err)
return
}
rows := strings.Split(string(data), "\n")
//Inicializamos los vertices
numOfVertexes, _ := strconv.Atoi(rows[0])
vertexesG := make([]Ver... | [
0.524625301361084,
-0.3039385974407196,
0.9221041202545166,
0.4265907406806946,
-0.577346682548523,
0.3261486887931824,
0.6762412786483765,
0.5111731886863708,
-0.3411898910999298,
0.3993535339832306,
-0.24971987307071686,
0.28255078196525574,
-0.027925556525588036,
0.18338656425476074,
... |
func ModifiedDirectoriesIncludeGlobs(globs ...string) ModifiedDirectoriesOption {
return func(opts *ModifiedDirectoriesOptions) {
opts.IncludeGlobs = globs
}
} | [
-0.08740466833114624,
0.3769610524177551,
0.45187515020370483,
0.07828592509031296,
-1.0062544345855713,
1.2119967937469482,
0.9940354824066162,
-0.02916577272117138,
1.8762637376785278,
0.02130778506398201,
0.3229932188987732,
0.19999843835830688,
-1.4859449863433838,
0.5280439853668213,
... |
func ModifiedDirectoriesExcludeGlobs(globs ...string) ModifiedDirectoriesOption {
return func(opts *ModifiedDirectoriesOptions) {
opts.ExcludeGlobs = globs
}
} | [
-0.6438038349151611,
0.5953437685966492,
0.4980596899986267,
-0.19066299498081207,
-1.5663858652114868,
1.209822654724121,
0.8567132353782654,
-0.2590033710002899,
1.6649283170700073,
0.22964568436145782,
0.14863887429237366,
0.09251164644956589,
-2.010380268096924,
0.5861483812332153,
-... |
func GoodJSONConfFile(t *testing.T) string {
t.Helper()
goodJSONConfFile := `[
{
"TableName" : "UserAccounts",
"Filter" : "LOG0 = 'UserAccounts'",
"DeleteMarkerField": "__DELETE__",
"FieldMappings" : [
{"Field": "userAddress" , "ColumnName" : "address", "Type": "address", "Primary" : true},
{"... | [
-0.018525561317801476,
-0.7606715559959412,
0.8964360952377319,
-1.1570987701416016,
-0.9857283234596252,
-0.3082239031791687,
0.5023660063743591,
-0.02020690217614174,
-0.24838930368423462,
0.5627853870391846,
-0.8079174160957336,
0.40152081847190857,
0.6049773693084717,
-0.44146233797073... |
func MissingFieldsJSONConfFile(t *testing.T) string {
t.Helper()
missingFieldsJSONConfFile := `[
{
"TableName" : "UserAccounts",
"Fields" ,
"userAddress" , "ColumnName" : "address", "Primary" : true},
"userName", "ColumnName" : "username", "Primary" : false}
}
}
]`
return missingFieldsJSONC... | [
0.14650815725326538,
-0.3552829921245575,
0.36556804180145264,
-0.9740376472473145,
-0.18148866295814514,
0.5110305547714233,
0.8453103303909302,
-0.07760494947433472,
-0.9332291483879089,
0.009018655866384506,
-1.07222580909729,
-0.14015819132328033,
0.5000253915786743,
-0.411825329065322... |
func UnknownTypeJSONConfFile(t *testing.T) string {
t.Helper()
unknownTypeJSONConfFile := `[
{
"TableName" : "UserAccounts",
"Filter" : "LOG0 = 'UserAccounts'",
"DeleteMarkerField": "__DELETE__",
"Event" ,
"anonymous": false,
"inputs": [{
"indexed": false,
"ColumnName": "userName",
... | [
-0.1634979099035263,
-0.931972324848175,
0.9320518970489502,
-1.097848892211914,
-0.44619977474212646,
-0.3276435136795044,
0.7298924922943115,
-0.5431183576583862,
-0.6581870913505554,
0.20274287462234497,
-0.7618676424026489,
0.33826586604118347,
0.14598862826824188,
-0.606843888759613,
... |
func BadJSONConfFile(t *testing.T) string {
t.Helper()
badJSONConfFile := `[
{
"TableName" : "UserAccounts",
"Event" ,
"anonymous": false,
"inputs": [{
"indexed": false,
"ColumnName": "userName",
"Type": "string"
}, {
"indexed": false,
"ColumnName": "userAddress",
... | [
0.12632980942726135,
-0.885199248790741,
0.6485887169837952,
-0.7804170250892639,
-0.5943595767021179,
-0.11233783513307571,
0.28131964802742004,
-0.0611463263630867,
-0.7596505880355835,
0.30651581287384033,
-0.6118614673614502,
0.45989349484443665,
0.40305638313293457,
-0.214294999837875... |
func DuplicatedColNameJSONConfFile(t *testing.T) string {
t.Helper()
duplicatedColNameJSONConfFile := `[
{
"TableName" : "DUPLICATED_COLUMN",
"Filter" : "LOG0 = 'UserAccounts'",
"DeleteMarkerField": "__DELETE__",
"Fields" ,
"userAddress" , "ColumnName" : "address", "Primary" : true},
"userNam... | [
-0.04532661661505699,
-0.8434534668922424,
0.5844166278839111,
-1.168036937713623,
-0.534753680229187,
0.08245576173067093,
0.5883500576019287,
-0.5722864270210266,
-0.4597243368625641,
0.3180989921092987,
-1.5765219926834106,
0.570476233959198,
0.9062848687171936,
-0.30132749676704407,
... |
func ConstraintError(cause error) error {
return errors.Wrapf(cause, "Fail on validate business rules constraints.")
} | [
0.27638599276542664,
-0.12611913681030273,
0.1679343730211258,
0.9001181721687317,
0.32823365926742554,
0.053820181638002396,
0.274511456489563,
0.2902386784553528,
0.0073952097445726395,
1.051762580871582,
0.4121498763561249,
0.3129504919052124,
0.37688469886779785,
-0.7377221584320068,
... |
func NewEnvironment(env ...string) *Environment {
e := Environment{
Hidden: &Environment{},
}
for _, keyvalue := range env {
pair := strings.SplitN(keyvalue, "=", 2)
e.Add(pair[0], pair[1])
}
return &e
} | [
-1.1380796432495117,
-0.11336465179920197,
0.3013879060745239,
-0.23968076705932617,
-0.17320020496845245,
-0.02348772995173931,
0.15766087174415588,
-0.16880576312541962,
-0.26722273230552673,
0.8789567351341248,
-0.8130844235420227,
0.4020620286464691,
0.16684500873088837,
0.409138590097... |
func (e *Environment) Update(a [][]string) {
for _, keyvalue := range a {
e.Add(keyvalue[0], keyvalue[1])
}
} | [
-1.2818858623504639,
-0.6967287063598633,
0.32554519176483154,
-0.8602932691574097,
-0.032765477895736694,
0.6289664506912231,
-0.646530270576477,
0.5596463084220886,
-0.4479425549507141,
1.6237387657165527,
0.5619829297065735,
0.3722302317619324,
0.13707223534584045,
0.33696168661117554,
... |
func (e *Environment) Add(key, value string) {
if e.Map == nil {
e.Map = make(map[string]string)
}
if _, ok := e.Map[key]; !ok {
e.Order = append(e.Order, key)
}
e.Map[key] = value
} | [
-0.9692600965499878,
-0.7651283144950867,
0.6076517701148987,
-0.3067842721939087,
-0.1488276571035385,
0.5456590056419373,
-0.8775021433830261,
0.31918442249298096,
-0.018360301852226257,
0.7477874159812927,
0.6029998660087585,
0.5620132088661194,
0.31841909885406494,
1.0714449882507324,
... |
func (e *Environment) AddIfMissing(key, value string) {
if e.Map == nil {
e.Add(key, value)
} else if _, ok := e.Map[key]; !ok {
e.Add(key, value)
}
} | [
-0.2981615960597992,
-0.6094693541526794,
0.6983304023742676,
-0.6426599025726318,
0.42697352170944214,
0.8553589582443237,
-1.8506782054901123,
-0.3182384669780731,
-0.23365356028079987,
1.1211618185043335,
0.2997550368309021,
0.4459790885448456,
0.25127848982810974,
1.0895901918411255,
... |
func (e *Environment) PassThruProxyConfig() {
if e.Map == nil {
return
}
for _, key := range proxyEnv {
value, ok := e.Map[key]
if ok {
e.AddIfMissing(fmt.Sprintf("%s%s", public, key), value)
}
}
} | [
-0.8670459389686584,
0.27910593152046204,
0.5838720202445984,
-1.0698806047439575,
0.76348477602005,
0.6159839034080505,
-0.21430335938930511,
0.7073741555213928,
-0.9875220656394958,
0.9656628370285034,
-0.16028881072998047,
-0.5202426910400391,
-0.059436142444610596,
1.243078351020813,
... |
func (e *Environment) Get(key string) string {
if e.Map != nil {
if val, ok := e.Map[key]; ok {
return val
}
}
return ""
} | [
-0.8002704381942749,
-0.5052645206451416,
0.5129101872444153,
-0.3396519124507904,
-0.32454565167427063,
0.28222453594207764,
-0.9489383101463318,
-0.24455900490283966,
-0.5062511563301086,
0.6940630078315735,
0.7296203970909119,
0.5763168334960938,
-0.18575158715248108,
0.7332045435905457... |
func (e *Environment) Export() []string {
s := []string{}
for _, key := range e.Order {
export := fmt.Sprintf(`export %s=%q`, key, e.Map[key])
export = strings.Replace(export, "`", "\\`", -1)
s = append(s, export)
}
return s
} | [
-0.6095040440559387,
-0.24563883244991302,
0.9247960448265076,
0.7381898164749146,
-0.17241187393665314,
0.2100362479686737,
-0.6664963960647583,
-0.6054163575172424,
-0.1852545589208603,
1.7420971393585205,
-0.09721184521913528,
0.3779928982257843,
0.13833078742027283,
1.0924489498138428,... |
func (e *Environment) Ordered() [][]string {
a := [][]string{}
for _, k := range e.Order {
a = append(a, []string{k, e.Map[k]})
}
return a
} | [
-0.9562891721725464,
-0.9915578365325928,
0.4275906980037689,
-0.6574857234954834,
0.3059091567993164,
0.09044361859560013,
-1.0108153820037842,
-0.18195554614067078,
-0.2630150020122528,
0.3956429958343506,
0.3217722475528717,
0.4862673282623291,
1.0392184257507324,
0.7401435375213623,
... |
func (e *Environment) Interpolate(s string) string {
return os.Expand(s, e.GetInclHidden)
} | [
0.5151271820068359,
0.556422233581543,
0.6926871538162231,
-0.2709377706050873,
-0.7063812017440796,
0.23457711935043335,
0.13110627233982086,
-0.34647148847579956,
0.06503234803676605,
0.13707858324050903,
1.231224775314331,
-0.32598528265953064,
-0.5009975433349609,
0.0498168021440506,
... |
func (e *Environment) GetPassthru() (env *Environment) {
return e.passthru(public)
} | [
-0.47671186923980713,
0.4177229106426239,
0.5542216897010803,
-0.25043854117393494,
0.8347506523132324,
0.449307918548584,
0.1471310704946518,
-0.1978549063205719,
-0.9216863512992859,
-0.9668578505516052,
0.5034023523330688,
0.9242985248565674,
-0.40219804644584656,
-0.24536225199699402,
... |
func (e *Environment) GetHiddenPassthru() (env *Environment) {
return e.passthru(protected)
} | [
0.08036433905363083,
0.3350505530834198,
0.642870306968689,
-0.08711706101894379,
0.17087280750274658,
0.8904656767845154,
0.6869890093803406,
-0.191116601228714,
-0.015388250350952148,
-1.042083740234375,
-0.12037301063537598,
1.058900237083435,
-0.4069748818874359,
-0.36784785985946655,
... |
func (e *Environment) GetInclHidden(key string) string {
if e.Map != nil {
if val, ok := e.Map[key]; ok {
return val
}
}
if e.Hidden != nil && e.Hidden.Map != nil {
if val, ok := e.Hidden.Map[key]; ok {
return val
}
}
return ""
} | [
0.7800187468528748,
-0.6661017537117004,
1.0989524126052856,
0.11231669783592224,
-1.4352065324783325,
0.3667781949043274,
0.06368707865476608,
-0.08734577894210815,
0.208583801984787,
0.05773181840777397,
0.24515756964683533,
1.497747778892517,
-0.42806169390678406,
0.8906443119049072,
... |
func (e *Environment) LoadFile(f string) error {
file, err := os.Open(f)
if err != nil {
return err
}
defer file.Close()
s := bufio.NewScanner(file)
for ok := s.Scan(); ok; ok = s.Scan() {
// Ignore comments
if strings.HasPrefix(s.Text(), "#") {
continue
}
parts := strings.SplitN(s.Text(), "=", 2)
... | [
-0.2754329442977905,
0.33024531602859497,
0.6697452068328857,
-0.3525542616844177,
-0.20009109377861023,
0.1487829089164734,
-0.18696126341819763,
0.24117466807365417,
-1.2589170932769775,
0.882327675819397,
0.1441998928785324,
-0.3822074830532074,
-0.16548700630664825,
0.8695265650749207,... |
func (e *Error) Code() int { return e.code } | [
-0.9722251892089844,
-0.13550008833408356,
0.1478005051612854,
0.16853639483451843,
0.12162065505981445,
0.5092140436172485,
0.5099687576293945,
0.7674060463905334,
0.26599326729774475,
-0.23266896605491638,
0.42877858877182007,
0.08819754421710968,
0.6394748687744141,
0.6899307370185852,
... |
func (e Error) MarshalJSON() ([]byte, error) {
return json.Marshal(jsonError{jsonType, e.message, e.code})
} | [
-1.0594675540924072,
0.10918138921260834,
0.27808213233947754,
-0.17250512540340424,
-0.19631190598011017,
-0.3277323246002197,
-0.5115445852279663,
-0.07533065229654312,
1.0004141330718994,
0.5485944151878357,
-0.6874200105667114,
1.5326095819473267,
0.038554586470127106,
1.00852763652801... |
func (e *Error) UnmarshalJSON(b []byte) error {
var je jsonError
if err := json.Unmarshal(b, &je); err != nil {
return err
}
if je.Type != jsonType {
return ErrJSONInvalidUnmarshal
}
e.code = je.Code
e.message = je.Message
return nil
} | [
-1.1344494819641113,
0.2495114803314209,
0.6290233135223389,
-0.5325490832328796,
-0.44132837653160095,
-0.32143881916999817,
0.2471190094947815,
0.40231555700302124,
0.8947738409042358,
0.46396368741989136,
-0.12697263062000275,
0.6940707564353943,
-0.3535480499267578,
0.4477609694004059,... |
func (e *ErrorSet) New(msg string) *Error {
e.l.Lock()
defer e.l.Unlock()
err := newError(len(e.errs), msg)
e.errs = append(e.errs, err)
return err
} | [
-0.28302833437919617,
-0.5841325521469116,
0.09254186600446701,
-1.0623372793197632,
-0.3198433816432953,
-0.6964096426963806,
-0.21383170783519745,
-0.045916106551885605,
0.1922648698091507,
-0.5460619926452637,
0.44983822107315063,
0.48211368918418884,
0.35843324661254883,
0.725215554237... |
func (e *ErrorSet) FromJSON(b []byte) (*Error, error) {
var je jsonError
if err := json.Unmarshal(b, &je); err != nil {
return nil, err
}
if je.Type != jsonType {
return nil, ErrJSONInvalidUnmarshal
}
return e.FromCode(je.Code), nil
} | [
-0.426677405834198,
-0.49017876386642456,
0.47946223616600037,
-0.5067375302314758,
-0.8108581304550171,
-0.6220782995223999,
0.014214867725968361,
-0.326116681098938,
1.1801530122756958,
0.168831005692482,
0.018171995878219604,
1.1631276607513428,
-0.07816500961780548,
0.00863558147102594... |
func (e *ErrorSet) Member(err error) bool {
err2, ok := err.(*Error)
if !ok {
return false
}
e.l.RLock()
defer e.l.RUnlock()
return e.errs[err2.Code()] == err2
} | [
-0.9849733114242554,
-0.7867636680603027,
0.15097640454769135,
-0.11744273453950882,
-0.7806069850921631,
-0.39167720079421997,
-1.0088790655136108,
-0.4816795289516449,
0.7857334613800049,
-0.1811022013425827,
-0.024691108614206314,
0.6319432258605957,
-0.04081311076879501,
0.296023607254... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.