text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func TestInit(t *testing.T) {
fmt.Println("Entering the test method for Init")
provcc := new(SimpleAsset)
stub := shim.NewMockStub("ANY_PARAM", provcc)
checkInit(t, stub, [][]byte{[]byte("init")})
} | [
-0.1233614832162857,
-0.20460006594657898,
0.557933509349823,
0.11334598809480667,
0.6316259503364563,
0.3141593039035797,
0.6309996843338013,
-0.42810505628585815,
-0.13371160626411438,
-0.47174954414367676,
-0.4112233519554138,
1.0447275638580322,
-0.30369195342063904,
0.5179206728935242... |
func TestSetWrongArgs(t *testing.T) {
fmt.Println("Entering the test method for SetWrongArgs")
provcc := new(SimpleAsset)
stub := shim.NewMockStub("ANY_PARAM", provcc)
checkInit(t, stub, [][]byte{[]byte("init")})
res := stub.MockInvoke("1", [][]byte{[]byte("set"), []byte("S52fkpF2rCEArSuwqyDA9tVjawUdrkGzbNQLaa7... | [
-0.4626874029636383,
0.12367058545351028,
0.7314575910568237,
-0.3465994894504547,
0.9434890151023865,
0.19660766422748566,
-0.003775127464905381,
-0.6600344777107239,
-0.6456124186515808,
0.27084293961524963,
-0.1431398242712021,
1.0709502696990967,
-0.9415636658668518,
1.0050748586654663... |
func TestSetGoodArgs(t *testing.T) {
fmt.Println("Entering the test method for SetGoodArgs")
provcc := new(SimpleAsset)
stub := shim.NewMockStub("ANY_PARAM", provcc)
// Testing the init. It always return true. No parameters in init.
checkInit(t, stub, [][]byte{[]byte("init")})
res := stub.MockInvoke("1", [][... | [
-0.08292990922927856,
-0.5196971893310547,
0.9809809923171997,
-0.37039825320243835,
0.44431307911872864,
0.5798877477645874,
-0.16338498890399933,
-0.12655124068260193,
-0.17798344790935516,
0.0986211746931076,
-0.4676169753074646,
0.6236123442649841,
-0.7430515289306641,
0.41895699501037... |
func TestSetWrongArgsNoAgentInfo(t *testing.T) {
fmt.Println("Entering the test method for SetWrongArgsNoAgentInfo")
provcc := new(SimpleAsset)
stub := shim.NewMockStub("ANY_PARAM", provcc)
// Testing the init. It always return true. No parameters in init.
checkInit(t, stub, [][]byte{[]byte("init")})
res := ... | [
-0.2226746380329132,
-0.4683672785758972,
0.6538935899734497,
-0.7136170864105225,
0.6921151280403137,
0.4211028814315796,
-0.12766610085964203,
-0.5497571229934692,
-0.7333910465240479,
-0.1884659379720688,
-0.24151617288589478,
0.6920685768127441,
-0.6490280628204346,
0.8681775331497192,... |
func TestSetGoodArgsFull(t *testing.T) {
fmt.Println("Entering the test method for SetGoodArgsFull")
provcc := new(SimpleAsset)
stub := shim.NewMockStub("ANY_PARAM", provcc)
// Testing the init. It always return true. No parameters in init.
checkInit(t, stub, [][]byte{[]byte("init")})
res := stub.MockInvoke(... | [
0.29176756739616394,
-0.5430867671966553,
1.0266616344451904,
-0.49185237288475037,
0.18003131449222565,
0.3002990782260895,
-0.30229926109313965,
-0.16886860132217407,
0.01862083189189434,
0.14588859677314758,
-0.5346604585647583,
0.43700945377349854,
-0.40258386731147766,
0.2624258697032... |
func TestSetGetGoodArgsFull(t *testing.T) {
fmt.Println("Entering the test method for SetGetGoodArgsFull")
provcc := new(SimpleAsset)
stub := shim.NewMockStub("ANY_PARAM", provcc)
// Testing the init. It always return true. No parameters in init.
checkInit(t, stub, [][]byte{[]byte("init")})
res := stub.MockI... | [
0.4012611210346222,
-0.5766769051551819,
1.0154026746749878,
-0.48093605041503906,
0.2386186569929123,
0.11208365112543106,
-0.33700627088546753,
-0.45229992270469666,
-0.10020972788333893,
-0.054377228021621704,
-0.5066271424293518,
0.7190454006195068,
-0.27665576338768005,
0.277841955423... |
func LoggerInit(logFile string) (*os.File, error) {
if _, err := os.Stat(logFile); os.IsNotExist(err) {
if _, err := os.Create(logFile); err != nil {
return nil, fmt.Errorf("failed to create log file: %s", err)
}
}
file, err := os.OpenFile(logFile, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
if err != nil {
... | [
0.6243425607681274,
-0.9989439845085144,
0.728804349899292,
-0.8677176237106323,
-0.12364791333675385,
0.11656302213668823,
0.22359690070152283,
0.2634909451007843,
-1.1423166990280151,
-0.29745206236839294,
-0.18849726021289825,
-0.15999899804592133,
-0.15553268790245056,
0.74743717908859... |
func (*DatadogConfig) Descriptor() ([]byte, []int) {
return file_envoy_config_trace_v3_datadog_proto_rawDescGZIP(), []int{0}
} | [
0.48399069905281067,
0.953986406326294,
0.04808712378144264,
-0.9541503190994263,
0.03136098012328148,
-0.060713030397892,
-0.07016700506210327,
0.5857980251312256,
-0.5581001043319702,
0.0033914330415427685,
-1.6123850345611572,
0.7680253386497498,
0.07008594274520874,
1.2531439065933228,... |
func (sbf *StorageBrokerFetcher) FetchBroker(ctx context.Context, brokerID string) (*types.Broker, error) {
broker, err := sbf.BrokerStorage.Get(ctx, brokerID)
if err != nil {
log.C(ctx).Debugf("FetchBroker with id %s not found in storage", brokerID)
return nil, util.HandleStorageError(err, "broker")
}
passwor... | [
-0.137464240193367,
-0.36746105551719666,
0.4634416103363037,
1.1395201683044434,
-0.4418017566204071,
-0.18572351336479187,
-0.14314572513103485,
-0.2836013436317444,
0.4575229585170746,
-0.19910983741283417,
-0.836458683013916,
0.3715682923793793,
-0.4040799140930176,
0.7054183483123779,... |
func CreateProcessWithLogonW(
username *uint16,
domain *uint16,
password *uint16,
logonFlags uint32,
applicationName *uint16,
commandLine *uint16,
creationFlags uint32,
environment *uint16,
currentDirectory *uint16,
startupInfo *syscall.StartupInfo,
processInformation *syscall.ProcessInformation) error {
r1... | [
0.8510661721229553,
-1.08206045627594,
0.9590573906898499,
0.09737654775381088,
-0.027015941217541695,
0.43123090267181396,
0.05104074999690056,
-1.8246062994003296,
-0.0922432541847229,
-0.5162526965141296,
0.26775842905044556,
0.019828036427497864,
0.045417189598083496,
0.430810481309890... |
func ListToEnvironmentBlock(list *[]string) *uint16 {
if list == nil {
return nil
}
size := 1
for _, v := range *list {
size += len(syscall.StringToUTF16(v))
}
result := make([]uint16, size)
tail := 0
for _, v := range *list {
uline := syscall.StringToUTF16(v)
copy(result[tail:], uline)
tail += le... | [
-0.2544499635696411,
0.2046576887369156,
0.7888372540473938,
-0.09945064038038254,
0.7504646182060242,
-0.2556929290294647,
0.1860019862651825,
0.17815780639648438,
0.4084729552268982,
0.6538328528404236,
-0.7652391791343689,
0.6307979226112366,
-0.768322229385376,
1.2494993209838867,
0.... |
func GetInstanceBackups(ctx *pulumi.Context, args *GetInstanceBackupsArgs, opts ...pulumi.InvokeOption) (*GetInstanceBackupsResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetInstanceBackupsResult
err := ctx.Invoke("linode:index/getInstanceBackups:getInstanceBackups", args, &rv, opts...)
if err !... | [
-1.0909204483032227,
0.6156625151634216,
0.8222036361694336,
0.5734260082244873,
0.9898351430892944,
0.5559403896331787,
-0.36423829197883606,
-0.1581086367368698,
0.4905174970626831,
0.5449666380882263,
-1.0872570276260376,
0.6367313861846924,
-1.3550355434417725,
-1.844374418258667,
-0... |
func (o GetInstanceBackupsResultOutput) Id() pulumi.IntOutput {
return o.ApplyT(func(v GetInstanceBackupsResult) int { return v.Id }).(pulumi.IntOutput)
} | [
0.14123304188251495,
0.06101027503609657,
0.47835907340049744,
0.1972595602273941,
0.6018036603927612,
0.2817435562610626,
0.4728696048259735,
0.5095993280410767,
0.5737648606300354,
-0.06714831292629242,
-0.8147904872894287,
-0.29310548305511475,
-0.8924160599708557,
-1.3604506254196167,
... |
func FileSetNew() *FileSet {
fs := &FileSet{
top: 0,
}
c := make(chan string, bufferSize)
fs.fileChannels = append(fs.fileChannels, c)
return fs
} | [
0.4548899531364441,
-0.875450849533081,
0.5398036241531372,
-0.8294751644134521,
-0.6596202850341797,
-0.9375438690185547,
-0.08316656947135925,
-0.7671433687210083,
-0.7601562142372131,
-1.4005630016326904,
0.40839001536369324,
0.6225298643112183,
0.36714744567871094,
0.024419061839580536... |
func (fs *FileSet) Add(s string) {
//找一个空channel,传入string
if len(fs.fileChannels[fs.top]) == bufferSize {
fs.fileChannels = append(fs.fileChannels, make(chan string, bufferSize))
fs.top++
}
fs.fileChannels[fs.top] <- s
} | [
0.08956313133239746,
-0.44538676738739014,
0.6451834440231323,
-1.3002105951309204,
-0.2800634205341339,
0.00167998974211514,
-0.12892165780067444,
-0.7238669991493225,
0.5074295997619629,
-0.7513970732688904,
0.24181805551052094,
0.9658693671226501,
-0.6571899056434631,
0.3947299122810364... |
func (fs *FileSet) Length() int {
sum := 0
for _, c := range fs.fileChannels {
sum += len(c)
}
return sum
} | [
0.6024995446205139,
-0.31633684039115906,
0.19417884945869446,
-1.1580854654312134,
0.5906471610069275,
-0.5810003876686096,
0.5073400735855103,
0.2566874325275421,
0.07451947033405304,
-0.32555246353149414,
-0.07160883396863937,
0.07894837856292725,
-0.1189754530787468,
0.6285929679870605... |
func (u *UserDB) IsUserExists(mobile string) bool {
count, err := u.Session.(*mgo.Session).DB(u.DBName).C("user").Find(bson.M{"mobile": mobile}).Count()
if err != nil {
if err.Error() == "not found" {
return false
}
}
if count > 0 {
return true
}
return false
} | [
-0.9751891493797302,
-0.6954199075698853,
0.4881512224674225,
0.915419340133667,
0.9008550643920898,
0.34767234325408936,
-0.007127797231078148,
0.650854766368866,
0.4714515805244446,
0.4029877483844757,
-0.14926305413246155,
-1.0205384492874146,
-0.8525398969650269,
0.16615982353687286,
... |
func (u *UserDB) IsUserExistsForLogin(userLogin models.UserLogin) bool {
count, err := u.Session.(*mgo.Session).DB(u.DBName).C("user").Find(bson.M{"mobile": userLogin.Mobile, "email": userLogin.Email, "passcode": userLogin.Passcode, "user_type": userLogin.UserType}).Count()
if err != nil {
if err.Error() == "not... | [
-1.0914851427078247,
-0.969372570514679,
0.4968753755092621,
0.36337482929229736,
0.6225010752677917,
0.3397725820541382,
-0.1732299029827118,
0.6514098048210144,
0.1462596356868744,
-0.14059141278266907,
-0.06816787272691727,
-0.9082072377204895,
-0.21872760355472565,
0.3143252432346344,
... |
func (u *UserDB) GetUser(email, mobile string) (*models.User, error) {
user := &models.User{}
if err := u.Session.(*mgo.Session).DB(u.DBName).C("user").Find(bson.M{"mobile": mobile, "email": email}).One(user); err != nil {
return nil, err
}
return user, nil
} | [
-0.1607276052236557,
0.22579467296600342,
0.5963571071624756,
1.1619179248809814,
0.8589427471160889,
-0.10151640325784683,
0.44361934065818787,
-0.24127478897571564,
0.02970585785806179,
0.2632048428058624,
0.288875550031662,
-0.17323395609855652,
-0.826621413230896,
-0.5068735480308533,
... |
func (u *UserDB) RegisterUser(user models.User) error {
if !u.IsUserExists(user.Mobile) {
if err := u.Session.(*mgo.Session).DB(u.DBName).C("user").Insert(user); err != nil {
return err
}
usr, err := u.GetUser(user.Email, user.Mobile)
if err != nil {
//Todo the earlier transaction revoke
retur... | [
-0.6402544379234314,
0.2958067059516907,
0.7963402271270752,
1.546641230583191,
0.8997673392295837,
0.1281449943780899,
1.427049160003662,
-0.017087101936340332,
1.285220742225647,
0.2946215569972992,
-0.5305607914924622,
-0.7054897546768188,
-0.1430291086435318,
0.9086592793464661,
0.41... |
func (u *UserDB) LoginUser(userLogin models.UserLogin) bool {
return u.IsUserExistsForLogin(userLogin)
} | [
-1.1109627485275269,
-0.20993487536907196,
0.414354532957077,
0.9157505035400391,
-0.6152666211128235,
0.39558884501457214,
-0.23263783752918243,
0.11330991238355637,
0.08883191645145416,
-0.4751816391944885,
-1.2802391052246094,
-1.5864289999008179,
-0.30433163046836853,
0.160072714090347... |
func AddJSONObject(ctx Interface, data interface{}) error {
jsonBytes, err := json.Marshal(data)
if err != nil {
return err
}
return ctx.addJSON(jsonBytes)
} | [
0.007360946387052536,
-0.20212826132774353,
0.5831834077835083,
-0.2115064412355423,
-1.1064069271087646,
0.211249440908432,
-0.839614987373352,
-0.47185957431793213,
0.5836383700370789,
-0.6899882555007935,
-0.8935711979866028,
0.3593822717666626,
-0.003947687800973654,
-0.131716027855873... |
func NewRPC(server *Server) *RPC {
return &RPC{server}
} | [
0.29874467849731445,
-0.7431545257568359,
0.21133558452129364,
-0.07494518160820007,
-0.6527097821235657,
0.2988239824771881,
-0.3155076503753662,
-1.2269988059997559,
0.6337505578994751,
-0.006834960542619228,
0.27193784713745117,
1.0538694858551025,
-0.5151503682136536,
0.351220995187759... |
func (rpc *RPC) Get(args *GetArgs, reply *GetReply) error {
var (
err error
value string
)
value, err = rpc.server.RouteGet(args.Key, args.Quorum)
if err != nil {
return err
}
*reply = GetReply{value}
return nil
} | [
-0.5171310901641846,
-0.23238946497440338,
0.583463191986084,
-1.159928798675537,
1.115212321281433,
-0.6330601572990417,
-1.2217319011688232,
-0.9319909811019897,
-0.08315201103687286,
0.869960367679596,
0.5390802621841431,
1.3320753574371338,
-1.4852958917617798,
-0.42735040187835693,
... |
func (rpc *RPC) Put(args *PutArgs, _ *struct{}) error {
rpc.server.RoutePut(args.Key, args.Value, args.Quorum)
return nil
} | [
-0.9744120240211487,
0.14043593406677246,
0.3332158625125885,
-1.2612676620483398,
0.62424635887146,
0.5108765363693237,
0.24771443009376526,
-0.9173232913017273,
-0.9331653714179993,
1.1085925102233887,
-0.33615171909332275,
0.45662155747413635,
-1.9700987339019775,
-0.11526399850845337,
... |
func (rpc *RPC) NewOrder(args *api.TransportOrderArgs, reply *api.TransportOrderReply) error {
var (
err error
cost float64
msg string
)
cost, msg, err = rpc.server.NewOrder(args.OrderNumber, args.Destination, args.Date, args.Tons, args.Quorum)
if err != nil {
return err
}
*reply = ap... | [
-0.8622072339057922,
0.12440627068281174,
0.6608301997184753,
0.042378634214401245,
0.013682659715414047,
-0.0751059278845787,
-0.5612517595291138,
-0.8167710900306702,
-0.3833829164505005,
0.5620761513710022,
-0.33621087670326233,
0.1766315996646881,
-1.1321336030960083,
0.383425652980804... |
func (b *bgpserver) watchServiceUpdates() {
t := time.NewTicker(100 * time.Millisecond)
defer t.Stop()
for {
select {
case <-b.ctx.Done():
return
case <-t.C:
services := map[string]string{}
for svcName, svc := range b.watcher.Services() {
if svc.Spec.ClusterIP == "" {
continue
} else if s... | [
-0.2661047577857971,
-0.966665506362915,
0.4618088901042938,
-0.6185978055000305,
0.1493467390537262,
-0.026996169239282608,
0.5096374154090881,
-0.03932339325547218,
-0.03718404844403267,
0.15474341809749603,
0.0983123928308487,
0.575340211391449,
-0.3002226948738098,
0.5221889615058899,
... |
func (b *bgpserver) setAddresses() error {
// pull existing
configuredV4, _, err := b.ipLoopback.Get()
if err != nil {
return err
}
// get desired set VIP addresses
desired := []string{}
for ip, _ := range b.config.Config {
desired = append(desired, string(ip))
}
removals, additions := b.ipLoopback.Compa... | [
-0.6201324462890625,
0.39804917573928833,
0.6948460340499878,
-0.4970546364784241,
0.17583021521568298,
-0.20330969989299774,
0.7427188158035278,
-0.1428554505109787,
0.2285069078207016,
0.5981736183166504,
0.46251988410949707,
0.47303780913352966,
-0.7349898219108582,
0.545866847038269,
... |
func (b *bgpserver) watches() {
b.logger.Debugf("Enter func (b *bgpserver) watches()\n")
defer b.logger.Debugf("Exit func (b *bgpserver) watches()\n")
for {
select {
case nodes := <-b.nodeChan:
b.logger.Debug("recv nodeChan")
if types.NodesEqual(b.nodes, nodes, b.logger) {
b.logger.Debug("NODES ARE E... | [
-0.14238838851451874,
-0.44781985878944397,
0.6534383893013,
-0.36715394258499146,
0.05338818207383156,
0.3992430865764618,
0.27142632007598877,
-1.316888451576233,
-0.3298788368701935,
-0.024546219035983086,
0.13523679971694946,
1.1282998323440552,
-0.15694274008274078,
0.8805686831474304... |
func (b *bgpserver) performReconfigure() {
if b.noUpdatesReady() {
// last update happened before the last reconfigure
return
}
start := time.Now()
// these are the VIP addresses
// get both the v4 and v6 to use in CheckConfigParity below
addressesV4, addressesV6, err := b.ipLoopback.Get()
if err != nil {... | [
-0.14742328226566315,
-0.33396703004837036,
0.8425278067588806,
0.3441508114337921,
0.8166828751564026,
-0.8381591439247131,
0.43159618973731995,
0.6942770481109619,
-0.05929890647530556,
0.7339215874671936,
0.6040604710578918,
-0.05043664574623108,
-0.2500687837600708,
0.6008734703063965,... |
func (m *NetManager) serverAdd(key string, con cm.Connection) error {
m.keyMarker[key] = key_marker_server
return m.serverConsManager.Add(key, con)
} | [
-1.103476643562317,
-0.5173152685165405,
0.38452965021133423,
0.21097807586193085,
0.25608503818511963,
1.0117980241775513,
-0.5512569546699524,
0.5839966535568237,
-0.08494006842374802,
0.1734853833913803,
-0.33582767844200134,
-0.010896426625549793,
-1.2325284481048584,
1.387063145637512... |
func New(handler http.Handler) *SafeWrapper {
h := SafeWrapper{
handler: handler,
}
return &h
} | [
-0.25655031204223633,
-0.3983699679374695,
-0.11995035409927368,
-0.1020287275314331,
-1.346729040145874,
0.7490156888961792,
-0.9324665069580078,
-0.11308017373085022,
-0.661430835723877,
-0.2382068932056427,
-0.2601906955242157,
0.7474614381790161,
1.075437307357788,
0.6042780876159668,
... |
func (h *SafeWrapper) SwapHandler(handler http.Handler) {
h.mu.Lock()
h.handler = handler
h.mu.Unlock()
} | [
-1.1427370309829712,
-0.24606218934059143,
0.21988873183727264,
-0.29605716466903687,
-0.40264230966567993,
0.6405714750289917,
-0.05202285572886467,
0.7484363913536072,
0.03798668086528778,
-0.6497765779495239,
-0.5539805293083191,
0.6977197527885437,
-0.6830254197120667,
0.59352219104766... |
func All(c *gin.Context) {
} | [
1.06122624874115,
-0.6509233117103577,
0.3989752233028412,
1.6609294414520264,
0.8827056288719177,
0.6389119625091553,
0.438504159450531,
0.5005435347557068,
0.043946877121925354,
-0.7718164324760437,
0.08945973962545395,
0.9355940222740173,
0.5506261587142944,
0.6300930976867676,
-1.496... |
func ByID(c *gin.Context) {
} | [
0.9986952543258667,
-1.1641907691955566,
0.28099992871284485,
0.2433263212442398,
0.3250296115875244,
0.07401551306247711,
1.4417672157287598,
0.13016080856323242,
0.23900264501571655,
0.16444242000579834,
-0.1289389431476593,
1.0384743213653564,
0.22926896810531616,
-0.023563239723443985,... |
func Register(c *gin.Context) {
} | [
-0.4087185859680176,
0.39740413427352905,
0.33770036697387695,
1.0046539306640625,
1.1918222904205322,
-0.006421595811843872,
0.5996682047843933,
-0.12327729165554047,
-0.4004434049129486,
-1.0287916660308838,
-0.3698798418045044,
0.4643627107143402,
0.035331062972545624,
0.245499342679977... |
func Login(c *gin.Context) {
} | [
-0.15951091051101685,
-0.19363223016262054,
0.2637875974178314,
1.4444550275802612,
0.5697177648544312,
0.43316808342933655,
1.2777725458145142,
0.4068135619163513,
0.15564222633838654,
-0.760961651802063,
-0.6285209655761719,
0.6193659901618958,
0.08294922858476639,
-0.15873627364635468,
... |
func NewServer(port string, newClients chan<- *Client, clientInput chan<- *ClientInputMessage) *Server {
id := NewID("server")
log := NewLogger(id)
return &Server{id, newClients, clientInput, port, nil, log}
} | [
-0.2273530215024948,
-1.156640887260437,
0.33350399136543274,
-0.16924917697906494,
-0.06795879453420639,
0.4963591694831848,
0.4964742362499237,
-0.8096867203712463,
-0.26754429936408997,
-0.29145345091819763,
-0.6257655620574951,
0.9442809820175171,
-0.9498549103736877,
0.782686471939086... |
func (s *Server) Start() {
defer (Track("Start", s.log))()
go s.listen()
} | [
0.3923783600330353,
-0.5669713020324707,
0.19287128746509552,
0.12229005247354507,
0.48065483570098877,
0.34668031334877014,
-0.06693145632743835,
0.5619441270828247,
-0.5126460790634155,
-0.04121227189898491,
-0.5816789269447327,
1.6285786628723145,
0.309665709733963,
0.6538469195365906,
... |
func (s *Server) listen() {
defer (Track("listen", s.log))()
var err error
s.listener, err = net.Listen("tcp", s.port)
if err != nil {
s.log("listen() failed to start per error: %+v", err)
panic(err)
}
s.log("listening at %s", s.port)
for {
conn, err := s.listener.Accept()
if err != nil {
s.log("faile... | [
0.33089005947113037,
-0.6009852886199951,
0.45149174332618713,
-0.6485071182250977,
0.5248543620109558,
0.91647869348526,
0.19855186343193054,
0.02316047064960003,
-0.837273120880127,
0.18786010146141052,
-0.2422276735305786,
0.8172609210014343,
0.2282157838344574,
0.8681129217147827,
0.... |
func (s *Service) Run() error {
if s.CertFile == "" || s.KeyFile == "" {
return fmt.Errorf("One or more TLS certificates not supplied: CertFile: %s, KeyFile: %s", s.CertFile, s.KeyFile)
}
if s.Port == 0 {
s.Port = port
}
return http.ListenAndServeTLS(fmt.Sprintf(":%d", s.Port), s.CertFile, s.KeyFile, s.Routes(... | [
-0.3747745454311371,
-0.6571007966995239,
0.5779527425765991,
-0.3623411953449249,
-0.4994209110736847,
0.38896700739860535,
0.04550971835851669,
0.3405064642429352,
-0.7775546908378601,
-0.02036162093281746,
-0.1405695527791977,
-0.10870634764432907,
-0.6313036680221558,
0.464910835027694... |
func (s *Service) Routes() *mux.Router {
s.Logger.Debug("setting up routes")
r := mux.NewRouter()
r.HandleFunc("/", s.logHandler(s.rootRequest))
r.HandleFunc("/query", s.logHandler(s.queryRequest))
if s.EnableDebug {
r.HandleFunc("/debug/pprof/", pprof.Index)
r.HandleFunc("/debug/pprof/{action}", pprof.Index)
... | [
-0.49672940373420715,
0.27062568068504333,
0.5029845237731934,
-0.13828960061073303,
-0.3664448857307434,
-0.4183011054992676,
-0.5072788000106812,
-0.45999741554260254,
0.12471731007099152,
-1.3296300172805786,
1.0421825647354126,
0.45498591661453247,
-0.3108314871788025,
0.33047002553939... |
func NewKeeper(cdc *codec.Codec, storeKey sdk.StoreKey, bankKeeper bank.Keeper) Keeper {
return Keeper{
cdc: cdc,
storeKey: storeKey,
BankKeeper: bankKeeper,
}
} | [
0.46489450335502625,
-0.5620591640472412,
0.26964080333709717,
0.5592139959335327,
-0.6690080165863037,
-0.1739250272512436,
-0.20738494396209717,
0.2894556522369385,
-0.03441328555345535,
-0.3470170795917511,
-0.02676345966756344,
0.29150742292404175,
-0.3368759751319885,
0.82381635904312... |
func (k Keeper) GetAccountScores(ctx sdk.Context, topicIDs []string, accAddress sdk.AccAddress) pagerank.Vector {
account := accAddress.String()
scoreVector := pagerank.Vector{}
for _, topicID := range topicIDs {
s := k.getScoreVectorUnmarshaled(ctx, topicID)
scoreVector[topicID] = s[account]
}
return scoreV... | [
0.17270709574222565,
-0.4926077127456665,
0.4458344578742981,
-0.5807858109474182,
1.277699589729309,
-0.12633565068244934,
-0.07446497678756714,
-0.7121797800064087,
0.36335989832878113,
0.5593530535697937,
1.2534432411193848,
0.9565989971160889,
-0.24629972875118256,
-0.21629585325717926... |
func (k Keeper) SetEvaluation(ctx sdk.Context, topicID string, fromAddress sdk.AccAddress, toAddress sdk.AccAddress, weight1000 sdk.Int) {
from := fromAddress.String()
to := toAddress.String()
linkMatrix := k.getLinkMatrixUnmarshaled(ctx, topicID)
stochasticMatrix := pagerank.GetStochastixMatrix(linkMatrix)
score... | [
0.4582616090774536,
-0.1649433821439743,
0.2946004271507263,
-0.6013752818107605,
0.2470734715461731,
-0.152165025472641,
0.29310500621795654,
0.2835572063922882,
0.5210673809051514,
0.9257248044013977,
0.2707371115684509,
0.9731412529945374,
0.17001500725746155,
0.3285546600818634,
-0.1... |
func NewAzureActuator(azureCreds *corev1.Secret, cloudName string, logger log.FieldLogger) (*AzureActuator, error) {
azureClient, err := azureclient.NewClientFromSecret(azureCreds, cloudName)
if err != nil {
logger.WithError(err).Warn("failed to create Azure client with creds in clusterDeployment's secret")
retur... | [
-0.33099448680877686,
-0.6387349367141724,
0.3379572033882141,
-0.20331107079982758,
-1.2074313163757324,
-0.16404056549072266,
0.30374306440353394,
0.6169555187225342,
0.32498931884765625,
0.755113959312439,
0.23702119290828705,
1.0779880285263062,
-0.6705203652381897,
0.46604612469673157... |
func (a *AzureActuator) GenerateMachineSets(cd *hivev1.ClusterDeployment, pool *hivev1.MachinePool, logger log.FieldLogger) ([]*machineapi.MachineSet, bool, error) {
if cd.Spec.ClusterMetadata == nil {
return nil, false, errors.New("ClusterDeployment does not have cluster metadata")
}
if cd.Spec.Platform.Azure == ... | [
-1.21604585647583,
0.24310778081417084,
0.666487991809845,
-0.053113289177417755,
0.1498265266418457,
0.36686059832572937,
0.5464316010475159,
-0.04045868292450905,
-0.6032263040542603,
0.9648492932319641,
0.289357453584671,
0.19239147007465363,
-0.7392643094062805,
1.3379489183425903,
0... |
func NewConfig() *Config {
cfg := &Config{}
if err := yaml.Unmarshal([]byte(defaultConfig), cfg); err != nil {
log.Println("Failed to load default config")
log.Println(err)
os.Exit(1)
}
if err := cfg.ParseConfigAt(nil); err != nil {
log.Println("Failed to parse default config")
log.Println(err)
os.Exit... | [
0.38127100467681885,
-0.8267381191253662,
0.5640098452568054,
0.3396983742713928,
0.06363239139318466,
-0.14664627611637115,
0.24450308084487915,
0.5303071737289429,
-0.4990730285644531,
-0.1827995479106903,
-0.13543881475925446,
0.10404057055711746,
-0.3373054563999176,
0.8277237415313721... |
func (cfg *Config) Load() error {
cfg.loadCLIConfigEnv()
if err := cfg.parseConfig(); err != nil {
return fmt.Errorf("failed to read config file : %s", err.Error())
}
if err := cfg.parseBPF(); err != nil {
return fmt.Errorf("failed to read BPF file : %s", err.Error())
}
cfg.loadCLIOverrides()
return nil
} | [
-0.041512832045555115,
0.5111203789710999,
0.5111207365989685,
-0.2147713452577591,
0.2708725333213806,
0.07089916616678238,
0.020207662135362625,
0.08756308257579803,
-1.3581217527389526,
0.2512715458869934,
-0.5190058350563049,
-0.25769171118736267,
-0.8593186736106873,
-0.03911058232188... |
func (cfg *Config) ParseConfigAt(filepath *string) error {
var err error
if filepath != nil {
cfgData, err := ioutil.ReadFile(*filepath)
if err != nil {
return err
}
if err := yaml.Unmarshal(cfgData, cfg); err != nil {
return err
}
}
if len(cfg.MatchProtocols) == 0 {
cfg.MatchProtocols = Suppor... | [
-0.14471159875392914,
-0.23907271027565002,
0.9846614599227905,
-0.5694922208786011,
-0.2783142328262329,
0.19070997834205627,
0.20053115487098694,
-0.06246602162718773,
-0.7820590734481812,
-0.06661462038755417,
-0.015374554321169853,
-0.17467685043811798,
0.46206536889076233,
0.916287600... |
func Parse(L1, L2, L3 [][]string, Excludes []string, scopeName string) []byte {
var oldxml []string
var newxml []string
// read Zap default xml template
fo, _ := io.OpenFile("configs/default.context")
fr, _ := io.ReadFile(fo)
// loop template and append each line to var
scanner := bufio.NewScanner(strings.New... | [
0.021952342242002487,
0.2973839342594147,
0.9112143516540527,
-0.41875016689300537,
-0.8733949661254883,
0.07683956623077393,
-0.2930842638015747,
0.736444890499115,
-0.29120028018951416,
0.5675141215324402,
-0.07623188942670822,
-0.5466593503952026,
-0.6153673529624939,
-0.374016940593719... |
func parse(target, protocol, port string) string {
line := target
// if no protocol, no port was specified
if len(protocol) == 0 && len(port) == 0 {
// scope only http/https
line = `http(s)?://` + line
// if port was specified but no protocol
} else if len(protocol) == 0 && len(port) > 0 {
// scope any pr... | [
-0.1704844981431961,
-0.6669186949729919,
0.8521198630332947,
-0.20926618576049805,
-0.20116327702999115,
0.10938684642314911,
-0.5455871820449829,
-0.0471494197845459,
-0.7183055281639099,
0.28345873951911926,
0.8702061772346497,
0.6431929469108582,
-0.39535871148109436,
-0.43536511063575... |
func isExclude(Excludes []string, target string) bool {
for _, exclude := range Excludes {
//fmt.Println(target, exclude)
if target == exclude {
return true
}
}
return false
} | [
-0.5180338621139526,
-0.11722695827484131,
0.7275329828262329,
0.7546434998512268,
-0.5426913499832153,
0.23085203766822815,
-1.001065969467163,
-0.012447397224605083,
0.9259570837020874,
0.6119870543479919,
0.4263654053211212,
1.0563910007476807,
-1.2801920175552368,
-0.03018037974834442,... |
func ToGlooInt64RangeList(int64Range []*envoy_type_v3.Int64Range) []*envoytype_gloo.Int64Range {
result := make([]*envoytype_gloo.Int64Range, len(int64Range))
for i, v := range int64Range {
result[i] = ToGlooInt64Range(v)
}
return result
} | [
-1.7562233209609985,
-0.1588883101940155,
0.10718263685703278,
0.49203404784202576,
-0.19245897233486176,
0.3443666398525238,
0.04184713959693909,
-0.7200076580047607,
0.8799732327461243,
0.988000750541687,
-0.033494770526885986,
0.3380734920501709,
-1.1496868133544922,
0.02974641136825084... |
func CheckForbiddenCustomHeaders(header envoycore_sk.HeaderValue) error {
key := header.GetKey()
if strings.HasPrefix(key, ":") || strings.ToLower(key) == "host" {
return errors.Errorf(": -prefixed or host headers may not be modified. Received '%s' header", key)
}
return nil
} | [
0.21205787360668182,
0.15545432269573212,
0.4501979649066925,
0.1634574681520462,
-0.8508026599884033,
-0.11807291209697723,
-0.12566132843494415,
-0.24038727581501007,
-0.4366642236709595,
0.2603246867656708,
0.3987707495689392,
1.2889454364776611,
-0.8020067811012268,
0.7920303344726562,... |
func (h *CreateUserHandlerImpl) Handle(params user.CreateUserParams, principal interface{}) middleware.Responder {
t := ""
v := int64(0)
if params.TransactionID != nil {
t = *params.TransactionID
}
if params.Version != nil {
v = *params.Version
}
if t != "" && *params.ForceReload {
msg := "Both force_reloa... | [
-0.07730560749769211,
0.2236575335264206,
0.9161645174026489,
0.5257911086082458,
0.011703590862452984,
0.3946905732154846,
0.48734384775161743,
-0.6520335674285889,
0.5109427571296692,
0.3342464864253998,
-0.27113261818885803,
-0.21006473898887634,
-1.1642460823059082,
0.4190443158149719,... |
func (h *DeleteUserHandlerImpl) Handle(params user.DeleteUserParams, principal interface{}) middleware.Responder {
t := ""
v := int64(0)
if params.TransactionID != nil {
t = *params.TransactionID
}
if params.Version != nil {
v = *params.Version
}
if t != "" && *params.ForceReload {
msg := "Both force_reloa... | [
-0.14754259586334229,
0.24384531378746033,
0.9202935099601746,
0.7987454533576965,
-0.0782170444726944,
-0.02734963409602642,
0.6822212338447571,
-0.2220717817544937,
0.5158984661102295,
0.34380680322647095,
0.1878053992986679,
0.20662546157836914,
-0.9975573420524597,
0.6030678153038025,
... |
func (h *GetUserHandlerImpl) Handle(params user.GetUserParams, principal interface{}) middleware.Responder {
t := ""
if params.TransactionID != nil {
t = *params.TransactionID
}
configuration, err := h.Client.Configuration()
if err != nil {
e := misc.HandleError(err)
return user.NewGetUserDefault(int(*e.Code... | [
0.036963630467653275,
0.4533393979072571,
0.9023532867431641,
0.8209996819496155,
-0.04133113846182823,
0.5481634140014648,
0.47217634320259094,
-0.5778214931488037,
0.08637948334217072,
0.21627436578273773,
-0.09034259617328644,
0.31479793787002563,
-1.2974437475204468,
-0.134056165814399... |
func (h *GetUsersHandlerImpl) Handle(params user.GetUsersParams, principal interface{}) middleware.Responder {
t := ""
if params.TransactionID != nil {
t = *params.TransactionID
}
configuration, err := h.Client.Configuration()
if err != nil {
e := misc.HandleError(err)
return user.NewGetUsersDefault(int(*e.C... | [
0.12237518280744553,
0.5479740500450134,
0.8726179599761963,
0.5629979968070984,
0.26307621598243713,
0.2560808062553406,
0.3247188925743103,
-0.6563854813575745,
0.027558516710996628,
0.17305335402488708,
0.19097673892974854,
0.10323852300643921,
-0.9908806085586548,
0.4950535297393799,
... |
func (h *ReplaceUserHandlerImpl) Handle(params user.ReplaceUserParams, principal interface{}) middleware.Responder {
t := ""
v := int64(0)
if params.TransactionID != nil {
t = *params.TransactionID
}
if params.Version != nil {
v = *params.Version
}
if t != "" && *params.ForceReload {
msg := "Both force_rel... | [
-0.11722058802843094,
0.26217371225357056,
0.9548808336257935,
0.24259623885154724,
0.04980582371354103,
-0.20561431348323822,
0.9094588160514832,
0.24547289311885834,
0.45498472452163696,
0.35585933923721313,
-0.3068385720252991,
0.3685637414455414,
-1.1541117429733276,
0.3954290747642517... |
func absDifference[T Numeric](a, b T, abs func(a T) T) T {
return abs(a - b)
} | [
-0.881606936454773,
-0.17629218101501465,
0.579258918762207,
0.7072305679321289,
-0.5948384404182434,
0.9389186501502991,
-0.914068877696991,
-0.11345203965902328,
-0.9991268515586853,
0.16597194969654083,
0.43168842792510986,
-0.11113031953573227,
1.1346381902694702,
0.2299441248178482,
... |
func OrderedAbsDifference[T OrderedNumeric](a, b T) T {
return absDifference(a, b, Abs[T])
} | [
-0.7401753664016724,
-0.9504492878913879,
0.44593027234077454,
0.27006298303604126,
-0.5959082841873169,
0.7740166187286377,
-0.913421630859375,
-0.5902916789054871,
-0.7058372497558594,
-0.04018442705273628,
-0.13159719109535217,
0.18581396341323853,
1.1945185661315918,
0.1293761879205703... |
func ComplexAbsDifference[T Complex](a, b T) T {
return absDifference(a, b, ComplexAbs[T])
} | [
-0.21068604290485382,
-1.5227224826812744,
0.32707658410072327,
0.734935998916626,
-0.8709626197814941,
0.8538933992385864,
0.2191421389579773,
-0.2837664783000946,
-0.3995998203754425,
0.203129380941391,
-0.6187698841094971,
-0.9817021489143372,
0.7531402111053467,
0.15596821904182434,
... |
func climbingLeaderboard(scores []int64, alice []int64) []int64 {
var scores_ []int64
m := make(map[int64]bool)
for _, val := range scores {
if _, ok := m[val]; !ok {
m[val] = true
scores_ = append(scores_, val)
}
}
var index []int64
n := int64(len(scores_)) - 1
for _, val := range alice {
for n >= ... | [
-0.6121500730514526,
-0.33018919825553894,
0.8762629628181458,
0.1979794204235077,
-0.17536558210849762,
0.7886257171630859,
0.7231817841529846,
-0.7169739007949829,
-0.35182344913482666,
0.681681215763092,
-0.06232495978474617,
0.6844078898429871,
-0.35237330198287964,
0.4105089008808136,... |
func URLForTask(ctx context.Context, tid string) string {
cfg := config.Get(ctx)
u := url.URL{
Scheme: "https",
Host: cfg.Swarming.Host,
Path: "task",
}
q := u.Query()
q.Set("id", tid)
u.RawQuery = q.Encode()
return u.String()
} | [
0.5200697183609009,
0.23674479126930237,
0.42869141697883606,
-0.3205294907093048,
0.2549827992916107,
0.35798996686935425,
-0.19597911834716797,
-0.11800220608711243,
-1.2165313959121704,
0.6380082964897156,
-0.3404732644557953,
0.17223137617111206,
0.9802594780921936,
0.66019606590271,
... |
func AddCommonTags(ctx context.Context, ts ...string) []string {
cfg := config.Get(ctx)
tags := make([]string, 0, len(ts)+2)
tags = append(tags, cfg.Swarming.LuciProjectTag)
tags = append(tags, cfg.Swarming.FleetAdminTaskTag)
tags = append(tags, ts...)
return tags
} | [
0.5022650361061096,
0.3572646379470825,
0.6464561223983765,
0.3276250660419464,
1.500907063484192,
0.4646507799625397,
-0.4808606803417206,
0.19885575771331787,
-0.26338768005371094,
0.5899695158004761,
-0.46710050106048584,
-0.2798759937286377,
-0.3442669212818146,
1.3651366233825684,
-... |
func SetCommonTaskArgs(ctx context.Context, args *clients.SwarmingCreateTaskArgs) *clients.SwarmingCreateTaskArgs {
cfg := config.Get(ctx)
args.User = taskUser
args.ServiceAccount = cfg.Tasker.AdminTaskServiceAccount
args.Pool = cfg.Swarming.BotPool
return args
} | [
0.3276508152484894,
0.6888935565948486,
0.4367987811565399,
0.5050544142723083,
0.31958743929862976,
1.1309421062469482,
1.022270917892456,
0.008482346311211586,
-0.5612809658050537,
0.9900466203689575,
-0.6566767692565918,
0.10989796370267868,
-0.33371099829673767,
1.2011064291000366,
-... |
func ExtractSingleValuedDimension(dims strpair.Map, key string) (string, error) {
vs, ok := dims[key]
if !ok {
return "", fmt.Errorf("failed to find dimension %s", key)
}
switch len(vs) {
case 1:
return vs[0], nil
case 0:
return "", fmt.Errorf("no value for dimension %s", key)
default:
return "", fmt.Err... | [
-0.4714493453502655,
-0.052885282784700394,
0.4733414947986603,
-0.04265716299414635,
-0.7234936952590942,
-0.2914426326751709,
0.09785205125808716,
0.5534815788269043,
-0.10039433091878891,
1.0437031984329224,
0.32065266370773315,
0.4446743130683899,
-0.10844313353300095,
0.89585137367248... |
func DimensionsMap(sdims []*swarming.SwarmingRpcsStringListPair) strpair.Map {
dims := make(strpair.Map)
for _, sdim := range sdims {
dims[sdim.Key] = sdim.Value
}
return dims
} | [
-0.48360374569892883,
0.28012052178382874,
0.319189190864563,
-0.509967565536499,
-0.6917731761932373,
0.2229631543159485,
0.6066177487373352,
0.399370014667511,
0.415241539478302,
0.41234639286994934,
0.0546979196369648,
-0.42428162693977356,
0.11698950082063675,
0.4038836359977722,
-0.... |
func GetRoutes() *mux.Router {
router := mux.NewRouter()
router.HandleFunc("/api/V1/getInfoCurp/{encode_curp}", getInfoCurp).Name("getInfoCurp").Methods("GET")
return router
} | [
-0.7875127196311951,
0.4336588680744171,
0.4125121235847473,
0.28466612100601196,
0.7147857546806335,
-0.45275261998176575,
-0.5962874293327332,
-0.014839914627373219,
0.17996340990066528,
-0.8015857338905334,
0.3279832601547241,
0.9302268624305725,
-0.7778934240341187,
-0.1104135140776634... |
func GetCurpByRenapo(curp string) string {
resp, _ := http.Post(os.Getenv("URL_STC_1")+curp+os.Getenv("URL_STC_2"), "application/json", nil)
bodyBytes, _ := ioutil.ReadAll(resp.Body)
return string(bodyBytes)
} | [
-0.2509600520133972,
-0.6975479125976562,
0.8702938556671143,
-0.28299692273139954,
0.042258501052856445,
-0.4509902000427246,
-0.20946934819221497,
-0.664368748664856,
-0.8939350843429565,
1.0582798719406128,
-0.6240321397781372,
0.6184408664703369,
-0.7752154469490051,
-0.333080589771270... |
func ValidateRequest(key string) bool {
return true
} | [
-1.8888336420059204,
-0.1539379060268402,
0.4024040102958679,
0.6532175540924072,
-0.5094863176345825,
0.9997949600219727,
-0.773475706577301,
0.23105370998382568,
-0.3232361972332001,
-0.6538037657737732,
0.059934988617897034,
-0.9601535797119141,
-0.8318222165107727,
-0.1475120186805725,... |
func GetProtEnvaironment() string {
port := os.Getenv("PORT")
if port != "" {
return port
}
return "80"
} | [
-0.6799504160881042,
-0.5223363637924194,
0.7673171162605286,
-0.24340760707855225,
0.026007752865552902,
0.7707299590110779,
0.8316032290458679,
-0.2558595538139343,
-0.388587087392807,
0.37852922081947327,
1.172183632850647,
0.698660135269165,
-0.27592039108276367,
0.14035658538341522,
... |
func Evaluate(expression *[]string, dispatchTable DispatchTable, stack *Stack) interface{} {
for idx, token := range *expression {
var dispatchFunction DispatchFunc
if _, err := strconv.ParseFloat(token, 64); err == nil {
dispatchFunction = dispatchTable["FLOAT"]
} else {
var evalsOk bool
if dispatchF... | [
0.16557185351848602,
0.44475579261779785,
0.9151039123535156,
0.20743393898010254,
-0.48513519763946533,
-1.097895622253418,
-0.2965392470359802,
0.2626815438270569,
-0.7535982131958008,
0.8833869695663452,
-0.36164116859436035,
-0.6784414052963257,
-0.04928870499134064,
-0.330090194940567... |
func TestParsePolicy(t *testing.T) {
enabled := "enabled"
disabled := "disabled"
pathA := "/bucket/a"
pathB := "/bucket/b"
modelA := &models.RetentionPolicyRule{
Status: &enabled,
Filter: &models.RetentionPolicyRuleFilter{Prefix: pathA},
Expiration: &models.RetentionPolicyRuleExpiration{All: &models.... | [
0.9113163352012634,
0.037171415984630585,
0.7461785674095154,
0.00640430673956871,
1.4884419441223145,
0.537059485912323,
-0.07797230035066605,
-0.08363683521747589,
0.24973326921463013,
0.028047263622283936,
-0.34529536962509155,
-0.2988489270210266,
-0.13504736125469208,
0.19970680773258... |
func IsWithSudo() error {
if os.Getenv("SUDO_UID") != "" {
return nil
}
return errors.New("Elevated permissions are required to make entries to host file. Make sure you are using sudo")
} | [
0.9621415734291077,
0.3940938115119934,
0.653586208820343,
1.1163698434829712,
0.10588046163320541,
0.5517051219940186,
-0.551206648349762,
0.5835127830505371,
-0.9290616512298584,
-0.2112574428319931,
-0.13321632146835327,
0.9858412146568298,
0.3305990397930145,
0.58982914686203,
-0.077... |
func TokenAuthHandler(grpAuthClient auth_proto.AuthenticationServiceClient, repository user_persistance.UserRepository) http_authenticator.TokenAuthFunc {
fn := func(token string) (identity.Identity, error) {
tokenInfo, err := grpAuthClient.VerifyToken(context.Background(), &auth_proto.VerifyTokenRequest{
Token: ... | [
-0.060710735619068146,
-0.24204759299755096,
0.1669737696647644,
0.09452788531780243,
-0.3422160744667053,
-0.11512286961078644,
0.580304741859436,
-0.4904134273529053,
0.3135884404182434,
0.044466424733400345,
-0.4455842673778534,
0.5005584359169006,
0.29035308957099915,
-0.85403716564178... |
func deploymentSpecReplicas(deployment *unstructured.Unstructured) (interface{}, bool) {
return pluck(deployment.Object, "spec", "replicas")
} | [
-1.0736079216003418,
0.5985830426216125,
0.3561360538005829,
-0.9301552772521973,
-0.16275747120380402,
0.30400511622428894,
-0.33900514245033264,
0.8077608346939087,
0.38776281476020813,
1.7196619510650635,
-0.2234620302915573,
0.08560752868652344,
0.9006440043449402,
-0.36165666580200195... |
func waitForDesiredReplicasFunc(
clientForResource dynamic.ResourceInterface,
name string,
getReplicasSpec func(*unstructured.Unstructured) (interface{}, bool),
getReplicasStatus func(*unstructured.Unstructured) (interface{}, bool),
) watcher.Predicate {
return func(replicator *unstructured.Unstructured) bool {
... | [
-0.5326694846153259,
0.03218284249305725,
0.4409888684749603,
-0.8354800939559937,
-0.699134886264801,
-0.06493916362524033,
0.13686130940914154,
0.33874234557151794,
-0.3042345941066742,
-0.28039470314979553,
-0.6634782552719116,
0.6755056381225586,
0.7539112567901611,
-0.0637453421950340... |
func FindIndividualsByNameDate(g types.Gedcom, name string, yob int, yod int) []types.Individual {
var individuals []types.Individual
// var err error
// var t time.Time
re := regexp.MustCompile(name)
for _, i := range g.Individual {
var birth int
var death int
if re.Find([]byte(i.Name[0].Name)) != nil {
... | [
-0.5226631164550781,
-1.2843782901763916,
0.8513748049736023,
-0.14825871586799622,
-0.6577689051628113,
0.6024004220962524,
-0.33777880668640137,
-0.11485942453145981,
-0.6096733212471008,
0.4444383382797241,
-0.3420461416244507,
0.46345439553260803,
-0.4527035057544708,
1.256621241569519... |
func (DrugAllergy) Fields() []ent.Field {
return []ent.Field{
}
} | [
-0.34183600544929504,
-0.045817781239748,
0.21788670122623444,
-1.5716323852539062,
1.0819932222366333,
0.9056780934333801,
-0.7736584544181824,
-0.06038739159703255,
-0.10416807979345322,
-0.48291483521461487,
-0.10290259122848511,
0.20135962963104248,
-0.16132739186286926,
-0.32873338460... |
func (DrugAllergy) Edges() []ent.Edge {
return []ent.Edge{
edge. From("doctor",Doctor.Type).Ref("Doctor_DrugAllergy").Unique(),
edge. From("patient",Patient.Type).Ref("Patient_DrugAllergy").Unique(),
edge. From("medicine",Medicine.Type).Ref("Medicine_DrugAllergy").Unique(),
edge. From("manner... | [
-0.7966112494468689,
-0.47310566902160645,
0.5576404929161072,
-0.975195586681366,
0.6318529844284058,
0.22648870944976807,
-0.8509083390235901,
0.5132010579109192,
0.18336734175682068,
0.2958906590938568,
0.9249794483184814,
0.9169225096702576,
0.44899407029151917,
0.27332526445388794,
... |
func (s *Server) authTokenVerifier(auth JWTVerifier) func(next http.Handler) http.Handler {
return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
authHeader := getHeader(r, headerAuthorization)
if authHeader == "" {
s.logger.Print("no authoriz... | [
0.21321092545986176,
0.11143039166927338,
0.48721447587013245,
0.04850781336426735,
-1.3982971906661987,
0.07958497852087021,
0.2018873244524002,
-0.5365487337112427,
0.45751169323921204,
0.02614659257233143,
-0.8653597831726074,
1.0378986597061157,
0.486396461725235,
0.9539837837219238,
... |
func (s *Server) keyPermissionMapper(m keyPermissionMapper) func(next http.Handler) http.Handler {
return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
a := getHeader(r, headerAPIKey)
if a == "" {
http.Error(w, "api key not found", http.Status... | [
-0.8569090366363525,
-0.2667466998100281,
0.7350291013717651,
0.3624488413333893,
-1.7639505863189697,
-0.1328182965517044,
-0.1301322728395462,
0.27892690896987915,
0.591031014919281,
0.7645694613456726,
0.7936370372772217,
-1.1906558275222778,
-0.1043737530708313,
0.031893521547317505,
... |
func NewWebSocket(uri string) (l3.Transport, error) {
sock := gWebSocket.New(uri, []any{})
sock.Set("binaryType", "arraybuffer")
tr := &wsTransport{
sock: sock,
rxq: make(chan js.Value, 64),
}
tr.TransportBase, tr.p = l3.NewTransportBase(l3.TransportBaseConfig{
MTU: 8800,
InitialState: l3.Transpo... | [
0.3478822410106659,
-0.11222447454929352,
0.9314848780632019,
-0.23983298242092133,
-0.8440423011779785,
-0.27321845293045044,
0.6902294158935547,
-1.1807090044021606,
0.19062983989715576,
-0.4894642233848572,
-0.4641430974006653,
0.88436359167099,
-0.08717332780361176,
-0.0519987307488918... |
func (l LoggoLogger) Printf(format string, v ...interface{}) {
l.Debugf(format, v...)
} | [
0.10374043881893158,
-0.054390668869018555,
0.42730191349983215,
0.30630993843078613,
0.6091223359107971,
-0.24888727068901062,
-0.2315082550048828,
0.06517647206783295,
-0.5739776492118835,
-0.9588014483451843,
-0.232168048620224,
0.8463600873947144,
-0.10514938086271286,
1.34493982791900... |
func (a CompatLoggerAdapter) Debugf(format string, v ...interface{}) {
a.Printf("DEBUG: "+format, v...)
} | [
-0.28254926204681396,
-0.05409993976354599,
0.529455304145813,
-0.03186054155230522,
-0.09416097402572632,
-0.5956516861915588,
-0.41525375843048096,
0.2675982713699341,
-0.3670981228351593,
-0.5183559656143188,
0.17449508607387543,
0.26400724053382874,
0.06121502444148064,
1.1530654430389... |
func (a CompatLoggerAdapter) Warningf(format string, v ...interface{}) {
a.Printf("WARNING: "+format, v...)
} | [
0.270579993724823,
-0.3594433665275574,
0.41547489166259766,
0.4755553603172302,
-0.4533860981464386,
-0.26020297408103943,
-0.17976807057857513,
-0.0784527063369751,
-0.167855903506279,
0.42406418919563293,
0.3863483667373657,
0.322668194770813,
0.4968316853046417,
0.479437917470932,
-0... |
func (a CompatLoggerAdapter) Tracef(format string, v ...interface{}) {
a.Printf("TRACE: "+format, v...)
} | [
0.6343008279800415,
-0.23808345198631287,
0.48696163296699524,
-0.01894141361117363,
0.06353975087404251,
-0.21467505395412445,
0.41249772906303406,
-0.07859576493501663,
0.36971303820610046,
-0.1139340028166771,
-0.07562173902988434,
0.38396450877189636,
0.3273982107639313,
0.358689069747... |
func FromCompat(in CompatLogger) Logger {
if in == nil || in == (*log.Logger)(nil) {
return CompatLoggerAdapter{nopLogger{}}
}
if l, ok := in.(Logger); ok {
return l
}
return CompatLoggerAdapter{in}
} | [
-0.013069281354546547,
-0.4330579936504364,
0.4906238317489624,
0.16591769456863403,
-1.5971572399139404,
-0.05039049685001373,
-0.29834383726119995,
0.39687180519104004,
1.226216197013855,
-0.18315646052360535,
-0.08900629729032516,
0.04604562371969223,
-0.6058842539787292,
0.582631289958... |
func New(kind string, client client.Contract) *instance {
return &instance{
kind: kind,
client: client,
}
} | [
0.0157797671854496,
-0.5029393434524536,
0.18428091704845428,
-1.0099126100540161,
-0.9358432292938232,
0.46930062770843506,
-1.0455305576324463,
0.4680245518684387,
-1.1555497646331787,
1.023026704788208,
-0.022281909361481667,
0.8706619143486023,
-0.1872977912425995,
-0.2630048990249634,... |
func (*instance) createTransfer(address trinary.Hash, message trinary.Trytes) bundle.Transfer {
return bundle.Transfer{
Address: address,
Message: message,
Value: 0,
}
} | [
0.5782131552696228,
-0.28089237213134766,
0.41656655073165894,
0.061264198273420334,
0.2648729383945465,
0.34361743927001953,
-0.8056018948554993,
-0.06905179470777512,
-0.287576287984848,
-0.41812559962272644,
0.3123132884502411,
-0.15924422442913055,
-0.8353763818740845,
0.50736743211746... |
func (i *instance) Send(seed string, depth uint64, mwm uint64, annotations []byte) metadata.Contract {
addr, err := i.client.GetNewAddress(seed, iotaAPI.GetNewAddressOptions{})
if err != nil {
return i.getNewAddressError(err.Error())
}
messageTrytes, err := converter.ASCIIToTrytes(string(annotations))
if err !=... | [
-0.9525240659713745,
0.08667691797018051,
0.36269301176071167,
-0.19886428117752075,
-0.17574971914291382,
-0.11322229355573654,
-0.09675296396017075,
-0.6003369092941284,
-0.6701799035072327,
0.6680792570114136,
0.06174617260694504,
0.7615559101104736,
-1.0251942873001099,
-0.346071988344... |
func main(){
// Relative path to the folder containing the test files.
inputPath := "../../TestFiles/"
outputPath := "../../TestFiles/Output/"
inputFileName := "newsletter"
// The first step in every application using PDFNet is to initialize the
// library and set the path to common PDF re... | [
0.7731637358665466,
0.09815249592065811,
1.0857412815093994,
1.2196428775787354,
0.5548992156982422,
-0.8905815482139587,
1.013228416442871,
-0.48090654611587524,
-0.061285197734832764,
-0.4227805435657501,
-0.7446067333221436,
-1.104295253753662,
0.02958928979933262,
-0.34272995591163635,... |
func NewCommand() *cli.Command { //nolint:funlen
const (
apiKeyMinLength = 8
)
return &cli.Command{
Name: "quota",
Aliases: []string{"q"},
Usage: "Get currently used quota",
Action: func(c *cli.Context) error {
var apiKeys = c.StringSlice(shared.APIKeyFlag.Name)
if len(apiKeys) == 0 {
retu... | [
-0.43884018063545227,
-0.35283780097961426,
0.9177284836769104,
-0.5449718236923218,
-0.16107352077960968,
-0.05992709472775459,
0.28251245617866516,
-0.982729971408844,
0.11711179465055466,
0.7312028408050537,
0.6741941571235657,
1.2747060060501099,
0.16555505990982056,
0.5904822945594788... |
func maskString(s string) string {
var length = utf8.RuneCountInString(s)
if length <= 8 { //nolint:gomnd
return s
}
return s[:4] + strings.Repeat("*", length-8) + s[length-4:] //nolint:gomnd
} | [
0.045892249792814255,
0.37476038932800293,
0.6619452238082886,
0.36517569422721863,
-0.5134207010269165,
-0.26867029070854187,
0.10571636259555817,
-0.6718246936798096,
0.5716644525527954,
0.9528746604919434,
0.7346735596656799,
-0.3284839987754822,
-0.24009424448013306,
-1.508791565895080... |
func NewSign(
xrp xrpgrp.Rippler,
logger *zap.Logger,
xrpAccountKeyRepo coldrepo.XRPAccountKeyRepositorier,
txFileRepo tx.FileRepositorier,
wtype wallet.WalletType) *Sign {
return &Sign{
xrp: xrp,
logger: logger,
xrpAccountKeyRepo: xrpAccountKeyRepo,
txFileRepo: txFileRepo,... | [
0.2545817494392395,
-0.5229979753494263,
0.46990177035331726,
-0.6717954277992249,
-0.6827826499938965,
-0.5468241572380066,
-0.7202473282814026,
-0.20995351672172546,
-0.16299545764923096,
0.6825516223907471,
0.26798585057258606,
-0.2748759686946869,
-0.8841647505760193,
0.397807747125625... |
func (s *Sign) SignTx(filePath string) (string, bool, string, error) {
// get tx_deposit_id from tx file name
actionType, _, txID, signedCount, err := s.txFileRepo.ValidateFilePath(filePath, tx.TxTypeUnsigned)
if err != nil {
return "", false, "", err
}
var senderAccount account.AccountType
// get hex tx from... | [
-0.5604276061058044,
-0.513221025466919,
1.038842797279358,
-0.27114182710647583,
-0.19467701017856598,
0.11186017096042633,
0.37459900975227356,
0.5047004818916321,
-0.32983675599098206,
1.1421936750411987,
-1.2845009565353394,
-0.8981173038482666,
0.008858292363584042,
-0.181772246956825... |
func (p *MockPipe) Reader() (io.ReadCloser, error) {
return ioutil.NopCloser(bytes.NewReader([]byte(p.Data))), p.Err
} | [
-0.9689159393310547,
-0.4263041913509369,
0.12705302238464355,
-1.1369707584381104,
-1.0501484870910645,
1.1213712692260742,
0.5579949617385864,
0.022268667817115784,
-0.40730610489845276,
-0.6132605671882629,
0.4742566645145416,
0.25695621967315674,
-0.7432734370231628,
0.2819528877735138... |
func NewService(repo formationConstraintRepository, formationTemplateConstraintReferenceRepo formationTemplateConstraintReferenceRepository, uidSvc uidService, converter formationConstraintConverter) *service {
return &service{
repo: repo,
formationTemplateConstraintReferenceRep... | [
-0.5173494219779968,
-0.3551226854324341,
0.18346041440963745,
-0.48365163803100586,
-0.00839476753026247,
-0.2906442880630493,
0.09847264736890793,
-0.4453471302986145,
-0.3256937861442566,
-0.09058607369661331,
0.3351127803325653,
0.12677842378616333,
-0.09979543834924698,
0.625612795352... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.