text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (f FlagHandler) FindByFlag(c echo.Context) error {
req := request.FindFlagHistoryRequest{}
if err := c.Bind(&req); err != nil {
logrus.Errorf("flag handler bind (find by flag): %s", err.Error())
return echo.NewHTTPError(http.StatusBadRequest, ErrInvalidJSONSyntax.Error())
}
if err := req.Validate(); err ... | [
0.33023160696029663,
0.7203333377838135,
0.6965857744216919,
0.22249606251716614,
-0.030014613643288612,
-0.16275714337825775,
0.792466402053833,
-0.2203679382801056,
-0.5230616331100464,
-0.11991305649280548,
-0.7293056845664978,
0.330689936876297,
-0.6630866527557373,
1.6456451416015625,... |
func (f FlagHandler) FindFlags(c echo.Context) error {
req := request.FindFlagsRequest{}
if err := c.Bind(&req); err != nil {
logrus.Errorf("flag handler bind (find flags): %s", err.Error())
return echo.NewHTTPError(http.StatusBadRequest, ErrInvalidJSONSyntax.Error())
}
if err := req.Validate(); err != nil {
... | [
-0.4121610224246979,
0.4369604289531708,
0.7358784079551697,
0.000596981612034142,
0.16715697944164276,
0.3181135356426239,
0.039996709674596786,
-0.6703342795372009,
-0.8361024260520935,
0.058739107102155685,
-0.3387545645236969,
0.16592325270175934,
-0.6494857668876648,
1.828899502754211... |
func New(path string) (*DB, error) {
db, err := badger.Open(badger.DefaultOptions(path))
if err != nil {
return nil, fmt.Errorf("new db error: %w", err)
}
return &DB{db}, nil
} | [
-0.3015705347061157,
-0.3577834665775299,
0.37806081771850586,
0.22863881289958954,
-0.4375622868537903,
0.47932735085487366,
0.02428125962615013,
0.0003886963822878897,
-0.6286307573318481,
-0.4830048084259033,
-0.4870457053184509,
-0.16333170235157013,
-0.17841118574142456,
0.51680684089... |
func (db *DB) Source() *badger.DB {
return db.db
} | [
-0.71330326795578,
0.5521067976951599,
0.1038505807518959,
0.5013683438301086,
-0.5528685450553894,
0.9027369618415833,
0.4361580014228821,
0.13411284983158112,
0.6043995022773743,
-0.17846380174160004,
-1.4553602933883667,
0.029517818242311478,
-0.8543339967727661,
1.1053801774978638,
0... |
func (r Rectangle) Area() float64 {
return r.Width * r.Height
} | [
-0.683792769908905,
-0.2071824073791504,
0.19337119162082672,
0.17267856001853943,
-0.2615612745285034,
0.08998467028141022,
0.4309616982936859,
-0.3143710196018219,
0.7400619387626648,
0.09214284271001816,
0.7448434829711914,
-0.779507577419281,
-0.049817562103271484,
2.0366246700286865,
... |
func (c *ClusterFixture) AddOne(object runtime.Object) {
c.objects = append(c.objects, object)
} | [
-0.9218631386756897,
-0.10009898245334625,
0.30847159028053284,
0.4656815230846405,
0.9070152044296265,
0.6672884225845337,
0.8638588190078735,
0.16763725876808167,
0.0433151014149189,
0.027685225009918213,
-1.2032519578933716,
0.26075807213783264,
-0.3739568293094635,
-0.01460749283432960... |
func WithName(n string) Option {
return func(s *Server) {
s.Name = n
}
} | [
-0.38434940576553345,
0.17128276824951172,
0.5752673745155334,
-0.3990180790424347,
-0.5001779794692993,
-0.0981893241405487,
0.30262491106987,
-0.6023346185684204,
0.5649364590644836,
0.6595985889434814,
-1.14353346824646,
-0.015366962179541588,
0.013406290672719479,
0.2485491931438446,
... |
func WithRouter(r http.Handler) Option {
return func(s *Server) {
s.Router = r
}
} | [
-0.055671680718660355,
-0.2618404030799866,
0.457612007856369,
-0.025004668161273003,
-1.0822383165359497,
0.7725954055786133,
0.7204259634017944,
-0.414825975894928,
0.7397109866142273,
-0.9868939518928528,
-0.25331050157546997,
-0.019039249047636986,
0.7175744771957397,
1.043402314186096... |
func WithLogger(l log.Logger) Option {
return func(s *Server) {
s.Logger = l
}
} | [
-0.26371416449546814,
0.5559795498847961,
0.4067767858505249,
-0.4259408414363861,
-0.5235488414764404,
-0.20200270414352417,
0.14568005502223969,
0.06127048283815384,
1.0695444345474243,
-0.689441978931427,
-0.7257471680641174,
0.014862473122775555,
0.12228967249393463,
1.162813425064087,... |
func WithPort(p string) Option {
return func(s *Server) {
s.Port = p
}
} | [
0.2679215967655182,
-0.2508752644062042,
0.45674821734428406,
-0.21381808817386627,
-0.08582589030265808,
0.7122530937194824,
0.640932023525238,
-0.18839561939239502,
0.6811718940734863,
-0.48435255885124207,
-0.1847536265850067,
-0.07240748405456543,
-0.2959473133087158,
-0.17801199853420... |
func WithHTTPServerTimeout(t time.Duration) Option {
return func(s *Server) {
s.HTTPServerTimeout = t
}
} | [
-0.13459283113479614,
-0.25341668725013733,
0.3268806040287018,
-0.14934687316417694,
-0.49844464659690857,
0.26758813858032227,
-0.29510244727134705,
0.14484743773937225,
-0.1717614382505417,
0.4089767038822174,
-1.0970333814620972,
0.3887598216533661,
0.6239159107208252,
1.26129126548767... |
func WithHTTPServerShutdownTimeout(t time.Duration) Option {
return func(s *Server) {
s.HTTPServerShutdownTimeout = t
}
} | [
-0.18714095652103424,
-0.4442182183265686,
0.1786704659461975,
-0.21091923117637634,
-0.2720915675163269,
0.36833688616752625,
-0.031845469027757645,
0.11029548197984695,
0.18241441249847412,
0.26412317156791687,
-0.5961321592330933,
0.10235967487096786,
0.9452139139175415,
0.8793675303459... |
func WithTLSConfig(cfg *tls.Config) Option {
return func(s *Server) {
s.TLSConfig = cfg
}
} | [
1.06719172000885,
0.12704776227474213,
0.440613716840744,
-0.5114004015922546,
-1.140959620475769,
-0.019742146134376526,
-0.2936578392982483,
0.6386957764625549,
0.02966149151325226,
0.7270212769508362,
-1.1852158308029175,
-0.33013373613357544,
1.5846810340881348,
1.1600571870803833,
-... |
func NewServer(opts ...Option) (*Server, error) {
// setup default server
srv := &Server{
Name: "default",
Router: http.NewServeMux(),
Port: "8080",
HTTPServerTimeout: 60 * time.Second,
HTTPServerShutdownTimeout: 10 * time.Second,
}
for... | [
-1.1516070365905762,
0.05809333920478821,
0.6909174919128418,
0.5163924098014832,
0.49731165170669556,
-0.3032882511615753,
-0.1760948747396469,
-0.5122424960136414,
0.1728716343641281,
-0.08236425369977951,
-0.20092558860778809,
0.4010937213897705,
-1.1221375465393066,
0.3679650127887726,... |
func (s *Server) Shutdown() {
close(stop)
} | [
-1.0348789691925049,
-0.5683164000511169,
-0.005723962094634771,
0.06631622463464737,
-0.2724789083003998,
0.8861294984817505,
0.06652194261550903,
0.3031356930732727,
0.3787018060684204,
0.10214632749557495,
0.214408740401268,
0.9480243921279907,
-0.35472673177719116,
0.22334782779216766,... |
func (b *DisputeTracker) Exec(ctx context.Context) error {
//cast client using type assertion since context holds generic interface{}
client := ctx.Value(berryCommon.ClientContextKey).(rpc.ETHClient)
DB := ctx.Value(berryCommon.DBContextKey).(db.DB)
//get the single config instance
cfg := config.GetConfig()
//g... | [
0.15122510492801666,
0.07674851268529892,
0.8638929128646851,
-0.012690690346062183,
0.9206720590591431,
0.9944486021995544,
0.14297889173030853,
0.4130381643772125,
-0.43866485357284546,
0.27068892121315,
-0.40168139338493347,
-0.1378946155309677,
-0.5117658376693726,
0.8568221926689148,
... |
func goPath() string {
gpDefault := build.Default.GOPATH
gps := filepath.SplitList(gpDefault)
return gps[0]
} | [
0.01750803552567959,
0.6347875595092773,
0.4970610737800598,
0.989094078540802,
1.1983433961868286,
0.8891696929931641,
0.5329297780990601,
-0.22667920589447021,
-0.7474380731582642,
0.9467458128929138,
0.17193499207496643,
-0.0510813370347023,
-1.2338899374008179,
-0.22825799882411957,
... |
func NewPoint(x, y int) *Point {
return &Point{
X: x,
Y: y,
}
} | [
0.4058467745780945,
-0.6213419437408447,
0.25803402066230774,
0.017723560333251953,
-0.423321396112442,
0.4201308488845825,
-1.294165849685669,
-1.2155380249023438,
0.317545086145401,
-0.09285817295312881,
0.13756269216537476,
1.0966336727142334,
-0.08043263107538223,
-1.1190409660339355,
... |
func (p *Point) To(other *Point) float64 {
X2 := math.Pow(float64(p.X-other.X), 2)
Y2 := math.Pow(float64(p.Y-other.Y), 2)
return math.Sqrt(X2 + Y2)
} | [
0.04270627722144127,
-0.15644438564777374,
0.756698489189148,
-0.40199995040893555,
0.5498690605163574,
0.3448861241340637,
-0.4962444603443146,
-0.27416905760765076,
0.03517519310116768,
0.21460315585136414,
-0.30839964747428894,
0.4964541494846344,
-0.045291267335414886,
-0.4501350522041... |
func main() {
scanner := bufio.NewScanner(os.Stdin)
for {
fmt.Println("Please enter your input in the below format or 'quit' to exit")
fmt.Println("format is '<a> <op> <b> (operation can be '+', '-', '*', '/'")
if !scanner.Scan() {
break
}
cmd := scanner.Text()
if strings.ToLower(cmd) == "quit" {
... | [
0.5206547975540161,
0.005058730952441692,
1.1091408729553223,
0.8648868799209595,
-0.49217739701271057,
0.855821430683136,
1.1222902536392212,
-0.38647863268852234,
-0.6718246936798096,
-0.16395670175552368,
0.6934396624565125,
-0.24709786474704742,
0.018842358142137527,
-0.018939379602670... |
func Exec(command string, params interface{}) {
_, err := env.Parse(env.Extract(os.Environ(), "PLUGIN_"), params)
if err != nil {
log.Fatalf("error parsing environment: %+v\n", err)
}
cmd.Exec(command, params)
} | [
0.6911354660987854,
-0.6503649950027466,
0.5165289044380188,
0.19890864193439484,
0.6680019497871399,
0.032205935567617416,
-0.6137591004371643,
0.16276304423809052,
-0.8993349671363831,
0.46140289306640625,
-0.009285981766879559,
1.0145467519760132,
0.05216120183467865,
0.2629755437374115... |
func ExecCommand(command string, paramsMap map[string]interface{}) {
commandParams := &Command{}
_, err := env.Parse(env.Extract(os.Environ(), "PLUGIN_"), commandParams)
if err != nil {
log.Fatalf("error parsing environment: %+v\n", err)
}
key := commandParams.Command
if commandParams.Subcommand != "" {
key =... | [
0.39081674814224243,
-0.7542139291763306,
0.7102013230323792,
0.21328341960906982,
0.534514307975769,
0.24086064100265503,
-0.5394062995910645,
0.43049535155296326,
-0.3663925528526306,
0.30767810344696045,
-0.03130973502993584,
1.150404453277588,
0.07871777564287186,
0.8794406056404114,
... |
func (n *RNSNum) size() int {
return len(n.buffer)
} | [
-0.4574274718761444,
0.6270106434822083,
0.32215774059295654,
-1.0532238483428955,
0.009519767016172409,
0.7555320262908936,
1.1390857696533203,
-0.4927292764186859,
1.076838731765747,
-1.3731703758239746,
-1.272951602935791,
0.663148820400238,
-0.2513412535190582,
0.8458281755447388,
0.... |
func EchoClient(name string) EchoClientStub {
return implEchoClientStub{name}
} | [
0.22136466205120087,
-0.3045221269130707,
0.11156059056520462,
-0.6933115124702454,
-0.9828833341598511,
0.3905782401561737,
-0.16932065784931183,
-0.2812138795852661,
-0.11889839917421341,
-0.0543949268758297,
-1.1072893142700195,
0.2793442904949188,
0.09084756672382355,
-1.39900028705596... |
func EchoServer(impl EchoServerMethods) EchoServerStub {
stub := implEchoServerStub{
impl: impl,
}
// Initialize GlobState; always check the stub itself first, to handle the
// case where the user has the Glob method defined in their VDL source.
if gs := rpc.NewGlobState(stub); gs != nil {
stub.gs = gs
} else... | [
-1.0331259965896606,
-0.2741144001483917,
0.6337389945983887,
0.15830613672733307,
-0.2713129222393036,
0.504260778427124,
0.5619887709617615,
-0.19942408800125122,
0.5798358917236328,
0.4171360731124878,
-0.3752088248729706,
0.4260520339012146,
-0.8606690168380737,
0.4459552466869354,
0... |
func removeTempRepos() {
os.RemoveAll("/tmp/github.com")
} | [
-0.22295907139778137,
0.16420765221118927,
0.32727232575416565,
-0.35259753465652466,
-0.13459907472133636,
0.2843530476093292,
0.4037867486476898,
1.3747904300689697,
0.10962260514497757,
0.5172040462493896,
-0.5472177267074585,
-1.2921198606491089,
-0.6541969776153564,
0.5801575779914856... |
func TestCloneRepo(t *testing.T) {
defer removeTempRepos()
rs := NewRepoService(testConf, gklog.NewNopLogger(), &statsd.Client{})
if err := rs.CloneRepo("/tmp", "github.com/briandowns/smile"); err != nil {
t.Error(err)
}
} | [
0.44564288854599,
0.8455019593238831,
0.529768705368042,
0.18330617249011993,
-0.011121049523353577,
0.4145098626613617,
0.8992030620574951,
-0.1781964898109436,
1.2378013134002686,
-0.25901398062705994,
-0.5302829742431641,
-0.03974062576889992,
-0.7074108719825745,
-0.13115116953849792,
... |
func TestCloneRepo_Failure(t *testing.T) {
defer removeTempRepos()
rs := NewRepoService(testConf, gklog.NewNopLogger(), &statsd.Client{})
if err := rs.CloneRepo("/tmp", "github.com/briandown/smile"); err == nil {
t.Error("expected error but received none")
}
} | [
0.42295220494270325,
0.8889127373695374,
0.5040640830993652,
-0.06855854392051697,
-0.0012052921811118722,
0.3509221374988556,
0.3380264937877655,
-0.18265455961227417,
0.8830140233039856,
-0.24132244288921356,
-0.4734615683555603,
-0.24704235792160034,
-0.8648351430892944,
-0.425097405910... |
func LookupAssessment(ctx *pulumi.Context, args *LookupAssessmentArgs, opts ...pulumi.InvokeOption) (*LookupAssessmentResult, error) {
var rv LookupAssessmentResult
err := ctx.Invoke("azure-native:migrate/v20191001:getAssessment", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
} | [
-0.258910596370697,
-0.47428780794143677,
0.7516001462936401,
-0.009973865933716297,
-0.17132118344306946,
0.45089560747146606,
0.33474022150039673,
-0.5497434139251709,
1.0588984489440918,
0.5071709156036377,
0.8567747473716736,
0.7614097595214844,
-0.44581303000450134,
-1.356249094009399... |
func NewEncoder(f FormatType, w io.Writer) (enc Encoder) {
var e EncodeProvider = nil
switch f {
case TomlFormat:
e = NewTomlEncoder(w)
case YamlFormat:
e = NewYamlEncoder(w)
case JsonFormat:
e = json.NewEncoder(w)
default:
}
return Encoder{Provider: e}
} | [
-0.36120131611824036,
-0.8865708112716675,
0.2553827166557312,
0.5693323612213135,
-0.7303951978683472,
-0.2077856957912445,
-0.6166772842407227,
-0.13305458426475525,
0.25363340973854065,
-0.34569051861763,
0.6705789566040039,
0.4700521230697632,
0.3637518584728241,
0.932112991809845,
0... |
func NewDecoder(f FormatType, r io.Reader) (dec Decoder) {
var d DecodeProvider = nil
switch f {
case TomlFormat:
d = NewTomlDecoder(r)
case YamlFormat:
d = NewYamlDecoder(r)
case JsonFormat:
d = json.NewDecoder(r)
default:
}
return Decoder{Provider: d}
} | [
-0.3951968550682068,
-0.8852407932281494,
0.40780118107795715,
0.1777738481760025,
-1.0547893047332764,
-0.26785486936569214,
-0.9925990104675293,
0.0826026052236557,
0.2515747845172882,
-0.895526647567749,
0.688464879989624,
0.16424529254436493,
0.544950544834137,
0.7944915890693665,
1.... |
func (d Decoder) Decode(out interface{}) (err error) {
return d.Provider.Decode(out)
} | [
-1.1927275657653809,
0.8036375045776367,
0.2573961615562439,
0.8498605489730835,
-0.862943172454834,
-0.6360659599304199,
-0.1389758139848709,
-0.29529866576194763,
0.6221776008605957,
-0.27595388889312744,
-0.010116513818502426,
0.3495091497898102,
-0.05327417701482773,
0.5496199727058411... |
func NewWatcher() *Watcher {
return &Watcher{
LogFunc: noop,
Interval: 500,
}
} | [
0.06804011017084122,
-0.8617587089538574,
-0.05617142468690872,
0.6097334623336792,
-0.49284034967422485,
0.3233358561992645,
0.30786648392677307,
-0.7234104871749878,
-0.2669695019721985,
-1.0393656492233276,
-0.13056758046150208,
0.9230215549468994,
-0.23727884888648987,
0.68342906236648... |
func (w *Watcher) Run() {
for {
if w.closed {
break
}
time.Sleep(time.Millisecond * time.Duration(w.Interval))
l := len(w.Inputs)
w.LogFunc("Checking %d items...\n", l)
w.DoRemoval()
w.DoUpdate()
time.Sleep(time.Millisecond * time.Duration(w.Interval))
}
} | [
-0.43660199642181396,
-0.5609240531921387,
0.6824339032173157,
-0.1796647012233734,
0.44859009981155396,
0.502985954284668,
0.9872786402702332,
-0.0988394096493721,
-0.7831701040267944,
-0.0778595581650734,
-0.34398508071899414,
0.011526613496243954,
-0.8624898791313171,
0.7984288334846497... |
func (w *Watcher) DoUpdate() {
for _, i := range w.Inputs {
if w.closed {
return
}
newStats, err := i.GetStats()
if err == nil {
if i.LastErr != nil || w.isSameAs(i.KnownStats, newStats) == false {
i.Update(newStats)
}
} else {
if i.OnErrored != nil {
i.OnErrored(i, err)
}
w.LogFunc... | [
-0.49133995175361633,
-0.4374428987503052,
0.5817304253578186,
0.31319141387939453,
1.0183809995651245,
0.6000809073448181,
0.11995846033096313,
-1.3150843381881714,
-0.16077767312526703,
0.09405767917633057,
1.0713797807693481,
-0.2935377061367035,
-0.6345639228820801,
1.1103193759918213,... |
func (w *Watcher) DoRemoval() {
deletion := make([]int, 0)
for e, i := range w.Inputs {
if i.MarkedForDeletion {
deletion = append(deletion, e)
}
}
for i := 0; i < len(deletion); i++ {
index := deletion[i]
w.Inputs = append(w.Inputs[:index], w.Inputs[index+1:]...)
}
if len(deletion) > 0 {
w.LogFunc("... | [
-0.381389856338501,
0.0351390540599823,
0.6909643411636353,
-0.6611992716789246,
1.167762279510498,
-0.10273563116788864,
0.726265013217926,
0.355182409286499,
-0.27680718898773193,
0.41930633783340454,
-0.27192962169647217,
0.46025171875953674,
0.024557076394557953,
0.5951546430587769,
... |
func (w *Watcher) Close() {
w.LogFunc("Closing watcher...")
w.closed = true
} | [
0.15226194262504578,
-0.47415295243263245,
0.11238221079111099,
0.05075310170650482,
-0.0016306748148053885,
1.5370402336120605,
0.30942386388778687,
-0.1470983475446701,
-1.644614338874817,
-0.7952226996421814,
0.0904504731297493,
0.7128486037254333,
-0.6964630484580994,
2.104096174240112... |
func (w *Watcher) isSameAs(old Stats, newRes Stats) bool {
if len(old) != len(newRes) {
return false
}
for _, o := range old {
if newRes.ContainsSame(o) == false {
return false
}
}
for _, n := range newRes {
if old.ContainsSame(n) == false {
return false
}
}
return true
} | [
-0.04576800763607025,
-0.8675066828727722,
0.6014726758003235,
-0.2957628071308136,
0.28675201535224915,
-0.2943862974643707,
-0.43861520290374756,
-1.2879117727279663,
0.45642998814582825,
0.43776288628578186,
0.28997325897216797,
0.841133713722229,
0.5401952266693115,
1.1191831827163696,... |
func (w *Watcher) NewInput(p ProducerFunc) *Input {
ret := &Input{
Producer: p,
LogFunc: w.LogFunc,
}
w.Inputs = append(w.Inputs, ret)
return ret
} | [
0.014152769930660725,
-0.4655740261077881,
0.203507661819458,
0.45916423201560974,
-0.8199595808982849,
0.4241977334022522,
0.4859767556190491,
-0.6444676518440247,
0.22911421954631805,
-0.5815110802650452,
0.4295255243778229,
1.2586767673492432,
-0.6627469658851624,
-0.5116643905639648,
... |
func NewMetrics(subsystem string) *Metrics {
base := metrics.NewBase(subsystem, "")
return &Metrics{
Base: base,
FailedDatabaseMethods: promauto.NewCounterVec(prometheus.CounterOpts{
Name: "failed_database_operations",
Help: "Tracks the number of database failures",
Subsystem: base.SubsystemNam... | [
0.2577618360519409,
0.424591988325119,
0.7420089244842529,
-0.4006691575050354,
0.12602916359901428,
0.06583240628242493,
0.4544229805469513,
-0.7361066937446594,
-0.397941529750824,
-0.10205090790987015,
0.3627913296222687,
0.5612736940383911,
0.0009224574314430356,
0.6832782030105591,
... |
func NewDedupingFinder(sortedRecords []*common.Record, ra io.ReaderAt, combiner common.ObjectCombiner) common.Finder {
return &dedupingFinder{
ra: ra,
sortedRecords: sortedRecords,
combiner: combiner,
}
} | [
-0.9943819046020508,
-0.4815477728843689,
0.36638981103897095,
-0.13618868589401245,
-0.5740827918052673,
0.12319249659776688,
0.3946405053138733,
-0.01641499064862728,
0.08134197443723679,
-0.0045997705310583115,
-0.3506854474544525,
-0.7202057242393494,
0.1990414410829544,
0.727054178714... |
func GoID() int {
var buf [64]byte
n := runtime.Stack(buf[:], false)
idField := strings.Fields(strings.TrimPrefix(string(buf[:n]), "goroutine "))[0]
id, err := strconv.Atoi(idField)
if err != nil {
panic(fmt.Sprintf("cannot get goroutine id: %v", err))
}
return id
} | [
0.7472827434539795,
0.8868957757949829,
0.4756266474723816,
-0.3124394416809082,
0.48242130875587463,
0.10573996603488922,
0.2936638295650482,
-0.15364466607570648,
-0.5636892914772034,
1.06694757938385,
-0.551901638507843,
0.41956213116645813,
-1.6336876153945923,
-0.050901591777801514,
... |
func CreateTransaction(from uint, to uint, amount int) {
db := helpers.ConnectDB().Debug()
defer db.Close()
transaction := &interfaces.Transaction{From: from, To: to, Amount: amount}
db.Create(&transaction)
} | [
0.610847532749176,
0.2971683442592621,
0.41357704997062683,
-0.37317293882369995,
1.1300429105758667,
0.07758912444114685,
-0.3368530869483948,
-0.4690919816493988,
-0.6383408904075623,
0.3425871431827545,
-0.7170186042785645,
-1.3934274911880493,
-0.321593701839447,
-0.25535809993743896,
... |
func (bb *gcpBalancerBuilder) Build(
cc balancer.ClientConn,
opt balancer.BuildOptions,
) balancer.Balancer {
return &gcpBalancer{
cc: cc,
affinityMap: make(map[string]balancer.SubConn),
scRefs: make(map[balancer.SubConn]*subConnRef),
scStates: make(map[balancer.SubConn]connectivity.State),
... | [
-0.020442143082618713,
-1.2060308456420898,
0.3034704923629761,
0.2421257495880127,
0.5442160367965698,
1.0398945808410645,
-0.4986775815486908,
-0.45507365465164185,
0.02677547000348568,
-0.42075181007385254,
-0.6844236850738525,
0.3113974928855896,
-0.21874788403511047,
-0.02996370941400... |
func (*gcpBalancerBuilder) Name() string {
return Name
} | [
-0.17122025787830353,
-0.5111294984817505,
0.4082188010215759,
0.7780529856681824,
-0.3827107548713684,
1.9819083213806152,
0.37041643261909485,
-0.7839698791503906,
-0.07879386842250824,
0.37474191188812256,
-1.2513850927352905,
-0.8345796465873718,
-1.0126641988754272,
0.3849059641361236... |
func newBuilder() balancer.Builder {
return &gcpBalancerBuilder{
name: Name,
}
} | [
0.6269950866699219,
-0.3169023394584656,
0.2647663354873657,
0.5508840084075928,
-0.3032022714614868,
1.6317036151885986,
-0.48433899879455566,
-0.5571786165237427,
0.29401302337646484,
-0.7201844453811646,
-0.7028461694717407,
-0.8582006692886353,
-0.8146453499794006,
0.7255915403366089,
... |
func (cse *connectivityStateEvaluator) recordTransition(
oldState,
newState connectivity.State,
) connectivity.State {
// Update counters.
for idx, state := range []connectivity.State{oldState, newState} {
updateVal := 2*uint64(idx) - 1 // -1 for oldState and +1 for new.
switch state {
case connectivity.Ready... | [
-0.40770241618156433,
-0.21156781911849976,
0.489782452583313,
-0.7551271319389343,
-0.06961824744939804,
-0.4638904929161072,
-0.11031514406204224,
-0.1420571208000183,
0.02169940620660782,
0.08248470723628998,
-0.6172357201576233,
0.14405903220176697,
-0.15395139157772064,
-0.00514514604... |
func (gb *gcpBalancer) getConnectionPoolSize() int {
gb.mu.Lock()
defer gb.mu.Unlock()
return len(gb.scRefs)
} | [
-0.3600788414478302,
0.3187132775783539,
0.4317673444747925,
-0.6843879222869873,
-0.11077679693698883,
0.8176093697547913,
0.8192552328109741,
-0.07314042747020721,
-0.513769268989563,
-0.32688313722610474,
-0.26628634333610535,
-0.09060677140951157,
-1.2099517583847046,
-0.24716733396053... |
func (gb *gcpBalancer) newSubConn() {
gb.mu.Lock()
defer gb.mu.Unlock()
// there are chances the newly created subconns are still connecting,
// we can wait on those new subconns.
for _, scState := range gb.scStates {
if scState == connectivity.Connecting {
return
}
}
sc, err := gb.cc.NewSubConn(
gb.a... | [
0.3332405984401703,
-0.8011698126792908,
0.3890992999076843,
0.6042115092277527,
0.601740300655365,
-0.007972677238285542,
-0.20497705042362213,
-0.4574318528175354,
-0.22170323133468628,
-0.613140881061554,
-1.1055536270141602,
0.4380577802658081,
-0.10755201429128647,
0.15255321562290192... |
func (gb *gcpBalancer) getReadySubConnRef(boundKey string) (*subConnRef, bool) {
gb.mu.RLock()
defer gb.mu.RUnlock()
if sc, ok := gb.affinityMap[boundKey]; ok {
if gb.scStates[sc] != connectivity.Ready {
// It's possible that the bound subconn is not in the readySubConns list,
// If it's not ready yet, we t... | [
-0.4041454493999481,
-0.11073784530162811,
0.8481301069259644,
0.157906636595726,
-0.589178204536438,
-0.08893560618162155,
-0.2569911777973175,
-0.5834235548973083,
-0.06233282759785652,
0.1918962299823761,
-1.1661022901535034,
0.8232296109199524,
-0.30618196725845337,
0.3954598605632782,... |
func (gb *gcpBalancer) bindSubConn(bindKey string, sc balancer.SubConn) {
gb.mu.Lock()
defer gb.mu.Unlock()
_, ok := gb.affinityMap[bindKey]
if !ok {
gb.affinityMap[bindKey] = sc
}
gb.scRefs[sc].affinityIncr()
} | [
-0.06786661595106125,
-1.4115468263626099,
0.49351537227630615,
0.7938088774681091,
-0.287431538105011,
0.48947495222091675,
-0.2712034583091736,
0.37822800874710083,
-0.24358387291431427,
-0.25765499472618103,
-0.8719645142555237,
1.4819716215133667,
-0.31478503346443176,
0.26087546348571... |
func (gb *gcpBalancer) unbindSubConn(boundKey string) {
gb.mu.Lock()
defer gb.mu.Unlock()
boundSC, ok := gb.affinityMap[boundKey]
if ok {
gb.scRefs[boundSC].affinityDecr()
if gb.scRefs[boundSC].getAffinityCnt() <= 0 {
delete(gb.affinityMap, boundKey)
}
}
} | [
0.06974251568317413,
-1.1492204666137695,
0.7185731530189514,
0.032216235995292664,
-0.9554188251495361,
0.6470085978507996,
0.42875799536705017,
0.2121114581823349,
-0.28202247619628906,
-0.1380614936351776,
-0.16931498050689697,
1.1799557209014893,
-0.6168614625930786,
0.7195725440979004... |
func (gb *gcpBalancer) regeneratePicker() {
gb.mu.RLock()
defer gb.mu.RUnlock()
if gb.state == connectivity.TransientFailure {
gb.picker = newErrPicker(balancer.ErrTransientFailure)
return
}
readyRefs := []*subConnRef{}
// Select ready subConns from subConn map.
for sc, scState := range gb.scStates {
if ... | [
-1.0483589172363281,
-0.35080665349960327,
0.5393907427787781,
-0.32108113169670105,
0.71980220079422,
0.4110023081302643,
0.30154791474342346,
-0.150796040892601,
-0.8706110119819641,
-0.3172578513622284,
-0.739819347858429,
0.07752019912004471,
-0.3242137134075165,
0.029510866850614548,
... |
func NewSpinner(out io.Writer) (Spinner, error) {
spinner, err := yacspin.New(yacspin.Config{
CharSet: yacspin.CharSets[9],
Frequency: 100 * time.Millisecond,
StopCharacter: "✓",
StopColors: []string{"fgGreen"},
StopFailCharacter: "✗",
StopFailColors: []string{"fgRed"},
Su... | [
-0.033414289355278015,
-0.9054214954376221,
0.2602926194667816,
0.0918964371085167,
-1.167090892791748,
-0.06426949054002762,
0.1620141565799713,
-0.16516099870204926,
-0.08307500183582306,
-0.27553853392601013,
-0.5949923992156982,
0.12461917102336884,
0.18430933356285095,
0.7096142172813... |
func NewTileSet(ctx context.Context, path string) (t *pb.TileSet, err error) {
f, err := os.Open(path)
if err != nil {
return
}
defer f.Close()
t = &pb.TileSet{}
d := tsx.NewDecoder(f)
err = d.Decode(t)
if err != nil {
err = errors.Wrap(err, "marshal")
return
}
return
} | [
0.1742977648973465,
-0.3097608685493469,
0.4402891993522644,
-0.785938024520874,
-1.285972237586975,
-0.13391317427158356,
-0.35698533058166504,
-0.12267014384269714,
-0.9145495295524597,
-0.255111426115036,
0.09452489018440247,
0.7212250828742981,
-0.4509121775627136,
-0.6181275844573975,... |
func List(w http.ResponseWriter, r *http.Request) {
var dl models.DirList
dl.Path = r.URL.Path
// scan the current path
err := dl.ScanPath(r.URL.Path)
if err != nil {
http.Error(w, err.Error(), http.StatusNotFound)
return
}
// repair url if someone misses a /
if dl.Redirect {
http.Redirect(w, r, r.URL.Pa... | [
-0.6610761880874634,
-0.23573173582553864,
0.9474501609802246,
0.009278850629925728,
-0.3082799017429352,
-0.2887985110282898,
0.3735314607620239,
0.7954769730567932,
0.24399517476558685,
-0.6528230905532837,
0.6222004890441895,
-0.6439222097396851,
-0.1484590768814087,
0.3094406723976135,... |
func (factory *ApplicationControllerFactory) Create() controller.RunnableController {
applicationLW := &cache.ListWatch{
ListFunc: func(options kapi.ListOptions) (runtime.Object, error) {
return factory.Client.Applications(kapi.NamespaceAll).List(options)
},
WatchFunc: func(options kapi.ListOptions) (watch.... | [
0.8781992793083191,
-0.04765531048178673,
0.7343876361846924,
0.4513406753540039,
0.16026939451694489,
-0.17086617648601532,
-0.5161795020103455,
-0.7656498551368713,
-0.3528212010860443,
0.177463099360466,
0.14592471718788147,
0.038635898381471634,
0.2456483691930771,
0.6477433443069458,
... |
func (r *StoreRepository) CreateStore(store *model.Store) error {
_id := bson.NewObjectId()
store.Id = _id
err := r.C.Insert(&store)
return err
} | [
-0.3028457760810852,
0.07277204096317291,
0.10021448135375977,
0.38485974073410034,
0.3830144703388214,
0.5569556355476379,
-0.045963555574417114,
0.014252187684178352,
0.45941630005836487,
-0.29149702191352844,
-0.7591131925582886,
-1.5513464212417603,
-1.0816434621810913,
0.2339842915534... |
func (r *StoreRepository) UpdatePhone(store *model.Store) error {
err := r.C.Update(bson.M{"_id": store.Id}, bson.M{
"$set": bson.M{
"Phone": store.Phone,
},
})
return err
} | [
-0.8407793641090393,
-0.14932537078857422,
0.18871141970157623,
0.5105347037315369,
-0.4209306240081787,
0.6271674633026123,
-0.4470929801464081,
-0.16981013119220734,
0.9248105883598328,
0.5872307419776917,
0.38976213335990906,
-0.8985564708709717,
-0.1416623294353485,
0.3578987717628479,... |
func (c *ClusterEtcdint) Start() error {
wal.SegmentSizeBytes = c.cfg.WalSize
e, err := embed.StartEtcd(c.etcdcfg)
if err != nil {
return err
}
select {
case <-e.Server.ReadyNotify():
c.etcdsrv = e
break
case <-time.After(60 * time.Second):
e.Server.Stop() // trigger a shutdown
return errors.New("Serve... | [
-0.06434628367424011,
0.133678138256073,
0.33044466376304626,
-0.6623499393463135,
0.3384920656681061,
0.04428115487098694,
-0.2741755545139313,
0.6065358519554138,
-0.8048353791236877,
0.4460658133029938,
-0.06326920539140701,
0.5460213422775269,
-0.3822839856147766,
0.27565833926200867,
... |
func (c *ClusterEtcdint) Stop() error {
c.etcdsrv.Server.Stop()
return nil
} | [
-1.0239267349243164,
0.4166416823863983,
0.03528238832950592,
-1.41776704788208,
0.3431446850299835,
0.7071056962013245,
-0.5592089295387268,
0.10763049125671387,
-1.3151049613952637,
0.18018817901611328,
-0.0187053345143795,
0.01025344803929329,
-0.6336326599121094,
-0.07022382318973541,
... |
func (pop Population) cluster(k int) Populations {
var (
pops = make(Populations, k)
n = len(pop.Individuals)
m = min(int(math.Ceil(float64(n/k))), n)
)
for i := range pops {
var (
a = i * m
b = min((i+1)*m, n)
)
pops[i] = Population{
Individuals: pop.Individuals[a:b],
rng: pop.... | [
-0.7172080874443054,
0.4105209708213806,
0.30925557017326355,
0.19799485802650452,
-0.40796980261802673,
0.6953688859939575,
0.21905383467674255,
-0.4269509017467499,
0.9970676898956299,
1.3950390815734863,
0.01936335302889347,
0.6066698431968689,
0.26008620858192444,
-0.3582143783569336,
... |
func (pops Populations) merge() Individuals {
var indis Individuals
for _, pop := range pops {
indis = append(indis, pop.Individuals...)
}
return indis
} | [
-2.2533116340637207,
-0.0945730209350586,
0.4590059220790863,
0.18661659955978394,
-0.09066618978977203,
1.2914901971817017,
-0.605710506439209,
0.42958977818489075,
-0.3185279071331024,
-0.05492137372493744,
-0.2896807789802551,
-0.15819577872753143,
-1.0796784162521362,
-0.12707316875457... |
func ReadDeck(r io.ReadCloser, w, h int) (Deck, error) {
var d Deck
err := xml.NewDecoder(r).Decode(&d)
if d.Canvas.Width == 0 {
d.Canvas.Width = w
}
if d.Canvas.Height == 0 {
d.Canvas.Height = h
}
r.Close()
return d, err
} | [
0.016813436523079872,
0.5948541164398193,
0.8285191059112549,
-0.05542423576116562,
-1.693731427192688,
0.1618945151567459,
-0.394291490316391,
-0.26566043496131897,
-0.5203685760498047,
-1.2837226390838623,
1.6454261541366577,
-0.6530650854110718,
-0.26050421595573425,
1.1911791563034058,... |
func Read(filename string, w, h int) (Deck, error) {
var d Deck
if filename == "-" {
return ReadDeck(os.Stdin, w, h)
}
r, err := os.Open(filename)
if err != nil {
return d, err
}
return ReadDeck(r, w, h)
} | [
0.2825402617454529,
0.30699822306632996,
0.7594151496887207,
0.6500757932662964,
-1.102449655532837,
0.5217333436012268,
-0.05537828058004379,
0.568310558795929,
-0.9835954904556274,
-0.3997393548488617,
0.8459446430206299,
0.2379882037639618,
-0.09646628797054291,
1.1258103847503662,
0.... |
func Dimen(c canvas, xp, yp, sp float64) (x, y, s float64) {
x = (xp / 100) * float64(c.Width)
y = (yp / 100) * float64(c.Height)
s = (sp / 100) * float64(c.Width)
return
} | [
-0.0805678740143776,
-0.1160387173295021,
0.6129003763198853,
-0.000839819957036525,
0.14822369813919067,
-0.7682952880859375,
0.23884044587612152,
0.11101119220256805,
0.024731211364269257,
0.04152059182524681,
-1.0658223628997803,
-0.6571997404098511,
0.7658956050872803,
-0.5648474097251... |
func Pwidth(wp, cw, defval float64) float64 {
if wp == 0 {
return defval
}
return (wp / 100) * cw
} | [
0.15598663687705994,
0.6945252418518066,
0.3242376148700714,
0.4715029001235962,
-0.3534720242023468,
0.6048592329025269,
-0.16162177920341492,
0.277460515499115,
0.15447404980659485,
0.0675605908036232,
0.8229578137397766,
0.04475818946957588,
-0.4882688522338867,
0.7922070622444153,
-0... |
func Search(d Deck, s string) int {
// for every slide...
for i, slide := range d.Slide {
// search lists
for _, l := range slide.List {
for _, ll := range l.Li {
if strings.Contains(ll.ListText, s) {
return i
}
}
}
// search text
for _, t := range slide.Text {
if strings.Contains(t.Td... | [
-0.8173467516899109,
-0.19469057023525238,
0.7645461559295654,
-1.0440791845321655,
-1.1563948392868042,
-0.20057645440101624,
0.23829609155654907,
1.046637773513794,
-0.43739011883735657,
-0.4701923727989197,
-0.48411256074905396,
-0.0034134602174162865,
-0.12425437569618225,
1.0432016849... |
func Dump(d Deck) {
fmt.Printf("Title: %#v\nCreator: %#v\nDescription: %#v\nDate: %#v\nPublisher: %#v\nSubject: %#v\n",
d.Title, d.Creator, d.Description, d.Date, d.Publisher, d.Subject)
fmt.Printf("Canvas = %v\n", d.Canvas)
for i, s := range d.Slide {
fmt.Printf("Slide [%d] = %+v %+v %+v %+v %+v %+v\n", i, s.Bg... | [
-0.08071225136518478,
-0.11201027035713196,
0.9511187672615051,
-1.4389870166778564,
-0.3944409191608429,
0.4512050449848175,
0.2060827761888504,
-0.2704378068447113,
-0.1205211654305458,
-0.5858914852142334,
-0.29877951741218567,
0.481152206659317,
0.5769574642181396,
0.8658245801925659,
... |
func (s *Server) EventsResolver(p graphql.ResolveParams) (interface{}, error) {
var lat float64
var lon float64
var totalTime string
var ok bool
if lat, ok = p.Args["lat"].(float64); !ok {
lat = 34.079701
}
if lon, ok = p.Args["lon"].(float64); !ok {
lon = -118.269421
}
if totalTime, ok = p.Args["totalTi... | [
-0.4505552351474762,
-0.354882150888443,
0.9171913862228394,
-0.3888496160507202,
0.37675824761390686,
-0.3479990065097809,
-0.4885583519935608,
0.06636988371610641,
-0.4204476773738861,
-0.09974626451730728,
0.17164020240306854,
-0.3706515431404114,
-0.4823787808418274,
0.4938386380672455... |
func partition(a []int, low, high int) int {
i := low - 1
pivot := a[high]
for j := low; j < high; j++ {
if a[j] <= pivot {
i++
a[i], a[j] = a[j], a[i]
}
a[i+1], a[high] = a[high], a[i+1]
}
return i + 1
} | [
0.10375208407640457,
0.11425311863422394,
0.4328722059726715,
-0.9978289604187012,
-0.781213641166687,
-0.6997963190078735,
0.3603523373603821,
0.16708894073963165,
0.6816902756690979,
0.37302640080451965,
-0.017959484830498695,
0.1716586798429489,
-0.2750301659107208,
-0.19764184951782227... |
func (p *Proxy) director(_ *http.Request) {} | [
-1.8030163049697876,
-0.47005265951156616,
0.3888305127620697,
0.2577701508998871,
-0.6060739755630493,
0.3748849928379059,
0.2101898491382599,
-0.43026891350746155,
-0.01252024993300438,
-0.8132879137992859,
0.5754810571670532,
0.47709566354751587,
0.3668585419654846,
0.28753340244293213,... |
func (t *TokenSource) Token() (*oauth2.Token, error) {
return &oauth2.Token{
AccessToken: t.AccessToken,
}, nil
} | [
-0.20783303678035736,
-0.3078913986682892,
0.14437970519065857,
-0.4078826904296875,
-0.6763656139373779,
-0.7750183343887329,
0.26727285981178284,
1.0641452074050903,
0.5881069898605347,
-1.4853423833847046,
-0.4216504693031311,
1.0533784627914429,
1.5018585920333862,
-1.0748437643051147,... |
func GetClient(token string) *godo.Client {
tokenSource := &TokenSource{AccessToken: token}
oauthClient := oauth2.NewClient(oauth2.NoContext, tokenSource)
client := godo.NewClient(oauthClient)
client.BaseURL = GodoBase
return client
} | [
0.046602267771959305,
0.21469342708587646,
0.18648575246334076,
-0.722956657409668,
-0.257981538772583,
-0.3732813894748688,
-0.32136958837509155,
0.10001019388437271,
-0.2966618835926056,
-0.7613605856895447,
-0.6794994473457336,
1.6889363527297974,
0.523690938949585,
-1.0699882507324219,... |
func WhoAmI(cmd *cobra.Command) int {
client := metadata.NewClient(metadata.WithBaseURL(MetadataBase))
id, err := client.DropletID()
if err != nil {
fmt.Println("Error: ", err)
cmd.Help()
os.Exit(1)
}
return id
} | [
0.11870599538087845,
-0.240571066737175,
0.724635899066925,
0.10620225965976715,
0.14274942874908447,
0.5402456521987915,
0.6082947850227356,
-0.037385884672403336,
-0.8273987174034119,
0.5592440366744995,
-0.37258556485176086,
0.23766903579235077,
-0.818126380443573,
-0.2932926416397095,
... |
func TokenCheck(cmd *cobra.Command, args []string) {
if Token == "" {
fmt.Println("The '--token flag or $DIGITALOCEAN_TOKEN environmental variable must be set.")
os.Exit(1)
}
} | [
0.42659810185432434,
0.4969964027404785,
0.3064189553260803,
0.34790095686912537,
1.2657742500305176,
0.6371937394142151,
0.5999717116355896,
0.2874820828437805,
-0.8915949463844299,
0.2386520802974701,
0.6407116055488586,
1.6843862533569336,
0.19407065212726593,
0.7487419247627258,
0.40... |
func New(URL string, username string, password string) *Hub {
c := newClient(URL+"/cgi/json-req", username, password)
log.SetPrefix("INFO: ")
log.SetFlags(log.LstdFlags)
log.SetOutput(ioutil.Discard)
return &Hub{c}
} | [
-0.598131537437439,
-0.6075682044029236,
0.5628682971000671,
0.565967857837677,
-0.1325504034757614,
0.34550321102142334,
0.08510441333055496,
0.13901153206825256,
-0.9817003011703491,
-0.44551485776901245,
0.12013287097215652,
0.7220475077629089,
0.5020285248756409,
0.3056325316429138,
... |
func (h *Hub) BroadbandProductType() (result string, err error) {
i, err := h.client.sendXPathRequest(mySagemcomBoxDeviceInfoInterfaceType)
if err != nil {
return "", err
}
if i == "FTTX" {
return "BT Infinity 3 and 4", nil
} else if i == "VDSL" {
return "BT Infinity", nil
}
return "BT Broadband", nil
} | [
-0.8001357913017273,
0.23906351625919342,
0.6265694499015808,
0.27418988943099976,
0.5016984939575195,
0.3881034553050995,
0.3943374752998352,
-0.9326866269111633,
0.7208156585693359,
0.38885170221328735,
-0.29847076535224915,
0.5880921483039856,
-1.1045200824737549,
0.15035498142242432,
... |
func (h *Hub) DataPumpVersion() (result string, err error) {
return h.client.sendXPathRequest(mySagemcomBoxDeviceInfoDatapumpVersion)
} | [
-1.2340737581253052,
0.26502323150634766,
0.41221052408218384,
0.3077083230018616,
0.4214419424533844,
-0.31034812331199646,
0.5422850847244263,
-0.16224700212478638,
0.5153336524963379,
0.16445401310920715,
-1.2747313976287842,
0.14679692685604095,
-0.692979097366333,
-0.3261987566947937,... |
func (h *Hub) DataReceived() (result string, err error) {
return h.client.sendXPathRequest(mySagemcomBoxBasicStatusDataUsageReceived)
} | [
-0.13188035786151886,
-0.060737449675798416,
0.6359654664993286,
-0.45615154504776,
0.6627874374389648,
-0.40164610743522644,
-0.4302116930484772,
0.6528308987617493,
0.4169670045375824,
-0.9732305407524109,
-1.1499277353286743,
-0.014594188891351223,
-0.09865245968103409,
-0.2177532166242... |
func (h *Hub) DataSent() (result string, err error) {
return h.client.sendXPathRequest(mySagemcomBoxBasicStatusDataUsageSent)
} | [
-0.5378908514976501,
0.3163551986217499,
0.33741995692253113,
-0.3751325309276581,
0.8073426485061646,
-0.7443708777427673,
-0.43870893120765686,
-0.4847548007965088,
-0.022887177765369415,
-0.1649790108203888,
-0.9815114736557007,
0.6444367170333862,
-0.7122100591659546,
0.188052877783775... |
func (h *Hub) DhcpPoolStart() (result string, err error) {
return h.client.sendXPathRequest(mySagemcomBoxDhcpIpv4PoolStart)
} | [
-0.9494149684906006,
0.15035255253314972,
0.34964221715927124,
0.3723808825016022,
0.45470449328422546,
-0.168278768658638,
0.3875895142555237,
-0.43984878063201904,
0.4725722372531891,
0.16315783560276031,
-0.5588684678077698,
0.8204501271247864,
-0.6424686908721924,
-0.31599849462509155,... |
func (h *Hub) DhcpPoolEnd() (result string, err error) {
return h.client.sendXPathRequest(mySagemcomBoxDhcpIpv4PoolEnd)
} | [
-0.8521219491958618,
0.3993341326713562,
0.31194359064102173,
0.5107332468032837,
0.32752883434295654,
0.0578254871070385,
0.18848948180675507,
-0.7057375907897949,
-0.25014814734458923,
0.5271141529083252,
-0.5040688514709473,
0.28685542941093445,
-1.1020835638046265,
0.17248722910881042,... |
func (h *Hub) DhcpSubnetMask() (result string, err error) {
return h.client.sendXPathRequest(mySagemcomBoxDeviceInfoLocalSubnetMask)
} | [
-0.31987980008125305,
0.2956080138683319,
0.4291609227657318,
0.9892813563346863,
0.893034040927887,
-0.22321268916130066,
0.09205775707960129,
-0.871123194694519,
-0.0697033703327179,
-0.9519166350364685,
-1.0226683616638184,
0.6413823962211609,
-0.31130197644233704,
-0.349948912858963,
... |
func (h *Hub) DownstreamSyncSpeed() (result string, err error) {
return h.client.sendXPathRequest(mySagemcomBoxBasicStatusDownstreamSyncSpeedDsl)
} | [
-0.03668872267007828,
0.8801388740539551,
0.3427451252937317,
0.6888781189918518,
0.1644110530614853,
-0.16358545422554016,
0.7906680703163147,
0.214481920003891,
0.05452895909547806,
-0.5810227394104004,
-0.720421314239502,
1.348270297050476,
-1.1050242185592651,
0.48102420568466187,
-0... |
func (h *Hub) EnableDebug(enable bool) {
if enable {
log.SetOutput(os.Stdout)
} else {
log.SetOutput(ioutil.Discard)
}
} | [
1.2480461597442627,
0.11291726678609848,
0.7551310062408447,
0.6662335991859436,
0.2858114540576935,
0.7104126214981079,
-0.1777140200138092,
1.327132225036621,
-0.05986590310931206,
-0.43763256072998047,
-0.11556076258420944,
-0.30955368280410767,
-0.4218193590641022,
0.3388533890247345,
... |
func (h *Hub) HardwareVersion() (result string, err error) {
return h.client.sendXPathRequest(mySagemcomBoxDeviceInfoHardwareVersion)
} | [
-0.7424669861793518,
0.46310552954673767,
0.4710642099380493,
1.3372989892959595,
0.3914538323879242,
-0.020347965881228447,
0.9308931231498718,
-0.09362345188856125,
-0.019746892154216766,
0.2559228241443634,
-0.7750743627548218,
0.29285988211631775,
-1.1339914798736572,
0.476216435432434... |
func (h *Hub) InternetConnectionStatus() (result string, err error) {
return h.client.sendXPathRequest(mySagemcomBoxDeviceInfoWanInternetStatus)
} | [
-1.0884044170379639,
-0.9403219819068909,
0.3741794228553772,
0.024563506245613098,
0.3067164123058319,
-0.5214425325393677,
0.1300077736377716,
-0.17876110970973969,
0.36515551805496216,
1.1446701288223267,
-0.615147590637207,
-0.3384816348552704,
-1.2716797590255737,
0.001021495321765542... |
func (h *Hub) LightStatus() (result string, err error) {
return h.client.sendXPathRequest(mySagemcomBoxDeviceInfoHubLightStatus)
} | [
0.025183331221342087,
-0.5632824301719666,
0.26391175389289856,
0.57919842004776,
0.19699057936668396,
-0.37760046124458313,
-0.14408229291439056,
0.30825474858283997,
0.908645510673523,
-0.3681577742099762,
-1.1920841932296753,
0.3146228790283203,
-0.648047924041748,
0.6237983703613281,
... |
func (h *Hub) LocalTime() (result string, err error) {
return h.client.sendXPathRequest(mySagemcomBoxMaintenanceNtpLocalTime)
} | [
0.35925620794296265,
-0.14359095692634583,
0.4467594027519226,
0.20936109125614166,
-0.24477249383926392,
-0.23879458010196686,
-0.17444626986980438,
-0.17738401889801025,
0.6680126786231995,
0.6494384407997131,
0.07574155926704407,
-0.4388720691204071,
-1.4142102003097534,
0.0104279061779... |
func (h *Hub) Login() (success bool, err error) {
req := newRequest(&h.client.authData, "logIn", "")
resp, err := req.send()
if err == nil {
h.client.authData.sessionID = strconv.Itoa(resp.ResponseBody.Reply.ResponseActions[0].ResponseCallbacks[0].Parameters.ID)
h.client.authData.nonce = resp.ResponseBody.Reply... | [
-0.6663452982902527,
0.33663713932037354,
1.0253421068191528,
0.42613697052001953,
0.03208481892943382,
0.44711726903915405,
-0.08450346440076828,
-0.39562830328941345,
0.5430877208709717,
0.22934114933013916,
-0.41897809505462646,
0.6141059398651123,
-1.0237054824829102,
-0.16796751320362... |
func (h *Hub) MaintenaceFirmwareVersion() (result string, err error) {
return h.client.sendXPathRequest(technicalLogFirmwareVersion)
} | [
-0.2341078817844391,
0.24381068348884583,
0.35140925645828247,
0.25412511825561523,
-0.4582497775554657,
-0.3621565103530884,
0.41491565108299255,
-0.8317668437957764,
-0.4768577516078949,
0.4673558175563812,
-0.1480080485343933,
-0.14105571806430817,
-0.35830649733543396,
0.82368236780166... |
func (h *Hub) PublicIPAddress() (result string, err error) {
return h.client.sendXPathRequest(mySagemcomBoxDeviceInfoPublicIpv4)
} | [
-0.8238565325737,
-0.5514333844184875,
0.29463058710098267,
0.5992967486381531,
-0.21488799154758453,
-0.6035095453262329,
0.5665361285209656,
0.0784190446138382,
0.24541789293289185,
-0.3804816007614136,
-0.8920193314552307,
0.17517675459384918,
-1.0111255645751953,
-0.22046639025211334,
... |
func (h *Hub) PublicSubnetMask() (result string, err error) {
return h.client.sendXPathRequest(mySagemcomBoxDeviceInfoPublicSubnetMask)
} | [
-0.6403509378433228,
0.4198322296142578,
0.2523747682571411,
1.1899499893188477,
0.2268531769514084,
0.19791895151138306,
-0.21262377500534058,
-1.0027893781661987,
-0.7545088529586792,
-1.6638786792755127,
-1.481850504875183,
1.0137726068496704,
0.20234765112400055,
0.44090086221694946,
... |
func (h *Hub) Reboot() (result string, err error) {
// TODO: Figure out why the response is HTTP 500 and why there is a delay till the router reboots
return h.client.sendXPathRequest("Device")
} | [
-0.8174712657928467,
0.854354739189148,
0.5087699890136719,
1.5021713972091675,
0.5970549583435059,
-0.4569198191165924,
0.34063851833343506,
0.016893217340111732,
0.9632808566093445,
0.09131960570812225,
0.36033812165260315,
0.18296919763088226,
-1.2214322090148926,
-0.32534024119377136,
... |
func (h *Hub) SambaIP() (result string, err error) {
return h.client.sendXPathRequest(mymediaSambaIP)
} | [
-0.8493503928184509,
-0.32896509766578674,
0.42291903495788574,
1.712367057800293,
-0.7949592471122742,
-0.3216848373413086,
0.2008657455444336,
0.6568053364753723,
0.9229893088340759,
0.8652520775794983,
-0.13159167766571045,
-0.11632662266492844,
-0.8725258708000183,
-0.404347687959671,
... |
func (h *Hub) SambaHost() (result string, err error) {
return h.client.sendXPathRequest(mymediaSambaHost)
} | [
0.32130932807922363,
0.1996130645275116,
0.48080116510391235,
1.4666814804077148,
-0.5651646256446838,
-0.035225436091423035,
-0.01332775503396988,
0.6764031648635864,
0.30359458923339844,
0.9175671339035034,
-0.3840271830558777,
0.5625743269920349,
-1.1712067127227783,
-0.2885773777961731... |
func (h *Hub) SerialNumber() (result string, err error) {
return h.client.sendXPathRequest(mySagemcomBoxDeviceInfoSerialNumber)
} | [
-0.9708967208862305,
-0.28220275044441223,
0.4873236119747162,
1.101494312286377,
0.12206753343343735,
-1.0909522771835327,
1.1522088050842285,
0.4685938060283661,
1.501781702041626,
-0.8642969131469727,
-0.6018944978713989,
0.643695592880249,
-0.5967710018157959,
-0.13221633434295654,
1... |
func (h *Hub) SoftwareVersion() (result string, err error) {
return h.client.sendXPathRequest(mySagemcomBoxDeviceInfoSoftwareVersion)
} | [
-0.7582538723945618,
-0.010229607112705708,
0.3854178488254547,
1.4433873891830444,
-0.3207240402698517,
-0.5559101700782776,
1.1413886547088623,
-0.06837588548660278,
0.705956757068634,
-0.1066688746213913,
-0.9974387884140015,
-0.36832195520401,
-0.7295001745223999,
0.8470296263694763,
... |
func (h *Hub) UpstreamSyncSpeed() (result string, err error) {
return h.client.sendXPathRequest(mySagemcomBoxBasicStatusUpstreamSyncSpeedDsl)
} | [
-0.6957505345344543,
0.681956946849823,
0.4833734929561615,
0.18774527311325073,
-0.4208299219608307,
-0.2013430893421173,
0.6838241219520569,
0.30096903443336487,
0.12816913425922394,
0.3127973973751068,
-0.6964362859725952,
1.2582954168319702,
-0.6569971442222595,
0.5505802631378174,
0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.