text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func iserr(t reflect.Type) bool {
if t.Kind() == reflect.Interface {
return t.Implements(reflect.TypeOf((*error)(nil)).Elem())
}
return false
} | [
-1.226264476776123,
0.17537462711334229,
0.44563668966293335,
0.23040154576301575,
-0.21572759747505188,
0.1343679428100586,
0.21409134566783905,
-0.1073349341750145,
1.1732748746871948,
0.11403144150972366,
-0.19307109713554382,
0.19855301082134247,
-0.7568935751914978,
0.8534661531448364... |
func (f *FactionValues) TableName() string {
return "faction_values"
} | [
0.054619550704956055,
-0.016639728099107742,
0.33516767621040344,
0.4951246678829193,
0.39094018936157227,
0.06001337245106697,
-0.40409055352211,
0.4238532781600952,
-1.378682017326355,
-0.6276820302009583,
0.3183009922504425,
-0.3033803701400757,
1.4209622144699097,
0.7759571075439453,
... |
func (f *FactionValues) BeforeSave() error {
return nil
} | [
-0.21812967956066132,
0.17361371219158173,
0.23699985444545746,
-0.10211201012134552,
0.838086724281311,
-0.5807227492332458,
-0.79047691822052,
-0.6222378015518188,
-1.1308425664901733,
-0.1556738317012787,
-0.2595789432525635,
-0.9629513025283813,
-0.26339811086654663,
1.0270670652389526... |
func (f *FactionValues) Prepare() {
} | [
-0.47302988171577454,
0.2557550072669983,
0.141395702958107,
0.17031343281269073,
-0.010943328030407429,
-0.6838635802268982,
-0.4081753194332123,
-0.273681104183197,
-0.6694762706756592,
-1.253162145614624,
-0.07198484241962433,
-0.6178810596466064,
0.7087555527687073,
0.877173900604248,
... |
func (f *FactionValues) Validate(action Action) error {
return nil
} | [
-0.7096951603889465,
0.30898013710975647,
0.25127550959587097,
0.3499625325202942,
0.9307212829589844,
-0.1655135303735733,
0.1781446933746338,
-0.6513893604278564,
-0.9484224319458008,
-1.5148049592971802,
0.7958637475967407,
-0.2423735409975052,
0.4891621768474579,
1.2464120388031006,
... |
func (f *FactionValues) TableInfo() *TableInfo {
return faction_valuesTableInfo
} | [
0.5017442107200623,
-0.12707869708538055,
0.1665160357952118,
0.2804952561855316,
0.46679285168647766,
0.35546085238456726,
-0.752599835395813,
-0.7861489057540894,
-1.8791402578353882,
-0.9933666586875916,
0.07839122414588928,
-0.23876141011714935,
1.1349745988845825,
0.7436642050743103,
... |
func ProxyID(endpointID uint16, ingress bool, protocol string, port uint16) string {
direction := "egress"
if ingress {
direction = "ingress"
}
return strconv.FormatUint(uint64(endpointID), 10) + ":" + direction + ":" + protocol + ":" + strconv.FormatUint(uint64(port), 10)
} | [
0.4644721746444702,
-0.22286798059940338,
0.489402174949646,
-0.6743500232696533,
0.5311938524246216,
0.46679916977882385,
-0.660313069820404,
0.7408906817436218,
0.03822367638349533,
0.8360486030578613,
0.5306066870689392,
0.25482311844825745,
-1.1484464406967163,
-0.22590188682079315,
... |
func ProxyIDFromKey(endpointID uint16, key Key) string {
return ProxyID(endpointID, key.TrafficDirection == trafficdirection.Ingress.Uint8(), u8proto.U8proto(key.Nexthdr).String(), key.DestPort)
} | [
0.19578707218170166,
-0.5253454446792603,
0.3075242340564728,
-0.31028252840042114,
-0.7284347414970398,
0.042498961091041565,
-0.9919911026954651,
0.027073707431554794,
0.19526709616184235,
1.2858386039733887,
0.5911747217178345,
-0.36215734481811523,
-1.2667512893676758,
-0.4330101013183... |
func ParseProxyID(proxyID string) (endpointID uint16, ingress bool, protocol string, port uint16, err error) {
comps := strings.Split(proxyID, ":")
if len(comps) != 4 {
err = fmt.Errorf("invalid proxy ID structure: %s", proxyID)
return
}
epID, err := strconv.ParseUint(comps[0], 10, 16)
if err != nil {
return... | [
-0.13108640909194946,
-0.5841760039329529,
0.506564736366272,
-0.8770636320114136,
0.33244600892066956,
-0.36356937885284424,
-0.35949113965034485,
0.19795012474060059,
-0.01635861024260521,
0.28106996417045593,
-0.5255752205848694,
0.03686094284057617,
-0.9948367476463318,
-0.010433094576... |
func TestLASetPasswordSalt(t *testing.T) {
la := &LoggedAccount{}
la.SetPassword("bla bla")
salt1 := la.Salt
pass1 := la.Password
// Same password, another salt
la.SetPassword("bla bla")
if salt1 == la.Salt {
t.Errorf("Salts %v and %v identical", salt1, la.Salt)
}
if pass1 == la.Password {
t.Errorf("Stor... | [
0.3631751239299774,
-0.5296947360038757,
0.5893318057060242,
-0.16474708914756775,
0.225076362490654,
1.1816987991333008,
0.20580770075321198,
-0.0910615548491478,
1.0872135162353516,
-0.009998473338782787,
-0.40288251638412476,
0.8765068054199219,
-0.009669163264334202,
0.5094699859619141... |
func TestLASetAndVerifyPassword(t *testing.T) {
la := &LoggedAccount{}
la.SetPassword("bla bla")
if !la.VerifyPassword("bla bla") {
t.Errorf("Passord not recognized")
}
if la.VerifyPassword("another password") {
t.Errorf("Password incorrectly verified")
}
} | [
0.8877050280570984,
-0.4512781798839569,
0.48639535903930664,
0.24889621138572693,
0.5851010680198669,
0.8291060328483582,
-0.3972018361091614,
0.3711024224758148,
0.9024394750595093,
-0.3839511275291443,
-0.9005197882652283,
1.0069849491119385,
0.06984584778547287,
1.2327059507369995,
0... |
func Inside(point *Point, polygon PolygonI) bool {
polygons := polygon.getPolygons()
insidePoly := false
for i := 0; i < len(polygons) && !insidePoly; i++ {
// check if it is in the outer ring first
if inRing(point, polygons[i].LineStrings[0]) {
inHole := false
// check for the point in any of the holes
... | [
0.28978702425956726,
-0.630835771560669,
0.6739206910133362,
-0.5481461882591248,
-0.887869119644165,
0.8896154165267944,
-0.9573485851287842,
-0.21076969802379608,
-0.06968212127685547,
0.35115206241607666,
-0.19657093286514282,
0.04280850291252136,
-1.2949419021606445,
-0.917691886425018... |
func Within(points []*Point, polygons []PolygonI) []*Point {
result := []*Point{}
for _, polygon := range polygons {
for _, point := range points {
if Inside(point, polygon) {
result = append(result, point)
}
}
}
return result
} | [
0.27898988127708435,
-0.8791560530662537,
0.411876380443573,
0.5622214078903198,
-0.9206805229187012,
0.5799063444137573,
-1.172715663909912,
0.12814567983150482,
-0.0833558440208435,
0.5488051176071167,
-0.2026212364435196,
0.7467952966690063,
-0.4625510275363922,
-0.6927340030670166,
-... |
func NewMockAuthenticationService(ctrl *gomock.Controller) *MockAuthenticationService {
mock := &MockAuthenticationService{ctrl: ctrl}
mock.recorder = &MockAuthenticationServiceMockRecorder{mock}
return mock
} | [
-0.8918306827545166,
0.08645753562450409,
-0.09700965881347656,
0.6970799565315247,
-0.15497510135173798,
-0.12370388209819794,
0.7310372591018677,
-1.106536865234375,
1.0247681140899658,
0.5367165803909302,
-0.2813512682914734,
0.36898571252822876,
-0.725727915763855,
0.6145041584968567,
... |
func (m *MockAuthenticationService) EXPECT() *MockAuthenticationServiceMockRecorder {
return m.recorder
} | [
-0.46946945786476135,
0.41607925295829773,
0.1402030736207962,
0.21835753321647644,
-0.25172048807144165,
0.3455839157104492,
-0.05646995082497597,
-0.18316800892353058,
0.9781839847564697,
-0.33159366250038147,
0.733223021030426,
0.9613008499145508,
-0.9988316297531128,
0.4974553883075714... |
func (m *MockAuthenticationService) GetLoginSession(arg0 *http.Request) (security.LoginSession, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetLoginSession", arg0)
ret0, _ := ret[0].(security.LoginSession)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
-0.5997887849807739,
-0.7193223834037781,
0.2447819858789444,
0.3382706940174103,
1.0601634979248047,
-0.009109473787248135,
0.973225474357605,
-1.3029401302337646,
-0.21406809985637665,
-0.6570247411727905,
-0.9569796919822693,
0.33969101309776306,
-1.221825361251831,
0.1844661980867386,
... |
func (mr *MockAuthenticationServiceMockRecorder) GetLoginSession(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLoginSession", reflect.TypeOf((*MockAuthenticationService)(nil).GetLoginSession), arg0)
} | [
-0.47746193408966064,
0.13305902481079102,
0.15089835226535797,
0.056768979877233505,
0.5660483241081238,
0.15004415810108185,
-0.07872617244720459,
-1.538642406463623,
0.9564625024795532,
0.2424183338880539,
-0.004456088412553072,
1.2960622310638428,
-1.2610703706741333,
0.715971291065216... |
func (c *Canvas) SetColor(row, col int, color utils.Color) { //uint8
//sadly a lot of terminals don't support true colors yet..
//in the future this would be a better alternative:
//c.formatting[row][col] = fmt.Sprintf("38;2;%d;%d;%d;1", r, g, b) //+= ?
//for now.. we use the basic(only) alternative
number := 16 +... | [
0.4721249043941498,
-0.07906554639339447,
0.6998955607414246,
-0.19849136471748352,
-0.1261317878961563,
0.4337061941623688,
-0.31525319814682007,
0.07412449270486832,
0.2922303378582001,
-0.04262339696288109,
-0.18558572232723236,
-0.15589164197444916,
0.4394126534461975,
0.47791528701782... |
func GetCmdIssueToken(cdc *codec.Codec) *cobra.Command {
cmd := &cobra.Command{
Use: `issue --token-name [name] --total-supply [amount]
--symbol [ABC] --mintable --from [account]`,
Short: "create a new asset",
// Args: cobra.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
cliCtx := c... | [
0.38785257935523987,
0.21645809710025787,
0.9011530876159668,
-0.6483376622200012,
-0.3126881420612335,
-0.2899514138698578,
0.09946627169847488,
0.02088492177426815,
-0.22994038462638855,
-0.4558553397655487,
-0.6168922781944275,
1.073498010635376,
-0.1686946451663971,
0.2444419115781784,... |
func GetCmdMintCoins(cdc *codec.Codec) *cobra.Command {
cmd := &cobra.Command{
Use: `mint --amount [amount] --symbol [ABC-123]`,
Short: "mint more coins for the specified token",
// Args: cobra.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
cliCtx := context.NewCLIContext().WithCodec... | [
0.16088467836380005,
0.25433140993118286,
0.845552921295166,
-1.492619514465332,
0.3217778205871582,
-0.6241416335105896,
-0.28172194957733154,
-1.353821873664856,
-0.044887907803058624,
0.027503270655870438,
-0.05664641037583351,
0.8575209379196167,
-0.4716508388519287,
0.2527220547199249... |
func GetCmdBurnCoins(cdc *codec.Codec) *cobra.Command {
cmd := &cobra.Command{
Use: `burn --amount [amount] --symbol [ABC-123] --from [account]`,
Short: "destroy the given amount of token/coins, reducing the total supply",
// Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
... | [
0.32661885023117065,
0.31406858563423157,
0.8752606511116028,
-1.143973469734192,
0.6476060152053833,
-1.153141975402832,
0.16768011450767517,
-0.4008176326751709,
0.032738275825977325,
-0.33592820167541504,
-0.13354089856147766,
1.1659730672836304,
-0.4540140926837921,
-0.0195012446492910... |
func GetCmdFreezeCoins(cdc *codec.Codec) *cobra.Command {
cmd := &cobra.Command{
Use: `freeze --amount [amount] --symbol [ABC-123] --from [account]`,
Short: "move specified amount of token/coins into frozen status, preventing their sale",
// Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []st... | [
0.10119833052158356,
0.6151763796806335,
0.6730555891990662,
-0.9691232442855835,
0.7706161737442017,
-0.406014084815979,
0.5056874752044678,
-0.9067802429199219,
-0.27779027819633484,
-0.02948256954550743,
0.037506893277168274,
1.087603211402893,
-0.2562902569770813,
0.2698975205421448,
... |
func GetCmdUnfreezeCoins(cdc *codec.Codec) *cobra.Command {
cmd := &cobra.Command{
Use: `unfreeze --amount [amount] --symbol [ABC-123] --from [account]`,
Short: "move specified amount of token into frozen status, preventing their sale",
// Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []stri... | [
-0.02754521183669567,
0.30438050627708435,
0.7788541316986084,
-1.2387782335281372,
0.2473679482936859,
-0.5492926239967346,
0.49703776836395264,
-0.3495134711265564,
-0.216691792011261,
-0.3107525706291199,
0.1021457388997078,
1.0842572450637817,
-0.5230225324630737,
-0.11568582057952881,... |
func GenerateOrBroadcastMsgs(cliCtx context.CLIContext, txBldr authtypes.TxBuilder, msgs []sdk.Msg) (*sdk.TxResponse, error) {
if cliCtx.GenerateOnly {
return nil, utils.PrintUnsignedStdTx(txBldr, cliCtx, msgs)
}
return CompleteAndBroadcastTxCLI(txBldr, cliCtx, msgs)
} | [
-0.31945088505744934,
1.409035325050354,
0.5019014477729797,
-0.2581053376197815,
-0.33757665753364563,
0.12489920109510422,
0.22503218054771423,
0.04255206882953644,
0.6504184007644653,
0.9575083255767822,
0.3769984543323517,
-0.1526414006948471,
-0.3534458577632904,
0.81902015209198,
-... |
func CompleteAndBroadcastTxCLI(txBldr authtypes.TxBuilder, cliCtx context.CLIContext, msgs []sdk.Msg) (*sdk.TxResponse, error) {
txBldr, err := utils.PrepareTxBuilder(txBldr, cliCtx)
if err != nil {
return nil, err
}
fromName := cliCtx.GetFromName()
if txBldr.SimulateAndExecute() || cliCtx.Simulate {
txBldr,... | [
0.5068356990814209,
0.2621254324913025,
1.2321505546569824,
-0.2082025557756424,
-0.8426071405410767,
-0.20446838438510895,
0.43609750270843506,
-0.32585200667381287,
-0.14109501242637634,
1.2068467140197754,
0.025124691426753998,
0.08542787283658981,
-0.45866718888282776,
0.16616494953632... |
func getMerchantInfoForMerchantWeb(u *uModel.User) func(db *gorm.DB) *gorm.DB {
return func(db *gorm.DB) *gorm.DB {
return db.Where("and user_id=? ", u.ID)
}
} | [
0.5851486325263977,
-0.4282326400279999,
0.3830157518386841,
0.32555657625198364,
-0.22799350321292877,
0.015238167718052864,
1.1150784492492676,
-0.1901300698518753,
0.06082656979560852,
0.045222315937280655,
-0.29217803478240967,
0.24135085940361023,
-0.5734058618545532,
1.39103949069976... |
func (sched *Scheduler) Registered(driver sched.SchedulerDriver, frameworkId *mesos.FrameworkID, masterInfo *mesos.MasterInfo) {
sched.master = MasterConnStr(masterInfo)
log.Println("Taurus Framework Registered with Master", sched.master)
// Start the scheduler worker
go func() {
log.Printf("Starting %s framework... | [
0.14419177174568176,
0.005502672865986824,
0.6054501533508301,
0.24825544655323029,
0.7482905387878418,
-0.4534836709499359,
0.23708343505859375,
0.6479073166847229,
-0.30656740069389343,
-0.5408790111541748,
-0.9212242960929871,
0.5671819448471069,
0.5004746317863464,
0.7822301983833313,
... |
func TestCommonHeaders(t *testing.T) {
server := httpserver.New()
server.Use(CommonHeaders("Testify"))
server.GET("/", func(c *httpserver.Context) { c.Response.HEAD(300) })
req, err := http.NewRequest("GET", "/", nil)
if err != nil {
t.Fatal(err)
}
rec := httptest.NewRecorder()
server.ServeHTTP(rec, req)
... | [
0.2881769835948944,
0.6268070936203003,
0.9104695320129395,
-0.07392094284296036,
1.1114864349365234,
0.46389517188072205,
0.03016756661236286,
-0.5444000959396362,
-0.30065086483955383,
0.1756455898284912,
-0.624455451965332,
0.2447798103094101,
-1.4294430017471313,
0.07944653928279877,
... |
func (b Bet) String() string {
if b.Amount != 0. {
return fmt.Sprintf("%s %.2f", string(b.Type), b.Amount)
}
return string(b.Type)
} | [
0.06501574069261551,
-1.030112862586975,
0.5597798824310303,
0.2978273630142212,
0.04072284325957298,
0.6948946714401245,
0.7288806438446045,
-1.1224379539489746,
-0.5988964438438416,
0.7139221429824829,
0.7757641077041626,
0.6492161154747009,
-0.3787202537059784,
0.1770293414592743,
0.7... |
func (b Bet) PrintString() string {
return b.String()
} | [
-0.6525282263755798,
-0.16417595744132996,
0.36084574460983276,
0.4298284947872162,
-0.18900363147258759,
1.378150224685669,
0.09303964674472809,
-0.6918460130691528,
-0.38317903876304626,
0.1263524889945984,
0.9110930562019348,
0.6584397554397583,
-0.5734571814537048,
-0.538555383682251,
... |
func (b Bet) IsActive() bool {
switch b.Type {
case bet.Raise, bet.Call:
return true
default:
return false
}
} | [
-0.5018683075904846,
-0.3983456790447235,
0.6380873322486877,
0.8931530117988586,
0.10316798090934753,
1.110609531402588,
-0.23999470472335815,
0.0320904366672039,
-0.22703465819358826,
0.8077207803726196,
-0.23043060302734375,
0.7034697532653809,
-1.1764382123947144,
-0.12771499156951904,... |
func (b Bet) IsForced() bool {
switch b.Type {
case bet.Ante, bet.BringIn, bet.SmallBlind, bet.BigBlind, bet.GuestBlind, bet.Straddle:
return true
default:
return false
}
} | [
-0.6862891316413879,
0.03655555099248886,
0.4401123821735382,
0.7369396686553955,
0.49047622084617615,
1.1366230249404907,
0.24373936653137207,
-0.033997923135757446,
0.1029941588640213,
0.4662962853908539,
-0.34558019042015076,
1.0811588764190674,
-1.0902018547058105,
1.2025810480117798,
... |
func (b *Bet) Validate(seat *Seat, betRange *bet.Range) error {
switch b.Type {
case bet.Fold:
// no error
case bet.Check:
if betRange.Call != seat.Bet {
return fmt.Errorf("Can't check: need to call=%.2f", betRange.Call)
}
case bet.Call, bet.Raise:
amount := b.Amount
if amount > seat.Stack {
retur... | [
-0.37676501274108887,
0.08382757753133774,
0.7906448841094971,
0.7505858540534973,
-0.11407394707202911,
0.6069832444190979,
-0.20681516826152802,
-0.879539966583252,
-0.516908586025238,
0.2567712366580963,
0.7188404202461243,
0.8123111128807068,
-0.33510440587997437,
0.7909634709358215,
... |
func ReflectInterface(projRoot string, pathSymbolMap map[string]string) (map[string]*model.Package, error) {
// We use TempDir instead of TempFile so we can control the filename.
tmpDir, err := ioutil.TempDir("./", "gomock_reflect_")
if err != nil {
return nil, err
}
defer func() { _ = os.RemoveAll(tmpDir) }()
... | [
-0.41681599617004395,
-0.19136610627174377,
0.8244926929473877,
-0.42831453680992126,
0.34695348143577576,
0.5538243055343628,
1.249668836593628,
-0.17059242725372314,
-0.4429275393486023,
0.12415920197963715,
-0.4748143255710602,
-0.009499779902398586,
-0.4445899426937103,
0.1864388585090... |
func (r *Controller) authorized() gin.HandlerFunc {
return func(c *gin.Context) {
bearToken := c.GetHeader("Authorization")
strArr := strings.Split(bearToken, " ")
if len(strArr) != 2 {
c.AbortWithStatus(http.StatusForbidden)
return
}
tk, err := r.UserToken.VerifyToken(strArr[1])
if err != nil {
... | [
0.4002339839935303,
-0.7221012711524963,
0.5444492101669312,
0.5975334644317627,
-0.5923559665679932,
0.026718145236372948,
-0.4344298541545868,
-0.7824061512947083,
0.21601921319961548,
-0.3215521275997162,
0.31388816237449646,
1.0585963726043701,
0.9878131151199341,
-0.07494399696588516,... |
func RunListener(port string) {
go runServer(port)
rec := transport.CreateReliableReceiver()
defer rec.Close()
buffers := make([]*data.Buffer, data.NumSensorTypes)
for i := range buffers {
buffers[i] = data.CreateBuffer()
}
for {
data := rec.Listen()
for _, d := range data.Body {
buffers[d.Type()].A... | [
-0.5759256482124329,
-0.6320846080780029,
0.729260265827179,
-1.3158349990844727,
0.08157673478126526,
-0.06624162197113037,
0.26006898283958435,
-0.9877666234970093,
-0.24018166959285736,
-0.13844726979732513,
-1.1196516752243042,
0.5160207152366638,
-0.5044331550598145,
0.778563261032104... |
func Logger(next http.Handler) http.HandlerFunc {
stdlogger := log.New(os.Stdout, "", 0)
//errlogger := log.New(os.Stderr, "", 0)
return func(w http.ResponseWriter, r *http.Request) {
// Start timer
start := time.Now()
// Process request
writer := statusWriter{w, 0}
next.ServeHTTP(&writer, r)
// Stop ... | [
-0.7576594352722168,
-0.5934299230575562,
0.832566499710083,
-0.7249433398246765,
-0.8183645009994507,
0.3544881045818329,
-0.22850637137889862,
-0.008944145403802395,
-0.5982776284217834,
0.028449811041355133,
0.04730695113539696,
0.27547377347946167,
0.7921028137207031,
1.044344663619995... |
func main() {
// Start the chaincode and make it ready for futures requests
err := shim.Start(new(SalmonChaincode))
if err != nil {
fmt.Printf("Error starting SalmonChaincode: %s", err)
}
} | [
0.8279999494552612,
-0.41032806038856506,
0.6045293807983398,
0.9780901670455933,
0.1679242104291916,
-0.6003126502037048,
0.5075036287307739,
1.3873423337936401,
-0.019752908498048782,
-0.4544099271297455,
-0.5291675925254822,
1.504531979560852,
-0.6246417164802551,
-0.18327997624874115,
... |
func genFromTempl(server *server, templ string) (string, error) {
t := template.Must(
template.New(confOut).Parse(templ))
var out bytes.Buffer
if err := t.Execute(&out, server); err != nil {
return "", err
}
return out.String(), nil
} | [
0.0492347776889801,
-0.14709483087062836,
0.3380785584449768,
-0.35548070073127747,
-1.3333740234375,
-0.05185692384839058,
0.20503666996955872,
0.2925800383090973,
-1.215202808380127,
0.0708741843700409,
-0.8797525763511658,
-0.5950765013694763,
-0.10180415213108063,
0.666523814201355,
... |
func New(clientID, clientSecret, redirectURL string, scopes ...string) *Provider {
var c = &oauth2.Config{
ClientID: clientID,
ClientSecret: clientSecret,
RedirectURL: redirectURL,
Endpoint: oauth2.Endpoint{
AuthURL: authURL,
TokenURL: tokenURL,
},
Scopes: []string{},
}
c.Scopes = append(c.S... | [
-0.5260226130485535,
0.10952991992235184,
0.1943245381116867,
-1.284394383430481,
-1.2113616466522217,
-0.1503017395734787,
-0.7563422322273254,
0.019709978252649307,
1.040383219718933,
0.17241646349430084,
-0.2946743369102478,
1.4940139055252075,
0.2777028977870941,
0.10023675113916397,
... |
func (p *Provider) Name() string {
return p.name
} | [
-1.157953143119812,
-0.07011232525110245,
0.25046229362487793,
-0.07331213355064392,
-1.0929898023605347,
0.7679830193519592,
-0.527927577495575,
-0.2175361067056656,
0.4191640317440033,
1.5550357103347778,
-0.5716982483863831,
0.1292753517627716,
-0.34346720576286316,
-0.22645629942417145... |
func (p *Provider) SetName(name string) {
p.name = name
} | [
-1.003339409828186,
0.3325532376766205,
0.34285470843315125,
0.27023473381996155,
-0.7267704010009766,
0.5950635671615601,
-0.5329374074935913,
0.3037593960762024,
0.5973570942878723,
1.708226203918457,
-1.000921607017517,
-0.08663924783468246,
-0.46807852387428284,
0.3424065113067627,
0... |
func (p *Provider) BeginAuth(state string) (goth.Session, error) {
return &Session{
AuthURL: p.oauthConfig.AuthCodeURL(state),
}, nil
} | [
-0.791236937046051,
0.07120773941278458,
0.2171240597963333,
0.6622501611709595,
-0.769609808921814,
-0.4967045187950134,
0.8691003918647766,
-0.5742781758308411,
1.0890851020812988,
0.36560890078544617,
0.20546062290668488,
0.7504624128341675,
0.29149505496025085,
-0.3915668725967407,
0... |
func (p *Provider) FetchUser(session goth.Session) (_ goth.User, err error) {
var (
sess = session.(*Session)
user = goth.User{
AccessToken: sess.AccessToken,
RefreshToken: sess.RefreshToken,
Provider: p.Name(),
ExpiresAt: sess.ExpiresAt,
}
)
if user.AccessToken == "" {
return user, fmt.... | [
-0.5696619749069214,
-0.42812904715538025,
0.9581509828567505,
-0.35442593693733215,
-0.8526021838188171,
-0.5731306672096252,
-0.49821627140045166,
-1.5259259939193726,
0.4907535910606384,
-0.044553328305482864,
-0.3982546031475067,
0.5197069644927979,
0.540928065776825,
-0.46877965331077... |
func (p *Provider) Debug(debug bool) {} | [
-0.13086020946502686,
0.5660216808319092,
0.31817078590393066,
0.2390863597393036,
0.7899104952812195,
0.8570924401283264,
0.3950193524360657,
0.8855581879615784,
1.0404486656188965,
0.18049146234989166,
-0.13867032527923584,
0.3801949918270111,
-0.45082706212997437,
0.33587974309921265,
... |
func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) {
t := &oauth2.Token{RefreshToken: refreshToken}
ts := p.oauthConfig.TokenSource(goth.ContextForClient(p.Client()), t)
return ts.Token()
} | [
-0.1942945271730423,
0.07602390646934509,
0.28011661767959595,
0.4889211356639862,
-0.686915397644043,
-0.031978677958250046,
-0.11814874410629272,
-0.03860853239893913,
0.8845389485359192,
-0.25969594717025757,
-0.7958307266235352,
1.6698352098464966,
0.6727526783943176,
-0.62527662515640... |
func (p *Provider) RefreshTokenAvailable() bool {
return true
} | [
-0.9581421613693237,
-0.4628293514251709,
0.39392802119255066,
1.2267566919326782,
-0.20724205672740936,
0.6786739230155945,
-0.9580369591712952,
0.031700249761343,
0.25825583934783936,
1.3072322607040405,
-1.1104326248168945,
1.218548059463501,
0.1698739379644394,
0.3971637487411499,
-0... |
func (p *packet) retrieveInstance(value reflect.Value, tags []string) error {
prv, err := p.firstProvider(tags)
if err != nil {
return err
}
instance, err := prv.getInstance(p.ctn)
if err != nil {
return err
}
value.Elem().Set(instance)
return nil
} | [
-0.21130117774009705,
0.5224791765213013,
0.3539917469024658,
-0.8099797964096069,
0.1310412734746933,
-0.18108002841472626,
-0.6254335641860962,
0.19790785014629364,
0.5737544298171997,
-0.35281404852867126,
-0.6814791560173035,
-0.19507953524589539,
-1.5663583278656006,
0.029570460319519... |
func (p *packet) retrieveSlice(value reflect.Value, tags []string) error {
matchedInstances := reflect.MakeSlice(value.Type().Elem(), 0, 0)
for _, prv := range p.getProviders(tags) {
instance, err := prv.getInstance(p.ctn)
if err != nil {
return err
}
matchedInstances = reflect.Append(matchedInstances, ins... | [
-0.7554519772529602,
0.2845152020454407,
0.3997073769569397,
-0.5551084280014038,
0.8532935976982117,
-0.6007559299468994,
-0.7665169835090637,
-0.3024961054325104,
0.3099674582481384,
-0.15333957970142365,
-0.08960580825805664,
0.4850139319896698,
-1.0142968893051147,
-0.21265681087970734... |
func (p *packet) retrieveMap(value reflect.Value, tags []string) error {
matchedInstances := reflect.MakeMap(value.Type().Elem())
for tag, prv := range p.getProviders(tags) {
instance, err := prv.getInstance(p.ctn)
if err != nil {
return err
}
matchedInstances.SetMapIndex(reflect.ValueOf(tag), instance)
}... | [
-0.6136137247085571,
0.011784788221120834,
0.46153247356414795,
-0.6829521656036377,
0.6941762566566467,
-0.03089882992208004,
0.011770322918891907,
0.20743224024772644,
0.650526762008667,
-0.4373566806316376,
0.015810146927833557,
0.151573047041893,
-0.4897577464580536,
-0.223768144845962... |
func (p *packet) provide(tag string, src *provider) error {
if _, ok := p.providers.Load(tag); ok {
return errors.Wrapf(DuplicatedTag, "'%s'", tag)
}
p.providers.Store(tag, src)
return nil
} | [
-0.6669700145721436,
0.7470759153366089,
0.2388152778148651,
-0.6750092506408691,
0.1623658835887909,
0.017877880483865738,
-0.3846764862537384,
-0.692306399345398,
0.702374279499054,
0.17949442565441132,
-0.9206413626670837,
0.0687398910522461,
-0.06902902573347092,
0.8527885675430298,
... |
func (p *packet) remove(tags []string) {
for _, tag := range tags {
p.providers.Delete(tag)
}
} | [
-0.7665120959281921,
0.4416673481464386,
0.25153717398643494,
-0.23508410155773163,
0.1956881731748581,
-0.16118837893009186,
-1.1952039003372192,
0.5752750039100647,
0.32312893867492676,
0.8197451233863831,
-1.300572156906128,
0.08553822338581085,
-1.1890910863876343,
0.9449261426925659,
... |
func (p *packet) getProviders(tags []string) map[string]*provider {
result := make(map[string]*provider)
getAll := tags == nil
p.providers.Range(func(key, value interface{}) bool {
keyStr := key.(string)
if getAll || internal.KeyInStrings(keyStr, tags) {
prv := value.(*provider)
result[keyStr] = prv
}
... | [
-0.9226053953170776,
0.25992798805236816,
0.6055999994277954,
-0.06246102973818779,
0.3503119945526123,
-0.6080343127250671,
-1.4603121280670166,
-0.4491179585456848,
-0.16027505695819855,
0.5434326529502869,
-0.5546993613243103,
0.37108805775642395,
-0.7555054426193237,
0.6666145920753479... |
func (p *packet) getProvider(tag string) (*provider, error) {
prv, ok := p.providers.Load(tag)
if !ok {
return nil, ProviderNotFound
}
return prv.(*provider), nil
} | [
0.08155513554811478,
0.22910642623901367,
0.3597937822341919,
0.09588368237018585,
-0.5235075354576111,
-0.3119927644729614,
-0.5423347353935242,
-0.9394261240959167,
0.7069187760353088,
0.08285866677761078,
-0.4000866711139679,
0.15611997246742249,
-0.6819249987602234,
0.21239380538463593... |
func (p *packet) firstProvider(tags []string) (*provider, error) {
for _, tag := range tags {
prv, err := p.getProvider(tag)
if err == nil {
return prv, nil
}
}
return nil, ProviderNotFound
} | [
-0.16529129445552826,
0.11822700500488281,
0.32130739092826843,
-0.0063264500349760056,
0.617759108543396,
-0.505181074142456,
-1.3172507286071777,
-1.0025427341461182,
-0.002272452926263213,
0.35958239436149597,
0.34001731872558594,
-0.38760605454444885,
-0.7399587035179138,
1.04233956336... |
func HalfBlockWrite(w io.Writer, l Level, text string) error {
return NewHalfBlockWriter(l, w).QR(text)
} | [
0.32319384813308716,
-0.9383520483970642,
0.35952699184417725,
0.21047209203243256,
-0.5341131687164307,
-0.2789382040500641,
0.3560827672481537,
-0.6653215289115906,
-0.7690796256065369,
-0.19706006348133087,
-0.8655895590782166,
0.015035634860396385,
-1.2580665349960327,
0.74785387516021... |
func HalfBlockWriteFile(filename string, l Level, text string) error {
return NewHalfBlockWriter(l, nil).QRFile(filename, text)
} | [
0.40200987458229065,
-1.3426786661148071,
0.4437938928604126,
0.3551230728626251,
-0.23928309977054596,
-0.18645119667053223,
0.6481654047966003,
0.09397421032190323,
-1.270196795463562,
-0.3600820004940033,
-0.7976838946342468,
-0.30867430567741394,
-1.183791160583496,
0.5307035446166992,... |
func BlockWrite(w io.Writer, l Level, text string) error {
return NewBlockWriter(l, w).QR(text)
} | [
0.7625851631164551,
0.07675661146640778,
0.2811783254146576,
0.3715105354785919,
-0.33087602257728577,
0.26800277829170227,
-0.2648232579231262,
-0.4187098741531372,
-1.0266367197036743,
0.367517352104187,
-0.3061475157737732,
0.11652644723653793,
-0.5619036555290222,
0.13640408217906952,
... |
func BlockWriteFile(filename string, l Level, text string) error {
return NewBlockWriter(l, nil).QRFile(filename, text)
} | [
0.4023244380950928,
-0.3970586359500885,
0.3133006989955902,
0.5993871092796326,
-0.022644875571131706,
0.3145155906677246,
0.14248672127723694,
0.3238101899623871,
-1.581191897392273,
0.14690667390823364,
-0.3208330571651459,
-0.345794677734375,
-0.9181482195854187,
0.014189857058227062,
... |
func Bash(l Level, text string) error {
return NewBashWriter(l, os.Stdout).QR(text)
} | [
1.2802932262420654,
-0.17302460968494415,
0.2631465792655945,
0.03054025024175644,
-0.8844072222709656,
0.16352827847003937,
-1.123630166053772,
-0.0872623473405838,
-0.7171735167503357,
-0.9473221898078918,
0.24551166594028473,
0.8599453568458557,
0.39915239810943604,
0.3798472583293915,
... |
func HalfBash(l Level, text string) error {
return NewHalfBashWriter(l, os.Stdout).QR(text)
} | [
1.173057198524475,
-0.6505750417709351,
0.37944650650024414,
0.28803783655166626,
-0.3509373962879181,
0.14002840220928192,
0.596891462802887,
-0.46444013714790344,
-0.7875518202781677,
-1.404622197151184,
-0.7411378026008606,
0.2890203893184662,
-0.9901127219200134,
0.5477357506752014,
... |
func PNG(filename string, l Level, text string) error {
return NewPNGWriter(l).QRFile(filename, text)
} | [
0.40288859605789185,
0.07489994913339615,
0.2744947671890259,
-0.5612702965736389,
-0.6797979474067688,
0.33753642439842224,
0.04479173198342323,
0.4286639094352722,
-1.0157966613769531,
-0.6830072402954102,
-0.029200749471783638,
-0.8783801198005676,
0.2580402195453644,
-0.077694833278656... |
func JPEG(filename string, l Level, text string) error {
return NewJPEGWriter(l).QRFile(filename, text)
} | [
0.5839687585830688,
0.41255468130111694,
0.2600235939025879,
-0.19783629477024078,
-0.9511277675628662,
0.00293608452193439,
0.39542156457901,
0.5389025211334229,
-1.2574487924575806,
-0.18779338896274567,
-0.08666840195655823,
-0.37625953555107117,
0.31593576073646545,
0.05403188243508339... |
func (_m *PeerFinder) Start(ctx context.Context) ([]string, <-chan []string, error) {
ret := _m.Called(ctx)
var r0 []string
if rf, ok := ret.Get(0).(func(context.Context) []string); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]string)
}
}
var r1 <-chan []string
if rf, ok := ret... | [
-0.6082534193992615,
-0.2293160855770111,
0.6055646538734436,
0.05309813469648361,
-0.07440097630023956,
-0.3141794204711914,
-0.039433978497982025,
0.06389530003070831,
-0.4697881042957306,
0.3530823886394501,
-0.5988677740097046,
0.9345084428787231,
0.15976828336715698,
0.085773468017578... |
func NewPeerFinder(t testing.TB) *PeerFinder {
mock := &PeerFinder{}
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
} | [
-0.7095520496368408,
-0.5330225229263306,
0.29479095339775085,
-0.06458710879087448,
-0.16928596794605255,
0.7958807349205017,
0.28632304072380066,
-0.5305280089378357,
-0.2753683626651764,
-0.7169542908668518,
-0.5397911071777344,
-0.8531427979469299,
-0.8184792399406433,
2.05439686775207... |
func (m *CreateTicketPayload) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateImpact(formats); err != nil {
res = append(res, err)
}
if err := m.validateTicketType(formats); err != nil {
res = append(res, err)
}
if err := m.validateUrgency(formats); err != nil {
res = append... | [
0.4991280734539032,
0.04788627848029137,
0.5329172015190125,
-0.6323699355125427,
-0.10295271128416061,
0.26749590039253235,
0.23598244786262512,
-0.9753179550170898,
-1.159912347793579,
0.06420817226171494,
0.05646749213337898,
0.16096648573875427,
-1.0407286882400513,
0.8614006638526917,... |
func (m *CreateTicketPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
} | [
0.6638045907020569,
0.26505979895591736,
0.23919866979122162,
-0.799656867980957,
-0.28137579560279846,
1.3940500020980835,
0.03565411642193794,
-0.5430268049240112,
-0.05215970799326897,
-0.03134436905384064,
-0.1783665418624878,
0.7577743530273438,
-1.646475076675415,
0.12089714407920837... |
func MarshalSAMLIdPServiceProvider(serviceProvider types.SAMLIdPServiceProvider, opts ...MarshalOption) ([]byte, error) {
if err := serviceProvider.CheckAndSetDefaults(); err != nil {
return nil, trace.Wrap(err)
}
cfg, err := CollectOptions(opts)
if err != nil {
return nil, trace.Wrap(err)
}
switch sp := se... | [
-0.6556896567344666,
0.29239407181739807,
0.23694723844528198,
-0.07294926792383194,
-1.2679017782211304,
0.9682267904281616,
-0.7874515652656555,
-0.40498748421669006,
1.1871607303619385,
0.7480312585830688,
-0.025038739666342735,
0.37666192650794983,
-0.8051266670227051,
0.14792463183403... |
func UnmarshalSAMLIdPServiceProvider(data []byte, opts ...MarshalOption) (types.SAMLIdPServiceProvider, error) {
if len(data) == 0 {
return nil, trace.BadParameter("missing SAML IdP service provider data")
}
cfg, err := CollectOptions(opts)
if err != nil {
return nil, trace.Wrap(err)
}
var h types.ResourceHea... | [
-0.7421529293060303,
-0.10826952755451202,
0.3636861741542816,
-0.8699092864990234,
-1.5299698114395142,
0.14867103099822998,
-0.8570038080215454,
0.06834717094898224,
0.6546559929847717,
1.0369735956192017,
0.16100578010082245,
-0.4011743366718292,
-0.9262736439704895,
-0.2905230224132538... |
func GenerateIdPServiceProviderFromFields(name string, entityDescriptor string) (types.SAMLIdPServiceProvider, error) {
if len(name) == 0 {
return nil, trace.BadParameter("missing name")
}
if len(entityDescriptor) == 0 {
return nil, trace.BadParameter("missing entity descriptor")
}
var s types.SAMLIdPServiceP... | [
-0.6488901376724243,
0.578269362449646,
0.3727191686630249,
-0.6567683815956116,
-0.7943757772445679,
0.6806681156158447,
-1.4348853826522827,
-0.2171749472618103,
-0.020400330424308777,
1.0489073991775513,
-0.4714781641960144,
-0.40931448340415955,
-0.2763163447380066,
0.438799113035202,
... |
func connect() *r.Session {
session, _ := r.Connect(r.ConnectOpts{
Address: "localhost:28015",
})
return session
} | [
-0.3695358633995056,
-0.584128201007843,
0.1815822273492813,
0.468624085187912,
-0.5223997235298157,
-0.3781872093677521,
-0.04380112141370773,
-1.1554256677627563,
0.28646597266197205,
0.619078516960144,
0.38199490308761597,
0.07278572022914886,
-0.4521156847476959,
-0.4455808699131012,
... |
func createDB(opts opts) error {
_, err := r.DBCreate(opts.db).RunWrite(opts.session)
return err
} | [
0.3098786473274231,
0.3937852680683136,
0.3782532215118408,
1.064752459526062,
1.0043998956680298,
0.6956768035888672,
0.48387250304222107,
-0.12330026179552078,
1.2313915491104126,
-0.9622641205787659,
1.25857675075531,
-0.07505916804075241,
-0.3733068108558655,
-0.17623178660869598,
0.... |
func createTable(opts opts) error {
_, err := r.DB(opts.db).
TableCreate(opts.table, r.TableCreateOpts{
PrimaryKey: opts.pK,
}).
RunWrite(opts.session)
return err
} | [
0.21165630221366882,
0.250968337059021,
0.36272287368774414,
0.21418996155261993,
1.3979483842849731,
0.1285661906003952,
0.1983640193939209,
-0.41780537366867065,
0.48033827543258667,
0.028255321085453033,
0.753320574760437,
-0.6354236006736755,
-0.4795512855052948,
-0.4104311168193817,
... |
func dropTable(opts opts) error {
_, err := r.DB(opts.db).TableDrop(opts.table).RunWrite(opts.session)
return err
} | [
-0.7983802556991577,
0.10874749720096588,
0.3823603391647339,
0.4225873351097107,
0.9545568227767944,
-0.04234060272574425,
0.10644236207008362,
-0.07800893485546112,
0.5548068284988403,
0.10102468729019165,
0.2688135802745819,
-0.115504689514637,
-0.529571533203125,
-1.0256612300872803,
... |
func dropDB(opts opts) error {
_, err := r.DBDrop(opts.db).RunWrite(opts.session)
return err
} | [
-1.2534561157226562,
0.6650574803352356,
0.27847418189048767,
0.7820497751235962,
1.199317455291748,
0.3948172926902771,
0.15189078450202942,
-0.06005840376019478,
1.3280023336410522,
0.1996709257364273,
0.7649311423301697,
0.03837241604924202,
-1.0794382095336914,
-0.7371405959129333,
0... |
func Setup(dbName string) error {
session := connect()
var err error
err = createDB(opts{session: session, db: dbName})
if err != nil {
return err
}
err = createTable(opts{session: session, db: dbName, table: "users", pK: "email"})
err = createTable(opts{session: session, db: dbName, table: "addresses", pK: ... | [
-0.5253697633743286,
0.9627483487129211,
0.8350266218185425,
-0.5474704504013062,
0.5919997692108154,
-0.13229282200336456,
0.6883413195610046,
-0.8504959940910339,
0.5829435586929321,
-0.2597964107990265,
-0.2413497269153595,
-0.26340505480766296,
-0.6207644939422607,
0.499992311000824,
... |
func CleanUp(dbName string) error {
session := connect()
var err error
err = dropTable(opts{session: session, db: dbName, table: "posts"})
err = dropTable(opts{session: session, db: dbName, table: "addresses"})
err = dropTable(opts{session: session, db: dbName, table: "users"})
err = dropTable(opts{session: sessi... | [
-0.09194426983594894,
0.3508346676826477,
0.9085770845413208,
-0.5800092816352844,
-0.0429479144513607,
0.02984168753027916,
0.7175373435020447,
-0.3580242097377777,
1.4476624727249146,
-0.08474027365446091,
-0.44371601939201355,
-0.4356938600540161,
-0.5198532938957214,
0.565132200717926,... |
func (s *Service) IndexRequest(identifiable DocIdentifiable, doc interface{}) error {
// TODO: accept ctx as param
return s.Index(s.RequestsIndex, identifiable.DocID(), "_doc", doc)
} | [
-1.5072226524353027,
0.12048093974590302,
0.15184903144836426,
0.6602713465690613,
-0.3395092189311981,
0.26353007555007935,
0.3609805107116699,
-0.013987977057695389,
0.4132322072982788,
-0.14051692187786102,
0.7429264187812805,
1.1848909854888916,
0.2171780914068222,
-0.12980768084526062... |
func (s *Service) DeleteRequest(identifiable DocIdentifiable) error {
// TODO: accept ctx as param
return s.Delete(s.RequestsIndex, identifiable.DocID(), "_doc")
} | [
-1.2784903049468994,
0.22444728016853333,
0.20307034254074097,
0.5213226079940796,
-0.013576137833297253,
0.524658739566803,
0.3032975494861603,
-0.5652966499328613,
0.7200939655303955,
-0.612096905708313,
0.19100680947303772,
0.9270133972167969,
0.4143175482749939,
0.5798100233078003,
0... |
func (s *Service) GetRequest(identifiable DocIdentifiable) (*json.RawMessage, error) {
// TODO: accept ctx as param
get, err := s.Client.Get().
Index(s.RequestsIndex).
Type("_doc").
Id(identifiable.DocID()).
Do(context.TODO())
if err != nil {
return nil, err
}
return get.Source, nil
} | [
-1.1808958053588867,
1.1201573610305786,
0.4240581691265106,
0.30546703934669495,
0.13577519357204437,
-0.47541293501853943,
0.12089981138706207,
-0.9997510313987732,
0.7843591570854187,
0.0013525941176339984,
-0.11203090846538544,
0.8768084645271301,
-0.0035718802828341722,
-0.32044649124... |
func Add(mgr manager.Manager) error {
return add(mgr, newReconciler(mgr))
} | [
-0.24057555198669434,
0.12229465693235397,
0.46777674555778503,
-0.6655282378196716,
0.4479011595249176,
-0.17455056309700012,
-0.48020607233047485,
0.6828829646110535,
0.19666412472724915,
-0.7739230394363403,
0.224630668759346,
0.617239773273468,
-1.010264277458191,
1.3228338956832886,
... |
func newReconciler(mgr manager.Manager) reconcile.Reconciler {
return &ReconcileAerospikeCluster{client: mgr.GetClient(), scheme: mgr.GetScheme()}
} | [
0.45006442070007324,
-0.5679931640625,
0.2290675789117813,
-0.6387127637863159,
0.17441332340240479,
-0.30018293857574463,
-0.08381980657577515,
0.9603663682937622,
-0.19224843382835388,
0.34574681520462036,
0.8017725348472595,
0.21877527236938477,
-0.1394052356481552,
0.31070467829704285,... |
func add(mgr manager.Manager, r reconcile.Reconciler) error {
// Create a new controller
c, err := controller.New("aerospikecluster-controller", mgr, controller.Options{Reconciler: r, MaxConcurrentReconciles: maxConcurrentReconciles})
if err != nil {
return err
}
// Watch for changes to primary resource Aerospi... | [
0.22462941706180573,
-0.5409475564956665,
0.7234930992126465,
-0.042885392904281616,
0.4266405403614044,
-0.2175900936126709,
0.01257255207747221,
-0.2608167827129364,
0.5980777144432068,
-0.1749250888824463,
0.3863488435745239,
0.29277029633522034,
0.07819913327693939,
0.5596815943717957,... |
func (r *ReconcileAerospikeCluster) getIgnorablePods(aeroCluster *aerospikev1alpha1.AerospikeCluster, racksToDelete []aerospikev1alpha1.Rack) ([]corev1.Pod, error) {
ignorablePods := []corev1.Pod{}
for _, rack := range racksToDelete {
rackPods, err := r.getRackPodList(aeroCluster, rack.ID)
if err != nil {
ret... | [
-0.14394503831863403,
-0.13104186952114105,
0.8182297945022583,
0.42421388626098633,
0.7887269854545593,
0.41731494665145874,
-0.4235371947288513,
0.46849703788757324,
-0.7114248275756836,
0.7963759303092957,
0.08407767862081528,
0.2088131159543991,
-0.9393147230148315,
-0.0262648519128561... |
func (r *ReconcileAerospikeCluster) removePodStatus(aeroCluster *aerospikev1alpha1.AerospikeCluster, podNames []string) error {
if len(podNames) == 0 {
return nil
}
patches := []jsonpatch.JsonPatchOperation{}
for _, podName := range podNames {
patch := jsonpatch.JsonPatchOperation{
Operation: "remove",
... | [
-1.1559284925460815,
-0.6915149688720703,
0.19167904555797577,
-0.3678111433982849,
-0.09971459209918976,
-0.27730339765548706,
-0.5769416689872742,
0.6169435977935791,
0.2716476321220398,
0.21335619688034058,
-0.485012024641037,
-0.20448116958141327,
-0.6593318581581116,
-0.33124643564224... |
func (r *ReconcileAerospikeCluster) recoverFailedCreate(aeroCluster *aerospikev1alpha1.AerospikeCluster) error {
logger := pkglog.New(log.Ctx{"AerospikeCluster": utils.ClusterNamespacedName(aeroCluster)})
logger.Info("Forcing a cluster recreate as status is nil. The cluster could be unreachable due to bad configurati... | [
-0.5851554870605469,
-0.1386442929506302,
0.5089660882949829,
0.2758418321609497,
0.4858567714691162,
-0.37011370062828064,
-0.01996760629117489,
-0.4930883049964905,
0.15911410748958588,
-0.19034969806671143,
-0.040285442024469376,
-0.08497585356235504,
0.347128301858902,
0.11273907870054... |
func (r *ReconcileAerospikeCluster) cleanupPods(aeroCluster *aerospikev1alpha1.AerospikeCluster, podNames []string, rackState RackState) error {
logger := pkglog.New(log.Ctx{"AerospikeCluster": utils.ClusterNamespacedName(aeroCluster)})
logger.Info("Removing pvc for removed pods", log.Ctx{"pods": podNames})
// Del... | [
-0.4618866741657257,
-0.5037396550178528,
0.5713289380073547,
-0.26674684882164,
0.4394834637641907,
0.013706951402127743,
0.548478364944458,
-0.09168771654367447,
0.14115500450134277,
0.6510651707649231,
0.7317458391189575,
-0.3029315173625946,
-0.08153478801250458,
0.23612354695796967,
... |
func containsString(slice []string, s string) bool {
for _, item := range slice {
if item == s {
return true
}
}
return false
} | [
0.04810415208339691,
-1.3337082862854004,
0.0976812094449997,
0.28136488795280457,
-0.344137966632843,
-0.12331268191337585,
-0.8575016856193542,
-0.49491265416145325,
-0.10580432415008545,
0.619733452796936,
-0.4712563455104828,
0.22324824333190918,
0.2490464299917221,
-0.7696039080619812... |
func PanicHandler() func(http.ResponseWriter, *http.Request, interface{}) {
return func(w http.ResponseWriter, r *http.Request, rcv interface{}) {
response := ResultInternalServerErr
if env := viper.GetString(`env`); env == "development" {
if rcv != nil {
response.SetMessage(rcv)
}
}
log.Printf("%s ... | [
-0.5059146881103516,
-0.4435766339302063,
0.5628715753555298,
0.11845934391021729,
-0.3104214668273926,
0.3191854655742645,
0.557196319103241,
-0.6197145581245422,
0.18502570688724518,
0.2712303102016449,
0.3720889091491699,
-0.4427911043167114,
-0.45505669713020325,
0.44986414909362793,
... |
func NewLBAgent(da DataAccess, rp pool.RunnerPool, p pool.Placer) (Agent, error) {
agent := createAgent(da, false)
a := &lbAgent{
delegatedAgent: agent,
rp: rp,
placer: p,
}
return a, nil
} | [
0.768264889717102,
-0.5966818332672119,
0.32019227743148804,
-0.610404372215271,
-0.24496260285377502,
0.5348576307296753,
-0.4165652096271515,
-0.18996158242225647,
0.8916913866996765,
-0.4321402609348297,
-0.3003927767276764,
0.9234732389450073,
-0.02638234756886959,
0.14134085178375244,... |
func (a *lbAgent) GetAppID(ctx context.Context, appName string) (string, error) {
return a.delegatedAgent.GetAppID(ctx, appName)
} | [
1.4262691736221313,
-0.07617346197366714,
0.6324766874313354,
0.26858097314834595,
0.01415097713470459,
1.2644925117492676,
-0.6827628016471863,
-0.5304335951805115,
1.4698930978775024,
0.34740862250328064,
0.6589549779891968,
0.564042329788208,
0.0726296529173851,
0.9065908789634705,
0.... |
func (a *lbAgent) GetAppByID(ctx context.Context, appID string) (*models.App, error) {
return a.delegatedAgent.GetAppByID(ctx, appID)
} | [
1.2362136840820312,
-0.4532240033149719,
0.3508826196193695,
0.4107791483402252,
0.06887173652648926,
0.7589834928512573,
-0.9159331917762756,
-1.0317144393920898,
1.1376556158065796,
0.18997491896152496,
-0.08826076984405518,
0.27015191316604614,
0.43696221709251404,
0.7303029894828796,
... |
func (a *lbAgent) GetCall(opts ...CallOpt) (Call, error) {
opts = append(opts, WithoutPreemptiveCapacityCheck())
return a.delegatedAgent.GetCall(opts...)
} | [
1.1501153707504272,
0.7525851130485535,
0.6710558533668518,
0.21538622677326202,
0.27566632628440857,
0.5199974179267883,
-0.8526747822761536,
-0.4284702241420746,
1.0018651485443115,
-0.09677741676568985,
0.4574161767959595,
0.8535956740379333,
-0.03519976884126663,
0.1589755415916443,
... |
func MapProviderIDToInstanceID(providerID string) (string, error) {
if providerID == "" {
return providerID, errors.New("provider ID is empty")
}
if strings.HasPrefix(providerID, providerPrefix) {
return strings.TrimPrefix(providerID, providerPrefix), nil
}
return providerID, nil
} | [
-0.7228415608406067,
-1.096089482307434,
0.2692562937736511,
-1.43198823928833,
-0.7749384641647339,
0.7526341676712036,
0.07784756273031235,
0.7119358777999878,
1.428079605102539,
1.4180818796157837,
0.8755330443382263,
1.7076199054718018,
-0.24806378781795502,
0.5439504384994507,
0.526... |
func NodeInternalIP(node *api.Node) string {
for _, addr := range node.Status.Addresses {
if addr.Type == api.NodeInternalIP {
return addr.Address
}
}
return ""
} | [
-0.8384252190589905,
-0.7282494902610779,
0.7145159244537354,
-1.332283854484558,
-0.6224759221076965,
0.0024608662351965904,
-0.3716599643230438,
0.023864049464464188,
-0.09140398353338242,
0.5575608611106873,
1.112988829612732,
-0.03149009868502617,
-0.6564489603042603,
-0.95010292530059... |
func DeepEqualLists(listA, listB []string) bool {
return sets.NewString(listA...).Equal(sets.NewString(listB...))
} | [
-0.07709983736276627,
0.1519857496023178,
0.7267466187477112,
0.011945952661335468,
-0.10624180734157562,
0.5101539492607117,
-0.5303090810775757,
0.08776962012052536,
-0.2636859118938446,
0.48606276512145996,
-0.9763245582580566,
0.35020169615745544,
-0.5016801953315735,
0.797820746898651... |
func (service homeService) FindUserByUsernameAndFullName(name string, myUserID int64) ([]models.UserFollowObject, error) {
stmt := `
MATCH(a:User) where ID(a)={userid}
OPTIONAL MATCH(u:User)
WHERE toLower(u.username) CONTAINS toLower({s}) OR toLower(u.full_name) CONTAINS toLower({s})
RETURN
ID(u) as ... | [
-0.0159683246165514,
-0.5807430148124695,
0.663490891456604,
0.41785332560539246,
-0.9657650589942932,
-0.15820400416851044,
0.3404325544834137,
-0.6747024655342102,
-0.0879904255270958,
-0.05426233634352684,
-1.032143473625183,
-0.41361933946609497,
-0.745754063129425,
0.8915038108825684,... |
func (service homeService) GetNewsFeed(params helpers.ParamsGetAll, myUserID int64) ([]models.Post, error) {
stmt := fmt.Sprintf(`
OPTIONAL MATCH (u:User)-[:POST]->(p:Post)<-[:HAS]-(g:Group)<-[j:JOIN{status:1}]-(me:User)
WHERE ID(me) = {myUserID} AND 3>=j.role>=1
WITH
collect(
p{
id:ID(p),
.*,
message:... | [
-0.007864552550017834,
0.3584476411342621,
0.7689121961593628,
0.8698346614837646,
-0.8310787677764893,
0.2815287411212921,
0.29718995094299316,
-0.6514697670936584,
-0.5585938692092896,
-0.4385206699371338,
-0.049350690096616745,
1.318760871887207,
-0.6337893605232239,
0.7903713583946228,... |
func (service homeService) GetNewsFeedWithPageRank(params helpers.ParamsGetAll, myUserID int64) ([]models.Post, error) {
stmt := `
OPTIONAL MATCH (u:User)-[:POST]->(p:Post)<-[:HAS]-(g:Group)<-[j:JOIN{status:1}]-(me:User)
WHERE ID(me) = {myUserID} AND 3>=j.role>=1
WITH
collect(
p{
id:ID(p),
.*,
message: substri... | [
0.052719052881002426,
0.06952506303787231,
0.8269459009170532,
0.6607205867767334,
-0.8779909014701843,
0.13636237382888794,
-0.01722703129053116,
-0.5978708863258362,
-0.3115590214729309,
-0.3492337465286255,
0.25243544578552246,
1.334938406944275,
-0.8775717616081238,
0.6204096078872681,... |
func (mr *MapReduce) KillWorkers() *list.List {
l := list.New()
for _, w := range mr.Workers {
DPrintf("DoWork: shutdown %s\n", w.address)
args := &ShutdownArgs{}
var reply ShutdownReply
ok := call(w.address, "Worker.Shutdown", args, &reply)
if ok == false {
fmt.Printf("DoWork: RPC %s shutdown error\n", ... | [
-1.3962301015853882,
-0.18199026584625244,
0.6803399324417114,
0.22760184109210968,
0.8211776614189148,
0.014497896656394005,
-0.4900648891925812,
-0.32840391993522644,
0.283871591091156,
1.2287274599075317,
0.099223293364048,
-0.3563994765281677,
-1.4780153036117554,
0.6132948994636536,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.