text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func NewRunner() *Runner {
r := &Runner{}
r.generator = romanumeral.NewRomanNumeralGenerator()
return r
} | [
-0.8981977105140686,
-0.4432702958583832,
0.20514944195747375,
0.2460481822490692,
-1.2851042747497559,
0.6568330526351929,
0.37751317024230957,
0.058458756655454636,
0.07495399564504623,
-1.3268007040023804,
-0.8985377550125122,
0.3533771336078644,
-0.7628085613250732,
-0.0926562845706939... |
func (r *Runner) Run(args ...string) (*string, error) {
if len(args) != 1 {
return nil, fmt.Errorf("incorrect number of arguments passed")
}
if number, err := strconv.Atoi(args[0]); err != nil {
return nil, fmt.Errorf("number passed must be an integer number")
} else {
roman, err := r.generator.Generate(numb... | [
-0.5669152736663818,
-0.11072032898664474,
0.8878481984138489,
0.00688585452735424,
-0.3612452745437622,
0.45138660073280334,
0.4874313175678253,
0.1303640753030777,
-0.5779982209205627,
-0.1941436231136322,
-0.05766623094677925,
0.022635161876678467,
-1.0288012027740479,
-0.13036903738975... |
func (*DataType) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*DataType_ListElementType)(nil),
(*DataType_StructType)(nil),
(*DataType_TimeFormat)(nil),
}
} | [
-0.9165853261947632,
0.6253958344459534,
0.4581091105937958,
-0.180496945977211,
0.5722362995147705,
-0.38906213641166687,
-0.20376281440258026,
-0.5067847371101379,
1.850612998008728,
-0.03870183974504471,
-1.2564629316329956,
0.47555452585220337,
-0.0009620895725674927,
1.567500948905944... |
func (in *MultiCasskop) DeepCopyInto(out *MultiCasskop) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
out.Status = in.Status
} | [
0.1827470362186432,
-0.4826137125492096,
0.7281531095504761,
0.5244991779327393,
-1.3424961566925049,
0.41172584891319275,
-0.11352504044771194,
0.41366320848464966,
-1.099388837814331,
-0.2805922329425812,
-0.585189163684845,
0.5648339986801147,
0.8150716423988342,
-0.02344501204788685,
... |
func (in *MultiCasskop) DeepCopy() *MultiCasskop {
if in == nil {
return nil
}
out := new(MultiCasskop)
in.DeepCopyInto(out)
return out
} | [
-0.6260266304016113,
0.25272998213768005,
0.6290601491928101,
1.842854380607605,
-1.4793355464935303,
0.6974604725837708,
-0.10688041150569916,
-0.4398196339607239,
-0.1805354654788971,
0.08300057053565979,
-0.1270955353975296,
-0.7079645395278931,
0.28648895025253296,
-0.25439009070396423... |
func (in *MultiCasskop) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
} | [
-0.2693294584751129,
-0.054067060351371765,
0.7476766109466553,
0.8814606666564941,
-1.1620732545852661,
0.707480788230896,
0.7133302092552185,
-0.0647977888584137,
-0.45461681485176086,
-0.47694703936576843,
-0.18726268410682678,
-0.5284568071365356,
0.5357147455215454,
-0.278730690479278... |
func (in *MultiCasskopList) DeepCopyInto(out *MultiCasskopList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]MultiCasskop, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
} | [
-0.29110339283943176,
0.26302090287208557,
0.8497020602226257,
0.7667543888092041,
-1.2784502506256104,
0.13262373208999634,
-0.1509980857372284,
0.49624958634376526,
-0.5787820219993591,
0.1581011414527893,
-1.1142908334732056,
0.061636414378881454,
0.29495754837989807,
-0.023598300293087... |
func (in *MultiCasskopList) DeepCopy() *MultiCasskopList {
if in == nil {
return nil
}
out := new(MultiCasskopList)
in.DeepCopyInto(out)
return out
} | [
-1.0679301023483276,
0.36661455035209656,
0.5506791472434998,
1.686733365058899,
-1.2744532823562622,
0.30985206365585327,
-0.14265340566635132,
-0.126564621925354,
0.3523057699203491,
0.28846392035484314,
-1.2919050455093384,
-0.831336498260498,
0.12234282493591309,
0.07648512721061707,
... |
func (in *MultiCasskopList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
} | [
-0.5782231092453003,
0.13765813410282135,
0.691146969795227,
0.7292550802230835,
-1.0323424339294434,
0.5451965928077698,
0.5808121562004089,
0.19547884166240692,
-0.1082223579287529,
-0.3128741383552551,
-1.0186147689819336,
-0.4560748040676117,
0.28967487812042236,
0.00466474425047636,
... |
func (in *MultiCasskopSpec) DeepCopyInto(out *MultiCasskopSpec) {
*out = *in
if in.DeleteCassandraCluster != nil {
in, out := &in.DeleteCassandraCluster, &out.DeleteCassandraCluster
*out = new(bool)
**out = **in
}
in.Base.DeepCopyInto(&out.Base)
if in.Override != nil {
in, out := &in.Override, &out.Overrid... | [
0.18124185502529144,
0.28528857231140137,
0.6455649137496948,
-0.024295002222061157,
-1.098584532737732,
-0.020426612347364426,
0.0680517926812172,
0.42819201946258545,
-1.125491738319397,
-0.03136380389332771,
-0.33042246103286743,
0.2563592791557312,
0.42780765891075134,
-0.0561388358473... |
func (in *MultiCasskopSpec) DeepCopy() *MultiCasskopSpec {
if in == nil {
return nil
}
out := new(MultiCasskopSpec)
in.DeepCopyInto(out)
return out
} | [
-0.3376602828502655,
0.0426197312772274,
0.5068826675415039,
0.8209643363952637,
-1.5530751943588257,
0.6761637926101685,
-0.039905477315187454,
-0.4295596182346344,
-0.39805930852890015,
0.781432569026947,
-0.02459373138844967,
-0.6318359375,
1.0935583114624023,
0.2539999783039093,
0.26... |
func (in *MultiCasskopStatus) DeepCopyInto(out *MultiCasskopStatus) {
*out = *in
} | [
0.3738638758659363,
-0.023694932460784912,
0.4627351760864258,
0.5025337338447571,
-1.8319636583328247,
0.6322812438011169,
-0.6773355007171631,
0.3605400323867798,
-0.7829396724700928,
-0.1791217029094696,
-0.6618071794509888,
-0.23342405259609222,
1.1310073137283325,
-0.02750156633555889... |
func (in *MultiCasskopStatus) DeepCopy() *MultiCasskopStatus {
if in == nil {
return nil
}
out := new(MultiCasskopStatus)
in.DeepCopyInto(out)
return out
} | [
-0.959517240524292,
0.1074279323220253,
0.26877108216285706,
0.870803952217102,
-1.6637879610061646,
0.5780032873153687,
-0.5250142812728882,
-0.21952100098133087,
0.09059053659439087,
0.1266244351863861,
-0.7485456466674805,
-1.026779294013977,
1.105249285697937,
0.5105676054954529,
0.1... |
func GenKey32(length int) ([]uint32, error) {
key := make([]uint32, length, length)
keyByteLength := length * 4
keyBytes := make([]byte, keyByteLength, keyByteLength)
if _, e := rand.Read(keyBytes); e != nil {
return nil, e
}
for i := 0; i < length; i++ {
key[i] = binary.LittleEndian.Uint32(keyBytes[4*i:])
... | [
-0.9747800827026367,
0.38423481583595276,
0.8627623915672302,
-0.587813675403595,
-0.002489181002601981,
0.6715803146362305,
-0.4587337076663971,
-0.5918818116188049,
0.41713011264801025,
0.37081068754196167,
-1.2114766836166382,
-0.3361244201660156,
-0.9700143337249756,
0.6220723986625671... |
func Parse32(s string) ([]uint32, error) {
var (
bytes []byte
e error
)
if bytes, e = base64.StdEncoding.DecodeString(s); e != nil {
return nil, e
}
if len(bytes)%4 != 0 {
return nil, errors.New("invalid length")
}
out := make([]uint32, len(bytes)/4, len(bytes)/4)
for i := 0; i < len(out); i++ {... | [
-0.12423980236053467,
0.2866801917552948,
0.5859259963035583,
-0.026657847687602043,
-0.1217118576169014,
-0.1578187793493271,
-0.15690134465694427,
-0.04127475246787071,
0.8425795435905457,
-0.011320026591420174,
-0.5648560523986816,
-0.1620427668094635,
-0.5526010394096375,
0.20417015254... |
func Stringify32(key []uint32) string {
bytes := make([]byte, len(key)*4, len(key)*4)
for i, n := range key {
binary.LittleEndian.PutUint32(bytes[4*i:], n)
}
return base64.StdEncoding.EncodeToString(bytes)
} | [
-0.47638824582099915,
0.616254448890686,
0.4950520396232605,
-0.3279942572116852,
-0.13834910094738007,
0.5063883662223816,
-1.242658019065857,
-0.9003582000732422,
-0.17350710928440094,
1.0431928634643555,
-0.8443296551704407,
-0.3147312104701996,
-0.6935822367668152,
0.7449357509613037,
... |
func GenKey16(length int) ([]uint16, error) {
key := make([]uint16, length, length)
keyByteLength := length * 2
keyBytes := make([]byte, keyByteLength, keyByteLength)
if _, e := rand.Read(keyBytes); e != nil {
return nil, e
}
for i := 0; i < length; i++ {
key[i] = binary.LittleEndian.Uint16(keyBytes[2*i:])
... | [
-0.7504128217697144,
0.04199805483222008,
0.7961199879646301,
-0.44559845328330994,
0.41176217794418335,
0.21538682281970978,
-0.4917808473110199,
-0.32805177569389343,
0.07161222398281097,
0.5796526074409485,
-1.1638236045837402,
0.04195287078619003,
-0.6884467601776123,
0.544739663600921... |
func Parse16(s string) ([]uint16, error) {
var (
bytes []byte
e error
)
if bytes, e = base64.StdEncoding.DecodeString(s); e != nil {
return nil, e
}
if len(bytes)%2 != 0 {
return nil, errors.New("invalid length")
}
out := make([]uint16, len(bytes)/2, len(bytes)/2)
for i := 0; i < len(out); i++ {... | [
0.20398761332035065,
0.12039291113615036,
0.4532647430896759,
0.3861936926841736,
0.1864802986383438,
-0.06816809624433517,
-0.15801210701465607,
0.30793386697769165,
0.7356639504432678,
-0.006212267093360424,
-0.42378997802734375,
0.10718746483325958,
-0.4932563900947571,
-0.0158755276352... |
func Stringify16(key []uint16) string {
bytes := make([]byte, len(key)*2, len(key)*2)
for i, n := range key {
binary.LittleEndian.PutUint16(bytes[2*i:], n)
}
return base64.StdEncoding.EncodeToString(bytes)
} | [
0.0588623508810997,
0.45880138874053955,
0.5712598562240601,
0.256735622882843,
0.4226387143135071,
0.09281565248966217,
-1.1827805042266846,
-0.27596402168273926,
-0.43526309728622437,
0.7847165465354919,
-0.47416985034942627,
0.04019608348608017,
-0.48951560258865356,
0.5332079529762268,... |
func (s *server) PublishRTT(stream pb.ProbePub_PublishRTTServer) error {
var count int32
startTime := time.Now()
for {
r, err := stream.Recv()
if err == io.EOF {
endTime := time.Now()
return stream.SendAndClose(
&pb.PubStat{
ProbeCount: count,
ElapsedTime: int32(endTime.Sub(startTime).Second... | [
-0.05952833965420723,
-0.351223349571228,
0.4199225902557373,
-0.2497095912694931,
-0.2650314271450043,
0.659869372844696,
0.17568665742874146,
-0.5930094122886658,
-0.8527072668075562,
1.1270191669464111,
0.38410958647727966,
0.3073270916938782,
-0.9353392720222473,
1.4460536241531372,
... |
func ApplyRoutes(r *gin.RouterGroup) {
satellites := r.Group("/satellites")
{
satellites.POST("/", middlewares.Authorized, create)
}
} | [
-0.263179212808609,
0.8879455924034119,
0.3097638785839081,
-0.06948956102132797,
-0.09325119107961655,
0.15521931648254395,
-0.7209664583206177,
0.5874717235565186,
0.36097005009651184,
-0.7568639516830444,
0.6993035078048706,
0.12448479235172272,
-0.17692755162715912,
2.0652430057525635,... |
func NewRouter() *mux.Router {
router := mux.NewRouter().StrictSlash(true)
for _, route := range routes {
var handler http.Handler
handler = route.HandlerFunc
handler = Logger(handler, route.Name)
router.
Methods(route.Method).
Path(route.Pattern).
Name(route.Name).
Handler(handler)
}
return r... | [
-0.17422859370708466,
-0.3097667694091797,
0.5276026725769043,
0.43994128704071045,
-0.7750229835510254,
0.15346510708332062,
-0.21314111351966858,
0.19120924174785614,
0.333229124546051,
-0.7900100350379944,
-0.03746642917394638,
0.11100546270608902,
0.6044767498970032,
0.6490172743797302... |
func NewIndexCollectionAccessorMock(t minimock.Tester) *IndexCollectionAccessorMock {
m := &IndexCollectionAccessorMock{t: t}
if controller, ok := t.(minimock.MockController); ok {
controller.RegisterMocker(m)
}
m.ForJetMock = mIndexCollectionAccessorMockForJet{mock: m}
m.ForPulseAndJetMock = mIndexCollectionA... | [
-0.6708486676216125,
-0.9771938323974609,
0.28582602739334106,
0.18033841252326965,
-0.3042832314968109,
-0.10473781079053879,
1.3715976476669312,
0.5381889939308167,
0.15793593227863312,
-0.7330744862556458,
0.5053991675376892,
-0.1664816439151764,
-0.24620753526687622,
-0.086800709366798... |
func (m *mIndexCollectionAccessorMockForJet) Expect(p context.Context, p1 insolar.JetID) *mIndexCollectionAccessorMockForJet {
m.mock.ForJetFunc = nil
m.expectationSeries = nil
if m.mainExpectation == nil {
m.mainExpectation = &IndexCollectionAccessorMockForJetExpectation{}
}
m.mainExpectation.input = &IndexCol... | [
-0.6544098854064941,
0.2278178185224533,
0.09873748570680618,
-0.7908891439437866,
-0.5174170732498169,
0.8151453137397766,
0.08435441553592682,
0.31473204493522644,
0.10309872776269913,
-0.661013126373291,
0.6484394073486328,
0.5333636999130249,
-0.16956301033496857,
0.7380726337432861,
... |
func (m *mIndexCollectionAccessorMockForJet) Return(r map[insolar.ID]LifelineMeta) *IndexCollectionAccessorMock {
m.mock.ForJetFunc = nil
m.expectationSeries = nil
if m.mainExpectation == nil {
m.mainExpectation = &IndexCollectionAccessorMockForJetExpectation{}
}
m.mainExpectation.result = &IndexCollectionAcces... | [
-0.6215267777442932,
-0.2819926142692566,
0.1667533814907074,
-0.7519374489784241,
-0.7218829989433289,
0.3282322287559509,
0.09943665564060211,
0.08919447660446167,
0.24872325360774994,
-0.5806434750556946,
0.7275353074073792,
0.11935313791036606,
-0.2659846842288971,
0.030866706743836403... |
func (m *mIndexCollectionAccessorMockForJet) ExpectOnce(p context.Context, p1 insolar.JetID) *IndexCollectionAccessorMockForJetExpectation {
m.mock.ForJetFunc = nil
m.mainExpectation = nil
expectation := &IndexCollectionAccessorMockForJetExpectation{}
expectation.input = &IndexCollectionAccessorMockForJetInput{p, ... | [
-0.4811705946922302,
0.5629237294197083,
0.25012317299842834,
-0.26187822222709656,
-0.15050815045833588,
0.5629202127456665,
0.3039787709712982,
0.24241897463798523,
0.08814834803342819,
-0.253736674785614,
0.6101232767105103,
0.04145446792244911,
-0.8264830112457275,
0.7211853265762329,
... |
func (m *mIndexCollectionAccessorMockForJet) Set(f func(p context.Context, p1 insolar.JetID) (r map[insolar.ID]LifelineMeta)) *IndexCollectionAccessorMock {
m.mainExpectation = nil
m.expectationSeries = nil
m.mock.ForJetFunc = f
return m.mock
} | [
-0.8200116753578186,
0.12409120053052902,
0.1958760768175125,
-0.8738250732421875,
-0.31516575813293457,
0.2379082441329956,
0.16715148091316223,
0.17597410082817078,
-0.3439871370792389,
-0.4158068001270294,
0.3328397870063782,
0.4561518132686615,
0.5916990637779236,
0.11300405859947205,
... |
func (m *IndexCollectionAccessorMock) ForJet(p context.Context, p1 insolar.JetID) (r map[insolar.ID]LifelineMeta) {
counter := atomic.AddUint64(&m.ForJetPreCounter, 1)
defer atomic.AddUint64(&m.ForJetCounter, 1)
if len(m.ForJetMock.expectationSeries) > 0 {
if counter > uint64(len(m.ForJetMock.expectationSeries)) ... | [
-0.5697928071022034,
-0.14492221176624298,
0.4122917652130127,
-0.36613619327545166,
-0.2446138709783554,
0.23149368166923523,
1.0309605598449707,
-0.29378220438957214,
-0.3888048827648163,
-0.8827217817306519,
0.7085244655609131,
-0.11172120273113251,
-0.31103581190109253,
0.1309865117073... |
func (m *IndexCollectionAccessorMock) ForJetMinimockCounter() uint64 {
return atomic.LoadUint64(&m.ForJetCounter)
} | [
-0.13032282888889313,
-0.6535485982894897,
0.2895520329475403,
-0.12617698311805725,
-0.3439575433731079,
-0.3521745502948761,
0.8362699151039124,
-0.047520171850919724,
-0.11455042660236359,
-0.7079698443412781,
0.044883742928504944,
-0.3325382471084595,
-0.29239270091056824,
0.8940331339... |
func (m *IndexCollectionAccessorMock) ForJetMinimockPreCounter() uint64 {
return atomic.LoadUint64(&m.ForJetPreCounter)
} | [
-0.20601165294647217,
-0.011552984826266766,
0.3846784830093384,
-0.07188989967107773,
-0.7051560282707214,
-0.4480787515640259,
0.8735880851745605,
0.17829325795173645,
0.2516455352306366,
-1.0113805532455444,
-0.24306130409240723,
-0.4156777262687683,
-0.41286540031433105,
0.802657723426... |
func (m *IndexCollectionAccessorMock) ForJetFinished() bool {
// if expectation series were set then invocations count should be equal to expectations count
if len(m.ForJetMock.expectationSeries) > 0 {
return atomic.LoadUint64(&m.ForJetCounter) == uint64(len(m.ForJetMock.expectationSeries))
}
// if main expectat... | [
-0.2436423897743225,
-0.19365337491035461,
0.331479012966156,
-0.8181082606315613,
0.29357749223709106,
-0.008403747342526913,
0.24273593723773956,
-0.16179215908050537,
-0.6227322220802307,
-0.5409405827522278,
0.2971935570240021,
-0.045252475887537,
-0.12520121037960052,
1.32057631015777... |
func (m *mIndexCollectionAccessorMockForPulseAndJet) Expect(p context.Context, p1 insolar.PulseNumber, p2 insolar.JetID) *mIndexCollectionAccessorMockForPulseAndJet {
m.mock.ForPulseAndJetFunc = nil
m.expectationSeries = nil
if m.mainExpectation == nil {
m.mainExpectation = &IndexCollectionAccessorMockForPulseAnd... | [
-0.6534530520439148,
-0.2823241353034973,
0.22037996351718903,
-0.7580849528312683,
-0.472583532333374,
1.061715841293335,
-0.14666664600372314,
0.5676651000976562,
-0.15357409417629242,
-1.086783528327942,
0.28772565722465515,
0.6859965920448303,
-0.28352001309394836,
0.6258772015571594,
... |
func (m *mIndexCollectionAccessorMockForPulseAndJet) Return(r map[insolar.ID]Lifeline) *IndexCollectionAccessorMock {
m.mock.ForPulseAndJetFunc = nil
m.expectationSeries = nil
if m.mainExpectation == nil {
m.mainExpectation = &IndexCollectionAccessorMockForPulseAndJetExpectation{}
}
m.mainExpectation.result = &... | [
-0.675369918346405,
-0.6491862535476685,
0.09758986532688141,
-0.8460362553596497,
-0.5805482864379883,
0.4664500057697296,
-0.11982491612434387,
0.49000903964042664,
0.3821348249912262,
-0.8352946043014526,
0.3557750880718231,
-0.14133818447589874,
-0.5088850855827332,
0.21883445978164673... |
func (m *mIndexCollectionAccessorMockForPulseAndJet) ExpectOnce(p context.Context, p1 insolar.PulseNumber, p2 insolar.JetID) *IndexCollectionAccessorMockForPulseAndJetExpectation {
m.mock.ForPulseAndJetFunc = nil
m.mainExpectation = nil
expectation := &IndexCollectionAccessorMockForPulseAndJetExpectation{}
expecta... | [
-0.5573486685752869,
0.1593431830406189,
0.32399091124534607,
-0.2707878649234772,
-0.09755552560091019,
0.6656485795974731,
-0.10253401100635529,
0.38791152834892273,
0.03775584697723389,
-0.5526044368743896,
0.3125075101852417,
0.20402507483959198,
-0.9561260938644409,
0.6666338443756104... |
func (m *mIndexCollectionAccessorMockForPulseAndJet) Set(f func(p context.Context, p1 insolar.PulseNumber, p2 insolar.JetID) (r map[insolar.ID]Lifeline)) *IndexCollectionAccessorMock {
m.mainExpectation = nil
m.expectationSeries = nil
m.mock.ForPulseAndJetFunc = f
return m.mock
} | [
-0.9953349232673645,
-0.37206965684890747,
0.15151727199554443,
-0.7404341697692871,
-0.2564072012901306,
0.5436102151870728,
0.027693796902894974,
0.47520896792411804,
-0.26062044501304626,
-0.8098534345626831,
-0.05105406045913696,
0.2757946252822876,
0.28858134150505066,
0.1096083894371... |
func (m *IndexCollectionAccessorMock) ForPulseAndJet(p context.Context, p1 insolar.PulseNumber, p2 insolar.JetID) (r map[insolar.ID]Lifeline) {
counter := atomic.AddUint64(&m.ForPulseAndJetPreCounter, 1)
defer atomic.AddUint64(&m.ForPulseAndJetCounter, 1)
if len(m.ForPulseAndJetMock.expectationSeries) > 0 {
if co... | [
-0.47757259011268616,
-0.5019209980964661,
0.442393958568573,
-0.6525650024414062,
-0.08837880939245224,
0.5232329964637756,
0.13971731066703796,
0.04839230328798294,
-0.37027186155319214,
-1.0940279960632324,
0.11000420898199081,
0.09833487123250961,
-0.3761826753616333,
1.062669515609741... |
func (m *IndexCollectionAccessorMock) ForPulseAndJetMinimockCounter() uint64 {
return atomic.LoadUint64(&m.ForPulseAndJetCounter)
} | [
-0.058672040700912476,
-0.9948358535766602,
0.2024352103471756,
-0.46704214811325073,
-0.2156904935836792,
-0.036082930862903595,
0.1972978264093399,
0.3990592658519745,
-0.12610943615436554,
-0.9985812902450562,
-0.05983361601829529,
-0.2365473359823227,
-0.2982315421104431,
0.92624551057... |
func (m *IndexCollectionAccessorMock) ForPulseAndJetMinimockPreCounter() uint64 {
return atomic.LoadUint64(&m.ForPulseAndJetPreCounter)
} | [
-0.034122202545404434,
-0.3331824243068695,
0.2941688895225525,
-0.4294036328792572,
-0.4742213487625122,
-0.1957768350839615,
0.3084513247013092,
0.4274323582649231,
0.14711658656597137,
-1.2457627058029175,
-0.20970746874809265,
-0.2993990480899811,
-0.22153601050376892,
0.91392767429351... |
func (m *IndexCollectionAccessorMock) ForPulseAndJetFinished() bool {
// if expectation series were set then invocations count should be equal to expectations count
if len(m.ForPulseAndJetMock.expectationSeries) > 0 {
return atomic.LoadUint64(&m.ForPulseAndJetCounter) == uint64(len(m.ForPulseAndJetMock.expectationS... | [
-0.30272814631462097,
-0.37906068563461304,
0.2862005829811096,
-0.9016344547271729,
0.2613195776939392,
0.23621465265750885,
0.016579553484916687,
0.21658171713352203,
-0.43891605734825134,
-0.7293842434883118,
0.26672741770744324,
-0.07290370762348175,
-0.1263255625963211,
1.211897969245... |
func (m *IndexCollectionAccessorMock) ValidateCallCounters() {
if !m.ForJetFinished() {
m.t.Fatal("Expected call to IndexCollectionAccessorMock.ForJet")
}
if !m.ForPulseAndJetFinished() {
m.t.Fatal("Expected call to IndexCollectionAccessorMock.ForPulseAndJet")
}
} | [
0.2695704400539398,
0.09593231230974197,
0.35189467668533325,
-0.486325740814209,
0.4194706976413727,
0.7595287561416626,
0.7663348317146301,
-0.7271499633789062,
0.19033588469028473,
-0.9209473729133606,
0.4997199475765228,
-0.44854867458343506,
-0.1671915054321289,
1.3060495853424072,
... |
func (m *IndexCollectionAccessorMock) CheckMocksCalled() {
m.Finish()
} | [
-0.1741684526205063,
-0.0548250786960125,
0.3095482289791107,
0.3388969302177429,
1.0756611824035645,
0.9214250445365906,
0.6275211572647095,
-0.8512796759605408,
-0.09638805687427521,
0.33407485485076904,
0.20370326936244965,
0.27045735716819763,
-0.6161558628082275,
0.5485981106758118,
... |
func (m *IndexCollectionAccessorMock) Finish() {
m.MinimockFinish()
} | [
0.027513619512319565,
-0.5231274962425232,
0.0725126564502716,
0.11916341632604599,
0.5499163866043091,
-0.056398674845695496,
0.5021045804023743,
-0.45270103216171265,
-0.2817525565624237,
0.5435799360275269,
-0.7957427501678467,
0.43514499068260193,
-0.45615968108177185,
0.47398409247398... |
func (m *IndexCollectionAccessorMock) MinimockFinish() {
if !m.ForJetFinished() {
m.t.Fatal("Expected call to IndexCollectionAccessorMock.ForJet")
}
if !m.ForPulseAndJetFinished() {
m.t.Fatal("Expected call to IndexCollectionAccessorMock.ForPulseAndJet")
}
} | [
-0.11212247610092163,
-0.3773725926876068,
0.2810463011264801,
-0.2507152855396271,
0.6205969452857971,
0.4300410747528076,
0.195700541138649,
-0.10822124034166336,
-0.42265784740448,
0.07982117682695389,
-0.20960654318332672,
-0.03519977256655693,
-0.03563046455383301,
0.6217809319496155,... |
func (m *IndexCollectionAccessorMock) Wait(timeout time.Duration) {
m.MinimockWait(timeout)
} | [
-0.3888413906097412,
-0.16747164726257324,
0.17936065793037415,
0.20859235525131226,
0.8188148140907288,
0.5281874537467957,
1.2749075889587402,
0.2188265472650528,
0.2751365005970001,
-0.25363773107528687,
-0.08602476119995117,
0.38397276401519775,
0.32009759545326233,
-0.1668454110622406... |
func (m *IndexCollectionAccessorMock) MinimockWait(timeout time.Duration) {
timeoutCh := time.After(timeout)
for {
ok := true
ok = ok && m.ForJetFinished()
ok = ok && m.ForPulseAndJetFinished()
if ok {
return
}
select {
case <-timeoutCh:
if !m.ForJetFinished() {
m.t.Error("Expected call to ... | [
-0.18008418381214142,
-0.11213667690753937,
0.546609103679657,
-0.18413680791854858,
0.23545295000076294,
0.5395337343215942,
0.47206398844718933,
0.020081406459212303,
-0.23606924712657928,
-0.013331124559044838,
0.29730311036109924,
-0.23705270886421204,
-0.3024515211582184,
0.2597003579... |
func (m *IndexCollectionAccessorMock) AllMocksCalled() bool {
if !m.ForJetFinished() {
return false
}
if !m.ForPulseAndJetFinished() {
return false
}
return true
} | [
-0.26026561856269836,
-0.5301132202148438,
0.5917308330535889,
0.18586724996566772,
0.22190774977207184,
1.0379669666290283,
-0.35612764954566956,
0.0995311290025711,
0.24808436632156372,
-0.6716238856315613,
0.11818137764930725,
-0.47417572140693665,
-0.17178452014923096,
1.02218890190124... |
func (c *Client) Close() error {
return c.Db.Disconnect()
} | [
-0.3733392357826233,
0.43243393301963806,
0.3449245095252991,
-0.0122170215472579,
-0.4396010637283325,
0.6106160879135132,
-0.2874385416507721,
-0.6209073662757874,
-1.1032143831253052,
-0.33654022216796875,
-0.04612822085618973,
-0.29583731293678284,
-1.6118870973587036,
0.41318294405937... |
func (c *Client) GetStateAgencies(uf string) ([]models.Agency, error) {
ags, err := c.Db.GetStateAgencies(uf)
if err != nil {
return nil, fmt.Errorf("GetStateAgencies() error: %q", err)
}
return ags, err
} | [
-1.5609941482543945,
0.5931969881057739,
0.19607920944690704,
0.4268835186958313,
0.3838278353214264,
-0.7668513059616089,
0.1164223924279213,
-0.19675232470035553,
0.7417641878128052,
0.03636931627988815,
-0.2763482332229614,
-0.0003460556617937982,
-0.5007901191711426,
0.6739413738250732... |
func (c *Client) GetOMA(month int, year int, agency string) (*models.AgencyMonthlyInfo, *models.Agency, error) {
agsMR, agencyObj, err := c.Db.GetOMA(month, year, agency)
if err != nil {
return nil, nil, fmt.Errorf("GetOMA() error: %q", err)
}
return agsMR, agencyObj, nil
} | [
-0.5556184649467468,
-0.3738950490951538,
0.6291268467903137,
0.4740672707557678,
0.3068321943283081,
-0.4463626742362976,
-0.5868687033653259,
-0.28480714559555054,
0.8748190999031067,
0.04437825456261635,
0.6362118721008301,
0.4814901351928711,
0.507732629776001,
0.3304562568664551,
0.... |
func (c *Client) Store(agmi models.AgencyMonthlyInfo) error {
if err := c.Db.Store(agmi); err != nil {
return fmt.Errorf("Store() error: %q", err)
}
return nil
} | [
0.3804748058319092,
0.2185191810131073,
0.16087961196899414,
0.4155588746070862,
-0.2598155438899994,
1.1471328735351562,
-0.2308334857225418,
-0.507875382900238,
-0.09006646275520325,
-0.8714964985847473,
-0.11837617307901382,
0.021949298679828644,
-0.7650606036186218,
0.4916742146015167,... |
func (c *Client) GetAgenciesCount() (int, error) {
count, err := c.Db.GetAgenciesCount()
if err != nil {
return count, fmt.Errorf("GetAgenciesCount() error: %q", err)
}
return count, nil
} | [
0.13034972548484802,
0.5882663130760193,
0.38139596581459045,
-0.6941526532173157,
0.332072377204895,
-0.43303006887435913,
0.30284571647644043,
0.08182037621736526,
-0.33381393551826477,
0.10111701488494873,
0.2131229043006897,
-0.6262412667274475,
0.15725257992744446,
0.590278148651123,
... |
func (c *Client) GetNumberOfMonthsCollected() (int, error) {
count, err := c.Db.GetNumberOfMonthsCollected()
if err != nil {
return count, fmt.Errorf("GetNumberOfMonthsCollected() error: %q", err)
}
return count, nil
} | [
0.8777039051055908,
0.043196048587560654,
0.49477165937423706,
0.02859993278980255,
1.2054117918014526,
0.4274054765701294,
0.7372321486473083,
-0.5481442213058472,
-0.0523420125246048,
-1.3867988586425781,
-0.45958423614501953,
0.18277353048324585,
0.007799654733389616,
0.2611090242862701... |
func (c *Client) GetLastDateWithMonthlyInfo() (int, int, error) {
month, year, err := c.Db.GetLastDateWithMonthlyInfo()
if err != nil {
return 0, 0, fmt.Errorf("GetLastDateWithMonthlyInfo() error: %q", err)
}
return month, year, nil
} | [
0.531190812587738,
-0.8550140857696533,
0.7912910580635071,
-0.0570705346763134,
-0.11015927046537399,
0.31991666555404663,
-0.2889758348464966,
0.08314076066017151,
0.18039348721504211,
-0.6358453035354614,
0.17898185551166534,
-0.7565385103225708,
-0.960389256477356,
1.161778450012207,
... |
func (c *Client) GetFirstDateWithMonthlyInfo() (int, int, error) {
month, year, err := c.Db.GetFirstDateWithMonthlyInfo()
if err != nil {
return 0, 0, fmt.Errorf("GetFirstDateWithMonthlyInfo() error: %q", err)
}
return month, year, nil
} | [
1.081639289855957,
-0.783718466758728,
0.46965235471725464,
0.4973524212837219,
-0.04860719293355942,
0.0708218663930893,
-0.35288888216018677,
-0.02498699724674225,
0.18054884672164917,
-1.2117061614990234,
0.4100419580936432,
-0.3934609591960907,
-0.5872843861579895,
1.756066083908081,
... |
func (c *Client) GetIndexInformation(name string, month, year int) (map[string][]models.IndexInformation, error) {
agg, err := c.Db.GetIndexInformation(name, month, year)
if err != nil {
return nil, fmt.Errorf("GetIndexInformation() error: %w", err)
}
return agg, nil
} | [
-1.3304123878479004,
-0.005151079967617989,
0.45709842443466187,
-0.19209201633930206,
-0.17689427733421326,
-0.014705196022987366,
-0.2413610965013504,
-0.08861030638217926,
-0.22506697475910187,
0.4895521104335785,
-0.5127902626991272,
-0.1316680759191513,
-0.6001107096672058,
0.25717985... |
func (c *Client) GetAllAgencyCollection(agency string) ([]models.AgencyMonthlyInfo, error) {
collections, err := c.Db.GetAllAgencyCollection(agency)
if err != nil {
return nil, fmt.Errorf("GetAllAgencyCollection() error: %w", err)
}
return collections, nil
} | [
-0.3356907367706299,
-0.46421101689338684,
0.6711342930793762,
0.2632999122142792,
-0.4035090506076813,
0.15601971745491028,
-0.49381476640701294,
-0.35572466254234314,
0.4864511787891388,
-0.4038805663585663,
0.15620629489421844,
0.3580012917518616,
-0.004247251898050308,
1.89125144481658... |
func PadLeft(src, padding string, length int) (string, error) {
if length <= len(src) {
return "", errors.New("Target length must be greater than the length" +
" of the original string.")
}
if len(padding) != 1 {
return "", errors.New("Padding must be a single character.")
}
return strings.Repeat(padding... | [
0.8261094689369202,
0.6095248460769653,
0.487983763217926,
-0.9086740016937256,
-0.661833643913269,
0.4272831678390503,
-1.001471757888794,
-0.19604559242725372,
1.2161568403244019,
0.5631968379020691,
0.13782592117786407,
0.5760515332221985,
-0.7597535252571106,
-0.08530223369598389,
0.... |
func (u *Unit) OpenStdinReader() (io.ReadCloser, error) {
go func() {
wfp, err := os.OpenFile(u.stdinPath, os.O_WRONLY, 0200)
if err != nil {
glog.Errorf("opening stdin pipe %s: %v", u.stdinPath, err)
} else {
defer wfp.Close()
}
select {
case _ = <-u.stdinCloser:
break
}
}()
fp, err := os.Ope... | [
-0.3674308955669403,
-0.9052744507789612,
0.7280868887901306,
-0.19008363783359528,
-1.0318764448165894,
0.8647516965866089,
0.7532352805137634,
0.040925756096839905,
-0.17642226815223694,
-0.2504502534866333,
0.8301737308502197,
0.27974602580070496,
-0.5833215713500977,
-0.004432232584804... |
func TestTruncate(t *testing.T) {
if result := truncate(sha1Hmac); result != truncExpect {
fmt.Printf("hotp: expected truncate -> %d, saw %d\n",
truncExpect, result)
t.FailNow()
}
sha1Hmac[19]++
if result := truncate(sha1Hmac); result == truncExpect {
fmt.Println("hotp: expected truncation to fail")
t.F... | [
0.8400798439979553,
0.9504217505455017,
0.4414414167404175,
0.00047829747200012207,
1.1211357116699219,
0.4356796443462372,
0.4852311909198761,
0.1365608125925064,
0.3620181977748871,
-0.5640013217926025,
-0.6454339623451233,
-0.1985044777393341,
-1.0488171577453613,
0.055874455720186234,
... |
func init() {
backendQueue = make(chan *Backend, 10) //channel at a size of 10
//This is a buffered channel.
//This means that it can hold 10 Backends before it starts to block
} | [
0.8879126310348511,
0.203347310423851,
0.7692916393280029,
-1.1416288614273071,
1.3513824939727783,
-0.2568400800228119,
-0.11444611102342606,
-0.2125137895345688,
-0.2860761880874634,
-0.13124285638332367,
-0.8359273076057434,
1.2551040649414062,
-0.6236759424209595,
0.2551531195640564,
... |
func NewHookConsole(level logrus.Level) *HookConsole {
return &HookConsole{
logger: &logrus.Logger{
Out: os.Stderr,
Formatter: new(logrus.TextFormatter),
Hooks: make(logrus.LevelHooks),
Level: level,
},
}
} | [
0.1979115754365921,
-1.4040335416793823,
0.31938424706459045,
-0.9263275265693665,
-0.24728138744831085,
-0.4147341847419739,
0.2197638601064682,
-1.0200483798980713,
-0.9665996432304382,
-0.1560840606689453,
0.020089030265808105,
0.9860817193984985,
0.3918946087360382,
0.5867936015129089,... |
func (hook *HookConsole) Levels() []logrus.Level {
return logrus.AllLevels
} | [
-0.1642688512802124,
-0.8933249115943909,
0.27652212977409363,
0.1539066880941391,
1.2095582485198975,
0.9829666018486023,
-0.40838509798049927,
-0.5610519647598267,
-0.5567208528518677,
-0.6407700777053833,
0.24561502039432526,
0.7496639490127563,
-0.3127318322658539,
1.1346590518951416,
... |
func (hook *HookConsole) Fire(e *logrus.Entry) error {
msg := e.Message
if scope, ok := e.Data["scope"]; ok {
msg = "(" + scope.(string) + ") " + msg
}
switch e.Level {
case logrus.PanicLevel:
hook.logger.Panic(msg)
case logrus.FatalLevel:
hook.logger.Fatal(msg)
case logrus.ErrorLevel:
hook.logger.Error... | [
-0.09310223907232285,
-0.6838892698287964,
0.7432642579078674,
-0.2830463647842407,
0.48692411184310913,
-0.31000271439552307,
-0.1885877400636673,
-0.08938640356063843,
-0.42023518681526184,
-0.45932647585868835,
-0.13349999487400055,
1.4214260578155518,
0.2337501347064972,
0.925029814243... |
func drawWholeBoard(b *board, h bool) {
fmt.Printf("\033[H\033[2J")
fmt.Printf("\033[H\033[1mCurrent Board\n\033[0m")
printLine(80)
fmt.Println()
fmt.Printf("\033[0m ")
for x := 0; x < b.width; x++ {
fmt.Printf("%-2d ", x+1)
}
fmt.Printf("\n")
fmt.Printf(" %s", TOP_LEFT_CORNER)
for x := 0; x < b.w... | [
0.18791109323501587,
0.5931315422058105,
1.5429258346557617,
-0.27052900195121765,
-0.17649854719638824,
1.0537116527557373,
0.5982929468154907,
-0.08096513152122498,
-0.8685289025306702,
0.0987052246928215,
-0.19579972326755524,
0.7871999144554138,
-0.367499440908432,
0.705178439617157,
... |
func showPiece(b *board, x int, y int, h bool) string {
myPieces := b.discoveredBoard
if !h {
myPieces = b.actualBoard
}
p := myPieces[y][x]
if p == MINE {
return "\033[41;1m \033[0m\033[31;1mX\033[0m\033[41;1m \033[0m"
} else if p == UNKNOWN {
return "\033[47m - \033[0m"
} else if p == POSSIBLE {
return... | [
0.2782890200614929,
0.26247695088386536,
1.20688796043396,
-0.7102099061012268,
-1.0034617185592651,
1.0241271257400513,
-0.5774970054626465,
0.32606661319732666,
0.055285580456256866,
0.6487975120544434,
0.6633372902870178,
0.675058901309967,
-0.5842639803886414,
0.06948313862085342,
0.... |
func index(res http.ResponseWriter, req *http.Request, p httprouter.Params) {
_, err := req.Cookie("login")
if err == nil {
http.Redirect(res, req, "app", http.StatusSeeOther)
}
TPL.ExecuteTemplate(res, "index", nil)
} | [
-0.6705780029296875,
0.03385047987103462,
0.466781884431839,
0.38047099113464355,
-0.026541810482740402,
0.6662811636924744,
0.9369417428970337,
0.6348909139633179,
-0.06635360419750214,
0.822801411151886,
0.4776343107223511,
0.42019039392471313,
0.5326911807060242,
-0.5764715671539307,
... |
func login(res http.ResponseWriter, req *http.Request, p httprouter.Params) {
_, err := req.Cookie("login")
if err == nil {
http.Redirect(res, req, "app", http.StatusSeeOther)
}
TPL.ExecuteTemplate(res, "login", nil)
} | [
-0.6302406787872314,
0.13388992846012115,
0.6907758712768555,
0.7481140494346619,
-0.13772884011268616,
0.39999356865882874,
0.35811150074005127,
0.5711256265640259,
0.049312200397253036,
0.3975922167301178,
0.0678611621260643,
-0.020692521706223488,
0.2892637252807617,
-0.1703191697597503... |
func WithFake(t T, f func(T)) FakeReport {
fake := fakeT{T: t}
// t.FailNow calls runtime.Goexit to kill the current goroutine.
// To guard against that, we'll run the given function
// in a separate goroutine and if the user calls t.FailNow,
// we'll record it and continue execution here.
done := make(chan stru... | [
0.6891803741455078,
0.3929694592952728,
0.6299221515655518,
-0.07999304682016373,
0.749598503112793,
-0.6334218978881836,
-0.8235760927200317,
-0.8061181902885437,
-1.1922303438186646,
0.19573937356472015,
-0.3246011435985565,
-0.13916385173797607,
-0.6294652819633484,
-0.2690814137458801,... |
func landHandler(w http.ResponseWriter, r *http.Request) {
path := r.URL.Path[1:]
if path == "" || path == "index" {
path = "index.html"
}
//open file and send
f, err := os.Open("content/" + path)
if err != nil {
fourOhFour(w, r)
} else {
http.ServeContent(w, r, path, time.Now(), f)
}
} | [
0.6739346981048584,
0.11747730523347855,
0.7010481357574463,
-0.13265039026737213,
-0.21699059009552002,
1.0413258075714111,
0.6952276229858398,
-0.5074526071548462,
-0.6901642084121704,
-0.414167195558548,
0.7822083830833435,
-0.6770769357681274,
-0.7111217379570007,
0.3197941184043884,
... |
func pathHandler(w http.ResponseWriter, r *http.Request) {
path := "/var/www/ear7h-net/" + r.URL.Path[1:]
//open file and send
f, err := os.Open(path)
if err != nil {
fourOhFour(w, r)
} else {
http.ServeContent(w, r, r.URL.Path, time.Now(), f)
}
} | [
0.23409202694892883,
-0.10491324216127396,
0.6104742288589478,
-0.1186453178524971,
-0.18112607300281525,
0.601151704788208,
0.9886239171028137,
-0.2030736804008484,
-0.6175331473350525,
0.2967567443847656,
0.25089582800865173,
-1.1046665906906128,
-0.9858168363571167,
0.2976512908935547,
... |
func binHandler(w http.ResponseWriter, r *http.Request) {
path := "/var/www/ear7h-net/" + r.URL.Path[1:]
//open file and send
f, err := os.Open(path)
if err != nil {
fourOhFour(w, r)
} else {
http.ServeContent(w, r, r.URL.Path, time.Now(), f)
}
} | [
0.00981457345187664,
-0.3991522490978241,
0.7656415700912476,
-0.09046725183725357,
-0.06862743198871613,
0.6907910108566284,
0.47168782353401184,
-0.5415706038475037,
-0.7789093852043152,
-0.30554264783859253,
0.10491202771663666,
-0.36562177538871765,
-0.6888874769210815,
0.5058113932609... |
func NewSsmService(ctx context.Context) (*SsmService, error) {
cfg, err := config.LoadDefaultConfig(ctx)
if err != nil {
// Don't need to quit the process
log.Printf("Failed to load default SDK config to create SSM client - %s\n", err.Error())
return nil, err
}
// Create an Amazon DynamoDB client.
client :=... | [
0.17811019718647003,
0.08169829100370407,
0.08205372095108032,
0.29290786385536194,
0.09545062482357025,
-0.46955615282058716,
-0.6462219953536987,
-0.8572445511817932,
-0.12525641918182373,
-0.5205281972885132,
-0.4633248448371887,
-0.14752879738807678,
-0.6240422129631042,
0.940337538719... |
func NewDBService(ctx context.Context, tableName string) (*DBService, error) {
cfg, err := config.LoadDefaultConfig(ctx)
if err != nil {
log.Fatalf("Failed to load default SDK config to create DynamoDB client - %s\n", err.Error())
}
// Create an Amazon DynamoDB client.
client := dynamodb.NewFromConfig(cfg)
re... | [
-0.22201547026634216,
0.5860868096351624,
0.14486582577228546,
0.6950535178184509,
-0.2527586817741394,
-0.14262820780277252,
-0.6425884962081909,
-0.8833720684051514,
-0.35667070746421814,
0.11372324824333191,
-0.3584977984428406,
-0.1484498530626297,
-0.4623790681362152,
0.34006842970848... |
func NewSqsService(ctx context.Context, queueName string) (*SqsService, error) {
// Only to use default config here
cfg, err := config.LoadDefaultConfig(ctx)
if err != nil {
log.Fatalf("Failed to load default SDK config to create SQS client - %s\n", err.Error())
}
client := sqs.NewFromConfig(cfg)
input := &sq... | [
-0.427590012550354,
-0.9525137543678284,
0.3511844575405121,
-0.3912048935890198,
-0.44544705748558044,
-0.31736689805984497,
-1.14005708694458,
-1.20699143409729,
0.2500622570514679,
-0.030479762703180313,
-0.28468844294548035,
0.3296970725059509,
-0.6824455261230469,
0.6071538925170898,
... |
func (ss *SqsService) SendMessage(ctx context.Context, body *string) {
// log.Printf("Sending 1 Message to Queue")
input := &sqs.SendMessageInput{
QueueUrl: &ss.queueURL,
MessageBody: body,
}
_, err := ss.client.SendMessage(ctx, input)
if err != nil {
log.Fatalf("Failed to send the messages in batch to ... | [
-0.8810150027275085,
-0.36450377106666565,
0.3797037899494171,
0.17833326756954193,
0.8415231704711914,
0.4251178801059723,
-0.32923397421836853,
-0.5736508369445801,
0.2650260627269745,
-0.15647515654563904,
-0.10212640464305878,
0.703861653804779,
-0.8476789593696594,
0.7821847796440125,... |
func (ss *SqsService) SendMessageInBatch(ctx context.Context, batch []*string) {
// log.Printf("Sending %d messages to Queue in batch ", len(batch))
// Assume batch size <= 10
entries := make([]types.SendMessageBatchRequestEntry, len(batch), len(batch))
for id, body := range batch {
idstr := strconv.Itoa(id)
... | [
-0.40497463941574097,
-0.5523305535316467,
0.5910046100616455,
-0.0009779216488823295,
0.5771220922470093,
0.6661561131477356,
-0.44082915782928467,
-0.9050206542015076,
-0.2773558795452118,
0.011571244336664677,
-0.05212511122226715,
0.6680691838264465,
-1.1338824033737183,
0.842496275901... |
func (ss *SqsService) ReceiveMessages(ctx context.Context) (body, receiptHandle *string) {
input := &sqs.ReceiveMessageInput{
QueueUrl: &ss.queueURL,
WaitTimeSeconds: 20,
}
output, err := ss.client.ReceiveMessage(ctx, input)
if err != nil {
log.Fatalf("Unable to read message from Queue %s - %s", ss.q... | [
-0.20981456339359283,
-0.7854787707328796,
0.3536987006664276,
-1.3975613117218018,
0.16342207789421082,
-0.6113893389701843,
-0.28770211338996887,
-0.5246968865394592,
0.550574779510498,
-0.5309813022613525,
-0.10322383791208267,
-0.2313188910484314,
-0.6760276556015015,
0.084664523601531... |
func (ss *SqsService) DeleteMessage(ctx context.Context, rh *string) (ok bool) {
// log.Printf("Delete Message from Queue\n")
input := &sqs.DeleteMessageInput{
QueueUrl: &ss.queueURL,
ReceiptHandle: rh,
}
_, err := ss.client.DeleteMessage(ctx, input)
if err != nil {
log.Printf("Unable to delete messa... | [
-0.44420570135116577,
-0.21726876497268677,
0.8284021019935608,
-0.6800289154052734,
0.2809044122695923,
0.7166643142700195,
-0.22515517473220825,
-0.5216751098632812,
0.4434906840324402,
-0.7515120506286621,
-0.0914212018251419,
0.22888419032096863,
-1.456838607788086,
0.4259144365787506,... |
func (ss *SqsService) ChangeVisibilityTimeout(ctx context.Context, rh *string, seconds int32) (ok bool) {
input := &sqs.ChangeMessageVisibilityInput{
QueueUrl: &ss.queueURL,
ReceiptHandle: rh,
VisibilityTimeout: seconds,
}
_, err := ss.client.ChangeMessageVisibility(ctx, input)
if err != nil {
... | [
-0.010773477144539356,
-0.3543691635131836,
0.6010119915008545,
-0.5885128974914551,
-0.727443516254425,
0.30226564407348633,
-0.24199271202087402,
-0.14770397543907166,
0.004895210266113281,
1.0752280950546265,
-0.6702452301979065,
1.5051178932189941,
-0.40581998229026794,
1.0062147378921... |
func (ss *SqsService) IsQueueEmpty(ctx context.Context) (isEmpty bool) {
isEmpty = false
input := &sqs.GetQueueAttributesInput{
QueueUrl: &ss.queueURL,
AttributeNames: []types.QueueAttributeName{
"ApproximateNumberOfMessages",
"ApproximateNumberOfMessagesNotVisible",
},
}
output, err := ss.client.GetQue... | [
-1.0062240362167358,
-0.5314958095550537,
0.6641553044319153,
-0.7974916696548462,
-0.17581738531589508,
0.09945940226316452,
0.08277127891778946,
-0.44620928168296814,
0.5612887740135193,
0.7959348559379578,
-0.22916875779628754,
1.112263798713684,
-0.1278182566165924,
0.8764209151268005,... |
func (s *SsmService) GetParameterValue(ctx context.Context, param *string, withDecryption bool) *string {
log.Printf("Get Parameter Value of %s from SSM\n", *param)
input := &ssm.GetParameterInput{
Name: param,
WithDecryption: withDecryption,
}
output, err := s.client.GetParameter(ctx, input)
if e... | [
-0.109563909471035,
0.5548104047775269,
0.583765983581543,
0.24990278482437134,
-1.0294088125228882,
-0.18865646421909332,
-0.09571361541748047,
-0.8530842661857605,
-0.03823778033256531,
0.5495871305465698,
0.1460995376110077,
1.8996124267578125,
-0.8264589905738831,
0.523780882358551,
... |
func (db *DBService) PutItem(ctx context.Context, o *Object) error {
// log.Printf("Put item for %s in DynamoDB\n", o.Key)
item := &Item{
ObjectKey: o.Key,
Size: o.Size,
Sequencer: o.Sequencer,
JobStatus: "STARTED",
StartTime: time.Now().Format("2006/01/02 15:04:05"),
StartT... | [
-0.6794536709785461,
-0.021579476073384285,
0.6435453295707703,
0.15853407979011536,
-0.0784626305103302,
0.7141958475112915,
0.9428315758705139,
0.623092532157898,
-0.1487383246421814,
0.14327304065227509,
-0.46783798933029175,
-0.10825798660516739,
-0.1917688548564911,
0.0121356574818491... |
func (db *DBService) UpdateItem(ctx context.Context, key *string, result *TransferResult) error {
// log.Printf("Update item for %s in DynamoDB\n", *key)
etag := ""
if result.etag != nil {
etag = *result.etag
}
expr := "set JobStatus = :s, Etag = :tg, EndTime = :et, EndTimestamp = :etm, SpentTime = :etm - Star... | [
-1.1951864957809448,
-0.49359220266342163,
0.7684265375137329,
0.33797383308410645,
-0.9511078000068665,
0.38625049591064453,
0.5846540331840515,
0.6467281579971313,
-0.6880950331687927,
0.27390316128730774,
-0.4582976996898651,
-0.4209282696247101,
-0.05264000594615936,
-0.081219136714935... |
func (db *DBService) UpdateSequencer(ctx context.Context, key, sequencer *string) error {
// log.Printf("Update Sequencer for %s in DynamoDB\n", *key)
expr := "set Sequencer = :s"
input := &dynamodb.UpdateItemInput{
TableName: &db.tableName,
Key: map[string]dtype.AttributeValue{
"ObjectKey": &dtype.Attribut... | [
-1.406076431274414,
-1.6649978160858154,
0.45697465538978577,
-0.010511565953493118,
-1.1411664485931396,
-0.6798985004425049,
0.011039859615266323,
0.7866304516792297,
-0.40729185938835144,
0.566222608089447,
-0.5315338969230652,
-0.11312680691480637,
-0.16288045048713684,
0.6914341449737... |
func (db *DBService) QueryItem(ctx context.Context, key *string) (*Item, error) {
// log.Printf("Query item for %s in DynamoDB\n", *key)
input := &dynamodb.GetItemInput{
TableName: &db.tableName,
Key: map[string]dtype.AttributeValue{
"ObjectKey": &dtype.AttributeValueMemberS{Value: *key},
},
}
output, er... | [
-0.30131036043167114,
-0.3709843158721924,
0.2574603259563446,
0.17816559970378876,
-0.4086322784423828,
0.634425163269043,
-0.1573382019996643,
0.332004189491272,
-0.446364164352417,
-0.2820088267326355,
0.6935641169548035,
0.01830088160932064,
-0.20460644364356995,
-0.47271403670310974,
... |
func (us ChapterService) InfoOfId(dto dto.GeneralGetDto) model.Chapter {
return chapterDao.Get(dto.Id)
} | [
0.26055335998535156,
-0.8258840441703796,
0.34912726283073425,
-0.5294554829597473,
-0.41188421845436096,
-0.4333592355251312,
-0.823520839214325,
-1.4127833843231201,
-0.10612565279006958,
-0.100040964782238,
0.8089327216148376,
0.6074861884117126,
1.1482099294662476,
0.05717958137392998,... |
func (us ChapterService) List(dto dto.GeneralListDto) ([]model.Chapter, int64) {
return chapterDao.List(dto)
} | [
-0.6564867496490479,
-0.7175995111465454,
0.28806936740875244,
0.12608696520328522,
-0.5645338296890259,
0.004198448732495308,
-0.48533251881599426,
0.14724871516227722,
0.06727316230535507,
-0.16017545759677887,
-0.12297475337982178,
0.3962227702140808,
1.227104663848877,
0.73199939727783... |
func (us ChapterService) Create(dto dto.ChapterCreateDto) model.Chapter {
ChapterModel := model.Chapter{
Book_id: dto.Book_id,
Title: dto.Title,
Content: dto.Content,
Status: dto.Status,
Url: dto.Url,
}
c := chapterDao.Create(&ChapterModel)
if c.Error != nil {
log.Error(c.Error.Error())
}
retur... | [
-0.11121079325675964,
-0.3850975036621094,
0.3567838966846466,
0.4809163212776184,
0.005921855103224516,
1.0613046884536743,
-0.3203277885913849,
0.11670303344726562,
-1.0301098823547363,
-0.38840264081954956,
0.2038375735282898,
-0.6943878531455994,
0.5281999707221985,
0.08982911705970764... |
func (us ChapterService) Update(dto dto.ChapterEditDto) int64 {
ChapterModel := model.Chapter{
Id: dto.Id,
Book_id: dto.Book_id,
Title: dto.Title,
Content: dto.Content,
Status: dto.Status,
Url: dto.Url,
}
c := chapterDao.Update(&ChapterModel)
return c.RowsAffected
} | [
-1.2121254205703735,
-0.5848972201347351,
0.5910153388977051,
-0.41638410091400146,
-0.6592338681221008,
0.27230000495910645,
0.09801681339740753,
0.22877641022205353,
-0.42844194173812866,
-0.12173376977443695,
-0.36783820390701294,
-0.27446138858795166,
0.28472062945365906,
-0.1156694367... |
func TestNone(t *testing.T) {
None := &none{}
None.Printf("")
None.Print()
None.Println()
None.Tracef("")
None.Debugf("")
None.Infof("")
None.Warnf("")
None.Errorf("")
None.Trace()
None.Debug()
None.Info()
None.Warn()
None.Error()
None.Traceln()
None.Debugln()
None.Infoln()
None.Warnln()
None.Errorl... | [
0.13978368043899536,
0.10037609189748764,
0.7100766897201538,
0.20054644346237183,
0.7491486668586731,
0.11115748435258865,
0.71852046251297,
-0.546503484249115,
0.36760228872299194,
-0.6250553727149963,
-0.5068129301071167,
-0.07199644297361374,
-0.232382133603096,
0.5748415589332581,
1... |
func dfa(x []xfer, ll []*Lexeme) State {
st := State(0)
for _, l := range ll {
if int(st) >= len(x) {
return Reject
}
xm := &x[st]
nextst, ok := (*xm)[l.tok]
if !ok {
// check for otherwise case
nextst, ok = (*xm)[token.ILLEGAL]
if !ok {
nextst = Reject
}
}
st = nextst
}
return st
} | [
-0.29909709095954895,
0.7293031215667725,
0.5538437366485596,
-0.05871118977665901,
-0.7283029556274414,
-0.6573716998100281,
-0.7948697805404663,
-0.5890092253684998,
0.004670890513807535,
-0.17922432720661163,
0.43444329500198364,
0.4598521888256073,
-0.4872756600379944,
0.01433173473924... |
func write(w http.ResponseWriter, status int, payload interface{}) {
w.WriteHeader(status)
raw, err := json.Marshal(payload)
if err != nil {
panic(err)
}
_, _ = w.Write(raw)
} | [
-1.0361888408660889,
-0.2863602340221405,
0.5739615559577942,
-0.1806591898202896,
-0.18813765048980713,
0.3380384147167206,
-0.5544891953468323,
-0.04674093797802925,
-0.17811095714569092,
0.3420118987560272,
-0.19922643899917603,
-0.28883859515190125,
0.6327288150787354,
0.19940945506095... |
func writeError(w http.ResponseWriter, status int, err error) {
write(w, status, Error{Err: err.Error()})
} | [
-0.9380990266799927,
-0.6574754118919373,
0.2318633645772934,
0.6566389203071594,
0.391250342130661,
0.015195620246231556,
0.24770303070545197,
0.6757835149765015,
0.3595423698425293,
-0.15099170804023743,
-0.22649016976356506,
-0.5128368735313416,
0.16572381556034088,
0.5682166218757629,
... |
func (s *service) indexCore(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
req := &indexRequest{
index: s.index,
log: s.logger,
r: r,
store: s.store,
}
req.init()
req.read()
req.readCore()
if req.req.IncludeExecutable {
req.readExecutable()
} else {
req.computeExecutableSize()
... | [
-0.47237658500671387,
0.3615262508392334,
0.8256138563156128,
-0.5301768779754639,
-0.1352708637714386,
-0.08792853355407715,
0.4860619306564331,
0.1403888314962387,
0.08548061549663544,
0.6170381903648376,
0.7191733121871948,
0.8104597926139832,
-1.0904439687728882,
0.26276811957359314,
... |
func (s *service) analyzeCore(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
uid := p.ByName("uid")
c, err := s.index.Find(uid)
switch err {
case nil:
s.analysisQueue <- c
write(w, http.StatusAccepted, map[string]interface{}{"acknowledged": true})
case ErrNotFound:
writeError(w, http.StatusB... | [
-0.6925222277641296,
0.4771208167076111,
0.7902426719665527,
0.2254250943660736,
-0.21997077763080597,
-0.41646745800971985,
0.5196111798286438,
-0.40983670949935913,
0.9781862497329712,
0.3447641432285309,
0.7114030122756958,
0.4501340091228485,
-0.5348590016365051,
1.1534918546676636,
... |
func (s *service) searchCore(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
var err error
q := r.FormValue("q")
if len(q) == 0 {
q = "*"
}
sort := r.FormValue("sort")
if len(sort) == 0 {
sort = "dumped_at"
}
switch sort {
case "dumped_at", "hostname":
break
default:
writeError(w, htt... | [
-1.1443605422973633,
0.6568486094474792,
1.4230222702026367,
-0.2757168710231781,
-0.3637901544570923,
-0.4198322296142578,
-0.026004120707511902,
-0.9039613604545593,
0.04763662442564964,
0.7830851674079895,
0.5628901720046997,
-0.09159675985574722,
-0.8684698939323425,
0.1160435304045677... |
func (s *service) getCore(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
f, err := s.store.Core(p.ByName("uid"))
if err != nil {
writeError(w, http.StatusInternalServerError, err)
return
}
defer f.Close()
// We ignore the error here, because the zero-value is fine in case of
// error.
info, ... | [
-0.7068865895271301,
0.5644751191139221,
0.6256639361381531,
0.22157423198223114,
0.1986616849899292,
-0.5961158275604248,
0.12295924127101898,
-0.6567544341087341,
0.1504974216222763,
0.3991977870464325,
0.9471815228462219,
0.2959766089916229,
-0.9915421605110168,
0.5605791211128235,
-0... |
func (s *service) deleteCore(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
uid := p.ByName("uid")
c, err := s.index.Find(uid)
switch err {
case nil:
s.cleanupQueue <- c
write(w, http.StatusAccepted, map[string]interface{}{"acknowledged": true})
case ErrNotFound:
writeError(w, http.StatusBad... | [
-0.3421940505504608,
0.48073577880859375,
0.6988483667373657,
-0.10982434451580048,
-0.30425214767456055,
-0.42810797691345215,
0.6492709517478943,
-0.06566708534955978,
1.090712547302246,
0.3399514853954315,
0.9644554853439331,
0.31329041719436646,
-1.0172048807144165,
0.93462735414505,
... |
func (s *service) lookupExecutable(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
exists, err := s.store.ExecutableExists(p.ByName("hash"))
if err != nil {
s.logger.Warn("looking up executable", "hash", p.ByName("hash"), "err", err)
writeError(w, http.StatusInternalServerError, err)
return
}
... | [
-0.29689255356788635,
-0.45222222805023193,
0.8649671673774719,
-0.04050905257463455,
0.5579583644866943,
0.31004974246025085,
0.15762901306152344,
-0.5744768381118774,
0.302507221698761,
0.4797414541244507,
0.20170901715755463,
-0.15460090339183807,
0.01716252975165844,
0.5014767646789551... |
func (s *service) getExecutable(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
f, err := s.store.Executable(p.ByName("hash"))
if err != nil {
writeError(w, http.StatusInternalServerError, err)
return
}
defer f.Close()
// We ignore the error here, because the zero-value is fine in case of
// e... | [
-0.06351640820503235,
-0.10625490546226501,
0.611463189125061,
0.44663816690444946,
0.5059845447540283,
-0.44400423765182495,
0.19487176835536957,
-0.8068543672561646,
-0.38260889053344727,
-0.11532176285982132,
0.49911999702453613,
0.1344517171382904,
-0.38428476452827454,
0.3169439136981... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.