text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (w Watcher) Do(ctx context.Context, listen string) error {
var dialer net.Dialer
for {
if ctx.Err() != nil {
return ctx.Err()
}
if conn, err := dialer.DialContext(ctx, "tcp", listen); err != nil {
time.Sleep(w.Interval)
if ctx.Err() != nil {
return err
}
continue
} else {
conn.Close... | [
0.9183655381202698,
0.11281979829072952,
0.9493034482002258,
-0.28863227367401123,
0.13305427134037018,
0.9032716751098633,
-0.961940586566925,
-1.3749336004257202,
-0.45361414551734924,
0.6810716986656189,
0.599216103553772,
0.602356493473053,
0.03207463398575783,
0.43883422017097473,
-... |
func (s *Server) GetStatValue(ctx context.Context, in *pb.GetStatValueRequest) (
*pb.GetStatValueResponse, error) {
place := in.GetPlace()
statVar := in.GetStatVar()
svobsMode := s.metadata.SvObsMode
if place == "" {
return nil, status.Errorf(codes.InvalidArgument,
"Missing required argument: place")
}
if ... | [
-0.6905626654624939,
0.8081904649734497,
0.7319967746734619,
0.3791748285293579,
-0.04552103206515312,
-0.31820112466812134,
0.5869641304016113,
-0.1043906956911087,
-0.20339742302894592,
0.2363751232624054,
0.7118642330169678,
1.274456262588501,
0.6991711258888245,
0.7417470216751099,
0... |
func (s *Server) GetStatSet(ctx context.Context, in *pb.GetStatSetRequest) (
*pb.GetStatSetResponse, error) {
places := in.GetPlaces()
statVars := in.GetStatVars()
date := in.GetDate()
svobsMode := s.metadata.SvObsMode
if len(places) == 0 {
return nil, status.Errorf(codes.InvalidArgument,
"Missing required ... | [
-0.7017393112182617,
0.6656941175460815,
0.5607720613479614,
-0.016261471435427666,
0.006520923227071762,
-0.36786457896232605,
0.5990140438079834,
0.00350324809551239,
-0.037456318736076355,
-0.1176767498254776,
0.4666762948036194,
0.6782350540161133,
0.6058236360549927,
0.503467798233032... |
func (s *Server) GetStatCollection(
ctx context.Context, in *pb.GetStatCollectionRequest) (
*pb.GetStatCollectionResponse, error) {
parentPlace := in.GetParentPlace()
statVars := in.GetStatVars()
childType := in.GetChildType()
date := in.GetDate()
svobsMode := s.metadata.SvObsMode
if parentPlace == "" {
retu... | [
-1.0188003778457642,
0.5672838687896729,
0.8176124691963196,
0.2318379133939743,
-0.0876801386475563,
-0.05627745762467384,
0.7282509207725525,
-0.9643665552139282,
-0.18651270866394043,
0.05070789158344269,
-0.018266068771481514,
0.7238750457763672,
0.3498324155807495,
0.7236183881759644,... |
func NewBroker() (*Broker, error) {
mqttConfigFile := config.NodeConfig.GetString(config.CfgMQTTConfig)
c, err := broker.ConfigureConfig([]string{fmt.Sprintf("--config=%s", mqttConfigFile)})
if err != nil {
log.Fatal("configure broker config error: ", err)
}
b, err := broker.NewBroker(c)
if err != nil {
log.... | [
0.3705422282218933,
-0.6318734884262085,
0.592447817325592,
0.6003937125205994,
-0.7932468056678772,
0.2402045577764511,
-0.27457401156425476,
0.39167168736457825,
0.14496202766895294,
-0.08829408138990402,
-0.09756216406822205,
0.34834355115890503,
-0.8591722249984741,
0.8909240365028381,... |
func (b *Broker) Send(topic string, message string) error {
packet := packets.NewControlPacket(packets.Publish).(*packets.PublishPacket)
packet.TopicName = topic
packet.Qos = 0
packet.Payload = []byte(message)
b.broker.PublishMessage(packet)
return nil
} | [
0.46755027770996094,
0.35200709104537964,
0.2452232837677002,
0.6503208875656128,
0.10511747747659683,
0.032705213874578476,
-1.1772818565368652,
-0.03657635673880577,
-0.3006707429885864,
0.3044340908527374,
-0.0032766801305115223,
0.47265103459358215,
-1.4431549310684204,
0.1327995210886... |
func (mctx *ModuleContext) EvalDynamic(expr hcl.Expression, each EachState) (DynExpr, hcl.Diagnostics) {
var diags hcl.Diagnostics
switch te := expr.(type) {
case *hclsyntax.LiteralValueExpr:
return &DynLiteral{
Value: te.Val,
SrcRange: te.SrcRange,
}, diags
case *hclsyntax.ScopeTraversalExpr:
ret... | [
-0.4023447334766388,
0.10164286941289902,
0.8385738134384155,
-0.27056819200515747,
-0.327981561422348,
-0.641625165939331,
-0.10385537147521973,
0.045285582542419434,
-0.2940121591091156,
-0.2548830509185791,
-0.4488599896430969,
-0.055618397891521454,
0.4963061213493347,
0.49242621660232... |
func (cmd *TokenAuthCommand) Run(c *client.Client, args []string) error {
var path string
if len(args) > 0 {
path = args[0]
} else {
path = "/auth/token"
}
var payload client.TokenAuthPayload
if cmd.Payload != "" {
err := json.Unmarshal([]byte(cmd.Payload), &payload)
if err != nil {
return fmt.Errorf("... | [
-0.9143536686897278,
-0.5178743004798889,
0.732010006904602,
-0.3810131251811981,
-0.15179812908172607,
0.11502373218536377,
0.868798553943634,
-0.060528211295604706,
-0.598595142364502,
-0.0722072571516037,
-0.3196830153465271,
1.0900723934173584,
-0.7393047213554382,
-0.0461423359811306,... |
func (cmd *TokenAuthCommand) RegisterFlags(cc *cobra.Command, c *client.Client) {
cc.Flags().StringVar(&cmd.Payload, "payload", "", "Request JSON body")
} | [
-0.1292094737291336,
0.8350443840026855,
0.2868930399417877,
-0.9433943629264832,
1.5825378894805908,
0.43459659814834595,
-0.9355723261833191,
-0.3114509880542755,
-0.5589698553085327,
-0.9164679646492004,
-0.7506106495857239,
1.1948193311691284,
-0.8073504567146301,
0.9622346758842468,
... |
func (cmd *CreatePostCommand) Run(c *client.Client, args []string) error {
var path string
if len(args) > 0 {
path = args[0]
} else {
path = "/posts"
}
var payload client.CreatePostPayload
if cmd.Payload != "" {
err := json.Unmarshal([]byte(cmd.Payload), &payload)
if err != nil {
return fmt.Errorf("fai... | [
-0.6744339466094971,
-0.3070768415927887,
0.7199506163597107,
-0.14115792512893677,
0.2978575527667999,
0.7354000210762024,
0.7114907503128052,
-0.17376527190208435,
-1.0236756801605225,
-0.19053560495376587,
-0.44990772008895874,
-0.10129060596227646,
-1.0302468538284302,
0.60084956884384... |
func (cmd *CreatePostCommand) RegisterFlags(cc *cobra.Command, c *client.Client) {
cc.Flags().StringVar(&cmd.Payload, "payload", "", "Request JSON body")
c.SignerJWT.RegisterFlags(cc)
} | [
0.14326047897338867,
0.9005754590034485,
0.29348623752593994,
-0.31243231892585754,
1.5571880340576172,
0.5915034413337708,
-0.9109581708908081,
-0.3836947977542877,
-1.0294450521469116,
-1.0631777048110962,
-0.8582437634468079,
0.2137586772441864,
-1.074828863143921,
1.6203360557556152,
... |
func (cmd *DeletePostCommand) Run(c *client.Client, args []string) error {
var path string
if len(args) > 0 {
path = args[0]
} else {
path = fmt.Sprintf("/posts/%v", cmd.PostID)
}
logger := goa.NewLogger(log.New(os.Stderr, "", log.LstdFlags))
ctx := goa.WithLogger(context.Background(), logger)
resp, err := c... | [
-0.6333709359169006,
-0.4516133666038513,
0.4719153642654419,
0.14341016113758087,
0.2002529352903366,
0.3577593266963959,
0.6550766825675964,
0.03645046800374985,
-0.5193111896514893,
-0.27682173252105713,
0.03668786957859993,
0.4397406280040741,
-1.0694561004638672,
0.42359471321105957,
... |
func (cmd *DeletePostCommand) RegisterFlags(cc *cobra.Command, c *client.Client) {
var postID int
cc.Flags().IntVar(&cmd.PostID, "postID", postID, `Post ID`)
c.SignerJWT.RegisterFlags(cc)
} | [
0.7732666730880737,
0.9570149183273315,
0.21832241117954254,
0.14537140727043152,
1.278236746788025,
0.1819206029176712,
-0.9735342264175415,
0.3082529604434967,
-0.5509044528007507,
-1.0354913473129272,
-0.6329817175865173,
0.4875914454460144,
-0.8954561948776245,
1.714845895767212,
0.0... |
func (cmd *ShowPostCommand) Run(c *client.Client, args []string) error {
var path string
if len(args) > 0 {
path = args[0]
} else {
path = fmt.Sprintf("/posts/%v", cmd.PostID)
}
logger := goa.NewLogger(log.New(os.Stderr, "", log.LstdFlags))
ctx := goa.WithLogger(context.Background(), logger)
resp, err := c.S... | [
-0.5197777152061462,
-0.08055086433887482,
0.6857880353927612,
0.1689411848783493,
-0.27765053510665894,
0.3427547216415405,
0.8739743232727051,
0.4137452244758606,
-0.4834221601486206,
-0.43016406893730164,
-0.15766555070877075,
0.9731001853942871,
-0.5690597295761108,
0.6433237791061401,... |
func (cmd *ShowPostCommand) RegisterFlags(cc *cobra.Command, c *client.Client) {
var postID int
cc.Flags().IntVar(&cmd.PostID, "postID", postID, `Post ID`)
c.SignerJWT.RegisterFlags(cc)
} | [
0.8199281096458435,
1.0940479040145874,
0.2622195780277252,
0.09091293066740036,
0.9430257081985474,
0.15363720059394836,
-0.6488143801689148,
0.26193884015083313,
-0.6039372682571411,
-0.9938933849334717,
-0.8329288959503174,
0.8024587035179138,
-0.6142430305480957,
1.7991385459899902,
... |
func (cmd *UpdatePostCommand) Run(c *client.Client, args []string) error {
var path string
if len(args) > 0 {
path = args[0]
} else {
path = fmt.Sprintf("/posts/%v", cmd.PostID)
}
var payload client.UpdatePostPayload
if cmd.Payload != "" {
err := json.Unmarshal([]byte(cmd.Payload), &payload)
if err != nil... | [
-0.9344990849494934,
-0.6313921213150024,
0.7945003509521484,
-0.08939986675977707,
-0.3066399395465851,
0.2798183560371399,
0.6683642864227295,
0.010214023292064667,
-0.6474348306655884,
0.16127775609493256,
-0.42342814803123474,
0.18932732939720154,
-1.240171194076538,
0.2040777504444122... |
func (cmd *UpdatePostCommand) RegisterFlags(cc *cobra.Command, c *client.Client) {
cc.Flags().StringVar(&cmd.Payload, "payload", "", "Request JSON body")
var postID int
cc.Flags().IntVar(&cmd.PostID, "postID", postID, `Post ID`)
c.SignerJWT.RegisterFlags(cc)
} | [
0.1428743153810501,
0.5300107002258301,
0.4554564952850342,
-0.1376558095216751,
1.0874210596084595,
0.348773717880249,
-0.9805077314376831,
-0.0031810193322598934,
-0.8748772144317627,
-0.6356088519096375,
-0.8148708343505859,
0.13443855941295624,
-1.1038120985031128,
1.5550966262817383,
... |
func (cmd *CreateUserCommand) Run(c *client.Client, args []string) error {
var path string
if len(args) > 0 {
path = args[0]
} else {
path = "/users"
}
var payload client.CreateUserPayload
if cmd.Payload != "" {
err := json.Unmarshal([]byte(cmd.Payload), &payload)
if err != nil {
return fmt.Errorf("fai... | [
-0.9333908557891846,
-0.1775841861963272,
0.6475622653961182,
-0.20685026049613953,
0.22510063648223877,
0.7808412313461304,
1.2621631622314453,
-0.4146183431148529,
-0.7292353510856628,
-0.047606460750103,
-0.21127182245254517,
0.2001175880432129,
-1.1597545146942139,
0.5909520387649536,
... |
func (cmd *CreateUserCommand) RegisterFlags(cc *cobra.Command, c *client.Client) {
cc.Flags().StringVar(&cmd.Payload, "payload", "", "Request JSON body")
} | [
0.02462777867913246,
1.13968825340271,
0.22623009979724884,
-0.4295729398727417,
1.6750441789627075,
0.8133344650268555,
-0.5370960831642151,
-0.5584332942962646,
-0.9499488472938538,
-1.172412633895874,
-0.8833749294281006,
0.8213146924972534,
-0.8661310076713562,
1.2533907890319824,
0.... |
func (cmd *DeleteUserCommand) Run(c *client.Client, args []string) error {
var path string
if len(args) > 0 {
path = args[0]
} else {
path = fmt.Sprintf("/users/%v", cmd.UserID)
}
logger := goa.NewLogger(log.New(os.Stderr, "", log.LstdFlags))
ctx := goa.WithLogger(context.Background(), logger)
resp, err := c... | [
-0.9653132557868958,
-0.5272795557975769,
0.5294539332389832,
0.4404062330722809,
0.08494936674833298,
0.5827974081039429,
1.4361563920974731,
-0.11804008483886719,
-0.4134114384651184,
-0.3415721356868744,
0.17064239084720612,
0.8942360877990723,
-1.0561124086380005,
0.5872783660888672,
... |
func (cmd *DeleteUserCommand) RegisterFlags(cc *cobra.Command, c *client.Client) {
var userID int
cc.Flags().IntVar(&cmd.UserID, "userID", userID, `User ID`)
} | [
0.5225714445114136,
1.0516059398651123,
0.05044534429907799,
0.3599092960357666,
1.0383048057556152,
0.542367696762085,
0.09455312043428421,
0.3861714005470276,
-0.2488294541835785,
-1.2755314111709595,
-0.7075330018997192,
1.2392029762268066,
-0.8080843687057495,
1.6592320203781128,
0.0... |
func (cmd *ShowUserCommand) Run(c *client.Client, args []string) error {
var path string
if len(args) > 0 {
path = args[0]
} else {
path = fmt.Sprintf("/users/%v", cmd.UserID)
}
logger := goa.NewLogger(log.New(os.Stderr, "", log.LstdFlags))
ctx := goa.WithLogger(context.Background(), logger)
resp, err := c.S... | [
-0.7170476913452148,
-0.11652746796607971,
0.6442084908485413,
0.2173990160226822,
-0.5707252621650696,
0.4867972731590271,
1.496443510055542,
0.22465337812900543,
-0.36042219400405884,
-0.3479597270488739,
0.014361107721924782,
1.2189605236053467,
-0.6022331714630127,
0.5744375586509705,
... |
func (cmd *ShowUserCommand) RegisterFlags(cc *cobra.Command, c *client.Client) {
var userID int
cc.Flags().IntVar(&cmd.UserID, "userID", userID, `User ID`)
} | [
0.5276983380317688,
1.2397546768188477,
0.10373802483081818,
0.2953275144100189,
0.737629234790802,
0.5356960296630859,
0.28213319182395935,
0.366262823343277,
-0.3548939526081085,
-1.160320520401001,
-0.9174817204475403,
1.4551085233688354,
-0.4947410821914673,
1.631280779838562,
0.2488... |
func (cmd *UpdateUserCommand) Run(c *client.Client, args []string) error {
var path string
if len(args) > 0 {
path = args[0]
} else {
path = fmt.Sprintf("/users/%v", cmd.UserID)
}
var payload client.UpdateUserPayload
if cmd.Payload != "" {
err := json.Unmarshal([]byte(cmd.Payload), &payload)
if err != nil... | [
-1.1558877229690552,
-0.5942440032958984,
0.9169778227806091,
0.055858269333839417,
-0.5090271830558777,
0.3766826093196869,
1.2776548862457275,
-0.038613155484199524,
-0.42855918407440186,
0.2729558050632477,
-0.27762916684150696,
0.6519216895103455,
-1.1030575037002563,
0.280384421348571... |
func (cmd *UpdateUserCommand) RegisterFlags(cc *cobra.Command, c *client.Client) {
cc.Flags().StringVar(&cmd.Payload, "payload", "", "Request JSON body")
var userID int
cc.Flags().IntVar(&cmd.UserID, "userID", userID, `User ID`)
} | [
-0.19980072975158691,
0.6849222183227539,
0.35284218192100525,
0.07108805328607559,
0.9185243844985962,
0.5639931559562683,
-0.336475670337677,
-0.12859445810317993,
-0.7267923951148987,
-0.6964797973632812,
-0.7283447980880737,
1.0173118114471436,
-0.9847494959831238,
1.4023903608322144,
... |
func (*UploadConversionAdjustmentsRequest) Descriptor() ([]byte, []int) {
return file_google_ads_googleads_v14_services_conversion_adjustment_upload_service_proto_rawDescGZIP(), []int{0}
} | [
-0.7453507781028748,
0.6612920761108398,
0.4543732702732086,
-0.7339637279510498,
-0.10144046694040298,
0.08771607279777527,
0.5976045727729797,
-1.12736976146698,
-1.0867663621902466,
0.44147855043411255,
1.1980618238449097,
0.05393261834979057,
-0.3230522572994232,
0.5992182493209839,
... |
func (*UploadConversionAdjustmentsResponse) Descriptor() ([]byte, []int) {
return file_google_ads_googleads_v14_services_conversion_adjustment_upload_service_proto_rawDescGZIP(), []int{1}
} | [
0.06560005247592926,
0.2853529751300812,
-0.018777908757328987,
-0.7943202257156372,
-0.0672018826007843,
-0.35606446862220764,
0.8647589683532715,
-1.308785080909729,
-0.7585020661354065,
0.7459384799003601,
0.24984928965568542,
-0.3444044589996338,
-0.9399166107177734,
-0.302286863327026... |
func (*ConversionAdjustment) Descriptor() ([]byte, []int) {
return file_google_ads_googleads_v14_services_conversion_adjustment_upload_service_proto_rawDescGZIP(), []int{2}
} | [
-0.9283550977706909,
-0.0521063394844532,
0.4547354578971863,
-0.3716927766799927,
0.011914289556443691,
0.24201573431491852,
0.6459230780601501,
-0.6139790415763855,
-0.4514192044734955,
0.4306947588920593,
-0.303999125957489,
0.0039858026430010796,
-0.23255926370620728,
0.749627888202667... |
func (*RestatementValue) Descriptor() ([]byte, []int) {
return file_google_ads_googleads_v14_services_conversion_adjustment_upload_service_proto_rawDescGZIP(), []int{3}
} | [
-0.12339940667152405,
0.15172037482261658,
0.5023647546768188,
-0.02552964724600315,
-0.7234089374542236,
-0.042769137769937515,
0.6248012185096741,
0.3982722759246826,
-0.7163267135620117,
0.18866883218288422,
0.1286589652299881,
-0.2890982925891876,
-0.5058420300483704,
0.776502788066864... |
func (*GclidDateTimePair) Descriptor() ([]byte, []int) {
return file_google_ads_googleads_v14_services_conversion_adjustment_upload_service_proto_rawDescGZIP(), []int{4}
} | [
-0.19021479785442352,
1.171769142150879,
0.2273809313774109,
-0.5992979407310486,
-0.26011866331100464,
-0.37290236353874207,
-1.3081930875778198,
-1.6263470649719238,
-0.8286356925964355,
-0.08029159903526306,
-0.6928853988647461,
0.6775670051574707,
-1.012316346168518,
0.7300068140029907... |
func (*ConversionAdjustmentResult) Descriptor() ([]byte, []int) {
return file_google_ads_googleads_v14_services_conversion_adjustment_upload_service_proto_rawDescGZIP(), []int{5}
} | [
0.056992143392562866,
0.11958648264408112,
0.24172385036945343,
-0.2647647261619568,
-0.4364829361438751,
-0.019049599766731262,
0.6614787578582764,
-0.9044897556304932,
-0.8633214235305786,
0.35602256655693054,
0.0009011661168187857,
-0.20761080086231232,
-0.16947974264621735,
0.989298641... |
func NewDeterministicWeightedWithoutReplacement() WeightedWithoutReplacement {
return &weightedWithoutReplacementGeneric{
u: NewUniform(),
w: NewDeterministicWeighted(),
}
} | [
0.018074296414852142,
-0.147186279296875,
0.3172411620616913,
0.055425453931093216,
-0.48846790194511414,
0.36704814434051514,
0.35917115211486816,
0.3931482434272766,
-0.5714409947395325,
-0.8817003965377808,
-0.5698489546775818,
-0.6004843711853027,
-0.02631218172609806,
0.41674146056175... |
func NewWeightedWithoutReplacement() WeightedWithoutReplacement {
return &weightedWithoutReplacementGeneric{
u: NewUniform(),
w: NewWeighted(),
}
} | [
0.24387536942958832,
-0.7148675322532654,
0.1506062000989914,
-0.5377964377403259,
-0.6373767852783203,
0.7411038279533386,
1.0300453901290894,
0.5366204977035522,
-0.24504567682743073,
-0.6786749362945557,
-0.6242581605911255,
-0.24798201024532318,
-0.4378516376018524,
0.13719825446605682... |
func NewBestWeightedWithoutReplacement(
expectedSampleSize int,
) WeightedWithoutReplacement {
return &weightedWithoutReplacementGeneric{
u: NewBestUniform(expectedSampleSize),
w: NewWeighted(),
}
} | [
0.6634810566902161,
-0.5484272837638855,
0.1484256088733673,
-0.09568783640861511,
-1.1797246932983398,
0.4046632647514343,
0.6296501159667969,
0.4196608364582062,
-0.009788467548787594,
-0.5100769996643066,
-0.5608923435211182,
0.6653503179550171,
-0.3053922951221466,
0.20816324651241302,... |
func (m *MongoDAO) ExecuteStatements(setupStatements, teardownStatements, statements []tester.Statement) ([]tester.Result, []error, error) {
result := []tester.Result{}
errs := []error{}
randomDatabaseName := getRandomString()
for _, statement := range setupStatements {
commands := strings.Split(strings.Replace... | [
-0.7374205589294434,
-0.3165465295314789,
0.7677473425865173,
-0.32194024324417114,
0.09764190018177032,
-0.3119185268878937,
0.36514177918434143,
-0.5975558161735535,
-0.11047213524580002,
1.133211374282837,
0.5344820022583008,
-1.4804434776306152,
-0.4450346827507019,
0.462479829788208,
... |
func merge(mapA, mapB map[string]interface{}) map[string]interface{} {
result := make(map[string]interface{})
for k, v := range mapA {
result[k] = v
}
for k, v := range mapB {
if _, ok := result[k]; !ok || result[k] == nil || result[k] == false {
result[k] = v
}
}
return result
} | [
-0.5941304564476013,
0.0040244669653475285,
0.8154142498970032,
-0.34314653277397156,
-0.3646378219127655,
-0.444703608751297,
-1.3739842176437378,
0.35886192321777344,
-0.8110020756721497,
-0.31913161277770996,
-0.38595321774482727,
0.21107244491577148,
-0.7636666893959045,
0.397684514522... |
func AddUser(jsonData []uint8) {
user := new(models.Users)
json.Unmarshal(jsonData, user)
fmt.Println("User================================>>>>>>>>>>>>>>>>", string(jsonData))
models.Db.NewRecord(user)
affected := models.Db.Create(&user)
fmt.Println("User Created :::::::::::::::::::::::", models.Db.NewRecord(u... | [
-0.8294006586074829,
-0.12143426388502121,
1.1762703657150269,
0.04542382434010506,
0.25881320238113403,
0.6410108208656311,
0.7409276962280273,
-0.1491750031709671,
-0.24070924520492554,
-0.4804014563560486,
-1.0215157270431519,
-0.27035364508628845,
-0.30024993419647217,
0.23996107280254... |
func SendOdpEvent(w http.ResponseWriter, r *http.Request) {
optlyClient, err := middleware.GetOptlyClient(r)
if err != nil {
RenderError(err, http.StatusInternalServerError, w, r)
return
}
body, err := getRequestOdpEvent(r)
if err != nil {
RenderError(err, http.StatusBadRequest, w, r)
return
}
err = op... | [
-1.3986526727676392,
0.1318572461605072,
0.8286755084991455,
-0.3726375699043274,
0.44811028242111206,
-0.13819947838783264,
-0.16996635496616364,
-1.0339428186416626,
-0.02964148111641407,
1.360596776008606,
-0.6218954920768738,
0.7842400074005127,
-0.6922675371170044,
0.43129774928092957... |
func New(server, tenantID string) (_ *Session, ferr fail.Error) {
var xerr fail.Error
// Validate server parameter (can be empty string...)
if server != "" {
if server, xerr = validateServerString(server); xerr != nil {
return nil, fail.Wrap(xerr, "server is invalid")
}
}
// if server is empty, try to see ... | [
-0.3103424906730652,
-0.6370956897735596,
0.7528427839279175,
-0.42600375413894653,
-0.5994969010353088,
0.28646647930145264,
0.1320362389087677,
-0.41395461559295654,
-0.6647913455963135,
0.5084741115570068,
0.13539458811283112,
0.44108864665031433,
0.13912665843963623,
-0.160788625478744... |
func (s *Session) Connect() {
if s.connection == nil {
s.connection = dial(s.server)
}
} | [
-0.16275089979171753,
-0.9985321760177612,
0.2570229172706604,
0.4231260418891907,
-0.4093930125236511,
-0.20725034177303314,
-0.5616074800491333,
-0.7260397672653198,
0.6533650159835815,
0.27905532717704773,
0.08095397800207138,
0.13971449434757233,
0.4586477279663086,
0.8833985924720764,... |
func dial(server string) *grpc.ClientConn {
// Set up a connection to the server.
conn, err := grpc.Dial(server, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
logrus.Fatalf("failed to connect to safescaled (%s): %v", server, err)
}
return conn
} | [
-0.22494752705097198,
-0.5163203477859497,
0.6264047026634216,
-0.05479477718472481,
-0.15610899031162262,
0.9030457139015198,
-0.09115196019411087,
0.1016790047287941,
-0.5467162728309631,
0.5124008655548096,
-0.0895017758011818,
1.145596981048584,
-0.7747399210929871,
-0.2789972126483917... |
func (s *Session) Disconnect() {
if s.connection != nil {
err := s.connection.Close()
if err != nil {
logrus.Error(err)
}
s.connection = nil
}
} | [
0.138010635972023,
-0.7026965618133545,
0.4169501066207886,
-0.14794793725013733,
0.1409624218940735,
-0.6726126670837402,
0.0851220116019249,
-0.2239323854446411,
0.6157639622688293,
0.1761500984430313,
0.21375411748886108,
0.4438612163066864,
0.18191248178482056,
0.14177577197551727,
1... |
func (s *Session) SetTask(inctx context.Context) fail.Error {
if s == nil {
return fail.InvalidInstanceError()
}
select {
case <-inctx.Done():
return fail.AbortedError(inctx.Err(), "aborted")
default:
}
s.clientCtx = inctx
return nil
} | [
-0.02879687026143074,
0.2916412949562073,
0.3621468245983124,
0.7907735705375671,
-0.026644829660654068,
0.749428391456604,
0.6884456872940063,
-0.43708232045173645,
0.5147481560707092,
0.13957373797893524,
-0.7110438346862793,
0.24505263566970825,
0.45662224292755127,
-0.6008646488189697,... |
func (GatewayType) EnumDescriptor() ([]byte, []int) {
return file_synerex_proto_rawDescGZIP(), []int{0}
} | [
0.026800576597452164,
0.6497628092765808,
0.5853070020675659,
-0.6702011823654175,
0.1964881718158722,
-0.4703987240791321,
0.39266228675842285,
-0.030643543228507042,
0.16865043342113495,
0.7691575288772583,
0.12545928359031677,
0.2839523255825043,
-0.9448574781417847,
1.6968920230865479,... |
func (MsgType) EnumDescriptor() ([]byte, []int) {
return file_synerex_proto_rawDescGZIP(), []int{1}
} | [
-0.016761576756834984,
0.7950734496116638,
0.670612096786499,
-0.33293595910072327,
0.6129052639007568,
-0.6920145750045776,
0.5717114806175232,
-0.3850630819797516,
-0.38100945949554443,
0.222261443734169,
0.11083853989839554,
0.32734057307243347,
-0.6001294851303101,
1.3249684572219849,
... |
func (MbusOpt_MbusType) EnumDescriptor() ([]byte, []int) {
return file_synerex_proto_rawDescGZIP(), []int{9, 0}
} | [
-0.5784919261932373,
0.5177338123321533,
0.46923431754112244,
0.20160068571567535,
-0.15850336849689484,
-0.17559750378131866,
0.6454760432243347,
0.09816049784421921,
0.3210528790950775,
0.9875944256782532,
0.2888239920139313,
0.6273500919342041,
-0.3703559339046478,
-0.24802877008914948,... |
func (MbusState_MbusStatus) EnumDescriptor() ([]byte, []int) {
return file_synerex_proto_rawDescGZIP(), []int{10, 0}
} | [
-0.15909698605537415,
0.2123912274837494,
0.3057935833930969,
-0.1730162799358368,
-0.028120901435613632,
-0.5206378698348999,
-0.3363777697086334,
0.9173136353492737,
0.3641797602176666,
-0.151174858212471,
-0.3719756305217743,
0.49271848797798157,
0.5658251643180847,
0.2759595811367035,
... |
func (*Response) Descriptor() ([]byte, []int) {
return file_synerex_proto_rawDescGZIP(), []int{0}
} | [
-0.2606411576271057,
0.28592270612716675,
0.34669390320777893,
0.570866048336029,
0.1857934445142746,
-0.26012739539146423,
0.8433914184570312,
0.3565342128276825,
0.4387129247188568,
-1.26705002784729,
-1.0293323993682861,
-0.4529361128807068,
0.0802716463804245,
0.09716815501451492,
1.... |
func (*ConfirmResponse) Descriptor() ([]byte, []int) {
return file_synerex_proto_rawDescGZIP(), []int{1}
} | [
0.01557030901312828,
0.3189667761325836,
0.38899466395378113,
0.614732563495636,
0.90150386095047,
-0.6776676177978516,
0.6646617650985718,
0.19633351266384125,
0.03445083647966385,
-0.4044106900691986,
-0.6991813778877258,
-0.31789010763168335,
-0.7274729013442993,
0.0044444408267736435,
... |
func (*Content) Descriptor() ([]byte, []int) {
return file_synerex_proto_rawDescGZIP(), []int{2}
} | [
-0.7513871788978577,
0.41727977991104126,
0.3928321301937103,
-0.09423685073852539,
-0.31696659326553345,
0.07708199322223663,
0.03720365837216377,
0.15841317176818848,
-0.632785975933075,
-0.6638888716697693,
-0.2936072051525116,
-0.4853443205356598,
-0.13277572393417358,
0.05222044885158... |
func (*Supply) Descriptor() ([]byte, []int) {
return file_synerex_proto_rawDescGZIP(), []int{3}
} | [
-1.1388181447982788,
0.27044516801834106,
0.6954323053359985,
-0.24833399057388306,
0.025804512202739716,
0.3239502012729645,
0.2804223895072937,
0.2695450186729431,
0.15907175838947296,
-0.416483998298645,
-0.8579548597335815,
-0.008498778566718102,
0.044318974018096924,
0.219981566071510... |
func (*Demand) Descriptor() ([]byte, []int) {
return file_synerex_proto_rawDescGZIP(), []int{4}
} | [
-0.8928571343421936,
0.21788610517978668,
0.5606296062469482,
-0.25010499358177185,
0.4178476929664612,
0.1470165103673935,
0.45077916979789734,
0.08567746728658676,
-0.35897642374038696,
-1.0522133111953735,
-0.5698609948158264,
0.20637644827365875,
0.45695725083351135,
0.841865062713623,... |
func (*Target) Descriptor() ([]byte, []int) {
return file_synerex_proto_rawDescGZIP(), []int{5}
} | [
-1.1017049551010132,
0.482550710439682,
0.43900611996650696,
0.016678955405950546,
0.1768176108598709,
-0.2887316942214966,
0.40589386224746704,
0.4979199171066284,
-0.3341873586177826,
-0.9278044104576111,
-0.405818372964859,
0.30927205085754395,
0.22232532501220703,
-0.19877436757087708,... |
func (*Channel) Descriptor() ([]byte, []int) {
return file_synerex_proto_rawDescGZIP(), []int{6}
} | [
-0.7039803266525269,
0.457538366317749,
0.4013918936252594,
-0.14778397977352142,
0.37638694047927856,
0.3435583710670471,
0.34483662247657776,
0.7891228795051575,
0.008193223737180233,
-1.3330190181732178,
-0.30932939052581787,
0.7587617635726929,
0.05201996862888336,
0.5305459499359131,
... |
func (*Mbus) Descriptor() ([]byte, []int) {
return file_synerex_proto_rawDescGZIP(), []int{7}
} | [
-0.8876805305480957,
1.0180312395095825,
0.23548376560211182,
-0.4766440689563751,
-0.013776857405900955,
-0.2217731773853302,
0.27875974774360657,
0.4044957458972931,
-0.13288788497447968,
-0.7505238056182861,
-0.18043793737888336,
0.5655717253684998,
-0.1959025114774704,
0.35039150714874... |
func (*MbusMsg) Descriptor() ([]byte, []int) {
return file_synerex_proto_rawDescGZIP(), []int{8}
} | [
-0.41668757796287537,
1.4325306415557861,
0.15212875604629517,
-0.06612621247768402,
-0.6248598694801331,
-0.519065797328949,
-0.17789599299430847,
1.3771207332611084,
-0.8196641206741333,
-0.8082110285758972,
-0.3970264494419098,
0.3576878309249878,
0.5653514266014099,
0.9942011833190918,... |
func (*MbusOpt) Descriptor() ([]byte, []int) {
return file_synerex_proto_rawDescGZIP(), []int{9}
} | [
-0.16391657292842865,
0.8662578463554382,
0.3154841363430023,
-0.005318698938935995,
-0.19718605279922485,
-0.22013521194458008,
0.7035035490989685,
-0.16937832534313202,
-0.01774156466126442,
0.3796939253807068,
-0.5846419334411621,
-0.0043231649324297905,
0.2701495587825775,
-0.636752188... |
func (*MbusState) Descriptor() ([]byte, []int) {
return file_synerex_proto_rawDescGZIP(), []int{10}
} | [
-0.4871242940425873,
0.7639622092247009,
0.3655789792537689,
-0.15422871708869934,
-0.6762430667877197,
-0.48317116498947144,
-0.054148219525814056,
0.642835259437561,
-0.12118703126907349,
-0.8061196208000183,
-0.5395125150680542,
0.48168236017227173,
0.45230644941329956,
0.12274529784917... |
func (*GatewayInfo) Descriptor() ([]byte, []int) {
return file_synerex_proto_rawDescGZIP(), []int{11}
} | [
0.4454784393310547,
0.368877112865448,
0.3061746060848236,
-0.3177797198295593,
-0.2173582911491394,
-0.1619797646999359,
0.6192352175712585,
0.36303195357322693,
-1.2612333297729492,
-0.19041895866394043,
-0.5793850421905518,
0.25290989875793457,
-0.39683860540390015,
0.9809551239013672,
... |
func (*GatewayMsg) Descriptor() ([]byte, []int) {
return file_synerex_proto_rawDescGZIP(), []int{12}
} | [
-0.18117867410182953,
1.1389352083206177,
0.20917770266532898,
-0.3692949712276459,
-0.20469817519187927,
-0.057715825736522675,
0.7540165781974792,
0.781169593334198,
-1.1258792877197266,
-0.39110267162323,
0.0004897713661193848,
0.5120301246643066,
-0.9555887579917908,
1.7751379013061523... |
func (*ProviderID) Descriptor() ([]byte, []int) {
return file_synerex_proto_rawDescGZIP(), []int{13}
} | [
-0.30130940675735474,
0.1492384970188141,
0.34278950095176697,
0.3831406235694885,
-0.10232695937156677,
0.19593298435211182,
0.3167283236980438,
0.4292580485343933,
0.4357413351535797,
0.27246198058128357,
-0.2950182557106018,
0.7481923699378967,
-0.46867766976356506,
1.0660779476165771,
... |
func NewContainerRegistry(ctx *pulumi.Context,
name string, args *ContainerRegistryArgs, opts ...pulumi.ResourceOption) (*ContainerRegistry, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AccessLevel == nil {
return nil, errors.New("invalid value for requir... | [
-0.37960538268089294,
1.0426887273788452,
0.4651187062263489,
-0.0030225133523344994,
0.32425352931022644,
-0.023617593571543694,
-0.08579779416322708,
0.32500600814819336,
0.1244869977235794,
0.04238882288336754,
-0.15328341722488403,
0.1694703847169876,
-0.24651679396629333,
0.1826533675... |
func GetContainerRegistry(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ContainerRegistryState, opts ...pulumi.ResourceOption) (*ContainerRegistry, error) {
var resource ContainerRegistry
err := ctx.ReadResource("sakuracloud:index/containerRegistry:ContainerRegistry", name, id, state, &resource, opts..... | [
0.25112584233283997,
0.7709906101226807,
0.19113364815711975,
0.056900281459093094,
0.6405572891235352,
-0.5413397550582886,
-0.2831667363643646,
0.1928837150335312,
1.005006194114685,
-0.5645281672477722,
0.2850189805030823,
0.8987772464752197,
0.06694865971803665,
-0.8070200085639954,
... |
func NewAutomationAccountLister(indexer cache.Indexer) AutomationAccountLister {
return &automationAccountLister{indexer: indexer}
} | [
-0.8980638384819031,
-1.2239028215408325,
-0.17397402226924896,
0.5521548986434937,
-0.7465564012527466,
-0.5569904446601868,
0.69911789894104,
-0.3520559072494507,
0.08452105522155762,
0.10226264595985413,
-0.17817986011505127,
0.7139714360237122,
0.36740225553512573,
0.08471249788999557,... |
func (s *automationAccountLister) List(selector labels.Selector) (ret []*v1alpha1.AutomationAccount, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.AutomationAccount))
})
return ret, err
} | [
-1.2245144844055176,
-1.0054874420166016,
-0.018015824258327484,
0.5148422122001648,
0.5932110548019409,
-0.8912148475646973,
0.7611864805221558,
-0.12019313126802444,
-0.02072986774146557,
0.5281962156295776,
-0.1723359078168869,
0.21360497176647186,
0.27807244658470154,
0.159267023205757... |
func (s *automationAccountLister) AutomationAccounts(namespace string) AutomationAccountNamespaceLister {
return automationAccountNamespaceLister{indexer: s.indexer, namespace: namespace}
} | [
-0.19730588793754578,
-1.0186347961425781,
0.2397933453321457,
-0.20522166788578033,
-0.8038244843482971,
-0.17710335552692413,
0.09164489060640335,
-0.3136288523674011,
1.0258729457855225,
-0.43345561623573303,
0.08287563174962997,
0.7895689606666565,
-0.16736087203025818,
-0.096822693943... |
func (s automationAccountNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.AutomationAccount, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.AutomationAccount))
})
return ret, err
} | [
-0.7057158946990967,
-1.0164369344711304,
-0.10664087533950806,
0.19027335941791534,
0.26153433322906494,
-0.6678600907325745,
0.3607589304447174,
-0.7261048555374146,
0.4959339201450348,
0.5606001019477844,
-0.0842026099562645,
0.3919593393802643,
0.12852971255779266,
0.6250568628311157,
... |
func (s automationAccountNamespaceLister) Get(name string) (*v1alpha1.AutomationAccount, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("automationaccount"), name)
}
return obj.(*v1alpha1... | [
-0.813930094242096,
-0.8448346257209778,
0.20828679203987122,
-0.2789096236228943,
0.08864486217498779,
-0.1034337729215622,
0.4757431745529175,
-0.8286339044570923,
0.16869908571243286,
0.4905487895011902,
-0.015134727582335472,
0.8291948437690735,
-0.2893297076225281,
-0.1057071834802627... |
func conflictCheckForDevfileFlag(args []string, registryName string) error {
// More than one arguments should not be allowed when --devfile is used
if len(args) > 1 {
return &DevfileExistsExtraArgsError{len(args)}
}
// Check if both --devfile and --registry flag are used, in which case raise an error
if registr... | [
-0.20933759212493896,
0.8366224765777588,
0.6058668494224548,
0.8074819445610046,
0.9560062885284424,
0.7162883281707764,
0.9484721422195435,
0.2813892960548401,
-0.7765383720397949,
-0.1910260021686554,
0.3467071056365967,
-0.7268218994140625,
-0.4624415636062622,
1.0365264415740967,
-0... |
func validateAndFetchRegistry(registryName string) (catalog.DevfileComponentTypeList, error) {
// TODO(feloy) Get from DI
prefClient, err := preference.NewClient()
if err != nil {
odoutil.LogErrorAndExit(err, "unable to set preference, something is wrong with odo, kindly raise an issue at https://github.com/redhat... | [
0.11244808882474899,
-0.13513943552970886,
0.662147581577301,
-0.329035222530365,
0.21532626450061798,
0.2667270600795746,
-0.012530874460935593,
-0.0706038698554039,
0.19048281013965607,
0.28929638862609863,
0.25872913002967834,
0.24524642527103424,
-0.3413967490196228,
0.6532501578330994... |
func findDevfileFromRegistry(catalogDevfileList catalog.DevfileComponentTypeList, registryName, componentType string) (devfileLink string, devfileRegistry catalog.Registry, err error) {
devfileExistSpinner := log.Spinnerf("Checking if the devfile for %q exists on available registries", componentType)
defer devfileExi... | [
0.07130542397499084,
-0.2652209997177124,
0.47377878427505493,
-0.4016583561897278,
0.4212730824947357,
0.13434892892837524,
0.24372375011444092,
0.35214948654174805,
0.10014846920967102,
-0.4024251401424408,
0.1560303419828415,
-0.1301344633102417,
-0.555828869342804,
0.874866783618927,
... |
func fetchDevfileFromRegistry(registry catalog.Registry, devfileLink, devfilePath, componentType, componentContext string, prefClient preference.Client) (err error) {
// Download devfile from registry
registrySpinner := log.Spinnerf("Creating a devfile component from registry %q", registry.Name)
defer registrySpinne... | [
0.5893011689186096,
-0.10698787868022919,
0.7487356662750244,
0.09846731275320053,
0.5217010974884033,
0.5673761367797852,
0.52065110206604,
-0.41801124811172485,
0.37028390169143677,
-0.05755100026726723,
-0.11304838955402374,
0.15878279507160187,
-0.07314417511224747,
-0.0610176175832748... |
func getMetadataForExistingDevfile(co *CreateOptions, args []string) (componentName, componentType string, err error) {
devObj, err := devfileParseFromFile(co.DevfilePath, false)
if err != nil {
return "", "", err
}
componentType = component.GetComponentTypeFromDevfileMetadata(devObj.Data.GetMetadata())
// Set ... | [
-0.3314640522003174,
-0.16100217401981354,
0.9746597409248352,
-0.5557010173797607,
0.8911736011505127,
1.1978868246078491,
0.07414781302213669,
-0.5899783968925476,
-0.56988525390625,
0.5358420610427856,
0.18913820385932922,
0.034929487854242325,
0.44099459052085876,
0.6117761731147766,
... |
func createDefaultComponentName(componentType string, sourcePath string, prefClient preference.Client) (string, error) {
var finalSourcePath string
var err error
if sourcePath != "" {
finalSourcePath, err = filepath.Abs(sourcePath)
} else {
finalSourcePath, err = os.Getwd()
}
if err != nil {
return "", err
... | [
-0.5376625061035156,
-0.6746018528938293,
0.4076330065727234,
-0.5831629633903503,
0.16786250472068787,
0.6055125594139099,
0.073300801217556,
-0.48151588439941406,
0.34675031900405884,
0.22459298372268677,
-0.05896579101681709,
0.12923169136047363,
-0.012512734159827232,
0.943869590759277... |
func deleteDevfile(devfile string) {
if util.CheckPathExists(devfile) {
_ = os.Remove(devfile)
}
} | [
1.1601536273956299,
0.3010740280151367,
0.6527581810951233,
0.5974597334861755,
0.3749738931655884,
1.752726674079895,
1.1373496055603027,
0.026854943484067917,
-0.24028372764587402,
-0.4543531537055969,
-0.12895254790782928,
-0.9581777453422546,
0.43038609623908997,
0.7695665955543518,
... |
func deleteOdoDir(componentContext string) {
odoDir := filepath.Join(componentContext, ".odo")
if util.CheckPathExists(odoDir) {
_ = dfutil.DeletePath(odoDir)
}
} | [
0.10167252272367477,
-0.027379702776670456,
0.4028366804122925,
-0.5932860970497131,
0.5869222283363342,
-0.11401376873254776,
0.8704712986946106,
-0.649454653263092,
0.8840903043746948,
-0.06744720041751862,
-0.08275027573108673,
0.298309862613678,
0.5154383182525635,
0.7346175312995911,
... |
func Hamming(s1, s2 string) int {
minLen := len(s1)
if len(s2) < len(s1) {
minLen = len(s2)
}
d := 0
for i := 0; i < minLen; i++ {
b1 := s1[i]
b2 := s2[i]
for j := uint(0); j < 8; j++ {
bb1 := b1 >> j
bb2 := b2 >> j
if (bb1 & 1) != (bb2 & 1) {
d++
}
}
}
return d
} | [
0.24756723642349243,
0.36584022641181946,
0.812000572681427,
0.15168923139572144,
-0.41400134563446045,
0.1186509057879448,
-0.05968331918120384,
-0.23072096705436707,
0.4671342968940735,
0.9944012761116028,
-0.38789108395576477,
1.4540514945983887,
-0.600542426109314,
-0.6308647394180298,... |
func getItem(input string) (PostItem, error) {
item := make(PostItem)
attrs := strings.Split(input, "")
if len(attrs) != len(config.Mapping) {
return item, errors.New(fmt.Sprintf("The input string does not have the same number of attributes (%v) as the mapping (%v).\n", len(attrs), len(config.Mapping)))
}
for i... | [
0.13076971471309662,
0.5691275596618652,
0.47346562147140503,
0.3560737669467926,
-0.598967432975769,
0.5654410123825073,
-0.013058073818683624,
0.4843395948410034,
-0.2794530391693115,
-0.6596873998641968,
-0.12858842313289642,
-0.15685266256332397,
-0.14092637598514557,
-0.74256592988967... |
func getLine(item PostItem) (string, error) {
s := []string{}
for _, attr := range config.Mapping {
if attrValue, ok := item[attr]; ok {
s = append(s, *attrValue.S)
} else {
s = append(s, "")
}
}
return strings.Join(s, ""), nil
} | [
-0.09366974979639053,
-0.30894821882247925,
0.7051790952682495,
0.1739792823791504,
0.21319514513015747,
-0.12012895941734314,
-0.9263549447059631,
-0.031190568581223488,
-0.2598450481891632,
-0.28667882084846497,
-0.15682120621204376,
-0.2923709750175476,
0.48475006222724915,
-0.037864878... |
func scanWithValidation(scanner bufio.Scanner) string {
retString := ""
scanner.Scan() // collect user option
if scanner.Err() != nil { // check that there is no scanner error
retString = "SCANNER ERROR" // scan
} else {
retString = scanner.Text()
}
return retString
} | [
0.2185034453868866,
-0.8672059178352356,
0.7687547206878662,
0.5582946538925171,
-1.2461432218551636,
0.9840091466903687,
0.02004028484225273,
-0.8020417094230652,
0.48603111505508423,
0.06876365840435028,
0.2682393193244934,
-0.18400177359580994,
0.11250748485326767,
0.04059545323252678,
... |
func waitForuserInput(scanner bufio.Scanner) {
enter := "wait for user"
for enter != "" {
fmt.Printf("\nPlease press enter to continue: ")
enter = scanWithValidation(scanner)
}
} | [
0.46821117401123047,
-0.43315303325653076,
0.27994897961616516,
0.2947600185871124,
-0.5005576610565186,
1.5185065269470215,
0.6177575588226318,
-0.2906173765659332,
-0.6234045624732971,
-1.0582458972930908,
-0.005383281037211418,
0.03810865804553032,
0.031232673674821854,
0.00074254878563... |
func main() {
if len(os.Args) != 2 {
fmt.Println("ERROR: Name of the input file not found in the command line arguments")
os.Exit(1)
}
security.CreatePasswordFile()
if !security.LoadAccessMatrix(os.Args[1]) { // load the input file
fmt.Println("Couldn't read the input file")
os.Exit(1)
}
scanner := bu... | [
0.22540849447250366,
-0.6519082188606262,
1.1889797449111938,
0.9335191249847412,
-0.17535927891731262,
0.704176664352417,
1.074460744857788,
-0.180586576461792,
-0.05591554567217827,
0.2478310763835907,
0.061536289751529694,
0.40145015716552734,
-0.29740118980407715,
-0.3280370235443115,
... |
func (c CelestialObject) J(n uint8) float64 {
switch n {
case 2:
return c.J2
case 3:
return c.J3
case 4:
return c.J4
default:
return 0.0
}
} | [
-0.6785376071929932,
-0.2159898579120636,
0.34825408458709717,
0.699016273021698,
0.14671148359775543,
0.4646942615509033,
0.6360347270965576,
-0.9855464696884155,
-0.18205669522285461,
-0.8636122941970825,
-0.22372357547283173,
-0.027733704075217247,
0.1453033834695816,
1.2284502983093262... |
func (c CelestialObject) String() string {
return c.Name + " body"
} | [
0.41096028685569763,
-1.3313192129135132,
0.43004947900772095,
-0.4606727063655853,
-0.6786239743232727,
2.1791093349456787,
0.15523020923137665,
-1.4918594360351562,
-0.1553853303194046,
-0.08322737365961075,
-0.9996734261512756,
0.6197528839111328,
0.29522743821144104,
-0.070993706583976... |
func (c *CelestialObject) Equals(b CelestialObject) bool {
return c.Name == b.Name && c.Radius == b.Radius && c.a == b.a && c.μ == b.μ && c.SOI == b.SOI && c.J2 == b.J2
} | [
-0.25853216648101807,
-1.423272728919983,
0.6693869829177856,
0.1679784655570984,
-0.19038163125514984,
0.6307863593101501,
-0.23398706316947937,
-0.6804770827293396,
-0.4717794954776764,
-0.07003453373908997,
-1.2666836977005005,
0.7216148376464844,
-0.3324495255947113,
-0.381159305572509... |
func (c *CelestialObject) HelioOrbit(dt time.Time) Orbit {
if c.Name == "Sun" {
return *NewOrbitFromRV([]float64{0, 0, 0}, []float64{0, 0, 0}, *c)
}
pstate := config.HelioState(c.Name, dt)
R := pstate.R
V := pstate.V
return *NewOrbitFromRV(R, V, Sun)
} | [
0.29756030440330505,
0.386476069688797,
0.5381501913070679,
0.13285961747169495,
-0.6033029556274414,
0.8786760568618774,
-0.43147748708724976,
-0.1337539702653885,
-0.6799756288528442,
0.2646818161010742,
-0.17174935340881348,
-0.2439020723104477,
0.742888867855072,
0.367387056350708,
0... |
func CelestialObjectFromString(name string) (CelestialObject, error) {
switch strings.ToLower(name) {
case "sun":
return Sun, nil
case "earth":
return Earth, nil
case "venus":
return Venus, nil
case "mars":
return Mars, nil
case "jupiter":
return Jupiter, nil
case "saturn":
return Saturn, nil
case "... | [
0.30824002623558044,
-1.3417181968688965,
0.3549538552761078,
-0.07829874753952026,
-1.1083173751831055,
0.8101718425750732,
-0.4327029287815094,
-0.018818560987710953,
-0.4445560872554779,
-0.374172568321228,
-0.40733984112739563,
0.38810408115386963,
-0.2017212063074112,
-0.6876738667488... |
func isDir(path string) bool {
return os.IsPathSeparator(path[len(path)-1])
} | [
-0.20023074746131897,
-0.08984309434890747,
0.6406633257865906,
0.9135583639144897,
-0.3838960528373718,
0.5908891558647156,
0.07333022356033325,
-0.10234344750642776,
0.4884454607963562,
-0.6798986792564392,
-0.02635084092617035,
-0.2656192183494568,
-0.38116520643234253,
0.14913053810596... |
func GetBoilerplates() ([]Category, error) {
resp, err := grequests.Get("https://lcinternal-cloud-code-update.leanapp.cn/boilerplates.json", &grequests.RequestOptions{
UserAgent: "LeanCloud-CLI/" + version.Version,
})
if err != nil {
return nil, err
}
var result []Category
err = resp.JSON(&result)
return res... | [
-0.9136899709701538,
0.3342280387878418,
0.7407141923904419,
-0.07410351932048798,
0.2542038857936859,
-0.7675321698188782,
-1.2972025871276855,
-0.22583076357841492,
-0.8471107482910156,
0.0369722917675972,
-1.0587577819824219,
0.7431336641311646,
-1.4130058288574219,
1.1668492555618286,
... |
func DownloadToFile(r *grequests.Response, fileName string) error {
if r.Error != nil {
return r.Error
}
fd, err := os.Create(fileName)
if err != nil {
return err
}
defer r.Close() // This is a noop if we use the internal ByteBuffer
defer fd.Close()
if length, err := strconv.Atoi(r.Header.Get("Content-... | [
0.6752123832702637,
0.0951215922832489,
0.8222078084945679,
-0.6192768216133118,
0.2716374099254608,
-0.07173803448677063,
0.812827467918396,
-0.2940503656864166,
-0.1448492556810379,
-0.08483189344406128,
0.3898558020591736,
-0.41950663924217224,
-0.09379848837852478,
-0.06946157664060593... |
func Delete() {
// dwn-delete:
// @echo Deleting dep ...
// @echo
// @echo DEP_DOWNLOAD_DIR: $(DEP_DOWNLOAD_DIR)
// @echo DEP_INSTALL_PREFIX: $(DEP_INSTALL_PREFIX)
// @echo
// @echo DWN_FILENAME: $(DWN_FILENAME)
// @echo DWN_BIN_NAME: $(DWN_BIN_NAME)
// @echo
// @echo DWN_FILENAME_CALC: $(DWN_FILENAM... | [
0.7889627814292908,
-0.2693587839603424,
1.0098483562469482,
0.228404238820076,
0.09504852443933487,
0.44942551851272583,
0.6058191657066345,
0.16882090270519257,
-0.28665342926979065,
-0.6936674118041992,
-0.10435663908720016,
0.2809898853302002,
0.1307380199432373,
1.305962085723877,
0... |
func Download() {
// dwn-download: dwn-delete
// @echo Downloading dep ...
// @echo
// @echo DEP_DOWNLOAD_DIR: $(DEP_DOWNLOAD_DIR)
// @echo DEP_INSTALL_PREFIX: $(DEP_INSTALL_PREFIX)
// @echo
// @echo DWN_FILENAME: $(DWN_FILENAME)
// @echo DWN_BIN_NAME: $(DWN_BIN_NAME)
// @echo
// @echo DWN_FILENAME_CAL... | [
0.12071399390697479,
-0.29351806640625,
1.0611079931259155,
0.19483652710914612,
-0.6698473691940308,
0.13789613544940948,
0.942884624004364,
-0.41930997371673584,
-0.2072119414806366,
-0.3791266083717346,
-0.200121209025383,
0.08673083037137985,
0.6054713726043701,
0.9738756418228149,
0... |
func (m *exampleTimeout) Timeout(tType fab.TimeoutType) time.Duration {
t, ok := defaultTypes[tType]
if !ok {
return time.Second * 30 // general default if type is not found
}
return t
} | [
0.4016440212726593,
0.9775515794754028,
0.23784302175045013,
0.5821701884269714,
0.1866016983985901,
0.4820341467857361,
0.1003362238407135,
0.05962715297937393,
0.23552505671977997,
1.2838613986968994,
0.08977620303630829,
0.1703415960073471,
0.15249189734458923,
0.8992899060249329,
0.3... |
func PeerMSPID(name string) (string, bool) {
// Find organisation/msp that peer belongs to
for _, org := range orgsConfig {
for i := 0; i < len(org.Peers); i++ {
if strings.EqualFold(org.Peers[i], name) {
// peer belongs to this org add org msp
return org.MSPID, true
// EntityMatchers are not used in... | [
-0.1412830501794815,
-0.7592160105705261,
1.0336833000183105,
-1.0085855722427368,
-0.8939016461372375,
0.03866385295987129,
-0.4304516017436981,
-0.10136231034994125,
0.5280986428260803,
0.9264943599700928,
-0.5245710611343384,
-1.3725868463516235,
-1.358641266822815,
0.7217693328857422,
... |
func newOrderersConfigImpl() *exampleOrderersConfig {
oConfig := verifyIsLocalOrderersURLs(orderersConfig)
orderersConfig = oConfig
o := &exampleOrderersConfig{}
return o
} | [
-0.5533345937728882,
0.01979333721101284,
0.015854449942708015,
-0.19014416635036469,
-1.1328641176223755,
-0.6178771257400513,
-0.16347287595272064,
0.836688220500946,
-0.06938152015209198,
0.7533358931541443,
-1.08462655544281,
-0.5311061143875122,
0.021764779463410378,
0.662555098533630... |
func (m *exampleOrderersConfig) OrderersConfig() []fab.OrdererConfig {
orderers := []fab.OrdererConfig{}
for _, orderer := range orderersConfig {
if orderer.TLSCACert == nil && !m.isSystemCertPool {
return nil
}
orderers = append(orderers, orderer)
}
return orderers
} | [
0.013529105111956596,
-0.2708355188369751,
0.3655622601509094,
0.5124597549438477,
-0.21810151636600494,
0.020483408123254776,
-0.5310084223747253,
0.4923636019229889,
-0.5829297304153442,
0.9738844633102417,
-0.8736271262168884,
0.16221505403518677,
-0.647962749004364,
1.637709140777588,
... |
func (m *exampleOrdererConfig) OrdererConfig(ordererNameOrURL string) (*fab.OrdererConfig, bool, bool) {
orderer, ok := networkConfig.Orderers[strings.ToLower(ordererNameOrURL)]
if !ok {
// EntityMatchers are not used in this implementation, below is an example of how to use them if needed, see default implementati... | [
-0.644873321056366,
-0.9168986082077026,
0.9152986407279968,
0.05367621034383774,
-0.6315032243728638,
-0.15779760479927063,
0.10723289847373962,
0.6005380153656006,
-0.1848524808883667,
0.3676395118236542,
-0.6164022088050842,
-0.83831387758255,
-0.6098774671554565,
1.4622924327850342,
... |
func newPeersConfigImpl() *examplePeersConfig {
pConfig := verifyIsLocalPeersURLs(peersConfig)
peersConfig = pConfig
p := &examplePeersConfig{}
return p
} | [
-0.7408185005187988,
-0.13915836811065674,
0.09427648782730103,
-0.39427316188812256,
-1.3844026327133179,
-0.151897594332695,
-0.5349786281585693,
1.1568423509597778,
-0.5285977125167847,
0.8123413324356079,
-1.6387412548065186,
-0.618009090423584,
-0.04396793246269226,
0.7044030427932739... |
func (m *examplePeersConfig) PeersConfig(org string) ([]fab.PeerConfig, bool) {
orgPeers := orgsConfig[strings.ToLower(org)].Peers
peers := []fab.PeerConfig{}
for _, peerName := range orgPeers {
p := networkConfig.Peers[strings.ToLower(peerName)]
if err := m.verifyPeerConfig(p, peerName, endpoint.IsTLSEnabled(p... | [
-0.7607802152633667,
-0.21305310726165771,
0.7212335467338562,
-0.2007901966571808,
-0.1331564038991928,
-0.13359785079956055,
-0.6924759149551392,
1.0500977039337158,
-0.07118796557188034,
1.175278902053833,
-1.2808157205581665,
-0.6896934509277344,
-0.5550470948219299,
1.2480297088623047... |
func (m *examplePeerConfig) PeerConfig(nameOrURL string) (*fab.PeerConfig, bool) {
pcfg, ok := peersConfig[nameOrURL]
if ok {
return &pcfg, true
}
if integration.IsLocal() {
pcfg, ok := peersByLocalURL[nameOrURL]
if ok {
return &pcfg, true
}
}
i := strings.Index(nameOrURL, ":")
if i > 0 {
return m... | [
-0.2617999017238617,
-0.2103690654039383,
0.6106012463569641,
-0.14196333289146423,
-0.8985702991485596,
-0.8652645945549011,
-0.23591509461402893,
1.048248529434204,
0.2076888531446457,
0.9442133903503418,
-0.9101938605308533,
-0.7342564463615417,
-0.5600683093070984,
1.1115777492523193,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.