text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func masterSock() string {
s := "/var/tmp/824-mr-"
s += strconv.Itoa(os.Getuid())
return s
} | [
-0.2557890713214874,
-0.5439467430114746,
0.6565352082252502,
-0.7948881387710571,
-0.33738601207733154,
0.7036263346672058,
-0.09688037633895874,
0.13109473884105682,
0.2703961133956909,
-0.7543063163757324,
0.19032026827335358,
0.7213417887687683,
-0.2670593857765198,
0.16970442235469818... |
func GetTopics(topicReg string) []string {
var topics []string
for _, tp := range strings.Split(topicReg, ",") {
//command := "kafka-topics.sh " + brokers + " --list --topic" + topicReg
out, err := exec.Command("bash", "kafka-topics.sh", "--zookeeper", zks, "--list", "--topic", tp).Output()
if err != nil {
... | [
0.3238201439380646,
-0.3863365054130554,
0.667740523815155,
0.237324520945549,
0.2496979832649231,
0.03618984669446945,
-0.15631428360939026,
0.15609429776668549,
-0.47557103633880615,
0.6901952624320984,
0.43391212821006775,
0.4318103492259979,
-0.4729450047016144,
0.6147920489311218,
-... |
func GetPartitionsMap(topic string) PartitionMap {
if topic == "" {
log.Println("Topic is empty")
return PartitionMap{}
}
topicjson := []byte("{\"topics\":[{\"topic\": \"" + topic + "\"}],\"version\":1}")
err := ioutil.WriteFile("/tmp/test-topic.json", topicjson, 0644)
out, err := exec.Command("bash", "kafk... | [
-0.5899773240089417,
-1.91719651222229,
0.9217899441719055,
-0.4004242718219757,
-0.35578852891921997,
0.20146039128303528,
1.064890742301941,
0.19067394733428955,
-0.20521901547908783,
0.5136330723762512,
-0.15113525092601776,
-0.16891787946224213,
-0.5861563682556152,
0.49984872341156006... |
func isLimitBandwidthChange() bool {
tempBW, err := ReadBandwithLimitFile()
if err == nil {
if tempBW != throttle {
return true
}
}
return false
} | [
1.0125929117202759,
-0.38645175099372864,
0.7704464197158813,
0.6987709999084473,
-0.2780972719192505,
0.6150913834571838,
-0.41661298274993896,
-0.2288643717765808,
0.4360169470310211,
0.30256325006484985,
0.6450423002243042,
0.5441222786903381,
-1.3053330183029175,
0.34737804532051086,
... |
func forceUperBandwidth(bw int64) int64 {
if bw > maxBwPerBroker {
return maxBwPerBroker
}
return bw
} | [
0.20053285360336304,
0.5994285941123962,
0.5639098286628723,
1.2923799753189087,
-0.23068533837795258,
-0.10825367271900177,
0.45602288842201233,
0.24317772686481476,
0.7793938517570496,
-0.3935294449329376,
0.04048899933695793,
0.26759496331214905,
-1.346373200416565,
1.3191184997558594,
... |
func choseBrokerByCompareStorage(p Partition, brokerIds []int, partmetric map[string]map[int]int64, brokermetric map[int]int64, brokerCount int) int {
tryValue := -1
brokerIndex := 0
numberOfBroker := len(brokerIds)
for brokerIndex := 0; brokerIndex < len(brokerIds); brokerIndex++ {
tryValue = brokerIds[(brokerC... | [
0.1441853940486908,
-0.5404800176620483,
0.7750975489616394,
0.8840548396110535,
-0.32126230001449585,
0.18771539628505707,
1.3319514989852905,
-0.9016757011413574,
-1.1090441942214966,
0.06278687715530396,
0.5101617574691772,
-0.04779970273375511,
-1.160606861114502,
0.5203218460083008,
... |
func (m Releases) Validate(formats strfmt.Registry) error {
var res []error
for i := 0; i < len(m); i++ {
if swag.IsZero(m[i]) { // not required
continue
}
if m[i] != nil {
if err := m[i].Validate(formats); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidatio... | [
-0.5897026658058167,
-0.27677345275878906,
0.35875436663627625,
0.022336499765515327,
0.7234109044075012,
-0.04496263340115547,
-0.06416434049606323,
-0.24500912427902222,
-0.6600365042686462,
0.6457763314247131,
0.6398141384124756,
-0.4312707483768463,
-0.7221698760986328,
1.8969234228134... |
func (m *ReleasesItems0) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAssets(formats); err != nil {
// prop
res = append(res, err)
}
if err := m.validateAuthor(formats); err != nil {
// prop
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationE... | [
-0.18573391437530518,
-0.5395796895027161,
0.08546148985624313,
-0.45673152804374695,
0.2801412045955658,
0.013445623219013214,
0.09638908505439758,
0.576973021030426,
-0.5775935053825378,
0.02983868680894375,
-0.15960291028022766,
0.21452926099300385,
-0.436122864484787,
0.743676960468292... |
func (m *ReleasesItems0AssetsItems0) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateUploader(formats); err != nil {
// prop
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
} | [
-0.22940750420093536,
-0.4148089587688446,
0.06238909065723419,
-0.5318138003349304,
0.1158619076013565,
-0.03250126540660858,
0.2899417579174042,
0.3105994760990143,
-0.5805603265762329,
0.30009225010871887,
-0.04443864896893501,
0.09500999003648758,
-0.23628373444080353,
0.52188932895660... |
func (m *ReleasesItems0AssetsItems0Uploader) Validate(formats strfmt.Registry) error {
var res []error
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
} | [
-0.342727392911911,
0.02016710489988327,
0.1741071194410324,
-0.4428940713405609,
0.1235530823469162,
-0.5766685605049133,
0.1697864681482315,
0.4004189968109131,
-0.5307497382164001,
0.22617238759994507,
-0.09048294275999069,
-0.35282832384109497,
0.10044850409030914,
1.4329103231430054,
... |
func (m *ReleasesItems0Author) Validate(formats strfmt.Registry) error {
var res []error
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
} | [
-0.35637643933296204,
-0.481571227312088,
0.0025005193892866373,
-0.18972179293632507,
0.2748565077781677,
-0.22919481992721558,
0.4516616463661194,
1.2042498588562012,
-0.40200766921043396,
0.24621130526065826,
-0.10138538479804993,
0.3024730980396271,
-0.13012182712554932,
0.550266861915... |
func (u *User) Normalize() {
u.Email = strings.TrimSpace(u.Email)
u.Name = strings.TrimSpace(u.Name)
// removes all non-number char, including + sign
u.Phone = regexp.MustCompile(`\D`).ReplaceAllString(strings.TrimSpace(u.Phone), "")
r := regexp.MustCompile("^0+")
if r.MatchString(u.Phone) {
u.Phone = r.Replace... | [
-0.38079267740249634,
0.39131179451942444,
0.7467923760414124,
0.1559431105852127,
-0.7545371651649475,
0.08730345219373703,
-0.28722912073135376,
0.4666720926761627,
0.7246180176734924,
-0.7881057262420654,
-0.5725491642951965,
-0.5303341746330261,
-0.6565453410148621,
-0.1384025067090988... |
func (u *User) Validate() error {
// check name first: must have no special character
matched, _ := regexp.Match("^[A-Za-z0-9\\s]+$", []byte(u.Name))
if !matched {
return errors.New("Nama hanya boleh mengandung karakter alfanumerik")
}
// check phone
return nil
} | [
0.17027601599693298,
0.04397471621632576,
0.6015347242355347,
0.6509695053100586,
-0.6774129867553711,
0.7231860160827637,
-0.10403691232204437,
-0.07532744854688644,
0.5803723335266113,
-0.6599400043487549,
-0.28395646810531616,
-0.5033998489379883,
-0.2853275537490845,
0.2713234126567840... |
func (u *User) ConvertToPublic() *UserPublic {
return &UserPublic{
ID: u.ID,
Email: u.Email,
Name: u.Name,
Phone: u.Phone,
BankName: u.BankName,
BankAccount: u.BankAccount,
RegisteredAt: u.CreatedAt,
Avatar: u.Avatar,
}
} | [
0.18506060540676117,
0.007350921630859375,
0.6024942398071289,
-0.2838067412376404,
-1.3436634540557861,
0.35915976762771606,
-0.0589023195207119,
-1.0640966892242432,
-0.3352096676826477,
-0.24008189141750336,
-0.9672528505325317,
-0.2578517198562622,
0.44605475664138794,
-0.5813720822334... |
func New() *Prque {
return &Prque{newSstack()}
} | [
-0.13808058202266693,
-0.41414105892181396,
0.10842940956354141,
-0.1560869663953781,
-0.3571036159992218,
-0.2236296385526657,
-1.1316053867340088,
-0.2830671966075897,
-1.0595812797546387,
-0.1331583559513092,
-0.3834957778453827,
0.5148575305938721,
0.06925658881664276,
0.58655774593353... |
func (p *Prque) Push(data interface{}, priority float32) {
heap.Push(p.cont, &item{data, priority})
} | [
0.375720739364624,
0.6780784130096436,
0.40473195910453796,
-0.5031692981719971,
0.1559174656867981,
0.9540471434593201,
-1.6278420686721802,
0.2129659354686737,
-0.16805344820022583,
0.3969123661518097,
-0.5641687512397766,
0.8867135643959045,
-0.3914525508880615,
0.24301870167255402,
1... |
func (p *Prque) Pop() (interface{}, float32) {
item := heap.Pop(p.cont).(*item)
return item.value, item.priority
} | [
-0.3194359540939331,
0.020597945898771286,
0.7246218919754028,
-0.48765331506729126,
-0.06857296079397202,
0.5377185940742493,
-0.9657443761825562,
0.18387463688850403,
-0.8800650835037231,
0.9438608884811401,
-0.6724650859832764,
-0.31287696957588196,
-0.17937496304512024,
-0.099905692040... |
func (p *Prque) PopItem() interface{} {
return heap.Pop(p.cont).(*item).value
} | [
-0.12510308623313904,
0.0792095735669136,
0.4411179721355438,
0.45448464155197144,
-0.09891048073768616,
1.2351402044296265,
-0.6931191682815552,
-0.07513730227947235,
-0.7485700249671936,
0.6780576705932617,
0.21230071783065796,
-0.3865776062011719,
-0.4986519515514374,
-0.331814140081405... |
func (p *Prque) Empty() bool {
return p.cont.Len() == 0
} | [
-0.9772074818611145,
-0.4149225354194641,
0.34017542004585266,
-0.9822102189064026,
0.9034264087677002,
1.3906197547912598,
-0.5961247086524963,
0.3535192906856537,
-0.9463118314743042,
0.9817293286323547,
-0.028355976566672325,
0.49814867973327637,
-1.2647637128829956,
-0.0660143941640853... |
func (p *Prque) Size() int {
return p.cont.Len()
} | [
-0.18968704342842102,
0.33295056223869324,
0.32408836483955383,
-1.419567584991455,
0.5183457136154175,
1.2131098508834839,
0.29675108194351196,
0.30806076526641846,
-0.37885019183158875,
0.34844300150871277,
-0.19936329126358032,
0.5204422473907471,
-1.136984944343567,
-0.2061593532562255... |
func (p *Prque) Reset() {
*p = *New()
} | [
-0.5290865898132324,
-0.0844399705529213,
0.1569102257490158,
-0.5580841302871704,
1.0921721458435059,
0.7604231238365173,
0.24249611794948578,
-0.5095219016075134,
-1.08306086063385,
0.278743714094162,
-0.4720880687236786,
1.5755195617675781,
-1.0593451261520386,
-0.7838969230651855,
-0... |
func (z *TermChange) Msgsize() (s int) {
s = 1 + z.TxBase.Msgsize() + msgp.BytesPrefixSize + len(z.PkBls) + z.Issuer.Msgsize()
return
} | [
0.26629501581192017,
0.9146238565444946,
0.49314627051353455,
-0.2827945649623871,
-0.45477306842803955,
-0.5376628041267395,
0.23583221435546875,
-0.0921233668923378,
0.4757719039916992,
0.24980603158473969,
-0.06260724365711212,
0.14191113412380219,
-0.6277989745140076,
0.579861283302307... |
func newNodeSet(capacity int) *nodeSet {
head, tail := &doubleListNode{}, &doubleListNode{}
head.right, tail.left = tail, head
return &nodeSet{
capacity: capacity,
head: head,
tail: tail,
itemMap: make(map[*treeNode]*doubleListNode),
}
} | [
-0.5885262489318848,
-0.02861129678785801,
0.33827441930770874,
-0.6303485035896301,
-1.3189871311187744,
-0.7393394708633423,
0.47015777230262756,
-0.9563066363334656,
-0.6446257829666138,
0.255006343126297,
-0.7239393591880798,
0.8240128755569458,
0.29672327637672424,
0.28798410296440125... |
func (s *nodeSet) size() int {
return len(s.itemMap)
} | [
-1.2247086763381958,
0.6439640522003174,
0.16415241360664368,
-1.3555059432983398,
-0.4377796947956085,
-0.45308902859687805,
0.5252288579940796,
-0.6111940145492554,
-0.03929673135280609,
-0.47682100534439087,
-0.4145478904247284,
0.30709517002105713,
0.14585135877132416,
-0.2290261089801... |
func (s *nodeSet) cap() int {
return s.capacity
} | [
-0.7935740947723389,
0.41253721714019775,
0.38066115975379944,
-0.3296625316143036,
-0.7554148435592651,
-0.3846413195133209,
0.5614898800849915,
-0.6799045205116272,
-0.33308249711990356,
0.6053383946418762,
0.5544564127922058,
0.8011861443519592,
0.4985865652561188,
0.13579803705215454,
... |
func (s *nodeSet) resize(capacity int) {
for len(s.itemMap) > capacity {
delete(s.itemMap, removeTail(s.head, s.tail).val)
}
s.capacity = capacity
} | [
-0.7630573511123657,
0.6236985921859741,
0.5861454010009766,
-0.6979725956916809,
-0.3975158929824829,
-1.2353929281234741,
0.2817381024360657,
-0.21772338449954987,
-0.6587545871734619,
-0.2942087948322296,
-0.187588170170784,
0.13337138295173645,
0.11147904396057129,
-0.3036927580833435,... |
func (s *nodeSet) clear() {
s.head.right = s.tail
s.tail.left = s.head
s.itemMap = make(map[*treeNode]*doubleListNode)
} | [
-1.2353742122650146,
0.2178877741098404,
0.24123267829418182,
-0.759316086769104,
-0.9534989595413208,
0.3910354673862457,
0.10687143355607986,
-1.2134511470794678,
-0.355942040681839,
0.20579411089420319,
-0.4871898889541626,
1.3260586261749268,
1.1321752071380615,
0.8617518544197083,
-... |
func (s *nodeSet) has(tn *treeNode) bool {
nPtr, has := s.itemMap[tn]
if has {
moveToHead(s.head, nPtr)
}
return has
} | [
-0.7900723814964294,
0.292697548866272,
0.3448775112628937,
-0.9051356911659241,
-0.2737739384174347,
-0.41398876905441284,
-0.7765163779258728,
-0.5907339453697205,
-0.8775494694709778,
-0.1733335703611374,
-0.36589160561561584,
0.08339368551969528,
0.5906203389167786,
0.3269834816455841,... |
func (s *nodeSet) add(tn *treeNode) interface{} {
if nPtr, has := s.itemMap[tn]; has {
moveToHead(s.head, nPtr)
} else {
newNode := &doubleListNode{
val: tn,
left: nil,
right: nil,
}
s.itemMap[tn] = newNode
addToHead(s.head, newNode)
}
if len(s.itemMap) > s.capacity {
tail := removeTail(s.h... | [
-0.7623450756072998,
0.30657893419265747,
0.7442967295646667,
-0.9710404276847839,
-0.6772744059562683,
-0.27027463912963867,
0.0654083788394928,
-0.9180483222007751,
0.30923891067504883,
0.10880447924137115,
-0.41088923811912537,
0.3417656719684601,
0.1548524796962738,
0.4327305853366852,... |
func (s *nodeSet) remove(tn *treeNode) {
if nPtr, has := s.itemMap[tn]; has {
removeNode(nPtr)
delete(s.itemMap, tn)
}
} | [
-0.7009444236755371,
-0.1404726803302765,
0.15508726239204407,
-1.0892728567123413,
-0.6067159175872803,
-0.7805629372596741,
-0.25584664940834045,
0.2793460190296173,
-0.47156503796577454,
0.20868264138698578,
-0.14143751561641693,
-0.03438005596399307,
0.13885757327079773,
0.251743942499... |
func (s *nodeSet) all() []*treeNode {
all := make([]*treeNode, 0, len(s.itemMap))
p := s.head.right
for p != s.tail {
all = append(all, p.val)
p = p.right
}
return all
} | [
0.16382996737957,
-0.7702679634094238,
0.645412802696228,
0.19752655923366547,
0.3869732916355133,
0.4732367694377899,
-1.117051601409912,
0.08974604308605194,
-0.5228584408760071,
0.1271774172782898,
0.05236883834004402,
1.440068006515503,
-0.01060215849429369,
0.745381236076355,
-0.563... |
func moveToHead(head, node *doubleListNode) {
if node != nil {
removeNode(node)
addToHead(head, node)
}
} | [
-0.43242117762565613,
0.7641364932060242,
0.6623325943946838,
0.14677999913692474,
0.09968402236700058,
-0.6676025986671448,
0.3724589943885803,
0.013703553937375546,
0.8616424202919006,
1.408820390701294,
-1.0170738697052002,
1.0064550638198853,
0.14277635514736176,
0.21471233665943146,
... |
func removeNode(node *doubleListNode) {
node.right.left, node.left.right = node.left, node.right
} | [
-1.219892978668213,
0.9766114354133606,
0.45744451880455017,
-0.7554518580436707,
-0.3412087559700012,
0.7341762185096741,
0.37925323843955994,
0.8282437920570374,
0.09966859221458435,
0.7896389961242676,
-1.672727108001709,
-0.04465080052614212,
0.25249987840652466,
1.2792879343032837,
... |
func addToHead(head, node *doubleListNode) {
node.left, node.right = head, head.right
head.right.left, head.right = node, node
} | [
-0.8198494911193848,
0.5865929126739502,
0.6663405299186707,
-0.35752755403518677,
0.20483054220676422,
0.44743239879608154,
-0.19183482229709625,
-0.3607965409755707,
0.6365086436271667,
0.8346323370933533,
-1.0442663431167603,
0.836548388004303,
0.2825053930282593,
0.5532264709472656,
... |
func addToTail(tail, node *doubleListNode) {
node.right, node.left = tail, tail.left
tail.left.right, tail.left = node, node
} | [
-0.50064617395401,
0.6015489101409912,
0.7507191300392151,
-0.949553906917572,
0.20736604928970337,
0.716362714767456,
0.05292482301592827,
-0.13563799858093262,
0.12206999212503433,
0.37208235263824463,
-1.412308931350708,
1.4628087282180786,
0.015438082627952099,
1.1195012331008911,
0.... |
func removeTail(head, tail *doubleListNode) *doubleListNode {
if head.right != tail {
ret := tail.left
removeNode(tail.left)
return ret
}
return nil
} | [
-0.011965771205723286,
0.1601351499557495,
0.698333740234375,
0.2361132800579071,
-0.8146029114723206,
-0.00973565224558115,
0.01802675612270832,
-0.21637274324893951,
0.20418091118335724,
0.3596484065055847,
-1.4186862707138062,
1.3121079206466675,
-1.150422215461731,
0.7467665672302246,
... |
func moveToTail(tail, node *doubleListNode) {
if node != nil {
removeNode(node)
addToTail(tail, node)
}
} | [
0.04994022473692894,
0.6836863160133362,
0.614587128162384,
-0.4380455017089844,
0.03919551521539688,
-0.7399340867996216,
0.4134202301502228,
0.1772240847349167,
0.5067797303199768,
1.0294122695922852,
-1.389115333557129,
1.7373782396316528,
0.050062455236911774,
0.7299202084541321,
0.1... |
func TestFiles(t *testing.T) {
f, err := os.Open(".")
if err != nil {
t.Fatal(err)
}
names, err := f.Readdirnames(-1)
if err != nil {
t.Fatal(err)
}
for _, name := range names {
if !strings.HasSuffix(name, ".go") {
continue
}
b, err := os.ReadFile(name)
if err != nil {
t.Fatal(err)
}
// Che... | [
-0.03832045570015907,
0.9834997057914734,
0.8408876657485962,
0.356879860162735,
0.3442477285861969,
0.7004673480987549,
0.7479466795921326,
0.23069623112678528,
-0.7219110131263733,
0.41043806076049805,
0.2301035374403,
0.15064379572868347,
-0.6539175510406494,
-0.0015092323301360011,
-... |
func (s ReEncryptInput) String() string {
return awsutil.Prettify(s)
} | [
0.2920195758342743,
-0.23412854969501495,
0.10933279246091843,
-0.47972342371940613,
-0.5816828012466431,
0.5211676359176636,
0.8109261989593506,
-1.111313819885254,
-0.04351626709103584,
0.24159549176692963,
-0.4175599217414856,
1.169796347618103,
-0.28043267130851746,
-0.9670091867446899... |
func (s *ReEncryptInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "ReEncryptInput"}
if s.CiphertextBlob == nil {
invalidParams.Add(aws.NewErrParamRequired("CiphertextBlob"))
}
if s.CiphertextBlob != nil && len(s.CiphertextBlob) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("CiphertextB... | [
-0.6834164261817932,
0.1073252335190773,
0.5266384482383728,
0.005577511619776487,
-0.504863977432251,
-0.04553265869617462,
0.08879761397838593,
-0.3180343210697174,
-0.596532940864563,
0.4565703272819519,
-0.32460322976112366,
0.36918267607688904,
-1.2501224279403687,
0.4497174620628357,... |
func (s ReEncryptOutput) String() string {
return awsutil.Prettify(s)
} | [
0.637994110584259,
-0.4536476135253906,
0.18355703353881836,
-0.5044511556625366,
-0.5143803954124451,
-0.1803242415189743,
1.1006133556365967,
-0.7200379967689514,
-0.47002050280570984,
-0.046513110399246216,
0.008760287426412106,
0.940436601638794,
0.02239903062582016,
-1.259350776672363... |
func (r ReEncryptRequest) Send(ctx context.Context) (*ReEncryptResponse, error) {
r.Request.SetContext(ctx)
err := r.Request.Send()
if err != nil {
return nil, err
}
resp := &ReEncryptResponse{
ReEncryptOutput: r.Request.Data.(*ReEncryptOutput),
response: &aws.Response{Request: r.Request},
}
retur... | [
-1.2122126817703247,
-0.06723355501890182,
0.40313997864723206,
0.12854258716106415,
0.10058212280273438,
-0.8095217347145081,
-0.2362312525510788,
-1.1295078992843628,
0.015367856249213219,
0.26401376724243164,
-0.764239490032196,
0.8645745515823364,
-0.7172572612762451,
-0.50870501995086... |
func (r *ReEncryptResponse) SDKResponseMetdata() *aws.Response {
return r.response
} | [
-0.02869235910475254,
-0.12544240057468414,
0.25654518604278564,
-0.024356616660952568,
-0.3335409164428711,
0.040791697800159454,
-0.44014251232147217,
-0.8851041197776794,
0.8141761422157288,
0.3123793601989746,
-0.8166603446006775,
0.43115195631980896,
-0.5351139903068542,
-1.5288850069... |
func CreateLegacyDatasetLanding(ctx context.Context, req *http.Request, dlp zebedee.DatasetLandingPage, bcs []zebedee.Breadcrumb, ds []zebedee.Dataset, localeCode string) StaticDatasetLandingPage {
var sdlp StaticDatasetLandingPage
MapCookiePreferences(req, &sdlp.CookiesPreferencesSet, &sdlp.CookiesPolicy)
// Pre... | [
-0.13342568278312683,
0.22835850715637207,
0.5836488604545593,
-0.9876394867897034,
-0.225289449095726,
0.23980498313903809,
-0.21736200153827667,
0.6850261092185974,
0.5633938312530518,
-0.040680382400751114,
0.44638124108314514,
0.262157142162323,
0.22396798431873322,
0.28959548473358154... |
func isValidCEXName(_ *validator.Validate, _ reflect.Value, _ reflect.Value,
field reflect.Value, _ reflect.Type, _ reflect.Kind, _ string) bool {
cexNameInput := strings.ToLower(field.String())
return common.IsValidCEXName(cexNameInput)
} | [
-0.5342286825180054,
-0.82755446434021,
0.4052174389362335,
0.030979616567492485,
-0.8425114154815674,
0.4530244767665863,
-0.14071135222911835,
-0.24303722381591797,
-0.18897861242294312,
0.0608474537730217,
-0.8110483288764954,
-0.4272844195365906,
-0.7575784921646118,
0.5987964272499084... |
func (c *Client) GetPolicyDocument(input *PolicyDocumentInput) (*PolicyDocument, error) {
var policyDocument PolicyDocument
var inputBody map[string]interface{} = make(map[string]interface{})
if input.ActionsForServices != nil {
if input.ActionsForServices.Read != nil && len(input.ActionsForServices.Read) > 0 {
... | [
-0.3595011234283447,
-0.4921446740627289,
0.8277847170829773,
-0.8972721099853516,
-0.39303284883499146,
0.27614906430244446,
0.800951361656189,
-0.383378267288208,
0.7153279185295105,
-0.2649565637111664,
0.1500239372253418,
0.7179734706878662,
-0.8505973219871521,
0.5534274578094482,
0... |
func (c *Client) GetPolicyDocumentJsonString(input *PolicyDocumentInput) (string, error) {
policyDocument, err := c.GetPolicyDocument(input)
if err != nil {
return "", err
}
jsonDoc, err := json.Marshal(policyDocument)
if err != nil {
return "", err
}
jsonString := string(jsonDoc)
return jsonString, err... | [
-0.4381583034992218,
-0.4872099757194519,
0.39899545907974243,
-0.7480981349945068,
-1.0848445892333984,
0.8430525064468384,
-0.17306329309940338,
-1.1968742609024048,
0.449746698141098,
0.3662688434123993,
0.12993454933166504,
0.9727455377578735,
-0.7341806292533875,
0.05854671820998192,
... |
func getListenerPredicate() predicate.Predicate {
return predicate.Funcs{
UpdateFunc: func(e event.UpdateEvent) bool {
newListener, okNew := e.ObjectNew.(*networkextensionv1.Listener)
oldListener, okOld := e.ObjectOld.(*networkextensionv1.Listener)
if !okNew || !okOld {
return false
}
if newListen... | [
0.1750180572271347,
-1.1001967191696167,
0.9081892967224121,
-0.30980297923088074,
-0.6308742761611938,
1.1680841445922852,
-0.47398239374160767,
0.1619061827659607,
0.1668870449066162,
0.4671902358531952,
-0.11277379095554352,
-0.110289566218853,
-0.5985808372497559,
0.43928980827331543,
... |
func AddTFeedbackAction(m *TFeedbackAction) (id int64, err error) {
o := orm.NewOrm()
id, err = o.Insert(m)
return
} | [
-0.4557896554470062,
0.39076781272888184,
0.7315724492073059,
-0.19971688091754913,
0.6369226574897766,
-0.2673998773097992,
1.9030358791351318,
-0.8061876893043518,
0.18957985937595367,
0.29328903555870056,
-0.7269775867462158,
-0.6969251036643982,
-0.6610559821128845,
0.5365481376647949,... |
func GetTFeedbackActionById(id int) (v *TFeedbackAction, err error) {
o := orm.NewOrm()
v = &TFeedbackAction{Id: id}
if err = o.Read(v); err == nil {
return v, nil
}
return nil, err
} | [
-0.1589086502790451,
-0.10431835055351257,
0.11347141116857529,
-0.35417085886001587,
0.5158341526985168,
-0.8568480014801025,
1.3592755794525146,
-1.5686250925064087,
-0.014761350117623806,
0.7681137919425964,
-0.6133600473403931,
0.22939614951610565,
-0.630246102809906,
0.507490813732147... |
func GetAllTFeedbackAction(query map[string]string, fields []string, sortby []string, order []string,
offset int64, limit int64) (ml []interface{}, err error) {
o := orm.NewOrm()
qs := o.QueryTable(new(TFeedbackAction))
// query k=v
for k, v := range query {
// rewrite dot-notation to Object__Attribute
k = str... | [
-0.2392120361328125,
-0.1798800826072693,
1.0565667152404785,
0.3548542857170105,
0.12297507375478745,
-0.5108857154846191,
0.4168601632118225,
-0.9389649033546448,
0.2552236318588257,
0.4637690484523773,
0.2867966890335083,
0.048679202795028687,
-0.07306661456823349,
0.7884719371795654,
... |
func UpdateTFeedbackActionById(m *TFeedbackAction) (err error) {
o := orm.NewOrm()
v := TFeedbackAction{Id: m.Id}
// ascertain id exists in the database
if err = o.Read(&v); err == nil {
var num int64
if num, err = o.Update(m); err == nil {
fmt.Println("Number of records updated in database:", num)
}
}
r... | [
-0.6080759167671204,
-0.8583903908729553,
0.5392928123474121,
-0.3513864576816559,
0.38942787051200867,
-0.5389989018440247,
1.353851556777954,
-0.6194934248924255,
0.21567581593990326,
0.9715861678123474,
-0.9925533533096313,
0.009045151062309742,
-0.7465751767158508,
0.6070645451545715,
... |
func DeleteTFeedbackAction(id int) (err error) {
o := orm.NewOrm()
v := TFeedbackAction{Id: id}
// ascertain id exists in the database
if err = o.Read(&v); err == nil {
var num int64
if num, err = o.Delete(&TFeedbackAction{Id: id}); err == nil {
fmt.Println("Number of records deleted in database:", num)
}
... | [
0.11068478971719742,
-0.266732394695282,
0.6266902685165405,
-0.3026518225669861,
0.7335079908370972,
-0.45268338918685913,
1.5838218927383423,
-0.3320126533508301,
0.5558462142944336,
0.2882089614868164,
-0.6830429434776306,
0.07855796813964844,
-0.6740228533744812,
0.9680162072181702,
... |
func NewOutput(value *Thunk) *Thunk {
return Normal(OutputType{value})
} | [
-0.8087010979652405,
0.04481753706932068,
0.08551745116710663,
0.682543933391571,
-1.7149715423583984,
-0.6703846454620361,
0.44553565979003906,
-0.5049211978912354,
-0.29581552743911743,
0.5864636898040771,
0.21801194548606873,
-0.5884596109390259,
-0.036798227578401566,
0.163236781954765... |
func convertToUser(row *sql.Row) (*User, error) {
user := User{}
err := row.Scan(&user.UserID, &user.Mail, &user.Password)
if err != nil {
return nil, fmt.Errorf("model.convertToUser: %w", err)
}
return &user, nil
} | [
-1.206889271736145,
0.11526242643594742,
0.3398191034793854,
-0.25377562642097473,
-0.13951654732227325,
-0.3260434865951538,
0.2977616786956787,
-0.8279770612716675,
0.5931072235107422,
-0.4020535349845886,
-0.6100998520851135,
-0.3255477249622345,
0.26434507966041565,
-0.3449886739253998... |
func (m *LookmlTestResult) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateErrors(formats); err != nil {
res = append(res, err)
}
if err := m.validateWarnings(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
... | [
0.7132962942123413,
-0.313221275806427,
0.22752292454242706,
-1.0282018184661865,
-0.1859571933746338,
-0.18293496966362,
0.010685743764042854,
-0.579758882522583,
-0.28427204489707947,
-0.05586816370487213,
-0.06329023092985153,
0.14962367713451385,
-1.029915690422058,
0.6390307545661926,... |
func (r *Router) getFromCache(confHash string, items []url_item.Item) *getFromCacheResult {
result := &getFromCacheResult{
report: map[tester.Key]tester.Item{},
}
for _, item := range items {
key := tester.Key{
Host: item.Host,
URL: item.Url,
}
existItem, ok := r.options.Cache.Get(confHash, key)
i... | [
-0.14526331424713135,
-0.250977098941803,
0.62599778175354,
0.4179951250553131,
0.2701819837093353,
-0.37346208095550537,
0.017995400354266167,
0.310981810092926,
-0.49108561873435974,
0.6466856002807617,
-0.3227153420448303,
-0.09045258164405823,
-0.7850809097290039,
0.5148837566375732,
... |
func (r *Router) testerConfiguration(req *http.Request) tester.Configuration {
tConf := tester.DefaultConfiguration()
if r.options.Cfg.LoadTest.MaxIdleConnPerHost > 0 {
tConf.MaxIdleConnPerHost = r.options.Cfg.LoadTest.MaxIdleConnPerHost
}
if r.options.Cfg.LoadTest.Timeout > 0 {
tConf.Timeout = time.Duration(... | [
-0.2437276542186737,
-0.9402633309364319,
0.8547955751419067,
-0.24893313646316528,
-0.39900609850883484,
-0.46553710103034973,
0.762274444103241,
-0.2713598310947418,
0.12640787661075592,
0.4628155529499054,
-0.4959302842617035,
-0.8439961671829224,
-0.8092888593673706,
1.1166538000106812... |
func (list List) String() string {
builder := strings.Builder{}
for _, t := range list {
builder.WriteString(t.String())
}
return builder.String()
} | [
-0.466219425201416,
-0.4540977478027344,
-0.2319609820842743,
-0.3566303253173828,
0.3202059864997864,
0.5982405543327332,
0.01654145121574402,
-0.04122410714626312,
0.056871041655540466,
-0.19732794165611267,
-0.8067830801010132,
-0.13024398684501648,
0.19970159232616425,
0.91326665878295... |
func (_m *Receiver) Receive() {
_m.Called()
} | [
-0.7865157723426819,
0.10874006897211075,
0.2415018081665039,
0.5034031271934509,
0.4849172830581665,
-0.08202902972698212,
0.8625367879867554,
0.8319072127342224,
-0.42942920327186584,
-0.18078865110874176,
-0.30634111166000366,
0.22191062569618225,
0.6818643808364868,
0.2793217599391937,... |
func (p *pipe) Read(b []byte) (int, error) {
if p.msgRemainder != nil {
n := copy(b, p.msgRemainder)
if len(p.msgRemainder) > n {
tmpBuf := make([]byte, len(p.msgRemainder)-n)
copy(tmpBuf, p.msgRemainder[n:])
p.msgRemainder = tmpBuf
} else {
p.msgRemainder = nil
}
return n, nil
}
select {
ca... | [
-0.37182459235191345,
0.19357866048812866,
0.7775956392288208,
-0.5032475590705872,
-0.18517397344112396,
-0.25538524985313416,
0.3506675660610199,
-0.5435547828674316,
-0.2419324368238449,
0.10070548951625824,
0.5274580717086792,
1.1069945096969604,
-1.1300883293151855,
0.7399023771286011... |
func (p *pipe) Write(b []byte) (int, error) {
msg := msg{
data: make([]byte, len(b)),
err: nil,
}
// Create copy of b in case it is modified externally.
copy(msg.data, b)
select {
case p.otherEnd.ch <- msg: // Sent msg to the other side's Read function.
return len(msg.data), msg.err
case <-p.ctx.Done():... | [
-1.0052075386047363,
0.633540153503418,
0.7956933975219727,
-0.4916335940361023,
0.4860496520996094,
-0.31608840823173523,
0.43765684962272644,
0.0630410686135292,
-0.47726136445999146,
0.5786842107772827,
-0.3702821135520935,
0.4309445023536682,
-0.9708992838859558,
0.8794538974761963,
... |
func (p *pipe) Close() error {
msg := msg{
data: nil,
err: io.EOF, // Indicates to the other side's Read function that session has ended.
}
select {
case p.otherEnd.ch <- msg: // Sent msg to the other side's Read function.
return nil
case <-p.ctx.Done():
return p.ctx.Err()
}
} | [
-0.2639308571815491,
-0.2643349766731262,
0.8284141421318054,
-0.7903618812561035,
-0.06991622596979141,
0.026884768158197403,
0.13742677867412567,
-1.3806538581848145,
-0.7769811153411865,
-0.15266628563404083,
0.7921879291534424,
0.13839754462242126,
-0.9269792437553406,
0.13322047889232... |
func NewPipePair(ctx context.Context) (io.ReadWriteCloser, io.ReadWriteCloser) {
aEnd := &pipe{
ch: make(chan msg, bufferSize),
ctx: ctx,
}
bEnd := &pipe{
ch: make(chan msg, bufferSize),
ctx: ctx,
}
aEnd.otherEnd = bEnd
bEnd.otherEnd = aEnd
return aEnd, bEnd
} | [
-0.508501410484314,
-0.9068983793258667,
0.86244136095047,
-0.9799917936325073,
-0.26472029089927673,
-0.06293613463640213,
-0.38229063153266907,
-0.212210550904274,
-0.06387923657894135,
0.029501257464289665,
0.38075515627861023,
0.8292791247367859,
-1.2296981811523438,
1.1910486221313477... |
func NewGetFlowOK() *GetFlowOK {
return &GetFlowOK{}
} | [
0.7996671795845032,
-0.5887467861175537,
0.054137106984853745,
1.1811538934707642,
0.01841186173260212,
-0.14584167301654816,
0.9215189814567566,
0.26073211431503296,
0.23587694764137268,
-0.30183541774749756,
-0.8125960826873779,
0.09869176149368286,
0.34695708751678467,
0.101235061883926... |
func (o *GetFlowOK) WithPayload(payload *GetFlowOKBody) *GetFlowOK {
o.Payload = payload
return o
} | [
1.0072977542877197,
-0.26672282814979553,
0.026880137622356415,
0.7002273797988892,
-0.0217792559415102,
-0.5362532734870911,
0.2669018805027008,
-0.07307781279087067,
0.9321534633636475,
-0.7858426570892334,
-0.015579303726553917,
-0.5453111529350281,
0.6517700552940369,
-0.13308624923229... |
func (o *GetFlowOK) SetPayload(payload *GetFlowOKBody) {
o.Payload = payload
} | [
0.6135817170143127,
-0.013188990764319897,
0.06406939774751663,
0.7490041255950928,
0.19676107168197632,
-0.36595889925956726,
0.3162592947483063,
-0.06698600947856903,
0.8610619902610779,
-0.652157723903656,
-0.34396591782569885,
-0.15278199315071106,
-0.06593617796897888,
0.2250564843416... |
func (o *GetFlowOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(200)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
} | [
-0.06896954029798508,
-0.44244158267974854,
0.3153901696205139,
0.5505203008651733,
1.021168828010559,
-0.9175429940223694,
0.5648882985115051,
0.19241540133953094,
0.8046606183052063,
0.16347983479499817,
0.02778797782957554,
-0.6374276876449585,
-0.5528483390808105,
-0.44379401206970215,... |
func NewGetFlowMethodNotAllowed() *GetFlowMethodNotAllowed {
return &GetFlowMethodNotAllowed{}
} | [
0.9092500805854797,
-0.16855469346046448,
0.4028410315513611,
1.5492801666259766,
-0.8590165376663208,
-0.3674681484699249,
1.0827161073684692,
-0.6900306940078735,
-0.2103082537651062,
-0.5877745747566223,
1.0885660648345947,
0.7556986212730408,
-0.5928557515144348,
-0.7066749930381775,
... |
func (o *GetFlowMethodNotAllowed) WithPayload(payload *GetFlowMethodNotAllowedBody) *GetFlowMethodNotAllowed {
o.Payload = payload
return o
} | [
0.9258592128753662,
0.45084765553474426,
0.3588494062423706,
0.8621180653572083,
-0.6736249923706055,
-0.3963072597980499,
0.45246097445487976,
-1.2006295919418335,
0.5995911955833435,
-1.0556612014770508,
1.1096060276031494,
0.08601861447095871,
-0.16012504696846008,
-0.27420204877853394,... |
func (o *GetFlowMethodNotAllowed) SetPayload(payload *GetFlowMethodNotAllowedBody) {
o.Payload = payload
} | [
0.5036419630050659,
0.6948104500770569,
0.18504978716373444,
0.8524798154830933,
-0.40675920248031616,
-0.1447848379611969,
0.5784486532211304,
-1.089448094367981,
0.30582430958747864,
-0.8195548057556152,
0.7261748909950256,
0.3912496268749237,
-0.6473547220230103,
0.07564184069633484,
... |
func (o *GetFlowMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(405)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
} | [
0.19815225899219513,
0.33325886726379395,
0.4136432707309723,
0.8084409832954407,
0.4999169409275055,
-0.5708128213882446,
0.8845522403717041,
-0.7992314100265503,
0.328435480594635,
0.09791243076324463,
0.8720167279243469,
-0.04734896123409271,
-0.7599747180938721,
-0.40126484632492065,
... |
func (o *GetFlowInternalServerError) WithPayload(payload *GetFlowInternalServerErrorBody) *GetFlowInternalServerError {
o.Payload = payload
return o
} | [
-0.03315908834338188,
-0.19016392529010773,
0.3751508593559265,
-0.5870481729507446,
-0.2855529487133026,
-0.4908626973628998,
0.19336584210395813,
-0.46437492966651917,
0.8472887873649597,
-1.471619963645935,
0.40671664476394653,
0.7492038011550903,
-0.5928099751472473,
-0.063775770366191... |
func (o *GetFlowInternalServerError) SetPayload(payload *GetFlowInternalServerErrorBody) {
o.Payload = payload
} | [
-0.3967883884906769,
0.021461347118020058,
0.2724410891532898,
-0.3523038327693939,
-0.09472522139549255,
-0.497183233499527,
0.29674211144447327,
-0.11120723932981491,
0.5569339394569397,
-0.9800207018852234,
0.1754436492919922,
1.195960521697998,
-1.0022262334823608,
0.23848970234394073,... |
func (o *GetFlowInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(500)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
} | [
-0.7049322128295898,
-0.2523958086967468,
0.33451858162879944,
0.281654417514801,
0.7555657029151917,
-0.6838856935501099,
0.6128867268562317,
0.06406726688146591,
0.7737522125244141,
-0.16342957317829132,
0.46980369091033936,
0.197698712348938,
-0.9451665878295898,
-0.1716744303703308,
... |
func fibonacci() func() int {
x, y := 0, 1
i := 0
return func() int{
if i!=0{
x, y = y, x+y
}
i++
return x
}
} | [
0.21485234797000885,
-0.21652869880199432,
0.31589949131011963,
0.6021168828010559,
0.6009525656700134,
-0.6148316860198975,
0.9434981942176819,
-0.1880057454109192,
-0.2622520327568054,
-0.6068636178970337,
-0.5172288417816162,
0.0015225496608763933,
0.6954238414764404,
-0.402795404195785... |
func (gg *galleryGorm) ByID(id uint) (*Gallery, error) {
var gallery Gallery
db := gg.db.Where("id = ?", id)
err := first(db, &gallery)
if err != nil {
return nil, err
}
return &gallery, nil
} | [
0.7138592600822449,
-0.1190408319234848,
0.24198435246944427,
-0.7638887166976929,
0.29301369190216064,
-0.435556560754776,
0.7065520882606506,
-0.061543919146060944,
0.3229380249977112,
0.6018109321594238,
-0.48004063963890076,
0.7306699752807617,
-0.3505641222000122,
0.3274124264717102,
... |
func (gv *galleryValidator) nonZeroID(gallery *Gallery) error {
if gallery.ID <= 0 {
return ErrIDInvalid
}
return nil
} | [
-0.38474923372268677,
-0.9551485180854797,
0.1265522986650467,
0.20206275582313538,
-0.20690007507801056,
0.5580657124519348,
-0.25651443004608154,
0.12357385456562042,
0.27364489436149597,
-0.12557776272296906,
0.37408244609832764,
0.3929123878479004,
-0.33622997999191284,
1.8529123067855... |
func DropboxContentHash(ctx context.Context, reader io.Reader) (string, error) {
if ctx.Err() != nil {
return "", ctx.Err()
}
buf := make([]byte, hashBlockSize)
resultHash := sha256.New()
numReadBytes, err := reader.Read(buf)
if err != nil && err != io.EOF {
return "", err
}
if numReadBytes > 0 {
bufHash ... | [
0.3443274199962616,
-0.4321993589401245,
1.1391677856445312,
-0.555044949054718,
-0.48839130997657776,
-0.06798691302537918,
-0.048155929893255234,
-0.4052962064743042,
0.3366270959377289,
0.11867262423038483,
0.200831338763237,
-0.21895529329776764,
-0.0003353141655679792,
-0.162067294120... |
func (l *LogReader) Refresh() *[][]string {
file, err := l.openLogFile()
if err != nil {
return &[][]string{}
}
defer file.Close()
data, offset := readLogFileFromOffsetUp(file, l.config.Seperator, l.Capacity, l.currentOffset[l.FileIndex] + l.Capacity)
l.currentOffset[l.FileIndex] = offset
return data
} | [
0.18224699795246124,
-1.2693208456039429,
0.5969078540802002,
-0.799034833908081,
-0.7635183930397034,
0.3538210988044739,
-0.5597875118255615,
-0.6428048014640808,
-0.5965697169303894,
0.3796312212944031,
0.6428517699241638,
0.2420765906572342,
-0.03840731829404831,
-0.6120933294296265,
... |
func (l *LogReader) Tail() *[][]string {
fileInfo, err := os.Stat(l.config.Files[l.FileIndex].LogFile)
if err != nil {
return &[][]string{}
}
//Check if any changes happened to the file, otherwise return last page
if l.previousReadFileInfo != nil &&
fileInfo.Size() == l.previousReadFileInfo.Size() &&
fileInf... | [
-0.08832982927560806,
-1.1079621315002441,
1.0272223949432373,
-1.1413257122039795,
-0.021158479154109955,
0.04338179901242256,
-0.2727147042751312,
-0.6222305297851562,
-0.1536998301744461,
-0.008935595862567425,
1.0339667797088623,
0.3277878165245056,
-0.36417651176452637,
0.110897526144... |
func (l *LogReader) Head() *[][]string {
file, err := l.openLogFile()
if err != nil {
return &[][]string{}
}
defer file.Close()
data, offset, _ := head(file, l.Capacity, 0)
rows := [][]string{}
for _, line := range data {
rows = append(rows, parseLine(line, l.config.Seperator))
}
l.currentOffset[l.FileInd... | [
-0.03891267254948616,
-1.0110334157943726,
0.7863853573799133,
-0.4648151695728302,
-0.5521243810653687,
0.6876393556594849,
-0.3205830454826355,
0.01135251671075821,
0.0006555179716087878,
0.4457574486732483,
1.0168670415878296,
0.3463476002216339,
-0.24711762368679047,
-0.465366959571838... |
func (l *LogReader) PageUp() *[][]string {
file, err := l.openLogFile()
if err != nil {
return &[][]string{}
}
defer file.Close()
data, offset := readLogFileFromOffsetUp(file, l.config.Seperator, l.Capacity, l.currentOffset[l.FileIndex])
l.currentOffset[l.FileIndex] = offset
return data
} | [
-0.5167511701583862,
-0.6317648887634277,
0.7542642951011658,
-1.3163453340530396,
-0.7134332656860352,
0.581632137298584,
0.01974736899137497,
0.1489170640707016,
-0.1084558442234993,
1.2062891721725464,
1.0002132654190063,
0.18896789848804474,
-0.33693811297416687,
-0.736893892288208,
... |
func (l *LogReader) PageDown() *[][]string {
file, err := l.openLogFile()
if err != nil {
return &[][]string{}
}
defer file.Close()
data, offset := readLogFileFromOffsetDown(file, l.config.Seperator, l.Capacity, l.currentOffset[l.FileIndex])
l.currentOffset[l.FileIndex] = offset
return data
} | [
0.44166961312294006,
-1.0028350353240967,
0.8901909589767456,
-0.7807866930961609,
-0.5441407561302185,
1.013542652130127,
0.024273591116070747,
-0.11602570116519928,
-0.1482061743736267,
0.4630451798439026,
1.3102262020111084,
-0.083753302693367,
-0.9021269679069519,
0.13542920351028442,
... |
func (l *LogReader) Up() *[][]string {
file, err := l.openLogFile()
if err != nil {
return &[][]string{}
}
defer file.Close()
lastLine, _, _ := lastLine(file, l.Capacity, l.currentOffset[l.FileIndex])
lastPosition := tailStartPosition(file, l.Capacity, l.currentOffset[l.FileIndex]-len(lastLine))
if lastPositi... | [
-0.40330344438552856,
-0.8994909524917603,
0.9733407497406006,
-1.0466809272766113,
-0.5777648687362671,
0.3448355793952942,
0.256723552942276,
-0.1989264339208603,
-0.4296920597553253,
0.481654554605484,
0.538349449634552,
0.45574504137039185,
-0.3052826523780823,
-0.8764227032661438,
0... |
func (l *LogReader) Down() *[][]string {
file, err := l.openLogFile()
if err != nil {
return &[][]string{}
}
defer file.Close()
nextLine, _, _ := nextLine(file, l.currentOffset[l.FileIndex])
data, offset := readLogFileFromOffsetDown(file, l.config.Seperator, l.Capacity, tailStartPosition(file, l.Capacity, l.cu... | [
0.2640402913093567,
-0.9525928497314453,
0.9927815198898315,
-0.8060007691383362,
-0.6749960780143738,
0.9269978404045105,
0.2602933347225189,
-0.06939542293548584,
-0.4040030241012573,
-0.36935049295425415,
0.6539313197135925,
0.5614411234855652,
-0.7401514053344727,
-0.16670763492584229,... |
func (l *LogReader) Search(searchTerm string, currentLocation int) (*[][]string, int) {
file, err := l.openLogFile()
if err != nil {
return &[][]string{}, 0
}
defer file.Close()
searchOffset := l.currentOffset[l.FileIndex] + currentLocation + 1
location := searchFileForTerm(file, searchTerm, searchOffset)
if ... | [
-0.6449555158615112,
-0.9013210535049438,
0.7186176776885986,
-0.7179961204528809,
-0.6607449650764465,
0.18218016624450684,
0.8553235530853271,
0.34308722615242004,
-0.8882386684417725,
0.3803640305995941,
0.5084227919578552,
-0.11614949256181717,
-0.6581093668937683,
-0.5868666768074036,... |
func parseLine(line string, delim string) []string {
if line == "" {
return []string{}
}
columns := strings.Split(line, delim)
var columnValues []string
for _, col := range columns {
columnValues = append(columnValues, col)
}
return columnValues
} | [
0.5299898982048035,
0.11457564681768417,
0.6064510345458984,
0.7648133039474487,
0.11888077110052109,
-0.47562819719314575,
-1.4211604595184326,
0.9298667311668396,
-0.6433409452438354,
-0.11145667731761932,
-0.621869683265686,
0.3125704228878021,
0.026170462369918823,
-0.48967018723487854... |
func (l LogReader) GetHeaders() []string {
headers := make([]string, len(l.config.Headers))
for index, header := range l.config.Headers {
headers[index] = header.Header
}
return headers
} | [
-0.3563491106033325,
-0.5660675764083862,
0.5567532181739807,
0.00930993352085352,
0.5764896273612976,
-0.03476903215050697,
-1.169980525970459,
-0.4862353503704071,
0.15757593512535095,
0.08287271112203598,
0.20771752297878265,
0.0986364483833313,
-0.8567104339599609,
-0.03766416013240814... |
func (l LogReader) GetColumnSizes() []int {
sizes := make([]int, len(l.config.Headers))
for index, header := range l.config.Headers {
sizes[index] = header.Size
}
return sizes
} | [
-0.30886200070381165,
-0.02593749389052391,
0.7603235840797424,
-0.2965750992298126,
0.2871142029762268,
-0.6009722352027893,
-0.11262097954750061,
-0.025668339803814888,
-0.7266534566879272,
-0.10361427813768387,
-1.1126505136489868,
-0.19713373482227325,
-0.6764959692955017,
0.4328847229... |
func (l *LogReader) SetCapacity(capacity int) {
l.Capacity = capacity
} | [
0.2621573805809021,
-0.9139323234558105,
0.3693529963493347,
0.28656089305877686,
-0.24295227229595184,
0.0686703622341156,
0.827643871307373,
0.28986018896102905,
-0.21911101043224335,
0.031099271029233932,
0.0606805682182312,
-0.1382184624671936,
0.133467897772789,
0.5250025987625122,
... |
func (l *LogReader) CurrentOffset() int {
return l.currentOffset[l.FileIndex]
} | [
-0.16450943052768707,
-1.3224661350250244,
0.3732832074165344,
-0.8480194807052612,
-0.6482082009315491,
0.8026629090309143,
1.0321390628814697,
0.1480100452899933,
-1.0654122829437256,
0.1300729364156723,
1.0505414009094238,
0.44578006863594055,
-0.4935728907585144,
-0.2566676735877991,
... |
func readLogFileFromOffsetUp(file *os.File, delim string, capacity int, offset int) (*[][]string, int) {
data, newOffset, _ := tail(file, capacity, tailStartPosition(file, capacity, offset))
rows := [][]string{}
if len(data) == 0 {
return &rows, 0
}
for _, line := range data {
rows = append(rows, parseLine(lin... | [
0.027945898473262787,
-0.5105589032173157,
0.772049069404602,
-0.7210933566093445,
-1.2154827117919922,
-0.19570331275463104,
-0.3419901430606842,
0.39226555824279785,
-1.308348536491394,
0.770140528678894,
0.33477312326431274,
0.13503235578536987,
0.34431135654449463,
-0.9568372368812561,... |
func readLogFileFromOffsetDown(file *os.File, delim string, capacity int, offset int) (*[][]string, int) {
fileInfo, _ := file.Stat()
data, newOffset, _ := head(file, capacity, offset)
if newOffset >= int(fileInfo.Size()) {
data, newOffset, _ = tail(file, capacity, -1)
}
rows := [][]string{}
if len(data) == 0 ... | [
0.5713614225387573,
-0.8354368805885315,
0.9323925971984863,
-0.2878400385379791,
-1.2649471759796143,
0.2992301881313324,
-0.25877645611763,
0.1826745569705963,
-1.0744264125823975,
0.27209484577178955,
0.5476973652839661,
0.013507724739611149,
-0.06364486366510391,
-0.42473748326301575,
... |
func (r *Runner) sampleHammingRegion(center *permutation, dist int, done chan<- *runResult) {
var bestPerm *permutation
bestScore := math.Inf(1)
// Determine a reasonable sample size
n := len(center.Seq)
size := (n * (n - 1) / 2) * dist * dist
scores := make([]float64, size)
for i := 0; i < size; i++ {
neigh... | [
0.31268811225891113,
-0.344142884016037,
0.6782246232032776,
-0.0106327123939991,
-1.067272424697876,
0.13748547434806824,
0.24091315269470215,
0.04367316514253616,
0.8660211563110352,
0.8039493560791016,
-0.14291836321353912,
0.6778498291969299,
-0.4005667567253113,
0.39520302414894104,
... |
func (r *Runner) interpret(rs *runResult, done chan<- *Result) {
// If the solution is optimal, then we're done!
if rs.Opt {
logger.Println("Found optimal solution score: ", rs.Score)
done <- &Result{
Score: rs.Score,
Perm: rs.Perm.Seq,
}
return
}
// logger.Println("Variance: ", rs.Var)
// If vari... | [
-0.3616008460521698,
-0.08687155693769455,
0.5654642581939697,
-0.24947801232337952,
-0.1439560353755951,
-0.1274675726890564,
0.23675550520420074,
0.33030781149864197,
0.04620106890797615,
0.2624961733818054,
-0.18577957153320312,
0.05724262446165085,
-0.8562933802604675,
0.54504787921905... |
func UnmarshalConfig(data []byte) (*cb.Config, error) {
config := &cb.Config{}
err := proto.Unmarshal(data, config)
if err != nil {
return nil, err
}
return config, nil
} | [
0.7799336314201355,
0.6992124915122986,
0.8048483729362488,
-0.25886476039886475,
-0.9746580719947815,
-0.0569976270198822,
-0.33540380001068115,
0.6857556700706482,
-0.05979509279131889,
0.5473917126655579,
-0.4895429015159607,
-0.3055211007595062,
-0.6221596598625183,
0.7365014553070068,... |
func UnmarshalConfigOrPanic(data []byte) *cb.Config {
result, err := UnmarshalConfig(data)
if err != nil {
panic(err)
}
return result
} | [
0.7401334643363953,
0.4267594814300537,
0.46440526843070984,
-0.40987494587898254,
-1.170023798942566,
0.2290574312210083,
-0.20019517838954926,
0.21629247069358826,
-0.5416437387466431,
1.0037915706634521,
0.025145595893263817,
-0.513187050819397,
-0.1679748147726059,
-0.26499050855636597... |
func UnmarshalConfigUpdate(data []byte) (*cb.ConfigUpdate, error) {
configUpdate := &cb.ConfigUpdate{}
err := proto.Unmarshal(data, configUpdate)
if err != nil {
return nil, err
}
return configUpdate, nil
} | [
-0.4557631015777588,
-0.35927507281303406,
0.39581534266471863,
-0.2614363729953766,
-1.3619318008422852,
-0.49316340684890747,
-0.5264443159103394,
0.7820590734481812,
-0.10001246631145477,
0.8742455244064331,
-0.30200108885765076,
-0.6957888007164001,
-1.1462523937225342,
0.2355176061391... |
func UnmarshalConfigUpdateOrPanic(data []byte) *cb.ConfigUpdate {
result, err := UnmarshalConfigUpdate(data)
if err != nil {
panic(err)
}
return result
} | [
0.26385676860809326,
-0.37961745262145996,
0.3967621624469757,
0.07137010246515274,
-1.203952670097351,
0.2616174817085266,
-0.47128042578697205,
0.2931138277053833,
0.19790849089622498,
0.8207218647003174,
0.3646732568740845,
-0.6139039993286133,
-0.5593494176864624,
-0.25323620438575745,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.