text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (_m *EducationBackend) GetEducationUser(ctx context.Context, nameOrID string) (*libregraph.EducationUser, error) {
ret := _m.Called(ctx, nameOrID)
var r0 *libregraph.EducationUser
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) (*libregraph.EducationUser, error)); ok {
return rf(ctx, nam... | [
-0.9174484610557556,
-0.15525498986244202,
0.6905066967010498,
0.20647412538528442,
-1.0631067752838135,
-0.35508668422698975,
0.95450758934021,
-0.45362332463264465,
0.4821151793003082,
-0.2149830013513565,
-0.8760733604431152,
-0.20296913385391235,
0.43495485186576843,
0.8683966398239136... |
func (_m *EducationBackend) GetEducationUsers(ctx context.Context) ([]*libregraph.EducationUser, error) {
ret := _m.Called(ctx)
var r0 []*libregraph.EducationUser
var r1 error
if rf, ok := ret.Get(0).(func(context.Context) ([]*libregraph.EducationUser, error)); ok {
return rf(ctx)
}
if rf, ok := ret.Get(0).(fu... | [
-1.283018946647644,
0.5858167409896851,
0.5802074670791626,
0.7393943667411804,
-0.6627758145332336,
0.12116117775440216,
1.2158399820327759,
-0.04559427872300148,
0.4936825633049011,
0.060313016176223755,
-0.3846968412399292,
0.2931400537490845,
0.12770210206508636,
0.5679718255996704,
... |
func (_m *EducationBackend) RemoveClassFromEducationSchool(ctx context.Context, schoolNumberOrID string, memberID string) error {
ret := _m.Called(ctx, schoolNumberOrID, memberID)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
r0 = rf(ctx, schoolNumberOrID, memberID)
} e... | [
-0.6814689636230469,
-0.2775833010673523,
0.3773680627346039,
0.8683850765228271,
-0.46667641401290894,
0.017102083191275597,
1.0566850900650024,
-0.13534663617610931,
0.12842422723770142,
-0.4782152473926544,
0.03507723659276962,
-0.5367858409881592,
0.002334833610802889,
0.31132799386978... |
func (_m *EducationBackend) RemoveTeacherFromEducationClass(ctx context.Context, classID string, teacherID string) error {
ret := _m.Called(ctx, classID, teacherID)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
r0 = rf(ctx, classID, teacherID)
} else {
r0 = ret.Error(... | [
-1.0679168701171875,
-0.1668524146080017,
0.31164485216140747,
0.898347020149231,
-1.0158488750457764,
0.25185126066207886,
0.7724939584732056,
0.799208402633667,
-0.13672345876693726,
0.7458532452583313,
0.0076062665320932865,
-0.013001919724047184,
-0.26872000098228455,
0.841878354549408... |
func (_m *EducationBackend) RemoveUserFromEducationSchool(ctx context.Context, schoolID string, memberID string) error {
ret := _m.Called(ctx, schoolID, memberID)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
r0 = rf(ctx, schoolID, memberID)
} else {
r0 = ret.Error(0)... | [
0.0723450630903244,
-0.3402966856956482,
0.27731046080589294,
1.316719651222229,
-0.5162760019302368,
0.13416999578475952,
1.4176852703094482,
-0.09751973301172256,
-0.01023658737540245,
-0.2128542810678482,
-0.2788902521133423,
-0.1279849112033844,
-0.4983316957950592,
-0.1148468479514122... |
func (_m *EducationBackend) UpdateEducationClass(ctx context.Context, id string, class libregraph.EducationClass) (*libregraph.EducationClass, error) {
ret := _m.Called(ctx, id, class)
var r0 *libregraph.EducationClass
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, libregraph.EducationClass) (... | [
-1.2542775869369507,
-0.34849807620048523,
0.5386470556259155,
0.28657954931259155,
-1.1055344343185425,
0.23275603353977203,
0.669629693031311,
0.1325400024652481,
0.736067533493042,
0.24248431622982025,
-0.5035887360572815,
-0.362728476524353,
0.4937945008277893,
0.3013036549091339,
0.... |
func (_m *EducationBackend) UpdateEducationSchool(ctx context.Context, numberOrID string, school libregraph.EducationSchool) (*libregraph.EducationSchool, error) {
ret := _m.Called(ctx, numberOrID, school)
var r0 *libregraph.EducationSchool
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, libreg... | [
-0.897642970085144,
-0.6949993968009949,
0.3892190754413605,
0.4107082188129425,
-0.4872991740703583,
-0.2991158962249756,
1.0581765174865723,
-0.2411467432975769,
0.7922366857528687,
0.0013732651714235544,
-0.2431555837392807,
-0.01845833659172058,
0.7602340579032898,
-0.15243804454803467... |
func (_m *EducationBackend) UpdateEducationUser(ctx context.Context, nameOrID string, user libregraph.EducationUser) (*libregraph.EducationUser, error) {
ret := _m.Called(ctx, nameOrID, user)
var r0 *libregraph.EducationUser
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, libregraph.EducationUs... | [
-1.3619807958602905,
-0.5460976362228394,
0.6501697301864624,
0.5719372630119324,
-1.6333168745040894,
-0.09212649613618851,
1.201767086982727,
-0.16006162762641907,
0.2490289807319641,
0.123637855052948,
-0.9798719882965088,
-0.5263431072235107,
0.14332051575183868,
0.6256760358810425,
... |
func NewEducationBackend(t mockConstructorTestingTNewEducationBackend) *EducationBackend {
mock := &EducationBackend{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
} | [
-0.6897888779640198,
-0.18134799599647522,
0.13546974956989288,
0.5161367058753967,
-0.18654261529445648,
0.3169429898262024,
0.8485233187675476,
-0.001379817258566618,
0.20018230378627777,
0.8630750179290771,
-0.4568810760974884,
-0.6126852631568909,
0.2171635776758194,
0.9861730337142944... |
func (t *Thread) ToMessagesTree() *MessagesTree {
tree := make(MessagesTree)
for _, v := range t.Messages {
tree.Insert(v)
}
return &tree
} | [
0.3359984755516052,
0.10655435174703598,
0.5806032419204712,
-1.0426708459854126,
0.05003158003091812,
-0.23602303862571716,
-0.25062957406044006,
-1.4861868619918823,
0.48123326897621155,
0.5508100390434265,
-0.2633601129055023,
-0.2547549307346344,
-1.027204155921936,
0.8689656853675842,... |
func (t MessagesTree) Insert(m Message) {
d := m.Date
if t[d.Year()] == nil {
t[d.Year()] = make(year)
}
if t[d.Year()][d.Month()] == nil {
t[d.Year()][d.Month()] = make(month)
}
t[d.Year()][d.Month()][d.Day()] = append(t[d.Year()][d.Month()][d.Day()], m)
} | [
-0.5958026647567749,
0.8759050965309143,
0.7948793768882751,
-1.4050400257110596,
-0.5772063732147217,
0.3523918688297272,
0.426505982875824,
0.2314973622560501,
-0.8468835353851318,
0.5492659211158752,
-0.16084721684455872,
-0.02850620448589325,
-0.6069531440734863,
0.9432552456855774,
... |
func (t *MessagesTree) HTML(w io.Writer) error {
return tmpl.Execute(w, t)
} | [
-0.1567024290561676,
0.6145192384719849,
0.12203238159418106,
-0.05126827210187912,
0.4028787314891815,
0.16283194720745087,
0.8335952162742615,
0.002450811443850398,
-1.4533039331436157,
0.19193652272224426,
0.9758408069610596,
-0.169294536113739,
0.30422380566596985,
1.0641119480133057,
... |
func ParseJsonReq(v reflect.Value, req *http.Request) error {
return parseJsonReq(v, req)
} | [
-2.284965753555298,
-0.30449336767196655,
0.5032475590705872,
-0.15247108042240143,
-1.1326465606689453,
-0.8281200528144836,
-0.33342260122299194,
-0.4725914001464844,
-0.6326988935470581,
-0.09223273396492004,
-0.18447960913181305,
0.8355433940887451,
0.7687522172927856,
0.84063374996185... |
func SetDefaultRegistry(uri string) {
registryURI = uri
} | [
-0.9391595721244812,
0.9787803888320923,
0.1323355734348297,
-0.0743221715092659,
1.3722114562988281,
0.059790100902318954,
0.3626077473163605,
0.8293471932411194,
-0.18769320845603943,
-0.8151043653488159,
-0.8880897760391235,
0.5978514552116394,
-0.787990927696228,
1.0157361030578613,
... |
func InsecureRegistry(insecure bool) {
if insecure {
protocol = "http"
}
} | [
-0.21313129365444183,
1.037172794342041,
0.40950682759284973,
-0.17709843814373016,
0.5174166560173035,
0.6943418979644775,
0.1883152723312378,
0.3868273198604584,
-0.1636885106563568,
-0.0450940802693367,
-0.8464658856391907,
1.250939965248108,
-1.1912503242492676,
0.121332086622715,
-0... |
func ParseImageName(name string) (*Image, error) {
img := new(Image)
var err error
repo := strings.SplitN(name, "/", 2)
if len(repo) == 1 {
//no custom registry, using default one
img.Registry, err = getDefaultRegistry()
if err != nil {
return &Image{}, err
}
var imgName string
// get proper tag
i... | [
-0.13845683634281158,
-0.23038828372955322,
0.5482216477394104,
-0.09489459544420242,
-0.34289419651031494,
-0.5570749044418335,
-0.02393668331205845,
0.27760666608810425,
-0.018163960427045822,
0.8195067048072815,
-0.11422990262508392,
-0.3470151424407959,
0.09763611108064651,
0.793811023... |
func getTag(image string) (string, string) {
imgName := strings.SplitN(image, ":", 2)
if len(imgName) == 1 {
//no tag defined, using default
return imgName[0], "latest"
}
return imgName[0], imgName[1]
} | [
-0.5589674711227417,
-0.10157281905412674,
0.6437764763832092,
-0.09393683820962906,
1.0031707286834717,
-0.50281822681427,
-0.25020962953567505,
0.17842818796634674,
-0.8023190498352051,
0.7829286456108093,
-0.4025646448135376,
0.08526569604873657,
0.5432834029197693,
1.3686645030975342,
... |
func checkIfLibrary(image string) string {
//if image is from official docker registry and doesn't have username
//"library" should be added. Simplest test is checking if 2nd / is present
if strings.Contains(image, "/") {
// / is present nothing to add
return image
}
//we need to add "library"
return "library... | [
-0.14673936367034912,
-0.08359265327453613,
0.33334916830062866,
0.14579832553863525,
0.1821822077035904,
0.5278192162513733,
0.5516812801361084,
-0.33986660838127136,
0.8671330809593201,
0.2399744689464569,
1.2867450714111328,
-0.19324438273906708,
-0.36897313594818115,
1.7042406797409058... |
func (i *Image) getAuthToken() error {
//first we need to check response to GET /v2/ if we will get unauthorized then we will need to obtain token
resp, err := http.Get(protocol + "://" + i.Registry + "/v2/")
if err != nil {
return err
}
var realm, service string
if resp.StatusCode == http.StatusUnauthorized {
... | [
-0.7892910838127136,
-0.4305489659309387,
0.8412538170814514,
-0.7765934467315674,
0.046514008194208145,
-0.8678666353225708,
0.007525956723839045,
-0.025634890422225,
0.2887914776802063,
0.11551971733570099,
-0.08411183953285217,
1.2791131734848022,
0.29439231753349304,
0.4123986661434173... |
func maxProduct(nums []int) int {
res := nums[0]
for i, imax, imin := 1, res, res; i < len(nums); i++ {
if nums[i] < 0 {
imax, imin = imin, imax
}
imax = common.MaxInt(nums[i], nums[i]*imax)
imin = common.MinInt(nums[i], nums[i]*imin)
res = common.MaxInt(res, imax)
}
return res
} | [
-0.6891430616378784,
-0.1810750961303711,
0.7807072997093201,
0.41049712896347046,
-0.15575984120368958,
0.3182717561721802,
0.5499156713485718,
-0.6302372217178345,
1.3913811445236206,
0.04562557861208916,
0.30638137459754944,
-0.10826814919710159,
-1.0234520435333252,
-0.3545508086681366... |
func logWrap(c client.Client) client.Client {
return &logWrapper{c}
} | [
0.15422102808952332,
0.3440091609954834,
0.12769804894924164,
-0.18633294105529785,
-0.5688557028770447,
0.31787198781967163,
-0.8443530201911926,
-0.6730707287788391,
0.10336150974035263,
-0.2048068791627884,
-0.13103273510932922,
1.635007619857788,
0.32010433077812195,
-0.551802992820739... |
func (s *Rate) GetRates(ctx context.Context, req *rate.Request, rsp *rate.Result) error {
md, _ := metadata.FromContext(ctx)
traceID := md["traceID"]
if tr, ok := trace.FromContext(ctx); ok {
tr.LazyPrintf("traceID %s", traceID)
}
for _, hotelID := range req.HotelIds {
stay := stay{
HotelID: hotelID,
I... | [
0.09256814420223236,
0.9262520670890808,
0.48282429575920105,
0.2955818772315979,
0.832973837852478,
0.4574369788169861,
0.0552622489631176,
-0.8944244384765625,
0.22805115580558777,
0.5301131010055542,
-0.12310750782489777,
0.34004315733909607,
-1.0022740364074707,
0.2779657542705536,
-... |
func loadRateTable(path string) map[stay]*rate.RatePlan {
file := data.MustAsset("data/rates.json")
rates := []*rate.RatePlan{}
if err := json.Unmarshal(file, &rates); err != nil {
log.Fatalf("Failed to load json: %v", err)
}
rateTable := make(map[stay]*rate.RatePlan)
for _, ratePlan := range rates {
stay :... | [
-0.05369824916124344,
0.028271397575736046,
0.7925893068313599,
-0.9140862822532654,
-0.8826513290405273,
0.3844287395477295,
-0.21291781961917877,
-0.8827405571937561,
-0.6192281246185303,
1.2574448585510254,
-0.7294018268585205,
-0.022350778803229332,
-0.9304730296134949,
-0.514522016048... |
func main() {
flag.Parse()
// Load scenario
if scenario == defaultScenario {
log.Fatal("no scenario provided and no finder set")
}
scenario = strings.Replace(scenario, ".toml", "", 1)
viper.AddConfigPath(".")
viper.SetConfigName(scenario)
err := viper.ReadInConfig()
if err != nil {
log.Fatalf("./%s.toml: E... | [
0.7785717844963074,
0.12393379211425781,
0.9081475734710693,
0.5348364114761353,
-0.7223822474479675,
0.36503085494041443,
0.33418208360671997,
0.32222792506217957,
-0.6292409896850586,
0.3107987642288208,
0.4430391490459442,
0.3663724958896637,
0.20837260782718658,
0.09947162866592407,
... |
func DecodeHook(f, t reflect.Kind, data interface{}) (interface{}, error) {
if reflect.Slice != t {
switch f {
case reflect.Slice:
dataVal := reflect.ValueOf(data)
return dataVal.Interface().([]string)[0], nil
}
}
return data, nil
} | [
-0.47898274660110474,
0.1918153017759323,
0.7126068472862244,
-0.14954139292240143,
0.14431117475032806,
-0.1626044511795044,
-0.5770494341850281,
0.23441758751869202,
-0.6619901061058044,
0.600988507270813,
0.3401394486427307,
0.5470606088638306,
-0.05836942419409752,
0.2736279368400574,
... |
func Config(d interface{}) *mapstructure.DecoderConfig {
return &mapstructure.DecoderConfig{
DecodeHook: DecodeHook,
Result: d,
WeaklyTypedInput: true,
}
} | [
-0.4070976674556732,
0.21454952657222748,
0.20644159615039825,
-0.45649516582489014,
-1.032162070274353,
-0.34329116344451904,
0.37569209933280945,
0.7660300135612488,
0.489706814289093,
-1.1946345567703247,
-0.4965898394584656,
-0.32495206594467163,
0.4867750406265259,
1.441066026687622,
... |
func (t *transport) RoundTrip(req *http.Request) (resp *http.Response, err error) {
req.Header.Set("User-Agent", t.useragent)
return t.RoundTripper.RoundTrip(req)
} | [
-1.221053957939148,
-0.4940780997276306,
0.4898240566253662,
0.23476344347000122,
-0.1197165697813034,
-0.3025815486907959,
0.1457664668560028,
-0.3188655972480774,
0.5219033360481262,
0.22747479379177094,
0.1520974040031433,
-0.2500222623348236,
0.17922896146774292,
-0.7506779432296753,
... |
func NewReceiveOrderAPI(cli *soap.Client) ReceiveOrderAPI {
return &receiveOrderAPI{cli}
} | [
-0.7673707604408264,
-0.666700541973114,
0.4364299774169922,
-0.22118738293647766,
-0.05259140953421593,
-0.3376486301422119,
-0.19571180641651154,
-0.6413747668266296,
0.24900943040847778,
0.3306886553764343,
-0.6311594247817993,
-0.46287262439727783,
-0.5786239504814148,
0.54948341846466... |
func (p *receiveOrderAPI) ReceiveB2COrder(α *ReceiveB2COrder) (β *ReceiveB2COrderResponse, err error) {
γ := struct {
XMLName xml.Name `xml:"Envelope"`
Body struct {
M ReceiveB2COrderResponse `xml:"receiveB2COrderResponse"`
}
}{}
if err = p.cli.RoundTrip(α, &γ); err != nil {
return nil, err
}
retur... | [
-0.8083009719848633,
-0.9877312183380127,
0.6980958580970764,
-0.859722912311554,
0.12457159161567688,
-0.558440625667572,
-0.13073375821113586,
-1.1832222938537598,
-0.46115168929100037,
0.456977516412735,
-0.3795490860939026,
0.9917361736297607,
-0.7859827876091003,
0.9311569929122925,
... |
func (c *contentTypes) add(partName, contentType string) error {
// Process descrived in ISO/IEC 29500-2 §10.1.2.3
t, params, _ := mime.ParseMediaType(contentType)
contentType = mime.FormatMediaType(t, params)
ext := strings.ToLower(path.Ext(partName))
if len(ext) == 0 {
c.addOverride(partName, contentType)
r... | [
0.27065274119377136,
-1.0301393270492554,
0.6363205313682556,
-0.38158491253852844,
-0.2927505671977997,
-0.17695918679237366,
-0.6274057030677795,
-0.30625906586647034,
0.041791610419750214,
0.03020365722477436,
0.26866409182548523,
0.055748824030160904,
-1.5720055103302002,
0.22685022652... |
func CreateConfig(id, secret, token string) *aws.Config {
AnonymousCredentials := credentials.NewStaticCredentials(id, secret, token)
config := &aws.Config{
Region: aws.String("ap-southeast-1"),
Credentials: AnonymousCredentials,
}
return config
} | [
0.785307765007019,
-0.38042527437210083,
0.28199002146720886,
-0.6594802737236023,
-0.15402433276176453,
0.7200396656990051,
-1.8835846185684204,
0.32911136746406555,
0.04815937206149101,
0.6927817463874817,
-0.5531749129295349,
0.034495286643505096,
0.7582842111587524,
0.24128180742263794... |
func (suite *BinPackingTestSuite) TestInit() {
suite.Equal(3, len(rankers))
suite.NotNil(rankers[DeFrag])
suite.Equal(rankers[DeFrag].Name(), DeFrag)
suite.NotNil(rankers[FirstFit])
suite.Equal(rankers[FirstFit].Name(), FirstFit)
suite.NotNil(rankers[LoadAware])
suite.Equal(rankers[LoadAware].Name(), LoadAware)
... | [
-0.42966535687446594,
-0.1344490498304367,
0.5125271081924438,
-0.3693845272064209,
0.7159477472305298,
0.09167890250682831,
0.23090185225009918,
0.14476555585861206,
-0.45964208245277405,
-0.26723843812942505,
-0.9296635389328003,
0.20556415617465973,
-0.4863426089286804,
0.67908781766891... |
func (suite *BinPackingTestSuite) TestRegister() {
rankers[DeFrag] = nil
register(DeFrag, nil)
suite.Nil(rankers[DeFrag])
register(DeFrag, NewDeFragRanker)
suite.Nil(rankers[DeFrag])
delete(rankers, DeFrag)
register(DeFrag, NewDeFragRanker)
suite.NotNil(rankers[DeFrag])
} | [
-0.5268977284431458,
0.7803679704666138,
0.3469972312450409,
0.2525486648082733,
1.312851071357727,
-0.9982551336288452,
0.6352019309997559,
0.40141886472702026,
-0.4344523251056671,
-0.870613694190979,
-0.604065477848053,
0.31583866477012634,
-0.19778694212436676,
1.5365508794784546,
0.... |
func (suite *BinPackingTestSuite) TestGetRankerByName() {
ranker := GetRankerByName(DeFrag)
suite.NotNil(ranker)
suite.Equal(ranker.Name(), DeFrag)
ranker = GetRankerByName("Not_existing")
suite.Nil(ranker)
} | [
0.0001947394193848595,
0.07256197184324265,
0.42128199338912964,
0.4636833369731903,
0.9663243293762207,
-0.9523462653160095,
-0.26866963505744934,
0.017426108941435814,
-0.1422327607870102,
-0.09531297534704208,
-1.2252850532531738,
0.0012604299699887633,
-0.4576689302921295,
0.7927534580... |
func (suite *BinPackingTestSuite) TestGetRankers() {
result := GetRankers()
suite.Equal(3, len(result))
expectedNames := []string{DeFrag, FirstFit, LoadAware}
suite.Contains(expectedNames, result[0].Name())
suite.Contains(expectedNames, result[1].Name())
suite.Contains(expectedNames, result[2].Name())
} | [
-0.1368834376335144,
0.5157121419906616,
0.5478118658065796,
-0.05884923040866852,
1.0254520177841187,
-0.7425428628921509,
-0.25398045778274536,
0.11321915686130524,
-0.34971749782562256,
-0.26103171706199646,
-0.8169410228729248,
0.43466103076934814,
-0.9772996306419373,
0.27360069751739... |
func NewServiceInspectCommand(c cli.Interface) *cobra.Command {
return &cobra.Command{
Use: "inspect SERVICE",
Short: "Display detailed information of a service",
PreRunE: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return inspectService(c, args)
},
}
} | [
0.14714330434799194,
-0.10131718963384628,
0.38511955738067627,
-0.5487716794013977,
-0.4027571380138397,
-0.19973652064800262,
0.44419264793395996,
0.027385473251342773,
-0.44671720266342163,
-0.8632323145866394,
-0.12064861506223679,
0.7254621386528015,
-0.5522273182868958,
1.11311566829... |
func Solution(K int, A []int) int {
// write your code in Go 1.4
result := 0
tie := 0
for _, a := range A {
tie = tie + a
if tie >= K {
result++
tie = 0
}
}
return result
} | [
0.3582596182823181,
-0.0730006992816925,
0.5685104131698608,
0.6350821256637573,
-0.47767481207847595,
-0.5322427153587341,
0.6662456393241882,
0.3174690902233124,
-0.2787182629108429,
0.3501293361186981,
-0.5608212351799011,
0.32824036478996277,
0.05181817337870598,
0.4225345551967621,
... |
func (ring *ringBuffer) isFull() bool {
ring.mutex.Lock()
full := !ring.spaceReady
ring.mutex.Unlock()
return full
} | [
0.4861137568950653,
-0.20294289290905,
0.6133779287338257,
0.3664405941963196,
-0.21986372768878937,
0.39582106471061707,
0.1256309151649475,
-0.48522642254829407,
0.9566694498062134,
0.23008082807064056,
-1.4219354391098022,
-0.15522025525569916,
-0.7779373526573181,
0.4523530900478363,
... |
func (ring *ringBuffer) cancel() error {
ring.mutex.Lock()
defer ring.mutex.Unlock()
/* convert the reserved slot into space */
ring.countReserved--
if ring.countReserved < 0 {
return errors.New("Attempt made to cancel unreserved slot in ring buffer")
}
/* signal that space is available */
ring.spaceReady =... | [
1.3507221937179565,
-0.5385878086090088,
0.5450187921524048,
0.12395153194665909,
-0.48043951392173767,
0.528613805770874,
1.1210508346557617,
0.4101436734199524,
-0.2744956910610199,
-0.20683668553829193,
-0.2105933576822281,
-0.259196013212204,
-0.2879957854747772,
0.633348286151886,
1... |
func (ring *ringBuffer) confirm() error {
ring.mutex.Lock()
defer ring.mutex.Unlock()
/* convert the reserved slot into data */
ring.countData++
ring.countReserved--
if ring.countReserved < 0 {
return errors.New("Attempt made to confirm unreserved slot in ring buffer")
}
/* signal that data is available */
... | [
0.8790644407272339,
-0.10729556530714035,
0.6769535541534424,
-0.2908271253108978,
0.4854711592197418,
0.40336674451828003,
0.4683789908885956,
-0.5247717499732971,
-0.6954424381256104,
-0.21080976724624634,
-0.6206632256507874,
0.1358986645936966,
-0.26122668385505676,
0.7048670053482056,... |
func (session *Session) NewRingBuffer() *ringBuffer {
ring := new(ringBuffer)
ring.datagramSize = 6 + int(session.param.blockSize)
ring.datagrams = make([]byte, ring.datagramSize*MAX_BLOCKS_QUEUED)
ring.dataReady = false
ring.spaceReady = true
/* initialize the indices */
ring.countData = 0
ring.countReserve... | [
0.08554475754499435,
-0.33914992213249207,
0.5485802888870239,
0.10680851340293884,
-0.7585800290107727,
-0.2869940996170044,
0.8105656504631042,
-0.45105019211769104,
0.6463003754615784,
-0.26816055178642273,
-1.2889224290847778,
0.029993021860718727,
-1.080410122871399,
0.308874964714050... |
func (ring *ringBuffer) destroy() {
// do nothing in go
} | [
-0.14217612147331238,
-0.6905954480171204,
0.3424183428287506,
-0.1720246523618698,
0.37328264117240906,
1.0677706003189087,
0.9648337364196777,
-0.4897710978984833,
0.2528621256351471,
-0.5275771021842957,
-0.6152964234352112,
-0.28126493096351624,
-1.6533520221710205,
0.9359498023986816,... |
func (ring *ringBuffer) dump(out io.Writer) {
ring.mutex.Lock()
/* print out the top-level fields */
fmt.Fprintln(out, "datagram_size = ", ring.datagramSize)
fmt.Fprintln(out, "base_data = ", ring.baseData)
fmt.Fprintln(out, "count_data = ", ring.countData)
fmt.Fprintln(out, "count_reserved = ", ring.co... | [
0.2135077714920044,
0.2524988353252411,
0.7178725004196167,
-1.200340747833252,
-0.18694402277469635,
0.35969099402427673,
1.0580540895462036,
-0.6286266446113586,
-0.43113696575164795,
-0.5714953541755676,
-0.9680684208869934,
0.3075301945209503,
-0.7034363746643066,
0.6669792532920837,
... |
func (ring *ringBuffer) peek() []byte {
ring.mutex.Lock()
/* wait for the data-ready variable to make us happy */
for !ring.dataReady {
ring.dataReadyCond.Wait()
}
ring.mutex.Unlock()
/* find the address we want */
address := ring.datagrams[ring.datagramSize+ring.baseData:]
return address
} | [
-0.14430151879787445,
-0.05797587335109711,
0.7520580291748047,
-0.9273914098739624,
-0.2508419454097748,
-0.6450279355049133,
0.28364962339401245,
-1.1855577230453491,
0.27471819519996643,
-0.3402019739151001,
0.005901334807276726,
1.067840576171875,
-0.7970079183578491,
-0.21649396419525... |
func (ring *ringBuffer) pop() {
ring.mutex.Lock()
/* wait for the data-ready variable to make us happy */
for !ring.dataReady {
ring.dataReadyCond.Wait()
}
/* perform the pop operation */
ring.baseData = (ring.baseData + 1) % MAX_BLOCKS_QUEUED
ring.countData--
if ring.countData == 0 {
ring.dataReady = fal... | [
0.4277888834476471,
0.22227923572063446,
0.6033241152763367,
-0.25875717401504517,
0.21955013275146484,
0.12564419209957123,
0.7629140019416809,
-0.5781493186950684,
-0.6893784403800964,
0.2730138599872589,
-0.29075559973716736,
-0.21896348893642426,
-0.12422537058591843,
0.326098412275314... |
func (ring *ringBuffer) reserve() ([]byte, error) {
ring.mutex.Lock()
defer ring.mutex.Unlock()
/* figure out which slot comes next */
next := (ring.baseData + ring.countData + ring.countReserved) % MAX_BLOCKS_QUEUED
/* wait for the space-ready variable to make us happy */
for !ring.spaceReady {
fmt.Println("... | [
0.16397064924240112,
0.126678928732872,
0.6179600954055786,
-0.6659114956855774,
0.00044513356988318264,
-0.795405924320221,
0.5126953125,
-0.5799007415771484,
-0.18493488430976868,
-0.7825631499290466,
0.0550239160656929,
0.5335644483566284,
-1.0978165864944458,
-0.11308764666318893,
1.... |
func NewMeetingParticipants()(*MeetingParticipants) {
m := &MeetingParticipants{
}
m.SetAdditionalData(make(map[string]interface{}));
return m
} | [
-0.8430218696594238,
-1.5424052476882935,
-0.04362032189965248,
-0.31846779584884644,
-0.9827691912651062,
0.121902234852314,
-1.3293201923370361,
0.2510391175746918,
-0.2166365087032318,
0.26244279742240906,
-0.4677562117576599,
-0.41955599188804626,
-0.7566692233085632,
-0.06951893866062... |
func CreateMeetingParticipantsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewMeetingParticipants(), nil
} | [
-0.05749790370464325,
-0.6546123623847961,
0.3221450448036194,
-0.2908690273761749,
-0.5431358814239502,
0.16416577994823456,
-0.1718892902135849,
0.4346204400062561,
0.11806176602840424,
-0.04844379425048828,
0.30040958523750305,
0.13972710072994232,
-0.24324464797973633,
0.65297836065292... |
func (m *MeetingParticipants) GetAdditionalData()(map[string]interface{}) {
return m.additionalData
} | [
0.4140166938304901,
-0.9692533016204834,
0.2418336570262909,
-0.402839332818985,
-1.0687439441680908,
0.9431812763214111,
-0.9221152067184448,
0.019939925521612167,
0.43676719069480896,
-0.7408133745193481,
-0.02312144637107849,
0.4804530441761017,
-0.8001528382301331,
0.4642634689807892,
... |
func (m *MeetingParticipants) GetAttendees()([]MeetingParticipantInfoable) {
return m.attendees
} | [
0.4026099741458893,
-1.0407564640045166,
0.08359458297491074,
-0.04076056927442551,
0.03974246233701706,
0.40993836522102356,
-0.9442496299743652,
0.3902502954006195,
-0.9315776228904724,
-0.035021375864744186,
0.19576457142829895,
0.035314738750457764,
-1.0156493186950684,
-0.027620742097... |
func (m *MeetingParticipants) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error))
res["attendees"] = i2ae4187f7daee263371cb1... | [
-0.21002338826656342,
-0.2860577702522278,
0.5391950011253357,
-0.9382461309432983,
-0.23945315182209015,
0.008277799002826214,
-0.14014069736003876,
0.46333110332489014,
-0.9036149382591248,
-0.3375967741012573,
-0.5349053740501404,
-0.2794348895549774,
-0.9742804169654846,
-0.15151306986... |
func (m *MeetingParticipants) GetOrganizer()(MeetingParticipantInfoable) {
return m.organizer
} | [
0.5457077026367188,
-0.8539944291114807,
0.19648323953151703,
0.17798389494419098,
-0.3129558563232422,
-0.200611874461174,
-0.0042580729350447655,
-0.053639087826013565,
-0.7901144027709961,
-0.6272427439689636,
0.9025089740753174,
-0.722528338432312,
-1.353722095489502,
-0.04119860008358... |
func (m *MeetingParticipants) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
if m.GetAttendees() != nil {
cast := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.CollectionCast[i878a80d2330e89d26896388a3f487eef27b0a0e6c010c4... | [
-0.6535364985466003,
-0.7840527892112732,
0.5989570617675781,
-0.6784670948982239,
0.15534450113773346,
0.2371789515018463,
0.42068713903427124,
0.3471399247646332,
-0.4212627410888672,
0.48187291622161865,
-0.20040567219257355,
0.10907033085823059,
-0.7121596932411194,
0.2987825572490692,... |
func (m *MeetingParticipants) SetAdditionalData(value map[string]interface{})() {
m.additionalData = value
} | [
0.31374111771583557,
-0.3946576714515686,
-0.021455783396959305,
-0.5781104564666748,
-0.7843896150588989,
1.0952938795089722,
-0.30079856514930725,
-0.07547720521688461,
0.04766613617539406,
-0.5389136672019958,
-0.035246342420578,
0.30403631925582886,
-0.4678289294242859,
1.1191695928573... |
func (m *MeetingParticipants) SetAttendees(value []MeetingParticipantInfoable)() {
m.attendees = value
} | [
0.06945403665304184,
-0.41371703147888184,
0.2475614845752716,
-0.30806270241737366,
-0.11226791143417358,
0.6110348105430603,
-0.2749217748641968,
0.2360525131225586,
-1.3372312784194946,
0.29603731632232666,
0.04021534323692322,
-0.9126861095428467,
-0.3268483877182007,
0.673701405525207... |
func (m *MeetingParticipants) SetOrganizer(value MeetingParticipantInfoable)() {
m.organizer = value
} | [
0.27007004618644714,
-0.4307147264480591,
0.0028886760119348764,
0.13573473691940308,
-0.23436979949474335,
0.3028307855129242,
0.3433442711830139,
0.27806156873703003,
-1.1922309398651123,
-0.29896342754364014,
0.21111899614334106,
-0.9630213975906372,
-0.7280652523040771,
0.7598156332969... |
func GetRequest(link, sharedSecret, addOnKey string) (req *http.Request, err error) {
signingKey := []byte(sharedSecret)
// Take context path as a fn argument if required.
contextPath := ""
jwt, err := jwt.Encode(link, contextPath, addOnKey, signingKey)
if err != nil {
return
}
// Take method as a fn argum... | [
-0.8797807097434998,
0.7024049162864685,
0.721682071685791,
1.2665448188781738,
-0.027959365397691727,
-0.8585885167121887,
-0.7302389740943909,
0.12656301259994507,
0.5343591570854187,
0.3527510464191437,
0.4414128363132477,
0.9509215950965881,
-0.06009058281779289,
-0.17711083590984344,
... |
func AppendProcessorsFromConfig(conf Config, mgr interop.Manager, pipelines ...iprocessor.PipelineConstructorFunc) []iprocessor.PipelineConstructorFunc {
if len(conf.Processors) > 0 {
pipelines = append(pipelines, []iprocessor.PipelineConstructorFunc{func() (iprocessor.Pipeline, error) {
processors := make([]ipro... | [
-0.3826749920845032,
0.03825117647647858,
0.27602049708366394,
-0.22936324775218964,
0.031341418623924255,
-0.29751908779144287,
-0.4374240040779114,
0.604220449924469,
0.302517294883728,
0.30072006583213806,
-0.12342904508113861,
0.0032140580005943775,
-0.38228264451026917,
0.423529505729... |
func WalkConstructors(fn func(ConstructorFunc, docs.ComponentSpec)) {
inferred := docs.ComponentFieldsFromConf(NewConfig())
for k, v := range Constructors {
conf := v.Config
conf.Children = conf.Children.DefaultAndTypeFrom(inferred[k])
spec := docs.ComponentSpec{
Type: docs.TypeOutput,
Name: ... | [
-0.6521535515785217,
-0.5225385427474976,
0.2779872417449951,
-0.6693850755691528,
0.7618330717086792,
-0.1087249219417572,
0.6899582147598267,
0.01095543522387743,
-0.5629649758338928,
-0.36452797055244446,
-0.42809566855430603,
-0.062337204813957214,
0.8549070358276367,
0.913591027259826... |
func NewConfig() Config {
return Config{
Label: "",
Type: "stdout",
AMQP09: NewAMQPConfig(),
AMQP1: NewAMQP1Config(),
AWSDynamoDB: NewDynamoDBConfig(),
AWSKinesis: NewKinesisConfig(),
AWSKinesisFirehose: NewKinesisFirehoseConfig(),
AWSS... | [
0.19864240288734436,
-0.32454752922058105,
0.7459914684295654,
0.6879392862319946,
0.08929454535245895,
-0.4932105243206024,
0.22939316928386688,
-0.486158162355423,
0.06803330779075623,
0.1797180026769638,
-0.4585055708885193,
0.48607999086380005,
0.04722531884908676,
1.1131553649902344,
... |
func (conf *Config) UnmarshalYAML(value *yaml.Node) error {
type confAlias Config
aliased := confAlias(NewConfig())
err := value.Decode(&aliased)
if err != nil {
return fmt.Errorf("line %v: %v", value.Line, err)
}
var spec docs.ComponentSpec
if aliased.Type, spec, err = docs.GetInferenceCandidateFromYAML(doc... | [
0.26596730947494507,
0.09117614477872849,
0.5721798539161682,
-0.5948201417922974,
-0.007017466239631176,
-0.9478274583816528,
0.8583890199661255,
1.037452220916748,
-0.02650907076895237,
1.0119297504425049,
-0.37201988697052,
0.5580574870109558,
0.7216897010803223,
0.459928035736084,
1.... |
func New(
conf Config,
mgr interop.Manager,
log log.Modular,
stats metrics.Type,
pipelines ...iprocessor.PipelineConstructorFunc,
) (output.Streamed, error) {
if mgrV2, ok := mgr.(interface {
NewOutput(Config, ...iprocessor.PipelineConstructorFunc) (output.Streamed, error)
}); ok {
return mgrV2.NewOutput(con... | [
0.32364657521247864,
-0.5626100301742554,
0.22208172082901,
0.10961134731769562,
-1.0151582956314087,
-0.9918524026870728,
0.8351086974143982,
-0.3368808329105377,
-0.8951815962791443,
-0.09311410039663315,
0.6505432724952698,
0.06202457472681999,
0.37194880843162537,
0.4279550313949585,
... |
func Convert(n int) string {
rainspeak := ""
if n%3 == 0 {
rainspeak += "Pling"
}
if n%5 == 0 {
rainspeak += "Plang"
}
if n%7 == 0 {
rainspeak += "Plong"
}
if len(rainspeak) == 0 {
rainspeak = strconv.Itoa(n)
}
return rainspeak
} | [
-1.029909610748291,
0.515721321105957,
0.8139052391052246,
-1.0612627267837524,
-0.08205891400575638,
0.7110351324081421,
-0.7551385760307312,
-0.7599140405654907,
0.7649500370025635,
0.6464405655860901,
-0.3296893835067749,
-0.09021660685539246,
-0.09571782499551773,
0.09983363002538681,
... |
func countRegexFrequency(matcher, text string) int {
regex := regexp.MustCompile(matcher)
matches := regex.FindAllStringSubmatch(text, -1)
return len(matches)
} | [
0.37543919682502747,
-0.6123087406158447,
0.586749792098999,
0.13566341996192932,
0.10503453016281128,
-0.37019482254981995,
-0.093049056828022,
1.0608108043670654,
-0.5268427133560181,
-0.6355795860290527,
-0.8059621453285217,
-0.06233977526426315,
-0.39214104413986206,
0.4286048710346222... |
func (*EventType) GetConditionSet() apis.ConditionSet {
return eventTypeCondSet
} | [
0.6518742442131042,
-0.1527969092130661,
0.3917073607444763,
0.5668436884880066,
-0.08209021389484406,
-0.3968070149421692,
0.7755309343338013,
-0.48008963465690613,
-0.7793394327163696,
-0.2088913470506668,
0.6935156583786011,
1.088768720626831,
-0.9735834002494812,
-0.11623268574476242,
... |
func (et *EventTypeStatus) GetCondition(t apis.ConditionType) *apis.Condition {
return eventTypeCondSet.Manage(et).GetCondition(t)
} | [
0.5160380005836487,
-0.11943859606981277,
0.34758004546165466,
0.32640540599823,
-0.07790987938642502,
-0.3763730823993683,
0.29588744044303894,
-0.7326706051826477,
0.021572556346654892,
0.250089555978775,
0.12749895453453064,
0.3254435658454895,
0.08255571871995926,
0.5190107226371765,
... |
func (et *EventTypeStatus) IsReady() bool {
return eventTypeCondSet.Manage(et).IsHappy()
} | [
-0.5444826483726501,
0.9366310834884644,
0.5616139769554138,
0.44300127029418945,
-0.16732321679592133,
-0.35663121938705444,
-0.22253938019275665,
-0.6168286800384521,
-0.1854846477508545,
0.4831700921058655,
-0.6501297354698181,
0.4354919493198395,
0.6318027973175049,
0.741632342338562,
... |
func (et *EventTypeStatus) GetTopLevelCondition() *apis.Condition {
return eventTypeCondSet.Manage(et).GetTopLevelCondition()
} | [
0.7061500549316406,
-0.6621497273445129,
0.5311461091041565,
-0.3599409759044647,
-0.8319121599197388,
0.25664985179901123,
0.7041354179382324,
-0.3926399350166321,
-0.12388438731431961,
-0.10631772130727768,
0.11702615022659302,
0.9212533235549927,
-0.34001216292381287,
0.5599854588508606... |
func (et *EventTypeStatus) InitializeConditions() {
eventTypeCondSet.Manage(et).InitializeConditions()
} | [
-0.014653125777840614,
0.37627503275871277,
0.42286524176597595,
0.4087134897708893,
0.34927311539649963,
-0.3831406235694885,
0.5308926105499268,
-0.5533846616744995,
-0.713064968585968,
-0.11473501473665237,
-0.21668055653572083,
-0.016181770712137222,
-0.017383070662617683,
0.9023582339... |
func GetRowValue(row Row, index int, columnName string) interface{} {
if row.Values[index] == nil {
return 0
}
colIndex, err := getIndexByColumnName(row, columnName)
if err != nil {
log.Error(err)
}
if row.Values[index][colIndex] != nil {
res := row.Values[index][colIndex]
return res
}
return json.Num... | [
-0.7473821640014648,
0.8567696213722229,
0.7370235323905945,
0.49688559770584106,
-0.0813673660159111,
-1.3149878978729248,
-0.09904789924621582,
-0.6154467463493347,
0.201310932636261,
-0.20766492187976837,
0.3283453583717346,
0.48107683658599854,
0.8770124912261963,
0.13330620527267456,
... |
func (_m *IPlayer) CreatePlayer(ctx context.Context, player models.Player) (bool, *models.QError) {
ret := _m.Called(ctx, player)
var r0 bool
if rf, ok := ret.Get(0).(func(context.Context, models.Player) bool); ok {
r0 = rf(ctx, player)
} else {
r0 = ret.Get(0).(bool)
}
var r1 *models.QError
if rf, ok := r... | [
-0.7317512631416321,
-0.5914366841316223,
0.5818547606468201,
-0.0786614716053009,
0.3718082010746002,
0.20443393290042877,
0.6511729955673218,
0.28007972240448,
0.18488135933876038,
0.20806188881397247,
-0.20792938768863678,
-0.6657402515411377,
-0.2941446602344513,
-0.03346710279583931,
... |
func (_m *IPlayer) GetPlayer(ctx context.Context, playerId int) (*models.Player, *models.QError) {
ret := _m.Called(ctx, playerId)
var r0 *models.Player
if rf, ok := ret.Get(0).(func(context.Context, int) *models.Player); ok {
r0 = rf(ctx, playerId)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*models.P... | [
-0.8023576140403748,
-0.639643132686615,
0.5849100351333618,
0.3089027404785156,
0.29698601365089417,
-0.3996470272541046,
0.8449496030807495,
0.0438767671585083,
0.6280292272567749,
-0.165584996342659,
-0.16519691050052643,
0.19194215536117554,
0.05214698240160942,
0.4356912076473236,
0... |
func (_m *IPlayer) GetPlayers(ctx context.Context) ([]*models.Player, *models.QError) {
ret := _m.Called(ctx)
var r0 []*models.Player
if rf, ok := ret.Get(0).(func(context.Context) []*models.Player); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*models.Player)
}
}
var r1 *models... | [
-0.8677601218223572,
0.3355158865451813,
0.5278206467628479,
0.3259071409702301,
0.4685574769973755,
-0.026921331882476807,
0.6249373555183411,
-0.20413298904895782,
0.3826036751270294,
-0.22791141271591187,
-0.09006988257169724,
0.5402586460113525,
-0.4881122410297394,
0.42717424035072327... |
func Setup() error {
c, err := getConnection()
if err != nil {
return err
}
conn = c
ch, err := getChannel()
if err != nil {
return err
}
channel = ch
// listen for close events so we can reconnect.
errChan := channel.NotifyClose(make(chan *amqp.Error))
go func() {
for e := range errChan {
fmt.Pri... | [
-0.2096281498670578,
-0.5881783962249756,
0.7580554485321045,
-0.49706193804740906,
0.8120003342628479,
-1.0570050477981567,
0.10979855805635452,
-0.5277950167655945,
-0.24555902183055878,
-0.044306132942438126,
0.19164183735847473,
0.9449503421783447,
-0.2063448280096054,
-0.0222880300134... |
func Edit(ctx *aero.Context) string {
id := ctx.Get("id")
material, err := mui.GetMaterial(id)
if err != nil {
return ctx.Error(http.StatusNotFound, "Material not found")
}
return ctx.HTML(components.EditMaterial(material))
} | [
0.09859026223421097,
-0.5404193997383118,
0.3838753402233124,
-0.4428422152996063,
-0.11666145920753479,
0.6516527533531189,
0.17947737872600555,
-0.19728048145771027,
-0.07894087582826614,
-0.15046705305576324,
1.4219961166381836,
0.5593206882476807,
-0.4797094166278839,
-0.42230516672134... |
func Download(ctx *aero.Context) string {
id := ctx.Get("id")
material, err := mui.GetMaterial(id)
if err != nil {
return ctx.Error(http.StatusNotFound, "Material not found")
}
if !material.HasImage() {
return ctx.Error(http.StatusBadRequest, "Material has no image")
}
ctx.Response().Header().Set("Content... | [
0.5893164873123169,
-0.676524817943573,
0.8168652653694153,
-0.15592984855175018,
-0.9949274659156799,
0.31647980213165283,
-0.00431764917448163,
-0.14849956333637238,
0.2447030246257782,
-0.47931191325187683,
1.0520951747894287,
0.10646194219589233,
-0.2417319118976593,
-0.218031033873558... |
func DecomposeSPN(constr Construction, structure spn.Structure) (out spn.Construction) {
cipher := Encoding{constr}
return decomposeSPN(cipher, structure)
} | [
-0.543329656124115,
-0.6351678371429443,
0.16491997241973877,
0.5823819041252136,
-0.43021053075790405,
-0.42033761739730835,
0.08805739879608154,
0.8779484033584595,
0.6414143443107605,
-0.7292987704277039,
-1.8836119174957275,
-1.0910913944244385,
0.1442839503288269,
0.3708835542201996,
... |
func NewClient(URL, token string) *Client {
c := &Client{
Token: token,
client: http.DefaultClient,
}
if !strings.HasSuffix(URL, "/") {
URL += "/"
}
var err error
c.URL, err = url.Parse(URL)
if err != nil {
panic(err)
}
return c
} | [
0.6848036050796509,
-0.2906497120857239,
0.09774504601955414,
0.3797246813774109,
-0.397644579410553,
-0.1992274969816208,
-0.4902700185775757,
-0.02525332383811474,
-0.44835835695266724,
-0.3810039162635803,
-0.09770731627941132,
0.5492352247238159,
0.20117485523223877,
-1.258064150810241... |
func (c *Client) NewRequest(method, pathStr string, body interface{}) (*http.Request, error) {
c.URL.Path = path.Join(c.URL.Path, pathStr)
buf := new(bytes.Buffer)
if body != nil {
err := json.NewEncoder(buf).Encode(body)
if err != nil {
return nil, err
}
}
req, err := http.NewRequest(method, c.URL.Stri... | [
-0.04259311407804489,
0.20391714572906494,
0.81275874376297,
-0.14259204268455505,
-0.2774145305156708,
-0.31303566694259644,
-0.979667067527771,
-0.6289272308349609,
-0.1086750403046608,
0.3547307252883911,
0.6020157933235168,
1.2068198919296265,
0.4209196865558624,
-0.3634330928325653,
... |
func (c *Client) Do(req *http.Request) (interface{}, error) {
resp, err := c.client.Do(req)
if err != nil {
return nil, err
}
defer resp.Body.Close()
var response interface{}
err = json.NewDecoder(resp.Body).Decode(&response)
return response, err
} | [
-0.7008851766586304,
-0.35755306482315063,
1.0472962856292725,
-0.21357351541519165,
0.20934823155403137,
0.26512616872787476,
-0.7329772114753723,
-1.3696590662002563,
-0.28034254908561707,
0.3252701759338379,
-0.7300201058387756,
0.5491617321968079,
-0.019651619717478752,
0.1730192899703... |
func GetCreateHttpHandler() http.HandlerFunc {
return allowCORS(
validateReCaptcha(
middleware.InputCreateCheck(
http.HandlerFunc(createHandler)),
),
"*")
} | [
0.03633777052164078,
-0.4535459280014038,
0.4000457227230072,
1.3186531066894531,
-0.48995959758758545,
1.3197485208511353,
0.6715185642242432,
-0.351075679063797,
-0.9577682018280029,
0.3049445152282715,
0.3668419420719147,
-0.1212136447429657,
-0.1932164579629898,
0.8160377740859985,
-... |
func createHandler(w http.ResponseWriter, r *http.Request) {
log.Printf("CreateHandler Called...\n")
w.Header().Add("Content-Type", "application/json")
params := mux.Vars(r)
gameName := params["gameName"]
playerName := params["playerName"]
dieNum, _ := strconv.Atoi(params["dieNum"])
gameId := storewrapper.Great... | [
-0.8652604818344116,
-0.41865018010139465,
0.8469000458717346,
-0.013828529976308346,
0.40359655022621155,
0.16260604560375214,
-0.06045156717300415,
-0.4187549352645874,
-0.6870810389518738,
0.9236672520637512,
-0.20969919860363007,
-0.9734118580818176,
-0.6215941905975342,
0.210559248924... |
func (cc *ChaincodeEnv) getChaincodeSpec(args [][]byte) *pb.ChaincodeSpec {
spec := &pb.ChaincodeSpec{}
funcname := cc.Function
input := &pb.ChaincodeInput{}
input.Args = append(input.Args, []byte(funcname))
for _, arg := range args {
input.Args = append(input.Args, arg)
}
logger.Debug("ChaincodeSp... | [
0.06606471538543701,
-0.5905203223228455,
0.6964787244796753,
-0.123943991959095,
0.7175206542015076,
-0.008315971121191978,
-0.29131627082824707,
0.20853596925735474,
-1.0157579183578491,
0.3151835501194,
-0.1278415471315384,
0.9727187752723694,
-0.6185364723205566,
0.2719619870185852,
... |
func CreateChaincodeProposalWithTxIDAndTransient(chainID string, spec *pb.ChaincodeSpec, creator []byte, transientMap map[string][]byte) (*pb.Proposal, string, error) {
// generate a random nonce
nonce, err := utils.GetRandomNonce()
if err != nil {
return nil, "", err
}
txid, err := protoutils.ComputePropo... | [
0.07795989513397217,
-0.5811367034912109,
0.6614916920661926,
-1.0879871845245361,
-0.4626011252403259,
-0.4929121732711792,
-1.084727168083191,
-0.24998365342617035,
-0.6958680152893066,
0.864099383354187,
-0.23854155838489532,
-0.25069713592529297,
-0.3511921763420105,
0.0978439897298812... |
func GetSignedProposal(prop *pb.Proposal, signer msp.SigningIdentity) (*pb.SignedProposal, error) {
// check for nil argument
if prop == nil || signer == nil {
return nil, fmt.Errorf("Nil arguments")
}
propBytes, err := protoutils.Marshal(prop)
if err != nil {
return nil, err
}
signature, err :=... | [
-0.16168774664402008,
-0.658771812915802,
0.6686603426933289,
0.6610560417175293,
-0.5444695353507996,
0.08525079488754272,
-0.2919269800186157,
0.3235134482383728,
0.7384920120239258,
0.07686489820480347,
-0.5918758511543274,
-0.03598473593592644,
-1.0301412343978882,
0.25881949067115784,... |
func (api *CoreHandler) AuthorizeCallback(w http.ResponseWriter, r *http.Request) {
log.Println("Reaceived callback from Instagram oauth")
// Get the query string
vals := r.URL.Query()
// If "error" is not an empty string we have not received our access code
// This is error param is specified by the Reddit API
... | [
-0.28032276034355164,
0.1877111941576004,
0.6871969103813171,
0.5344472527503967,
0.40800032019615173,
-0.21749529242515564,
0.7864436507225037,
0.36531656980514526,
1.0783967971801758,
0.05065115541219711,
0.9406862854957581,
0.854834794998169,
-0.39797645807266235,
0.109502412378788,
0... |
func (k *kvSender) run() {
//main KVSender loop
loop:
for {
select {
case cmd, ok := <-k.supvCmdch:
if ok {
if cmd.GetMsgType() == KV_SENDER_SHUTDOWN {
c.Infof("KVSender::run Shutting Down")
k.supvCmdch <- &MsgSuccess{}
break loop
}
k.handleSupvervisorCommands(cmd)
} else {
... | [
-0.17511585354804993,
-0.26516246795654297,
0.7459521889686584,
0.7341265678405762,
-0.34738120436668396,
0.06396302580833435,
0.07586617022752762,
0.2845146059989929,
-0.5217706561088562,
0.22173389792442322,
-0.4567812383174896,
-0.15691307187080383,
-0.7118296027183533,
1.42194211483001... |
func sendMutationStreamRequest(ap adminport.Client,
mReq protobuf.MutationStreamRequest) (protobuf.MutationStreamResponse, Message) {
c.Debugf("KVSender::sendMutationStreamRequest \n\t%v", mReq)
mRes := protobuf.MutationStreamResponse{}
if err := ap.Request(&mReq, &mRes); err != nil {
c.Errorf("KVSender::sendMu... | [
-1.8398059606552124,
0.17786413431167603,
1.067193627357483,
0.2538941502571106,
-0.5559142827987671,
-0.2013447880744934,
-0.03879239037632942,
-1.1045396327972412,
0.8244499564170837,
0.23816446959972382,
0.16766496002674103,
1.4934251308441162,
-1.0373551845550537,
1.1010035276412964,
... |
func sendUpdateMutationStreamRequest(ap adminport.Client,
mReq protobuf.UpdateMutationStreamRequest) (protobuf.MutationStreamResponse, Message) {
c.Debugf("KVSender::sendUpdateMutationStreamRequest \n\t%v", mReq)
mRes := protobuf.MutationStreamResponse{}
if err := ap.Request(&mReq, &mRes); err != nil {
c.Errorf... | [
-2.0296292304992676,
-0.28241053223609924,
1.0314147472381592,
0.11087900400161743,
-0.942976176738739,
-0.29829639196395874,
0.1938885599374771,
-0.992189347743988,
0.7018546462059021,
0.4248269200325012,
-0.07984288781881332,
1.505918025970459,
-1.1759657859802246,
0.7382296323776245,
... |
func sendSubscribeStreamRequest(ap adminport.Client,
mReq protobuf.SubscribeStreamRequest) (protobuf.Error, Message) {
c.Debugf("KVSender::sendSubscribeStreamRequest \n\t%v", mReq)
mRes := protobuf.Error{}
if err := ap.Request(&mReq, &mRes); err != nil {
c.Errorf("KVSender::sendSubscribeStreamRequest \n\tUnexpe... | [
-0.7776783108711243,
0.2578836977481842,
1.1595371961593628,
-0.03751946985721588,
-0.5559906959533691,
-0.03912763297557831,
0.07189512997865677,
-0.6785483956336975,
0.7739338874816895,
0.008961408399045467,
0.07770289480686188,
1.3187587261199951,
-0.8657569289207458,
0.3786385357379913... |
func sendShutdownStreamRequest(ap adminport.Client,
sReq protobuf.ShutdownStreamRequest) (protobuf.Error, Message) {
c.Debugf("KVSender::sendShutdownStreamRequest \n\t%v", sReq)
sRes := protobuf.Error{}
if err := ap.Request(&sReq, &sRes); err != nil {
c.Errorf("KVSender::sendShutdownStreamRequest \n\tUnexpected... | [
-1.577887773513794,
0.251533180475235,
1.1362308263778687,
0.1921863853931427,
-0.6991429328918457,
-0.11787034571170807,
0.5884830951690674,
-0.8825741410255432,
0.7265064716339111,
0.2556767761707306,
0.4563009440898895,
1.0515162944793701,
-0.42971426248550415,
1.1292272806167603,
-0.... |
func (k *kvSender) updateServerListCache(vbmap *protobuf.VbmapResponse) {
//clear the cache
k.serverListCache = k.serverListCache[:0]
//update the cache
for _, kv := range vbmap.GetKvaddrs() {
k.serverListCache = append(k.serverListCache, kv)
}
} | [
-0.8960163593292236,
-0.3656260669231415,
0.28110507130622864,
0.308675616979599,
-0.2540625035762787,
-0.33038070797920227,
-0.9752132296562195,
0.29861128330230713,
1.1082594394683838,
2.0171570777893066,
-1.0939655303955078,
0.5264313817024231,
-1.1134980916976929,
1.358535885810852,
... |
func convertIndexInstToProtoInst(indexInst c.IndexInst, streamId c.StreamId) *protobuf.IndexInst {
protoDefn := convertIndexDefnToProtobuf(indexInst.Defn)
protoInst := convertIndexInstToProtobuf(indexInst, protoDefn)
addPartnInfoToProtoInst(indexInst, streamId, protoInst)
return protoInst
} | [
-0.8310613036155701,
-0.39710304141044617,
0.29298028349876404,
-0.7398656606674194,
-0.3049201965332031,
0.1736069917678833,
-0.06188499182462692,
-0.5200404524803162,
0.6809766888618469,
-0.3201398253440857,
-0.8059221506118774,
0.674153208732605,
-1.55707585811615,
-0.7919450402259827,
... |
func (h *handler) ValidateDNSName(clusterName, baseDNSDomainName string) error {
appsDomainNameSuffix := fmt.Sprintf(appsDomainNameFormat, clusterName, baseDNSDomainName)
apiErrorCode, err := validations.ValidateDomainNameFormat(baseDNSDomainName)
if err != nil {
return common.NewApiError(apiErrorCode, err)
}
if... | [
-0.425982266664505,
-0.11500890552997589,
0.5565285086631775,
0.43611302971839905,
-0.1804402470588684,
0.1185869500041008,
-0.512175977230072,
-0.7589594125747681,
0.09357117116451263,
-0.06621772050857544,
-0.45730188488960266,
0.5598763227462769,
0.4342518448829651,
0.19904498755931854,... |
func (h *handler) ValidateBaseDNS(domain *DNSDomain) error {
dnsProvider := h.providerFactory.GetProvider(domain)
dnsNameFromService, err := dnsProvider.GetDomainName()
if err != nil {
return errors.Errorf("Can't validate base DNS domain: %v", err)
}
dnsNameFromCluster := strings.TrimSuffix(domain.Name, ".")
i... | [
-0.0796506404876709,
0.3852282166481018,
0.5254982113838196,
0.17130528390407562,
-0.1546209454536438,
0.3033490478992462,
0.040924228727817535,
-0.8582080602645874,
0.6836032867431641,
-0.25014033913612366,
-0.15729233622550964,
1.082258701324463,
-0.11713475733995438,
0.2740214765071869,... |
func (h *Handler) HandleHealthz(w http.ResponseWriter, r *http.Request) {
response := struct {
Message string `json:"message"`
}{
Message: "ok",
}
h.render(w, http.StatusOK, response)
} | [
0.28538626432418823,
-0.7928348779678345,
0.5424810647964478,
0.3169861435890198,
-0.017980113625526428,
0.04729802906513214,
0.42990678548812866,
-0.0927492007613182,
0.43369898200035095,
-1.0993480682373047,
0.1054699569940567,
0.055200014263391495,
-0.3435969948768616,
0.742007553577423... |
func Epsilon(Ra, Rb, Rf *utils.SlidingWindow, scale float64) (float64, error) {
Rpf, err := Annualized(Rf, scale, true)
if err != nil {
return math.NaN(), err
}
return Epsilon2(Ra, Rb, Rpf, scale)
} | [
-0.4150019586086273,
0.026159001514315605,
0.4686194956302643,
0.4744630753993988,
-0.11183776706457138,
-0.18128271400928497,
-0.5024053454399109,
0.37311404943466187,
-0.8843404650688171,
1.0468391180038452,
-0.20814891159534454,
0.5685362815856934,
0.10753606259822845,
0.55930095911026,... |
func NewPublicRemoveTrustedDeviceV4Params() *PublicRemoveTrustedDeviceV4Params {
var ()
return &PublicRemoveTrustedDeviceV4Params{
timeout: cr.DefaultTimeout,
}
} | [
-0.36330845952033997,
0.1511918157339096,
-0.06692556291818619,
0.24910083413124084,
-0.41005465388298035,
-0.2972019910812378,
0.2508764863014221,
0.621843159198761,
-1.1215394735336304,
-0.49931105971336365,
-0.5430244207382202,
-0.7769264578819275,
-1.2702937126159668,
0.595814704895019... |
func NewPublicRemoveTrustedDeviceV4ParamsWithTimeout(timeout time.Duration) *PublicRemoveTrustedDeviceV4Params {
var ()
return &PublicRemoveTrustedDeviceV4Params{
timeout: timeout,
}
} | [
0.39838752150535583,
-0.03728979080915451,
0.12148037552833557,
0.23778147995471954,
-0.21305671334266663,
0.28117048740386963,
-0.5204777717590332,
0.6519139409065247,
-0.9152481555938721,
0.15031257271766663,
-0.29728370904922485,
-0.38277706503868103,
-0.8440933227539062,
0.760464668273... |
func NewPublicRemoveTrustedDeviceV4ParamsWithContext(ctx context.Context) *PublicRemoveTrustedDeviceV4Params {
var ()
return &PublicRemoveTrustedDeviceV4Params{
Context: ctx,
}
} | [
-0.08529091626405716,
-0.022551702335476875,
0.3597875237464905,
-0.1718049794435501,
0.04145275056362152,
0.061129577457904816,
-0.4163706302642822,
-0.033949799835681915,
-0.5939819812774658,
-0.22333064675331116,
-0.622241199016571,
-0.8058146238327026,
-1.0615249872207642,
0.0633921250... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.