text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func NewKeyboard() *pb.Keyboard {
kb := &pb.Keyboard{
Layout: randomKeyBoardLayout(),
Backlit: randomBool(),
}
return *&kb
} | [
0.06822896003723145,
0.35405677556991577,
0.365208238363266,
1.7708635330200195,
-1.1494312286376953,
0.406267911195755,
0.13976186513900757,
0.14457455277442932,
0.36880385875701904,
-0.5817003846168518,
-0.248067244887352,
-0.45088428258895874,
-1.242676019668579,
0.400636225938797,
-0... |
func NewRAM() *pb.Memory {
memGB := randomInt(4, 64)
ram := &pb.Memory{
Value: uint64(memGB),
Unit: pb.Memory_GIGABYTE,
}
return ram
} | [
-0.13963229954242706,
0.38298046588897705,
0.48062726855278015,
0.5896627306938171,
-0.49760597944259644,
0.7651687264442444,
-0.13415417075157166,
-0.5880162119865417,
0.24033424258232117,
-0.5726610422134399,
0.04152815788984299,
0.5362442135810852,
-1.0133434534072876,
0.272230863571167... |
func NewSSD() *pb.Storage {
memGB := randomInt(128, 1024)
ssd := &pb.Storage{
Driver: pb.Storage_SSD,
Memory: &pb.Memory{
Value: uint64(memGB),
Unit: pb.Memory_GIGABYTE,
},
}
return ssd
} | [
0.4986134171485901,
0.05749180167913437,
0.6411113142967224,
0.22324518859386444,
-1.12270188331604,
0.6801019906997681,
-1.1466505527496338,
-0.37139737606048584,
0.4186265766620636,
-0.9706623554229736,
0.6844896674156189,
0.6029375195503235,
-0.5006138682365417,
0.9512399435043335,
0.... |
func NewHDD() *pb.Storage {
memTB := randomInt(1, 6)
hdd := &pb.Storage{
Driver: pb.Storage_HDD,
Memory: &pb.Memory{
Value: uint64(memTB),
Unit: pb.Memory_TERABYTE,
},
}
return hdd
} | [
0.8090535402297974,
-0.4032929539680481,
0.6581044793128967,
0.7504159808158875,
-0.595784604549408,
1.173755407333374,
-0.8552573919296265,
-0.3323965072631836,
0.2344115525484085,
-0.6733663082122803,
0.8880274295806885,
-0.011964664794504642,
-1.194953441619873,
0.1393164098262787,
1.... |
func NewScreen() *pb.Screen {
screen := &pb.Screen{
SizeInch: randomFloat32(13, 17),
Resolution: randomScreenResolution(),
Panel: randomScreenPanel(),
Multitouch: randomBool(),
}
return screen
} | [
-0.30398380756378174,
0.10169044882059097,
0.4921320676803589,
0.5849422812461853,
-0.5970526933670044,
0.7395007610321045,
0.026780055835843086,
-1.3110053539276123,
1.0764375925064087,
-0.721853494644165,
-0.04384103789925575,
-0.5318294167518616,
-1.1324862241744995,
0.750132143497467,
... |
func NewLaptop() *pb.Laptop {
brand := randomLaptopBrand()
name := randomLaptopName(brand)
laptop := &pb.Laptop{
Id: randomID(),
Brand: brand,
Name: name,
Cpu: NewCpu(),
Ram: NewRAM(),
Gpus: []*pb.GPU{NewGPU()},
Storages: []*pb.Storage{NewSSD(), NewHDD()},
Scre... | [
-1.405806064605713,
-0.312185138463974,
0.821668803691864,
0.43507257103919983,
-1.037458062171936,
0.6967828869819641,
-0.4214656949043274,
-0.4587341845035553,
0.26151546835899353,
0.0538710281252861,
-0.59516841173172,
-0.32053470611572266,
-0.351847380399704,
-0.44329607486724854,
-0... |
func HighestFeeFirst(a, b interface{}) int {
s1 := a.(*SignedOperation)
s2 := b.(*SignedOperation)
switch {
case s1.Operation.GetFee() > s2.Operation.GetFee():
// s1 is higher priority. so a < b
return -1
case s1.Operation.GetFee() < s2.Operation.GetFee():
return 1
case s1.Signature < s2.Signature:
// s1... | [
0.5396753549575806,
-0.08774533867835999,
0.7273960709571838,
0.37021544575691223,
0.05211224406957626,
-1.1185144186019897,
0.12336701899766922,
0.31212589144706726,
0.21000593900680542,
-0.40517452359199524,
-0.14887350797653198,
0.5646868348121643,
-0.07472949475049973,
0.55998206138610... |
func NewService(client *memcache.Client) Service {
return &memproxyService{
client: client,
}
} | [
1.0073117017745972,
0.31589213013648987,
0.07883848994970322,
-0.6407732367515564,
-1.2167654037475586,
-0.18237222731113434,
-0.17440885305404663,
-0.6837940216064453,
0.13306304812431335,
-0.011977878399193287,
0.001820838893763721,
0.21288880705833435,
-1.4523169994354248,
0.26084312796... |
func (this *structHelper) valueToString(v reflect.Value) (string, error) {
if !v.IsValid() {
return "null", nil
}
switch v.Kind() {
case reflect.Ptr:
return this.valueToString(reflect.Indirect(v))
case reflect.Interface:
return this.valueToString(v.Elem())
case reflect.Bool:
x := v.Bool()
if x {
ret... | [
-0.1947927623987198,
-0.5092174410820007,
0.7582722306251526,
-0.7661292552947998,
-0.2154640257358551,
-0.4294902980327606,
0.4715966582298279,
-1.1891944408416748,
0.8691326379776001,
0.7628486752510071,
0.20477670431137085,
0.6434611678123474,
-0.056818924844264984,
0.873491644859314,
... |
func ProtoToHealthcareFhirStoreVersionEnum(e healthcarepb.HealthcareFhirStoreVersionEnum) *healthcare.FhirStoreVersionEnum {
if e == 0 {
return nil
}
if n, ok := healthcarepb.HealthcareFhirStoreVersionEnum_name[int32(e)]; ok {
e := healthcare.FhirStoreVersionEnum(n[len("HealthcareFhirStoreVersionEnum"):])
retu... | [
-0.2987263798713684,
-0.14869622886180878,
0.5504890084266663,
-0.19457478821277618,
1.1296354532241821,
-0.6099084615707397,
0.41136178374290466,
0.48124805092811584,
0.5372816324234009,
-0.5080327391624451,
-0.26615315675735474,
0.8202112317085266,
-0.19807380437850952,
0.237473770976066... |
func ProtoToHealthcareFhirStoreStreamConfigsBigqueryDestinationSchemaConfigSchemaTypeEnum(e healthcarepb.HealthcareFhirStoreStreamConfigsBigqueryDestinationSchemaConfigSchemaTypeEnum) *healthcare.FhirStoreStreamConfigsBigqueryDestinationSchemaConfigSchemaTypeEnum {
if e == 0 {
return nil
}
if n, ok := healthcarepb... | [
-1.0183687210083008,
0.4998699426651001,
0.6262576580047607,
-0.9198189973831177,
0.9389311075210571,
0.18689705431461334,
-0.38395577669143677,
0.7038224339485168,
0.2681749761104584,
-0.23130998015403748,
-0.28641387820243835,
0.08295651525259018,
0.16710934042930603,
-0.283050537109375,... |
func ProtoToHealthcareFhirStoreComplexDataTypeReferenceParsingEnum(e healthcarepb.HealthcareFhirStoreComplexDataTypeReferenceParsingEnum) *healthcare.FhirStoreComplexDataTypeReferenceParsingEnum {
if e == 0 {
return nil
}
if n, ok := healthcarepb.HealthcareFhirStoreComplexDataTypeReferenceParsingEnum_name[int32(e)... | [
-0.7001668810844421,
0.52265465259552,
0.46104440093040466,
-1.3861926794052124,
0.6490168571472168,
-0.056846484541893005,
0.25668075680732727,
0.979839563369751,
0.24541468918323517,
-0.8530270457267761,
-0.3534439206123352,
0.23865896463394165,
-0.3280429244041443,
0.062308866530656815,... |
func ProtoToHealthcareFhirStoreNotificationConfig(p *healthcarepb.HealthcareFhirStoreNotificationConfig) *healthcare.FhirStoreNotificationConfig {
if p == nil {
return nil
}
obj := &healthcare.FhirStoreNotificationConfig{
PubsubTopic: dcl.StringOrNil(p.GetPubsubTopic()),
}
return obj
} | [
0.6986554265022278,
0.5110929608345032,
0.1101655662059784,
-0.14247402548789978,
0.9080644249916077,
-0.1051822081208229,
0.2256164252758026,
1.0233428478240967,
-0.9741629958152771,
-0.5289346575737,
-0.28965193033218384,
0.2964552044868469,
0.1013217493891716,
1.1034129858016968,
0.75... |
func ProtoToHealthcareFhirStoreStreamConfigs(p *healthcarepb.HealthcareFhirStoreStreamConfigs) *healthcare.FhirStoreStreamConfigs {
if p == nil {
return nil
}
obj := &healthcare.FhirStoreStreamConfigs{
BigqueryDestination: ProtoToHealthcareFhirStoreStreamConfigsBigqueryDestination(p.GetBigqueryDestination()),
}... | [
-0.08503817766904831,
-0.20879970490932465,
0.3275407552719116,
-0.6787868738174438,
0.6548058390617371,
-0.15671682357788086,
-0.03601335361599922,
-0.13460597395896912,
0.012971588410437107,
-0.46093958616256714,
-0.025489825755357742,
0.7889309525489807,
-0.4444963037967682,
0.419704377... |
func ProtoToHealthcareFhirStoreStreamConfigsBigqueryDestination(p *healthcarepb.HealthcareFhirStoreStreamConfigsBigqueryDestination) *healthcare.FhirStoreStreamConfigsBigqueryDestination {
if p == nil {
return nil
}
obj := &healthcare.FhirStoreStreamConfigsBigqueryDestination{
DatasetUri: dcl.StringOrNil(p.Get... | [
-0.5994217395782471,
0.06291571259498596,
0.4411734342575073,
-0.8719041347503662,
0.7250710725784302,
-0.004166092723608017,
-0.013031232170760632,
0.25307756662368774,
0.0407525934278965,
-0.5700128674507141,
-0.06551288813352585,
0.9029989242553711,
-0.02959151566028595,
-0.201417803764... |
func ProtoToHealthcareFhirStoreStreamConfigsBigqueryDestinationSchemaConfig(p *healthcarepb.HealthcareFhirStoreStreamConfigsBigqueryDestinationSchemaConfig) *healthcare.FhirStoreStreamConfigsBigqueryDestinationSchemaConfig {
if p == nil {
return nil
}
obj := &healthcare.FhirStoreStreamConfigsBigqueryDestinationSch... | [
-0.8874050378799438,
0.030938543379306793,
0.5379462242126465,
-1.2202340364456177,
0.9800791144371033,
0.04349401593208313,
-0.6448221206665039,
0.8113307952880859,
-0.032495517283678055,
-0.6307792663574219,
-0.20592811703681946,
0.8251684904098511,
0.7729908227920532,
0.0010940551292151... |
func ProtoToHealthcareFhirStoreValidationConfig(p *healthcarepb.HealthcareFhirStoreValidationConfig) *healthcare.FhirStoreValidationConfig {
if p == nil {
return nil
}
obj := &healthcare.FhirStoreValidationConfig{
DisableProfileValidation: dcl.Bool(p.GetDisableProfileValidation()),
DisableRequiredFieldVa... | [
0.26663631200790405,
-0.24568983912467957,
0.31252676248550415,
-0.4120960235595703,
0.11694033443927765,
0.42408597469329834,
0.5903551578521729,
0.861729621887207,
-0.4787631928920746,
-0.3303941488265991,
-0.5216787457466125,
0.34775784611701965,
-0.23948736488819122,
1.2735247611999512... |
func ProtoToFhirStore(p *healthcarepb.HealthcareFhirStore) *healthcare.FhirStore {
obj := &healthcare.FhirStore{
Name: dcl.StringOrNil(p.GetName()),
EnableUpdateCreate: dcl.Bool(p.GetEnableUpdateCreate()),
NotificationConfig: ProtoToHealthcareFhirStoreNotifica... | [
0.34369248151779175,
-0.5008552074432373,
0.41285252571105957,
-0.4730592370033264,
-0.14544454216957092,
0.13353434205055237,
0.2087913155555725,
-0.3395262062549591,
0.1955532282590866,
-0.6747632026672363,
0.10425090044736862,
0.3207462430000305,
-0.8440565466880798,
0.24837198853492737... |
func HealthcareFhirStoreVersionEnumToProto(e *healthcare.FhirStoreVersionEnum) healthcarepb.HealthcareFhirStoreVersionEnum {
if e == nil {
return healthcarepb.HealthcareFhirStoreVersionEnum(0)
}
if v, ok := healthcarepb.HealthcareFhirStoreVersionEnum_value["FhirStoreVersionEnum"+string(*e)]; ok {
return healthca... | [
-0.19383707642555237,
0.417510986328125,
0.5502713322639465,
-0.09215733408927917,
0.5482943058013916,
-0.6939200758934021,
0.4056830406188965,
0.03575975075364113,
0.9414766430854797,
0.35211181640625,
-0.4861544966697693,
0.6500425934791565,
-0.07701003551483154,
-0.24029499292373657,
... |
func HealthcareFhirStoreStreamConfigsBigqueryDestinationSchemaConfigSchemaTypeEnumToProto(e *healthcare.FhirStoreStreamConfigsBigqueryDestinationSchemaConfigSchemaTypeEnum) healthcarepb.HealthcareFhirStoreStreamConfigsBigqueryDestinationSchemaConfigSchemaTypeEnum {
if e == nil {
return healthcarepb.HealthcareFhirSto... | [
-0.47056517004966736,
0.9416496753692627,
0.8260149359703064,
-1.0966558456420898,
0.6687173247337341,
0.0506194569170475,
-0.10943904519081116,
0.16899316012859344,
0.7290083765983582,
0.4157368242740631,
-0.23065878450870514,
0.2647513747215271,
0.3326513171195984,
-0.27405574917793274,
... |
func HealthcareFhirStoreComplexDataTypeReferenceParsingEnumToProto(e *healthcare.FhirStoreComplexDataTypeReferenceParsingEnum) healthcarepb.HealthcareFhirStoreComplexDataTypeReferenceParsingEnum {
if e == nil {
return healthcarepb.HealthcareFhirStoreComplexDataTypeReferenceParsingEnum(0)
}
if v, ok := healthcarepb... | [
-0.4595746397972107,
1.0007809400558472,
0.5932726263999939,
-1.4413294792175293,
0.3586250841617584,
-0.16729089617729187,
0.21257364749908447,
0.26224184036254883,
0.5906899571418762,
-0.13101360201835632,
-0.3503447473049164,
0.16748178005218506,
-0.008937478996813297,
-0.19307616353034... |
func HealthcareFhirStoreNotificationConfigToProto(o *healthcare.FhirStoreNotificationConfig) *healthcarepb.HealthcareFhirStoreNotificationConfig {
if o == nil {
return nil
}
p := &healthcarepb.HealthcareFhirStoreNotificationConfig{}
p.SetPubsubTopic(dcl.ValueOrEmptyString(o.PubsubTopic))
return p
} | [
0.3619668483734131,
1.603285789489746,
0.21771687269210815,
0.05876793712377548,
0.3382609784603119,
-0.015610720030963421,
0.5197426676750183,
0.2205752283334732,
-1.0871726274490356,
0.10825306922197342,
-0.5130359530448914,
-0.1856396347284317,
0.4156155288219452,
0.5825599431991577,
... |
func HealthcareFhirStoreStreamConfigsToProto(o *healthcare.FhirStoreStreamConfigs) *healthcarepb.HealthcareFhirStoreStreamConfigs {
if o == nil {
return nil
}
p := &healthcarepb.HealthcareFhirStoreStreamConfigs{}
p.SetBigqueryDestination(HealthcareFhirStoreStreamConfigsBigqueryDestinationToProto(o.BigqueryDestina... | [
0.21813534200191498,
0.6733163595199585,
0.5075351595878601,
-0.4579322636127472,
0.37405797839164734,
-0.32182398438453674,
0.33893755078315735,
-0.6769481897354126,
0.2653105854988098,
-0.03537307679653168,
-0.17021475732326508,
0.6128213405609131,
-0.2405330240726471,
0.0793714672327041... |
func HealthcareFhirStoreStreamConfigsBigqueryDestinationToProto(o *healthcare.FhirStoreStreamConfigsBigqueryDestination) *healthcarepb.HealthcareFhirStoreStreamConfigsBigqueryDestination {
if o == nil {
return nil
}
p := &healthcarepb.HealthcareFhirStoreStreamConfigsBigqueryDestination{}
p.SetDatasetUri(dcl.Value... | [
-0.31180277466773987,
0.846627950668335,
0.5566284656524658,
-0.7859296202659607,
0.40585389733314514,
0.03765977919101715,
0.23223093152046204,
-0.43358373641967773,
0.3599691689014435,
0.01706392504274845,
-0.09055439382791519,
0.6280084252357483,
0.6022382378578186,
-0.5621610879898071,... |
func HealthcareFhirStoreStreamConfigsBigqueryDestinationSchemaConfigToProto(o *healthcare.FhirStoreStreamConfigsBigqueryDestinationSchemaConfig) *healthcarepb.HealthcareFhirStoreStreamConfigsBigqueryDestinationSchemaConfig {
if o == nil {
return nil
}
p := &healthcarepb.HealthcareFhirStoreStreamConfigsBigqueryDest... | [
-0.692679226398468,
0.981311559677124,
0.6072959303855896,
-1.3670897483825684,
0.15676560997962952,
-0.06772632151842117,
-0.3343610465526581,
0.41410836577415466,
-0.07683487981557846,
-0.21079906821250916,
-0.4086747467517853,
0.3074924051761627,
0.8482524156570435,
-0.28233951330184937... |
func HealthcareFhirStoreValidationConfigToProto(o *healthcare.FhirStoreValidationConfig) *healthcarepb.HealthcareFhirStoreValidationConfig {
if o == nil {
return nil
}
p := &healthcarepb.HealthcareFhirStoreValidationConfig{}
p.SetDisableProfileValidation(dcl.ValueOrEmptyBool(o.DisableProfileValidation))
p.SetDis... | [
0.09498024731874466,
0.5040465593338013,
0.5479533672332764,
-0.41443002223968506,
-0.3893774747848511,
0.27669352293014526,
0.6515806317329407,
0.4639328420162201,
-0.6076359748840332,
0.25115713477134705,
-0.8121792674064636,
-0.11038298904895782,
0.26889804005622864,
0.5770653486251831,... |
func FhirStoreToProto(resource *healthcare.FhirStore) *healthcarepb.HealthcareFhirStore {
p := &healthcarepb.HealthcareFhirStore{}
p.SetName(dcl.ValueOrEmptyString(resource.Name))
p.SetEnableUpdateCreate(dcl.ValueOrEmptyBool(resource.EnableUpdateCreate))
p.SetNotificationConfig(HealthcareFhirStoreNotificationConfig... | [
0.2120029181241989,
-0.16478320956230164,
0.539830207824707,
-0.57738196849823,
-0.11259753257036209,
-0.48831287026405334,
0.17685294151306152,
-0.4429895579814911,
-0.22050556540489197,
-0.24924631416797638,
-0.48265886306762695,
0.03967558220028877,
0.20171883702278137,
0.14807695150375... |
func (s *FhirStoreServer) applyFhirStore(ctx context.Context, c *healthcare.Client, request *healthcarepb.ApplyHealthcareFhirStoreRequest) (*healthcarepb.HealthcareFhirStore, error) {
p := ProtoToFhirStore(request.GetResource())
res, err := c.ApplyFhirStore(ctx, p)
if err != nil {
return nil, err
}
r := FhirStor... | [
-0.20193593204021454,
0.0598033182322979,
0.22253543138504028,
-0.021325744688510895,
-0.029471170157194138,
0.14027540385723114,
0.417655348777771,
0.035232216119766235,
0.4752143621444702,
-0.878338098526001,
0.22701413929462433,
0.24011823534965515,
-0.6711869239807129,
0.96804326772689... |
func (s *FhirStoreServer) ApplyHealthcareFhirStore(ctx context.Context, request *healthcarepb.ApplyHealthcareFhirStoreRequest) (*healthcarepb.HealthcareFhirStore, error) {
cl, err := createConfigFhirStore(ctx, request.GetServiceAccountFile())
if err != nil {
return nil, err
}
return s.applyFhirStore(ctx, cl, requ... | [
0.19572992622852325,
0.3424546718597412,
0.3918359875679016,
0.14528818428516388,
0.3934550881385803,
-0.3991066813468933,
0.7973288893699646,
0.4890866279602051,
0.5837265253067017,
-1.3249621391296387,
0.4929613471031189,
0.3396178185939789,
-0.3009459972381592,
1.3069318532943726,
1.2... |
func (s *FhirStoreServer) DeleteHealthcareFhirStore(ctx context.Context, request *healthcarepb.DeleteHealthcareFhirStoreRequest) (*emptypb.Empty, error) {
cl, err := createConfigFhirStore(ctx, request.GetServiceAccountFile())
if err != nil {
return nil, err
}
return &emptypb.Empty{}, cl.DeleteFhirStore(ctx, Prot... | [
0.4517810344696045,
0.04086196795105934,
0.2564556896686554,
0.3019922077655792,
0.2881064713001251,
-0.16386398673057556,
0.9772740006446838,
-0.22908565402030945,
0.25640198588371277,
-1.3024450540542603,
0.5731774568557739,
0.5990997552871704,
-0.33937686681747437,
1.3804740905761719,
... |
func (s *FhirStoreServer) ListHealthcareFhirStore(ctx context.Context, request *healthcarepb.ListHealthcareFhirStoreRequest) (*healthcarepb.ListHealthcareFhirStoreResponse, error) {
cl, err := createConfigFhirStore(ctx, request.GetServiceAccountFile())
if err != nil {
return nil, err
}
resources, err := cl.ListF... | [
-0.07099112868309021,
-0.15185128152370453,
0.37539464235305786,
-0.21624188125133514,
0.250552773475647,
-0.5379465818405151,
0.08015463501214981,
-0.10979077965021133,
0.3182998299598694,
-0.6807783246040344,
-0.03248852863907814,
0.5737001299858093,
-0.07900099456310272,
1.1828736066818... |
func (*Foo) Descriptor() ([]byte, []int) {
return file_map_proto_rawDescGZIP(), []int{0}
} | [
-0.7264823913574219,
0.6594200134277344,
0.6288250684738159,
-0.1574353575706482,
-0.18192651867866516,
0.08342432230710983,
-0.1542055606842041,
0.698784351348877,
-0.7867043614387512,
-0.5642486214637756,
-0.286912202835083,
0.6810269355773926,
0.7013354301452637,
1.1939092874526978,
1... |
func (*MapMessage) Descriptor() ([]byte, []int) {
return file_map_proto_rawDescGZIP(), []int{1}
} | [
-1.303661823272705,
0.48259028792381287,
0.7140020728111267,
0.0944456085562706,
-0.6043028235435486,
0.1994955986738205,
-0.17604516446590424,
0.004305053036659956,
0.04189132899045944,
-0.16323596239089966,
-0.13617566227912903,
0.22361242771148682,
-0.14770536124706268,
0.74316000938415... |
func (c *Client) Search(ctx context.Context, params *SearchInput, optFns ...func(*Options)) (*SearchOutput, error) {
if params == nil {
params = &SearchInput{}
}
result, metadata, err := c.invokeOperation(ctx, "Search", params, optFns, c.addOperationSearchMiddlewares)
if err != nil {
return nil, err
}
out :... | [
-1.142124891281128,
1.2586076259613037,
0.6700185537338257,
0.47586557269096375,
0.4509638249874115,
-0.583935558795929,
0.7490746378898621,
-1.0823894739151,
0.21926914155483246,
-0.004508415702730417,
0.14133691787719727,
0.4928821623325348,
-1.1691747903823853,
-0.5272546410560608,
-0... |
func NewSearchPaginator(client SearchAPIClient, params *SearchInput, optFns ...func(*SearchPaginatorOptions)) *SearchPaginator {
if params == nil {
params = &SearchInput{}
}
options := SearchPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
f... | [
-1.1169542074203491,
0.19712093472480774,
0.42469653487205505,
-0.17199090123176575,
-1.0799628496170044,
-1.008190393447876,
-0.6073083877563477,
-0.2605020999908447,
0.19321167469024658,
0.20381705462932587,
-0.3126898407936096,
-0.006513342261314392,
-0.7530730366706848,
0.9026608467102... |
func (p *SearchPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
} | [
-0.16981656849384308,
-0.14269493520259857,
0.30151721835136414,
-0.6827499270439148,
0.5843569040298462,
-0.8915635943412781,
-1.7115111351013184,
-0.22502608597278595,
0.3091021180152893,
-0.5829771757125854,
-0.5687420964241028,
-0.8866446614265442,
-0.45002323389053345,
1.3822133541107... |
func (p *SearchPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
para... | [
-0.5080630779266357,
0.4291510581970215,
0.6407573223114014,
-0.14884290099143982,
0.04851888120174408,
-0.6313146352767944,
0.17821845412254333,
-0.6843312978744507,
0.0126875638961792,
-0.26415854692459106,
0.6607722043991089,
-0.3346307575702667,
-1.2404260635375977,
0.0080603351816535,... |
func (*Product) Descriptor() ([]byte, []int) {
return file_protofile_product_proto_rawDescGZIP(), []int{0}
} | [
-1.0078098773956299,
0.47440171241760254,
0.4665074050426483,
0.82634437084198,
0.1467243880033493,
0.8151437044143677,
0.9063609838485718,
-0.17421381175518036,
-0.196684330701828,
-0.5608468651771545,
-0.6824042201042175,
-0.08779385685920715,
-0.22350166738033295,
0.296790212392807,
0... |
func (*ProductResult) Descriptor() ([]byte, []int) {
return file_protofile_product_proto_rawDescGZIP(), []int{1}
} | [
-0.4118175804615021,
0.5843473076820374,
0.19803817570209503,
0.24791240692138672,
-0.12958021461963654,
-0.3365393877029419,
1.1979618072509766,
-0.3998800814151764,
-0.436286598443985,
-0.38493770360946655,
-0.9827601313591003,
0.20582526922225952,
-0.2674785554409027,
0.0640774145722389... |
func InitAndPlan(t *testing.T, options *Options) int {
exitCode, err := InitAndPlanE(t, options)
require.NoError(t, err)
return exitCode
} | [
0.3807467520236969,
0.12079538404941559,
0.5711884498596191,
0.09264928847551346,
-0.12813453376293182,
0.7983729243278503,
0.8154199123382568,
0.4793369174003601,
-0.3984127640724182,
-0.3314993977546692,
-0.38140669465065,
0.3151148855686188,
-0.7426581978797913,
0.715149998664856,
0.5... |
func InitAndPlanE(t *testing.T, options *Options) (int, error) {
if _, err := InitE(t, options); err != nil {
return DefaultErrorExitCode, err
}
return PlanExitCodeE(t, options)
} | [
0.4008141756057739,
0.1327425241470337,
0.7341421842575073,
0.3424726724624634,
-0.05137738212943077,
0.37137678265571594,
0.5366855263710022,
0.40948325395584106,
-0.6351103782653809,
0.2189692109823227,
0.10458476841449738,
-0.02967023476958275,
-1.2558006048202515,
0.6262460947036743,
... |
func PlanExitCode(t *testing.T, options *Options) int {
exitCode, err := PlanExitCodeE(t, options)
require.NoError(t, err)
return exitCode
} | [
0.36971426010131836,
-0.4273601472377777,
0.5065513849258423,
-0.2137601524591446,
0.24420391023159027,
0.7450486421585083,
0.37527018785476685,
0.3762654960155487,
-1.0002915859222412,
1.0751534700393677,
0.535544216632843,
-0.4387211203575134,
-0.5098574757575989,
-0.22276386618614197,
... |
func PlanExitCodeE(t *testing.T, options *Options) (int, error) {
return GetExitCodeForTerraformCommandE(t, options, FormatArgs(options, "plan", "-input=false", "-lock=true", "-detailed-exitcode")...)
} | [
0.36689528822898865,
0.16718773543834686,
0.41483405232429504,
-0.25916388630867004,
0.5187216997146606,
0.2554076313972473,
0.545534074306488,
0.4215552508831024,
-1.438923716545105,
0.6805287003517151,
0.4183616638183594,
-0.343148410320282,
-0.556522786617279,
-0.027439991012215614,
0... |
func TgPlanAllExitCode(t *testing.T, options *Options) int {
exitCode, err := TgPlanAllExitCodeE(t, options)
require.NoError(t, err)
return exitCode
} | [
0.549620509147644,
-0.06181711703538895,
0.43266811966896057,
-0.26690107583999634,
0.01833638735115528,
0.11612703651189804,
0.826049268245697,
0.43327808380126953,
-0.24835093319416046,
1.2619364261627197,
0.16871991753578186,
-0.667357325553894,
0.4848138988018036,
0.28257685899734497,
... |
func TgPlanAllExitCodeE(t *testing.T, options *Options) (int, error) {
if options.TerraformBinary != "terragrunt" {
return 1, fmt.Errorf("terragrunt must be set as TerraformBinary to use this method")
}
return GetExitCodeForTerraformCommandE(t, options, FormatArgs(options, "plan-all", "--input=false", "--lock=tru... | [
0.6549150943756104,
0.26455068588256836,
0.5667393803596497,
-0.21237197518348694,
0.3978685736656189,
-0.07499567419290543,
0.7019284963607788,
0.6137533187866211,
-1.03113853931427,
0.8384796977043152,
0.3266488313674927,
-0.5289397835731506,
0.3155736029148102,
0.746842622756958,
0.50... |
func NewDashboardConnHandler(list *CaptureList) http.HandlerFunc {
return func(rw http.ResponseWriter, req *http.Request) {
if _, ok := rw.(http.Flusher); !ok {
fmt.Printf("streaming not supported at %s\n", req.URL)
http.Error(rw, "streaming not supported", http.StatusInternalServerError)
return
}
rw.He... | [
-0.5252891778945923,
-0.15274392068386078,
0.8477026224136353,
0.4178909361362457,
-0.2915700674057007,
-0.36968618631362915,
0.16546083986759186,
0.191657155752182,
-0.30217698216438293,
-0.026082562282681465,
-0.5836991667747498,
-0.7203247547149658,
0.47113361954689026,
1.00581300258636... |
func NewDashboardClearHandler(list *CaptureList) http.HandlerFunc {
return func(rw http.ResponseWriter, req *http.Request) {
list.RemoveAll()
rw.WriteHeader(http.StatusOK)
}
} | [
-0.36533626914024353,
0.1714285910129547,
0.587123453617096,
0.5261571407318115,
-1.1786763668060303,
0.0706183910369873,
0.44321539998054504,
0.6258511543273926,
-0.03847473859786987,
-0.2463161200284958,
-0.7472130656242371,
-0.5928529500961304,
0.20983381569385529,
0.3242131173610687,
... |
func NewDashboardHTMLHandler(config Config) http.HandlerFunc {
return func(rw http.ResponseWriter, req *http.Request) {
rw.Header().Add("Content-Type", "text/html")
t, err := template.New("dashboard template").Delims("<<", ">>").Parse(dashboardHTML)
if err != nil {
msg := fmt.Sprintf("could not parse dashboar... | [
-0.14528603851795197,
0.7976280450820923,
0.47350460290908813,
0.4850694239139557,
-1.2119492292404175,
-0.046123821288347244,
0.7435500025749207,
0.9810519814491272,
-1.6454811096191406,
-0.09833426773548126,
-0.3656521439552307,
-1.0193376541137695,
0.02441098727285862,
0.432397246360778... |
func NewDashboardRetryHandler(list *CaptureList, next http.HandlerFunc) http.HandlerFunc {
return func(rw http.ResponseWriter, req *http.Request) {
id := req.URL.Path[strings.LastIndex(req.URL.Path, "/")+1:]
capture := list.Find(id)
if capture == nil {
http.Error(rw, "Item Not Found", http.StatusNotFound)
... | [
-0.5058596134185791,
0.3497988283634186,
0.7670077681541443,
0.27098992466926575,
-0.22425952553749084,
-0.5085200071334839,
0.24939224123954773,
0.143677219748497,
0.05996154993772507,
-0.4348529577255249,
-0.585123598575592,
-0.2271968424320221,
0.017014890909194946,
-0.09335612505674362... |
func NewDashboardItemInfoHandler(list *CaptureList) http.HandlerFunc {
return func(rw http.ResponseWriter, req *http.Request) {
id := req.URL.Path[strings.LastIndex(req.URL.Path, "/")+1:]
capture := list.Find(id)
if capture == nil {
http.Error(rw, "Item Not Found", http.StatusNotFound)
return
}
rw.Head... | [
-1.0440791845321655,
-0.31277868151664734,
0.754799485206604,
0.16245822608470917,
-0.09723861515522003,
-0.24517443776130676,
0.6136898994445801,
-0.3198334276676178,
-0.522907018661499,
0.028709284961223602,
-0.7549102306365967,
-0.8389768004417419,
0.45541203022003174,
0.274698436260223... |
func NewPlugin(next http.HandlerFunc) http.HandlerFunc {
p, err := plugin.Open("plugin.so")
if err != nil {
if strings.HasPrefix(err.Error(), "plugin.Open") {
fmt.Printf("error: could not open plugin file 'plugin.so': %v\n", err)
}
return next
}
f, err := p.Lookup("Handler")
if err != nil {
fmt.Printf("... | [
0.08182462304830551,
-1.2394977807998657,
0.5771127343177795,
0.6173721551895142,
-0.5003416538238525,
-0.0050094230100512505,
0.7206875681877136,
0.7011603713035583,
-0.061584558337926865,
-0.772333562374115,
-0.22468926012516022,
0.29308995604515076,
0.28582748770713806,
0.11197686940431... |
func NewRecorder(list *CaptureList, next http.HandlerFunc) http.HandlerFunc {
return func(rw http.ResponseWriter, req *http.Request) {
// save req body for later
var reqBody []byte
req.Body, reqBody = drain(req.Body)
rec := httptest.NewRecorder()
next.ServeHTTP(rec, req)
// respond
for k, v := range ... | [
-0.9905653595924377,
-0.5403527617454529,
0.695578396320343,
0.22347696125507355,
-0.06210510432720184,
0.14124876260757446,
-0.4704783260822296,
0.1128869503736496,
0.4177108705043793,
-0.30170536041259766,
-0.24585655331611633,
-0.6202494502067566,
-0.13838447630405426,
1.253530383110046... |
func NewProxyHandler(URL string) http.HandlerFunc {
url, _ := url.Parse(URL)
proxy := httputil.NewSingleHostReverseProxy(url)
proxy.ErrorHandler = func(rw http.ResponseWriter, req *http.Request, err error) {
fmt.Printf("uh oh | %v | %s %s\n", err, req.Method, req.URL)
rw.WriteHeader(StatusInternalProxyError)
f... | [
-0.4221618175506592,
-0.358186274766922,
0.6479175686836243,
-0.618837833404541,
-1.0655053853988647,
-0.052757006138563156,
0.19419868290424347,
0.6494494080543518,
-0.23389707505702972,
-0.1629514992237091,
-0.34989067912101746,
0.06755051016807556,
-0.12626703083515167,
0.05303151160478... |
func (e *ExtensionChanges) GetAllChanges() []*Change {
return e.Changes
} | [
0.046992186456918716,
-0.6093488931655884,
0.4409371018409729,
0.9279307126998901,
-0.4119996428489685,
0.9354153275489807,
-1.5944188833236694,
-0.2672814130783081,
1.6322370767593384,
-0.409224271774292,
-0.15009227395057678,
1.4454525709152222,
0.005001396872103214,
1.2388776540756226,
... |
func (e *ExtensionChanges) TotalChanges() int {
return e.PropertyChanges.TotalChanges()
} | [
-0.07996171712875366,
-0.014909197576344013,
0.5090465545654297,
-0.47425296902656555,
-0.5370314121246338,
-0.23857362568378448,
0.08572708070278168,
0.156197652220726,
1.045310616493225,
0.10562967509031296,
-0.13893955945968628,
0.0018169222166761756,
0.26929929852485657,
-0.21111382544... |
func (e *ExtensionChanges) TotalBreakingChanges() int {
return 0
} | [
-0.28908199071884155,
0.6140268445014954,
0.4677179455757141,
0.3392663896083832,
-0.7934629321098328,
0.21164372563362122,
0.72584468126297,
0.3444254398345947,
0.9093211889266968,
0.6021695733070374,
-1.3952025175094604,
-0.6422148942947388,
-0.2878718376159668,
0.25291380286216736,
0.... |
func CompareExtensions(l, r map[low.KeyReference[string]]low.ValueReference[any]) *ExtensionChanges {
// look at the original and then look through the new.
seenLeft := make(map[string]*low.ValueReference[any])
seenRight := make(map[string]*low.ValueReference[any])
for i := range l {
h := l[i]
seenLeft[strings... | [
0.5376201272010803,
-0.26794514060020447,
0.9200688004493713,
-0.47048890590667725,
-0.7612156867980957,
-0.8259625434875488,
-0.34683117270469666,
-0.848282516002655,
0.5112125277519226,
0.4792098104953766,
0.13091117143630981,
0.4072538912296295,
-0.49999934434890747,
0.33888381719589233... |
func CheckExtensions[T low.HasExtensions[T]](l, r T) *ExtensionChanges {
var lExt, rExt map[low.KeyReference[string]]low.ValueReference[any]
if len(l.GetExtensions()) > 0 {
lExt = l.GetExtensions()
}
if len(r.GetExtensions()) > 0 {
rExt = r.GetExtensions()
}
return CompareExtensions(lExt, rExt)
} | [
0.16141603887081146,
0.01770579256117344,
0.5506093502044678,
-0.05951149761676788,
-0.0865008756518364,
-0.9036275148391724,
-1.16161048412323,
-0.6336269378662109,
0.33527958393096924,
1.0548723936080933,
0.16849154233932495,
1.094984531402588,
-0.43927618861198425,
0.7442195415496826,
... |
func TestJobTaskAndAllocationAPI(t *testing.T) {
require.NoError(t, etc.SetRootPath(RootFromDB))
db := MustResolveTestPostgres(t)
MustMigrateTestPostgres(t, db, MigrationsFromDB)
// Add a mock user.
user := RequireMockUser(t, db)
// Add a job.
jID := model.NewJobID()
jIn := &model.Job{
JobID: jID,
JobTy... | [
0.4409545063972473,
0.31202375888824463,
0.8693759441375732,
0.38745030760765076,
-0.007649601437151432,
0.4738870859146118,
0.8031376004219055,
0.13944968581199646,
-0.29433929920196533,
0.3793236315250397,
-0.5549575686454773,
-0.3547917604446411,
0.7943326830863953,
0.1875218152999878,
... |
func (this *LRUCache) Get(key int) int {
// 如果 key 不存在,返回 -1
e, ok := this.m[key]
if !ok {
return -1
}
// 如果 key 已经存在需要将 value 移到最前面, 来保证最后面的元素是最近最少访问的
this.ll.MoveToFront(e)
return e.Value.(*element).value
} | [
-1.6159985065460205,
0.5713483095169067,
1.0264317989349365,
0.03342699632048607,
-0.4541454613208771,
-0.05117931216955185,
0.35799646377563477,
0.35995039343833923,
0.1288948953151703,
0.0989038497209549,
-0.47296854853630066,
0.1005391925573349,
-0.8814703226089478,
0.6962459683418274,
... |
func (this *LRUCache) Put(key int, value int) {
// 注意: 若 key 已存在,更新 value,并将 Element 移到 Front
if e, ok := this.m[key]; ok {
// 注意: 这里需要更新元素的值
e.Value.(*element).value = value
this.ll.MoveToFront(e)
return
}
// 容量足够
if this.cap > 0 {
// 注意: cap 是容量,而不是长度,所以是要减 1
this.cap--
e := this.ll.PushFront(&ele... | [
-0.9165981411933899,
0.45006829500198364,
0.8160008192062378,
-0.5237359404563904,
-0.59327232837677,
0.8853527307510376,
0.43152207136154175,
0.38391441106796265,
0.4822571873664856,
0.560982346534729,
-0.6519607901573181,
0.2845528721809387,
-0.8036302328109741,
0.2505469024181366,
0.3... |
func login(w http.ResponseWriter,r *http.Request){
session,err:=store.Get(r,"cookie-name")
if err!=nil{
log.Fatal(err)
}
// Where authentication could be done
if r.FormValue("code")!="code"{
if r.FormValue("code")==""{
session.AddFlash("must enter a code")
}
session.AddFlash("the code was incorrect")
... | [
-0.22841325402259827,
0.1439312994480133,
0.8243288397789001,
0.6895642876625061,
-0.10871313512325287,
0.6161102056503296,
0.3424251675605774,
0.6045483350753784,
0.3683401346206665,
-0.0770636796951294,
-0.8539018034934998,
-0.029371684417128563,
-0.27987074851989746,
-0.0707272738218307... |
func logout(w http.ResponseWriter,r *http.Request){
session,err:=store.Get(r,"cookie-name")
if err!=nil{
log.Fatal(err)
}
session.Values["user"]=user{}
session.Options.MaxAge=-1
err=session.Save(r,w)
if err!=nil{
log.Fatal(err)
}
http.Redirect(w,r,"/",http.StatusFound)
} | [
-0.7572518587112427,
-0.10069239884614944,
0.5094111561775208,
0.3035447299480438,
-0.2115827351808548,
0.595967173576355,
0.6532533764839172,
0.45313143730163574,
1.0618524551391602,
0.8330723643302917,
0.00891730934381485,
-0.02655118703842163,
0.19359996914863586,
-0.3671419024467468,
... |
func index(w http.ResponseWriter,r *http.Request){
session,err:=store.Get(r,"cookie-name")
if err!=nil{
log.Fatal(err)
}
user:=getUser(session)
tpl.ExecuteTemplate(w,"index.html",user)
} | [
-0.02487928606569767,
0.12030082195997238,
0.180562824010849,
0.2911408543586731,
-0.4070643186569214,
0.15740405023097992,
1.3721469640731812,
0.39153432846069336,
0.15896794199943542,
1.099470615386963,
0.6762192845344543,
0.9627193808555603,
0.3840709924697876,
-0.6167184114456177,
-0... |
func secret(w http.ResponseWriter, r *http.Request) {
session, err := store.Get(r, "cookie-name")
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
user := getUser(session)
if auth := user.Authenticated; !auth {
session.AddFlash("You don't have access!")
err = session.Sa... | [
0.25699231028556824,
0.5732018351554871,
0.731600821018219,
0.6463907957077026,
-0.4165034294128418,
0.15999367833137512,
0.8100496530532837,
0.1104443371295929,
0.24348141252994537,
0.44572943449020386,
-0.02523486502468586,
0.1966351717710495,
0.18438050150871277,
-0.035336922854185104,
... |
func forbidden(w http.ResponseWriter, r *http.Request) {
session, err := store.Get(r, "cookie-name")
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
flashMessages := session.Flashes()
err = session.Save(r, w)
if err != nil {
http.Error(w, err.Error(), http.StatusInternal... | [
0.47394320368766785,
0.8830924034118652,
0.7790662050247192,
0.6263627409934998,
0.33261293172836304,
0.12192384898662567,
1.1016992330551147,
-0.4254808723926544,
0.1098131537437439,
0.006820048205554485,
0.29248204827308655,
0.2807089686393738,
-0.13571789860725403,
0.4763321578502655,
... |
func (s SetLoadBalancerPoliciesOfListenerInput) String() string {
return awsutil.Prettify(s)
} | [
1.125773310661316,
-0.7231845259666443,
-0.014637356624007225,
-1.0680915117263794,
-0.20246168971061707,
1.53041672706604,
0.007229272276163101,
-1.3409992456436157,
0.49254563450813293,
0.451875239610672,
0.4468499422073364,
0.18450221419334412,
-0.3851330578327179,
0.014155501499772072,... |
func (s *SetLoadBalancerPoliciesOfListenerInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "SetLoadBalancerPoliciesOfListenerInput"}
if s.LoadBalancerName == nil {
invalidParams.Add(aws.NewErrParamRequired("LoadBalancerName"))
}
if s.LoadBalancerPort == nil {
invalidParams.Add(aws.NewE... | [
0.47390419244766235,
-0.37895718216896057,
0.41187939047813416,
-0.8069401383399963,
-0.09454065561294556,
1.0467363595962524,
-0.5736989378929138,
-0.6403926610946655,
-0.2300456017255783,
0.2620467245578766,
0.4038563072681427,
-0.14281664788722992,
-0.8749184608459473,
0.877989709377288... |
func (s SetLoadBalancerPoliciesOfListenerOutput) String() string {
return awsutil.Prettify(s)
} | [
1.507670283317566,
-1.0878764390945435,
0.03570764884352684,
-0.9590139985084534,
-0.41671955585479736,
0.8215668797492981,
0.1295074075460434,
-1.3227260112762451,
0.05202772468328476,
0.3392585813999176,
0.7583264708518982,
-0.11429241299629211,
-0.17006081342697144,
-0.24920699000358582... |
func (r SetLoadBalancerPoliciesOfListenerRequest) Send(ctx context.Context) (*SetLoadBalancerPoliciesOfListenerResponse, error) {
r.Request.SetContext(ctx)
err := r.Request.Send()
if err != nil {
return nil, err
}
resp := &SetLoadBalancerPoliciesOfListenerResponse{
SetLoadBalancerPoliciesOfListenerOutput: r.R... | [
-0.05829564854502678,
-0.326937198638916,
0.34971582889556885,
-0.21110789477825165,
-0.08457233756780624,
0.4530184864997864,
-0.4456997513771057,
-1.1372615098953247,
0.47202572226524353,
0.47576794028282166,
-0.2271648496389389,
0.19618569314479828,
-0.5177977085113525,
0.12566961348056... |
func (r *SetLoadBalancerPoliciesOfListenerResponse) SDKResponseMetdata() *aws.Response {
return r.response
} | [
0.8459399342536926,
-0.739396333694458,
0.10442642122507095,
-1.0012106895446777,
0.018849924206733704,
0.8866904973983765,
-0.7679473161697388,
-0.9665124416351318,
1.0059940814971924,
0.2238892763853073,
-0.48086264729499817,
-0.654276967048645,
-0.280566543340683,
-0.6503702998161316,
... |
func NewOneDriveClient() *OneDriveClient {
vRis := &OneDriveClient{httpClient: &http.Client{}}
return vRis
} | [
-0.6852430701255798,
-1.1659530401229858,
-0.0956595167517662,
-0.18661609292030334,
-1.059463381767273,
-0.7415173649787903,
0.34738656878471375,
-0.8453724980354309,
0.6016418933868408,
-0.7772064805030823,
0.026327114552259445,
0.15131732821464539,
-2.0546188354492188,
0.147954344749450... |
func TestMultiLevelLock(t *testing.T) {
ts, err := StartTestCluster(1, nil, logWriter{t: t, p: "[ZKERR] "})
if err != nil {
t.Fatal(err)
}
defer ts.Stop()
zk, _, err := ts.ConnectAll()
if err != nil {
t.Fatalf("Connect returned error: %+v", err)
}
defer zk.Close()
acls := WorldACL(PermAll)
path := "/test... | [
0.6336233615875244,
0.4171222746372223,
0.6767073273658752,
1.0401405096054077,
0.5506975650787354,
0.11669233441352844,
1.026607871055603,
-0.5432450175285339,
0.29220157861709595,
-0.37367579340934753,
-0.00789794884622097,
0.14523887634277344,
-0.7822967171669006,
0.3790843188762665,
... |
func (c *chanController) OpenChannel(target *btcec.PublicKey,
amt btcutil.Amount, addrs []net.Addr) error {
// We can't establish a channel if no addresses were provided for the
// peer.
if len(addrs) == 0 {
return fmt.Errorf("Unable to create channel w/o an active " +
"address")
}
// First, we'll check i... | [
-1.2569234371185303,
-0.10499855875968933,
0.5434668660163879,
-0.6942358613014221,
0.7749720215797424,
-0.4280005693435669,
0.2833966910839081,
-0.09952786564826965,
-0.3312631845474243,
0.04766549915075302,
0.9382216930389404,
0.6305168867111206,
-0.49885377287864685,
0.32296544313430786... |
func initAutoPilot(svr *server, cfg *autoPilotConfig) (*autopilot.Agent, error) {
atplLog.Infof("Instantiating autopilot with cfg: %v", spew.Sdump(cfg))
// First, we'll create the preferential attachment heuristic,
// initialized with the passed auto pilot configuration parameters.
//
minChanSize := svr.cc.wallet... | [
0.3762676417827606,
-0.15349316596984863,
0.6804627776145935,
0.05217282474040985,
-0.30207347869873047,
-0.032383427023887634,
-0.3282913565635681,
-0.08821526169776917,
0.3976036608219147,
0.011413322761654854,
-0.3265633285045624,
-0.12885291874408722,
-0.2557777464389801,
0.63584756851... |
func NewCreatePUTUpdatePUTRestResource[T InstanaDataObject](resourcePath string, unmarshaller JSONUnmarshaller[T], client RestClient) RestResource[T] {
return &defaultRestResource[T]{
mode: DefaultRestResourceModeCreateAndUpdatePUT,
resourcePath: resourcePath,
unmarshaller: unmarshaller,
client: ... | [
-0.7755662798881531,
-0.46215495467185974,
0.08597774058580399,
-0.7674069404602051,
-1.096238613128662,
-0.11185920238494873,
0.15902458131313324,
-0.016725728288292885,
-0.6923394203186035,
0.20427878201007843,
0.018409667536616325,
-0.5107125043869019,
-1.1340266466140747,
-0.6088587641... |
func NewCreatePOSTUpdatePUTRestResource[T InstanaDataObject](resourcePath string, unmarshaller JSONUnmarshaller[T], client RestClient) RestResource[T] {
return &defaultRestResource[T]{
mode: DefaultRestResourceModeCreatePOSTUpdatePUT,
resourcePath: resourcePath,
unmarshaller: unmarshaller,
client: ... | [
-0.19294409453868866,
-0.2998494803905487,
0.14929108321666718,
-0.228668674826622,
-1.498252272605896,
-0.291049987077713,
-0.060440417379140854,
-0.07823855429887772,
-0.8553003072738647,
-0.008328966796398163,
-0.33777740597724915,
-1.0653742551803589,
-1.1862000226974487,
-0.3512733280... |
func NewCreatePOSTUpdatePOSTRestResource[T InstanaDataObject](resourcePath string, unmarshaller JSONUnmarshaller[T], client RestClient) RestResource[T] {
return &defaultRestResource[T]{
mode: DefaultRestResourceModeCreateAndUpdatePOST,
resourcePath: resourcePath,
unmarshaller: unmarshaller,
client: ... | [
0.09095986187458038,
-0.29889723658561707,
0.07509058713912964,
0.08745650947093964,
-0.9840787053108215,
-0.26914769411087036,
-0.6673186421394348,
0.29621943831443787,
-0.6210501194000244,
-0.13997741043567657,
-0.4907996356487274,
-1.16582190990448,
-1.0734381675720215,
-0.1887406855821... |
func (r *Resolver) Register(f Factory) {
r.fs = append(r.fs, f)
} | [
-0.7989100813865662,
0.3455113172531128,
0.22686965763568878,
0.04880006983876228,
1.0002281665802002,
-0.7671322226524353,
-0.4856918454170227,
0.10435228794813156,
-0.7304530143737793,
-1.77376389503479,
-0.6329732537269592,
-0.5369403958320618,
0.6820281147956848,
0.2360236942768097,
... |
func TestMessageRegistry(t *testing.T) { //nolint:funlen,gocyclo
var result MessageRegistry
err := json.NewDecoder(strings.NewReader(messageRegistryBody)).Decode(&result)
if err != nil {
t.Errorf("Error decoding JSON: %s", err)
}
if result.ID != "MyRegistry.json" {
t.Errorf("Received invalid ID: %s", result.... | [
0.0774460956454277,
0.4541325271129608,
0.5263203382492065,
-0.5712739825248718,
1.2207367420196533,
-0.493254154920578,
0.6530688405036926,
-0.17101377248764038,
-0.5071144700050354,
-0.25575146079063416,
-0.7584614157676697,
0.5149924159049988,
-1.06539785861969,
0.8222317099571228,
0.... |
func NewLaptop() *pb.Laptop {
fmt.Println("Generate New Laptop")
newLaptop := &pb.Laptop{
Id: randomID(),
Brand: randomLaptopBrand(),
Model: randomLaptopModel(),
Cpu: NewCPU(),
Memory: NewMemory(),
Gpus: []*pb.GPU{NewGPU()},
Storages: []*pb.Storage{NewStorage(... | [
-1.4841467142105103,
-0.44595468044281006,
0.8705161809921265,
0.3264704942703247,
-0.8757737874984741,
0.8988778591156006,
-0.3048356771469116,
-0.40105578303337097,
0.1418619453907013,
-0.06325560063123703,
-0.7575806975364685,
-0.5160154700279236,
-0.4675222635269165,
-0.100405126810073... |
func Contains(array interface{}, val interface{}) (index int) {
index = -1
switch reflect.TypeOf(array).Kind() {
case reflect.Slice: {
s := reflect.ValueOf(array)
for i := 0; i < s.Len(); i++ {
if reflect.DeepEqual(val, s.Index(i).Interface()) {
... | [
-0.5851949453353882,
-0.5258573293685913,
0.7574899196624756,
0.21541206538677216,
-1.1994125843048096,
0.1939813196659088,
0.47306525707244873,
-0.4515054225921631,
0.2626919448375702,
0.07780829071998596,
0.40970346331596375,
1.8287591934204102,
-0.047820694744586945,
0.6553105115890503,... |
func ContainsString(array []string, val string) (index int) {
index = -1
for i := 0; i < len(array); i++ {
if array[i] == val {
index = i
return
}
}
return
} | [
-0.00576905719935894,
-1.1510248184204102,
0.5635260939598083,
0.2606084644794464,
-0.9219392538070679,
0.34906837344169617,
0.11366985738277435,
-1.0037111043930054,
-0.4150409698486328,
0.5430628061294556,
0.7669452428817749,
0.6635133028030396,
-0.06316012144088745,
-0.4300037920475006,... |
func ContainsInt(array []int64, val int64) (index int) {
index = -1
for i := 0; i < len(array); i++ {
if array[i] == val {
index = i
return
}
}
return
} | [
-0.11348245292901993,
-0.6364705562591553,
0.43192464113235474,
0.1947752833366394,
-1.1153559684753418,
0.45327430963516235,
-0.08443044126033783,
-0.9435039162635803,
-0.33333608508110046,
0.647140622138977,
0.3822174072265625,
0.609404981136322,
-0.3492369055747986,
0.13598552346229553,... |
func ContainsUint(array []uint64, val uint64) (index int) {
index = -1
for i := 0; i < len(array); i++ {
if array[i] == val {
index = i
return
}
}
return
} | [
-0.513918399810791,
-1.0130760669708252,
0.5975105166435242,
0.05064697936177254,
-0.6262809634208679,
0.45630910992622375,
0.20360739529132843,
-0.12187914550304413,
0.6483609080314636,
-0.269258975982666,
0.2460942417383194,
0.917412519454956,
0.06246799975633621,
0.16274335980415344,
... |
func ContainsBool(array []bool, val bool) (index int) {
index = -1
for i := 0; i < len(array); i++ {
if array[i] == val {
index = i
return
}
}
return
} | [
0.12475500255823135,
-0.8243550658226013,
0.5385621190071106,
0.6093406081199646,
-0.4809609651565552,
0.903580367565155,
0.45131275057792664,
-0.4111443758010864,
-0.526652991771698,
0.5483143925666809,
0.11175711452960968,
0.8787943720817566,
-0.15387147665023804,
-0.49148795008659363,
... |
func ContainsFloat(array []float64, val float64) (index int) {
index = -1
for i := 0; i < len(array); i++ {
if array[i] == val {
index = i
return
}
}
return
} | [
0.31724023818969727,
-0.29701390862464905,
0.5658974647521973,
0.462815523147583,
-0.2754594385623932,
0.22535860538482666,
0.7007074952125549,
-0.44494253396987915,
-0.4032422602176666,
-0.6418799757957458,
0.689761757850647,
0.6474053263664246,
-0.39716798067092896,
0.7500631213188171,
... |
func ContainsComplex(array []complex128, val complex128) (index int) {
index = -1
for i := 0; i < len(array); i++ {
if array[i] == val {
index = i
return
}
}
return
} | [
-0.08697141706943512,
-1.2510875463485718,
0.48963844776153564,
0.6199311017990112,
-0.7601639628410339,
0.40678679943084717,
0.8907650709152222,
-0.1934662014245987,
0.33744359016418457,
0.05335278436541557,
-0.10406491905450821,
0.551267683506012,
-0.5167171359062195,
0.03087498061358928... |
func parseTable(z *html.Tokenizer) {
var daycount int
var events []Event
for {
tt := z.Next()
switch tt {
case html.ErrorToken:
// End of the document, we're done
if len(events) > 0 {
publishEvent(events)
}
return
case html.StartTagToken:
t := z.Token()
if t.Data == "td" {
ParseRow:
... | [
0.026093892753124237,
-0.2087208479642868,
0.7000325322151184,
0.5056069493293762,
-0.5233410596847534,
-0.9182791113853455,
0.37192484736442566,
0.21722768247127533,
-0.41264528036117554,
-0.5421818494796753,
0.17990511655807495,
-0.10561861097812653,
0.6358467936515808,
0.99540776014328,... |
func parseDate(t string) (time.Time, bool) {
dt, err := time.Parse(layout, t)
if err != nil {
return dt, false
}
return dt, true
} | [
-0.17476817965507507,
0.9607055187225342,
1.0053437948226929,
0.1723209023475647,
-1.3408470153808594,
0.5941236615180969,
-0.38122785091400146,
-0.20520149171352386,
-0.20376846194267273,
-0.14415498077869415,
-1.022732138633728,
-1.4072009325027466,
-0.5964884161949158,
0.336559236049652... |
func parseRows(z *html.Tokenizer) string {
for {
tt := z.Next()
switch tt {
case html.ErrorToken:
// End of the document, we're done
return ""
case html.StartTagToken:
t := z.Token()
if t.Data == "td" {
for _, a := range t.Attr {
if a.Val == "rich-table-cell rich-table-cell-last" {
z... | [
0.10281885415315628,
0.06333091855049133,
0.6254090666770935,
0.12004299461841583,
-0.517711341381073,
-1.059065580368042,
-0.15388043224811554,
-0.6535546779632568,
0.13289891183376312,
-0.2930583953857422,
0.41195109486579895,
-0.5161561369895935,
-0.003229064168408513,
0.531176686286926... |
func notify(msg string, topic string, region string) {
log.Println(msg)
if config.Disablenotification {
log.Println("notification is disabled")
return
}
sess := session.Must(session.NewSession())
//region for AWS SNS topics
svc := sns.New(sess, aws.NewConfig().WithRegion(region))
params := &sns.PublishInput{... | [
0.6279454827308655,
-0.005552215501666069,
0.28137412667274475,
0.29139310121536255,
0.19197618961334229,
0.12137211859226227,
0.03627300262451172,
0.672501266002655,
0.3793397843837738,
0.6086855530738831,
-0.714069664478302,
1.189434289932251,
0.0068582757376134396,
0.358777791261673,
... |
func configure() {
loadConfigFile()
bw2client = bw2bind.ConnectOrExit("")
bw2client.OverrideAutoChainTo(true)
bw2client.SetEntityFromEnvironOrExit()
} | [
0.5277503728866577,
-0.5119911432266235,
0.49788394570350647,
0.7569139003753662,
0.6925168633460999,
0.3582838475704193,
-0.20721420645713806,
0.14121656119823456,
-2.0769429206848145,
0.14181770384311676,
-0.3323817551136017,
0.32589292526245117,
-0.4698399305343628,
0.8772892951965332,
... |
func loadConfigFile() {
f, err := os.Open(confPath)
if err != nil {
notify("Error: failed to load configuration file (./config.json). "+err.Error(), config.Devtopic, config.Devtopicregion)
log.Fatal(errors.New("Error: failed to load configuration file (./config.json). " + err.Error()))
return
}
d := json.NewD... | [
-0.21739992499351501,
0.6059466004371643,
0.4295225441455841,
-0.5805676579475403,
-0.14874091744422913,
-0.22531644999980927,
0.34843963384628296,
-0.18051749467849731,
-1.4277265071868896,
0.4069920778274536,
-0.5561712980270386,
-0.3330579400062561,
-0.11482810229063034,
1.2462007999420... |
func publishEvent(e []Event) bool {
if config.DisableBWPublish {
log.Println("publishing", e)
return true
}
// /sce/forecast/demand_response/s.forecast_demand_response/dr/i.xbos.demand_response_forecast/signal/info
service := bw2client.RegisterService(config.BWPubtopic, "s.forecast_demand_response")
iface := s... | [
-0.38219135999679565,
-0.20694366097450256,
0.9573332071304321,
0.08085319399833679,
0.020965225994586945,
0.9597271084785461,
0.479251891374588,
-0.16447214782238007,
-0.5214883685112,
0.1592879444360733,
-0.38972294330596924,
0.1717616468667984,
-0.42045435309410095,
0.5554531216621399,
... |
func InitializeData() {
// First we do the black cards
BlackCards = make(map[int]BlackCard)
ImportBlackCards()
// Print the amount of Black Cards loaded into memory.
fmt.Printf("%d Black Cards loaded!\n", len(BlackCards))
// Then we do the white cards.
WhiteCards = make(map[int]WhiteCard)
ImportWhiteCards()
/... | [
-0.4235503375530243,
-0.033829279243946075,
0.6564820408821106,
-0.5529633164405823,
0.8172883987426758,
0.08084191381931305,
0.11257582157850266,
-0.3497440814971924,
-0.26072001457214355,
-0.35732215642929077,
-0.6368549466133118,
0.6095407009124756,
0.19739125669002533,
0.42758640646934... |
func ImportBlackCards() {
// Loop through the black cards imported at start up of the bot and
// add them to our map of black cards.
for i, card := range cards.CardList.BlackCards {
// If there are no underscores, we still have to play a card.
if card.Cards2Play == 0 {
card.Cards2Play = 1
}
BlackCards[i]... | [
-0.522231936454773,
-0.5986176133155823,
0.5044119358062744,
-0.47857335209846497,
0.4741654396057129,
-0.35185131430625916,
-0.46255552768707275,
-0.03698332980275154,
0.48482292890548706,
1.167845368385315,
-1.436087965965271,
1.0031527280807495,
-0.11028784513473511,
0.02304988168179989... |
func ImportWhiteCards() {
// Loop through the white cards imported at start up of the bot and
// add them to our map of white cards.
for i, card := range cards.CardList.WhiteCards {
WhiteCards[i] = WhiteCard{
CardID: i,
Text: card.CardText,
taken: false,
}
}
} | [
-0.9666655659675598,
-0.24359658360481262,
0.4628167450428009,
-1.7113643884658813,
0.6486876010894775,
-0.10350623726844788,
-0.2764338552951813,
-0.03788640350103378,
0.5480514168739319,
1.3091365098953247,
-1.3803473711013794,
0.6760586500167847,
-0.27818769216537476,
-0.097516953945159... |
func AddPlayer(User *discordgo.User) {
Players[User.ID] = Player{
PlayerName: User.Username,
PlayerID: User.ID,
Zar: false,
}
// Add the player to the Zars list only if the game hasn't begun
if Round != 0 {
Zars = append(Zars, User.ID)
GenerateHand(User.ID)
}
// Add 1 to PlayerCount.
PlayerCou... | [
-0.4255594313144684,
-0.0867522582411766,
0.5082470178604126,
0.09460707753896713,
0.07058295607566833,
0.7430063486099243,
0.30911850929260254,
0.38544827699661255,
0.22324950993061066,
-0.4293978214263916,
-0.31803131103515625,
-0.19728690385818481,
-0.7694474458694458,
0.786939501762390... |
func RemovePlayer(s *discordgo.Session, m *discordgo.MessageCreate) {
s.ChannelMessageSend(m.ChannelID, fmt.Sprintf("%s has left the game!", m.Author.Username))
// Let's check if the game is paused, this is important because
// if the person leaving the game is the one who paused, we want to
// unpause it.
if Paus... | [
0.3011271357536316,
-0.7665431499481201,
0.7827498912811279,
-0.013816745020449162,
0.19273407757282257,
-0.5607507824897766,
0.17580591142177582,
0.85238116979599,
0.04049365222454071,
0.5201257467269897,
0.19302122294902802,
-0.05552711710333824,
-1.4639627933502197,
0.14785608649253845,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.