text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (o *CreateOverrideRules) SetGroupGuid(v string) {
o.GroupGuid = &v
} | [
0.8472970724105835,
0.5707353949546814,
-0.42347753047943115,
-0.04909174144268036,
-0.39696991443634033,
0.23647019267082214,
-0.26331931352615356,
-0.5410574078559875,
-0.6960967183113098,
0.5502064824104309,
0.2783361077308655,
1.2135634422302246,
-1.1193947792053223,
0.0732135102152824... |
func (*SinaUser) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _SinaUser_OneofMarshaler, _SinaUser_OneofUnmarshaler, _SinaUser_OneofSizer, []interface{}{
(*SinaUser_Id)(... | [
-0.04265812411904335,
-0.0594879649579525,
0.7323017716407776,
0.675507664680481,
-0.8971330523490906,
-0.40515318512916565,
0.4702437222003937,
-0.20839810371398926,
0.7068529725074768,
-0.3768942058086395,
-1.225344181060791,
0.0973067656159401,
-0.15369254350662231,
1.1158363819122314,
... |
func (scope *Scope) UnmarshalString(str string) error {
str = strings.ToLower(str)
if str == "public" {
*scope = ScopePublic
} else if str == "restricted" {
*scope = ScopeRestricted
} else if str == "private" {
*scope = ScopePrivate
} else {
return errors.New("Unknown Scope value")
}
return nil
} | [
-0.878256618976593,
-0.3454252779483795,
0.5568981766700745,
-1.3119044303894043,
-0.3109149634838104,
-0.14971354603767395,
-0.53215491771698,
0.01197057869285345,
-0.25537699460983276,
0.7712041139602661,
0.39587756991386414,
0.5992757081985474,
-0.13789696991443634,
-0.17294156551361084... |
func (scope *Scope) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
var str string
if err := d.DecodeElement(&str, &start); err != nil {
return err
}
return scope.UnmarshalString(str)
} | [
-0.5259746313095093,
0.41468995809555054,
0.4937392771244049,
-1.2249698638916016,
-1.0145169496536255,
-0.5950454473495483,
-0.4792633056640625,
0.1423475295305252,
0.06287656724452972,
0.5502369403839111,
0.701276957988739,
0.6318342089653015,
-0.4899808168411255,
-0.5353196263313293,
... |
func (scope *Scope) UnmarshalJSON(b []byte) error {
var str string
if err := json.Unmarshal(b, &str); err != nil {
return err
}
return scope.UnmarshalString(str)
} | [
-0.8508214950561523,
-0.06323594599962234,
0.6277236938476562,
-1.7400764226913452,
-0.6212286949157715,
-0.6331250667572021,
-0.23582357168197632,
-0.20803284645080566,
0.49953407049179077,
1.0873781442642212,
0.17890876531600952,
0.6476486921310425,
-0.776184618473053,
-0.084003366529941... |
func (scope *Scope) MarshalJSON() ([]byte, error) {
return json.Marshal(scope.String())
} | [
-0.28246667981147766,
-0.5909205675125122,
0.15562503039836884,
-0.8443224430084229,
-0.3381160497665405,
-0.7822407484054565,
-0.4035322964191437,
-0.03935416042804718,
0.7729972004890442,
0.9153519868850708,
-0.5517891645431519,
1.902500867843628,
-0.10268479585647583,
0.4465021789073944... |
func (scope *Scope) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
return e.EncodeElement(scope.String(), start)
} | [
0.3562827706336975,
-0.0972486212849617,
0.0751945748925209,
-0.018048513680696487,
-0.8641835451126099,
-0.20399725437164307,
-0.7663277983665466,
0.6693084239959717,
0.9997791051864624,
0.785754919052124,
0.274373322725296,
1.2169114351272583,
0.10017600655555725,
0.07409495860338211,
... |
func (scope Scope) String() string {
if scope == ScopePublic {
return "Public"
} else if scope == ScopeRestricted {
return "Restricted"
} else if scope == ScopePrivate {
return "Private"
} else if scope == ScopeUnknown {
return "Unknown"
}
return ""
} | [
-1.0239086151123047,
-0.9525042772293091,
0.2958553731441498,
-1.146971344947815,
-0.12492815405130386,
0.7898075580596924,
-0.23550067842006683,
-1.224692940711975,
-0.17372363805770874,
1.0369759798049927,
-0.2243701070547104,
1.2580329179763794,
-0.15451155602931976,
-0.0726103708148002... |
func NewReadWorker(fd int) *ReadWorker {
rw := new(ReadWorker)
rw.fd = fd
return rw
} | [
-0.40574678778648376,
-0.18949615955352783,
0.4002067446708679,
-0.4112050533294678,
-1.204404592514038,
0.1526065319776535,
-0.37419334053993225,
-0.5007816553115845,
-0.3840412497520447,
-1.0932515859603882,
0.059119947254657745,
-0.2832552492618561,
-0.11181562393903732,
0.7234174609184... |
func (rw *ReadWorker) Run(reader *bufio.Reader) {
isLastBufferSeparated := false
lastWriteBytes := 0
for {
buf := make([]byte, readBufferSize)
n, err := reader.Read(buf)
if err == io.EOF {
if n == 0 {
if !isLastBufferSeparated && lastWriteBytes != 0 {
rw.sendSpool(1, []byte{separator})
}
br... | [
-0.4913537800312042,
-0.4061952829360962,
1.0604833364486694,
-0.3945108652114868,
-0.0611707866191864,
0.37603873014450073,
1.0150706768035889,
-0.7441621422767639,
-0.13617761433124542,
0.3068789541721344,
-0.36921146512031555,
-0.3699929714202881,
-0.8402590155601501,
0.6157534122467041... |
func BusListen(path string, bh busHandler, rh servReadHandler) (serv *BusServer, err error) {
// resolve the address.
addr, err := net.ResolveUnixAddr("unix", path)
if err != nil {
return
}
// begin listening.
ln, err := net.ListenUnix("unix", addr)
if err != nil {
return
}
// no errors. create the serv... | [
-0.07666586339473724,
-0.8487706780433655,
0.6285192370414734,
-0.1304866373538971,
0.002956585492938757,
0.4430267810821533,
0.13580481708049774,
0.9799714088439941,
-0.47519057989120483,
-0.5990365147590637,
-0.7401701807975769,
0.8461523056030273,
-0.9289841651916504,
-0.245409235358238... |
func (serv *BusServer) Run() {
for {
conn, err := serv.listener.Accept()
// error accepting; ignore this.
if err != nil {
continue
}
// begin the connection goroutine.
go serv.handleConnection(conn)
}
} | [
-0.9658974409103394,
-0.45875686407089233,
0.72281414270401,
0.15468020737171173,
0.060880713164806366,
0.617845356464386,
0.9605302810668945,
0.6322776079177856,
-0.7187574505805969,
-0.43938156962394714,
-0.6771851778030396,
-0.25531449913978577,
-1.213599443435669,
0.3216186761856079,
... |
func (serv *BusServer) handleConnection(conn net.Conn) {
// create a buffered reader.
reader := bufio.NewReader(conn)
// attempt to read a line.
for {
line, err := reader.ReadString('\n')
// error occured before reaching delimiter.
if err != nil {
return
}
// no error. handle the line.
serv.readH... | [
0.0630715936422348,
0.01271797250956297,
0.5933892130851746,
0.5205917358398438,
-0.032351259142160416,
-0.29689404368400574,
0.3961588740348816,
0.6140053272247314,
-0.7782021760940552,
-0.4516313374042511,
-0.04765171930193901,
-1.2455326318740845,
-0.13570436835289001,
-0.24507139623165... |
func (o *DeleteMsgVpnDistributedCacheClusterInstanceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewDeleteMsgVpnDistributedCacheClusterInstanceOK()
if err := result.readResponse(response, consumer, o.formats);... | [
-0.2809271216392517,
-0.5175639390945435,
0.5191504955291748,
0.04147931933403015,
-0.204910010099411,
-0.6331939697265625,
0.03536113724112511,
-0.3007522523403168,
0.4894503057003021,
0.23147250711917877,
0.871841311454773,
0.20352144539356232,
-1.1226980686187744,
-0.15978777408599854,
... |
func NewDeleteMsgVpnDistributedCacheClusterInstanceOK() *DeleteMsgVpnDistributedCacheClusterInstanceOK {
return &DeleteMsgVpnDistributedCacheClusterInstanceOK{}
} | [
-0.04001476615667343,
0.19744659960269928,
0.3021802306175232,
0.27116310596466064,
-0.6883560419082642,
1.1086338758468628,
0.35885828733444214,
0.374755859375,
-0.09971459954977036,
-0.09213486313819885,
0.3139389753341675,
0.4835864305496216,
0.20780104398727417,
0.8620109558105469,
0... |
func NewDeleteMsgVpnDistributedCacheClusterInstanceDefault(code int) *DeleteMsgVpnDistributedCacheClusterInstanceDefault {
return &DeleteMsgVpnDistributedCacheClusterInstanceDefault{
_statusCode: code,
}
} | [
-0.14060728251934052,
0.28311407566070557,
0.2523587644100189,
0.3263392746448517,
-0.004103214479982853,
0.6809548735618591,
-0.30314183235168457,
0.4257546365261078,
0.12429193407297134,
-1.0033730268478394,
0.1574912965297699,
0.8985664248466492,
-0.4819249212741852,
0.818122386932373,
... |
func (o *DeleteMsgVpnDistributedCacheClusterInstanceDefault) Code() int {
return o._statusCode
} | [
-0.25633150339126587,
0.6449909806251526,
0.11943096667528152,
0.3449396789073944,
0.5048149824142456,
0.39090031385421753,
0.23298761248588562,
0.7683191895484924,
-0.09073428064584732,
-0.35997313261032104,
0.6262297630310059,
0.8301397562026978,
-0.6504647135734558,
0.6483750939369202,
... |
func main() {
fmt.Println("----------")
defer fmt.Println("----------")
// Open up our database connection.
// I've set up a database on my local machine using phpmyadmin.
// The database is called testDb
//db, err := sql.Open("mysql", "root:1234@tcp(127.0.0.1:3307)/rugby")
db, err := sqlx.... | [
0.6098185777664185,
0.5004584193229675,
0.9916677474975586,
0.631647527217865,
-0.1429959088563919,
0.3836265206336975,
-0.1474376767873764,
-0.1038965955376625,
-0.4075966775417328,
-0.5839072465896606,
0.35129663348197937,
0.04571134224534035,
-0.4202815294265747,
-0.275046706199646,
0... |
func PreMultiShiftOr(sizes *[]int, init, final *uint) {
t := 0
for _, size := range *sizes {
*init ^= 1 << t
t += size
*final ^= 1 << (t - 1)
}
} | [
-0.4098230004310608,
0.696099579334259,
0.20665974915027618,
0.5384498834609985,
-0.4174370765686035,
-0.5103188753128052,
0.44586291909217834,
0.38078922033309937,
-0.20519329607486725,
-0.2952306270599365,
-1.0736267566680908,
-0.060440875589847565,
-0.47580456733703613,
0.99444365501403... |
func MultiShiftOr(text string, patterns []string) [][]int {
occ := make([][]int, len(patterns))
sizes, bigPattern := bigPattern(&patterns)
masks := PreShiftOr(&bigPattern)
var init uint = (1 << len(bigPattern)) - 1
var final uint = (1 << len(bigPattern)) - 1
var match uint = (1 << len(bigPattern)) - 1
PreMultiSh... | [
-0.532670795917511,
0.01620677299797535,
0.9707344770431519,
0.3677385747432709,
-0.9884659051895142,
-0.385354608297348,
1.2640049457550049,
0.020746080204844475,
0.5544387102127075,
0.14704959094524384,
-0.5130800008773804,
-0.21542106568813324,
-0.20656324923038483,
0.9802504777908325,
... |
func (d *Database) Ping() error {
return d.Conn.Ping()
} | [
-0.46665748953819275,
0.6389724612236023,
0.098292775452137,
0.8663848638534546,
0.9124433398246765,
0.058094512671232224,
-0.28552740812301636,
0.7773046493530273,
-0.5496196746826172,
0.7666015625,
0.18786010146141052,
-0.17052872478961945,
-0.19653519988059998,
0.5353241562843323,
0.4... |
func (d *Database) Execute(query string, args ...interface{}) (sql.Result, error) {
var result sql.Result
stmtIns, err := d.Conn.Prepare(query)
if err != nil {
return result, err
}
defer stmtIns.Close()
result, err = stmtIns.Exec(args...)
if err != nil {
return result, err
}
return result, nil
} | [
-0.7129555344581604,
0.6316011548042297,
0.6254069209098816,
0.15183238685131073,
0.05413202568888664,
-0.2157391905784607,
-1.3521513938903809,
-0.3462051749229431,
-0.49573174118995667,
0.5834987163543701,
-0.06437868624925613,
-1.033991813659668,
-0.44853475689888,
-0.39161446690559387,... |
func (d *Database) ExecuteWithTx(tx *sql.Tx, query string, args ...interface{}) (sql.Result, error) {
var result sql.Result
stmtIns, err := tx.Prepare(query)
if err != nil {
return result, err
}
defer stmtIns.Close()
result, err = stmtIns.Exec(args...)
if err != nil {
return result, err
}
return result,... | [
-0.49370095133781433,
0.48441198468208313,
0.780487060546875,
-0.4104363024234772,
-0.338440865278244,
0.02284960262477398,
-1.4032179117202759,
-0.9304328560829163,
-0.12105554342269897,
0.8038948178291321,
-0.29029378294944763,
-0.7731192708015442,
0.017087165266275406,
-0.53738123178482... |
func (d *Database) SliceMapScanWithTx(tx *sql.Tx, query string, args ...interface{}) ([]map[string]interface{}, error) {
stmt, err := tx.Prepare(query)
if err != nil {
return nil, err
}
defer stmt.Close()
rows, err := stmt.Query(args...)
if err != nil {
return nil, err
}
defer rows.Close()
return sliceM... | [
-0.4571300446987152,
-0.8934582471847534,
0.7722795009613037,
0.10924872756004333,
-1.1535757780075073,
0.030210254713892937,
-0.8366055488586426,
-0.5908713340759277,
0.4419783651828766,
0.59886634349823,
0.429740846157074,
-0.970515787601471,
0.08296027779579163,
0.2519315779209137,
-0... |
func (d *Database) SliceMapScan(query string, args ...interface{}) ([]map[string]interface{}, error) {
stmt, err := d.Conn.Prepare(query)
if err != nil {
return nil, err
}
defer stmt.Close()
rows, err := stmt.Query(args...)
if err != nil {
return nil, err
}
defer rows.Close()
return sliceMapScanReadRows(r... | [
-0.9118019938468933,
-0.9167465567588806,
0.9031261205673218,
0.37044116854667664,
-1.0070847272872925,
-0.12175304442644119,
-0.3122522234916687,
-0.1786009520292282,
0.3647345006465912,
-0.03166205435991287,
0.7986370921134949,
-0.5567033886909485,
-0.25686803460121155,
0.264574110507965... |
func (d *Database) QueryRow(query string, args ...interface{}) *sql.Row {
return d.Conn.QueryRow(query, args...)
} | [
-0.01076834462583065,
1.2299939393997192,
0.2452319711446762,
0.3719012141227722,
-0.18849313259124756,
-0.16339914500713348,
-1.097055435180664,
-0.16364839673042297,
-0.1399102509021759,
-1.338262915611267,
0.7293226718902588,
-0.07779078185558319,
0.1488531082868576,
0.43567413091659546... |
func (d *Database) GetJSON(sqlString string) (map[string]interface{}, error) {
rows, err := d.Conn.Query(sqlString)
if err != nil {
return nil, err
}
defer rows.Close()
columns, err := rows.Columns()
if err != nil {
return nil, err
}
count := len(columns)
values := make([]interface{}, count)
valuePtrs := ... | [
-0.34344691038131714,
0.08027875423431396,
0.9188098311424255,
-0.5264607071876526,
-1.1129392385482788,
-1.174275279045105,
0.0000024449323063890915,
-0.4105323553085327,
-0.23970329761505127,
-0.014291583560407162,
-1.0055718421936035,
0.7185527086257935,
0.1387462317943573,
0.2761108279... |
func (d *Database) GetJSONList(sqlString string) ([]map[string]interface{}, error) {
rows, err := d.Conn.Query(sqlString)
if err != nil {
return nil, err
}
defer rows.Close()
columns, err := rows.Columns()
if err != nil {
return nil, err
}
count := len(columns)
tableData := make([]map[string]interface{}, 0... | [
-0.2277153879404068,
-0.16700811684131622,
1.078227162361145,
-0.3096364140510559,
-1.1651384830474854,
-1.150195598602295,
-0.7111862897872925,
-0.3075219690799713,
-0.319519966840744,
0.31309497356414795,
-0.8730764389038086,
0.4064705967903137,
0.3783358931541443,
0.5732296109199524,
... |
func (d *Database) Close() {
err := d.Conn.Close()
if err != nil {
fmt.Println(err)
}
} | [
-0.12474777549505234,
0.5150160193443298,
0.5014417767524719,
0.05720791965723038,
0.2003917694091797,
0.8659780025482178,
-0.027092497795820236,
0.554228663444519,
-0.8959299921989441,
-0.4441542625427246,
0.8026586174964905,
0.8947530388832092,
-0.9708882570266724,
1.2504374980926514,
... |
func ShowLimitsOfINT32() {
fmt.Println()
var num32 int32
fmt.Printf("Limits of signed integer %T\n", num32)
fmt.Println("================================================")
fmt.Printf(" minimum %d\n", math.MinInt32)
fmt.Printf(" maximum %d\n", math.MaxInt32)
fmt.Printf(" 2^3... | [
0.7403013706207275,
-0.36702659726142883,
1.146938681602478,
-1.1481456756591797,
-0.6392550468444824,
1.020403504371643,
0.13051001727581024,
-1.5791677236557007,
-0.2134714424610138,
-0.570965051651001,
-0.6364529728889465,
0.8262475728988647,
-0.2901898920536041,
0.1978086531162262,
0... |
func ShowLimitsOfUINT32() {
fmt.Println()
var numU32 uint32
fmt.Printf("Limits of unsigned integer %T\n", numU32)
fmt.Println("================================================")
fmt.Printf(" minimum %d\n", 0)
fmt.Printf(" maximum %d\n", math.MaxUint32)
fmt.Printf(" 2^32 ... | [
0.2968868017196655,
0.25887128710746765,
1.1162053346633911,
-1.1614152193069458,
-0.8212882876396179,
0.9909783005714417,
0.13809259235858917,
-0.882758378982544,
-0.24995580315589905,
-0.9119328260421753,
-0.3354091942310333,
1.005621314048767,
0.16426429152488708,
0.3005162179470062,
... |
func ShowLimitsOfINT64() {
fmt.Println()
// LIMITS OF INT64 - SIGNED
var num64 int64
fmt.Printf("Limits of signed integer %T\n", num64)
fmt.Println("================================================")
fmt.Printf(" minimum %d\n", math.MinInt64)
fmt.Printf(" maximum %d\n", math.M... | [
0.19366124272346497,
-0.7253413200378418,
1.0542020797729492,
-0.32848092913627625,
-0.7399280667304993,
0.35516357421875,
0.48049917817115784,
-1.1625871658325195,
0.11836502701044083,
-0.3537157475948334,
-0.3290422558784485,
0.7198559641838074,
-0.17260785400867462,
0.41726142168045044,... |
func ShowLimitsOfUINT64() {
fmt.Println()
var numU64 uint64
fmt.Printf("Limits of unsigned integer %T\n", numU64)
fmt.Println("================================================")
fmt.Printf(" minimum %d\n", 0)
fmt.Printf(" maximum %d\n", uint64(math.MaxUint64))
fmt.Printf(" 2^6... | [
-0.03992340713739395,
0.12672656774520874,
0.910210907459259,
-0.31934690475463867,
-0.7268010973930359,
0.23701226711273193,
0.37710127234458923,
-0.5500016808509827,
0.01808943785727024,
-0.758462131023407,
-0.045846883207559586,
0.8062608242034912,
0.32946527004241943,
0.586391329765319... |
func (t *namedTypes) resolveType(typeI Type) error {
switch v := typeI.(type) {
case *Optional:
if unresolved, ok := v.Item.(unresolvedReferencePlaceholder); ok {
if resolved := t.GetByName(unresolved.Ref); resolved != nil {
v.Item = resolved
} else {
return errors.Errorf("Unresolved optional type ref... | [
-0.812084436416626,
-0.31643223762512207,
0.8805131316184998,
-0.24637290835380554,
0.4492539167404175,
-0.3996807932853699,
0.14355270564556122,
-0.7904541492462158,
0.03002273105084896,
0.0906001403927803,
-0.5085229277610779,
-0.3018263876438141,
-0.18388113379478455,
1.3307826519012451... |
func sanitizePackageName(importPath string) string {
alias := path.Base(importPath)
// alias should be lower case
alias = strings.ToLower(alias)
// alias should now only contain alphanumerics
importsRegex := regexp.MustCompile(`[^a-z0-9]`)
alias = importsRegex.ReplaceAllString(alias, "")
// can't have a first... | [
-0.15555092692375183,
-0.24643325805664062,
0.5987895727157593,
-0.2767309248447418,
-0.2097114473581314,
0.22518746554851532,
0.2007949948310852,
0.3980497419834137,
0.6423177719116211,
0.719900369644165,
0.35283881425857544,
-1.0700852870941162,
0.0226385910063982,
0.7324443459510803,
... |
func OpenTemplate(label string, source io.Reader, commonTemplates *packr.Box) (*template.Template, error) {
// TODO we should probably cache these rather than open and parse them for every apply
var readTemplate = func(source io.Reader) (string, error) {
s, err := ioutil.ReadAll(source)
if err != nil {
retur... | [
-0.3240526020526886,
-0.2542665898799896,
0.6893121004104614,
-0.663199245929718,
-1.0984352827072144,
-0.43016383051872253,
0.039933353662490845,
0.553538978099823,
0.09621737152338028,
0.020423755049705505,
-0.5825833082199097,
-0.7748130559921265,
-0.8365964293479919,
0.2383957207202911... |
func noop(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
w.Write([]byte("not yet implemented"))
} | [
-0.18507438898086548,
0.09700661152601242,
0.4122926890850067,
-0.16602420806884766,
0.2806549072265625,
0.6228494644165039,
0.8199759125709534,
0.20495550334453583,
0.3240832984447479,
0.9305495023727417,
0.2852913439273834,
-0.10926457494497299,
0.34538179636001587,
-0.43473902344703674,... |
func clinicaltrialsFetch(w http.ResponseWriter, r *http.Request) {
// define the query
query := `(wuhan AND (coronavirus OR corona virus OR pneumonia virus)) OR COVID19 OR COVID-19 OR COVID 19 OR coronavirus 2019 OR corona virus 2019 OR SARS-CoV-2 OR SARSCoV2 OR SARS2 OR SARS-2 OR 2019 nCoV OR ((novel coronavirus OR... | [
1.073027491569519,
-0.7241733074188232,
0.36779430508613586,
-0.1336466670036316,
-0.6282578110694885,
0.6151024103164673,
-0.7208986282348633,
0.047534458339214325,
0.3158748745918274,
-0.4641910791397095,
0.8824670910835266,
0.43727102875709534,
-0.17665138840675354,
0.6373891234397888,
... |
func clinicaltrialsParse(w http.ResponseWriter, r *http.Request) {
clinicaltrials.Parse(currentFileName)
} | [
0.9649692177772522,
-1.0092328786849976,
0.22521422803401947,
-0.22121617197990417,
0.45303699374198914,
0.5919106602668762,
0.22413644194602966,
0.4847649931907654,
-0.7333753108978271,
0.13128426671028137,
0.7996776700019836,
-0.5131105780601501,
-0.7421121001243591,
0.5757524967193604,
... |
func clinicaltrialsCompare(w http.ResponseWriter, r *http.Request) {
clinicaltrials.Compare(currentFileName)
} | [
0.9907724857330322,
-1.5271501541137695,
0.22234345972537994,
-0.23080450296401978,
0.5061128735542297,
0.8914039731025696,
0.5019628405570984,
0.04855400696396828,
-0.797105073928833,
0.4283140003681183,
1.0397515296936035,
0.03688018023967743,
-0.5680645108222961,
1.0315812826156616,
-... |
func NewConfig(config CConfig) *Config {
return &Config{config: config, nsPath: make([]byte, 1)}
} | [
1.1347699165344238,
0.19424502551555634,
0.1392735242843628,
0.6322928071022034,
-1.0092689990997314,
0.09331697970628738,
0.39260396361351013,
0.5718317031860352,
0.6142913103103638,
-0.11969178169965744,
-0.9174069762229919,
0.04882083833217621,
0.21629419922828674,
1.0266904830932617,
... |
func (c *Config) GetIsSUID() bool {
if c.config.isSuid == 1 {
return true
}
return false
} | [
-0.7136756777763367,
0.24329662322998047,
0.38620471954345703,
1.17691969871521,
0.011720550246536732,
0.5587454438209534,
0.4160403609275818,
1.0188573598861694,
0.4881085455417633,
-0.3408779203891754,
-0.8793424963951111,
1.0133626461029053,
-1.1657274961471558,
0.37774065136909485,
0... |
func (c *Config) GetContainerPid() int {
return int(c.config.containerPid)
} | [
0.7543760538101196,
-0.658194363117218,
0.606964111328125,
0.26984089612960815,
0.3250620365142822,
0.8701968789100647,
0.7505722045898438,
0.2176482230424881,
0.27423223853111267,
0.6869308948516846,
0.19946229457855225,
0.18562866747379303,
-0.8337085843086243,
0.7535359263420105,
1.69... |
func (c *Config) SetInstance(instance bool) {
if instance {
c.config.isInstance = C.uchar(1)
} else {
c.config.isInstance = C.uchar(0)
}
} | [
-1.0966360569000244,
0.22970852255821228,
0.2945455312728882,
-0.46354934573173523,
-0.10303046554327011,
1.0467374324798584,
0.34119734168052673,
1.4116389751434326,
-0.1569197028875351,
0.8263621926307678,
-0.7473940253257751,
0.47423896193504333,
-1.4128594398498535,
0.649749755859375,
... |
func (c *Config) GetInstance() bool {
if c.config.isInstance == 1 {
return true
}
return false
} | [
-1.007811188697815,
1.1268352270126343,
0.38018542528152466,
0.4970102310180664,
0.2289607673883438,
0.4459848701953888,
0.32096120715141296,
1.1653168201446533,
0.06944366544485092,
0.7191774845123291,
-0.5386579632759094,
0.141433984041214,
-1.8878735303878784,
0.09509611874818802,
0.5... |
func (c *Config) SetNoNewPrivs(noprivs bool) {
if noprivs {
c.config.noNewPrivs = C.uchar(1)
} else {
c.config.noNewPrivs = C.uchar(0)
}
} | [
-1.544188141822815,
-0.07852526009082794,
0.3004288673400879,
-0.6387282013893127,
-0.5264608263969421,
0.717187225818634,
-0.27996590733528137,
0.17883548140525818,
-0.26658597588539124,
-0.2118166834115982,
-0.3890362083911896,
0.41387614607810974,
-1.2626501321792603,
0.8479927182197571... |
func (c *Config) GetNoNewPrivs() bool {
if c.config.noNewPrivs == 1 {
return true
}
return false
} | [
-1.5828489065170288,
0.596361517906189,
0.3219185471534729,
-0.060946498066186905,
-0.3817228674888611,
0.6838157176971436,
-0.4858056902885437,
-0.32479533553123474,
-0.49171653389930725,
-0.3411130905151367,
-0.06758065521717072,
0.23021306097507477,
-1.8519771099090576,
0.82222402095794... |
func (c *Config) SetMountPropagation(propagation string) {
switch propagation {
case "shared":
c.config.mountPropagation = C.ulong(syscall.MS_SHARED | syscall.MS_REC)
case "slave":
c.config.mountPropagation = C.ulong(syscall.MS_SLAVE | syscall.MS_REC)
case "private":
c.config.mountPropagation = C.ulong(syscal... | [
0.11812825500965118,
-0.0058253128081560135,
0.8184114694595337,
0.4972350299358368,
-0.24808241426944733,
0.09289593249559402,
0.5066215395927429,
0.7058025002479553,
0.8237659335136414,
0.5851768851280212,
-0.7114889621734619,
0.07523391395807266,
-0.19476522505283356,
0.6985028386116028... |
func (c *Config) GetJSONConfSize() uint {
return uint(c.config.jsonConfSize)
} | [
-0.9224502444267273,
0.20736132562160492,
0.700160801410675,
-0.4211072623729706,
-0.7579940557479858,
-0.7462352514266968,
0.3719981014728546,
-0.5366206169128418,
-0.27433449029922485,
-0.11263636499643326,
-1.0736783742904663,
0.14482323825359344,
-0.5253012776374817,
-0.002863004570826... |
func (c *Config) WritePayload(w io.Writer, payload interface{}) error {
jsonConf, err := json.Marshal(payload)
if err != nil {
return fmt.Errorf("failed to marshal payload: %s", err)
}
c.config.jsonConfSize = C.uint(len(jsonConf))
c.config.nsPathSize = C.uint(len(c.nsPath))
cconfPayload := C.GoBytes(unsafe.Poi... | [
-0.6558531522750854,
0.08216147124767303,
0.6229422092437744,
-0.49841785430908203,
0.14327608048915863,
-0.10117269307374954,
0.37604793906211853,
-0.3286457061767578,
-0.33149218559265137,
0.14776036143302917,
-0.6366468071937561,
-0.7989482879638672,
0.17553770542144775,
0.6236665844917... |
func (c *Config) AddUIDMappings(uids []specs.LinuxIDMapping) {
for i, uid := range uids {
c.config.uidMapping[i].containerID = C.uid_t(uid.ContainerID)
c.config.uidMapping[i].hostID = C.uid_t(uid.HostID)
c.config.uidMapping[i].size = C.uint(uid.Size)
}
} | [
-1.2784732580184937,
0.023435179144144058,
0.3808683753013611,
0.03352922946214676,
-0.07858719676733017,
0.7368098497390747,
0.33625954389572144,
0.8123151659965515,
1.4203051328659058,
-0.6432361006736755,
-0.3967588543891907,
-0.533139705657959,
-0.09539966285228729,
0.9914553761482239,... |
func (c *Config) AddGIDMappings(gids []specs.LinuxIDMapping) {
for i, gid := range gids {
c.config.gidMapping[i].containerID = C.gid_t(gid.ContainerID)
c.config.gidMapping[i].hostID = C.gid_t(gid.HostID)
c.config.gidMapping[i].size = C.uint(gid.Size)
}
} | [
-1.0378923416137695,
0.21805493533611298,
0.39702320098876953,
-0.43606889247894287,
0.3017176389694214,
1.2376413345336914,
0.037828151136636734,
0.3360040783882141,
0.37824180722236633,
0.25754234194755554,
-0.3654685616493225,
-0.35226109623908997,
-0.6042944192886353,
1.232681512832641... |
func (c *Config) SetNsFlags(flags int) {
c.config.nsFlags = C.uint(flags)
} | [
-0.040500227361917496,
1.0109227895736694,
0.2409471720457077,
0.1829577535390854,
0.42796099185943604,
0.46248456835746765,
-0.0019592908211052418,
-0.07249864190816879,
-0.13198301196098328,
-0.9098265171051025,
-2.7221453189849854,
0.1441708356142044,
-0.4025792181491852,
1.621190071105... |
func (c *Config) SetNsFlagsFromSpec(namespaces []specs.LinuxNamespace) {
c.config.nsFlags = 0
for _, namespace := range namespaces {
switch namespace.Type {
case specs.UserNamespace:
c.config.nsFlags |= syscall.CLONE_NEWUSER
case specs.IPCNamespace:
c.config.nsFlags |= syscall.CLONE_NEWIPC
case specs.UT... | [
0.6605840921401978,
0.13921214640140533,
0.44343313574790955,
0.033362921327352524,
0.20673109591007233,
0.46050703525543213,
-0.0953366681933403,
-0.44676122069358826,
0.155837282538414,
-0.39128538966178894,
-1.048762321472168,
0.3273373246192932,
-0.11428473889827728,
2.372661590576172,... |
func (c *Config) SetNsPath(nstype specs.LinuxNamespaceType, path string) {
nullified := path + "\x00"
switch nstype {
case specs.UserNamespace:
c.config.userNsPathOffset = C.off_t(len(c.nsPath))
case specs.IPCNamespace:
c.config.ipcNsPathOffset = C.off_t(len(c.nsPath))
case specs.UTSNamespace:
c.config.utsN... | [
0.18854579329490662,
-0.27931055426597595,
0.3827345669269562,
-0.10764776170253754,
-0.2113640308380127,
0.5307146310806274,
-0.28447964787483215,
-0.5616340041160583,
0.2627119719982147,
-0.06088140979409218,
-1.0426188707351685,
0.25016725063323975,
-0.14317798614501953,
0.9093383550643... |
func (c *Config) SetNsPathFromSpec(namespaces []specs.LinuxNamespace) {
for _, namespace := range namespaces {
nullified := namespace.Path + "\x00"
switch namespace.Type {
case specs.UserNamespace:
c.config.userNsPathOffset = C.off_t(len(c.nsPath))
case specs.IPCNamespace:
c.config.ipcNsPathOffset = C.o... | [
0.5001492500305176,
-0.5878022313117981,
0.36774760484695435,
-0.027405494824051857,
0.07602553069591522,
0.7283377051353455,
0.10677224397659302,
-0.23360927402973175,
0.31313860416412354,
0.11274654418230057,
-0.5070751309394836,
-0.026117410510778427,
0.2400585561990738,
1.4093099832534... |
func (c *Config) SetCapabilities(ctype string, caps []string) {
switch ctype {
case capabilities.Permitted:
c.config.capPermitted = 0
for _, v := range caps {
c.config.capPermitted |= C.ulonglong(1 << capabilities.Map[v].Value)
}
case capabilities.Effective:
c.config.capEffective = 0
for _, v := range c... | [
-1.08832585811615,
-0.49960869550704956,
0.6448193192481995,
-0.07608382403850555,
-0.11708665639162064,
0.24627918004989624,
-0.015794139355421066,
0.6065335273742676,
-0.23699289560317993,
0.7897870540618896,
-0.7691082954406738,
0.024773532524704933,
-0.12910322844982147,
1.154582738876... |
func (m MongoManager) GetConcreteClient(id string) (*Client, error) {
collection := m.DB.C(mongo.CollectionClients).With(m.DB.Session.Copy())
defer collection.Database.Session.Close()
client := &Client{}
if err := collection.Find(bson.M{"_id": id}).One(client); err != nil {
if err == mgo.ErrNotFound {
return ... | [
0.5627442598342896,
-0.4450131356716156,
0.7497612237930298,
-0.4679166078567505,
0.1028481051325798,
-0.07535678148269653,
0.39184221625328064,
-0.4104519188404083,
0.013693210668861866,
-0.22066445648670197,
0.07442228496074677,
0.6539409756660461,
-0.5413703322410583,
-0.049080528318881... |
func (m MongoManager) GetClient(ctx context.Context, id string) (fosite.Client, error) {
return m.GetConcreteClient(id)
} | [
0.5826802253723145,
-0.1579929143190384,
0.3210625946521759,
-0.0893520787358284,
0.5094116926193237,
-0.4957091510295868,
0.1864357441663742,
-0.641239583492279,
0.5194547772407532,
-0.5095865726470947,
-0.045407555997371674,
0.3282146155834198,
-0.4437565505504608,
-0.5184741020202637,
... |
func (m MongoManager) GetClients() (clients map[string]Client, err error) {
clients = make(map[string]Client)
collection := m.DB.C(mongo.CollectionClients).With(m.DB.Session.Copy())
defer collection.Database.Session.Close()
var result *Client
iter := collection.Find(bson.M{}).Limit(100).Iter()
for iter.Next(&res... | [
-0.5653464198112488,
0.08002758771181107,
0.6100931167602539,
-0.3853338658809662,
0.5449008941650391,
-0.25102996826171875,
-0.2613406777381897,
-1.2758171558380127,
-0.6006020903587341,
0.3455159366130829,
-0.45591214299201965,
0.7788115739822388,
-0.5970845818519592,
0.5702106952667236,... |
func (m *MongoManager) CreateClient(c *Client) error {
if c.ID == "" {
c.ID = uuid.New()
}
// Hash incoming secret
h, err := m.Hasher.Hash(c.Secret)
if err != nil {
return errors.WithStack(err)
}
c.Secret = h
// Insert to Mongo
collection := m.DB.C(mongo.CollectionClients).With(m.DB.Session.Copy())
defe... | [
-0.18386918306350708,
0.5435982346534729,
0.674671471118927,
-0.1845197230577469,
1.0019701719284058,
0.9207258224487305,
0.3112286329269409,
-0.2770131230354309,
-0.30562475323677063,
0.7847662568092346,
-0.6821693778038025,
-0.5210213661193848,
-0.8797410726547241,
0.27643296122550964,
... |
func (m *MongoManager) UpdateClient(c *Client) error {
o, err := m.GetConcreteClient(c.ID)
if err != nil {
if err == fosite.ErrNotFound {
return err
}
return errors.WithStack(err)
}
// If the password isn't updated, grab it from the stored object
if string(c.Secret) == "" {
c.Secret = o.GetHashedSecret... | [
-0.3480702042579651,
-0.5345276594161987,
0.7864327430725098,
-0.08043567836284637,
-0.0184423066675663,
-0.1856260597705841,
0.15124355256557465,
-0.239918515086174,
0.19198380410671234,
0.6837366819381714,
-0.44502249360084534,
0.38321051001548767,
-0.7579717636108398,
0.2088047564029693... |
func (m *MongoManager) DeleteClient(id string) error {
collection := m.DB.C(mongo.CollectionClients).With(m.DB.Session.Copy())
defer collection.Database.Session.Close()
if err := collection.Remove(bson.M{"_id": id}); err != nil {
if err == mgo.ErrNotFound {
return fosite.ErrNotFound
}
return errors.WithSta... | [
-0.37612688541412354,
-0.3433120846748352,
0.32798057794570923,
-0.5554444789886475,
0.0921642854809761,
0.08519569784402847,
0.42903342843055725,
-0.887255072593689,
-0.1309821605682373,
-0.05938331037759781,
-0.4519874155521393,
0.4250867962837219,
-0.9141707420349121,
0.6855701804161072... |
func (m MongoManager) Authenticate(id string, secret []byte) (*Client, error) {
c, err := m.GetConcreteClient(id)
if err != nil {
return nil, errors.WithStack(err)
}
if err := m.Hasher.Compare(c.GetHashedSecret(), secret); err != nil {
return nil, errors.WithStack(err)
}
return c, nil
} | [
0.43061769008636475,
-0.14209163188934326,
0.6003031134605408,
0.8063890933990479,
0.3920958936214447,
-0.645572304725647,
-0.6637035012245178,
-1.1432939767837524,
-0.3676013648509979,
0.27519023418426514,
0.20942848920822144,
0.2139580249786377,
-1.1412428617477417,
-0.25628313422203064,... |
func CopyDirectory(sourceDirName, destDirName string) error {
children, err := ioutil.ReadDir(sourceDirName)
if err != nil {
return err
}
for _, child := range children {
sourcePath := fmt.Sprintf("%v/%v", sourceDirName, child.Name())
destPath := fmt.Sprintf("%v/%v", destDirName, child.Name())
if child.IsDi... | [
-0.4408411383628845,
-0.25210094451904297,
0.9775338768959045,
-0.22583162784576416,
-0.10201942175626755,
0.019941413775086403,
1.045692801475525,
-0.08358237892389297,
0.025397170335054398,
0.6312397718429565,
-0.09910820424556732,
0.2623273432254791,
0.7812749147415161,
0.46576139330863... |
func RemoveEmptyDirectory(path string) {
} | [
-0.6554805040359497,
-0.6678359508514404,
0.3923163414001465,
0.16470983624458313,
-0.36332565546035767,
-0.36934781074523926,
1.452649474143982,
0.3474580943584442,
0.5977709889411926,
-0.9629809856414795,
-0.4355854392051697,
0.03542511537671089,
-0.3523901104927063,
0.3025931715965271,
... |
func IsValidPkgNameList(pkglist string) bool {
for _, name := range strings.Split(pkglist, ",") {
if !IsValidPkgName(name) {
return false
}
}
return true
} | [
-1.4033349752426147,
0.11532456427812576,
0.2684022784233093,
0.9311093688011169,
-0.5536954402923584,
0.4209243059158325,
-1.407568335533142,
0.4711804986000061,
0.514350414276123,
0.5315305590629578,
-1.0963517427444458,
-1.1840579509735107,
-0.8338595032691956,
0.8803103566169739,
-1.... |
func (c *Client) DescribeStreamProcessor(ctx context.Context, params *DescribeStreamProcessorInput, optFns ...func(*Options)) (*DescribeStreamProcessorOutput, error) {
if params == nil {
params = &DescribeStreamProcessorInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeStreamProcessor", params, o... | [
-1.2499628067016602,
0.5747835636138916,
0.8497186303138733,
-0.5712913274765015,
-0.5695962309837341,
-0.7910184264183044,
0.6318758726119995,
-0.9298200607299805,
0.21198488771915436,
0.4022606909275055,
-0.049754947423934937,
2.231433153152466,
-0.75511634349823,
0.4366835057735443,
-... |
func (f *Fills) Setup(fillsFeedEnabled bool, c chan interface{}) {
f.dataHandler = c
f.fillsFeedEnabled = fillsFeedEnabled
} | [
0.9792046546936035,
-0.03649401664733887,
0.4388585388660431,
-1.298275113105774,
-0.14445605874061584,
0.788280189037323,
0.5305376052856445,
0.2942638397216797,
0.243538036942482,
-1.3931242227554321,
-0.883770763874054,
0.28008443117141724,
-0.2469763457775116,
1.0027151107788086,
-0.... |
func (f *Fills) Update(data ...Data) error {
if len(data) == 0 {
// nothing to do
return nil
}
if !f.fillsFeedEnabled {
return ErrFeedDisabled
}
f.dataHandler <- data
return nil
} | [
0.5272648930549622,
-0.02558637596666813,
0.4937410354614258,
-0.5264707207679749,
-0.09788960963487625,
1.1929742097854614,
-0.060850273817777634,
-0.03585200011730194,
-0.32441815733909607,
-1.3839489221572876,
-0.012277983129024506,
-0.04710996150970459,
-0.7903116345405579,
0.512810349... |
func StringParaseWith_(str string) string {
var buffer bytes.Buffer
for i, s := range str {
if s >= 65 && s <= 90 && i != 0 {
buffer.WriteByte('_')
buffer.WriteRune(s)
continue
}
buffer.WriteRune(s)
}
fmt.Println("--------------name-----",strings.ToLower(buffer.String()))
return strings... | [
0.23484741151332855,
-1.1242588758468628,
0.9251630306243896,
-1.4319428205490112,
-1.226670265197754,
0.06538617610931396,
-0.8503379821777344,
-1.4791961908340454,
-0.4365578591823578,
0.9487859010696411,
-0.08531588315963745,
0.2585841417312622,
-0.06300473213195801,
-0.3751379549503326... |
func NumberOfContainer(object interface{}) int {
typ := reflect.TypeOf(object)
numField := typ.Elem().NumField()
return numField
} | [
-0.7483401894569397,
0.43964195251464844,
0.7989568710327148,
0.05039781332015991,
-0.09441618621349335,
-0.7012994289398193,
1.5944600105285645,
-0.8623160123825073,
0.9564682245254517,
-0.5403929352760315,
-1.653241515159607,
-0.49497273564338684,
0.6559596657752991,
0.5376092791557312,
... |
func (c SpanContext) ForeachBaggageItem(handler func(k, v string) bool) {} | [
-0.1907273381948471,
-0.5540665984153748,
0.31122609972953796,
1.0740687847137451,
0.03969012573361397,
1.2948883771896362,
0.5680003762245178,
-0.7818819880485535,
-0.8334947824478149,
-0.05824883654713631,
-1.093367099761963,
-0.2532745897769928,
0.24146640300750732,
0.7400716543197632,
... |
func NewKubeTestPlatform() *KubeTestPlatform {
return &KubeTestPlatform{
AppResources: new(TestResources),
ComponentResources: new(TestResources),
Secrets: new(TestResources),
}
} | [
0.3532143235206604,
-1.2862718105316162,
-0.025471996515989304,
-0.8122137188911438,
0.19655491411685944,
-0.7915911078453064,
-0.32212623953819275,
-1.7426291704177856,
0.8603417873382568,
-0.6144683361053467,
-0.6273719668388367,
-0.3788800835609436,
-1.3388066291809082,
-0.0238989274948... |
func (c *KubeTestPlatform) AddComponents(comps []kube.ComponentDescription) error {
if c.KubeClient == nil {
return fmt.Errorf("kubernetes cluster needs to be setup")
}
for _, comp := range comps {
c.ComponentResources.Add(kube.NewDaprComponent(c.KubeClient, getNamespaceOrDefault(comp.Namespace), comp))
}
//... | [
-0.6111893653869629,
-0.24508735537528992,
0.45852088928222656,
-1.171005368232727,
1.1451363563537598,
0.912325918674469,
-0.40848517417907715,
-0.45876753330230713,
1.0317083597183228,
-0.49549874663352966,
0.8198347687721252,
-0.15485356748104095,
-1.3171323537826538,
0.6569271087646484... |
func (c *KubeTestPlatform) AddSecrets(secrets []kube.SecretDescription) error {
if c.KubeClient == nil {
return fmt.Errorf("kubernetes cluster needs to be setup")
}
for _, secret := range secrets {
c.Secrets.Add(kube.NewSecret(c.KubeClient, secret.Namespace, secret.Name, secret.Data))
}
// setup secret resou... | [
-0.17571577429771423,
0.34184888005256653,
0.3322066366672516,
0.4284314513206482,
1.1350263357162476,
0.8416053056716919,
-0.5769773721694946,
-0.9708410501480103,
0.016984211280941963,
-0.06328065693378448,
0.2194298654794693,
-0.12684039771556854,
-0.9293884634971619,
1.0871151685714722... |
func (c *KubeTestPlatform) AddApps(apps []kube.AppDescription) error {
if c.KubeClient == nil {
return fmt.Errorf("kubernetes cluster needs to be setup before calling BuildAppResources")
}
dt := c.disableTelemetry()
namespaces := make(map[string]struct{}, 0)
for _, app := range apps {
if app.RegistryName == ... | [
0.28541016578674316,
-0.3261263966560364,
0.46256422996520996,
0.055467721074819565,
-0.27817875146865845,
0.4543306529521942,
-0.34531083703041077,
-0.38785988092422485,
0.5858890414237976,
0.19343693554401398,
0.7386380434036255,
-0.26275208592414856,
-0.6338000893592834,
1.0408493280410... |
func (c *KubeTestPlatform) GetOrCreateNamespace(parentCtx context.Context, namespace string) (*corev1.Namespace, error) {
log.Printf("Checking namespace %q ...", namespace)
namespaceClient := c.KubeClient.Namespaces()
ctx, cancel := context.WithTimeout(parentCtx, 30*time.Second)
ns, err := namespaceClient.Get(ctx, ... | [
-0.11920148134231567,
0.4278983473777771,
0.683158814907074,
-0.30009031295776367,
0.42836564779281616,
0.08043020218610764,
-0.07535194605588913,
-1.2958335876464844,
1.1400941610336304,
-0.4078391194343567,
0.49835848808288574,
-0.07876156270503998,
-1.0900250673294067,
0.674105823040008... |
func (c *KubeTestPlatform) AcquireAppExternalURL(name string) string {
app := c.AppResources.FindActiveResource(name)
return app.(*kube.AppManager).AcquireExternalURL()
} | [
0.41335320472717285,
-0.6535288691520691,
0.36428022384643555,
0.39668235182762146,
-0.7954750657081604,
0.815531313419342,
-1.0322860479354858,
-0.6381224393844604,
-0.11851483583450317,
0.45637115836143494,
0.39505448937416077,
0.10085584223270416,
0.1119849756360054,
0.7364825010299683,... |
func (c *KubeTestPlatform) GetAppHostDetails(name string) (string, string, error) {
app := c.AppResources.FindActiveResource(name)
pods, err := app.(*kube.AppManager).GetHostDetails()
if err != nil {
return "", "", err
}
if len(pods) == 0 {
return "", "", fmt.Errorf("no pods found for app: %v", name)
}
ret... | [
0.21074633300304413,
-0.7707915306091309,
0.6344878077507019,
0.12255728989839554,
-0.9858563542366028,
0.27777519822120667,
-0.8108396530151367,
-1.123456358909607,
-0.264013409614563,
0.6256698966026306,
0.13840624690055847,
-0.3606985807418823,
0.6681771874427795,
0.5996663570404053,
... |
func (c *KubeTestPlatform) Scale(name string, replicas int32) error {
app := c.AppResources.FindActiveResource(name)
appManager := app.(*kube.AppManager)
if err := appManager.ScaleDeploymentReplica(replicas); err != nil {
return err
}
_, err := appManager.WaitUntilDeploymentState(appManager.IsDeploymentDone)
... | [
-0.20189398527145386,
-0.2901315987110138,
0.5690024495124817,
-0.2846251428127289,
-0.4684201180934906,
0.7184481620788574,
-0.6469384431838989,
-0.14433234930038452,
-0.12768474221229553,
1.7625682353973389,
0.3624696433544159,
-0.17892234027385712,
-0.5900660753250122,
0.399267852306365... |
func (c *KubeTestPlatform) SetAppEnv(name, key, value string) error {
app := c.AppResources.FindActiveResource(name)
appManager := app.(*kube.AppManager)
if err := appManager.SetAppEnv(key, value); err != nil {
return err
}
if _, err := appManager.WaitUntilDeploymentState(appManager.IsDeploymentDone); err != n... | [
0.05261653661727905,
-0.615408182144165,
0.6577016115188599,
0.2312929332256317,
-0.5707101225852966,
0.5915678143501282,
-0.38399046659469604,
-0.4878271818161011,
-0.35476842522621155,
1.1671993732452393,
0.17718349397182465,
0.34358102083206177,
0.017801925539970398,
1.317557692527771,
... |
func (c *KubeTestPlatform) Restart(name string) error {
// To minic the restart behavior, scale to 0 and then scale to the original replicas.
app := c.AppResources.FindActiveResource(name)
m := app.(*kube.AppManager)
originalReplicas := m.App().Replicas
if err := c.Scale(name, 0); err != nil {
return err
}
i... | [
0.2646315097808838,
-0.36010363698005676,
0.735869288444519,
0.2086346447467804,
-0.43636828660964966,
-0.012200853787362576,
-0.11054094135761261,
-0.546202540397644,
0.09049052745103836,
0.6767567992210388,
0.1606506109237671,
0.42042940855026245,
-0.7111033797264099,
0.5630632638931274,... |
func (c *KubeTestPlatform) PortForwardToApp(appName string, targetPorts ...int) ([]int, error) {
app := c.AppResources.FindActiveResource(appName)
appManager := app.(*kube.AppManager)
_, err := appManager.WaitUntilDeploymentState(appManager.IsDeploymentDone)
if err != nil {
return nil, err
}
if targetPorts ==... | [
0.06330066174268723,
-0.16740959882736206,
0.6488223075866699,
-0.2067660540342331,
0.16356965899467468,
0.630851149559021,
-0.2954617142677307,
-0.43420374393463135,
-0.34487029910087585,
0.8847318291664124,
0.9610087871551514,
0.09688514471054077,
-0.16091537475585938,
-0.451460629701614... |
func (c *KubeTestPlatform) GetAppUsage(appName string) (*AppUsage, error) {
app := c.AppResources.FindActiveResource(appName)
appManager := app.(*kube.AppManager)
cpu, mem, err := appManager.GetCPUAndMemory(false)
if err != nil {
return nil, err
}
return &AppUsage{
CPUm: cpu,
MemoryMb: mem,
}, nil
} | [
0.47734442353248596,
-0.5007286667823792,
0.5035194754600525,
0.21840040385723114,
-0.6634884476661682,
-0.2530573010444641,
-0.3025977313518524,
-0.8642526268959045,
0.13993223011493683,
0.6348000764846802,
1.010054349899292,
0.08179544657468796,
-1.1662994623184204,
0.5460816621780396,
... |
func (c *KubeTestPlatform) GetTotalRestarts(appName string) (int, error) {
app := c.AppResources.FindActiveResource(appName)
appManager := app.(*kube.AppManager)
return appManager.GetTotalRestarts()
} | [
0.8136040568351746,
-0.23149478435516357,
0.663797914981842,
-0.6756749749183655,
0.17442622780799866,
-0.5078222155570984,
-0.16142192482948303,
-0.48378634452819824,
0.6758416891098022,
0.39380088448524475,
-0.27881166338920593,
-0.5476527214050293,
-1.1349446773529053,
-0.42188543081283... |
func (c *KubeTestPlatform) GetSidecarUsage(appName string) (*AppUsage, error) {
app := c.AppResources.FindActiveResource(appName)
appManager := app.(*kube.AppManager)
cpu, mem, err := appManager.GetCPUAndMemory(true)
if err != nil {
return nil, err
}
return &AppUsage{
CPUm: cpu,
MemoryMb: mem,
}, nil
... | [
0.5812985897064209,
-0.055532071739435196,
0.6981410384178162,
-0.07288987934589386,
-1.2199029922485352,
-0.30294543504714966,
-0.3941264748573303,
-0.8152623772621155,
-0.3505321741104126,
0.27785828709602356,
0.4867841899394989,
0.31871798634529114,
-1.6096248626708984,
0.50792962312698... |
func (c *KubeTestPlatform) GetConfiguration(name string) (*configurationv1alpha1.Configuration, error) {
client := c.KubeClient.DaprClientSet.ConfigurationV1alpha1().Configurations(kube.DaprTestNamespace)
return client.Get(name, metav1.GetOptions{})
} | [
-0.7509205341339111,
0.18408392369747162,
0.2825280427932739,
0.03514661639928818,
0.09119895100593567,
-0.9030106663703918,
0.36317846179008484,
-1.0581679344177246,
0.44405004382133484,
0.5060077905654907,
-0.18019568920135498,
-0.08123509585857391,
-0.7426647543907166,
0.450625360012054... |
func main() {
var (
perimeter int
width, height = 5, 6
)
perimeter = 2 * (width + height)
fmt.Println("perimeter =", perimeter)
} | [
0.2541969418525696,
-0.8644097447395325,
0.4703959822654724,
0.4614582359790802,
-0.45305612683296204,
-0.1261400729417801,
0.6687179803848267,
0.030134357511997223,
0.1915191262960434,
-0.30209881067276,
-0.9500693082809448,
0.10235770046710968,
-1.0289280414581299,
0.36185020208358765,
... |
func getTokens(clientID, clientSecret, code string) (resp oauth2.TokenResponse, err error) {
client, err := oidc.NewClient(oidcClientConfig)
if err != nil {
return
}
oauth2Client, err := client.OAuthClient()
if err != nil {
return
}
return oauth2Client.RequestToken(oauth2.GrantTypeAuthCode, code)
} | [
-0.20502473413944244,
0.24929256737232208,
0.4274906814098358,
-0.463931143283844,
0.5349858999252319,
-1.096168041229248,
-0.19187474250793457,
-1.2475310564041138,
1.0718024969100952,
0.2938510775566101,
0.10221504420042038,
1.5407228469848633,
-0.6102563142776489,
-0.3776436150074005,
... |
func (wp *workerPool) StopJobs(jobs []int64) {
log.Debugf("Works working on jobs: %v will be stopped", jobs)
for _, id := range jobs {
for _, w := range wp.workerList {
if w.SM.JobID == id {
log.Debugf("found a worker whose job ID is %d, will try to stop it", id)
w.SM.Stop(id)
}
}
}
} | [
-1.023925542831421,
-0.34382545948028564,
0.1776915192604065,
-0.2935464084148407,
0.004891376942396164,
0.23326504230499268,
0.22729399800300598,
-0.5501819849014282,
-0.4105467200279236,
0.028569074347615242,
-0.36709100008010864,
-0.1279384344816208,
-1.3756486177444458,
0.6294536590576... |
func (w *Worker) Start() {
go func() {
for {
WorkerPool.workerChan <- w
select {
case jobID := <-w.RepJobs:
log.Debugf("worker: %d, will handle job: %d", w.ID, jobID)
w.handleRepJob(jobID)
case q := <-w.quit:
if q {
log.Debugf("worker: %d, will stop.", w.ID)
return
}
}
}
}... | [
-0.16331635415554047,
-0.31006351113319397,
0.3124121129512787,
-0.5311164855957031,
0.13883082568645477,
0.4090203046798706,
0.7797956466674805,
0.039973605424165726,
-0.5377930998802185,
-0.1604115068912506,
-0.9970462322235107,
0.7145689129829407,
0.12052328884601593,
0.4138966500759125... |
func NewWorker(id int) *Worker {
w := &Worker{
ID: id,
RepJobs: make(chan int64),
quit: make(chan bool),
SM: &SM{},
}
w.SM.Init()
return w
} | [
-0.3174978494644165,
-0.05465665087103844,
0.24482782185077667,
-0.001432756776921451,
-0.7847967743873596,
0.0406833179295063,
0.17073379456996918,
-0.6127848625183105,
0.7791504859924316,
-0.2706783413887024,
-1.153767704963684,
0.39029696583747864,
-0.0781753659248352,
0.734151363372802... |
func InitWorkerPool() {
WorkerPool = &workerPool{
workerChan: make(chan *Worker, config.MaxJobWorkers()),
workerList: make([]*Worker, 0, config.MaxJobWorkers()),
}
for i := 0; i < config.MaxJobWorkers(); i++ {
worker := NewWorker(i)
WorkerPool.workerList = append(WorkerPool.workerList, worker)
worker.Start... | [
-0.3671126365661621,
0.16879351437091827,
0.33299359679222107,
0.41614559292793274,
0.23229314386844635,
0.23595423996448517,
0.651593804359436,
0.4191269278526306,
-0.28669556975364685,
0.12081778049468994,
-1.9854521751403809,
0.7914167642593384,
-0.6007120013237,
0.7631458640098572,
-... |
func Dispatch() {
for {
select {
case job := <-jobQueue:
go func(jobID int64) {
log.Debugf("Trying to dispatch job: %d", jobID)
worker := <-WorkerPool.workerChan
worker.RepJobs <- jobID
}(job)
}
}
} | [
0.0888996347784996,
-0.5677006244659424,
0.3403059244155884,
-0.8300769925117493,
0.6963908076286316,
0.09787629544734955,
-0.14568579196929932,
0.060835666954517365,
-0.0772080272436142,
-0.025941437110304832,
-1.258400559425354,
0.9331455826759338,
0.24091675877571106,
0.7231552004814148... |
func GetKamReleaseSummaryPackageTypeEnumValues() []KamReleaseSummaryPackageTypeEnum {
values := make([]KamReleaseSummaryPackageTypeEnum, 0)
for _, v := range mappingKamReleaseSummaryPackageType {
values = append(values, v)
}
return values
} | [
-0.7607854008674622,
0.16781176626682281,
0.7491105794906616,
0.9591355323791504,
-0.36332884430885315,
-0.10013899207115173,
-0.17537175118923187,
0.8685811758041382,
0.7501790523529053,
1.42843759059906,
-0.5451070070266724,
-0.45356565713882446,
0.18714645504951477,
0.35270288586616516,... |
func NewRequestService(ctx context.Context, wg *sync.WaitGroup, channel *models.Channel, host string) *RequestService {
router := NewRouter(channel)
return &RequestService{ctx, wg, host, router}
} | [
-1.022445797920227,
-0.2784063220024109,
0.2935659885406494,
0.12186183780431747,
0.0809728130698204,
0.18945863842964172,
-1.4289040565490723,
-0.7958959341049194,
-0.2156488448381424,
-0.29805776476860046,
0.1124727725982666,
1.0886836051940918,
-0.9718371629714966,
-0.13082768023014069,... |
func VisitAll(algorithm Algorithm, root *html.Node, fn func(*html.Node)) {
if algorithm == BreadthFirst {
bfs(root, fn)
return
}
dfs(root, fn)
} | [
0.24287228286266327,
0.877788782119751,
0.7169445753097534,
0.7589529156684875,
-0.4412965178489685,
-0.5808087587356567,
-0.039442360401153564,
0.837949275970459,
0.14709070324897766,
0.07718054950237274,
0.5533719062805176,
1.5943474769592285,
0.6062718629837036,
1.4635387659072876,
-0... |
func GetMessagesV2(ctx context.Context, queryParameters QueryParameters) []*models.MessageV2 {
return GetMessagesV2WithParameter(ctx, queryParameters)
} | [
-0.6605507731437683,
-0.3270733058452606,
0.41873615980148315,
0.1743917465209961,
0.5195979475975037,
-0.6243311166763306,
-0.6548999547958374,
-0.6545312404632568,
-0.18514539301395416,
0.22586405277252197,
-0.22347351908683777,
0.7730880975723267,
-0.47023746371269226,
0.470241665840148... |
func NewExpr(name, source string, expr expression.Expr) *Expr {
return &Expr{
source: source,
Expr: expr,
Name: name,
}
} | [
0.39211875200271606,
-0.5464575290679932,
0.19628342986106873,
0.40178701281547546,
-2.0003268718719482,
-0.9035301804542542,
-1.5200685262680054,
0.7141419053077698,
0.14516054093837738,
0.28314200043678284,
-0.22173573076725006,
1.103387713432312,
0.17018459737300873,
-0.0412751585245132... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.