text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (c *Client) GetIssueSharedFilesContext(ctx context.Context, issueIDOrKey string) ([]*SharedFile, error) {
u := fmt.Sprintf("/api/v2/issues/%v/sharedFiles", issueIDOrKey)
req, err := c.NewRequest("GET", u, nil)
if err != nil {
return nil, err
}
sharedFiles := []*SharedFile{}
if err := c.Do(ctx, req, &shar... | [
-0.5755091309547424,
0.9512263536453247,
0.6333185434341431,
-0.10444330424070358,
0.061758168041706085,
-0.39097896218299866,
0.39029648900032043,
-0.29492589831352234,
1.1279430389404297,
0.35975566506385803,
-0.7370548248291016,
-0.08714224398136139,
-0.7098696827888489,
0.0558067522943... |
func (c *Client) CreateIssueSharedFiles(issueIDOrKey string, input *CreateIssueSharedFilesInput) ([]*SharedFile, error) {
return c.CreateIssueSharedFilesContext(context.Background(), issueIDOrKey, input)
} | [
-0.3248540759086609,
0.23360759019851685,
0.327385276556015,
0.8661516904830933,
0.5473372936248779,
0.38312017917633057,
1.0973082780838013,
-0.11948499083518982,
0.3281203508377075,
-0.24678726494312286,
-0.7828266024589539,
-0.5342583060264587,
-1.179033875465393,
0.15736500918865204,
... |
func (c *Client) CreateIssueSharedFilesContext(ctx context.Context, issueIDOrKey string, input *CreateIssueSharedFilesInput) ([]*SharedFile, error) {
u := fmt.Sprintf("/api/v2/issues/%v/sharedFiles", issueIDOrKey)
req, err := c.NewRequest("POST", u, input)
if err != nil {
return nil, err
}
sharedFiles := []*Sh... | [
-0.7016299962997437,
0.5478918552398682,
0.6051555871963501,
0.16014344990253448,
0.37122681736946106,
0.2908327281475067,
0.6071816682815552,
-0.40728113055229187,
0.9577537178993225,
0.16499914228916168,
-0.8526091575622559,
-0.2558504045009613,
-0.918627917766571,
0.007256773300468922,
... |
func (c *Client) DeleteIssueSharedFile(issueIDOrKey string, sharedFileID int) (*SharedFile, error) {
return c.DeleteIssueSharedFileContext(context.Background(), issueIDOrKey, sharedFileID)
} | [
0.6953529119491577,
-0.03601489216089249,
0.36107322573661804,
0.3862718641757965,
0.08264778554439545,
0.534815788269043,
0.9928301572799683,
0.7612633109092712,
-0.038621142506599426,
-0.2756984531879425,
-0.047883737832307816,
-0.348621666431427,
-0.9478216767311096,
0.3650616705417633,... |
func (c *Client) DeleteIssueSharedFileContext(ctx context.Context, issueIDOrKey string, sharedFileID int) (*SharedFile, error) {
u := fmt.Sprintf("/api/v2/issues/%v/sharedFiles/%v", issueIDOrKey, sharedFileID)
req, err := c.NewRequest("DELETE", u, nil)
if err != nil {
return nil, err
}
sharedFile := new(Shared... | [
0.3728259801864624,
0.07444962859153748,
0.5990991592407227,
-0.23197811841964722,
-0.16985295712947845,
0.0726843848824501,
0.26384416222572327,
0.3192191421985626,
0.3025887608528137,
0.026341097429394722,
-0.40592455863952637,
-0.3453153669834137,
-0.6960033178329468,
0.0240058153867721... |
func connect(seeds []string, keyspace, us, pw string) *gocql.Session {
cluster := gocql.NewCluster(seeds...)
cluster.Timeout = 10 * time.Second
cluster.Authenticator = gocql.PasswordAuthenticator{
Username: us,
Password: pw,
}
cluster.Keyspace = keyspace
for {
session, err := cluster.CreateSession()
if er... | [
0.29818880558013916,
-0.10190344601869583,
0.3605073094367981,
0.3130274713039398,
-0.8875270485877991,
-0.03091624565422535,
-0.4297776520252228,
-0.7902580499649048,
-0.8665424585342407,
0.7014427781105042,
0.05827292427420616,
-0.279649943113327,
-0.3221529722213745,
-0.4970743656158447... |
func NewDB(seeds []string, us, pw string) *DB {
me := &DB{}
me.session = connect(seeds, keyspace, us, pw)
return me
} | [
0.18383225798606873,
-0.21294160187244415,
0.26450976729393005,
1.323124885559082,
-1.31315016746521,
0.5220807194709778,
-0.2568497061729431,
-0.385148286819458,
0.5900402665138245,
-0.6166409254074097,
0.45707008242607117,
-0.4055292010307312,
-0.3477536737918854,
-0.1335086077451706,
... |
func (me *DB) Store(conf *pb.Configuration) error {
confb, err := proto.Marshal(conf)
if err != nil {
return errors.Wrap(err, 500, errors.E_proto_marshal_error)
}
err = me.session.Query("INSERT INTO "+tblConf+"(cluster, conf) VALUES(?,?)",
conf.GetCluster(), confb).Exec()
if err != nil {
return errors.Wrap(... | [
-0.5987766981124878,
0.4708586633205414,
0.24685607850551605,
0.3514588475227356,
0.5105130076408386,
0.5068668127059937,
0.4862233102321625,
0.1904103308916092,
-0.4509383738040924,
0.1521839052438736,
-1.0485570430755615,
-0.6473863124847412,
-0.9672411680221558,
0.2075497806072235,
0.... |
func (me *DB) Load(cluster string) (*pb.Configuration, error) {
confb := make([]byte, 0)
err := me.session.Query("SELECT conf FROM "+tblConf+" WHERE cluster=?",
cluster).Scan(&confb)
if err != nil && err.Error() == gocql.ErrNotFound.Error() {
return &pb.Configuration{}, nil
}
if err != nil {
return nil, err... | [
-0.4823995530605316,
0.2498008906841278,
0.41203439235687256,
-0.34644752740859985,
-0.5004466772079468,
-0.22959911823272705,
-0.5354350209236145,
0.001959999790415168,
-0.6391767263412476,
0.9535635113716125,
-0.684084415435791,
-0.536255955696106,
-1.1482529640197754,
-0.456365346908569... |
func TestNewDeployment(t *testing.T) {
type args struct {
workersTemplate *jettypes.NodeTemplate
controllerTemplate *jettypes.NodeTemplate
ingressTemplate *jettypes.NodeTemplate
name string
}
tests := []struct {
name string
args args
want *Deployment
wantErr bool
}{
{
... | [
-0.6186893582344055,
-0.4968820810317993,
0.6191095113754272,
-0.4407942295074463,
0.196294903755188,
0.09854473918676376,
0.49194833636283875,
-0.32975444197654724,
-0.07069890946149826,
0.0034243150148540735,
-0.13892564177513123,
-0.19746793806552887,
-0.32018864154815674,
1.19565606117... |
func Connect() *Database {
once.Do(func() {
db, err := sql.Open("mysql",
"root:@tcp(127.0.0.1:3306)/messaging")
if err != nil {
log.Fatal(err)
}
instance = &Database{database: db}
})
return instance
} | [
-0.374665230512619,
0.6065664291381836,
0.4654352068901062,
-0.19125428795814514,
-0.704509973526001,
0.4986463189125061,
-0.457898885011673,
-0.39017796516418457,
-0.5810049772262573,
0.07963208854198456,
0.3500927686691284,
0.3016597628593445,
-1.1038661003112793,
1.0189480781555176,
0... |
func (r *Database) Test() {
var (
num int
)
rows, err := r.database.Query("select num from test")
if err != nil {
log.Fatal(err)
}
defer rows.Close()
for rows.Next() {
err := rows.Scan(&num)
if err != nil {
log.Fatal(err)
}
log.Println(num)
}
err = rows.Err()
if err != nil {
log.Fatal(err)
}... | [
0.15642444789409637,
0.7149829268455505,
0.4886375069618225,
0.4558645188808441,
0.10808102041482925,
-0.2045384645462036,
0.951210618019104,
-0.1912994682788849,
0.3135519325733185,
-1.1265612840652466,
0.0857006385922432,
0.16279296576976776,
-0.42808109521865845,
0.09847621619701385,
... |
func Find(slice []string, val string) bool {
for _, item := range slice {
if item == val {
return true
}
}
return false
} | [
0.4042119085788727,
-0.6270529627799988,
0.32201871275901794,
-0.22294987738132477,
-1.0648843050003052,
-0.027291880920529366,
-1.0660845041275024,
-0.42722687125205994,
-0.9525792002677917,
1.289108157157898,
0.12677468359470367,
-0.2884474992752075,
-0.4867005944252014,
0.87537252902984... |
func ColorFromBytes(colorBytes []byte) (color Color, consumedBytes int, err error) {
marshalUtil := marshalutil.New(colorBytes)
if color, err = ColorFromMarshalUtil(marshalUtil); err != nil {
err = errors.Errorf("failed to parse Color from MarshalUtil: %w", err)
return
}
consumedBytes = marshalUtil.ReadOffset()... | [
0.317772775888443,
-1.1641947031021118,
0.34704434871673584,
-0.8160674571990967,
-0.43858611583709717,
0.29074859619140625,
-0.37750425934791565,
0.6135199069976807,
0.9055895805358887,
0.19434604048728943,
0.3382558822631836,
-0.051495034247636795,
0.1347358375787735,
0.5138190388679504,... |
func ColorFromBase58EncodedString(base58String string) (color Color, err error) {
parsedBytes, err := base58.Decode(base58String)
if err != nil {
err = errors.Errorf("error while decoding base58 encoded Color (%v): %w", err, cerrors.ErrBase58DecodeFailed)
return
}
if color, _, err = ColorFromBytes(parsedBytes)... | [
0.5080921053886414,
-1.3505779504776,
-0.027198851108551025,
-0.1319543719291687,
-0.40069812536239624,
0.275165319442749,
-0.15680044889450073,
0.8547499775886536,
0.8172736167907715,
0.43435144424438477,
0.020629581063985825,
0.8031015992164612,
-0.13581447303295135,
0.08717981725931168,... |
func ColorFromMarshalUtil(marshalUtil *marshalutil.MarshalUtil) (color Color, err error) {
colorBytes, err := marshalUtil.ReadBytes(ColorLength)
if err != nil {
err = errors.Errorf("failed to parse Color (%v): %w", err, cerrors.ErrParseBytesFailed)
return
}
copy(color[:], colorBytes)
return
} | [
0.8391036987304688,
-0.6279380321502686,
0.2903432250022888,
-0.5977374315261841,
-0.6973505020141602,
0.3539458215236664,
-0.785616397857666,
0.4511944353580475,
0.4976784884929657,
-0.10470982640981674,
0.27982062101364136,
0.7309409379959106,
0.31976374983787537,
-0.257215678691864,
0... |
func (c Color) Bytes() []byte {
return c[:]
} | [
-0.10410606116056442,
-0.10141347348690033,
0.3074558675289154,
-1.047490119934082,
1.3154364824295044,
0.6306502819061279,
-1.0740617513656616,
-1.185012936592102,
0.2183161824941635,
-0.9513586163520813,
-0.8910902142524719,
1.3556759357452393,
-0.27550721168518066,
0.47031012177467346,
... |
func (c Color) Base58() string {
return base58.Encode(c.Bytes())
} | [
0.031033191829919815,
-1.1229323148727417,
-0.13127323985099792,
-0.15923020243644714,
0.7753584980964661,
0.5462612509727478,
-0.7053192853927612,
-0.054730962961912155,
0.2608503997325897,
0.8482781648635864,
-0.3518335819244385,
0.3694787919521332,
-1.0400776863098145,
-0.29065591096878... |
func (c Color) String() string {
switch c {
case ColorIOTA:
return "IOTA"
case ColorMint:
return "MINT"
default:
return c.Base58()
}
} | [
-0.6172868609428406,
-0.8637261986732483,
-0.04402028024196625,
-0.5161586999893188,
0.8514657616615295,
0.9533931016921997,
-0.329357385635376,
-1.1396671533584595,
-0.3408975601196289,
0.2159510999917984,
0.021683786064386368,
0.6104340553283691,
-0.3034950792789459,
-0.14783471822738647... |
func (c Color) Compare(otherColor Color) int {
return bytes.Compare(c[:], otherColor[:])
} | [
-0.40906721353530884,
-0.5690225958824158,
0.6332305073738098,
-0.9075062870979309,
-0.124881312251091,
-0.10300863534212112,
-0.054561566561460495,
-1.093093991279602,
-0.47380128502845764,
0.04998128488659859,
-0.9888579249382019,
0.18019787967205048,
-1.306946039199829,
1.47809612751007... |
func NewColoredBalances(balances map[Color]uint64) (coloredBalances *ColoredBalances) {
coloredBalances = &ColoredBalances{balances: orderedmap.New()}
// deterministically sort colors
sortedColors := make([]Color, 0, len(balances))
for color, balance := range balances {
if balance == 0 {
// drop zero balances... | [
-0.2575376629829407,
-0.8177338242530823,
0.7681652307510376,
-0.5619973540306091,
-0.29842492938041687,
0.6119112372398376,
-0.5451957583427429,
-1.0851962566375732,
1.101989984512329,
-0.6747023463249207,
0.2728746235370636,
0.10572079569101334,
-0.20637473464012146,
0.854171633720398,
... |
func ColoredBalancesFromBytes(bytes []byte) (coloredBalances *ColoredBalances, consumedBytes int, err error) {
marshalUtil := marshalutil.New(bytes)
if coloredBalances, err = ColoredBalancesFromMarshalUtil(marshalUtil); err != nil {
err = errors.Errorf("failed to parse ColoredBalances from MarshalUtil: %w", err)
... | [
0.5133972764015198,
-0.9785376191139221,
0.5637674927711487,
-0.6146754026412964,
-0.4365241229534149,
0.4939604699611664,
-0.4003128707408905,
-0.34171435236930847,
1.2025569677352905,
-0.02915128879249096,
-0.1804383397102356,
0.0040193055756390095,
-0.5701088905334473,
0.343375355005264... |
func ColoredBalancesFromMarshalUtil(marshalUtil *marshalutil.MarshalUtil) (coloredBalances *ColoredBalances, err error) {
balancesCount, err := marshalUtil.ReadUint32()
if err != nil {
err = errors.Errorf("failed to parse element count (%v): %w", err, cerrors.ErrParseBytesFailed)
return
}
if balancesCount == 0 ... | [
0.6045873165130615,
-0.7338091731071472,
0.842964768409729,
-0.5967825651168823,
-0.26158037781715393,
0.24764983355998993,
-0.14543741941452026,
-0.7784396409988403,
0.6763209104537964,
-0.7188746333122253,
0.2975432276725769,
0.590813159942627,
0.1992596536874771,
-0.01960638351738453,
... |
func (c *ColoredBalances) Get(color Color) (uint64, bool) {
balance, exists := c.balances.Get(color)
ret, ok := balance.(uint64)
if !ok {
return 0, false
}
return ret, exists
} | [
-1.0836440324783325,
0.03153255209326744,
0.8725796937942505,
-0.7844807505607605,
0.8996970057487488,
0.09046263992786407,
-0.5882375836372375,
-0.7079129219055176,
0.4258330762386322,
0.22761623561382294,
-0.2873882055282593,
-0.09802773594856262,
-0.1282488852739334,
0.6252233386039734,... |
func (c *ColoredBalances) ForEach(consumer func(color Color, balance uint64) bool) {
c.balances.ForEach(func(key, value interface{}) bool {
return consumer(key.(Color), value.(uint64))
})
} | [
0.2510583996772766,
0.4479973018169403,
0.48520925641059875,
-0.143041729927063,
0.1105952113866806,
0.4342292547225952,
0.2459716796875,
-1.3218251466751099,
-0.4320914149284363,
0.5902106761932373,
0.28133532404899597,
-0.03897712007164955,
0.20307159423828125,
0.8746397495269775,
-0.5... |
func (c *ColoredBalances) Size() int {
return c.balances.Size()
} | [
-0.18428032100200653,
0.4680510461330414,
0.5124666690826416,
-1.2838754653930664,
0.2525269687175751,
1.1346304416656494,
0.775527834892273,
-1.1734315156936646,
0.5435651540756226,
-0.556450366973877,
-0.5282891988754272,
0.34457501769065857,
-0.5441935062408447,
0.3665033280849457,
0.... |
func (c *ColoredBalances) Clone() *ColoredBalances {
copiedBalances := orderedmap.New()
c.balances.ForEach(copiedBalances.Set)
return &ColoredBalances{
balances: copiedBalances,
}
} | [
0.16188430786132812,
-0.9919632077217102,
0.6429044008255005,
-0.13715612888336182,
-0.42203012108802795,
1.5212048292160034,
-0.17184510827064514,
-1.7627596855163574,
0.7750987410545349,
-0.08162464946508408,
0.09268371760845184,
0.3415405750274658,
-0.3700358271598816,
-0.06184617429971... |
func (c *ColoredBalances) Bytes() []byte {
marshalUtil := marshalutil.New()
marshalUtil.WriteUint32(uint32(c.balances.Size()))
c.ForEach(func(color Color, balance uint64) bool {
marshalUtil.WriteBytes(color.Bytes())
marshalUtil.WriteUint64(balance)
return true
})
return marshalUtil.Bytes()
} | [
-0.2328610122203827,
-0.19152012467384338,
0.4855663776397705,
-1.5354909896850586,
0.5975595712661743,
1.0698705911636353,
-0.9363529086112976,
-1.5619763135910034,
0.7268519997596741,
-0.6220076084136963,
-0.3871530294418335,
0.3341039717197418,
-0.2126108855009079,
0.46396419405937195,
... |
func (c *ColoredBalances) Map() (balances map[Color]uint64) {
balances = make(map[Color]uint64)
c.ForEach(func(color Color, balance uint64) bool {
balances[color] = balance
return true
})
return
} | [
-0.4580615162849426,
-0.34248432517051697,
0.8184674382209778,
-0.41811901330947876,
-0.05400436744093895,
0.9181385636329651,
-0.032175127416849136,
-0.7780502438545227,
0.9701151251792908,
0.5713288187980652,
-0.38596779108047485,
-0.20388567447662354,
0.7929412126541138,
0.6079893112182... |
func (c *ColoredBalances) String() string {
structBuilder := stringify.StructBuilder("ColoredBalances")
c.ForEach(func(color Color, balance uint64) bool {
structBuilder.AddField(stringify.StructField(color.String(), balance))
return true
})
return structBuilder.String()
} | [
-0.20395244657993317,
-0.11957757920026779,
0.3400372862815857,
-1.3531042337417603,
0.21961410343647003,
0.9266106486320496,
0.2660325765609741,
-1.5141903162002563,
-0.004876132123172283,
-0.18586459755897522,
-0.403257817029953,
-0.08680238574743271,
-0.3869490623474121,
-0.243462294340... |
func favgen(faviconPath, packageName string) {
fav, err := ioutil.ReadFile(faviconPath)
if err != nil {
log.Fatalf("Failed to read %s file -- %s", faviconPath, err)
}
out, err := os.Create("favicon.go")
if err != nil {
log.Fatalln("Failed to create output favicon.go file --", err)
}
defer out.Close()
str :... | [
0.2913292944431305,
0.3041151165962219,
0.5620357990264893,
0.3154456615447998,
0.08612796664237976,
0.48216211795806885,
-0.33064234256744385,
0.3820476830005646,
-1.3502029180526733,
1.1111743450164795,
-0.7804995775222778,
0.45880717039108276,
0.826271653175354,
-0.38511449098587036,
... |
func getRelevantUsers(s *PartyMatchState) map[string]struct{} {
relevantUsers := make(map[string]struct{})
for userID := range s.presences {
relevantUsers[userID] = struct{}{}
}
for userID := range s.invitations {
relevantUsers[userID] = struct{}{}
}
for userID := range s.approvedForRejoin {
relevantUsers... | [
-0.6960635781288147,
-0.5871346592903137,
0.47897008061408997,
-0.4712193012237549,
-0.8860900402069092,
0.5638113617897034,
-0.13769562542438507,
0.9807309508323669,
-0.2961244583129883,
0.2920997142791748,
-0.17862114310264587,
0.2370835244655609,
-0.30453431606292725,
0.1026944816112518... |
func altProtoMiddleware(next http.Handler, port int) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Add("Alternate-Protocol", fmt.Sprintf("%d:quic", port))
next.ServeHTTP(w, r)
})
} | [
0.6138659715652466,
-0.8861718773841858,
0.6206088066101074,
-0.8376256227493286,
-0.2868887782096863,
0.5897158980369568,
-0.9471414089202881,
-0.49546363949775696,
0.13091403245925903,
-0.12649984657764435,
0.4513283371925354,
0.7687612175941467,
-0.5660853385925293,
0.186358243227005,
... |
func (c *Client) DescribeNetworkInterfaces(ctx context.Context, params *DescribeNetworkInterfacesInput, optFns ...func(*Options)) (*DescribeNetworkInterfacesOutput, error) {
if params == nil {
params = &DescribeNetworkInterfacesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeNetworkInterfaces",... | [
-0.9255837202072144,
1.3738822937011719,
0.7790852189064026,
0.08163458108901978,
0.7397757768630981,
-0.33403000235557556,
0.7265249490737915,
-1.945543885231018,
0.27758529782295227,
-0.5320248603820801,
-0.727077305316925,
0.08947250992059708,
-1.2460310459136963,
0.3831213414669037,
... |
func NewDescribeNetworkInterfacesPaginator(client DescribeNetworkInterfacesAPIClient, params *DescribeNetworkInterfacesInput, optFns ...func(*DescribeNetworkInterfacesPaginatorOptions)) *DescribeNetworkInterfacesPaginator {
if params == nil {
params = &DescribeNetworkInterfacesInput{}
}
options := DescribeNetwork... | [
-0.38842156529426575,
0.49905508756637573,
0.45430895686149597,
-0.19253122806549072,
-0.29092249274253845,
0.010535934939980507,
0.65074622631073,
-0.7134847044944763,
0.18982864916324615,
-0.32637888193130493,
0.19254611432552338,
-0.9222757816314697,
-1.562327265739441,
0.83522289991378... |
func (p *DescribeNetworkInterfacesPaginator) HasMorePages() bool {
return p.firstPage || p.nextToken != nil
} | [
0.508676290512085,
0.2635432779788971,
0.15991424024105072,
-1.0531870126724243,
1.036629557609558,
-0.4154493510723114,
-1.1255695819854736,
-0.4626188278198242,
0.29430630803108215,
-0.55241459608078,
-0.21951837837696075,
-1.2588040828704834,
-0.6893423795700073,
1.4211633205413818,
-... |
func (p *DescribeNetworkInterfacesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeNetworkInterfacesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
params.MaxResults = p.options.Limit
re... | [
-0.33918580412864685,
1.1094224452972412,
0.5154817700386047,
-0.6191760897636414,
0.1860535740852356,
-0.21219602227210999,
0.5313743948936462,
-1.1044538021087646,
0.049421850591897964,
-0.4169645309448242,
0.891693115234375,
-0.48130643367767334,
-1.4719886779785156,
0.547286868095398,
... |
func lastFolderFromPath(path string) string {
slices := strings.Split(path, "/")
return slices[len(slices)-1]
} | [
-0.5917419791221619,
-0.6102240681648254,
0.5315371155738831,
-0.11564262211322784,
-0.21842405200004578,
0.2267538607120514,
0.574435293674469,
-0.37915557622909546,
0.08725880086421967,
-0.4808989465236664,
0.749396562576294,
-0.9096519351005554,
-0.8322963714599609,
-0.4345933496952057,... |
func firstPartFromPath(path string) string {
return path[:strings.LastIndex(path, "/")]
} | [
0.6686025857925415,
-0.709567129611969,
0.3228225111961365,
-0.20853905379772186,
0.04978860169649124,
-0.10239117592573166,
-0.1404556930065155,
-0.8867324590682983,
0.02802133560180664,
-0.44710928201675415,
0.8751305341720581,
-0.4484274685382843,
-0.3697940409183502,
-0.750963807106018... |
func readToken(filePath string) (string, error) {
b, err := ioutil.ReadFile(filePath)
if err != nil {
return "", err
}
return string(b), nil
} | [
0.26667436957359314,
-0.43379852175712585,
0.530450165271759,
-0.14037789404392242,
-0.31108930706977844,
0.5348979830741882,
-0.2412686049938202,
0.8270285129547119,
-0.7638854384422302,
0.14227698743343353,
-0.22548602521419525,
0.7959463596343994,
0.4884239435195923,
-0.5063021779060364... |
func writeToken(filePath string, token string) {
// Check if file exists
if _, err := os.Stat(filePath); os.IsNotExist(err) {
// Doesn't exist; lets create it
err = os.MkdirAll(filepath.Dir(filePath), 0700)
if err != nil {
return
}
}
b := []byte(token)
if err := ioutil.WriteFile(filePath, b, 0600); err ... | [
0.17147880792617798,
-0.611767053604126,
0.5824904441833496,
-0.10242460668087006,
1.3619847297668457,
0.7637344598770142,
0.6074528694152832,
1.325925350189209,
-0.06874561309814453,
-0.4445446729660034,
-1.3350104093551636,
0.5789673924446106,
0.48367810249328613,
0.6197032928466797,
-... |
func ToClient(client types.Client) *api.Client {
return &api.Client{
Id: client.ID.Bytes(),
Metadata: ToMetadataInfo(client.MetadataInfo),
}
} | [
-0.42187193036079407,
-0.6191707849502563,
0.32535576820373535,
-0.7370082139968872,
-0.22532731294631958,
0.679891049861908,
0.1523907631635666,
-0.5361391305923462,
0.34713098406791687,
0.2968901991844177,
-0.8830414414405823,
0.7396798133850098,
-0.21279828250408173,
-1.1300989389419556... |
func ToMetadataInfo(metadata types.MetadataInfo) *api.Metadata {
return &api.Metadata{
Clock: metadata.Clock,
Data: metadata.Data,
}
} | [
0.05314892530441284,
-0.40468406677246094,
0.4554217457771301,
-1.383721947669983,
-0.7531036138534546,
0.6792172789573669,
-1.5907282829284668,
-0.7447577714920044,
0.22628863155841827,
0.4210943281650543,
-0.9386088252067566,
0.4517364501953125,
0.6581298112869263,
-0.13296881318092346,
... |
func ToChangePack(pack *change.Pack) (*api.ChangePack, error) {
pbChanges, err := toChanges(pack.Changes)
if err != nil {
return nil, err
}
return &api.ChangePack{
DocumentKey: toDocumentKey(pack.DocumentKey),
Checkpoint: toCheckpoint(pack.Checkpoint),
Changes: pbChanges,
Snapshot: ... | [
-1.1064530611038208,
0.33629554510116577,
0.5843805074691772,
0.12480294704437256,
-0.44866943359375,
-0.40243226289749146,
-0.09186964482069016,
-0.45589131116867065,
0.644508421421051,
0.3445103168487549,
-1.1934525966644287,
0.1821516454219818,
0.012281692586839199,
0.5047335624694824,
... |
func ToDocumentKeys(keys []*key.Key) []*api.DocumentKey {
var pbKeys []*api.DocumentKey
for _, k := range keys {
pbKeys = append(pbKeys, toDocumentKey(k))
}
return pbKeys
} | [
-1.6233984231948853,
-0.13551396131515503,
0.3395702838897705,
0.16746319830417633,
0.276263564825058,
0.1930481493473053,
-0.6801896095275879,
-0.20473098754882812,
-0.005371688399463892,
1.3627817630767822,
-0.3096129298210144,
0.6436012983322144,
-0.8001720309257507,
0.47447317838668823... |
func ToClientsMap(clientsMap map[string][]types.Client) map[string]*api.Clients {
pbClientsMap := make(map[string]*api.Clients)
for k, clients := range clientsMap {
var pbClients []*api.Client
for _, client := range clients {
pbClients = append(pbClients, ToClient(client))
}
pbClientsMap[k] = &api.Client... | [
-0.3763682246208191,
-0.8194937705993652,
0.5526459813117981,
-0.5145017504692078,
0.04788019880652428,
0.4315369129180908,
-0.043232690542936325,
-0.2814749777317047,
0.6327430009841919,
0.9622681140899658,
-0.1541530042886734,
0.3483069837093353,
-0.5149704813957214,
0.24037399888038635,... |
func ToDocEventType(eventType types.DocEventType) (api.DocEventType, error) {
switch eventType {
case types.DocumentsChangedEvent:
return api.DocEventType_DOCUMENTS_CHANGED, nil
case types.DocumentsWatchedEvent:
return api.DocEventType_DOCUMENTS_WATCHED, nil
case types.DocumentsUnwatchedEvent:
return api.DocE... | [
0.011584768071770668,
-0.3221948742866516,
0.8241859078407288,
-0.008837143890559673,
-0.4117635190486908,
-0.18892759084701538,
0.6891050934791565,
-0.36658772826194763,
0.47189924120903015,
0.8335909843444824,
-0.11534442752599716,
0.365378737449646,
0.07841769605875015,
0.61711430549621... |
func ToDocEvent(docEvent sync.DocEvent) (*api.DocEvent, error) {
eventType, err := ToDocEventType(docEvent.Type)
if err != nil {
return nil, err
}
return &api.DocEvent{
Type: eventType,
Publisher: ToClient(docEvent.Publisher),
DocumentKeys: ToDocumentKeys(docEvent.DocumentKeys),
}, nil
} | [
0.17801524698734283,
0.048475075513124466,
0.4496828317642212,
-0.34009620547294617,
-0.5345108509063721,
0.07544563710689545,
0.2761165201663971,
-0.3488136827945709,
0.7010956406593323,
0.4812975823879242,
-0.3758886158466339,
0.7885147333145142,
-0.12021967023611069,
-0.3033301234245300... |
func ToOperations(operations []operation.Operation) ([]*api.Operation, error) {
var pbOperations []*api.Operation
for _, o := range operations {
pbOperation := &api.Operation{}
var err error
switch op := o.(type) {
case *operation.Set:
pbOperation.Body, err = toSet(op)
case *operation.Add:
pbOperatio... | [
-1.5091300010681152,
0.27627140283584595,
0.8249273896217346,
0.5783633589744568,
-0.17147409915924072,
-0.21527771651744843,
0.4789361357688904,
-0.979709804058075,
0.9132022261619568,
0.8417173027992249,
-0.40070223808288574,
-0.7182008624076843,
-0.023697849363088608,
-0.171428337693214... |
func AddLogger(logger Logger) error {
if logger == nil {
return fmt.Errorf("logger can't be nil.")
}
handlers[logger.Name()] = logger
return nil
} | [
-0.6531333923339844,
0.661392092704773,
0.6833193898200989,
0.20475101470947266,
-0.2746044099330902,
0.4322393238544464,
-0.2868614196777344,
0.540378212928772,
0.5747243762016296,
-1.2237073183059692,
-0.5394238233566284,
-0.4033069610595703,
-0.4313948452472687,
2.2798166275024414,
1.... |
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 Test_New(t *testing.T) {
r := taskrunner.New()
assert.NotNil(t, r)
} | [
0.44822070002555847,
0.9019396305084229,
0.3080863952636719,
0.11450854688882828,
-0.22870850563049316,
0.38903677463531494,
0.13237465918064117,
0.16846612095832825,
-1.0058159828186035,
-0.9444082975387573,
-1.0492205619812012,
-0.5920209884643555,
0.8221023082733154,
0.8466072082519531,... |
func Test_Run(t *testing.T) {
r := taskrunner.New()
f := false
r.Run("Name", func(ctx context.Context) {
f = true
})
r.Wait()
assert.Equal(t, true, f)
} | [
0.012406185269355774,
0.8672137260437012,
0.47949716448783875,
0.15501393377780914,
0.0314500667154789,
0.9417123794555664,
0.3737699091434479,
-0.24341587722301483,
-0.3275343179702759,
-0.44211095571517944,
-1.2339891195297241,
-0.7799610495567322,
-0.1150473952293396,
-0.600120902061462... |
func Version() string {
return libs.Version()
} | [
-0.10332943499088287,
-1.6073650121688843,
0.11118283867835999,
0.40913254022598267,
0.48699361085891724,
0.9348565340042114,
0.7141290307044983,
-0.012540267780423164,
-0.19638291001319885,
-0.032977424561977386,
-0.5671490430831909,
-0.7917792201042175,
-0.21527618169784546,
0.0895365774... |
func (fn DeleteAPIInventoryAPIIDSpecsProvidedSpecHandlerFunc) Handle(params DeleteAPIInventoryAPIIDSpecsProvidedSpecParams) middleware.Responder {
return fn(params)
} | [
-0.11799436062574387,
-0.23916076123714447,
0.18732215464115143,
0.05401216074824333,
0.5567739605903625,
0.04451430216431618,
-0.3853355348110199,
0.13016164302825928,
0.6129022240638733,
-0.49567165970802307,
0.46282896399497986,
-0.22854872047901154,
-0.4560139775276184,
-0.101781383156... |
func NewDeleteAPIInventoryAPIIDSpecsProvidedSpec(ctx *middleware.Context, handler DeleteAPIInventoryAPIIDSpecsProvidedSpecHandler) *DeleteAPIInventoryAPIIDSpecsProvidedSpec {
return &DeleteAPIInventoryAPIIDSpecsProvidedSpec{Context: ctx, Handler: handler}
} | [
-0.16600225865840912,
-0.26982954144477844,
0.11145151406526566,
-0.19147904217243195,
0.5538835525512695,
-0.1552402526140213,
-0.07167284935712814,
0.10403520613908768,
0.7386705875396729,
-0.10798276960849762,
0.32522982358932495,
-0.22754953801631927,
-0.38644978404045105,
-0.495212316... |
func (a *PlaylistSongsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
a.cache.ServeHTTP(w, r)
} | [
0.084676094353199,
0.4864010512828827,
0.21079057455062866,
0.4732993245124817,
0.2174079865217209,
0.38738226890563965,
0.3824649453163147,
-0.21239088475704193,
-0.6817783713340759,
1.2308743000030518,
-0.01770652085542679,
-0.0850750058889389,
-0.917798638343811,
0.7541280388832092,
-... |
func (a *PlaylistSongsHandler) Changed() <-chan struct{} {
return a.changed
} | [
-0.46128425002098083,
-1.1411076784133911,
0.3573508858680725,
-0.41495102643966675,
0.5831701755523682,
0.5416742563247681,
-0.042671095579862595,
-0.2937702238559723,
-0.03199436515569687,
-0.39233046770095825,
-0.44376859068870544,
1.488380789756775,
-0.3181867301464081,
1.3168494701385... |
func (a *PlaylistSongsHandler) Close() {
a.cache.Close()
} | [
0.16529253125190735,
-0.11603520810604095,
0.1807539165019989,
-0.23777395486831665,
-0.2436121702194214,
1.0368611812591553,
0.6002853512763977,
-0.03277641907334328,
-0.7035570740699768,
-0.21478164196014404,
0.22419235110282898,
-0.0007392971310764551,
-1.258802056312561,
1.284801721572... |
func (c Config) DataBag() *cfgfile.DataBag {
bag := cfgfile.NewDataBag()
bag.PublicIP = c.defaultHTTP.PublicIP
for _, http := range c.defaultHTTP.Parts() {
if bd, ok := http.(parts.BindDomain); ok {
dm := cfgfile.NewDomains()
dm.BackendName = bd.BackendName
dm.DomainNames = append(dm.DomainNames, bd.Domai... | [
-0.15541310608386993,
-0.21810384094715118,
0.7082640528678894,
-0.4832075834274292,
0.6029744744300842,
0.9554834961891174,
0.35414838790893555,
-0.23808002471923828,
-0.7572816014289856,
-0.7633178234100342,
-0.6302988529205322,
0.3393385410308838,
0.35775333642959595,
0.9370905160903931... |
func HTTPResponse(err error, body interface{}) (int, interface{}) {
e, ok := err.(*Error)
if ok {
return http.StatusBadRequest, map[string]interface{}{"code": e.ErrorCode, "message": e.ErrorMessage}
}
logger.LogError(err)
logger.LogErrorF("body: %+v\n ", body)
return http.StatusInternalServerError, map[string]i... | [
-0.5022679567337036,
-0.8251581192016602,
0.7763630151748657,
-0.28535208106040955,
-0.26064491271972656,
-0.7184863686561584,
-0.24796876311302185,
0.2732613682746887,
0.6356068253517151,
0.3505939841270447,
-0.8599672913551331,
0.6737857460975647,
-0.3381200432777405,
0.48441019654273987... |
func (e Error) HTTPResponse(body interface{}) (int, interface{}) {
logger.LogErrorF("body: %+v\n ", body)
return http.StatusBadRequest, map[string]interface{}{"code": e.ErrorCode, "message": e.ErrorMessage}
} | [
-0.916738748550415,
-0.9367169141769409,
0.6026403307914734,
-0.5489416718482971,
0.1858324110507965,
-0.357618510723114,
-0.7958914637565613,
-0.03146814554929733,
0.5906972885131836,
0.7531077265739441,
-0.9673359990119934,
0.8260038495063782,
-0.42224738001823425,
0.33621805906295776,
... |
func GetWriter(syslogHost, syslogPrefix, containerName string) (io.WriteCloser, error) {
return syslog.Dial("udp4", syslogHost, syslog.LOG_WARNING|syslog.LOG_DAEMON, syslogPrefix+containerName)
} | [
-0.13311490416526794,
0.6834859848022461,
0.4122011363506317,
0.5587538480758667,
-0.03942640498280525,
-1.1364840269088745,
0.0018843654543161392,
0.16627109050750732,
0.33023515343666077,
-0.14436447620391846,
0.188684344291687,
0.3165959119796753,
0.20537258684635162,
-0.121985018253326... |
func IsSupported() bool {
return true
} | [
-0.39192017912864685,
0.08471725881099701,
0.3774940073490143,
0.8613052368164062,
-0.1933271288871765,
0.9127599000930786,
-0.2350291907787323,
1.4358952045440674,
0.6747344732284546,
0.0035941048990935087,
-1.450501799583435,
-0.15500876307487488,
-0.7964242696762085,
0.02218738757073879... |
func NewPkgBuilder(root string) PkgBuilder {
ref := manifest.Reference{
Name: "test",
Version: manifest.Version{},
}
return PkgBuilder{
&manifest.Package{
Reference: ref,
Binaries: []string{"darwin_exe", "linux_exe"},
Root: root,
Dest: root,
Triggers: map[manifest.Event][]manifest... | [
0.4005699157714844,
-0.5195724368095398,
0.5168902277946472,
0.7356592416763306,
-1.2881790399551392,
0.01891147904098034,
-0.32647430896759033,
0.2828185260295868,
0.3780316114425659,
-0.9013245105743408,
-0.3861114978790283,
-0.16314250230789185,
-0.6260568499565125,
1.3727117776870728,
... |
func (b PkgBuilder) Result() *manifest.Package {
return b.result
} | [
-0.29670676589012146,
0.8255316615104675,
0.30325499176979065,
0.9546247124671936,
0.12700651586055756,
0.3516329824924469,
-0.04696272686123848,
0.36383679509162903,
1.049839735031128,
-1.231565237045288,
-0.18568070232868195,
-0.20088011026382446,
-0.5819272398948669,
-0.0234738308936357... |
func (b PkgBuilder) WithName(name string) PkgBuilder {
b.result.Reference.Name = name
return b
} | [
-0.14728401601314545,
0.5363816618919373,
0.4836779236793518,
0.4968997836112976,
-0.6367851495742798,
-0.21534325182437897,
0.3734806180000305,
0.271165132522583,
0.662846028804779,
0.4933713972568512,
-0.5361427664756775,
-0.9346756935119629,
-0.4224863648414612,
0.6261600852012634,
-1... |
func (b PkgBuilder) WithVersion(version string) PkgBuilder {
b.result.Reference.Version = manifest.ParseVersion(version)
return b
} | [
0.1691080629825592,
-0.3651682138442993,
0.2771862745285034,
0.7156732082366943,
-0.2509777247905731,
-0.1490502804517746,
0.02647688239812851,
0.7491162419319153,
0.7818151712417603,
-0.21707195043563843,
-0.7125702500343323,
-0.9139094948768616,
-0.7804154753684998,
0.07386805862188339,
... |
func (b PkgBuilder) WithChannel(name string) PkgBuilder {
b.result.Reference.Channel = name
return b
} | [
-0.39838770031929016,
0.2730036973953247,
0.3184351623058319,
-0.3910374343395233,
-0.171904519200325,
0.27307918667793274,
0.20798076689243317,
-0.06353159993886948,
0.7369214296340942,
-0.13240519165992737,
0.03754119575023651,
0.05769642814993858,
-0.2723957300186157,
0.5309261083602905... |
func (b PkgBuilder) WithDest(dst string) PkgBuilder {
b.result.Dest = dst
return b
} | [
-0.12890204787254333,
0.558329701423645,
0.3436623215675354,
0.5580481290817261,
-0.9366915225982666,
0.5648286938667297,
-0.2244110107421875,
0.40160027146339417,
0.5284355282783508,
-0.22516733407974243,
-0.4845332205295563,
-0.6718546748161316,
0.5921691656112671,
-0.0067120627500116825... |
func (b PkgBuilder) WithBinaries(bins ...string) PkgBuilder {
b.result.Binaries = bins
return b
} | [
-0.28685715794563293,
0.581040620803833,
0.23223522305488586,
0.8777285814285278,
-0.038685236126184464,
0.4677373468875885,
-0.3938632309436798,
-0.29299283027648926,
0.3114904463291168,
-1.3063859939575195,
-0.5613995790481567,
-0.8520458936691284,
-0.5629639625549316,
0.4418608844280243... |
func (b PkgBuilder) WithSource(src string) PkgBuilder {
b.result.Source = src
return b
} | [
-0.43256875872612,
0.6925166249275208,
0.195420503616333,
1.2335922718048096,
-1.0042734146118164,
-0.21692797541618347,
0.155703604221344,
0.8648952841758728,
1.127625823020935,
-0.12999452650547028,
-0.8956500291824341,
-0.5378072261810303,
-0.15484900772571564,
0.8557526469230652,
-0.... |
func (b PkgBuilder) WithWarnings(warnings ...string) PkgBuilder {
b.result.Warnings = warnings
return b
} | [
0.13401412963867188,
0.6616835594177246,
0.20943231880664825,
1.286890983581543,
-0.490386039018631,
0.12882983684539795,
-0.7418234944343567,
-0.6825850605964661,
0.41164422035217285,
-0.625424861907959,
-0.16724362969398499,
-0.8552980422973633,
-0.2848547399044037,
-0.20403648912906647,... |
func (b PkgBuilder) WithSHA256(sha string) PkgBuilder {
b.result.SHA256 = sha
return b
} | [
0.15225034952163696,
-0.36071211099624634,
0.18685181438922882,
0.8446937203407288,
0.021772418171167374,
-0.7648649215698242,
-0.3168018162250519,
0.6437627077102661,
1.6944098472595215,
0.03170658275485039,
-1.01677405834198,
-1.0941722393035889,
0.4697505235671997,
0.9060438275337219,
... |
func (b PkgBuilder) WithUpdateInterval(dur time.Duration) PkgBuilder {
b.result.UpdateInterval = dur
return b
} | [
-0.6395438313484192,
-0.46682533621788025,
0.4214767515659332,
0.8014041781425476,
-1.136849284172058,
0.8657411336898804,
-0.27381306886672974,
0.05737762525677681,
0.48988306522369385,
0.3142136037349701,
-0.6451268196105957,
-0.974102258682251,
-0.49238187074661255,
0.4007212519645691,
... |
func (b PkgBuilder) WithFile(src, dst string, fs fs.FS) PkgBuilder {
b.result.Files = append(b.result.Files, &manifest.ResolvedFileRef{
FS: fs,
FromPath: src,
ToPAth: dst,
})
return b
} | [
0.24420157074928284,
0.7717117667198181,
0.26339855790138245,
0.4399743378162384,
-0.2726480960845947,
-0.05640644580125809,
-0.1727774739265442,
1.1811363697052002,
-0.04807218909263611,
-1.1741622686386108,
-0.5430723428726196,
-0.7737911939620972,
0.449260950088501,
-0.0612281858921051,... |
func (b PkgBuilder) WithTrigger(event manifest.Event, actions ...manifest.Action) PkgBuilder {
b.result.Triggers[event] = append(b.result.Triggers[event], actions...)
return b
} | [
-0.09562355279922485,
0.6007152795791626,
0.2425694763660431,
0.9915134906768799,
-0.05507037416100502,
-0.7164576053619385,
-0.408265084028244,
0.4473191499710083,
0.6829749941825867,
-0.606907844543457,
-0.8669838309288025,
-0.6907432079315186,
0.36374005675315857,
-0.34919771552085876,
... |
func (b PkgBuilder) WithEnvOps(ops ...envars.Op) PkgBuilder {
b.result.Env = append(b.result.Env, ops...)
return b
} | [
-0.9783767461776733,
0.2286829650402069,
0.35433927178382874,
0.7543598413467407,
0.20563875138759613,
0.10772392153739929,
-0.5831565260887146,
0.13650758564472198,
0.29334545135498047,
0.29015010595321655,
0.6305370330810547,
-1.1724761724472046,
-0.11314515024423599,
0.4593835175037384,... |
func (b PkgBuilder) WithFS(fs fs.FS) PkgBuilder {
b.result.FS = fs
return b
} | [
-0.9215847849845886,
0.644504189491272,
0.25130826234817505,
0.671694815158844,
-0.6242085099220276,
-0.5995379090309143,
0.1285618096590042,
0.29876014590263367,
1.1866116523742676,
-1.4624868631362915,
0.5632053017616272,
-0.9215934872627258,
0.22138537466526031,
0.31595778465270996,
-... |
func (b PkgBuilder) WithRequires(reqs ...string) PkgBuilder {
b.result.Requires = reqs
return b
} | [
-0.5647916793823242,
0.25879967212677,
0.2617955803871155,
0.6200842261314392,
-0.34413641691207886,
0.040940772742033005,
-0.5816984176635742,
0.05855013430118561,
0.5933476090431213,
-1.0001589059829712,
-0.34817489981651306,
-1.1919941902160645,
0.08403819054365158,
0.7900347709655762,
... |
func (b PkgBuilder) WithProvides(provs ...string) PkgBuilder {
b.result.Provides = provs
return b
} | [
-0.257161408662796,
0.8310175538063049,
0.14509405195713043,
0.738858163356781,
-0.29166096448898315,
0.6032202243804932,
-1.1579004526138306,
-0.1346856951713562,
0.7631261348724365,
-0.644684374332428,
0.25648194551467896,
-0.745448887348175,
-0.4439013600349426,
0.4337342083454132,
-1... |
func (b PkgBuilder) WithUnsupportedPlatforms(platforms []platform.Platform) PkgBuilder {
b.result.UnsupportedPlatforms = platforms
return b
} | [
-0.706279993057251,
0.6467978954315186,
0.3859522342681885,
0.8614645004272461,
-0.5629963874816895,
0.8736610412597656,
0.13382744789123535,
0.4794863164424896,
0.3349684178829193,
-0.4599841237068176,
-0.7887598276138306,
-1.2713775634765625,
-0.772263765335083,
1.2683303356170654,
-1.... |
func (*DescribeDomainRequest) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*DescribeDomainRequest_Id)(nil),
(*DescribeDomainRequest_Name)(nil),
}
} | [
-1.7346407175064087,
0.2193455845117569,
0.2910554111003876,
-0.2684871554374695,
0.5556398034095764,
0.0211036279797554,
-0.10101118683815002,
-0.5978615283966064,
0.7618920207023621,
-0.38250237703323364,
0.72251296043396,
1.3804950714111328,
-0.28309547901153564,
1.307297706604004,
0.... |
func LeadNodeRec(self NodeSocket, m string){
nodeSend(m,self)
} | [
0.7866177558898926,
0.08696556091308594,
0.17703944444656372,
-1.3369174003601074,
-0.3595655858516693,
0.7399882078170776,
-0.46469733119010925,
-0.9121460914611816,
-0.6935440897941589,
0.034598879516124725,
0.10405807197093964,
1.5468425750732422,
-0.7186726331710815,
-0.015548899769783... |
func TraceMsg(logger log.Logger, message string, keyvals ...interface{}) {
Msg(TraceLogger(logger), message, keyvals...)
} | [
0.21375975012779236,
0.7326555252075195,
0.4814654588699341,
0.1388373225927353,
-0.31930091977119446,
-0.03817974776029587,
-0.5933191180229187,
-0.05532565712928772,
-0.2198578119277954,
-0.4378691613674164,
-0.23083990812301636,
-0.3591753840446472,
0.5829975605010986,
1.090991735458374... |
func WithScope(logger log.Logger, scopeName string) log.Logger {
// InfoTraceLogger will collapse successive (ScopeKey, scopeName) pairs into a vector in the order which they appear
return log.With(logger, structure.ScopeKey, scopeName)
} | [
-0.22860920429229736,
-0.4389200806617737,
0.5749292373657227,
-0.5020453929901123,
-0.7677552700042725,
-0.8755902647972107,
-0.48230352997779846,
-0.6507713794708252,
-0.1461644023656845,
0.7554147839546204,
0.2390977442264557,
0.039617206901311874,
0.5137184858322144,
-0.024133319035172... |
func Msg(logger log.Logger, message string, keyvals ...interface{}) error {
prepended := make([]interface{}, 0, len(keyvals)+2)
prepended = append(prepended, structure.MessageKey, message)
prepended = append(prepended, keyvals...)
return logger.Log(prepended...)
} | [
-0.4014832377433777,
0.5851055383682251,
0.6964670419692993,
0.0700812116265297,
-0.986789882183075,
0.4455980956554413,
-0.25886043906211853,
-0.020016388967633247,
-1.1186312437057495,
-0.790871262550354,
0.5469158887863159,
0.28189340233802795,
0.4936661124229431,
0.9072303175926208,
... |
func Err(logger log.Logger, err error) error {
if err != nil {
errLogger := logger.Log(structure.MessageKey, "Failure", structure.ErrorKey, err)
if errLogger != nil {
return fmt.Errorf("failed to log error '%s': %s", errLogger, err)
}
return err
}
return nil
} | [
0.2959464490413666,
-0.18621444702148438,
0.3171902894973755,
0.5431483387947083,
-0.9827166199684143,
-0.3450588881969452,
-0.5832167267799377,
0.01936214417219162,
0.2745889127254486,
-0.3680579364299774,
0.25661447644233704,
-0.27370771765708923,
0.4574500322341919,
1.100576400756836,
... |
func Scrape(proxlist []m.ProxySource) []string {
for _, p := range proxlist { // turn to go routine
fmt.Println(p.Reg + "\t" + p.Url)
response, err := http.Get(p.Url)
if err != nil {
log.Fatal(err)
}
defer response.Body.Close()
// convert io page to string
buf := new(bytes.Buffer)
buf.ReadFrom(re... | [
-1.4832062721252441,
-0.42371508479118347,
0.9239286780357361,
-0.4207885265350342,
0.047678761184215546,
0.1341160386800766,
-0.4091264605522156,
0.31159600615501404,
0.16003526747226715,
0.7061300873756409,
0.039096761494874954,
-0.2086574137210846,
-0.23789645731449127,
0.47257834672927... |
func NewStagingArea() *StagingArea {
return &StagingArea{
shards: make(map[StagingShardID]StagingShard),
isCommitted: false,
}
} | [
-0.9292170405387878,
-0.1389220505952835,
0.22376172244548798,
-0.1674359291791916,
-0.6731091737747192,
-0.29446104168891907,
0.2383832186460495,
0.23119549453258514,
-0.5584552884101868,
0.7648178935050964,
-0.09790197759866714,
-0.7597855925559998,
-1.0142719745635986,
1.252713680267334... |
func (sa *StagingArea) GetOrCreateShard(shardID StagingShardID, createFunc func() StagingShard) StagingShard {
shard, ok := sa.shards[shardID]
if !ok {
shard = createFunc()
sa.shards[shardID] = shard
}
return shard
} | [
0.30177268385887146,
0.7154087424278259,
0.3681534230709076,
-0.4996010363101959,
0.4717884063720703,
-0.6235406994819641,
0.5050526857376099,
-0.12363222986459732,
0.6220486760139465,
0.22740529477596283,
0.37304016947746277,
0.7431221008300781,
0.4669967591762543,
0.348794549703598,
0.... |
func (sa *StagingArea) Commit(dbTx DBTransaction) error {
if sa.isCommitted {
return errors.New("Attempt to call Commit on already committed stagingArea")
}
for _, shard := range sa.shards {
err := shard.Commit(dbTx)
if err != nil {
return err
}
}
sa.isCommitted = true
return nil
} | [
-0.4189560115337372,
-0.013922970741987228,
0.5523096919059753,
0.014071568846702576,
0.5036014914512634,
0.5444959998130798,
0.9160260558128357,
-0.20495258271694183,
-0.43522214889526367,
1.8251780271530151,
0.42485353350639343,
-0.7870422601699829,
-0.08381899446249008,
1.04640114307403... |
func (s *MysqlSuite) SetupSuite() {
DisableLogging()
var err error
s.DBConn, err = sql.Open(mysql, s.DSN)
s.Require().NoError(err)
err = s.DBConn.Ping()
s.Require().NoError(err)
_, err = s.DBConn.Exec("set global sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CR... | [
-0.7843711972236633,
0.04980722814798355,
0.9672980904579163,
0.4968712329864502,
0.22846846282482147,
0.09551354497671127,
0.8802277445793152,
0.5993919372558594,
-0.30084869265556335,
0.12542258203029633,
-0.08132791519165039,
-0.5135846138000488,
0.223932683467865,
0.8946049809455872,
... |
func (s *MysqlSuite) TearDownSuite() {
s.DBConn.Close()
} | [
-0.2706522047519684,
-0.07331139594316483,
0.20083384215831757,
-0.538483202457428,
0.07131320238113403,
0.4598042666912079,
1.0782480239868164,
0.2572703957557678,
-0.3532804548740387,
-0.7399452328681946,
0.37390032410621643,
0.3540314733982086,
-1.3872472047805786,
0.4668481647968292,
... |
func (r *warmupRunnable) NeedLeaderElection() bool {
return true
} | [
-0.44685226678848267,
0.04001416265964508,
0.7277734875679016,
-0.754134476184845,
0.3049142360687256,
0.7555972337722778,
0.8879725933074951,
0.40835776925086975,
-0.45790958404541016,
-0.6949460506439209,
0.05904558673501015,
-0.2882096767425537,
-0.8517566323280334,
0.6563816666603088,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.