text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (p *Parser) Parse() (*ast.ConfigurationFile, error) {
f := ast.NewConfigurationFile()
for !p.curTokenIs(token.EOF) {
stmt := p.parseStatement()
if stmt != nil {
f.Statements = append(f.Statements, stmt)
}
p.Next()
}
var err error
if len(p.errors) > 0 {
err = fmt.Errorf("parsing error: there were ... | [
-0.19491516053676605,
-0.11356892436742783,
0.5161341428756714,
0.24224400520324707,
-0.09514382481575012,
-0.7197590470314026,
-0.041323255747556686,
0.0017369341803714633,
-1.34132981300354,
0.31816452741622925,
0.49660801887512207,
-1.6349011659622192,
-0.528654158115387,
0.531682848930... |
func (p *Parser) Next() {
p.curr = p.peek
p.peek = p.l.NextToken()
} | [
-0.324955552816391,
-0.5087037086486816,
0.18019898235797882,
-0.13849054276943207,
-0.4348350465297699,
0.6344351172447205,
-0.383806049823761,
0.6360669732093811,
-0.13487055897712708,
-0.7824715971946716,
-0.1617938131093979,
1.0746499300003052,
-0.09829982370138168,
0.9199237823486328,... |
func (p *Parser) Peek() token.Token {
return p.peek
} | [
0.5123215317726135,
-0.30565428733825684,
0.4361312985420227,
-0.2144203633069992,
0.017583169043064117,
0.29986706376075745,
-0.29117563366889954,
-0.5146312117576599,
-0.5058022737503052,
-0.8143655061721802,
0.2504625916481018,
1.2393198013305664,
0.5809891819953918,
-0.4154061377048492... |
func (p *Parser) Token() token.Token {
return p.curr
} | [
-0.45859870314598083,
-1.5525230169296265,
0.45247578620910645,
-0.4000455439090729,
0.23026585578918457,
0.599162220954895,
1.2086584568023682,
0.6156478524208069,
-0.5338953733444214,
-1.7154159545898438,
0.01795579120516777,
0.9886389374732971,
0.18423551321029663,
-0.45865142345428467,... |
func (*WriteReq) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _WriteReq_OneofMarshaler, _WriteReq_OneofUnmarshaler, _WriteReq_OneofSizer, []interface{}{
(*WriteReq_Name... | [
-1.4297703504562378,
-0.05201689898967743,
0.5228708982467651,
-0.46397989988327026,
0.8120350241661072,
-1.094104290008545,
0.9567349553108215,
-0.45068249106407166,
-0.23928692936897278,
-0.10651315748691559,
-0.7015326023101807,
-0.5858822464942932,
-0.26857903599739075,
0.8838801980018... |
func NewAzureAccountsClient(endpoint string) AzureAccountsClient {
return AzureAccountsClient{New(endpoint)}
} | [
-0.14676570892333984,
-0.9979252219200134,
0.03570796176791191,
0.00750764599069953,
-0.8101477026939392,
-0.6166073679924011,
0.11064179241657257,
-0.054391857236623764,
-0.13790178298950195,
0.03139008209109306,
0.7384818196296692,
0.13770365715026855,
0.10500717163085938,
-0.99486654996... |
func (client AzureAccountsClient) AssignToApp(ctx context.Context, appID uuid.UUID, azureAccountInfoObject *AzureAccountInfoObject) (result OperationStatus, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AzureAccountsClient.AssignToApp")
defer func() {
sc := -1
if result.Response.R... | [
-0.3438744843006134,
-0.9356831312179565,
0.8753581643104553,
0.22713154554367065,
0.006571647711098194,
0.6991769075393677,
0.7286752462387085,
-0.6874311566352844,
0.23210662603378296,
1.0518372058868408,
0.1724657565355301,
0.22990892827510834,
-0.03380613774061203,
0.03239938244223595,... |
func (client AzureAccountsClient) AssignToAppPreparer(ctx context.Context, appID uuid.UUID, azureAccountInfoObject *AzureAccountInfoObject) (*http.Request, error) {
urlParameters := map[string]interface{}{
"Endpoint": client.Endpoint,
}
pathParameters := map[string]interface{}{
"appId": autorest.Encode("path", ... | [
-0.3242369294166565,
-0.9406474828720093,
0.7229000329971313,
-0.1690044403076172,
-0.14448899030685425,
0.35519805550575256,
-0.40643104910850525,
-0.28591591119766235,
0.0428001768887043,
0.8279496431350708,
0.5552190542221069,
-0.16338279843330383,
0.4203340709209442,
0.880451500415802,... |
func (client AzureAccountsClient) AssignToAppSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
} | [
-0.6900677680969238,
-1.013224482536316,
0.5245809555053711,
0.8497075438499451,
0.3291931748390198,
-0.21378473937511444,
0.0914071723818779,
-0.27544093132019043,
-0.47389811277389526,
0.6821935772895813,
-0.09104451537132263,
0.07411711663007736,
-0.16475807130336761,
1.376181960105896,... |
func (client AzureAccountsClient) AssignToAppResponder(resp *http.Response) (result OperationStatus, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Respo... | [
-0.5929170250892639,
-1.5637062788009644,
0.5798671841621399,
-0.0026226602494716644,
0.2008187621831894,
-0.08247692137956619,
0.9144984483718872,
-0.396382600069046,
0.641729474067688,
0.496214896440506,
-0.0579824224114418,
-0.9069638252258301,
-0.2654135525226593,
0.6999744772911072,
... |
func (client AzureAccountsClient) GetAssigned(ctx context.Context, appID uuid.UUID) (result ListAzureAccountInfoObject, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AzureAccountsClient.GetAssigned")
defer func() {
sc := -1
if result.Response.Response != nil {
sc = result.Resp... | [
-0.3724900782108307,
-0.793517529964447,
0.766266942024231,
0.48660731315612793,
0.19663168489933014,
-0.8652912378311157,
0.6470261216163635,
-0.6977624893188477,
0.1246352270245552,
0.36280545592308044,
-0.13762147724628448,
1.245588779449463,
-0.14957097172737122,
0.5101219415664673,
... |
func (client AzureAccountsClient) GetAssignedPreparer(ctx context.Context, appID uuid.UUID) (*http.Request, error) {
urlParameters := map[string]interface{}{
"Endpoint": client.Endpoint,
}
pathParameters := map[string]interface{}{
"appId": autorest.Encode("path", appID),
}
preparer := autorest.CreatePreparer... | [
-0.08834642171859741,
-1.0745538473129272,
0.6134005784988403,
-0.24653279781341553,
-0.1865643560886383,
-0.3117656409740448,
-0.28753167390823364,
-0.45184627175331116,
0.0588911734521389,
0.01582326553761959,
0.1850988119840622,
0.9291207790374756,
0.37228524684906006,
1.008675575256347... |
func (client AzureAccountsClient) GetAssignedSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
} | [
-0.7546126246452332,
-0.8402483463287354,
0.23975008726119995,
0.5272188782691956,
0.1767951101064682,
-0.9071698188781738,
-0.04964604601264,
-0.8587291836738586,
-0.5989396572113037,
-0.3616985082626343,
-0.21235992014408112,
1.2842851877212524,
-0.3161238431930542,
1.578465461730957,
... |
func (client AzureAccountsClient) GetAssignedResponder(resp *http.Response) (result ListAzureAccountInfoObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response... | [
-0.6355755925178528,
-1.6887787580490112,
0.6333572268486023,
-0.2210037112236023,
0.019933730363845825,
-0.7928833365440369,
0.907845139503479,
-0.49061164259910583,
0.7250828742980957,
-0.24443000555038452,
-0.5561989545822144,
-0.0125515665858984,
-0.28623709082603455,
0.739781260490417... |
func (client AzureAccountsClient) GetUserLUISAccounts(ctx context.Context) (result ListAzureAccountInfoObject, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AzureAccountsClient.GetUserLUISAccounts")
defer func() {
sc := -1
if result.Response.Response != nil {
sc = result.Respo... | [
0.042122650891542435,
-0.05132472515106201,
0.5688468217849731,
0.6807084679603577,
-0.48491886258125305,
-0.2861773371696472,
0.3715917766094208,
-0.866674542427063,
0.6589639782905579,
-0.12485483288764954,
0.3105558753013611,
1.0458776950836182,
-0.34769561886787415,
0.1392013430595398,... |
func (client AzureAccountsClient) GetUserLUISAccountsPreparer(ctx context.Context) (*http.Request, error) {
urlParameters := map[string]interface{}{
"Endpoint": client.Endpoint,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithCustomBaseURL("{Endpoint}/luis/api/v2.0", urlParameters),
au... | [
0.15416641533374786,
-0.043685100972652435,
0.5366917848587036,
-0.3824816048145294,
-0.7283238768577576,
-0.3428988754749298,
-0.4087387025356293,
0.1329348236322403,
0.9496079087257385,
0.08697966486215591,
0.3994753360748291,
0.2529504895210266,
-0.038454897701740265,
0.2082253545522689... |
func (client AzureAccountsClient) GetUserLUISAccountsSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
} | [
0.1268484890460968,
0.12940260767936707,
0.6565949320793152,
0.9556300640106201,
-0.2733698785305023,
-0.587778627872467,
-0.1409974992275238,
-0.6864960193634033,
0.2739628851413727,
-0.14112673699855804,
0.11890474706888199,
0.9114512801170349,
-0.0179982278496027,
0.1256769299507141,
... |
func (client AzureAccountsClient) GetUserLUISAccountsResponder(resp *http.Response) (result ListAzureAccountInfoObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.... | [
0.0033273641020059586,
-0.8002266883850098,
0.36587920784950256,
-0.12587177753448486,
-0.5538750290870667,
-0.6196901798248291,
0.9235798716545105,
-0.41933152079582214,
1.1563822031021118,
-0.004228201694786549,
0.05876509100198746,
-0.5280523896217346,
-0.23027852177619934,
-0.103182964... |
func (client AzureAccountsClient) RemoveFromApp(ctx context.Context, appID uuid.UUID, azureAccountInfoObject *AzureAccountInfoObject) (result OperationStatus, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AzureAccountsClient.RemoveFromApp")
defer func() {
sc := -1
if result.Respon... | [
0.10452838242053986,
-0.9272860288619995,
0.5382221341133118,
0.23916997015476227,
-0.9579136967658997,
0.06622141599655151,
0.4883035123348236,
-0.6125600337982178,
0.33173975348472595,
1.033783197402954,
0.14876258373260498,
0.12871943414211273,
-0.4785331189632416,
-0.07990492880344391,... |
func (client AzureAccountsClient) RemoveFromAppPreparer(ctx context.Context, appID uuid.UUID, azureAccountInfoObject *AzureAccountInfoObject) (*http.Request, error) {
urlParameters := map[string]interface{}{
"Endpoint": client.Endpoint,
}
pathParameters := map[string]interface{}{
"appId": autorest.Encode("path"... | [
0.040267013013362885,
-1.0561789274215698,
0.6253374814987183,
-0.2837424576282501,
-1.0340723991394043,
-0.012292318977415562,
-0.5917497873306274,
0.14618386328220367,
0.1972305178642273,
0.6536960601806641,
0.46463772654533386,
-0.12292790412902832,
0.08930440247058868,
0.48602211475372... |
func (client AzureAccountsClient) RemoveFromAppSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
} | [
0.27488914132118225,
-0.6921998262405396,
0.4065830409526825,
0.8874347805976868,
-0.7998098134994507,
-0.37967947125434875,
0.10825704783201218,
0.16912537813186646,
-0.1967402696609497,
0.6336835622787476,
-0.22662152349948883,
-0.42205896973609924,
-0.5319796800613403,
0.401549339294433... |
func (client AzureAccountsClient) RemoveFromAppResponder(resp *http.Response) (result OperationStatus, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Res... | [
-0.009343297220766544,
-1.636126160621643,
0.42336374521255493,
0.1472695916891098,
-0.8898488283157349,
-0.35421985387802124,
0.6470662951469421,
-0.25348374247550964,
0.7812063097953796,
0.4372147023677826,
0.008116952143609524,
-1.1192339658737183,
-0.8404174447059631,
-0.26152256131172... |
func (device Device) RenderToBlazon() string {
blazon := ""
if device.Field.Division.Name == "plain" {
if device.Field.HasVariation {
blazon = strings.Title(device.Field.Variation.Name)
blazon += " " + device.Field.Variation.Tincture1.Name + " and " + device.Field.Variation.Tincture2.Name
} else {
blazon... | [
0.15381461381912231,
-0.21281792223453522,
0.8011456727981567,
-0.4478212893009186,
0.0017520022811368108,
-0.03456203266978264,
0.1883428990840912,
0.0030288072302937508,
-0.03239408880472183,
0.5417135953903198,
0.1546703279018402,
0.1644165962934494,
-0.19222234189510345,
0.242893055081... |
func (device Device) RenderToSVG(width int, height int) string {
buffer := new(bytes.Buffer)
centerX := int(width / 2)
centerY := int(height / 2)
lineColor := "#000000"
blazon := device.RenderToBlazon()
/*
blazonLength := len(blazon)
blazonSize := "10"
if blazonLength < 25 {
blazonSize = "28"
} el... | [
0.3153952956199646,
0.47700729966163635,
0.8824208378791809,
-0.5629962086677551,
0.27359744906425476,
0.4043533205986023,
0.589902400970459,
-0.1588098406791687,
0.284323126077652,
-0.02293333224952221,
0.0019260538974776864,
-0.05285574495792389,
0.03567548468708992,
0.13491202890872955,... |
func RenderToSVGFile(device Device, fileName string, width int, height int) {
var writer io.WriteCloser
writer, err := os.Create(fileName)
if err != nil {
fmt.Println(err)
return
}
contents := device.RenderToSVG(width, height)
io.WriteString(writer, contents)
defer writer.Close()
} | [
0.2290496975183487,
0.7596079707145691,
0.4302268922328949,
-0.3591848313808441,
0.14974898099899292,
0.42711198329925537,
-0.09292474389076233,
0.25316914916038513,
-1.32676362991333,
0.46243423223495483,
0.5163879990577698,
-0.8018916845321655,
-0.27714335918426514,
-0.05174032971262932,... |
func GetSurgeDir() string {
return os.Getenv("APPDATA") + string(os.PathSeparator) + "Surge"
} | [
-0.11733978986740112,
-0.2758882939815521,
0.5966048836708069,
-0.2727232873439789,
0.458118736743927,
0.9266895651817322,
0.12116442620754242,
-0.32796886563301086,
0.16170735657215118,
-1.2070518732070923,
0.2120053470134735,
1.4087131023406982,
0.13391467928886414,
0.5797588229179382,
... |
func GetRemoteFolder() (string, error) {
homedir, _ := windows.KnownFolderPath(windows.FOLDERID_Downloads, 0)
return homedir + string(os.PathSeparator) + "surge_downloads", nil
} | [
0.49695396423339844,
-0.8028310537338257,
0.7969003319740295,
0.1322552114725113,
-0.013095129281282425,
0.8774368166923523,
0.514457643032074,
-0.20278382301330566,
-0.05132550373673439,
-1.0719879865646362,
-0.5076936483383179,
1.0340920686721802,
-0.4638998806476593,
0.4578099250793457,... |
func (c *Client) GetPolicyVersion(ctx context.Context, params *GetPolicyVersionInput, optFns ...func(*Options)) (*GetPolicyVersionOutput, error) {
if params == nil {
params = &GetPolicyVersionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetPolicyVersion", params, optFns, c.addOperationGetPolicyVersi... | [
-0.0750831812620163,
0.3289698660373688,
0.41420698165893555,
0.5014621019363403,
0.5022488832473755,
0.203493133187294,
0.11096751689910889,
-1.0397019386291504,
0.5286045074462891,
0.16655555367469788,
-0.6114802956581116,
1.3365437984466553,
-0.5491831302642822,
-0.8735805153846741,
-... |
func NewConfig(region string) *aws.Config {
return &aws.Config{Region: aws.String(region)}
} | [
1.1152660846710205,
-0.6498948335647583,
0.2775840163230896,
-1.2381441593170166,
-1.5626792907714844,
0.37106209993362427,
-0.6926061511039734,
0.3699343502521515,
0.5615562796592712,
0.26688575744628906,
-0.4195956587791443,
0.7249889969825745,
0.9726154208183289,
-0.029425304383039474,
... |
func NewService(c *aws.Config) (*Service, error) {
sess, err := session.NewSession(c)
if err != nil {
return nil, errors.Wrap(err, "failed to create new session")
}
return &Service{ec2.New(sess)}, nil
} | [
0.02535623498260975,
-0.4155019521713257,
0.16344143450260162,
0.48568853735923767,
-0.5131996273994446,
0.28104785084724426,
-0.08113515377044678,
-1.4619745016098022,
0.49299582839012146,
0.12064239382743835,
-0.39429351687431335,
0.6328068375587463,
-0.003522005397826433,
0.157851934432... |
func (s *Service) FetchLatestAmiInfo() (amiInfo *ec2.Image, err error) {
params := &ec2.DescribeImagesInput{
Owners: []*string{
aws.String("amazon"),
},
Filters: []*ec2.Filter{
{
Name: aws.String("image-type"),
Values: []*string{
aws.String("machine"),
},
},
{
Name: aws.String("a... | [
-0.06932678818702698,
-0.7470346093177795,
0.42217108607292175,
0.015251686796545982,
-0.20794972777366638,
0.0943172425031662,
-0.600710391998291,
-0.9528462886810303,
-0.2887488007545471,
0.20636191964149475,
-0.3388688266277313,
0.46086904406547546,
0.5075777173042297,
0.625225603580474... |
func SelectRegion(optRegion string) (region string, err error) {
if optRegion == "OS Environment 'AWS_REGION'" {
if os.Getenv("AWS_REGION") != "" {
return os.Getenv("AWS_REGION"), err
}
return usEast1, err
}
return optRegion, err
} | [
-0.37088122963905334,
0.05110597983002663,
0.5724136233329773,
0.1385604739189148,
-0.4470822215080261,
0.697753369808197,
0.23186251521110535,
-0.7193540930747986,
0.5515726804733276,
0.3013266921043396,
1.0007210969924927,
1.0794603824615479,
0.11713460087776184,
0.4260002076625824,
0.... |
func New(svcs svc.Services, opts ...grpc.ServerOption) *grpc.Server {
opts = append(opts, grpc.CustomCodec(sourcegraph.GRPCCodec))
s := grpc.NewServer(opts...)
svc.RegisterAll(s, svcs)
return s
} | [
-0.6497392058372498,
0.45404595136642456,
0.3743762969970703,
-0.5180115699768066,
0.020639793947339058,
0.1494305431842804,
0.07000917196273804,
-0.4664999842643738,
0.23965220153331757,
-0.2695264518260956,
0.1612873673439026,
1.0148663520812988,
-0.2414526790380478,
0.4941769242286682,
... |
func WithAddr(addr string) Option {
return func(c *gatewayClient) {
if len(addr) != 0 {
c.addr = addr
}
}
} | [
0.9507668018341064,
-0.3428484797477722,
0.6216516494750977,
-0.9263385534286499,
-1.0425559282302856,
0.5156221389770508,
0.3021702766418457,
-0.6523779630661011,
1.1740508079528809,
-0.38261687755584717,
0.7266814708709717,
0.11511747539043427,
0.06274358183145523,
1.0040905475616455,
... |
func addEnvironmentFlag(cmd *cobra.Command) {
cmd.Flags().StringArrayVarP(&environment, "env", "e", []string{}, "environment variables to pass to container")
} | [
-0.01414936687797308,
0.09221088886260986,
0.5004561543464661,
-0.7255669832229614,
1.2830774784088135,
1.7027013301849365,
0.3467959463596344,
0.3134169280529022,
-0.9211979508399963,
0.24365100264549255,
-0.32354938983917236,
0.49707576632499695,
-0.03927922248840332,
1.7275861501693726,... |
func checkEnvironmentFlag(cmd *cobra.Command) (err error) {
for i, env := range environment {
e := strings.Split(env, "=")
// error on empty flag or env name
if len(e) == 0 || e[0] == "" {
return fmt.Errorf("invalid env flag: '%s'", env)
}
// if only name given, get from os.Env
if len(e) == 1 {
envir... | [
-0.7505476474761963,
-0.21775563061237335,
0.657238781452179,
0.18362483382225037,
0.4447405934333801,
0.8375692367553711,
0.3689793348312378,
0.47143667936325073,
-0.7610263228416443,
1.3164043426513672,
-0.054504383355379105,
0.3758470416069031,
-0.11580558866262436,
1.9860931634902954,
... |
func Init() (err error) {
mkSnapshotDir()
return nil
} | [
-0.4590085446834564,
0.7523461580276489,
0.44626373052597046,
1.0223734378814697,
-0.22916658222675323,
0.9257575273513794,
0.8396341800689697,
0.9526721239089966,
0.6786368489265442,
-0.976813793182373,
-0.6048973798751831,
0.06184311583638191,
1.1615262031555176,
0.35089659690856934,
0... |
func (this *Client) UpdateName() bool {
fmt.Println("Please input user name")
fmt.Scanln(&this.Name)
sendMsg := fmt.Sprintf("rename|%v\n", this.Name)
_, err := this.conn.Write([]byte(sendMsg))
if err != nil {
fmt.Println("conn.Write error: ", err)
return false
}
return true
} | [
-1.6149961948394775,
-0.02376236952841282,
1.358034372329712,
0.1480633020401001,
-1.3646286725997925,
0.5640849471092224,
0.2829262912273407,
-0.2855612337589264,
-0.6720008850097656,
0.6303896307945251,
-0.5345948934555054,
-0.03214854374527931,
-0.9044866561889648,
0.030642680823802948,... |
func CalculateAllContractsForCycles(delegatedContracts []DelegatedContract, cycleStart int, cycleEnd int, rate float64, spillage bool, delegateAddr string) ([]DelegatedContract, error){
var err error
for cycleStart <= cycleEnd {
//fmt.Println(cycleStart)
delegatedContracts, err = CalculateAllContractsForCy... | [
-0.41260284185409546,
-0.12549667060375214,
0.6641713976860046,
-0.5929757952690125,
-0.07005967199802399,
0.4593847990036011,
0.2397012710571289,
0.047589898109436035,
0.466280072927475,
-0.3183504343032837,
0.3564634621143341,
0.9044338464736938,
-0.7200983166694641,
0.8934078812599182,
... |
func CalculateAllContractsForCycle(delegatedContracts []DelegatedContract, cycle int, rate float64, spillage bool, delegateAddr string) ([]DelegatedContract, error) {
var err error
var balance float64
delegationsForCycle, _ := GetDelegatedContractsForCycle(cycle, delegateAddr)
for index, delegation := range de... | [
-0.1482463777065277,
0.13987046480178833,
0.7709196209907532,
-0.6367008090019226,
0.04847521334886551,
0.144746795296669,
0.7715044617652893,
0.010129326023161411,
0.9622580409049988,
0.2012239545583725,
0.5073725581169128,
-0.05961477383971214,
-0.24485844373703003,
0.9426295161247253,
... |
func CalculatePercentageSharesForCycle(delegatedContracts []DelegatedContract, cycle int, rate float64, spillage bool, delegateAddr string) ([]DelegatedContract, error){
var stakingBalance float64
//var balance float64
var err error
spillAlert := false
stakingBalance, err = GetDelegateStakingBalance(delegat... | [
0.4005343019962311,
0.5141345262527466,
0.9201488494873047,
-0.6733863353729248,
-0.38607847690582275,
0.5733205080032349,
1.2018277645111084,
0.6036417484283447,
0.7727562189102173,
0.9606776833534241,
0.4090200364589691,
0.11366084218025208,
-0.7027747631072998,
0.2869749367237091,
0.5... |
func GetDelegatedContractsForCycle(cycle int, delegateAddr string) ([]string, error){
var rtnString []string
snapShot, err := GetSnapShot(cycle)
// fmt.Println(snapShot)
if (err != nil){
return rtnString, errors.New("Could not get delegated contracts for cycle " + strconv.Itoa(cycle) + ": GetSnapShot(cycle ... | [
-0.2980475127696991,
0.08955061435699463,
0.9272452592849731,
-0.742154598236084,
-0.25462064146995544,
-0.3925279378890991,
0.21392272412776947,
-0.5361235737800598,
0.5043659210205078,
0.23245598375797272,
-0.2599155306816101,
0.7637357115745544,
-0.4903499484062195,
1.1721792221069336,
... |
func GetAllDelegatedContracts(delegateAddr string) ([]string, error){
var rtnString []string
delegatedContractsCmd := "/chains/main/blocks/head/context/delegates/" + delegateAddr + "/delegated_contracts"
s, err := TezosRPCGet(delegatedContractsCmd)
if (err != nil){
return rtnString, errors.New("Could not ge... | [
0.24824777245521545,
0.07757337391376495,
0.8336321711540222,
-0.36611413955688477,
-0.3326887786388397,
-0.050906021147966385,
-0.5456438660621643,
-0.07785739004611969,
1.1112018823623657,
-0.1534060835838318,
-0.4908429682254791,
1.0784980058670044,
-0.6804196238517761,
1.61851072311401... |
func CalculatePayoutForContract(contract Contract, rate float64, delegate bool) Contract{
////-------------JUST FOR TESTING -------------////
totalNodeRewards := 378 //Amount of rewards for my delegation in cycle 11
////--------------END TESTING ------------------////
grossRewards := contract.SharePercentage * ... | [
1.103883147239685,
0.4581358730792999,
0.7473371028900146,
-1.113837718963623,
0.031039712950587273,
0.035623934119939804,
0.2854486107826233,
0.5896631479263306,
0.591296374797821,
0.1512802094221115,
0.4164699614048004,
-0.7379550933837891,
-0.38464832305908203,
-0.019604017958045006,
... |
func CalculateDelegateNetPayout(delegatedContracts []DelegatedContract) []DelegatedContract{
var delegateIndex int
for index, delegate := range delegatedContracts{
if (delegate.Delegate){
delegateIndex = index
}
}
for _, delegate := range delegatedContracts{
if (!delegate.Delegate){
de... | [
0.2575623393058777,
0.18384972214698792,
0.7748695015907288,
-1.5178968906402588,
-0.025354640558362007,
0.24913625419139862,
0.03867929428815842,
0.5916003584861755,
1.0619016885757446,
0.0995936393737793,
0.5411062240600586,
-0.4972207546234131,
0.06379256397485733,
0.2681272625923157,
... |
func PayoutDelegatedContracts(delegatedContracts []DelegatedContract, alias string) error{
for _, delegatedContract := range delegatedContracts {
err := SendTezos(delegatedContract.TotalPayout, delegatedContract.Address, alias)
if (err != nil){
return errors.New("Could not Payout Delegated Contracts: Se... | [
0.12586775422096252,
0.22573836147785187,
0.5899503231048584,
-1.1244916915893555,
0.1576845794916153,
0.532502293586731,
0.3771229684352875,
0.13888993859291077,
0.4231012165546417,
0.2556889057159424,
-0.03271717205643654,
0.09548018127679825,
0.6428029537200928,
0.9441529512405396,
-0... |
func CalculateTotalPayout(delegatedContract DelegatedContract) DelegatedContract{
for _, contract := range delegatedContract.Contracts{
delegatedContract.TotalPayout = delegatedContract.TotalPayout + contract.NetPayout
}
return delegatedContract
} | [
0.40918469429016113,
0.04205872863531113,
0.6234865784645081,
-1.9148057699203491,
-0.5066643953323364,
0.5873091816902161,
0.532085120677948,
0.9387298226356506,
0.8181673288345337,
0.22818879783153534,
-0.10282942652702332,
-0.5420896410942078,
-0.07301072776317596,
0.17369699478149414,
... |
func CalculateAllTotalPayout(delegatedContracts []DelegatedContract) []DelegatedContract{
for index, delegatedContract := range delegatedContracts{
delegatedContracts[index] = CalculateTotalPayout(delegatedContract)
}
return delegatedContracts
} | [
0.029550781473517418,
-0.1089463159441948,
0.4998503625392914,
-1.2598899602890015,
-0.3055484890937805,
0.25216761231422424,
0.2604409456253052,
0.6003918647766113,
0.95023113489151,
0.22802001237869263,
-0.10855992883443832,
-0.2638828754425049,
0.24359610676765442,
0.7124080061912537,
... |
func CheckPercentageSumForCycle(cycle int, delegatedContracts []DelegatedContract) float64{
var sum float64
sum = 0
for x := 0; x < len(delegatedContracts); x++{
counter := 0
for y := 0; y < len(delegatedContracts[x].Contracts); y++{
if (delegatedContracts[x].Contracts[y].Cycle == cycle){
br... | [
0.40147411823272705,
0.3611655533313751,
0.7973536849021912,
-0.738746166229248,
-0.2158897966146469,
0.13411366939544678,
1.0990663766860962,
-0.5722302794456482,
0.35275495052337646,
0.561969518661499,
0.6255393028259277,
0.04266558960080147,
-0.7811742424964905,
0.24371911585330963,
0... |
func CalculateRollSpillage(delegatedContracts []DelegatedContract, delegateAddr string, cycle int) ([]DelegatedContract, error) {
stakingBalance, err := GetDelegateStakingBalance(delegateAddr, cycle)
if (err != nil){
return delegatedContracts, errors.New("func CalculateRollSpillage(delegatedContracts []Delegate... | [
0.4590136706829071,
0.5977818369865417,
0.8033665418624878,
-0.7900209426879883,
-0.19266840815544128,
-0.04205735772848129,
0.865371584892273,
0.22365379333496094,
0.8123264312744141,
1.3527040481567383,
0.062149498611688614,
0.2983497977256775,
-0.5177328586578369,
0.6270392537117004,
... |
func SortDelegateContracts(delegatedContracts []DelegatedContract) []DelegatedContract{
for i, j := 0, len(delegatedContracts)-1; i < j; i, j = i+1, j-1 {
delegatedContracts[i], delegatedContracts[j] = delegatedContracts[j], delegatedContracts[i]
}
return delegatedContracts
} | [
0.07268789410591125,
-0.5864543914794922,
0.5801029205322266,
-1.2829033136367798,
-0.38272812962532043,
0.3065168261528015,
0.6798558235168457,
-0.7431366443634033,
0.785149872303009,
-0.0230259969830513,
0.07371488958597183,
0.9840301871299744,
-0.04947391524910927,
0.9658297300338745,
... |
func BindStatusString(s string) (BindStatus, error) {
if val, ok := _BindStatusNameToValueMap[s]; ok {
return val, nil
}
return 0, fmt.Errorf("%s does not belong to BindStatus values", s)
} | [
-0.4909992218017578,
-1.227388858795166,
0.28816333413124084,
0.6912644505500793,
-1.087519645690918,
0.2691946029663086,
-0.150981605052948,
-0.37997257709503174,
0.3948432505130768,
-0.19412143528461456,
0.15062302350997925,
0.17358271777629852,
0.0040629045106470585,
0.44140493869781494... |
func BindStatusValues() []BindStatus {
return _BindStatusValues
} | [
-0.04590538516640663,
-0.9698213934898376,
0.3577183485031128,
1.4547384977340698,
-0.5706958770751953,
1.3545345067977905,
-0.8234636783599854,
0.8236626386642456,
0.42027005553245544,
-0.6537585258483887,
-1.2516268491744995,
0.7514889240264893,
0.43785664439201355,
1.3970547914505005,
... |
func (i BindStatus) IsABindStatus() bool {
for _, v := range _BindStatusValues {
if i == v {
return true
}
}
return false
} | [
-0.11495819687843323,
-1.0607376098632812,
0.5155348181724548,
1.0863910913467407,
0.0067552225664258,
0.5952388048171997,
-0.35526424646377563,
0.2342251092195511,
1.0352603197097778,
-0.3119499981403351,
-0.22165566682815552,
1.1120344400405884,
-0.3539154827594757,
1.1944565773010254,
... |
func NewEnvBackend(prefix string) confita_backend.Backend {
return confita_sugar_prefix.WithPrefix(prefix, confita_backend_env.NewBackend())
} | [
0.5981707572937012,
-0.5779449939727783,
0.3178617060184479,
0.926482081413269,
-0.07963548600673676,
-0.6067158579826355,
-0.7148474454879761,
0.15875808894634247,
-0.31963998079299927,
0.9346990585327148,
-0.09009800851345062,
0.3524378836154938,
0.6210116744041443,
0.755126953125,
0.7... |
func exceptioncheck(e1 error) {
if e1 != nil {
log.Fatal(e1)
}
} | [
0.733361005783081,
0.493166983127594,
0.3872935473918915,
1.1592239141464233,
0.5609256029129028,
0.6575048565864563,
-0.013896634802222252,
0.995151162147522,
0.5930154919624329,
1.027500033378601,
0.7423971891403198,
0.3630267381668091,
0.7801517248153687,
1.2171802520751953,
0.3879680... |
func (p *StatsDParser) GetMetrics() pdata.Metrics {
metrics := pdata.NewMetrics()
rm := metrics.ResourceMetrics().AppendEmpty()
for _, metric := range p.gauges {
rm.InstrumentationLibraryMetrics().Append(metric)
}
for _, metric := range p.counters {
rm.InstrumentationLibraryMetrics().Append(metric)
}
for ... | [
0.008662241511046886,
0.173823282122612,
0.525767982006073,
-0.7976499795913696,
0.3189120888710022,
0.963983416557312,
0.3228399157524109,
-0.9281965494155884,
-0.18461397290229797,
-1.1851121187210083,
0.8463694453239441,
0.39697694778442383,
-0.06636998802423477,
0.42701706290245056,
... |
func (p *StatsDParser) Aggregate(line string) error {
parsedMetric, err := parseMessageToMetric(line, p.enableMetricType)
if err != nil {
return err
}
switch parsedMetric.description.statsdMetricType {
case statsdGauge:
_, ok := p.gauges[parsedMetric.description]
if !ok {
p.gauges[parsedMetric.description... | [
0.9870076775550842,
0.5223976969718933,
0.8122782707214355,
-0.3051663041114807,
0.9018716812133789,
0.3159915804862976,
0.7190062999725342,
-0.7947356104850769,
-0.5475070476531982,
-0.4386013448238373,
0.5662165880203247,
0.681564450263977,
-0.12788952887058258,
0.8306929469108582,
0.5... |
func (pk *PublicKey) ToPublicKeyWithGenerators(messagesCount int) (*PublicKeyWithGenerators, error) {
offset := g2UncompressedSize + 1
data := calcData(pk, messagesCount)
h0 := hashToG1(data)
h := make([]*ml.G1, messagesCount)
for i := 1; i <= messagesCount; i++ {
dataCopy := make([]byte, len(data))
copy(d... | [
-0.19662174582481384,
0.6829347610473633,
0.565899670124054,
-0.4686783254146576,
-0.8231003880500793,
-0.25980645418167114,
0.5267525315284729,
-0.5503556132316589,
-1.3042153120040894,
0.41073909401893616,
-0.6611887812614441,
0.0965484157204628,
-0.25005805492401123,
0.5942983031272888,... |
func (k *PrivateKey) PublicKey() *PublicKey {
pointG2 := curve.GenG2.Mul(frToRepr(k.FR))
return &PublicKey{pointG2}
} | [
0.6390615105628967,
0.2919715940952301,
0.12714898586273193,
0.39265167713165283,
0.409513920545578,
-0.12608173489570618,
0.11197132617235184,
0.25238752365112305,
-0.09924409538507462,
0.009791351854801178,
-0.14347977936267853,
0.4213421940803528,
-0.08438212424516678,
-0.44308269023895... |
func UnmarshalPublicKey(pubKeyBytes []byte) (*PublicKey, error) {
if len(pubKeyBytes) != bls12381G2PublicKeyLen {
return nil, errors.New("invalid size of public key")
}
pointG2, err := curve.NewG2FromCompressed(pubKeyBytes)
if err != nil {
return nil, fmt.Errorf("deserialize public key: %w", err)
}
return &... | [
0.8045877814292908,
0.6056736707687378,
0.3390231132507324,
-0.08799836784601212,
-0.9795761108398438,
0.3150351047515869,
0.13538233935832977,
0.2703607976436615,
-0.18229752779006958,
0.9213438630104065,
-0.41773536801338196,
0.13506589829921722,
-0.47848963737487793,
0.30127671360969543... |
func GenerateKeyPair(h func() hash.Hash, seed []byte) (*PublicKey, *PrivateKey, error) {
if len(seed) != 0 && len(seed) != seedSize {
return nil, nil, errors.New("invalid size of seed")
}
okm, err := generateOKM(seed, h)
if err != nil {
return nil, nil, err
}
privKeyFr := frFromOKM(okm)
privKey := &Privat... | [
0.03345605358481407,
0.551539957523346,
0.5229656100273132,
0.4650527536869049,
-0.6076674461364746,
-0.2825477719306946,
-0.5099728107452393,
-0.1272510439157486,
-0.5853071212768555,
0.2014290988445282,
-0.3976878821849823,
0.5157113075256348,
-0.5574457049369812,
1.4092562198638916,
1... |
func (service ServiceTx) Create(registry *portainer.Registry) error {
return service.Tx.CreateObject(
BucketName,
func(id uint64) (int, interface{}) {
registry.ID = portainer.RegistryID(id)
return int(registry.ID), registry
},
)
} | [
-0.13270719349384308,
0.5324203968048096,
0.1873302310705185,
-0.2312459945678711,
0.38693490624427795,
-0.005848499480634928,
0.17559611797332764,
-0.43072840571403503,
-0.5044004321098328,
0.33557048439979553,
-0.8605553507804871,
-0.2837165296077728,
-0.25677555799484253,
-0.05074804648... |
func Asset(name string) ([]byte, error) {
cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[cannonicalName]; ok {
a, err := f()
if err != nil {
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
}
return a.bytes, nil
}
return nil, fmt.Errorf("Asset %s not foun... | [
-0.7961483001708984,
-1.2313168048858643,
0.633165180683136,
-0.6093899011611938,
-1.546921730041504,
-0.11101024597883224,
0.12971386313438416,
-1.3390334844589233,
-1.1358720064163208,
0.4855233430862427,
0.3090141713619232,
0.32495471835136414,
-0.6009681224822998,
-0.44264674186706543,... |
func MustAsset(name string) []byte {
a, err := Asset(name)
if err != nil {
panic("asset: Asset(" + name + "): " + err.Error())
}
return a
} | [
-0.012778956443071365,
0.11985661834478378,
0.4091298282146454,
-0.5268413424491882,
-0.8276715278625488,
0.4719155430793762,
-0.8186293840408325,
-1.5736604928970337,
0.16388541460037231,
0.6357062458992004,
-0.5354578495025635,
0.35693347454071045,
0.0057142809964716434,
-0.0248885955661... |
func AssetInfo(name string) (os.FileInfo, error) {
cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[cannonicalName]; ok {
a, err := f()
if err != nil {
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
}
return a.info, nil
}
return nil, fmt.Errorf("Asset... | [
0.371969997882843,
-1.1052993535995483,
0.5630446076393127,
-0.922572672367096,
-1.356387734413147,
0.0033556853886693716,
0.6777529716491699,
-0.8006685972213745,
-1.2748286724090576,
0.3115358352661133,
0.2636086046695709,
0.26388120651245117,
0.0635773167014122,
-0.3988074064254761,
0... |
func AssetNames() []string {
names := make([]string, 0, len(_bindata))
for name := range _bindata {
names = append(names, name)
}
return names
} | [
-0.7293784618377686,
-0.8460342288017273,
0.7321816682815552,
-0.39323121309280396,
-0.48951536417007446,
0.7661203145980835,
-0.5028699636459351,
-0.8655748963356018,
-0.4145073890686035,
0.8099913597106934,
0.16903363168239594,
1.163049578666687,
-0.028152840211987495,
0.0342608317732811... |
func RestoreAsset(dir, name string) error {
data, err := Asset(name)
if err != nil {
return err
}
info, err := AssetInfo(name)
if err != nil {
return err
}
err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
if err != nil {
return err
}
err = ioutil.WriteFile(_filePath(dir, name), d... | [
0.3437124192714691,
-0.3622540235519409,
0.6770355701446533,
-1.2592030763626099,
-0.006139514967799187,
-0.04453148692846298,
-0.0072639440186321735,
-0.43950510025024414,
-0.20619122684001923,
-0.2510169744491577,
0.1784360408782959,
0.13568510115146637,
-0.23627112805843353,
-0.56985116... |
func RestoreAssets(dir, name string) error {
children, err := AssetDir(name)
// File
if err != nil {
return RestoreAsset(dir, name)
}
// Dir
for _, child := range children {
err = RestoreAssets(dir, filepath.Join(name, child))
if err != nil {
return err
}
}
return nil
} | [
0.42261892557144165,
0.30020031332969666,
0.5813396573066711,
-0.20641657710075378,
-0.23828908801078796,
-0.24414615333080292,
0.5739709138870239,
-0.029911456629633904,
0.06188219040632248,
-0.43923482298851013,
0.5113736987113953,
0.3275970220565796,
-0.6125145554542542,
0.0351656526327... |
func SyncCompanies(w http.ResponseWriter, req *http.Request) {
w.Header().Set("Content-Type", "application/json")
res := models.APIRes{}
// - Get the size of companies data
var companiesIdx int
rows, err := glob.DB.Query("SELECT COUNT(1) FROM `companies`")
if err != nil {
logs.Error(err)
res.Error = err.Er... | [
-1.170412540435791,
0.5941190719604492,
1.0900704860687256,
-0.4277389943599701,
-0.2713659703731537,
-0.24707019329071045,
0.8202219009399414,
-0.6731196045875549,
-0.6577158570289612,
0.8181206583976746,
-0.22674942016601562,
0.07546009123325348,
0.34531569480895996,
0.7596212029457092,
... |
func kiloToChinese(number int, maybeZero, lastZero bool) (string, bool, bool) {
var buffer bytes.Buffer
for i, str := range Reverse(Number2) {
n := int(math.Pow10(3 - i))
switch {
case number >= n:
buffer.WriteString(Number1[number/n] + str)
number = number % n
maybeZero = true
lastZero = false
c... | [
0.6435717344284058,
-0.20533587038516998,
0.7610688209533691,
-0.29736971855163574,
-0.00930711068212986,
-0.37238290905952454,
-0.6518470644950867,
-0.4391242265701294,
-1.149788498878479,
0.7807954549789429,
-0.014422588981688023,
-0.7755734920501709,
-0.12437410652637482,
-0.43518605828... |
func NewMockUserRepositoryInterface(ctrl *gomock.Controller) *MockUserRepositoryInterface {
mock := &MockUserRepositoryInterface{ctrl: ctrl}
mock.recorder = &MockUserRepositoryInterfaceMockRecorder{mock}
return mock
} | [
-0.49857214093208313,
-0.24307137727737427,
0.30240073800086975,
0.5152350068092346,
-0.7902206778526306,
-0.10772204399108887,
0.713295578956604,
-0.33208587765693665,
0.14050248265266418,
0.34248313307762146,
-0.6603991389274597,
-0.6294171214103699,
-0.5824835896492004,
0.40685045719146... |
func (m *MockUserRepositoryInterface) EXPECT() *MockUserRepositoryInterfaceMockRecorder {
return m.recorder
} | [
-0.10836290568113327,
0.34967830777168274,
0.12087501585483551,
0.1953165978193283,
0.00040994465234689415,
0.13302358984947205,
0.3780900537967682,
0.06131918355822563,
0.2582320272922516,
-0.3724226653575897,
0.6243477463722229,
0.40127667784690857,
-0.837491512298584,
0.2234892249107360... |
func (m *MockUserRepositoryInterface) InsertUser(arg0 *db.User) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "InsertUser", arg0)
ret0, _ := ret[0].(error)
return ret0
} | [
-0.5905477404594421,
0.46008217334747314,
0.0851471871137619,
0.5734907984733582,
1.3279433250427246,
0.9754341840744019,
1.9249589443206787,
0.40092507004737854,
-0.9681350588798523,
-0.47994256019592285,
-0.5760228037834167,
-1.2142243385314941,
-1.911536693572998,
1.1277437210083008,
... |
func (mr *MockUserRepositoryInterfaceMockRecorder) InsertUser(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InsertUser", reflect.TypeOf((*MockUserRepositoryInterface)(nil).InsertUser), arg0)
} | [
-0.47966018319129944,
0.9992979168891907,
-0.08520451933145523,
0.3217182457447052,
0.18457533419132233,
0.9554663300514221,
0.8525149822235107,
-0.26958149671554565,
0.32796210050582886,
-0.09200670570135117,
0.5114968419075012,
-0.37131574749946594,
-1.8219741582870483,
1.366034865379333... |
func (m *MockUserRepositoryInterface) GetUserWhereUsername(arg0 string) (*db.User, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetUserWhereUsername", arg0)
ret0, _ := ret[0].(*db.User)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
0.14338193833827972,
0.5838867425918579,
0.23796600103378296,
1.3250561952590942,
0.7956076264381409,
-0.09000999480485916,
1.5567560195922852,
-0.12551839649677277,
-0.5072547197341919,
-0.5017150640487671,
-1.0613820552825928,
-0.8746832013130188,
-0.35463353991508484,
0.7513077855110168... |
func (mr *MockUserRepositoryInterfaceMockRecorder) GetUserWhereUsername(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUserWhereUsername", reflect.TypeOf((*MockUserRepositoryInterface)(nil).GetUserWhereUsername), arg0)
} | [
0.23012982308864594,
0.931510865688324,
0.30559515953063965,
1.205418348312378,
-0.08135160803794861,
0.06979063898324966,
0.4406612515449524,
-0.4771198034286499,
0.09749651700258255,
0.5742395520210266,
0.1086292713880539,
0.10584546625614166,
-0.22864332795143127,
1.005569338798523,
0... |
func (m *MockUserRepositoryInterface) GetUserWhereUserID(arg0 uint64) (*db.User, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetUserWhereUserID", arg0)
ret0, _ := ret[0].(*db.User)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
0.4261544644832611,
0.035535622388124466,
0.24071897566318512,
0.9246225357055664,
0.8884552717208862,
0.18232661485671997,
1.097307562828064,
-0.2971845269203186,
-0.24742162227630615,
-0.10387249290943146,
-0.5340933203697205,
-0.4330494701862335,
-0.2757470905780792,
1.3377859592437744,... |
func (mr *MockUserRepositoryInterfaceMockRecorder) GetUserWhereUserID(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUserWhereUserID", reflect.TypeOf((*MockUserRepositoryInterface)(nil).GetUserWhereUserID), arg0)
} | [
0.7017119526863098,
0.5112022757530212,
0.16695353388786316,
0.6674001216888428,
0.05576276406645775,
0.5109320878982544,
0.07519681006669998,
-0.40698951482772827,
0.40252453088760376,
0.69612717628479,
0.7214912176132202,
0.5058860778808594,
-0.2583685517311096,
1.707829475402832,
-0.1... |
func (m *MockUserRepositoryInterface) GetUsersWhereUserIDs(arg0 []uint64) ([]*db.User, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetUsersWhereUserIDs", arg0)
ret0, _ := ret[0].([]*db.User)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
0.14940139651298523,
0.15792620182037354,
-0.00156207790132612,
0.16027264297008514,
0.9377026557922363,
-0.007871807552874088,
1.1409807205200195,
0.23503008484840393,
-0.4050545394420624,
-0.27858519554138184,
-0.41489025950431824,
0.06713451445102692,
-0.7157847881317139,
1.269319415092... |
func (mr *MockUserRepositoryInterfaceMockRecorder) GetUsersWhereUserIDs(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUsersWhereUserIDs", reflect.TypeOf((*MockUserRepositoryInterface)(nil).GetUsersWhereUserIDs), arg0)
} | [
0.2408599853515625,
0.6151119470596313,
0.0917908251285553,
-0.21005742251873016,
-0.022835426032543182,
0.04619431123137474,
-0.3371083736419678,
-0.22083637118339539,
0.34271708130836487,
0.5839154720306396,
0.5647336840629578,
0.8851348757743835,
-0.4701140820980072,
1.571938157081604,
... |
func (m *MockUserRepositoryInterface) DeleteUserWhereUsername(arg0 string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DeleteUserWhereUsername", arg0)
ret0, _ := ret[0].(error)
return ret0
} | [
0.04784619063138962,
0.2217605859041214,
-0.11113762855529785,
0.8584235310554504,
0.3688269853591919,
0.1732804775238037,
1.903389573097229,
0.37537139654159546,
-0.5865588784217834,
-0.4174562394618988,
-0.26163649559020996,
-0.566892683506012,
-0.5848042368888855,
1.0122448205947876,
... |
func (mr *MockUserRepositoryInterfaceMockRecorder) DeleteUserWhereUsername(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteUserWhereUsername", reflect.TypeOf((*MockUserRepositoryInterface)(nil).DeleteUserWhereUsername), arg0)
} | [
0.0327383391559124,
0.6693618893623352,
0.12348770350217819,
0.8268958330154419,
-0.5381524562835693,
0.2202770859003067,
0.5527183413505554,
-0.12705302238464355,
0.34699949622154236,
0.3096308410167694,
0.46870675683021545,
0.2992328107357025,
-0.18622753024101257,
1.1308037042617798,
... |
func (sa ServiceAccount) MarshalText() ([]byte, error) {
return []byte(sa.String()), nil
} | [
1.084116816520691,
0.33533644676208496,
0.09395188838243484,
0.2558833360671997,
-1.1605466604232788,
-0.24450424313545227,
-0.32890933752059937,
-0.10551054775714874,
1.68965744972229,
0.4410523474216461,
0.2233840972185135,
1.0382792949676514,
-0.38551148772239685,
-0.5588803887367249,
... |
func (sa ServiceAccount) String() string {
if sa.Namespace == "" {
return fmt.Sprintf("default/%s", sa.Name)
}
return fmt.Sprintf("%s/%s", sa.Namespace, sa.Name)
} | [
0.7839771509170532,
-0.6973516345024109,
0.08449267596006393,
-0.04860054701566696,
-0.29711633920669556,
0.39493465423583984,
1.0018467903137207,
-1.277368187904358,
0.5535845160484314,
0.13012951612472534,
0.7364236116409302,
1.087231993675232,
-0.09719008952379227,
-0.08513294160366058,... |
func (sa ServiceAccount) Key() string {
return fmt.Sprintf("%s/%s", sa.Namespace, sa.Name)
} | [
0.15540455281734467,
-0.3832121789455414,
0.1799376755952835,
-0.0453084297478199,
-0.1778797060251236,
1.066213607788086,
0.15569397807121277,
-0.32562491297721863,
0.8610806465148926,
0.47794392704963684,
0.92423015832901,
1.05970299243927,
0.14601972699165344,
-0.21948513388633728,
0.... |
func (m *SAMap) Serialize() ([]byte, error) {
m.RLock()
defer m.RUnlock()
return json.Marshal(m.ma)
} | [
-0.6399389505386353,
-0.3412111699581146,
0.5518601536750793,
0.33645519614219666,
-0.3873938024044037,
-0.7497099041938782,
-0.3453080356121063,
-0.25727564096450806,
1.200481653213501,
0.1487068384885788,
-0.5778051018714905,
0.041086506098508835,
-1.2692662477493286,
0.5437893271446228,... |
func newSAMap() *saMap {
t := make(map[ServiceAccount]GSAEmail)
return &saMap{
ma: t,
}
} | [
0.0397542305290699,
-0.4625531733036041,
0.05559142678976059,
0.43241605162620544,
-1.3640230894088745,
-0.12583492696285248,
-0.01743452250957489,
0.1124122366309166,
1.2978649139404297,
0.42808467149734497,
0.25709041953086853,
0.2900632321834564,
0.5141024589538574,
-0.32211023569107056... |
func (m *saMap) get(sa ServiceAccount) (GSAEmail, bool) {
m.RLock()
defer m.RUnlock()
gsa, ok := m.ma[sa]
return gsa, ok
} | [
-0.5934633016586304,
-0.22868135571479797,
0.36886584758758545,
-0.02680307626724243,
-0.8036589026451111,
-0.40391257405281067,
0.3655838668346405,
-0.004270582925528288,
0.44253212213516235,
0.5658694505691528,
0.7293160557746887,
1.1788252592086792,
-0.4069623053073883,
-0.5288715362548... |
func (m *saMap) serialize() ([]byte, error) {
m.RLock()
defer m.RUnlock()
return json.Marshal(m.ma)
} | [
-0.6399389505386353,
-0.3412111699581146,
0.5518601536750793,
0.33645519614219666,
-0.3873938024044037,
-0.7497099041938782,
-0.3453080356121063,
-0.25727564096450806,
1.200481653213501,
0.1487068384885788,
-0.5778051018714905,
0.041086506098508835,
-1.2692662477493286,
0.5437893271446228,... |
func NewRunShellPlugin(context context.T) (*runShellPlugin, error) {
shplugin := runShellPlugin{
context: context,
Plugin: Plugin{
Context: context,
Name: appconfig.PluginNameAwsRunShellScript,
ScriptName: shellScriptName,
ShellCommand: shellCommand,
... | [
-0.22435736656188965,
-0.5925781726837158,
0.5599251389503479,
-0.4832756519317627,
-0.21826626360416412,
-0.43939727544784546,
-0.5529749989509583,
0.17169097065925598,
0.634696364402771,
-0.25816160440444946,
-0.9935821294784546,
1.2913187742233276,
-0.04672478511929512,
0.25196090340614... |
func getSleepTime() time.Duration {
return time.Duration(150+rand.Int31n(200)) * time.Millisecond
} | [
-0.05472981557250023,
0.46019259095191956,
0.504439651966095,
-0.6204530000686646,
-1.0765520334243774,
0.37506622076034546,
-0.6111882925033569,
-0.8904078006744385,
1.3473248481750488,
0.5624929070472717,
-0.04289211332798004,
0.41474348306655884,
-0.28231897950172424,
0.1908595561981201... |
func (rf *Raft) GetState() (int, bool) {
rf.mu.Lock()
defer rf.mu.Unlock()
var term int
var isleader bool
// Your code here (2A).
term = rf.currentTerm
if rf.state == LEADER {
isleader = true
} else {
isleader = false
}
return term, isleader
} | [
-0.09525223821401596,
-0.484832763671875,
0.70194011926651,
0.4311649799346924,
-0.33639925718307495,
-0.6654108166694641,
0.057580769062042236,
-0.05281846225261688,
0.15941570699214935,
0.0859893262386322,
-0.8472657799720764,
0.9178057909011841,
-1.0789871215820312,
0.5811142921447754,
... |
func (rf *Raft) persist() {
// Your code here (2C).
// Example:
// w := new(bytes.Buffer)
// e := gob.NewEncoder(w)
// e.Encode(rf.xxx)
// e.Encode(rf.yyy)
// data := w.Bytes()
// rf.persister.SaveRaftState(data)
} | [
0.2440500110387802,
0.20504844188690186,
0.7210336923599243,
0.22793003916740417,
0.47031599283218384,
0.6232033967971802,
1.197713851928711,
-0.2771352529525757,
0.28057047724723816,
-0.6213681101799011,
-1.392462968826294,
-0.13795502483844757,
-1.038998007774353,
0.5021166205406189,
-... |
func (rf *Raft) readPersist(data []byte) {
// Your code here (2C).
// Example:
// r := bytes.NewBuffer(data)
// d := gob.NewDecoder(r)
// d.Decode(&rf.xxx)
// d.Decode(&rf.yyy)
if data == nil || len(data) < 1 { // bootstrap without any state?
return
}
} | [
-0.32382404804229736,
0.021260399371385574,
0.7250837683677673,
0.9358000755310059,
0.1921267956495285,
-0.03958725184202194,
0.41396692395210266,
0.6316553950309753,
0.557557225227356,
-0.5584129095077515,
0.07672178000211716,
-0.25839853286743164,
-0.8620074987411499,
0.249738410115242,
... |
func (rf *Raft) RequestVote(args *RequestVoteArgs, reply *RequestVoteReply) {
// Your code here (2A, 2B).
rf.mu.Lock()
defer rf.mu.Unlock()
// defer DPrintf("%d(%d|term%d|vote%d) replyed %d(%d) with %s", rf.me, rf.state, rf.currentTerm, rf.votedFor, args.CandidateId, args.Term, reply)
if args.Term < rf.currentTe... | [
-0.38903528451919556,
-0.3431474566459656,
0.853326678276062,
0.7435746788978577,
0.31924694776535034,
-0.1838492453098297,
-0.2342166304588318,
-0.26655295491218567,
-0.16337081789970398,
-0.5070323348045349,
0.43652811646461487,
0.8962345123291016,
-1.0268664360046387,
0.0295303426682949... |
func (rf *Raft) sendRequestVote(server int, args *RequestVoteArgs, reply *RequestVoteReply) bool {
// DPrintf("%d send to Server %d", args.CandidateId, server)
ok := rf.peers[server].Call("Raft.RequestVote", args, reply)
return ok
} | [
-1.7597248554229736,
0.17187944054603577,
0.7749979496002197,
0.4043159484863281,
-0.12149311602115631,
0.4897199273109436,
-0.6838339567184448,
-0.15865640342235565,
-0.3190511167049408,
0.21421650052070618,
-0.0693332701921463,
0.8452647924423218,
-1.4494236707687378,
0.2035626322031021,... |
func (rf *Raft) Start(command interface{}) (int, int, bool) {
rf.mu.Lock()
state := rf.state
rf.mu.Unlock()
if state != LEADER {
return -1, -1, false
}
DPrintf("[START COMMAND] %d ON NODE %d TERM %d", command, rf.me, rf.currentTerm)
index := -1
term, isLeader := rf.GetState()
// Your code here (2B).
log ... | [
-0.554250180721283,
-0.336956262588501,
0.7361339330673218,
0.16963455080986023,
-0.01919623278081417,
-0.3896018862724304,
0.764535665512085,
0.27466559410095215,
-0.4964999854564667,
0.26062989234924316,
-1.102820634841919,
1.113824486732483,
-0.5505557060241699,
-0.002862803405150771,
... |
func (rf *Raft) Kill() {
// Your code here, if desired.
} | [
0.15184055268764496,
-0.3770192861557007,
0.40404364466667175,
1.9106957912445068,
0.502834141254425,
0.5282723903656006,
0.7904229164123535,
0.14719004929065704,
0.14879009127616882,
0.04401463642716408,
-0.7571715712547302,
1.279595971107483,
-0.5694881677627563,
0.10148557275533676,
-... |
func (rf *Raft) CheckLogs() {
rf.mu.Lock()
state := rf.state
rf.mu.Unlock()
for state == LEADER {
//DPrintf("CHECKLOGS ON NODE %d: logs %s", rf.me, rf.logs)
//appendChan := make(chan AppendResult, len(rf.peers))
for peerId := range rf.peers {
if peerId == rf.me {
continue
}
rf.mu.Lock()
logLen... | [
-0.017208058387041092,
0.11840756982564926,
0.9560010433197021,
-0.7856211066246033,
-0.10874863713979721,
-0.5642711520195007,
0.24439269304275513,
-0.5255076885223389,
0.05801258981227875,
0.51768958568573,
0.5492455959320068,
0.43687814474105835,
-0.7925969958305359,
0.7052544355392456,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.