text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (mmExchange *mMDNSClientMockExchange) Expect(msg *mdns.Msg, address string) *mMDNSClientMockExchange {
if mmExchange.mock.funcExchange != nil {
mmExchange.mock.t.Fatalf("MDNSClientMock.Exchange mock is already set by Set")
}
if mmExchange.defaultExpectation == nil {
mmExchange.defaultExpectation = &MDNSCli... | [
-0.3206958472728729,
0.7955845594406128,
0.4849226772785187,
-0.5035204291343689,
0.03898048400878906,
-0.361493319272995,
0.04117236286401749,
0.23733042180538177,
0.8068609237670898,
0.043798428028821945,
0.5870863199234009,
0.817249596118927,
-0.3901439309120178,
0.49230873584747314,
... |
func (mmExchange *mMDNSClientMockExchange) Inspect(f func(msg *mdns.Msg, address string)) *mMDNSClientMockExchange {
if mmExchange.mock.inspectFuncExchange != nil {
mmExchange.mock.t.Fatalf("Inspect function is already set for MDNSClientMock.Exchange")
}
mmExchange.mock.inspectFuncExchange = f
return mmExchange... | [
-0.7415384650230408,
0.583138644695282,
0.47451868653297424,
-0.7397719621658325,
-0.6109139323234558,
-0.40598776936531067,
0.570519208908081,
0.5409048795700073,
0.45661044120788574,
0.1629226952791214,
0.6796894073486328,
0.34578096866607666,
0.15443812310695648,
0.02521071396768093,
... |
func (mmExchange *mMDNSClientMockExchange) Return(r *mdns.Msg, rtt time.Duration, err error) *MDNSClientMock {
if mmExchange.mock.funcExchange != nil {
mmExchange.mock.t.Fatalf("MDNSClientMock.Exchange mock is already set by Set")
}
if mmExchange.defaultExpectation == nil {
mmExchange.defaultExpectation = &MDNS... | [
-0.6686051487922668,
0.8666867613792419,
0.2876822054386139,
-0.4924474358558655,
-0.1993931233882904,
-0.12603966891765594,
0.16861188411712646,
-0.31929659843444824,
0.6500343680381775,
0.47437769174575806,
0.5251823663711548,
-0.0008098341058939695,
-0.5944022536277771,
0.10376226156949... |
func (mmExchange *mMDNSClientMockExchange) Set(f func(msg *mdns.Msg, address string) (r *mdns.Msg, rtt time.Duration, err error)) *MDNSClientMock {
if mmExchange.defaultExpectation != nil {
mmExchange.mock.t.Fatalf("Default expectation is already set for the mDNSClient.Exchange method")
}
if len(mmExchange.expect... | [
-0.8725041747093201,
0.9966579079627991,
0.3840009570121765,
-0.8481248617172241,
0.32643890380859375,
-0.24906937777996063,
0.26645737886428833,
0.1703537106513977,
0.10326847434043884,
0.21806256473064423,
0.4441605508327484,
0.38121792674064636,
-0.03920117765665054,
0.47381627559661865... |
func (mmExchange *mMDNSClientMockExchange) When(msg *mdns.Msg, address string) *MDNSClientMockExchangeExpectation {
if mmExchange.mock.funcExchange != nil {
mmExchange.mock.t.Fatalf("MDNSClientMock.Exchange mock is already set by Set")
}
expectation := &MDNSClientMockExchangeExpectation{
mock: mmExchange.mock... | [
-0.010937725193798542,
0.6558179259300232,
0.5114994049072266,
-0.9971862435340881,
-0.8695895075798035,
-0.36760586500167847,
-0.36521002650260925,
0.4500944912433624,
0.9585654735565186,
-0.08961576968431473,
0.0375017374753952,
0.954140841960907,
-0.016420558094978333,
0.188084825873374... |
func (e *MDNSClientMockExchangeExpectation) Then(r *mdns.Msg, rtt time.Duration, err error) *MDNSClientMock {
e.results = &MDNSClientMockExchangeResults{r, rtt, err}
return e.mock
} | [
-0.13005192577838898,
0.2786487340927124,
0.26255056262016296,
-0.7244036793708801,
-0.03511194884777069,
-0.08367181569337845,
-0.3507937490940094,
-0.19143182039260864,
0.13232265412807465,
-0.32071003317832947,
-0.7509629130363464,
0.44397616386413574,
0.015886636450886726,
-0.157479986... |
func (mmExchange *MDNSClientMock) ExchangeAfterCounter() uint64 {
return mm_atomic.LoadUint64(&mmExchange.afterExchangeCounter)
} | [
0.2731260657310486,
0.21422332525253296,
0.2882821559906006,
-0.6742978692054749,
-1.337287187576294,
-0.1672130525112152,
0.7957522869110107,
0.3881075382232666,
0.965380072593689,
-0.4889213442802429,
-0.2547428607940674,
-0.29576629400253296,
-0.2559235692024231,
0.8425818085670471,
0... |
func (mmExchange *MDNSClientMock) ExchangeBeforeCounter() uint64 {
return mm_atomic.LoadUint64(&mmExchange.beforeExchangeCounter)
} | [
0.15541186928749084,
0.759846568107605,
0.35231369733810425,
-0.8908673524856567,
-0.8393190503120422,
-0.3790046274662018,
0.6907263398170471,
0.029458925127983093,
1.1499234437942505,
-0.25972506403923035,
0.13111957907676697,
-0.13795706629753113,
-0.4811130166053772,
0.7864290475845337... |
func (mmExchange *mMDNSClientMockExchange) Calls() []*MDNSClientMockExchangeParams {
mmExchange.mutex.RLock()
argCopy := make([]*MDNSClientMockExchangeParams, len(mmExchange.callArgs))
copy(argCopy, mmExchange.callArgs)
mmExchange.mutex.RUnlock()
return argCopy
} | [
-1.304839015007019,
0.3902451992034912,
0.41427871584892273,
-0.1892806887626648,
0.022870725020766258,
0.16635297238826752,
-1.2170913219451904,
-0.755838930606842,
1.0652546882629395,
0.45671695470809937,
-0.1445334106683731,
0.4682193696498871,
-0.9767990708351135,
0.5669554471969604,
... |
func (m *MDNSClientMock) MinimockExchangeDone() bool {
for _, e := range m.ExchangeMock.expectations {
if mm_atomic.LoadUint64(&e.Counter) < 1 {
return false
}
}
// if default expectation was set then invocations count should be greater than zero
if m.ExchangeMock.defaultExpectation != nil && mm_atomic.Load... | [
-0.35049450397491455,
1.0555915832519531,
0.6118807196617126,
0.12330765277147293,
0.3101816773414612,
-0.013393977656960487,
0.3528079092502594,
0.27780839800834656,
-0.0768565759062767,
-0.4411430060863495,
0.16855642199516296,
-0.2597372829914093,
-0.9336878657341003,
0.7235692739486694... |
func (m *MDNSClientMock) MinimockExchangeInspect() {
for _, e := range m.ExchangeMock.expectations {
if mm_atomic.LoadUint64(&e.Counter) < 1 {
m.t.Errorf("Expected call to MDNSClientMock.Exchange with params: %#v", *e.params)
}
}
// if default expectation was set then invocations count should be greater than... | [
0.3076115846633911,
0.36993473768234253,
0.6454101800918579,
-0.6207139492034912,
0.001998782390728593,
-0.286080926656723,
0.28645434975624084,
-0.139549121260643,
0.29691335558891296,
-0.35925233364105225,
0.838884711265564,
-0.09378798305988312,
-0.5264714360237122,
0.5799840092658997,
... |
func (m *MDNSClientMock) MinimockFinish() {
if !m.minimockDone() {
m.MinimockExchangeInspect()
m.t.FailNow()
}
} | [
0.19589540362358093,
0.2777836322784424,
0.23577676713466644,
-0.4113403558731079,
0.2715696394443512,
0.07092612236738205,
-0.24906842410564423,
-0.4960351884365082,
-0.10072159022092819,
0.2850119471549988,
-0.4726075232028961,
0.05343467369675636,
-0.8793268799781799,
0.3943120539188385... |
func (m *MDNSClientMock) MinimockWait(timeout mm_time.Duration) {
timeoutCh := mm_time.After(timeout)
for {
if m.minimockDone() {
return
}
select {
case <-timeoutCh:
m.MinimockFinish()
return
case <-mm_time.After(10 * mm_time.Millisecond):
}
}
} | [
0.0714634582400322,
0.4410618543624878,
0.49496906995773315,
-0.29254671931266785,
-0.17992372810840607,
0.8122079372406006,
-0.008181008510291576,
-0.054652608931064606,
0.35714590549468994,
0.18368251621723175,
0.05076638609170914,
0.4921119809150696,
-0.5177931189537048,
0.1417147666215... |
func NewMockCluster(opt *MockSchedulerOptions) *MockCluster {
return &MockCluster{
BasicCluster: NewBasicCluster(),
id: core.NewMockIDAllocator(),
MockSchedulerOptions: opt,
}
} | [
-0.683013916015625,
0.015576997771859169,
0.18984846770763397,
0.3818625807762146,
-0.1905038058757782,
-0.16305360198020935,
-0.07834972441196442,
-0.12068424373865128,
0.9605166912078857,
-0.30913424491882324,
0.011913067661225796,
0.4398309290409088,
-0.20175836980342865,
0.049523245543... |
func (mc *MockCluster) ScanRegions(startKey []byte, limit int) []*core.RegionInfo {
return mc.Regions.ScanRange(startKey, limit)
} | [
-1.0738307237625122,
-0.007359718903899193,
-0.06417874991893768,
0.3382405638694763,
-0.780398964881897,
-0.7687762975692749,
-0.5339745879173279,
-0.6505354046821594,
0.12388037890195847,
-0.6807019114494324,
0.01814514771103859,
0.5216284990310669,
-1.1942479610443115,
-0.30037936568260... |
func (mc *MockCluster) LoadRegion(regionID uint64, followerIds ...uint64) {
// regions load from etcd will have no leader
r := mc.newMockRegionInfo(regionID, 0, followerIds...)
r.Leader = nil
mc.PutRegion(r)
} | [
-0.029172630980610847,
0.437772661447525,
0.20658445358276367,
-0.1821293830871582,
-0.3180036246776581,
0.4736226201057434,
-0.32545313239097595,
0.3369453251361847,
0.24088698625564575,
-0.12396886944770813,
-0.13160870969295502,
-0.10147210955619812,
-1.1619455814361572,
0.7316285967826... |
func (mc *MockCluster) IsRegionHot(id uint64) bool {
return mc.BasicCluster.IsRegionHot(id, mc.GetHotRegionLowThreshold())
} | [
0.0664648488163948,
0.09574446827173233,
0.28602781891822815,
1.3970431089401245,
-0.6291876435279846,
-0.029984135180711746,
-0.4781160056591034,
-0.6715520024299622,
0.5099981427192688,
0.12873311340808868,
-0.0014693980338051915,
1.009652853012085,
-0.9871491193771362,
0.036125697195529... |
func (mc *MockCluster) RandHotRegionFromStore(store uint64, kind FlowKind) *core.RegionInfo {
r := mc.HotCache.RandHotRegionFromStore(store, kind, mc.GetHotRegionLowThreshold())
if r == nil {
return nil
}
return mc.GetRegion(r.RegionID)
} | [
-0.10722003877162933,
-0.18360035121440887,
0.16683989763259888,
-0.07633084058761597,
-0.6807112693786621,
-0.21154655516147614,
-0.0810132697224617,
-0.7921452522277832,
1.0108286142349243,
-0.8743504881858826,
-0.5939513444900513,
0.31226569414138794,
0.04702651500701904,
0.701654553413... |
func (mc *MockCluster) AllocPeer(storeID uint64) (*metapb.Peer, error) {
peerID, err := mc.allocID()
if err != nil {
log.Errorf("failed to alloc peer: %v", err)
return nil, errors.Trace(err)
}
peer := &metapb.Peer{
Id: peerID,
StoreId: storeID,
}
return peer, nil
} | [
0.39383912086486816,
-0.3673678934574127,
0.5422652363777161,
0.13049815595149994,
-0.46117523312568665,
0.5964813828468323,
-0.2529734969139099,
-0.03846544772386551,
0.9051337838172913,
0.455516517162323,
1.0908277034759521,
0.27677950263023376,
-1.0411620140075684,
0.7610296607017517,
... |
func (mc *MockCluster) SetStoreUp(storeID uint64) {
store := mc.GetStore(storeID)
store.State = metapb.StoreState_Up
store.LastHeartbeatTS = time.Now()
mc.PutStore(store)
} | [
-1.009371042251587,
0.019155990332365036,
0.417755126953125,
0.07432764023542404,
-0.07391539961099625,
0.2900004982948303,
0.6736012697219849,
0.5354629755020142,
0.9572538137435913,
0.6177565455436707,
-0.23134270310401917,
0.17944055795669556,
-0.4805684983730316,
0.09346084296703339,
... |
func (mc *MockCluster) SetStoreDisconnect(storeID uint64) {
store := mc.GetStore(storeID)
store.State = metapb.StoreState_Up
store.LastHeartbeatTS = time.Now().Add(-time.Second * 30)
mc.PutStore(store)
} | [
-0.5806047916412354,
-0.2610521614551544,
0.32715436816215515,
-0.04482682794332504,
-0.3088243305683136,
0.7021234035491943,
0.45655298233032227,
0.46625277400016785,
0.5657951235771179,
0.3284144401550293,
-0.14778365194797516,
-0.10883090645074844,
-0.4170008599758148,
0.083599798381328... |
func (mc *MockCluster) SetStoreDown(storeID uint64) {
store := mc.GetStore(storeID)
store.State = metapb.StoreState_Up
store.LastHeartbeatTS = time.Time{}
mc.PutStore(store)
} | [
-0.44433557987213135,
-0.12566693127155304,
0.4755061864852905,
0.2784363627433777,
-0.22657740116119385,
0.5703955888748169,
0.6147878766059875,
0.564780592918396,
1.09163498878479,
0.08424176275730133,
0.015020027756690979,
0.09481444954872131,
-0.8658632040023804,
0.5967386960983276,
... |
func (mc *MockCluster) SetStoreOffline(storeID uint64) {
store := mc.GetStore(storeID)
store.State = metapb.StoreState_Offline
mc.PutStore(store)
} | [
-0.3410509526729584,
-0.5313534140586853,
0.3278014361858368,
0.26652637124061584,
-0.49171701073646545,
0.344305157661438,
0.5597611665725708,
0.7000281810760498,
0.8957805633544922,
0.4282834827899933,
-0.600868821144104,
-0.14272554218769073,
-0.4516369104385376,
0.5771639943122864,
-... |
func (mc *MockCluster) SetStoreBusy(storeID uint64, busy bool) {
store := mc.GetStore(storeID)
store.Stats.IsBusy = busy
store.LastHeartbeatTS = time.Now()
mc.PutStore(store)
} | [
-0.6600337624549866,
0.05915350094437599,
0.28899267315864563,
0.2698096036911011,
0.5200279951095581,
-0.10014484077692032,
0.13765113055706024,
-0.28128769993782043,
0.4536687731742859,
0.41547566652297974,
-1.228291392326355,
0.8133277893066406,
-0.07673674821853638,
0.1296587437391281,... |
func (mc *MockCluster) AddLeaderStore(storeID uint64, leaderCount int) {
store := core.NewStoreInfo(&metapb.Store{Id: storeID})
store.Stats = &pdpb.StoreStats{}
store.LastHeartbeatTS = time.Now()
store.LeaderCount = leaderCount
store.LeaderSize = int64(leaderCount) * 10
store.Stats.Capacity = 1000 * (1 << 20)
st... | [
-0.18652445077896118,
-0.33830729126930237,
0.3855894207954407,
-0.6926925182342529,
-0.21504458785057068,
0.6677693128585815,
-0.1786230057477951,
0.3830290734767914,
0.6880254745483398,
-0.42994558811187744,
-0.5899623036384583,
-0.525939404964447,
-1.0153217315673828,
0.2123352587223053... |
func (mc *MockCluster) AddRegionStore(storeID uint64, regionCount int) {
store := core.NewStoreInfo(&metapb.Store{Id: storeID})
store.Stats = &pdpb.StoreStats{}
store.LastHeartbeatTS = time.Now()
store.RegionCount = regionCount
store.RegionSize = int64(regionCount) * 10
store.Stats.Capacity = 1000 * (1 << 20)
st... | [
0.007990971207618713,
-0.04689687490463257,
0.4092632830142975,
-0.7830408811569214,
0.0018578326562419534,
0.4195902645587921,
0.21919609606266022,
0.027635307982563972,
0.41393476724624634,
-0.7729319930076599,
-0.061377670615911484,
-0.5963087677955627,
-0.515261173248291,
0.02729973569... |
func (mc *MockCluster) AddLabelsStore(storeID uint64, regionCount int, labels map[string]string) {
mc.AddRegionStore(storeID, regionCount)
store := mc.GetStore(storeID)
for k, v := range labels {
store.Labels = append(store.Labels, &metapb.StoreLabel{Key: k, Value: v})
}
mc.PutStore(store)
} | [
-0.6033121347427368,
-0.4413483440876007,
0.15788143873214722,
-1.3661409616470337,
-0.3429451882839203,
0.6997177004814148,
-0.7406384348869324,
0.37733301520347595,
0.6945773363113403,
-0.6201794743537903,
0.7569116950035095,
-0.763558030128479,
-0.6878688335418701,
0.09297049790620804,
... |
func (mc *MockCluster) AddLeaderRegion(regionID uint64, leaderID uint64, followerIds ...uint64) {
regionInfo := mc.newMockRegionInfo(regionID, leaderID, followerIds...)
regionInfo.ApproximateSize = 10
regionInfo.ApproximateRows = 10
mc.PutRegion(regionInfo)
} | [
-0.21204955875873566,
-0.4104117453098297,
0.44834282994270325,
-0.6539232134819031,
0.15245355665683746,
0.5366191864013672,
-0.09635221213102341,
0.040965016931295395,
0.274680495262146,
-0.6043675541877747,
-1.066004753112793,
-0.3707694709300995,
-0.6942154169082642,
0.925018310546875,... |
func (mc *MockCluster) AddLeaderRegionWithRange(regionID uint64, startKey string, endKey string, leaderID uint64, followerIds ...uint64) {
r := mc.newMockRegionInfo(regionID, leaderID, followerIds...)
r.StartKey = []byte(startKey)
r.EndKey = []byte(endKey)
mc.PutRegion(r)
} | [
-0.5659523606300354,
-0.6890612840652466,
0.33297908306121826,
0.0856790542602539,
0.0978718101978302,
0.4246947765350342,
-0.32043591141700745,
0.0727064311504364,
-0.8189202547073364,
-0.40851297974586487,
-0.6722913384437561,
-0.5708922147750854,
-1.1341155767440796,
0.5082235932350159,... |
func (mc *MockCluster) AddLeaderRegionWithReadInfo(regionID uint64, leaderID uint64, readBytes uint64, followerIds ...uint64) {
r := mc.newMockRegionInfo(regionID, leaderID, followerIds...)
r.ReadBytes = readBytes
isUpdate, item := mc.BasicCluster.CheckReadStatus(r)
if isUpdate {
mc.HotCache.Update(regionID, item... | [
0.20360557734966278,
-1.1029011011123657,
0.49432364106178284,
-0.4808867275714874,
-0.21550557017326355,
0.582973837852478,
-0.8749929666519165,
-0.3162980377674103,
0.40044063329696655,
-0.5951648354530334,
-0.20803798735141754,
-0.5873326063156128,
-0.5513518452644348,
0.563282668590545... |
func (mc *MockCluster) AddLeaderRegionWithWriteInfo(regionID uint64, leaderID uint64, writtenBytes uint64, followerIds ...uint64) {
r := mc.newMockRegionInfo(regionID, leaderID, followerIds...)
r.WrittenBytes = writtenBytes
isUpdate, item := mc.BasicCluster.CheckWriteStatus(r)
if isUpdate {
mc.HotCache.Update(reg... | [
-0.31123480200767517,
-1.3840779066085815,
0.440984308719635,
-0.5207887887954712,
0.1433953493833542,
0.26103007793426514,
-0.18922194838523865,
-0.3230365514755249,
0.30961304903030396,
-0.33614903688430786,
-0.4713440537452698,
-0.7130424976348877,
-0.7878667116165161,
0.711993098258972... |
func (mc *MockCluster) UpdateStoreLeaderWeight(storeID uint64, weight float64) {
store := mc.GetStore(storeID)
store.LeaderWeight = weight
mc.PutStore(store)
} | [
-0.054761532694101334,
-0.9346070885658264,
0.16307002305984497,
0.0069149513728916645,
-1.084316611289978,
0.31154969334602356,
-0.6978697180747986,
0.0922994539141655,
0.8999598026275635,
0.579355776309967,
-1.0775971412658691,
-0.1933468133211136,
-0.8756468892097473,
0.8683565258979797... |
func (mc *MockCluster) UpdateStoreRegionWeight(storeID uint64, weight float64) {
store := mc.GetStore(storeID)
store.RegionWeight = weight
mc.PutStore(store)
} | [
0.014481207355856895,
-0.7045032382011414,
0.17354898154735565,
-0.05424709618091583,
-1.0738766193389893,
0.11136641353368759,
0.16540312767028809,
-0.30854275822639465,
0.47441020607948303,
0.7895254492759705,
-0.42234787344932556,
-0.23457711935043335,
-0.6894223093986511,
0.76938360929... |
func (mc *MockCluster) UpdateStoreLeaderSize(storeID uint64, size int64) {
store := mc.GetStore(storeID)
store.LeaderSize = size
store.Stats.Available = store.Stats.Capacity - uint64(store.LeaderSize)
mc.PutStore(store)
} | [
-0.4520507752895355,
-1.0312317609786987,
0.18940524756908417,
-0.695774257183075,
-0.8020241856575012,
0.16698400676250458,
-0.1591702252626419,
0.26263096928596497,
1.2287852764129639,
0.3078569173812866,
-0.6811093688011169,
0.16836801171302795,
-0.697463870048523,
0.3780141770839691,
... |
func (mc *MockCluster) UpdateStoreRegionSize(storeID uint64, size int64) {
store := mc.GetStore(storeID)
store.RegionSize = size
store.Stats.Available = store.Stats.Capacity - uint64(store.RegionSize)
mc.PutStore(store)
} | [
-0.3886185586452484,
-0.6610658168792725,
0.10966850817203522,
-0.5937806963920593,
-0.827541172504425,
-0.23576365411281586,
0.6290808320045471,
0.17341776192188263,
0.6196766495704651,
0.07325483113527298,
-0.38130298256874084,
0.02074059098958969,
-0.1741512268781662,
0.1753621548414230... |
func (mc *MockCluster) UpdateLeaderCount(storeID uint64, leaderCount int) {
store := mc.GetStore(storeID)
store.LeaderCount = leaderCount
store.LeaderSize = int64(leaderCount) * 10
mc.PutStore(store)
} | [
-0.6507160663604736,
-0.8114399909973145,
0.33316946029663086,
-0.7084510326385498,
-0.5656939744949341,
-0.0329875685274601,
-0.14380568265914917,
0.9978082776069641,
0.6427740454673767,
0.5150119066238403,
-1.3972089290618896,
0.8092965483665466,
-1.018175721168518,
0.2214723378419876,
... |
func (mc *MockCluster) UpdateRegionCount(storeID uint64, regionCount int) {
store := mc.GetStore(storeID)
store.RegionCount = regionCount
store.RegionSize = int64(regionCount) * 10
mc.PutStore(store)
} | [
-0.2913872003555298,
-0.5831702351570129,
0.3755510449409485,
-0.6205899119377136,
0.0715518593788147,
-0.3006095290184021,
0.4014720618724823,
0.7444571852684021,
0.2349816858768463,
0.05880849435925484,
-0.6236310005187988,
0.3798317313194275,
-0.4191729724407196,
-0.17782863974571228,
... |
func (mc *MockCluster) UpdateSnapshotCount(storeID uint64, snapshotCount int) {
store := mc.GetStore(storeID)
store.Stats.ApplyingSnapCount = uint32(snapshotCount)
mc.PutStore(store)
} | [
-0.6978771090507507,
0.23531745374202728,
0.5218324065208435,
-0.4096044600009918,
-1.1948634386062622,
0.05255803465843201,
0.3477388918399811,
0.9060526490211487,
1.1243195533752441,
-0.4860250949859619,
-1.091506838798523,
-0.3624163866043091,
0.7294452786445618,
0.6474817395210266,
0... |
func (mc *MockCluster) UpdatePendingPeerCount(storeID uint64, pendingPeerCount int) {
store := mc.GetStore(storeID)
store.PendingPeerCount = pendingPeerCount
mc.PutStore(store)
} | [
-0.9292628169059753,
-1.2606292963027954,
0.4883253574371338,
-0.997893214225769,
-0.5600568652153015,
0.24811701476573944,
0.10483064502477646,
0.7319079637527466,
-0.09525804966688156,
0.24998724460601807,
-0.6086602210998535,
-0.2780020833015442,
-1.1369922161102295,
0.5123971104621887,... |
func (mc *MockCluster) UpdateStorageRatio(storeID uint64, usedRatio, availableRatio float64) {
store := mc.GetStore(storeID)
store.Stats.Capacity = 1000 * (1 << 20)
store.Stats.UsedSize = uint64(float64(store.Stats.Capacity) * usedRatio)
store.Stats.Available = uint64(float64(store.Stats.Capacity) * availableRatio)... | [
-0.009728641249239445,
-0.6575564742088318,
0.41458287835121155,
-0.5560425519943237,
-0.2073058784008026,
-0.4375365078449249,
0.370909720659256,
0.004016949329525232,
-0.10080192983150482,
0.5373364090919495,
-0.24504664540290833,
-0.506000280380249,
-0.2285931557416916,
-0.0037309054750... |
func (mc *MockCluster) UpdateStorageWrittenBytes(storeID uint64, BytesWritten uint64) {
store := mc.GetStore(storeID)
store.Stats.BytesWritten = BytesWritten
now := time.Now().Second()
interval := &pdpb.TimeInterval{StartTimestamp: uint64(now - storeHeartBeatReportInterval), EndTimestamp: uint64(now)}
store.Stats.... | [
-0.622800350189209,
-1.0256587266921997,
0.25755953788757324,
0.07346990704536438,
0.8597295880317688,
0.2825925052165985,
0.7768716216087341,
0.14543986320495605,
-0.38648325204849243,
-0.0008168665808625519,
-0.6923019289970398,
0.5032338500022888,
-0.7404760122299194,
-0.177534982562065... |
func (mc *MockCluster) UpdateStorageReadBytes(storeID uint64, BytesRead uint64) {
store := mc.GetStore(storeID)
now := time.Now().Second()
interval := &pdpb.TimeInterval{StartTimestamp: uint64(now - storeHeartBeatReportInterval), EndTimestamp: uint64(now)}
store.Stats.Interval = interval
store.Stats.BytesRead = By... | [
-0.2555670440196991,
-0.8304189443588257,
0.37202000617980957,
-0.2565312683582306,
-0.2453712671995163,
0.4960152804851532,
0.21973825991153717,
-0.27773866057395935,
0.1851487010717392,
-0.3296225965023041,
-0.1832677274942398,
0.7741333842277527,
-0.691507875919342,
-0.33458131551742554... |
func (mc *MockCluster) UpdateStoreStatus(id uint64) {
mc.Stores.SetLeaderCount(id, mc.Regions.GetStoreLeaderCount(id))
mc.Stores.SetRegionCount(id, mc.Regions.GetStoreRegionCount(id))
mc.Stores.SetPendingPeerCount(id, mc.Regions.GetStorePendingPeerCount(id))
mc.Stores.SetLeaderSize(id, mc.Regions.GetStoreLeaderRegi... | [
-0.5236361026763916,
-0.932388424873352,
0.28956496715545654,
-0.7949573993682861,
-0.4567502737045288,
0.12822242081165314,
0.23004761338233948,
-0.05343645438551903,
0.7477498054504395,
0.06906385719776154,
-0.7721940279006958,
0.06368952244520187,
-0.2395043522119522,
0.3385728895664215... |
func (mc *MockCluster) ApplyOperator(op *Operator) {
region := mc.GetRegion(op.RegionID())
for !op.IsFinish() {
if step := op.Check(region); step != nil {
switch s := step.(type) {
case TransferLeader:
region.Leader = region.GetStorePeer(s.ToStore)
case AddPeer:
if region.GetStorePeer(s.ToStore) !=... | [
-0.7826400399208069,
-0.33003559708595276,
0.6696042418479919,
-0.38820743560791016,
-0.03370453417301178,
0.15468047559261322,
0.6958169937133789,
0.9261953830718994,
0.7735771536827087,
0.09611562639474869,
-0.0696476474404335,
-0.9581410884857178,
-0.44639521837234497,
0.838761627674102... |
func (mc *MockCluster) CheckLabelProperty(typ string, labels []*metapb.StoreLabel) bool {
for _, cfg := range mc.LabelProperties[typ] {
for _, l := range labels {
if l.Key == cfg.Key && l.Value == cfg.Value {
return true
}
}
}
return false
} | [
-0.6506780982017517,
-1.3736563920974731,
0.39358893036842346,
0.3175615966320038,
0.06564415246248245,
1.2597272396087646,
-0.7311044931411743,
-0.21468575298786163,
-0.24566024541854858,
1.5614873170852661,
0.8715808391571045,
0.12522435188293457,
-1.4792346954345703,
0.03298277780413627... |
func NewMockSchedulerOptions() *MockSchedulerOptions {
mso := &MockSchedulerOptions{}
mso.RegionScheduleLimit = defaultRegionScheduleLimit
mso.LeaderScheduleLimit = defaultLeaderScheduleLimit
mso.ReplicaScheduleLimit = defaultReplicaScheduleLimit
mso.MergeScheduleLimit = defaultMergeScheduleLimit
mso.MaxSnapshotC... | [
-0.34606218338012695,
-0.4366430938243866,
0.3568037748336792,
0.07250559329986572,
-0.35383325815200806,
-0.8266518712043762,
0.15490318834781647,
-0.16134734451770782,
0.5901107788085938,
0.4141339361667633,
-0.5461700558662415,
0.16662941873073578,
-0.5514600872993469,
0.515163898468017... |
func New(options ...Option) *Client {
// Instantiate client with static defaults.
c := &Client{
builder: &noopBuilder{output: os.Stdout},
pusher: &noopPusher{output: os.Stdout},
deployer: &noopDeployer{output: os.Stdout},
runner: &noopRunner{output: os.Stdout},
remover: ... | [
-0.19100837409496307,
-0.2903892993927002,
0.3364887535572052,
-0.06159551441669464,
-0.3187178373336792,
-0.23400156199932098,
1.0410102605819702,
-0.6844127774238586,
-0.2823719084262848,
-0.6317729353904724,
0.12156607210636139,
0.3175407350063324,
-0.02155487798154354,
0.13398504257202... |
func WithVerbose(v bool) Option {
return func(c *Client) {
c.verbose = v
}
} | [
0.553669810295105,
0.7211023569107056,
0.3397483229637146,
0.13857319951057434,
0.7454648613929749,
-0.2951509356498718,
-0.46704554557800293,
-0.9393936395645142,
-0.898242175579071,
0.665125846862793,
-0.003660492366179824,
-0.3389139473438263,
-0.6627993583679199,
0.030511431396007538,
... |
func WithBuilder(d Builder) Option {
return func(c *Client) {
c.builder = d
}
} | [
0.4020824730396271,
0.39988765120506287,
0.19883324205875397,
0.09860160946846008,
-1.1468868255615234,
0.36109593510627747,
0.806823194026947,
-0.32710227370262146,
0.8641011714935303,
-1.5386879444122314,
-0.19056110084056854,
-0.28432345390319824,
0.5097917318344116,
0.8641881942749023,... |
func WithPusher(d Pusher) Option {
return func(c *Client) {
c.pusher = d
}
} | [
0.11423002183437347,
0.312493234872818,
0.44691139459609985,
-0.29864341020584106,
-1.0475399494171143,
0.3253767192363739,
-0.5141313076019287,
-0.8265796303749084,
-0.4938189387321472,
-0.6056224703788757,
-0.1719880849123001,
-0.5090266466140747,
0.606753408908844,
1.0806255340576172,
... |
func WithDeployer(d Deployer) Option {
return func(c *Client) {
c.deployer = d
}
} | [
0.4332175850868225,
-0.3652164041996002,
0.37963593006134033,
-0.5342390537261963,
-0.32343095541000366,
0.06464183330535889,
0.5415194034576416,
-0.601585865020752,
0.3270210027694702,
-0.31193214654922485,
-0.4742521047592163,
-0.8789489269256592,
0.6283687949180603,
1.2824244499206543,
... |
func WithRunner(r Runner) Option {
return func(c *Client) {
c.runner = r
}
} | [
0.2358938455581665,
-0.21620947122573853,
0.29552361369132996,
-0.05686889961361885,
-0.7579152584075928,
0.4015927016735077,
0.8125830292701721,
-0.9721302390098572,
0.42413800954818726,
-0.46583497524261475,
-0.7562716007232666,
0.028545137494802475,
0.06580003350973129,
-0.2650644183158... |
func WithRemover(r Remover) Option {
return func(c *Client) {
c.remover = r
}
} | [
0.3189198076725006,
-0.392660528421402,
0.5301012396812439,
-0.32506904006004333,
-0.9125787019729614,
-0.048386286944150925,
0.1835678666830063,
-0.6882761120796204,
0.4685709476470947,
0.09765338897705078,
-0.4810473918914795,
-0.9092196226119995,
-0.20904481410980225,
0.1276274919509887... |
func WithLister(l Lister) Option {
return func(c *Client) {
c.lister = l
}
} | [
0.5769234299659729,
-0.43774405121803284,
0.36487865447998047,
-0.44837167859077454,
-0.73772132396698,
0.3680427670478821,
-0.06234026327729225,
-0.5650464296340942,
0.5259372591972351,
-0.6468608975410461,
-0.30170196294784546,
-0.49274903535842896,
0.342225044965744,
0.9112632870674133,... |
func WithDescriber(describer Describer) Option {
return func(c *Client) {
c.describer = describer
}
} | [
0.9561721682548523,
-0.14335843920707703,
0.4074803590774536,
-0.667777955532074,
-0.5423165559768677,
0.27533313632011414,
-0.1615942269563675,
-0.7570245862007141,
-0.08709021657705307,
-0.715065598487854,
0.14953356981277466,
-0.085405133664608,
0.438169002532959,
1.5547739267349243,
... |
func WithProgressListener(p ProgressListener) Option {
return func(c *Client) {
c.progressListener = p
}
} | [
0.6501535773277283,
-0.7901210188865662,
0.35654863715171814,
-0.056502796709537506,
-0.5482962131500244,
1.3023836612701416,
0.530210018157959,
-0.9295433163642883,
-0.021827757358551025,
0.32216447591781616,
-0.6421952843666077,
-1.8612405061721802,
0.08351153135299683,
0.610212981700897... |
func WithDNSProvider(provider DNSProvider) Option {
return func(c *Client) {
c.dnsProvider = provider
}
} | [
-0.21437864005565643,
0.9158844351768494,
-0.04688284918665886,
0.1176651194691658,
-0.7371353507041931,
0.07341857999563217,
-0.433247834444046,
-1.0561939477920532,
1.6483227014541626,
0.05812797322869301,
-0.7868226766586304,
-0.31510505080223083,
0.4624650478363037,
0.1097128614783287,... |
func WithDomainSearchLimit(limit int) Option {
return func(c *Client) {
c.domainSearchLimit = limit
}
} | [
-0.4276871979236603,
0.6568375825881958,
0.5352624654769897,
0.394666850566864,
-0.14888359606266022,
0.03312195464968681,
0.16645373404026031,
-0.5420028567314148,
0.3419341444969177,
-0.21714046597480774,
-0.1510651707649231,
0.43185392022132874,
-0.02488200180232525,
0.13356347382068634... |
func WithTemplates(templates string) Option {
return func(c *Client) {
c.templates = templates
}
} | [
0.6207708120346069,
0.030852308496832848,
0.3673960566520691,
-0.5896626710891724,
-0.5127321481704712,
-0.5824421644210815,
-0.0818355605006218,
-1.094834804534912,
1.369597315788269,
-0.3524063229560852,
-0.7040312886238098,
-1.0361779928207397,
-0.5224575996398926,
0.03321552649140358,
... |
func WithRegistry(registry string) Option {
return func(c *Client) {
c.registry = registry
}
} | [
0.3553846478462219,
0.43135732412338257,
0.23159320652484894,
-0.29800114035606384,
0.6428414583206177,
-0.5166729688644409,
0.7897698879241943,
-0.7214346528053284,
0.554968535900116,
-0.2805839478969574,
-0.17719832062721252,
0.4991019368171692,
0.25273600220680237,
-0.3585539758205414,
... |
func (c *Client) Create(cfg Function) (err error) {
c.progressListener.SetTotal(4)
defer c.progressListener.Done()
// Initialize, writing out a template implementation and a config file.
// TODO: the Function's Initialize parameters are slightly different than
// the Initializer interface, and can thus cause conf... | [
-0.3703165650367737,
0.7213350534439087,
0.718621015548706,
0.45632970333099365,
0.21299389004707336,
-0.7450888156890869,
0.23506303131580353,
-0.2469719648361206,
-0.4701479971408844,
-0.23785819113254547,
-0.1636294722557068,
-0.40594545006752014,
0.2875014841556549,
0.6934242844581604,... |
func (c *Client) Initialize(cfg Function) (err error) {
// Create project root directory, if it doesn't already exist
if err = os.MkdirAll(cfg.Root, 0755); err != nil {
return
}
// Create Function of the given root path.
f, err := NewFunction(cfg.Root)
if err != nil {
return
}
// Assert the specified roo... | [
-0.03597579896450043,
0.7970388531684875,
0.7048549056053162,
0.5045129060745239,
0.5753939151763916,
-1.0281093120574951,
0.9984763264656067,
0.6647866368293762,
-0.5825814604759216,
-0.31406092643737793,
-0.7792182564735413,
0.08936160802841187,
0.08856065571308136,
1.2647050619125366,
... |
func (c *Client) Run(root string) error {
// Create an instance of a Function representation at the given root.
f, err := NewFunction(root)
if err != nil {
return err
}
if !f.Initialized() {
// TODO: this needs a test.
return fmt.Errorf("the given path '%v' does not contain an initialized Function. Please... | [
-0.5826916098594666,
-0.02410639077425003,
0.5508929491043091,
0.10673418641090393,
-0.2370004504919052,
-0.4898635447025299,
0.8892796635627747,
-0.3302716612815857,
-0.43306586146354675,
-0.6151989102363586,
-0.680080771446228,
0.690303385257721,
-0.1861496865749359,
0.2908915579319,
0... |
func (c *Client) List() ([]string, error) {
// delegate to concrete implementation of lister entirely.
return c.lister.List()
} | [
-0.08421635627746582,
-0.9099048972129822,
0.21576696634292603,
-0.1849299669265747,
0.6448635458946228,
0.07651950418949127,
-0.8943755626678467,
0.5742470026016235,
-0.0024581842590123415,
-0.18541878461837769,
-0.5155647993087769,
0.4379064440727234,
-0.009165825322270393,
0.93457144498... |
func (c *Client) Describe(name, root string) (d Description, err error) {
// If name is provided, it takes precidence.
// Otherwise load the Function defined at root.
if name != "" {
return c.describer.Describe(name)
}
f, err := NewFunction(root)
if err != nil {
return d, err
}
if !f.Initialized() {
retu... | [
0.19582346081733704,
0.7678977251052856,
0.7256375551223755,
0.21473130583763123,
-0.687175452709198,
-1.5264441967010498,
-0.3991756737232208,
-0.636313259601593,
-0.2785576283931732,
-0.1506360024213791,
0.5890423655509949,
1.1292023658752441,
-0.7941242456436157,
1.1874481439590454,
0... |
func (c *Client) Remove(cfg Function) error {
// If name is provided, it takes precidence.
// Otherwise load the Function deined at root.
if cfg.Name != "" {
return c.remover.Remove(cfg.Name)
}
f, err := NewFunction(cfg.Root)
if err != nil {
return err
}
if !f.Initialized() {
return fmt.Errorf("Function ... | [
-0.4653964638710022,
0.6700562238693237,
0.4841623902320862,
0.24272795021533966,
-0.7007026672363281,
-1.2768077850341797,
0.35241785645484924,
0.14124645292758942,
-0.057964734733104706,
0.19617760181427002,
-0.8196848034858704,
-0.23486696183681488,
-0.8584797382354736,
1.00707519054412... |
func (s ModifyEventSubscriptionInput) String() string {
return awsutil.Prettify(s)
} | [
0.6362671256065369,
-0.40400412678718567,
0.2240227311849594,
-0.3595101237297058,
-0.8402367234230042,
0.3558692932128906,
0.0694340243935585,
-0.6637973189353943,
0.7598703503608704,
0.14051684737205505,
0.41470596194267273,
1.1854913234710693,
0.1640501469373703,
-0.2238185554742813,
... |
func (s *ModifyEventSubscriptionInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "ModifyEventSubscriptionInput"}
if s.SubscriptionName == nil {
invalidParams.Add(aws.NewErrParamRequired("SubscriptionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
} | [
-0.14281049370765686,
0.1382976621389389,
0.5769063234329224,
0.10228569805622101,
-0.48767203092575073,
-0.15433438122272491,
-0.5519798398017883,
-0.023593397811055183,
0.33573099970817566,
0.058464232832193375,
0.7974547147750854,
0.46289536356925964,
-0.43945640325546265,
0.94220286607... |
func (s ModifyEventSubscriptionOutput) String() string {
return awsutil.Prettify(s)
} | [
1.156701683998108,
-0.8139531016349792,
0.24924492835998535,
-0.3239790201187134,
-0.9845547676086426,
-0.47217872738838196,
0.2572987973690033,
-0.7378544807434082,
0.30534276366233826,
-0.09672295302152634,
0.5629132390022278,
0.9507063627243042,
0.45323753356933594,
-0.47238317131996155... |
func (r ModifyEventSubscriptionRequest) Send(ctx context.Context) (*ModifyEventSubscriptionResponse, error) {
r.Request.SetContext(ctx)
err := r.Request.Send()
if err != nil {
return nil, err
}
resp := &ModifyEventSubscriptionResponse{
ModifyEventSubscriptionOutput: r.Request.Data.(*ModifyEventSubscriptionOut... | [
-0.7563420534133911,
-0.4898049235343933,
0.49096840620040894,
0.26037245988845825,
-0.09864450991153717,
-0.47205132246017456,
-0.29865726828575134,
-0.448677122592926,
0.7973402142524719,
-0.03008878417313099,
-0.2487461268901825,
1.0041319131851196,
-0.0756022110581398,
0.00781053397804... |
func (r *ModifyEventSubscriptionResponse) SDKResponseMetdata() *aws.Response {
return r.response
} | [
0.13884605467319489,
-0.48157331347465515,
0.4682013690471649,
-0.20313327014446259,
-0.42975685000419617,
0.046971507370471954,
-0.648540198802948,
-0.16334779560565948,
1.5474307537078857,
-0.14678232371807098,
-0.19166961312294006,
0.2672334909439087,
0.2008129209280014,
-1.038257479667... |
func New(s *service.Service) (engine *bm.Engine, err error) {
var (
cfg struct {
bm.ServerConfig
CrossDomains []string
}
ct paladin.TOML
)
if err = paladin.Get("http.toml").Unmarshal(&ct); err != nil {
return
}
if err = ct.Get("Server").UnmarshalTOML(&cfg); err != nil {
return
}
engine = bm.Defau... | [
0.6271519660949707,
-0.3581964671611786,
0.4727689325809479,
0.08821548521518707,
-0.06896340847015381,
-0.4585115313529968,
-0.23835894465446472,
0.650097668170929,
-0.6185439825057983,
-0.11196290701627731,
0.12614654004573822,
1.325907588005066,
0.24403907358646393,
0.8257495760917664,
... |
func howToStart(c *bm.Context) {
k := &model.Kratos{
Hello: "Golang 大法好 !!!",
}
c.JSON(k, nil)
} | [
0.731863260269165,
0.049938660115003586,
0.43426549434661865,
-0.4980376362800598,
0.6995049715042114,
0.23272185027599335,
0.02050858736038208,
0.39461225271224976,
-0.46862560510635376,
0.7028934359550476,
-0.8457186818122864,
0.648659348487854,
0.9328643679618835,
-0.07866242527961731,
... |
func newAddress(pos int, address []string, value int) string {
var temp [4]int64
for i := 0; i < 4; i++ {
number, _ := strconv.ParseInt(address[i], 2, 64)
temp[i] = number
}
temp[pos] = int64(value)
return fmt.Sprint(temp[0], ".", temp[1], ".", temp[2], ".", temp[3])
} | [
-0.34098270535469055,
-1.3534332513809204,
0.7699702382087708,
-0.34432610869407654,
-0.447907954454422,
-0.8535050749778748,
-0.28750982880592346,
0.1294202208518982,
0.3072959780693054,
0.7296447157859802,
-0.011355479247868061,
0.2738274335861206,
0.3842788338661194,
0.20475850999355316... |
func Info(args ...interface{}) {
log.Println(args...)
} | [
0.6795185208320618,
-0.47712916135787964,
0.6819117069244385,
0.8126416206359863,
0.6771087050437927,
0.49964848160743713,
-0.22229993343353271,
-0.18180741369724274,
-1.3029224872589111,
-0.4326338469982147,
-0.21603643894195557,
1.2269243001937866,
0.6120057106018066,
0.7640045285224915,... |
func Infof(format string, args ...interface{}) {
log.Printf(format, args...)
} | [
1.1586976051330566,
-0.6253340840339661,
0.7797337770462036,
0.29323524236679077,
0.9265549182891846,
0.3809266984462738,
-0.11188720166683197,
0.43505704402923584,
-0.9029639959335327,
-0.6086090803146362,
0.5774917602539062,
1.6228877305984497,
0.5740238428115845,
0.5369787216186523,
0... |
func Warning(args ...interface{}) {
log.Println(args...)
} | [
0.8546383380889893,
-0.010422791354358196,
0.6329131722450256,
0.9454712867736816,
0.5060064792633057,
0.6035576462745667,
-0.6355938911437988,
-0.38379421830177307,
-0.3898007869720459,
-0.05014130473136902,
0.061379324644804,
0.9935068488121033,
0.40572282671928406,
0.4922516345977783,
... |
func Warningf(format string, args ...interface{}) {
log.Printf(format, args...)
} | [
1.1056761741638184,
-0.02841367945075035,
0.5231789350509644,
0.5592876672744751,
0.15824368596076965,
0.3830496072769165,
-0.25803399085998535,
-0.006665242835879326,
-1.1731456518173218,
-0.1034879982471466,
0.5767682790756226,
0.9915484189987183,
0.3707614243030548,
0.6117871999740601,
... |
func TestVfoMaps(t *testing.T) {
// Test VFOValue map
for vfoName, VFOValue := range goHamlib.VFOValue {
_, ok := goHamlib.VFOName[VFOValue]
if !ok {
t.Fatalf("VFO %d does not exist in VfoName map", VFOValue)
}
if vfoName != goHamlib.VFOName[VFOValue] {
t.Fatalf("Name of VFO inconsisted: %s", vfoName)
... | [
0.19424410164356232,
-0.9113442301750183,
0.5300334095954895,
-0.01549956202507019,
1.1201472282409668,
0.8526611328125,
0.32196131348609924,
-0.03928709402680397,
0.30330806970596313,
0.23376834392547607,
-0.41600164771080017,
-0.3668422996997833,
0.072516530752182,
0.26362738013267517,
... |
func TestOperationMaps(t *testing.T) {
// Test OperationValue map
for opName, opValue := range goHamlib.VFOOperationValue {
_, ok := goHamlib.VFOOperationName[opValue]
if !ok {
t.Fatalf("Operation %d does not exist in OperationName map", opValue)
}
if opName != goHamlib.VFOOperationName[opValue] {
t.Fa... | [
-0.031116977334022522,
-0.20980960130691528,
0.6462854743003845,
0.3437369763851166,
0.7643271088600159,
1.0758157968521118,
0.9937552213668823,
-0.22246767580509186,
0.3319816589355469,
0.23206524550914764,
-0.14087244868278503,
-0.8437681198120117,
0.1296594887971878,
-0.4941312968730926... |
func TestModeMaps(t *testing.T) {
// Test ModeValue map
for modeName, modeValue := range goHamlib.ModeValue {
_, ok := goHamlib.ModeName[modeValue]
if !ok {
t.Fatalf("Mode %d does not exist in ModeName map", modeValue)
}
if modeName != goHamlib.ModeName[modeValue] {
t.Fatalf("Name of Mode inconsisted: ... | [
-0.293337881565094,
-0.89425128698349,
0.5496606230735779,
-0.40647614002227783,
0.9243419766426086,
1.3660441637039185,
0.2409939467906952,
-0.25694525241851807,
-0.0128792067989707,
-0.04290451854467392,
-0.6069663166999817,
-0.5104150176048279,
0.030679428949952126,
0.22826533019542694,... |
func TestRigPowerMaps(t *testing.T) {
// Test ModeValue map
for rpName, rpValue := range goHamlib.RigPowerValue {
_, ok := goHamlib.RigPowerName[rpValue]
if !ok {
t.Fatalf("RigPower %d does not exist in RigPowerName map", rpValue)
}
if rpName != goHamlib.RigPowerName[rpValue] {
t.Fatalf("Name of RigPow... | [
-0.09875433892011642,
-0.8832063674926758,
0.6995609998703003,
-0.1538611352443695,
0.851913571357727,
0.9357004165649414,
0.13441918790340424,
-0.3124881386756897,
-0.11169756203889847,
0.10696248710155487,
-0.37330013513565063,
-0.6401253938674927,
-0.37187886238098145,
0.020698400214314... |
func TestLevelMaps(t *testing.T) {
// Test LevelValue map
for lName, lValue := range goHamlib.LevelValue {
_, ok := goHamlib.LevelName[lValue]
if !ok {
t.Fatalf("Level %d does not exist in LevelName map", lValue)
}
if lName != goHamlib.LevelName[lValue] {
t.Fatalf("Name of Level inconsisted: %s", lName... | [
0.22226953506469727,
-0.9815827012062073,
0.6269689798355103,
-0.3517089784145355,
0.9756330251693726,
1.6812939643859863,
0.008868152275681496,
0.06583164632320404,
-0.5398531556129456,
-0.37231841683387756,
-0.6377119421958923,
-0.2604553997516632,
-0.18975023925304413,
0.514061510562896... |
func TestParmMaps(t *testing.T) {
// Test ParmValue map
for pName, pValue := range goHamlib.ParmValue {
_, ok := goHamlib.ParmName[pValue]
if !ok {
t.Fatalf("Parm %d does not exist in ParmName map", pValue)
}
if pName != goHamlib.ParmName[pValue] {
t.Fatalf("Name of Parm inconsisted: %s", pName)
}
}... | [
0.1846674382686615,
-0.8879982829093933,
0.7248819470405579,
-0.19242173433303833,
0.816274106502533,
1.5580180883407593,
-0.09731750190258026,
0.29434412717819214,
0.1202159896492958,
-0.12578906118869781,
-0.31185242533683777,
0.025610851123929024,
-0.062403663992881775,
0.24926836788654... |
func TestFuncMaps(t *testing.T) {
// Test FuncValue map
for fName, fValue := range goHamlib.FuncValue {
_, ok := goHamlib.FuncName[fValue]
if !ok {
t.Fatalf("Func %d does not exist in FuncName map", fValue)
}
if fName != goHamlib.FuncName[fValue] {
t.Fatalf("Name of Func inconsisted: %s", fName)
}
}... | [
0.12090025097131729,
-0.5805397033691406,
0.6667156219482422,
-0.17385835945606232,
1.1336058378219604,
0.9252397418022156,
0.9799597263336182,
0.09758515655994415,
-0.0528387613594532,
-1.0315765142440796,
-0.23904642462730408,
-0.49722355604171753,
0.44672340154647827,
0.3328864574432373... |
func TestPttMaps(t *testing.T) {
// Test PttValue map
for pName, pValue := range goHamlib.PttValue {
_, ok := goHamlib.PttName[pValue]
if !ok {
t.Fatalf("Ptt %d does not exist in PttName map", pValue)
}
if pName != goHamlib.PttName[pValue] {
t.Fatalf("Name of Ptt inconsisted: %s", pName)
}
}
// Te... | [
-0.17508649826049805,
-0.6195645928382874,
0.5730695724487305,
-0.32450979948043823,
0.6913200616836548,
1.7221266031265259,
-0.2046491503715515,
-0.12483401596546173,
-0.13554969429969788,
0.006013817153871059,
0.11529279500246048,
-0.5473094582557678,
-0.08928786218166351,
0.228576093912... |
func TestAntennaMaps(t *testing.T) {
// Test AntValue map
for aName, aValue := range goHamlib.AntValue {
_, ok := goHamlib.AntName[aValue]
if !ok {
t.Fatalf("Antenna %d does not exist in AntName map", aValue)
}
if aName != goHamlib.AntName[aValue] {
t.Fatalf("Name of Antenna inconsisted: %s", aName)
... | [
0.2752503752708435,
-1.0330793857574463,
0.507720947265625,
-0.9152637720108032,
0.5723831653594971,
1.7167080640792847,
-0.35185858607292175,
-0.123286671936512,
0.21947941184043884,
-0.2759802043437958,
-0.14859536290168762,
-0.19030529260635376,
0.9296236634254456,
0.16233980655670166,
... |
func TestDebugLevelMaps(t *testing.T) {
// Test DebugLevelValue map
for dName, dValue := range goHamlib.DebugLevelValue {
_, ok := goHamlib.DebugLevelName[dValue]
if !ok {
t.Fatalf("Debug Level %d does not exist in DebugLevelName map", dValue)
}
if dName != goHamlib.DebugLevelName[dValue] {
t.Fatalf("N... | [
-0.24276871979236603,
-0.4504410922527313,
0.6125009059906006,
0.009764272719621658,
0.6633643507957458,
1.468436598777771,
0.08070514351129532,
-0.6165120601654053,
-0.3547326624393463,
-0.5611599087715149,
-0.5898603796958923,
-0.3316068947315216,
-0.1110660582780838,
0.71156245470047,
... |
func NewServer(apiDef *raml.APIDefinition, apiDocsDir string, targetDir string) *Server {
resources := getServerResourcesDefs(apiDef)
return &Server{
apiDef: apiDef,
apiDocsDir: apiDocsDir,
TargetDir: targetDir,
Resources: resources,
}
} | [
-0.24292798340320587,
-1.7228516340255737,
0.2873246669769287,
-0.7457259297370911,
-0.11357714235782623,
-0.22377005219459534,
0.08596087992191315,
0.6815953254699707,
0.7624857425689697,
-0.3750912547111511,
0.0645269900560379,
1.3600163459777832,
-0.15611709654331207,
0.1532012820243835... |
func (s *Server) APIDocsDir() string {
return s.apiDocsDir
} | [
-0.407236248254776,
-0.5390343070030212,
0.1762707680463791,
-1.3603848218917847,
-0.7979161739349365,
0.17067313194274902,
-0.06847818940877914,
-0.03827633708715439,
0.03462960943579674,
-1.0906249284744263,
0.7423905730247498,
-0.02067570947110653,
-0.008775186724960804,
0.4254680573940... |
func (s *Server) Generate() error {
if err := s.generateSchemas(); err != nil {
return err
}
if err := s.generateMain(); err != nil {
return err
}
return s.generateResources()
} | [
-0.6649089455604553,
0.41605648398399353,
0.32288044691085815,
0.3009713888168335,
0.190744087100029,
0.7305982112884521,
0.15127348899841309,
0.24664610624313354,
-0.2844977080821991,
-0.24065302312374115,
-0.3469814360141754,
-0.34384584426879883,
-0.7572454214096069,
1.080167531967163,
... |
func (s *Server) generateMain() error {
filename := path.Join(s.TargetDir, "main.lua")
return commons.GenerateFile(s, "./templates/tarantool/server_main.tmpl", "server_main", filename, true)
} | [
-0.3030828535556793,
-0.22978618741035461,
0.5736903548240662,
-0.7442408800125122,
0.035110313445329666,
0.7973655462265015,
-0.34286725521087646,
1.0578052997589111,
-0.07104098051786423,
-0.16492675244808197,
-0.06140001490712166,
-0.19826877117156982,
-0.2334592193365097,
0.33835405111... |
func (s *Server) generateResources() error {
var allMethods []method
for _, resource := range s.Resources {
filename := path.Join(s.TargetDir, fmt.Sprintf("%v_api", strings.ToLower(resource.Name))+".lua")
if err := commons.GenerateFile(resource, "./templates/tarantool/server_resource_api.tmpl",
"server_resou... | [
-0.6744728684425354,
-0.22642675042152405,
0.575484037399292,
-0.9499728083610535,
-0.0102577218785882,
0.28583869338035583,
0.4668622314929962,
0.3145301640033722,
-0.11151885241270065,
-0.2495943009853363,
-0.3680829405784607,
-0.6840662956237793,
0.13951292634010315,
1.0644075870513916,... |
func brokerEventVersionNotUpgraded(ctx context.Context, t feature.T) {
// brokerName := state.GetStringOrFail(ctx, t, "brokerName")
// Create a trigger,
} | [
0.2973449230194092,
-0.808417797088623,
0.3732773959636688,
0.40026113390922546,
0.07821997255086899,
0.4812939167022705,
-0.06299697607755661,
0.5547672510147095,
-0.17524844408035278,
0.08062071353197098,
-1.4537652730941772,
-0.25855016708374023,
-0.6297999024391174,
0.3443761169910431,... |
func Example() {
m := NewStringSet()
fmt.Println(m.String())
fmt.Println(m.Count("3"))
m.Insert("3")
m.Insert("3")
m.Insert("3")
m.Insert("3")
fmt.Println(m.String())
fmt.Println(m.Count("3"))
m.Insert("1")
m.Insert("2")
m.Insert("5")
m.Insert("7")
m.Erase("3")
m.Erase("5")
fmt.Println(m.Count("3"))
fm... | [
0.27108922600746155,
0.2012287825345993,
0.9870567321777344,
-0.7296061515808105,
-0.7120922803878784,
-0.11367233097553253,
0.6143589615821838,
-0.36697885394096375,
-0.4617220461368561,
0.21721449494361877,
-0.014402028173208237,
0.5362637042999268,
-0.41946855187416077,
-0.1303402185440... |
func ExpectEqual(alert func(format string, args ...interface{}),
expected interface{}, actual interface{}) bool {
expectedValue, actualValue := reflect.ValueOf(expected), reflect.ValueOf(actual)
equal := false
switch {
case expected == nil && actual == nil:
return true
case expected != nil && actual == nil:
e... | [
-0.09357324242591858,
-0.5821358561515808,
0.983773410320282,
0.2938825786113739,
0.21760061383247375,
0.19875012338161469,
0.019030781462788582,
-0.357542484998703,
-0.7974721193313599,
0.7122541666030884,
-0.08742082864046097,
0.4765690267086029,
-0.05277320742607117,
0.6069023609161377,... |
func NewCommonReconciler(c client.Client, log logr.Logger, req ctrl.Request) *CommonReconciler {
r := &podfailure.Reconciler{
Client: c,
Log: log,
}
return &CommonReconciler{
Reconciler: r,
}
} | [
0.06644739955663681,
-0.893304705619812,
0.5010796189308167,
-0.012452791444957256,
-0.4322616457939148,
0.27359798550605774,
0.3856433928012848,
0.16274672746658325,
-0.23069773614406586,
-0.8307235836982727,
0.32324734330177307,
-0.17573745548725128,
-1.283456563949585,
0.34610715508461,... |
func (r *CommonReconciler) Apply(ctx context.Context, req ctrl.Request, chaos common.InnerCommonObject) error {
return r.Perform(ctx, req, chaos)
} | [
-0.2992408573627472,
-0.23038212954998016,
0.5900192260742188,
0.19099865853786469,
0.7523413300514221,
0.36842894554138184,
0.0536610446870327,
0.7483643293380737,
0.4517369270324707,
-1.0672359466552734,
0.5298338532447815,
-0.5828163027763367,
-1.2594784498214722,
0.36803779006004333,
... |
func (r *CommonReconciler) Recover(ctx context.Context, req ctrl.Request, chaos common.InnerCommonObject) error {
return r.Clean(ctx, req, chaos)
} | [
-0.5048347115516663,
-0.6067450046539307,
0.5392276048660278,
0.06999202072620392,
0.2906765639781952,
0.07098785042762756,
0.11964069306850433,
0.2975602149963379,
0.4689441919326782,
-1.1262484788894653,
0.7220965623855591,
-0.2593347728252411,
-1.1010345220565796,
-0.22892789542675018,
... |
func NewRunnerWithGenerator(generator romanumeral.IRomanNumeralGenerator) *Runner {
r := &Runner{}
r.generator = generator
return r
} | [
-1.2784088850021362,
-0.3210127651691437,
0.10783910751342773,
0.4685918986797333,
-1.706506609916687,
0.22201919555664062,
0.159076526761055,
-0.01648036204278469,
0.15839587152004242,
-1.0473172664642334,
-0.3240525722503662,
-0.13615570962429047,
-0.12304254621267319,
0.8681855201721191... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.