text
stringlengths
11
6.3k
embedding
listlengths
768
768
func (o *GetServerConfigImportsDefault) Code() int { return o._statusCode }
[ 0.13353197276592255, 0.9254779815673828, 0.33921805024147034, 1.0381731986999512, 0.4839341640472412, -0.18409259617328644, 0.3836795389652252, 0.6690138578414917, -0.3655233085155487, 0.7674571871757507, -1.0936877727508545, -0.533445417881012, -1.0335005521774292, 0.747350811958313, 0....
func NewImageFile( fileDescriptor protodescriptor.FileDescriptor, moduleIdentity bufmoduleref.ModuleIdentity, commit string, externalPath string, isImport bool, isSyntaxUnspecified bool, unusedDependencyIndexes []int32, ) (ImageFile, error) { return newImageFile( fileDescriptor, moduleIdentity, commit, ...
[ -0.17891311645507812, 0.16097992658615112, 0.541000485420227, 0.09100645780563354, -0.02633316069841385, 0.13978038728237152, 0.4119451642036438, 0.526287317276001, -0.6931958794593811, 0.2109803706407547, -0.6947222948074341, 0.3675116300582886, -0.19541041553020477, 0.7214382886886597, ...
func NewImage(imageFiles []ImageFile) (Image, error) { return newImage(imageFiles, false) }
[ -0.6062430739402771, -0.09611601382493973, 0.1451343297958374, 1.3873831033706665, -0.21106962859630585, 0.39593228697776794, -0.06435555219650269, 0.2627118229866028, -0.4747578501701355, 0.6059490442276001, 0.5810436010360718, -0.8362517356872559, -0.42177146673202515, 0.9339002966880798...
func MergeImages(images ...Image) (Image, error) { switch len(images) { case 0: return nil, nil case 1: return images[0], nil default: var paths []string imageFileSet := make(map[string]ImageFile) for _, image := range images { for _, currentImageFile := range image.Files() { storedImageFile, ok :=...
[ -0.4793844521045685, 0.11694099009037018, 0.553100049495697, 0.7831608653068542, 0.6794013977050781, 0.0605299137532711, 0.11870161443948746, -0.24960307776927948, 0.24899710714817047, -0.01364616397768259, 0.044645898044109344, -0.7554516196250916, -0.38462021946907043, 0.6656290292739868...
func NewImageForProto(protoImage *imagev1.Image, options ...NewImageForProtoOption) (Image, error) { var newImageOptions newImageForProtoOptions for _, option := range options { option(&newImageOptions) } if newImageOptions.noReparse && newImageOptions.computeUnusedImports { return nil, fmt.Errorf("cannot use b...
[ -0.8402845859527588, -0.4696606993675232, 0.5217602849006653, 0.40432676672935486, 0.25076672434806824, 0.2868885397911072, 0.412754088640213, 0.13393253087997437, -0.21703889966011047, 0.2952880859375, 0.08323057740926743, 0.14442074298858643, -0.1647009253501892, 1.2847034931182861, 0....
func NewImageForCodeGeneratorRequest(request *pluginpb.CodeGeneratorRequest, options ...NewImageForProtoOption) (Image, error) { if err := protodescriptor.ValidateCodeGeneratorRequestExceptFileDescriptorProtos(request); err != nil { return nil, err } protoImageFiles := make([]*imagev1.ImageFile, len(request.GetPro...
[ -1.4188027381896973, -0.20563529431819916, 0.43894296884536743, 0.4235018789768219, -0.7602065801620483, -0.23056019842624664, 0.15103738009929657, 0.1319001019001007, -0.8199781775474548, -0.2858106195926666, 0.8478304743766785, 0.11673066765069962, 0.05339520797133446, 1.7873609066009521...
func WithNoReparse() NewImageForProtoOption { return func(options *newImageForProtoOptions) { options.noReparse = true } }
[ -0.5193214416503906, 0.005979248322546482, 0.23963110148906708, -0.53225177526474, 0.12336172163486481, -0.44053903222084045, -0.412485271692276, -0.3736955225467682, -0.43628355860710144, -1.1188459396362305, 0.03846581652760506, -0.9843351244926453, -0.987178385257721, 0.8774760961532593...
func WithUnusedImportsComputation() NewImageForProtoOption { return func(options *newImageForProtoOptions) { options.computeUnusedImports = true } }
[ -0.4597485661506653, 0.5628092288970947, 0.23062793910503387, -0.7040537595748901, 0.2527129054069519, -0.8405450582504272, 1.4661731719970703, -0.26923584938049316, -0.03211940452456474, -0.356585830450058, -0.1489558219909668, -0.7438936233520508, -0.1310710608959198, 1.2194292545318604,...
func ImageWithoutImports(image Image) Image { imageFiles := image.Files() newImageFiles := make([]ImageFile, 0, len(imageFiles)) for _, imageFile := range imageFiles { if !imageFile.IsImport() { newImageFiles = append(newImageFiles, imageFile) } } return newImageNoValidate(newImageFiles) }
[ -0.22898882627487183, -0.004362980369478464, 0.20175433158874512, -0.0017137660179287195, -0.1093769520521164, 1.0408872365951538, 0.38809284567832947, -0.38038045167922974, 0.1095990315079689, 0.21314193308353424, -0.017796460539102554, -0.8122658729553223, -0.6514983177185059, 1.08705055...
func ImageWithOnlyPaths( image Image, paths []string, excludePaths []string, ) (Image, error) { return imageWithOnlyPaths(image, paths, excludePaths, false) }
[ 0.014583935029804707, 0.6036985516548157, 0.08487548679113388, 1.166813611984253, -1.0654351711273193, 0.2282572239637375, -0.2190745621919632, 0.4661634862422943, 0.6073418855667114, 0.4273614287376404, 0.36115390062332153, -0.48489341139793396, 0.19541631639003754, 0.8485656380653381, ...
func ImageWithOnlyPathsAllowNotExist( image Image, paths []string, excludePaths []string, ) (Image, error) { return imageWithOnlyPaths(image, paths, excludePaths, true) }
[ -0.04613063856959343, 0.5813121795654297, 0.4483027458190918, 1.0742348432540894, -0.5334193706512451, 0.7281436324119568, -0.5090495347976685, 0.5573142170906067, 0.2506934702396393, 0.9959267377853394, 1.3059316873550415, -0.4324279725551605, 0.38005754351615906, 0.8660205006599426, 0....
func ImageByDir(image Image) ([]Image, error) { imageFiles := image.Files() paths := make([]string, 0, len(imageFiles)) for _, imageFile := range imageFiles { if !imageFile.IsImport() { paths = append(paths, imageFile.Path()) } } dirToPaths := normalpath.ByDir(paths...) // we need this to produce a determi...
[ -0.4723164439201355, 0.12035946547985077, 0.5388053059577942, 0.9333310127258301, -0.3847920894622803, -0.3433248996734619, 0.9647819399833679, -0.20852743089199066, 0.4628850221633911, 0.41344955563545227, 0.20110024511814117, -0.08215433359146118, 0.0514051727950573, 1.7109776735305786, ...
func ImageToProtoImage(image Image) *imagev1.Image { imageFiles := image.Files() protoImage := &imagev1.Image{ File: make([]*imagev1.ImageFile, len(imageFiles)), } for i, imageFile := range imageFiles { protoImage.File[i] = imageFileToProtoImageFile(imageFile) } return protoImage }
[ -1.0188407897949219, 0.21258726716041565, 0.547802209854126, 0.5820084810256958, -0.07378871738910675, 0.7068894505500793, 0.2095923125743866, -0.40278714895248413, 0.4577428996562958, 1.1750380992889404, -0.18839624524116516, -0.4804092347621918, -0.1828702986240387, 0.7102053761482239, ...
func ImageToFileDescriptorSet(image Image) *descriptorpb.FileDescriptorSet { return protodescriptor.FileDescriptorSetForFileDescriptors(ImageToFileDescriptors(image)...) }
[ -0.19111154973506927, -0.26520243287086487, 0.5146545767784119, -1.0082021951675415, 0.29618045687675476, 0.017094606533646584, 0.12134195119142532, -0.1445389837026596, -0.5305415987968445, -0.14445613324642181, 0.9673433899879456, 0.7939006090164185, 0.6873772144317627, 0.565926730632782...
func ImageToFileDescriptors(image Image) []protodescriptor.FileDescriptor { return imageFilesToFileDescriptors(image.Files()) }
[ -0.639123797416687, -0.4738123118877411, 0.5247224569320679, -0.34592074155807495, 0.7499057650566101, 0.23340114951133728, -0.23712867498397827, 0.39331090450286865, -0.06438781321048737, 0.2635996639728546, 0.26794037222862244, 0.38346606492996216, 0.6398789286613464, 1.2876960039138794,...
func ImageToFileDescriptorProtos(image Image) []*descriptorpb.FileDescriptorProto { return imageFilesToFileDescriptorProtos(image.Files()) }
[ -0.1666950136423111, -0.21404710412025452, 0.5026767253875732, 0.15915538370609283, 0.35433438420295715, 0.3873135447502136, -0.21770189702510834, -0.25105389952659607, 0.23412840068340302, 0.6537182331085205, 0.07717064023017883, -0.25853997468948364, 0.9064905643463135, 1.441944241523742...
func ImageToCodeGeneratorRequest( image Image, parameter string, compilerVersion *pluginpb.Version, includeImports bool, includeWellKnownTypes bool, ) *pluginpb.CodeGeneratorRequest { return imageToCodeGeneratorRequest( image, parameter, compilerVersion, includeImports, includeWellKnownTypes, nil, n...
[ -1.5466972589492798, -0.08126778900623322, 0.4018974304199219, -0.21252450346946716, -0.36425524950027466, -0.5449117422103882, 0.3198654055595398, 0.0678897574543953, 0.18328747153282166, 0.347196102142334, -0.1580071747303009, 0.5776811242103577, -0.49907758831977844, 1.176924467086792, ...
func ImagesToCodeGeneratorRequests( images []Image, parameter string, compilerVersion *pluginpb.Version, includeImports bool, includeWellKnownTypes bool, ) []*pluginpb.CodeGeneratorRequest { requests := make([]*pluginpb.CodeGeneratorRequest, len(images)) // alreadyUsedPaths is a map of paths that have already be...
[ -1.2795437574386597, -0.3292454183101654, 0.6125200986862183, -0.10064421594142914, -0.1459941565990448, -0.6744605898857117, 0.699945330619812, -0.23856830596923828, -0.058747127652168274, 0.26666340231895447, -0.2246973216533661, -0.009741997346282005, -0.45732831954956055, 1.63374304771...
func ProtoImageToFileDescriptors(protoImage *imagev1.Image) []protodescriptor.FileDescriptor { return protoImageFilesToFileDescriptors(protoImage.File) }
[ -1.1988784074783325, -0.38757991790771484, 0.32416391372680664, -0.02018064819276333, 0.8701012134552002, 0.19673441350460052, 0.3105526268482208, 0.248238205909729, -0.1584041565656662, -0.46927887201309204, 0.5949874520301819, 0.42372894287109375, -0.13462907075881958, 0.9020305871963501...
func ImageModuleDependencies(image Image) []ImageModuleDependency { importsOfNonImports := make(map[string]struct{}) for _, imageFile := range image.Files() { if !imageFile.IsImport() { for _, dependency := range imageFile.FileDescriptor().GetDependency() { importsOfNonImports[dependency] = struct{}{} } ...
[ -1.0009021759033203, -1.0184324979782104, 0.533231794834137, -0.9617704153060913, 0.1849239468574524, 0.1923123598098755, 0.5187579989433289, -0.22925253212451935, 1.0492240190505981, 0.6624183058738708, -0.8057798147201538, 0.1282680183649063, 0.3007791340351105, 1.5402615070343018, 0.1...
func InitVolumeOperationRequestInterface(ctx context.Context, cleanupInterval int, isBlockVolumeSnapshotEnabled func() bool) (VolumeOperationRequest, error) { log := logger.GetLogger(ctx) csiNamespace = getCSINamespace() operationStoreInitLock.Lock() defer operationStoreInitLock.Unlock() if operationRequestStore...
[ -0.6286906599998474, -0.29219627380371094, 0.7945939302444458, 0.08364906162023544, -0.10930188745260239, -0.29886743426322937, 0.4133497476577759, -0.2711934447288513, -0.09596362709999084, 0.31964221596717834, 0.040631912648677826, -0.39639750123023987, -0.10051616281270981, -0.309543341...
func (or *operationRequestStore) GetRequestDetails( ctx context.Context, name string, ) (*VolumeOperationRequestDetails, error) { log := logger.GetLogger(ctx) instanceKey := client.ObjectKey{Name: name, Namespace: csiNamespace} log.Debugf("Getting CnsVolumeOperationRequest instance with name %s/%s", instanceKey.Na...
[ -0.15751415491104126, 0.33254244923591614, 0.8166463375091553, 0.26227256655693054, -0.15939675271511078, -0.41101792454719543, 0.13929136097431183, -0.5616293549537659, 0.6768451929092407, 0.13176387548446655, 0.23241421580314636, -0.37954601645469666, -0.19061067700386047, -0.31036385893...
func (or *operationRequestStore) StoreRequestDetails( ctx context.Context, operationToStore *VolumeOperationRequestDetails, ) error { log := logger.GetLogger(ctx) if operationToStore == nil { return logger.LogNewError(log, "cannot store empty operation") } log.Debugf("Storing CnsVolumeOperationRequest instance ...
[ -0.20964369177818298, 0.08495473861694336, 0.5904518961906433, -0.17353402078151703, -0.17842121422290802, 0.16439221799373627, 0.18895216286182404, -0.6785763502120972, 0.71951824426651, -0.45605188608169556, -0.21848583221435547, -0.4821590781211853, 0.3811464309692383, -0.42535170912742...
func (or *operationRequestStore) DeleteRequestDetails(ctx context.Context, name string) error { log := logger.GetLogger(ctx) log.Debugf("Deleting CnsVolumeOperationRequest instance with name %s/%s", csiNamespace, name) err := or.k8sclient.Delete(ctx, &cnsvolumeoprequestv1alpha1.CnsVolumeOperationRequest{ ObjectM...
[ 0.145306795835495, -0.17276374995708466, 0.40220779180526733, -0.1547999531030655, -0.7764642238616943, 0.051359038800001144, 0.07057350128889084, -0.3583400249481201, 0.7723332643508911, -0.26391303539276123, 0.3095161020755768, -0.0958087220788002, -0.0883968397974968, 0.0420817621052265...
func (or *operationRequestStore) cleanupStaleInstances(cleanupInterval int, isBlockVolumeSnapshotEnabled func() bool) { ticker := time.NewTicker(time.Duration(cleanupInterval) * time.Minute) ctx, log := logger.GetNewContextWithLogger() log.Infof("CnsVolumeOperationRequest clean up interval is set to %d minutes", cle...
[ -0.7979580163955688, -0.7302112579345703, 0.6732923984527588, -0.3527587354183197, -0.9236195683479309, 0.23410272598266602, 0.25893568992614746, -0.20920182764530182, 0.16594232618808746, 0.42954951524734497, 0.10671726614236832, -0.4243053197860718, -0.0914967954158783, 0.290793448686599...
func makeFerry(usesWaypoint bool) ferry { pos := vector.Vec2{X: 0, Y: 0} var dir vector.Vec2 if usesWaypoint { dir = vector.Vec2{X: 10, Y: -1} } else { dir = vector.Vec2{X: 1, Y: 0} } return ferry{Pos: pos, Dir: dir, UsesWaypoint: usesWaypoint} }
[ 0.38540831208229065, 0.6121518015861511, 0.5622885823249817, -0.6339575052261353, 0.288036972284317, -0.0881899744272232, -0.3599705398082733, -0.009473263286054134, -0.1498493105173111, -0.9714105129241943, -0.42448097467422485, 0.3953130841255188, 0.13222113251686096, 0.4088076949119568,...
func (self *FederationGateway) sendFromQueue(req *WaveletUpdateRequest) { // No HTTP connection open yet? if self.connection == nil { con, err := net.Dial("tcp", "", fmt.Sprintf("%v:%v", self.manifest.HostName, self.manifest.Port)) if err != nil { // TODO: Good error handling log.Println("Failed connectin...
[ -0.6782540678977966, -0.9090322852134705, 0.8521636128425598, -1.1518011093139648, -0.030242446810007095, 0.44946756958961487, -0.6769755482673645, -0.8099786639213562, -0.2983454465866089, 0.2258833646774292, -0.3535573184490204, 0.7925614714622498, -0.5764272212982178, 0.534668505191803,...
func (c *Client) DescribeAssessmentRuns(ctx context.Context, params *DescribeAssessmentRunsInput, optFns ...func(*Options)) (*DescribeAssessmentRunsOutput, error) { if params == nil { params = &DescribeAssessmentRunsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeAssessmentRuns", params, optFns...
[ -0.8208500742912292, 0.511783242225647, 0.8220746517181396, 0.23763488233089447, 0.34052231907844543, 0.1653410792350769, 0.4785007834434509, -0.7620067000389099, -0.05226076394319534, -0.11967115104198456, 0.42503565549850464, 1.7559785842895508, -0.17486979067325592, 0.5281448364257812, ...
func WaitForFile( path string, retryCountLimit int, verifyFileExistsFunc VerifyFileExistsFunc, ) error { if verifyFileExistsFunc == nil { verifyFileExistsFunc = defaultVerifyFileExistsFunc } limitedBackOff := NewLimitedBackOff( time.Second, retryCountLimit, ) err := backoff.Retry(func() error { if lim...
[ 1.1090083122253418, 0.3224872946739197, 0.49615323543548584, 0.6395871043205261, 0.5629698038101196, 0.09563283622264862, 0.39670035243034363, 0.6826122999191284, -0.41286030411720276, -0.7304337024688721, 0.34403184056282043, 0.2788938879966736, -0.050621774047613144, -0.1889772266149521,...
func NewDBFromConfig(c *config.DatabaseConfig) (db DB, err error) { dbtype := strings.ToLower(c.Type) if dbtype == "postgres" { err = errors.New("postgres not supported") } else { err = errors.New("no such database driver: " + c.Type) } return }
[ 0.2703756093978882, -0.21457616984844208, 0.2624693214893341, 1.0311979055404663, -0.58477383852005, 0.5603985786437988, -0.14854560792446136, -0.11032911390066147, 0.2685176134109497, 0.3380833864212036, 0.24216477572917938, 0.03370765969157219, -0.7623368501663208, 0.9443221688270569, ...
func newEndpoint() *testSocket { p := fmt.Sprintf("@%s.sock", uuid.NewUUID()) return &testSocket{ path: p, endpoint: fmt.Sprintf("unix:///%s", p), } }
[ 0.46405452489852905, -0.3302771747112274, 0.38262906670570374, -0.6477379202842712, 0.08912713080644608, 0.09197909384965897, 0.2571231424808502, 0.15271629393100739, 0.2522676885128021, -0.5366008281707764, 0.6351216435432434, 1.0699195861816406, -1.2926290035247803, -0.0963883101940155, ...
func TestKMSPluginLateStart(t *testing.T) { t.Parallel() callTimeout := 3 * time.Second s := newEndpoint() ctx := testContext(t) service, err := NewGRPCService(ctx, s.endpoint, callTimeout) if err != nil { t.Fatalf("failed to create envelope service, error: %v", err) } defer destroyService(service) time.S...
[ -0.48490744829177856, 0.021759219467639923, 0.8309471607208252, 0.8104445934295654, 0.5598111748695374, -0.049698397517204285, -0.053921688348054886, -0.2616519629955292, 0.4474879801273346, 0.7496656775474548, -0.8495070338249207, 0.7696357369422913, -1.3041183948516846, -0.48155158758163...
func TestTimeouts(t *testing.T) { t.Parallel() var testCases = []struct { desc string callTimeout time.Duration pluginDelay time.Duration kubeAPIServerDelay time.Duration wantErr string }{ { desc: "timeout zero - expect failure when call from kube-apiserve...
[ 0.10369202494621277, 0.42416447401046753, 0.7869817018508911, 0.011296304874122143, 0.22759167850017548, 0.059203702956438065, 0.38496533036231995, -0.1732630878686905, 0.4244604706764221, -0.017977802082896233, -0.01689460314810276, -0.08781206607818604, -0.7657907009124756, 0.58688575029...
func TestIntermittentConnectionLoss(t *testing.T) { t.Parallel() var ( wg1 sync.WaitGroup wg2 sync.WaitGroup timeout = 30 * time.Second blackOut = 1 * time.Second data = []byte("test data") endpoint = newEndpoint() encryptErr error ) // Start KMS Plugin f := mock.NewBase64P...
[ -0.34413737058639526, -0.21263280510902405, 0.9270050525665283, 0.13971562683582306, 0.7283387780189514, -0.20304426550865173, -0.004742986522614956, -0.5142937898635864, -0.03346806392073631, 0.5314725637435913, -0.2927093207836151, 0.6953545808792114, -1.3685731887817383, -0.577661395072...
func TestGRPCService(t *testing.T) { t.Parallel() // Start a test gRPC server. endpoint := newEndpoint() _ = mock.NewBase64Plugin(t, endpoint.path) ctx := testContext(t) // Create the gRPC client service. service, err := NewGRPCService(ctx, endpoint.endpoint, 1*time.Second) if err != nil { t.Fatalf("failed ...
[ -0.5022683143615723, 0.672104001045227, 0.6574632525444031, -0.3437289595603943, 1.2278186082839966, 0.1153121218085289, 0.41919785737991333, -0.9891104698181152, 0.022264109924435616, 0.2719067931175232, -0.43430063128471375, 0.821023166179657, -1.6127629280090332, -0.4532851278781891, ...
func TestGRPCServiceConcurrentAccess(t *testing.T) { t.Parallel() // Start a test gRPC server. endpoint := newEndpoint() _ = mock.NewBase64Plugin(t, endpoint.path) ctx := testContext(t) // Create the gRPC client service. service, err := NewGRPCService(ctx, endpoint.endpoint, 15*time.Second) if err != nil { ...
[ -0.5020627379417419, 0.5352293252944946, 0.8610382080078125, -0.22213663160800934, 0.9513198733329773, 0.07168228924274445, 1.0029067993164062, -0.8917953372001648, -0.4759658873081207, 0.2082037478685379, 0.09227776527404785, 0.7426612377166748, -1.1418778896331787, -0.29917311668395996, ...
func TestInvalidConfiguration(t *testing.T) { t.Parallel() // Start a test gRPC server. _ = mock.NewBase64Plugin(t, newEndpoint().path) ctx := testContext(t) invalidConfigs := []struct { name string endpoint string }{ {"emptyConfiguration", ""}, {"invalidScheme", "tcp://localhost:6060"}, } for _,...
[ -0.668567955493927, 0.5879260301589966, 0.5163365006446838, 0.2626771628856659, 0.9826512336730957, 0.17636895179748535, 0.7423365116119385, -0.41496288776397705, 0.15807805955410004, 0.14054974913597107, -0.7510100603103638, -0.24271738529205322, -0.7555274367332458, 0.5116755366325378, ...
func (scanner *SchemaScanner) findTypeDefinition(name *astmodel.TypeName) (astmodel.TypeDefiner, bool) { result, ok := scanner.definitions[*name] return result, ok }
[ -1.098379373550415, 0.053845055401325226, 0.4275745749473572, -0.1481797695159912, -0.3984205424785614, -0.6457632184028625, -0.04455743357539177, -1.1195396184921265, -0.7176361680030823, 0.9010312557220459, -1.3592302799224854, -0.9964599609375, -1.2906889915466309, 1.7379188537597656, ...
func (scanner *SchemaScanner) addTypeDefinition(def astmodel.TypeDefiner) { scanner.definitions[*def.Name()] = def }
[ -0.9128966331481934, 0.12760113179683685, 0.3605273365974426, 0.38041117787361145, 0.4464382231235504, 0.010951478034257889, -0.09249899536371231, -0.5284099578857422, -0.1116393655538559, 0.013303122483193874, -1.3433897495269775, -0.11345744132995605, -0.427595317363739, 1.41528260707855...
func (scanner *SchemaScanner) addEmptyTypeDefinition(name *astmodel.TypeName) { scanner.definitions[*name] = nil }
[ -0.9904349446296692, -0.08720817416906357, 0.3422861099243164, -0.5790233612060547, 0.3935271203517914, -0.0031327547039836645, -0.17088545858860016, -0.4114166796207428, -0.17719176411628723, -0.08154948800802231, -1.0160998106002808, 0.01642693392932415, -0.09365256130695343, 0.984485328...
func (scanner *SchemaScanner) removeTypeDefinition(name *astmodel.TypeName) { delete(scanner.definitions, *name) }
[ -0.9493141174316406, -0.42185407876968384, 0.11227583885192871, -0.15499310195446014, -0.7742250561714172, -0.6616464257240295, 0.39867061376571655, -0.1582990139722824, -0.44892823696136475, 1.0551174879074097, -1.4356675148010254, -0.3777104914188385, -0.7283229827880859, 0.9921128153800...
func NewSchemaScanner(idFactory astmodel.IdentifierFactory) *SchemaScanner { return &SchemaScanner{ definitions: make(map[astmodel.TypeName]astmodel.TypeDefiner), TypeHandlers: DefaultTypeHandlers(), idFactory: idFactory, } }
[ -0.8007240891456604, -0.6056602001190186, 0.1144118532538414, 0.6370632648468018, -0.9653419256210327, -0.39743897318840027, -0.7103264927864075, -0.19521166384220123, 0.5100744962692261, -0.5625548362731934, -1.1727861166000366, -0.0881824642419815, 0.10927234590053558, 0.8315513134002686...
func (scanner *SchemaScanner) AddTypeHandler(schemaType SchemaType, handler TypeHandler) { scanner.TypeHandlers[schemaType] = handler }
[ -1.0004329681396484, -0.29641732573509216, 0.3186351954936981, 0.3060675263404846, -0.46303966641426086, 0.4029253423213959, -0.1332365721464157, -0.5307939648628235, 0.6589191555976868, -0.0006025796756148338, -0.718720555305481, -0.1521446406841278, -1.1507586240768433, 0.802083611488342...
func (scanner *SchemaScanner) RunHandler(ctx context.Context, schemaType SchemaType, schema *gojsonschema.SubSchema) (astmodel.Type, error) { handler := scanner.TypeHandlers[schemaType] return handler(ctx, scanner, schema) }
[ -1.2559826374053955, -0.4250968098640442, 0.31706252694129944, 0.24546024203300476, -0.5461378693580627, 0.47198015451431274, 0.4225037395954132, 0.050977859646081924, 0.3128621578216553, -0.38443872332572937, -0.08992931246757507, 0.25160008668899536, -0.8654017448425293, 0.39300596714019...
func (scanner *SchemaScanner) RunHandlerForSchema(ctx context.Context, schema *gojsonschema.SubSchema) (astmodel.Type, error) { schemaType, err := getSubSchemaType(schema) if err != nil { return nil, err } return scanner.RunHandler(ctx, schemaType, schema) }
[ -0.8249809741973877, 0.13986968994140625, 0.5155122876167297, 0.35447508096694946, -0.7439654469490051, 0.35443007946014404, 0.5745530724525452, -0.002299431711435318, 0.027198094874620438, -0.56659334897995, -0.003513615345582366, 0.22045162320137024, -0.5194084048271179, 0.62557947635650...
func (scanner *SchemaScanner) AddFilters(filters []string) { scanner.Filters = append(scanner.Filters, filters...) }
[ -1.3739780187606812, -0.26330384612083435, 0.37726253271102905, 0.608592689037323, 0.33504530787467957, 0.6310896873474121, -0.9487804770469666, -0.5390667915344238, 0.5381700396537781, -1.1840027570724487, 0.32633620500564575, -0.06934166699647903, -1.3948880434036255, 1.0890672206878662,...
func DefaultTypeHandlers() map[SchemaType]TypeHandler { return map[SchemaType]TypeHandler{ Array: arrayHandler, OneOf: oneOfHandler, AnyOf: anyOfHandler, AllOf: allOfHandler, Ref: refHandler, Object: objectHandler, Enum: enumHandler, String: fixedTypeHandler(astmodel.StringType, "string"), I...
[ -0.7577924728393555, -0.43893176317214966, 0.42626699805259705, 0.26886555552482605, -0.14027632772922516, 0.22378627955913544, 0.05447228252887726, -1.0730252265930176, -0.371781587600708, 0.14031627774238586, -1.4535263776779175, -0.27641457319259644, -0.893650472164154, 0.37640804052352...
func objectTypeOf(url *url.URL) (string, error) { fragmentParts := strings.FieldsFunc(url.Fragment, isURLPathSeparator) return fragmentParts[len(fragmentParts)-1], nil }
[ -0.5075220465660095, -0.23938237130641937, 0.6931540369987488, -0.3564496636390686, -0.1657421588897705, -0.29875507950782776, 0.3272135555744171, -0.4558367431163788, 0.9317571520805359, 0.3679576516151428, -0.4760797619819641, -0.7943859696388245, -0.8900900483131409, -1.0045427083969116...
func groupOf(url *url.URL) (string, error) { pathParts := strings.FieldsFunc(url.Path, isURLPathSeparator) file := pathParts[len(pathParts)-1] if !strings.HasSuffix(file, ".json") { return "", fmt.Errorf("Unexpected URL format (doesn't point to .json file)") } return strings.TrimSuffix(file, ".json"), nil }
[ 0.07280027866363525, 0.00926978513598442, 0.7311003804206848, -0.4504575729370117, -0.609362006187439, -0.19901813566684723, 0.9449788928031921, -1.0038734674453735, -0.3638574481010437, 0.5757049918174744, 0.5308577418327332, -0.23152676224708557, 0.4695577919483185, 0.24074774980545044, ...
func versionOf(url *url.URL) (string, error) { pathParts := strings.FieldsFunc(url.Path, isURLPathSeparator) for _, p := range pathParts { if versionRegex.MatchString(p) { return p, nil } } // No version found, that's fine return "", nil }
[ 0.27106794714927673, -0.6873559355735779, 0.3835294246673584, 0.2157488912343979, -0.4212246537208557, -0.21066083014011383, 0.3201424479484558, -0.16033177077770233, 0.26390254497528076, 0.8612326383590698, 0.17259939014911652, -1.0401133298873901, -0.10304476320743561, -0.174684464931488...
func (rm *ReleaseManager) DestroyFunc() interface{} { return rm.destroy }
[ 0.2678571939468384, -0.17145615816116333, 0.16176387667655945, -0.28814423084259033, -0.0293001439422369, -0.41960567235946655, 0.4672759175300598, 0.7188807129859924, 0.20074769854545593, 0.3906618654727936, 0.4739040434360504, 0.6432956457138062, 0.5122634768486023, 0.46981319785118103, ...
func (rm *ReleaseManager) destroy( ctx context.Context, log hclog.Logger, ui terminal.UI, release *Release, ) error { sg := ui.StepGroup() defer sg.Wait() r := rm.resourceManager(log, nil) // If we don't have resource state, this state is from an older version // and we need to manually recreate it. if rele...
[ -0.4291437566280365, -0.5937417149543762, 0.4822714328765869, -0.2547232210636139, -0.25000470876693726, -0.12807071208953857, -0.9373617768287659, 0.22971634566783905, 0.15731164813041687, 0.6095892190933228, 0.19590750336647034, -0.5679225921630859, -0.35584408044815063, 1.32777237892150...
func Constructor(length int) SnapshotArray { s := make([]map[int]int, 0, 128) c := make(map[int]int, 32) return SnapshotArray{ snaps: s, current: c, id: 0, } }
[ -0.9804069399833679, -0.19166646897792816, 0.5533517599105835, -0.4245031774044037, -1.0477290153503418, 0.44531798362731934, 0.21596023440361023, -0.31192225217819214, 0.6036815643310547, -0.2780669033527374, -1.4755698442459106, -0.7871148586273193, 0.18615269660949707, 0.199384421110153...
func (sa *SnapshotArray) Set(index int, val int) { sa.current[index] = val }
[ -1.1013020277023315, -0.1418927162885666, 0.1581416130065918, -0.6878111362457275, -0.6666756868362427, 0.841117262840271, 0.051301997154951096, -0.34723103046417236, 0.5492048263549805, 0.35398826003074646, -0.37805068492889404, 0.8588168621063232, 0.5056197643280029, -0.1397797167301178,...
func (sa *SnapshotArray) Get(index int, snap int) int { for id := snap; id >= 0; id-- { history := sa.snaps[id] if t, ok := history[index]; ok { return t } } return 0 //default value }
[ -0.9461129307746887, -0.018220234662294388, 0.7339253425598145, 0.030415646731853485, 0.0778701901435852, -0.5831228494644165, -0.37112465500831604, -0.5111051201820374, 0.3639862835407257, -0.14690044522285461, -0.24239994585514069, 0.7508569359779358, 0.14443354308605194, -0.655251562595...
func NewSetup() (*context, *prediction, *update) { var ctx context var pred prediction var upd update // init ctx ctx.X = mat.NewVecDense(2, []float64{4000.0, 280.0}) ctx.P = mat.NewDense(2, 2, []float64{425, 0, 0, 25}) // init prediction dt := 1.0 pred.F = mat.NewDense(2, 2, []float64{1, dt, 0, 1}) pred.B ...
[ -0.21836264431476593, -0.5534271597862244, 0.9301149845123291, -0.013773811981081963, -0.7695983052253723, -0.16133807599544525, 0.6817071437835693, -0.4060427248477936, 0.12229247391223907, 1.0348466634750366, 0.3901927173137665, -0.11113262176513672, 0.07029029726982117, -0.0667355358600...
func (*Ecdict) scanValues() []interface{} { return []interface{}{ &sql.NullInt64{}, // id &sql.NullString{}, // word &sql.NullString{}, // sw &sql.NullString{}, // phonetic &sql.NullString{}, // definition &sql.NullString{}, // translation &sql.NullString{}, // pos &sql.NullInt64{}, // collins &sql...
[ -0.4260469973087311, 0.13416065275669098, 0.5554077625274658, -0.5579450130462646, -0.5121532678604126, -0.029101025313138962, -1.1470392942428589, -0.1978681981563568, 0.07777669280767441, -0.6602178812026978, -0.21091319620609283, -0.09815926849842072, 0.11151601374149323, 1.121750235557...
func (e *Ecdict) assignValues(values ...interface{}) error { if m, n := len(values), len(ecdict.Columns); m < n { return fmt.Errorf("mismatch number of scan values: %d != %d", m, n) } value, ok := values[0].(*sql.NullInt64) if !ok { return fmt.Errorf("unexpected type %T for field id", value) } e.ID = int(valu...
[ -0.4574533700942993, -0.10803639143705368, 0.7369314432144165, -0.31598639488220215, -0.025099651888012886, 0.2398749589920044, -0.16674286127090454, -0.009596853516995907, -0.23670756816864014, -0.14693467319011688, -0.13424237072467804, -0.5850297808647156, 0.3431895673274994, 0.86075949...
func (e *Ecdict) Update() *EcdictUpdateOne { return (&EcdictClient{config: e.config}).UpdateOne(e) }
[ -0.862228274345398, 0.24739322066307068, 0.10214898735284805, -1.125783085823059, 0.2298578917980194, 0.5886565446853638, -0.4471858739852905, 0.33143481612205505, -0.21735213696956635, 0.14310157299041748, -0.2978319227695465, -0.4354356527328491, -0.8749067187309265, -0.36014097929000854...
func (e *Ecdict) Unwrap() *Ecdict { tx, ok := e.config.driver.(*txDriver) if !ok { panic("ent: Ecdict is not a transactional entity") } e.config.driver = tx.drv return e }
[ -0.8365386724472046, 0.8036378026008606, 0.24473196268081665, -1.2277196645736694, 0.05420951172709465, -0.05555935576558113, 0.06630546599626541, 0.9594799876213074, -0.13291485607624054, 0.65354984998703, 0.5352632999420166, -0.13277623057365417, 0.7927566170692444, -0.7170284986495972, ...
func (e *Ecdict) String() string { var builder strings.Builder builder.WriteString("Ecdict(") builder.WriteString(fmt.Sprintf("id=%v", e.ID)) builder.WriteString(", word=") builder.WriteString(e.Word) builder.WriteString(", sw=") builder.WriteString(e.Sw) builder.WriteString(", phonetic=") builder.WriteString(...
[ -0.015120790340006351, -0.7457482814788818, 0.47113245725631714, -1.7967615127563477, -0.3697362542152405, 0.5650254487991333, 0.31301119923591614, -0.8303367495536804, -0.3925672769546509, -0.07766425609588623, -0.0066865598782896996, 0.48802828788757324, -0.2968170642852783, -0.304806321...
func ok(tb testing.TB, err error) { if err != nil { _, file, line, _ := runtime.Caller(1) fmt.Printf("\033[31m%s:%d: unexpected error: %s\033[39m\n\n", filepath.Base(file), line, err.Error()) tb.FailNow() } }
[ 0.9303189516067505, -0.2473713904619217, 0.3249330520629883, -0.023582538589835167, -0.17135797441005707, 0.8187499642372131, 0.48980027437210083, 0.10770672559738159, -0.5933229923248291, 0.8405352234840393, 0.15640133619308472, 0.7572429180145264, 0.3956109285354614, 0.614584743976593, ...
func equals(tb testing.TB, exp, act interface{}) { if !reflect.DeepEqual(exp, act) { _, file, line, _ := runtime.Caller(1) fmt.Printf("\033[31m%s:%d:\n\n\texp: %#v\n\n\tgot: %#v\033[39m\n\n", filepath.Base(file), line, exp, act) tb.FailNow() } }
[ -0.2863089442253113, -1.0062764883041382, 0.5397624969482422, -0.8565458059310913, 0.6982912421226501, 0.742859423160553, 0.33423513174057007, -0.2609958052635193, -0.4185180962085724, 0.009127725847065449, -0.06660137325525284, 1.340972900390625, -0.351516455411911, 0.550495982170105, -...
func Passthrough(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error) { return in, nil // nothing to do here, just to keep track of the safe application }
[ 0.503322422504425, -0.5371967554092407, 0.44819945096969604, -0.008046004921197891, -0.5145317912101746, 0.8195056319236755, 0.61379474401474, 0.29168087244033813, -0.1459282636642456, 0.1519232541322708, 0.1456575244665146, 0.5867380499839783, -0.03900918737053871, -0.7230234146118164, ...
func LocalizedFormatCurrency(currency string, locale string) pongo2.FilterFunction { return func(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error) { fAmount, err := strconv.ParseFloat(in.String(), 64) var amount int64 if err != nil { amount = 0 } amount = int64(fAmount) currencyParam...
[ 0.8046038150787354, -1.069306492805481, 0.3877060115337372, -0.394827663898468, -0.9414641261100769, -0.9627785682678223, 0.018998941406607628, 0.24590948224067688, -0.1772724688053131, 0.26920029520988464, 0.403756707906723, 0.26722756028175354, -0.09037741273641586, -0.016444027423858643...
func FormatCurrencyAmount(locale string) pongo2.FilterFunction { return func(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error) { fAmount, err := strconv.ParseFloat(in.String(), 64) var amount int64 if err != nil { amount = 0 } amount = int64(fAmount) currency := param.String() m...
[ 0.03424396738409996, -0.6788183450698853, 0.298441618680954, -0.8406058549880981, -1.5799171924591064, -0.7285043597221375, 0.6107640266418457, 0.18383771181106567, 0.02544195018708706, 0.46160534024238586, 0.6691672205924988, 0.5182752013206482, -0.46654170751571655, 0.7119393348693848, ...
func FormatDecimalAmount(locale string) pongo2.FilterFunction { l := loc.Get(locale) cName := "GBP" if l != nil { cName = l.CurrencyCode } currency := c.Get(cName) defaultDigits := currency.DecimalDigits return func(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error) { log.Tracef("[FormatD...
[ 0.5161954164505005, -0.3059011697769165, 0.6794783473014832, -0.2885393500328064, -0.8347640037536621, -0.33878225088119507, 0.43016430735588074, 0.3622930943965912, 0.14916923642158508, 0.26735857129096985, 0.5489987134933472, 0.2938491702079773, -0.008127888664603233, 0.587151050567627, ...
func FormatShortCurrencyAmount(locale string) pongo2.FilterFunction { return func(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error) { fAmount, err := strconv.ParseFloat(in.String(), 64) var amount int64 if err != nil { amount = 0 } amount = int64(fAmount) currency := param.String()...
[ 1.0723785161972046, -0.8025557994842529, 0.41931548714637756, -1.0380510091781616, -1.7351725101470947, -0.3481340706348419, 0.561772346496582, -0.04809535667300224, 0.3517477810382843, 0.0035126162692904472, 0.5703511238098145, 1.013222575187683, -0.019143834710121155, 0.42760714888572693...
func LocalizedDateFormatter(locale string, timezone string) pongo2.FilterFunction { location, err := time.LoadLocation(timezone) if err != nil { log.Errorf("Failed to load timezone: %v", err) location, _ = time.LoadLocation("Europe/London") } return func(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *...
[ -0.21495264768600464, -0.9567285180091858, 0.46211040019989014, -1.171855092048645, -1.0749586820602417, -0.2818882167339325, -0.6580308675765991, 0.18833161890506744, 0.575319766998291, -0.16853481531143188, 0.06298179924488068, -0.004571692552417517, 0.1627073585987091, 0.630958378314971...
func ParseTimeFromString(in string, loc ...*time.Location) time.Time { var timestamp time.Time var err error for _, tf := range TTFormats { if len(loc) > 0 { timestamp, err = time.ParseInLocation(tf, in, loc[0]) } else { timestamp, err = time.Parse(tf, in) } if err == nil { break } log.Warnf("Fa...
[ 0.5709905624389648, -0.6716956496238708, 0.4812341034412384, -0.2873679995536804, -0.11445385962724686, 0.3209778964519501, -0.23353374004364014, 0.10441984236240387, -0.3360331654548645, 0.1721220314502716, -0.16610442101955414, -1.1370012760162354, -0.1883375346660614, 0.1596013605594635...
func SimpleDateFormatter(timezone string) pongo2.FilterFunction { location, err := time.LoadLocation(timezone) if err != nil { log.Errorf("Failed to load timezone: %v", err) location, _ = time.LoadLocation("Europe/London") } return func(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error) { ...
[ -0.6812483072280884, -0.9414251446723938, 0.6285489797592163, -1.1208785772323608, -1.2921336889266968, -0.03988685831427574, -0.8196525573730469, 0.3968467712402344, 0.9523546099662781, -0.607519268989563, -0.3630755841732025, -0.2855486571788788, -0.1314343810081482, 0.20850178599357605,...
func CurrencySymbol(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error) { code := in.String() if code == "" { return pongo2.AsValue(""), nil } currencyObj := c.Get(code) return pongo2.AsValue(currencyObj.Symbol), nil }
[ -0.9401566982269287, 0.6382089853286743, 0.11885872483253479, -0.6613196730613708, -0.25280410051345825, -0.5207279324531555, 0.4196374714374542, -0.168382927775383, -0.03412961959838867, 0.6565414071083069, -0.661659300327301, 0.4303608536720276, -0.3288211524486542, -0.027102375403046608...
func Capitalize(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error) { if !in.IsString() { return pongo2.AsValue(""), nil } return pongo2.AsValue(strings.Title(strings.ToLower(in.String()))), nil }
[ -0.22170814871788025, -0.4321152865886688, 0.807909369468689, -0.013598542660474777, -0.03808200731873512, -0.4178892970085144, -1.1938124895095825, -0.3900616765022278, -0.5300897359848022, 0.5120915770530701, 0.809764564037323, 0.7431711554527283, -0.3911808431148529, 0.2539325952529907,...
func EscapeEntities(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error) { output := in.String() output = strings.Replace(output, "&", "&amp;", -1) output = strings.Replace(output, ">", "&gt;", -1) output = strings.Replace(output, "<", "&lt;", -1) output = strings.Replace(output, "\"", "&quot;", -...
[ -0.8886088132858276, -0.9216316938400269, 0.49293655157089233, -1.29897940158844, -1.1348799467086792, -0.5425311923027039, -0.8661420345306396, -0.0926559790968895, -0.7566916346549988, 0.5771361589431763, -0.3653583526611328, -0.10641686618328094, -0.016103722155094147, 0.893547177314758...
func Split(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error) { if !in.CanSlice() { return in, nil } s := in.String() sep := param.String() result := make([]string, 0, len(s)) for _, c := range s { result = append(result, string(c)) } return pongo2.AsValue(strings.Split(s, sep)), nil }
[ -0.661787211894989, 0.41586074233055115, 0.519943118095398, 0.34311339259147644, -0.6940748691558838, -0.5590283274650574, -0.2920064628124237, 0.14724691212177277, -0.7978435158729553, 0.1881227344274521, -0.501659095287323, 0.4891052544116974, -0.5776830911636353, -0.5716480612754822, ...
func UnmarshalJson(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error) { s := in.String() if s != "" { var result []interface{} err := json.Unmarshal([]byte(s), &result) if err == nil { log.Debugf("[UnmarshalJson] JSON OUT LIST ===== %s", result) return pongo2.AsValue(result), nil } ...
[ -0.6344258189201355, -0.2796199321746826, 0.9871435761451721, -1.0038630962371826, -1.4501279592514038, -0.7749713659286499, 0.6179822087287903, 0.41289952397346497, -0.12253876030445099, 0.590737521648407, -0.2299175262451172, 0.6829738020896912, -0.2791594862937927, 0.4339052438735962, ...
func ConvertKilometersToMiles(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error) { distance, err := strconv.ParseFloat(in.String(), 64) if err != nil { distance = 0 } return pongo2.AsValue(fmt.Sprintf("%01.1f", float64(distance)*kmToMilesConstant)), nil }
[ 0.04352468252182007, -0.280179888010025, 0.3257060647010803, -0.6787571907043457, -0.4210953414440155, -0.23037895560264587, -1.155758023262024, -0.1974422186613083, 0.016372304409742355, 0.5530027151107788, -0.1759871244430542, -0.46607232093811035, -0.9178849458694458, 0.6264522075653076...
func MaskAccountNumber(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error) { if in == nil || len(in.String()) < 7 { return in, nil } n, l := 4, len(in.String()) if param != nil && param.IsInteger() && param.Integer() > 0 { n = param.Integer() if n > l { n = l } } masked := strings.Rep...
[ -0.2225394994020462, -0.25288665294647217, 0.8578734993934631, 0.7692735195159912, -1.0079158544540405, -0.49615564942359924, 1.2325800657272339, -0.15295767784118652, 1.1005626916885376, 0.004590318538248539, 0.26164546608924866, 0.3729994297027588, 0.18815656006336212, -0.657741546630859...
func LookupMap(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error) { log.Debugf("[LookupMap] IN PARAM: %+v %+v", *in, *param) if !in.Contains(param) { return pongo2.AsValue(""), nil } ii := in.Interface() log.Debugf("[LookupMap] Lookup value: %v %s", ii, param.String()) switch ii.(type) { cas...
[ -0.5539695024490356, -0.46788376569747925, 0.6990593075752258, -0.37106695771217346, -0.9630945324897766, -0.03689751774072647, 0.27876484394073486, -0.4343000650405884, 0.4516260027885437, 0.5775646567344666, 0.6347067952156067, 0.7533817887306213, -0.23085394501686096, -0.433678776025772...
func InsertSymbol(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error) { log.Debugf("[InsertSymbol] IN PARAM: %+v %+v", *in, *param) if !in.IsString() { return nil, &pongo2.Error{ Sender: "filterInsertSymbol", ErrorMsg: fmt.Sprintf("Target should be string: %+v", in), } } i := in.String...
[ -0.9269750714302063, 0.4701257348060608, 0.9637698531150818, -0.6441969871520996, -0.027752207592129707, -0.4395372271537781, 0.8351539969444275, 0.0019103392260149121, -0.27060794830322266, 0.7169869542121887, -0.7209507822990417, 0.667366087436676, -0.40906795859336853, 0.279565453529357...
func Decode(b []byte, dst interface{}) error { r, err := parser.NewReader(string(b)) // parser should provide another method for parsing []byte if err != nil { return errors.Wrap(err, "error reading AsyncAPI doc") } p, err := parser.New() if err != nil { return err } w := bytes.NewBuffer(nil) if err := p(...
[ -0.3121702969074249, 0.14728499948978424, 0.7803176045417786, 0.4610481560230255, -0.6060922145843506, 0.021725503727793694, -0.16430634260177612, 0.3524487614631653, -0.09953784942626953, 0.7013727426528931, -0.11245753616094589, -0.10509989410638809, 0.022519784048199654, -0.501008272171...
func setModelIdentifierHook(from reflect.Type, to reflect.Type, data interface{}) (interface{}, error) { if from.Kind() != reflect.Map || to.Kind() != reflect.Map { return data, nil } identifiableInterface := reflect.TypeOf((*asyncapi.Identifiable)(nil)).Elem() if to.Key() != reflect.TypeOf("string") || !to.Elem...
[ -1.1073954105377197, -0.2879974842071533, 0.4390248656272888, -0.26865729689598083, 0.7203372716903687, 0.6374853849411011, 0.24886451661586761, -0.002853458747267723, 0.09095614403486252, 0.40631088614463806, -0.541933000087738, 0.4139508605003357, 0.3797084391117096, -0.2121538519859314,...
func setDefaultsHook(_ reflect.Type, to reflect.Type, data interface{}) (interface{}, error) { if !to.Implements(reflect.TypeOf((*MapStructureDefaultsProvider)(nil)).Elem()) { return data, nil } var toType reflect.Type switch to.Kind() { //nolint:exhaustive case reflect.Array, reflect.Chan, reflect.Map, reflect...
[ -1.3784722089767456, 0.5072555541992188, 0.5232698321342468, -0.09735129773616791, 0.6323503851890564, 0.07573149353265762, -0.10191448777914047, -0.5241818428039551, 0.262150377035141, 0.043227169662714005, 0.08342846482992172, 0.8615039587020874, -0.01971433125436306, 0.41600438952445984...
func (m *_KeyValuePair) GetIdentifier() string { return "14535" }
[ -0.09754277765750885, -0.28736576437950134, 0.4153642952442169, 0.010203317739069462, -1.2832311391830444, 1.276637077331543, 0.3662232756614685, 0.7158307433128357, 0.5361271500587463, -0.3418547213077545, -0.40240278840065, -0.353340744972229, -0.6552214622497559, 0.16483306884765625, ...
func (m *_KeyValuePair) InitializeParent(parent ExtensionObjectDefinition) {}
[ 0.007832147181034088, 0.20898626744747162, 0.46479904651641846, 0.5002104043960571, -0.9890000224113464, -0.38236144185066223, 0.45355814695358276, -0.3075212240219116, 0.1998412162065506, -0.5869236588478088, -0.7426010966300964, -0.03525198996067047, -0.4180019497871399, 0.17791289091110...
func (m *_KeyValuePair) GetKey() QualifiedName { return m.Key }
[ 0.17084823548793793, 0.12319569289684296, 0.28979307413101196, 0.9309098124504089, -0.17113392055034637, 0.8789792060852051, -0.1812659204006195, 0.053067296743392944, -0.07392513006925583, -0.5348718762397766, 0.817300021648407, -0.49104517698287964, -0.44833892583847046, 0.00072389596607...
func NewKeyValuePair(key QualifiedName, value Variant) *_KeyValuePair { _result := &_KeyValuePair{ Key: key, Value: value, _ExtensionObjectDefinition: NewExtensionObjectDefinition(), } _result._ExtensionObjectDefinition._ExtensionObjectDefinitionChildRequirements = _...
[ 0.19536715745925903, -0.921129584312439, 0.3783584535121918, 0.549888551235199, -1.965025782585144, 0.3403593599796295, -1.0558029413223267, -0.2144923061132431, -0.04288944602012634, -0.06254296749830246, -0.45083653926849365, 0.39705225825309753, -0.31215447187423706, 0.6291658282279968,...
func CastKeyValuePair(structType any) KeyValuePair { if casted, ok := structType.(KeyValuePair); ok { return casted } if casted, ok := structType.(*KeyValuePair); ok { return *casted } return nil }
[ -0.05242465063929558, -0.5937159061431885, 0.47489428520202637, 0.5715280175209045, -0.834069550037384, 0.7735959887504578, -1.0865589380264282, -0.7122711539268494, 0.5645153522491455, 0.32675492763519287, 0.5183292031288147, 0.47539222240448, -0.822985053062439, 1.2846226692199707, 0.2...
func (self *PbftAgent) Stop() { // Unsubscribe all subscriptions registered from agent self.committeeSub.Unsubscribe() self.electionSub.Unsubscribe() self.ChainHeadAgentSub.Unsubscribe() self.scope.Close() }
[ 0.43381789326667786, -0.9508271217346191, 0.19983147084712982, -0.24814605712890625, 0.18121495842933655, 0.11796263605356216, -0.04268920049071312, 0.065519317984581, -0.648525595664978, 0.4134180247783661, 0.07623984664678574, 0.7236803770065308, -0.4867164194583893, 0.5962520241737366, ...
func (self *PbftAgent) OperateCommitteeBlock(receiveBlock *types.Block) error { fmt.Println(" into OperateCommitteeBlock") receiveBlockHeight := receiveBlock.Number() //receivedBlock has been into fashchain if self.fastChain.CurrentBlock().Number().Cmp(receiveBlockHeight) >= 0 { return nil } //self.fastChain.Cu...
[ -0.26294809579849243, -0.08652684092521667, 1.0838165283203125, -0.29769065976142883, 0.2410227209329605, -0.15592418611049652, 0.9778368473052979, 0.2559473216533661, -0.30771178007125854, 0.46964123845100403, -0.4470175802707672, -0.14737793803215027, -1.1704493761062622, 0.8915750384330...
func (pbftAgent *PbftAgent) SendPbftNode(committeeInfo *types.CommitteeInfo) *CryNodeInfo { log.Info("into SendPbftNode.") if committeeInfo == nil || len(committeeInfo.Members) == 0 { log.Error("committeeInfo is nil,len(committeeInfo.Members):", len(committeeInfo.Members)) return nil } cryNodeInfo := &CryNodeI...
[ 0.30334413051605225, -0.38949981331825256, 0.6781820058822632, -0.4921417534351349, 0.754872739315033, 0.19269932806491852, -0.41212624311447144, -0.45082348585128784, -0.7857256531715393, 0.7494605779647827, -1.1166183948516846, 0.44287219643592834, -1.2092692852020264, 0.5600505471229553...
func (self *PbftAgent) SubscribeNewPbftSignEvent(ch chan<- core.PbftSignEvent) event.Subscription { return self.scope.Track(self.signFeed.Subscribe(ch)) }
[ 0.418043851852417, -1.0616168975830078, 0.2906346619129181, 0.5141062140464783, -0.1925729215145111, 0.24030813574790955, -0.574500322341919, -0.6956411600112915, -0.43227171897888184, -0.33578553795814514, -1.3726731538772583, -0.0678517147898674, -0.19257928431034088, 0.7830300331115723,...
func (self *PbftAgent) VerifyCommitteeSign(sign *types.PbftSign) (bool, string) { if sign == nil { return false, "" } pubKey, err := crypto.SigToPub(GetSignHash(sign), sign.Sign) if err != nil { log.Error("SigToPub error.") return false, "" } pubKeyBytes := crypto.FromECDSAPub(pubKey) if self.GetCommitteIn...
[ 0.2778315842151642, -0.6065347790718079, 0.6502761244773865, 0.18930065631866455, 0.19076542556285858, 0.19449672102928162, -0.06919807195663452, -0.25026246905326843, -0.5858243107795715, 0.42547887563705444, -1.0241525173187256, -0.09554993361234665, -0.6012881398200989, 1.54105353355407...
func (self *PbftAgent) GetCommitteeNumber(blockHeight *big.Int) int32 { committees := self.election.GetCommittee(blockHeight) if committees == nil { log.Error("GetCommitteeNumber method committees is nil") return 0 } return int32(len(committees)) }
[ 0.18871985375881195, -0.3778315484523773, 0.7529013752937317, -0.4917283356189728, 0.04163448140025139, -0.36678239703178406, 0.38627198338508606, 0.7626546025276184, -0.9772022366523743, 0.4512430727481842, -0.23888178169727325, 0.13505178689956665, -0.9637055397033691, 0.4946521818637848...
func (self *PbftAgent) AcquireCommitteeAuth(blockHeight *big.Int) bool { if !self.nodeInfoIsExist() { return false } committeeMembers := self.election.GetCommittee(blockHeight) for _, member := range committeeMembers { if bytes.Equal(self.CommitteeNode.Publickey, crypto.FromECDSAPub(member.Publickey)) { retu...
[ 0.03128612041473389, -0.6542348861694336, 0.5560703277587891, 0.023034704849123955, 0.5141563415527344, -0.15312743186950684, -0.18507346510887146, 0.2794266641139984, -0.8740368485450745, 1.012392282485962, -0.23784562945365906, 0.4080713391304016, -1.0575635433197021, 0.5762451887130737,...
func UpdateConditionAlways(_, _, _, _ string) bool { return true }
[ 0.12816989421844482, -0.7092366218566895, 0.5462300181388855, 0.20595911145210266, -1.2530800104141235, 0.4902552366256714, -0.13611577451229095, 0.5850776433944702, -0.2582452893257141, 0.4266471862792969, -0.4007619619369507, -0.2668430507183075, -1.6816959381103516, 0.7423198223114014, ...
func UpdateConditionNever(_, _, _, _ string) bool { return false }
[ -1.2333048582077026, -0.8114755153656006, 0.7410964965820312, 1.10776948928833, -1.5023212432861328, 0.9732500314712524, 0.17322207987308502, 0.28245314955711365, -0.8065159320831299, 0.3091684579849243, -0.3165070414543152, -0.7481750845909119, -1.5384807586669922, 0.5329524278640747, -...
func UpdateConditionIfReasonOrMessageChange(oldReason, oldMessage, newReason, newMessage string) bool { return oldReason != newReason || oldMessage != newMessage }
[ 0.12559059262275696, -1.0884047746658325, 0.5343948602676392, -0.34425655007362366, -0.7336390018463135, -0.07923432439565659, -0.4988478422164917, -0.44860127568244934, 0.6766252517700195, 0.9312977194786072, 0.8180341720581055, 1.2342729568481445, -0.8139990568161011, 1.3396787643432617,...
func ShouldUpdateCondition( oldStatus corev1.ConditionStatus, oldReason, oldMessage string, newStatus corev1.ConditionStatus, newReason, newMessage string, updateConditionCheck UpdateConditionCheck, ) bool { if oldStatus != newStatus { return true } return updateConditionCheck(oldReason, oldMessage, newReason, ...
[ 0.5727057456970215, -0.8350071907043457, 0.5894261598587036, 0.4225729703903198, -0.7491728067398071, 0.5426356196403503, -0.38234448432922363, 0.04941569268703461, 0.1298077255487442, 0.5385876893997192, 0.39975857734680176, 1.0691252946853638, -0.3005181849002838, 0.7363214492797852, -...
func SetCustomDomainCondition( conditions []customdomainv1alpha1.CustomDomainCondition, conditionType customdomainv1alpha1.CustomDomainConditionType, status corev1.ConditionStatus, message string, updateConditionCheck UpdateConditionCheck, ) []customdomainv1alpha1.CustomDomainCondition { now := metav1.Now() exis...
[ -0.1974584311246872, -0.9255542755126953, 0.6267119646072388, -0.02238166145980358, -0.44002243876457214, 0.1612604409456253, 0.46502038836479187, 0.27873072028160095, 0.24990199506282806, 0.5238460898399353, 0.006834924686700106, 1.2887060642242432, -0.39619845151901245, 1.144438862800598...