text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (b *BlockProcessorQueue) Latest(num uint64) bool {
resp := make(chan bool)
udt := Update{BlockNumber: num, ResponseChan: resp}
b.LatestChan <- udt
return <-resp
} | [
-0.7999635338783264,
0.01634911820292473,
0.6196157932281494,
-1.023999810218811,
0.013877641409635544,
-0.3215252459049225,
-0.05261210352182388,
-0.8122519850730896,
-0.5004134178161621,
0.19442488253116608,
-0.6800703406333923,
0.20795467495918274,
-0.6943163275718689,
-0.00683304434642... |
func (b *BlockProcessorQueue) UnconfirmedNext() (uint64, bool) {
resp := make(chan struct {
Status bool
Number uint64
})
req := Next{ResponseChan: resp}
b.UnconfirmedNextChan <- req
v := <-resp
return v.Number, v.Status
} | [
-0.5957627296447754,
0.2623673975467682,
0.6914322376251221,
-0.07503724098205566,
-0.4311460256576538,
-0.6999244689941406,
-0.3394049108028412,
0.530227780342102,
-0.5701934099197388,
-0.5529301762580872,
-1.194262981414795,
0.5738826990127563,
-0.13962802290916443,
1.2048300504684448,
... |
func (b *BlockProcessorQueue) ConfirmedNext() (uint64, bool) {
resp := make(chan struct {
Status bool
Number uint64
})
req := Next{ResponseChan: resp}
b.ConfirmedNextChan <- req
v := <-resp
return v.Number, v.Status
} | [
-0.6117621064186096,
0.2634681463241577,
0.6950526833534241,
0.6257102489471436,
-0.38734936714172363,
-0.5495673418045044,
-0.558542788028717,
-0.1304420828819275,
-0.2814323306083679,
0.22250518202781677,
-1.6040809154510498,
0.5272120833396912,
-0.5690773725509644,
1.190686583518982,
... |
func (b *BlockProcessorQueue) CanBeConfirmed(num uint64) bool {
if b.LatestBlock < config.GetBlockConfirmations() {
return false
}
return b.LatestBlock-config.GetBlockConfirmations() >= num
} | [
0.07590720057487488,
0.15012533962726593,
0.7408186197280884,
0.8879549503326416,
-0.12048132717609406,
-0.0000900911254575476,
0.4750296175479889,
0.1406610757112503,
-1.0128370523452759,
0.7422589659690857,
-0.36396437883377075,
0.5636040568351746,
-0.39930084347724915,
1.094051122665405... |
func (b *BlockProcessorQueue) Start(ctx context.Context) {
for {
select {
case <-ctx.Done():
return
case req := <-b.PutChan:
// Once a block is inserted into processing queue, don't
// overwrite its history with some new request
if _, ok := b.Blocks[req.BlockNumber]; ok {
req.ResponseChan <-... | [
-0.3933100700378418,
-0.2894817590713501,
0.8584641814231873,
-0.23676782846450806,
0.41959503293037415,
-0.3336305022239685,
0.45970866084098816,
0.14474895596504211,
-0.5160127878189087,
0.04261336475610733,
-0.14302968978881836,
0.42830267548561096,
-0.8696093559265137,
0.97010940313339... |
func makeThumbnails(filenames []string){
for _, f := range filenames{
if _, err := thumbnail.ImageFile(f); err != nil{
log.Println(err)
}
}
} | [
-0.24770277738571167,
0.4837745428085327,
0.43202441930770874,
0.18152983486652374,
1.0302379131317139,
0.5875334143638611,
0.6489620804786682,
0.5562308430671692,
-0.60564124584198,
0.14200548827648163,
-0.06932294368743896,
-0.26404663920402527,
0.2832108736038208,
0.37364622950553894,
... |
func makeThumbnail3(filenames []string){
ch := make(chan struct{})
for _, f := range filenames{
go func(f string){
thumbnail.ImageFile(f) // NOTE: ignoring errors
ch <- struct{}{}
}(f) // 这个(f)是什么意思?
}
//Wait for goroutines to complete.
for range filenames{
<-ch
}
} | [
-0.7165573239326477,
0.25277531147003174,
0.6194047927856445,
0.20651943981647491,
0.3596895635128021,
0.4996526837348938,
0.3753596246242523,
0.18309803307056427,
-0.5336666107177734,
0.266554594039917,
-0.7729958295822144,
-0.1200062707066536,
0.16941730678081512,
-0.18888303637504578,
... |
func makeThumbnail4(filenames []string)error{
errors := make(chan error)
for _, f := range filenames{
go func(f string){
_, err := thumbnail.ImageFile(f)
errors <- err
}(f)
}
for range filenames{
if err := <-errors; err != nil{
return err // NOTE: incorrect: goroutine leak!
}
}
return nil
} | [
-0.6221396327018738,
0.025515511631965637,
0.6136312484741211,
0.25430816411972046,
0.4473808705806732,
-0.08706238865852356,
0.732338011264801,
-0.0940718725323677,
-0.8640881776809692,
0.08054003119468689,
0.10399962961673737,
-0.4332585334777832,
-0.06220228224992752,
0.4315851032733917... |
func makeThumbnails5(filenames []string)(thumbfiles []string, err error){
type item struct{
thumbfile string
err error
}
ch := make(chan item, len(filenames))
for _, f := range filenames{
go func (f string){
var it item
it.thumbfile, it.err = thumbnail.ImageFile(f)
ch <- it
}(f)
}
for range fil... | [
-1.0588665008544922,
-0.1729498952627182,
0.6100104451179504,
0.3067750036716461,
-0.09906444698572159,
0.0027941521257162094,
1.205979585647583,
-0.4676941931247711,
-0.3286057412624359,
0.4968492388725281,
-0.5147835612297058,
-0.7077246308326721,
0.14035870134830475,
0.5910606384277344,... |
func makeThumbnails6(filenames <-chan string) int64{
sizes := make(chan int64)
var wg sync.WaitGroup // number of working goroutines
for f := range filenames{
wg.Add(1)
//worker
go func(f string){
defer wg.Done()
thumb, err := thumbnail.ImageFile(f)
if err != nil{
log.Println(err)
return
}
... | [
-0.6984627842903137,
0.17599458992481232,
0.9019597172737122,
-0.4135439693927765,
0.011169109493494034,
-0.3494892120361328,
1.1697407960891724,
-0.44204333424568176,
-0.43677836656570435,
0.32160964608192444,
-0.655841052532196,
-1.1556464433670044,
-0.1393074095249176,
0.743596136569976... |
func dirents(dir string) []os.FileInfo{
sema <- struct{}{} // acquire token
defer func(){ <- sema }() // release token
//...
} | [
-0.6012598872184753,
-0.5984082221984863,
0.27422046661376953,
-0.4051097333431244,
0.15414763987064362,
-0.5595303177833557,
-0.2441917359828949,
-1.0429199934005737,
-0.2673238217830658,
-0.49751758575439453,
-0.2966861426830292,
0.7755487561225891,
0.6367737054824829,
-0.261335372924804... |
func (o *GetNicsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetNicsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
re... | [
0.00027298624627292156,
-0.6545495986938477,
0.6194019913673401,
0.3932909369468689,
0.037825193256139755,
-1.2832019329071045,
-0.16382038593292236,
-1.0510776042938232,
0.4894137978553772,
0.026584124192595482,
-0.026180749759078026,
-0.7167772650718689,
-1.0911237001419067,
-0.421293139... |
func NewGetNicsOK() *GetNicsOK {
return &GetNicsOK{}
} | [
0.10967759788036346,
0.6688952445983887,
-0.12977662682533264,
1.8167095184326172,
-0.021354055032134056,
-1.692069411277771,
-0.08502759039402008,
-0.9900474548339844,
-0.558305025100708,
-0.7047815322875977,
-1.1838771104812622,
-0.13210958242416382,
0.27619025111198425,
-0.3478331565856... |
func NewGetNicsBadRequest() *GetNicsBadRequest {
return &GetNicsBadRequest{}
} | [
-0.4300309717655182,
0.31422826647758484,
0.21398958563804626,
1.3344846963882446,
-0.2832428812980652,
-0.8192813396453857,
-0.2553102672100067,
-1.136444091796875,
-0.4639508128166199,
-0.3924473822116852,
-0.20357711613178253,
0.5753123760223389,
-0.5617311596870422,
0.16325236856937408... |
func NewGetNicsNotFound() *GetNicsNotFound {
return &GetNicsNotFound{}
} | [
0.03836505487561226,
-0.28212210536003113,
-0.2717913091182709,
0.2976444959640503,
-0.2170630842447281,
0.4301784634590149,
0.4244687557220459,
-1.122916340827942,
-0.34038180112838745,
-0.9316040277481079,
-0.9082350730895996,
0.11289413273334503,
-0.5861525535583496,
-0.7224187850952148... |
func EdgeNew(relation string, srcNode *Node, destNode *Node, properties map[string]interface{}) *Edge {
p := properties
if p == nil {
p = make(map[string]interface{})
}
return &Edge{
Relation: relation,
Source: srcNode,
Destination: destNode,
Properties: p,
graph: nil,
}
} | [
-0.33472633361816406,
-0.12342892587184906,
0.6849172711372375,
-0.7245303392410278,
-0.29961323738098145,
0.1300744265317917,
-1.1593736410140991,
0.822804868221283,
-0.7199708223342896,
-0.32069194316864014,
0.9044966101646423,
0.2555805742740631,
0.42128679156303406,
-0.3572831749916076... |
func (e *Edge) SetProperty(key string, value interface{}) {
e.Properties[key] = value
} | [
-0.4530391991138458,
-0.28809186816215515,
0.3489905893802643,
0.31409990787506104,
0.06943114846944809,
0.5390714406967163,
-0.38511398434638977,
0.8329733610153198,
0.22776080667972565,
1.551590919494629,
0.1207488477230072,
-0.08205487579107285,
-0.23734603822231293,
0.28368768095970154... |
func (e *Edge) GetProperty(key string) interface{} {
v, _ := e.Properties[key]
return v
} | [
-0.40981370210647583,
-0.45682191848754883,
0.38980919122695923,
0.455379456281662,
0.11190079897642136,
-0.5071804523468018,
0.11019711196422577,
0.0192547719925642,
0.5759333372116089,
1.2184406518936157,
0.6727434396743774,
0.0978771299123764,
-0.3245929181575775,
-0.12091134488582611,
... |
func (e Edge) SourceNodeID() uint64 {
if e.Source != nil {
return e.Source.ID
} else {
return e.srcNodeID
}
} | [
0.010389941744506359,
0.27561381459236145,
0.44613584876060486,
-0.7160722613334656,
-0.30637606978416443,
0.3459147810935974,
0.4394456744194031,
0.6626525521278381,
1.859153151512146,
1.2712525129318237,
-0.13723279535770416,
0.7145346999168396,
-0.3578270375728607,
0.8575857877731323,
... |
func (e Edge) DestNodeID() uint64 {
if e.Source != nil {
return e.Destination.ID
} else {
return e.destNodeID
}
} | [
-0.09794854372739792,
0.15970779955387115,
0.5685778260231018,
-0.9659553170204163,
-0.18983453512191772,
0.27312690019607544,
0.16763459146022797,
0.5222927331924438,
0.8771918416023254,
1.5763312578201294,
0.08380962163209915,
0.7137559652328491,
0.334479957818985,
0.39213308691978455,
... |
func (e Edge) String() string {
if len(e.Properties) == 0 {
return "{}"
}
p := make([]string, 0, len(e.Properties))
for k, v := range e.Properties {
p = append(p, fmt.Sprintf("%s:%v", k, ToString(v)))
}
s := fmt.Sprintf("{%s}", strings.Join(p, ","))
return s
} | [
-0.2689995765686035,
-1.1340932846069336,
0.3896385729312897,
-1.0617650747299194,
0.1784435361623764,
0.48443588614463806,
-0.3487953543663025,
-0.03391364961862564,
-0.48348334431648254,
0.761299729347229,
0.9688127040863037,
0.5195009112358093,
0.09859747439622879,
-0.5257605314254761,
... |
func (e Edge) Encode() string {
s := []string{"(", e.Source.Alias, ")"}
s = append(s, "-[")
if e.Relation != "" {
s = append(s, ":", e.Relation)
}
if len(e.Properties) > 0 {
p := make([]string, 0, len(e.Properties))
for k, v := range e.Properties {
p = append(p, fmt.Sprintf("%s:%v", k, ToString(v)))
... | [
-0.2754784822463989,
-0.2648988664150238,
0.8588080406188965,
-0.9506621360778809,
-0.4536478817462921,
0.7973949909210205,
-0.45433884859085083,
0.375862181186676,
-0.3198957145214081,
1.2095731496810913,
0.8231999278068542,
0.3770323693752289,
0.4676591455936432,
-0.271481990814209,
0.... |
func stripNondeterministicResources(v interface{}) {
m, ok := v.(map[string]interface{})
if !ok {
return
}
resource, ok := m["resource"].(map[string]interface{})
if !ok {
return
}
instance, ok := resource["marathon_app"].(map[string]interface{})
if !ok {
return
}
for _, v := range instance {
vm, ok... | [
-0.5509311556816101,
-0.6519659757614136,
0.782512366771698,
-0.35872697830200195,
-0.38646888732910156,
0.32104843854904175,
0.07258537411689758,
-0.15900421142578125,
-0.46777936816215515,
1.1974966526031494,
0.40461814403533936,
-0.32509246468544006,
0.003939392510801554,
0.815130531787... |
func New(domain string) (*Shortener, error) {
db, err := store.New("memory")
if err != nil {
return nil, err
}
domain = strings.TrimSpace(domain)
if domain == "" {
return nil, fmt.Errorf("Empty domain is not allowed")
}
if !strings.HasPrefix(domain, "http") {
domain = "http://" + domain
}
shortener := &S... | [
0.46912240982055664,
-0.1829577386379242,
0.40086233615875244,
-0.5864941477775574,
-0.9181959629058838,
0.28475555777549744,
-0.15718470513820648,
0.20486286282539368,
0.1283712536096573,
-0.16167482733726501,
-0.10388623178005219,
1.205096960067749,
-0.06869383156299591,
1.39830255508422... |
func (s Shortener) Shorten(uri string) string {
// Is this check needed here?
_, err := url.ParseRequestURI(uri)
if err != nil {
return ""
}
id, err := s.db.AddURL(uri)
if err != nil {
return ""
}
return s.domain + "/" + id
} | [
-0.5376638174057007,
0.6377431154251099,
0.5458142757415771,
0.35128965973854065,
0.2308097928762436,
0.7137824892997742,
0.043166615068912506,
0.5562021732330322,
0.5303656458854675,
-0.6771560907363892,
0.3560326099395752,
0.26628831028938293,
-0.3516477644443512,
0.679513156414032,
0.... |
func (s Shortener) Resolve(uri string) string {
u, err := url.ParseRequestURI(uri)
if err != nil {
return ""
}
id := strings.TrimLeft(u.Path, "/")
return s.db.GetURL(id)
} | [
-0.1860034316778183,
0.26228082180023193,
0.7018702030181885,
0.47644421458244324,
0.15135149657726288,
-0.42867666482925415,
-1.1167203187942505,
-0.2933466136455536,
-0.46497994661331177,
-0.8013213872909546,
-0.1136612519621849,
-0.5246514678001404,
-1.0911426544189453,
0.19936819374561... |
func Add(mgr manager.Manager, hubconfig *rest.Config, cluster types.NamespacedName) error {
reconciler, err := newReconciler(mgr, hubconfig, cluster)
if err != nil {
klog.Error("Failed to create the application reconciler ", err)
return err
}
reconciler.start()
return nil
} | [
0.7816649079322815,
-0.4531169533729553,
0.6119372248649597,
0.20407463610172272,
0.5955900549888611,
0.601669430732727,
-0.59702467918396,
1.0450266599655151,
0.38661712408065796,
-0.48033279180526733,
0.606680154800415,
0.47419923543930054,
-0.978183388710022,
1.2650771141052246,
1.516... |
func NewKernelMonitorOrDie(configPath string) KernelMonitor {
k := &kernelMonitor{
tomb: util.NewTomb(),
}
f, err := ioutil.ReadFile(configPath)
if err != nil {
glog.Fatalf("Failed to read configuration file %q: %v", configPath, err)
}
err = json.Unmarshal(f, &k.config)
if err != nil {
glog.Fatalf("Failed ... | [
0.2825759947299957,
-0.461024671792984,
0.6313410997390747,
-0.24669583141803741,
-0.25427886843681335,
-0.46975499391555786,
-0.04069725051522255,
0.022857902571558952,
-0.36029109358787537,
0.40250396728515625,
0.06756238639354706,
-0.7091447114944458,
-0.43214941024780273,
0.71081334352... |
func (k *kernelMonitor) monitorLoop() {
defer k.tomb.Done()
k.initializeStatus()
for {
select {
case log := <-k.logCh:
k.parseLog(log)
case <-k.tomb.Stopping():
k.watcher.Stop()
glog.Infof("Kernel monitor stopped")
return
}
}
} | [
0.20591512322425842,
-0.7496088743209839,
0.3887479305267334,
0.8848568797111511,
0.10306347161531448,
0.4466128945350647,
-0.6431018710136414,
-0.2974407970905304,
-0.5200501680374146,
0.4567449986934662,
0.10113823413848877,
-0.5420873761177063,
0.09826766699552536,
0.7650665640830994,
... |
func (k *kernelMonitor) parseLog(log *kerntypes.KernelLog) {
// Once there is new log, kernel monitor will push it into the log buffer and try
// to match each rule. If any rule is matched, kernel monitor will report a status.
k.buffer.Push(log)
if matched := k.buffer.Match(k.config.StartPattern); len(matched) != 0... | [
1.0443577766418457,
0.24780720472335815,
0.4875892698764801,
0.592178463935852,
-0.15711192786693573,
-0.12374376505613327,
0.4192693531513214,
0.39849644899368286,
-0.23176921904087067,
0.02447047457098961,
-0.6831533312797546,
-0.32463935017585754,
0.229883074760437,
0.9936877489089966,
... |
func (k *kernelMonitor) generateStatus(logs []*kerntypes.KernelLog, rule kerntypes.Rule) *types.Status {
// We use the timestamp of the first log line as the timestamp of the status.
timestamp := logs[0].Timestamp
message := generateMessage(logs)
var events []types.Event
if rule.Type == kerntypes.Temp {
// For t... | [
0.2625120282173157,
-0.19011446833610535,
0.6807665824890137,
-0.20734022557735443,
0.06859993189573288,
0.0019153187749907374,
-0.47285300493240356,
0.37132713198661804,
0.3126862645149231,
0.4190268814563751,
0.07655483484268188,
0.2752473056316376,
-0.2098882645368576,
0.670415461063385... |
func (k *kernelMonitor) initializeStatus() {
// Initialize the default node conditions
k.conditions = initialConditions(k.config.DefaultConditions)
glog.Infof("Initialize condition generated: %+v", k.conditions)
// Update the initial status
k.output <- &types.Status{
Source: k.config.Source,
Conditions: k.... | [
0.1345958709716797,
0.19576798379421234,
0.22899678349494934,
0.4349908232688904,
0.7900963425636292,
-0.6406742930412292,
0.3141276240348816,
0.6979693174362183,
-0.6249992251396179,
0.09873522818088531,
-0.6498891711235046,
0.4012860357761383,
-0.1968238204717636,
1.2487798929214478,
-... |
func validateRules(rules []kerntypes.Rule) error {
for _, rule := range rules {
_, err := regexp.Compile(rule.Pattern)
if err != nil {
return err
}
}
return nil
} | [
-0.2163388729095459,
0.07585509866476059,
0.4549625813961029,
0.16009464859962463,
0.809002161026001,
1.1164060831069946,
0.32446423172950745,
-0.010288516990840435,
-0.10285407304763794,
0.46049878001213074,
0.7243666648864746,
-0.39100977778434753,
-1.1119168996810913,
0.8488507270812988... |
func NewFolderSink(ctx *pulumi.Context,
name string, args *FolderSinkArgs, opts ...pulumi.ResourceOption) (*FolderSink, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Destination == nil {
return nil, errors.New("invalid value for required argument 'Destinat... | [
-0.33075758814811707,
0.992909848690033,
0.41079190373420715,
0.25555112957954407,
0.5248857736587524,
-0.21276436746120453,
0.1321645826101303,
-0.12374652922153473,
-0.7903148531913757,
-0.3826580345630646,
0.027445970103144646,
0.11066800355911255,
-0.39150699973106384,
0.44169747829437... |
func GetFolderSink(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *FolderSinkState, opts ...pulumi.ResourceOption) (*FolderSink, error) {
var resource FolderSink
err := ctx.ReadResource("gcp:logging/folderSink:FolderSink", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return... | [
-0.10363422334194183,
0.4126591682434082,
0.22480638325214386,
0.5515885949134827,
0.9244353175163269,
-0.7069321870803833,
-0.04335653409361839,
-0.6339756846427917,
0.17753610014915466,
-1.1029441356658936,
0.5162802338600159,
1.2710915803909302,
-0.26063477993011475,
-0.3380729556083679... |
func (o FolderSinkOutput) BigqueryOptions() FolderSinkBigqueryOptionsOutput {
return o.ApplyT(func(v *FolderSink) FolderSinkBigqueryOptionsOutput { return v.BigqueryOptions }).(FolderSinkBigqueryOptionsOutput)
} | [
0.07703445851802826,
-0.14128202199935913,
0.49027398228645325,
0.13866977393627167,
1.6662296056747437,
-0.4295772910118103,
0.8121008276939392,
-0.2881816029548645,
0.22171112895011902,
-0.9717932939529419,
0.4672425389289856,
0.9825192093849182,
0.7802242636680603,
-0.029203109443187714... |
func (o FolderSinkOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *FolderSink) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
} | [
0.17407311499118805,
0.03433837741613388,
0.3914622962474823,
0.0017859169747680426,
1.1120288372039795,
0.14909283816814423,
0.3674306571483612,
0.032456181943416595,
-0.08869268000125885,
-0.8171209096908569,
1.0072664022445679,
1.147194266319275,
-0.20447935163974762,
-0.614704966545105... |
func (o FolderSinkOutput) Destination() pulumi.StringOutput {
return o.ApplyT(func(v *FolderSink) pulumi.StringOutput { return v.Destination }).(pulumi.StringOutput)
} | [
-0.05645354464650154,
-0.2580014765262604,
0.5438072085380554,
0.07376967370510101,
0.747755765914917,
0.24130921065807343,
0.7195388078689575,
-0.20367829501628876,
-0.01805163361132145,
-0.6173310279846191,
0.5946081280708313,
0.6099618077278137,
0.7838993668556213,
-0.9020636081695557,
... |
func (o FolderSinkOutput) Disabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *FolderSink) pulumi.BoolPtrOutput { return v.Disabled }).(pulumi.BoolPtrOutput)
} | [
-0.14999224245548248,
-0.03806282579898834,
0.4247898757457733,
0.5305142402648926,
0.39712274074554443,
0.9356054067611694,
0.6925265789031982,
0.5980325937271118,
0.24216818809509277,
-0.9519818425178528,
-0.008071999065577984,
0.18725033104419708,
-1.0684046745300293,
-0.610355615615844... |
func (o FolderSinkOutput) Exclusions() FolderSinkExclusionArrayOutput {
return o.ApplyT(func(v *FolderSink) FolderSinkExclusionArrayOutput { return v.Exclusions }).(FolderSinkExclusionArrayOutput)
} | [
0.10432025790214539,
-0.2469051480293274,
0.5651187896728516,
0.4504493772983551,
0.0320771224796772,
0.1643037497997284,
0.5959342122077942,
-0.4060375392436981,
0.8115670084953308,
-0.9675476551055908,
0.08288627117872238,
0.21419723331928253,
-0.2987746298313141,
0.08463326096534729,
... |
func (o FolderSinkOutput) Filter() pulumi.StringPtrOutput {
return o.ApplyT(func(v *FolderSink) pulumi.StringPtrOutput { return v.Filter }).(pulumi.StringPtrOutput)
} | [
0.2506210207939148,
0.13140711188316345,
0.29340270161628723,
-0.058744288980960846,
0.7367766499519348,
0.3108619451522827,
0.9370522499084473,
0.21399274468421936,
0.06521019339561462,
-1.1201554536819458,
0.9126262068748474,
0.9671400785446167,
0.10977832973003387,
-0.8105451464653015,
... |
func (o FolderSinkOutput) Folder() pulumi.StringOutput {
return o.ApplyT(func(v *FolderSink) pulumi.StringOutput { return v.Folder }).(pulumi.StringOutput)
} | [
-0.2693570554256439,
-0.11007087677717209,
0.4375061094760895,
0.024012841284275055,
0.6511850953102112,
0.19694878160953522,
1.0916014909744263,
-0.2856591045856476,
0.11424312740564346,
-1.2660704851150513,
0.8961098790168762,
0.801250159740448,
0.5216115713119507,
-0.41243359446525574,
... |
func (o FolderSinkOutput) IncludeChildren() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *FolderSink) pulumi.BoolPtrOutput { return v.IncludeChildren }).(pulumi.BoolPtrOutput)
} | [
0.6337430477142334,
0.7995797395706177,
0.8004656434059143,
0.29433128237724304,
0.3209439516067505,
1.0321264266967773,
1.0084625482559204,
0.37075141072273254,
0.2698488235473633,
-0.5440073013305664,
-0.48443281650543213,
0.1845410019159317,
-0.7923132181167603,
-0.6126224398612976,
-... |
func (o FolderSinkOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *FolderSink) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
} | [
-0.2941277325153351,
-0.4591905176639557,
0.5379041433334351,
-0.010728566907346249,
0.3364013433456421,
0.020753901451826096,
0.7682414650917053,
-0.5137427449226379,
-0.3219100832939148,
-0.4269324541091919,
0.3775942921638489,
0.44357040524482727,
0.64468914270401,
-0.5224964022636414,
... |
func (o FolderSinkOutput) WriterIdentity() pulumi.StringOutput {
return o.ApplyT(func(v *FolderSink) pulumi.StringOutput { return v.WriterIdentity }).(pulumi.StringOutput)
} | [
-0.5586605072021484,
-0.5379548668861389,
0.42398038506507874,
0.3276095688343048,
1.698417067527771,
0.29810860753059387,
1.2341421842575073,
0.19515159726142883,
0.6463279724121094,
-0.9160372614860535,
0.10301458835601807,
-0.2998887598514557,
-0.06110032647848129,
-0.7682877779006958,
... |
func (m *TflAPIPresentationEntitiesJourneyPlannerLeg) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateArrivalPoint(formats); err != nil {
res = append(res, err)
}
if err := m.validateArrivalTime(formats); err != nil {
res = append(res, err)
}
if err := m.validateDeparturePoint... | [
-0.16394351422786713,
0.306497722864151,
0.784615695476532,
-0.6772528886795044,
-0.6251869797706604,
0.6524826884269714,
0.06910756230354309,
0.2009674310684204,
-0.5987133383750916,
0.14814859628677368,
0.26400691270828247,
-0.8641441464424133,
0.09278832376003265,
0.85502028465271,
0.... |
func Defaults() {
// web
viper.SetDefault("listen_address", ":8080")
viper.SetDefault("chrome_address", "http://127.0.0.1:9222")
viper.SetDefault("scrap_region", "de")
viper.SetDefault("cache_enabled", true) // enable cache
viper.SetDefault("cache_max_size", 10) // 10 megabytes
viper.SetDefault("cache_lifet... | [
-0.4410087764263153,
0.4672034978866577,
0.3919546604156494,
-0.03112233616411686,
1.33639657497406,
-0.44577157497406006,
-0.9774324893951416,
0.4896801710128784,
0.4244365692138672,
0.39668917655944824,
-1.1720255613327026,
0.2831997871398926,
-0.26123395562171936,
-0.1724046766757965,
... |
func (u UFSPathBuilder) GenAlluxioMountPath(curMount datav1alpha1.Mount) string {
// if the user defines mount.path, use it
if filepath.IsAbs(curMount.Path) {
return curMount.Path
}
return fmt.Sprintf(common.AlluxioMountPathFormat, curMount.Name)
} | [
0.5010209679603577,
-0.6902562975883484,
0.7186506390571594,
1.826591968536377,
-1.0389282703399658,
0.22969329357147217,
-0.47188156843185425,
0.25921598076820374,
0.31244122982025146,
0.024293646216392517,
0.870708703994751,
-0.37734878063201904,
0.22923895716667175,
0.5512627363204956,
... |
func (u UFSPathBuilder) GenAlluxioUFSRootPath(items []datav1alpha1.Mount) (string, *datav1alpha1.Mount) {
// if have multi ufs mount point or empty
// use local storage root path by default
if len(items) > 1 || len(items) == 0 {
return u.GetLocalStorageRootDir(), nil
}
m := items[0]
// if fluid native scheme ... | [
0.09812810271978378,
-0.2938618063926697,
0.7009968757629395,
1.6237190961837769,
-0.20176814496517181,
-0.2418772131204605,
0.15877321362495422,
0.5373305678367615,
0.6877242922782898,
-0.07668805122375488,
0.46781250834465027,
-0.5353840589523315,
0.144147589802742,
1.0268653631210327,
... |
func (u UFSPathBuilder) GenLocalStoragePath(curMount datav1alpha1.Mount) string {
if filepath.IsAbs(curMount.Path) {
return filepath.Join(common.AlluxioLocalStorageRootPath, curMount.Path)
}
return filepath.Join(common.AlluxioLocalStorageRootPath, curMount.Name)
} | [
0.5494730472564697,
-0.41521403193473816,
0.5278379917144775,
0.5763736963272095,
-0.6402918696403503,
0.7008646726608276,
0.3177323341369629,
0.4429108500480652,
0.3106490969657898,
0.003299939911812544,
0.5809742212295532,
-0.3642551898956299,
0.06289707124233246,
0.37843650579452515,
... |
func checkJWT(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("content-type", "application/json")
err := auth.TokenValid(r)
if err != nil {
http.Error(w, fmt.Sprintf(`{"status":"error","error":true,"msg":%s}`, "Unathorized"), 401)
ret... | [
0.1300414502620697,
-0.2606624960899353,
0.8302251696586609,
-0.1196671724319458,
-1.1231929063796997,
0.21904480457305908,
-0.9573276042938232,
-0.4033203125,
-0.6215882897377014,
0.7885804176330566,
0.18462106585502625,
0.5204888582229614,
0.2624236047267914,
0.7032574415206909,
-0.298... |
func (capabilities CapNetBindService) AddCap() error {
// Craft a duplicated capabilities
dupCapabilities, err := cap.GetProc().Dup()
if err != nil {
return err
}
if on, err := dupCapabilities.GetFlag(cap.Permitted, cap.NET_BIND_SERVICE); !on {
if err != nil {
return err
} else {
return errors.New(fmt.... | [
-0.6423132419586182,
-0.08063618093729019,
1.2159459590911865,
0.6734915971755981,
0.21463772654533386,
-0.24874743819236755,
0.42862457036972046,
-0.4805082380771637,
1.1361019611358643,
-0.4887086749076843,
0.24595321714878082,
0.6439007520675659,
0.3082757890224457,
1.087361454963684,
... |
func (capabilities CapRaw) AddCap() error {
// TODO
return nil
} | [
-0.8001518249511719,
-0.23183049261569977,
0.8908150792121887,
1.3311434984207153,
0.07730789482593536,
-0.06545419991016388,
0.2883721888065338,
0.1653166264295578,
1.3874330520629883,
-1.1180286407470703,
0.5389852523803711,
-0.5612252950668335,
0.4501710832118988,
0.9528182744979858,
... |
func RegisterTests(f *framework.Framework) {
ContainerDeployerTests(f)
ManifestDeployerTests(f)
helmcharts.RegisterTests(f)
blueprints.RegisterTests(f)
management.RegisterTests(f)
} | [
0.39699965715408325,
1.1484160423278809,
0.42735302448272705,
0.532611072063446,
1.9502936601638794,
0.10914255678653717,
0.8087268471717834,
-0.5891014933586121,
0.8007512092590332,
-1.0863772630691528,
-0.3521882891654968,
0.273010790348053,
0.07835069298744202,
1.08153235912323,
0.017... |
func BestPriorityFor(b Balance) Priority {
for priority, value := range b {
if value > 0 {
return Priority(priority)
}
}
return FreeBucket
} | [
0.0842842385172844,
-0.5342451930046082,
0.44152602553367615,
-0.16915975511074066,
0.27815696597099304,
-0.1262774020433426,
-1.0195180177688599,
-0.24479243159294128,
0.2646108567714691,
-0.7338650226593018,
0.42968377470970154,
-0.5420536398887634,
-0.10968537628650665,
0.77693831920623... |
func nextBalance(balance Balance, c *AccountConfig, elapsedSecs float32, runningJobs []int) Balance {
var runningJobsArray [NumPriorities]int
copy(runningJobsArray[:], runningJobs)
for priority := 0; priority < NumPriorities; priority++ {
val := balance[priority]
val -= elapsedSecs * float32(runningJobsArray[pri... | [
0.5074876546859741,
0.2766968607902527,
0.6491958498954773,
0.5876733660697937,
-0.2997755706310272,
-0.13048173487186432,
-0.506873369216919,
-0.004097692668437958,
0.7828935384750366,
-0.08982927352190018,
0.8137962818145752,
0.3839331269264221,
-0.11891694366931915,
0.7275188565254211,
... |
func NewAccountConfig(fanout int, chargeSeconds float32, chargeRate []float32, disableFreeTasks bool) *AccountConfig {
b := Balance{}
copy(b[:], chargeRate)
return &AccountConfig{
ChargeRate: b,
MaxChargeSeconds: chargeSeconds,
MaxFanout: int32(fanout),
DisableFreeTasks: disableFreeTasks,
}
} | [
0.7355336546897888,
0.15833784639835358,
0.3005324602127075,
0.9871477484703064,
-1.2044216394424438,
-0.099324069917202,
0.3828466832637787,
0.7063847184181213,
0.11405899375677109,
0.2654108703136444,
-0.4981255531311035,
0.4383881986141205,
0.36883464455604553,
0.7658297419548035,
0.0... |
func NewAccountConfigFromProto(c *protos.AccountConfig) *AccountConfig {
return NewAccountConfig(
int(c.MaxFanout),
c.MaxChargeSeconds,
c.ChargeRate,
c.DisableFreeTasks,
)
} | [
0.557195246219635,
0.0058995196595788,
0.19682122766971588,
1.0516046285629272,
-0.8895934224128723,
0.21902434527873993,
0.8245883584022522,
1.0830096006393433,
-0.5191878080368042,
-0.021733105182647705,
-0.775204062461853,
0.4538019597530365,
-0.02713956870138645,
0.7111572027206421,
... |
func RemotesCmd() *cobra.Command {
description := `List configured remotes and their information.`
var cmd = &cobra.Command{
Use: "remotes",
Short: "List the repository's configured remotes",
Long: formatdesc(description, nil),
Args: cobra.No... | [
-0.3306094706058502,
-0.5730419754981995,
0.6035265326499939,
-1.2632472515106201,
0.241862952709198,
0.6593154668807983,
-1.3966225385665894,
-0.03702565282583237,
-0.061287056654691696,
-0.2799476981163025,
0.008689380250871181,
0.7768795490264893,
-0.2734840214252472,
0.2391771227121353... |
func main() {
http.HandleFunc("/", index)
http.HandleFunc("/me/", me)
http.HandleFunc("/dog/", dog)
http.ListenAndServe(":8080", nil)
} | [
-0.5821067690849304,
-0.3959570527076721,
0.4951745271682739,
0.45818302035331726,
0.8558399677276611,
0.1954585313796997,
0.060413092374801636,
0.43610984086990356,
-1.188431739807129,
-1.148664951324463,
-0.15162844955921173,
0.23300085961818695,
0.0113432751968503,
-0.618830144405365,
... |
func Log(prefix, message string) {
logger.Log(prefix, message)
} | [
0.5605916976928711,
0.5749871134757996,
0.2063196450471878,
0.1628594845533371,
-0.36004671454429626,
-0.3895978033542633,
-0.35668662190437317,
0.7957954406738281,
-0.1689927577972412,
-0.6689862608909607,
-0.21318116784095764,
1.1885089874267578,
0.024099139496684074,
0.5528560876846313,... |
func NewGithubToken(token, desc, tokenType string) *GitToken {
return &GitToken{Token: token, Desc: desc, Limit: 5000, Remaining: 5000, Type: tokenType}
} | [
-0.2885465919971466,
-0.4887760281562805,
0.2626831829547882,
-0.5454956889152527,
-0.3440055251121521,
0.3591318726539612,
-0.9221388697624207,
0.48548418283462524,
-0.7592588067054749,
-0.33927202224731445,
-1.365146279335022,
1.6105873584747314,
-0.08328939974308014,
0.08679784089326859... |
func (g *GitToken) Insert() (int64, error) {
return Engine.Insert(g)
} | [
-1.049702525138855,
1.566666841506958,
0.4780973196029663,
-0.7581979036331177,
-0.03165629878640175,
-0.29039424657821655,
0.21685053408145905,
0.6229248046875,
-1.334874153137207,
-0.15452143549919128,
-0.7628470659255981,
0.03623247519135475,
-1.1238797903060913,
0.18092601001262665,
... |
func (g *GitToken) Exist() (bool, error) {
return Engine.Get(g)
} | [
-0.8655741810798645,
0.2604420781135559,
0.40257343649864197,
-0.3314096927642822,
0.7380088567733765,
0.4827207624912262,
-0.8818867802619934,
-0.3099496364593506,
-1.4838991165161133,
1.0304780006408691,
0.2326240837574005,
-0.22718828916549683,
-0.13660961389541626,
0.40429913997650146,... |
func NewProof(hash, signature []byte) Proof {
return Proof{
Hash: hash,
Signature: signature,
}
} | [
1.6212477684020996,
-0.5381345748901367,
0.2752803862094879,
1.3285216093063354,
-1.5087089538574219,
-0.5136560797691345,
-0.76077800989151,
0.32841095328330994,
0.5154783725738525,
0.6354994773864746,
-0.5361504554748535,
0.13973428308963776,
-0.0517648421227932,
0.5186597108840942,
0.... |
func GenerateProof(data []byte, pk *ecdsa.PrivateKey) (Proof, error) {
// Turn the message into a 32-byte hash
hash := solsha3.SoliditySHA3(solsha3.String(data))
// Prefix and then hash to mimic behavior of eth_sign
prefixed := solsha3.SoliditySHA3(solsha3.String("\x19Ethereum Signed Message:\n32" + hex.EncodeToStr... | [
0.7019017934799194,
0.5483629703521729,
0.5777061581611633,
-0.6525047421455383,
-0.15452781319618225,
0.15799309313297272,
-0.39109084010124207,
0.3017273545265198,
1.3779703378677368,
0.5037251114845276,
-0.7922448515892029,
-0.8654788732528687,
-0.4110569655895233,
0.6357777714729309,
... |
func (in *CrunchyBridgeConnection) DeepCopyInto(out *CrunchyBridgeConnection) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
in.Status.DeepCopyInto(&out.Status)
} | [
0.7684816122055054,
-0.31261375546455383,
0.6126947999000549,
0.5555242896080017,
-0.028026539832353592,
-0.057084616273641586,
0.5609428882598877,
0.547158420085907,
-0.8018231987953186,
-0.47610700130462646,
-0.48382568359375,
0.9944888353347778,
0.13115638494491577,
0.012802181765437126... |
func (in *CrunchyBridgeConnection) DeepCopy() *CrunchyBridgeConnection {
if in == nil {
return nil
}
out := new(CrunchyBridgeConnection)
in.DeepCopyInto(out)
return out
} | [
-0.04059183597564697,
0.622176468372345,
0.32298633456230164,
1.7914272546768188,
0.970335841178894,
-0.7022354602813721,
1.0372973680496216,
-0.28850677609443665,
0.6795319318771362,
-0.3284662961959839,
-0.14032073318958282,
-0.14178262650966644,
-0.5009056925773621,
0.3179270327091217,
... |
func (in *CrunchyBridgeConnection) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
} | [
-0.03470369428396225,
-0.05922573804855347,
0.6799066662788391,
0.8691988587379456,
0.011841034516692162,
0.066576287150383,
1.2076126337051392,
-0.036007821559906006,
-0.02038821391761303,
-0.6189701557159424,
-0.37527528405189514,
-0.22391262650489807,
-0.17470598220825195,
0.01909786835... |
func (in *CrunchyBridgeConnectionList) DeepCopyInto(out *CrunchyBridgeConnectionList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]CrunchyBridgeConnection, len(*in))
for i := range *in {
(*in)[i].DeepCopy... | [
-0.06498590856790543,
0.2342580258846283,
0.5788302421569824,
0.7351059317588806,
0.19185473024845123,
-0.42255938053131104,
0.13924235105514526,
0.5128346681594849,
-0.44773736596107483,
0.1090276688337326,
-0.8553931713104248,
-0.1880413144826889,
-0.04136805236339569,
0.0965185910463333... |
func (in *CrunchyBridgeConnectionList) DeepCopy() *CrunchyBridgeConnectionList {
if in == nil {
return nil
}
out := new(CrunchyBridgeConnectionList)
in.DeepCopyInto(out)
return out
} | [
-0.452430784702301,
0.2962573170661926,
0.09904725849628448,
1.6390559673309326,
0.9289346933364868,
-0.4260144531726837,
0.5624701976776123,
0.03406447544693947,
0.6147454977035522,
0.27662384510040283,
-0.8036696314811707,
-0.8161308765411377,
0.16493503749370575,
0.20843558013439178,
... |
func (in *CrunchyBridgeConnectionList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
} | [
-0.5876766443252563,
-0.00560028525069356,
0.5432933568954468,
0.8855015635490417,
0.22799712419509888,
-0.04175557196140289,
0.9096288084983826,
0.0920996144413948,
0.22505977749824524,
-0.3749202787876129,
-0.7919999361038208,
-0.7002390623092651,
0.06002325937151909,
0.23537705838680267... |
func (in *CrunchyBridgeInventory) DeepCopyInto(out *CrunchyBridgeInventory) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
} | [
0.3101423382759094,
-0.5943415760993958,
0.5561976432800293,
0.41331416368484497,
0.19388794898986816,
0.3701207935810089,
0.7739080786705017,
0.27005890011787415,
-0.5457808375358582,
-0.3941887319087982,
-0.5513644218444824,
0.9274683594703674,
0.12896209955215454,
0.042945992201566696,
... |
func (in *CrunchyBridgeInventory) DeepCopy() *CrunchyBridgeInventory {
if in == nil {
return nil
}
out := new(CrunchyBridgeInventory)
in.DeepCopyInto(out)
return out
} | [
-0.43424615263938904,
-0.08757283538579941,
0.3662722110748291,
1.444787621498108,
0.7543067932128906,
-0.017139824107289314,
1.4976208209991455,
-0.2959645092487335,
0.9447200894355774,
-0.24668216705322266,
-0.0967012420296669,
-0.24530071020126343,
-0.43144944310188293,
0.00608241697773... |
func (in *CrunchyBridgeInventory) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
} | [
-0.24457359313964844,
-0.30399927496910095,
0.688400149345398,
0.9033783674240112,
0.20731022953987122,
0.3560677170753479,
1.45430326461792,
-0.14708566665649414,
-0.06816806644201279,
-0.611487865447998,
-0.2907179296016693,
-0.30041271448135376,
0.005051668733358383,
-0.1590828895568847... |
func (in *CrunchyBridgeInventoryList) DeepCopyInto(out *CrunchyBridgeInventoryList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]CrunchyBridgeInventory, len(*in))
for i := range *in {
(*in)[i].DeepCopyInt... | [
-0.04345649480819702,
0.014967184513807297,
0.5563715696334839,
0.8100947737693787,
0.43651914596557617,
-0.05431550741195679,
0.6237457394599915,
0.6570181846618652,
-0.5976993441581726,
0.34109818935394287,
-0.7160870432853699,
-0.10230494290590286,
-0.029942484572529793,
-0.233341261744... |
func (in *CrunchyBridgeInventoryList) DeepCopy() *CrunchyBridgeInventoryList {
if in == nil {
return nil
}
out := new(CrunchyBridgeInventoryList)
in.DeepCopyInto(out)
return out
} | [
-0.5442720651626587,
-0.01842539757490158,
0.16345345973968506,
1.4748685359954834,
1.0387893915176392,
-0.27174752950668335,
1.0540138483047485,
0.006702721118927002,
0.28885969519615173,
0.7129433751106262,
-0.575891375541687,
-1.1605255603790283,
-0.031936533749103546,
-0.05371011793613... |
func (in *CrunchyBridgeInventoryList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
} | [
-0.568939208984375,
-0.19487139582633972,
0.5658102631568909,
1.0442129373550415,
0.4559861719608307,
0.26944252848625183,
1.3348796367645264,
0.1684633195400238,
-0.1542740762233734,
-0.16084657609462738,
-0.7242043614387512,
-0.6340687870979309,
0.045736994594335556,
-0.01562279928475618... |
func (f fieldInfos) GetByVarName(name string) (fieldInfo, bool) {
for _, info := range f {
if info.Name == name {
return info, true
}
}
return fieldInfo{}, false
} | [
-0.01020129770040512,
-0.5082553029060364,
0.47918182611465454,
-0.10792304575443268,
-0.12855999171733856,
-0.45043426752090454,
-0.21148943901062012,
-0.3023936152458191,
-1.055253028869629,
0.030290989205241203,
-1.7608736753463745,
-0.1809903234243393,
-0.4200388491153717,
-0.462692588... |
func NewFieldRule(fset *token.FileSet) *FieldRule {
return &FieldRule{
fset: fset,
}
} | [
0.37050414085388184,
-0.5340442657470703,
-0.13264013826847076,
-0.831686794757843,
-0.49228858947753906,
0.36254391074180603,
-0.8927814364433289,
0.21480430662631989,
-0.7841070890426636,
-0.5656731724739075,
-0.3365056812763214,
0.8248471617698669,
-0.2174779325723648,
0.446906208992004... |
func (r FieldRule) checkBinaryExprFields(bexpr *ast.BinaryExpr) []error {
errs := []error{}
exprs := []ast.Expr{bexpr.X, bexpr.Y}
// check each expression if it is a selector expr. If it is a selector expr
// it may be using a field that may be deprecated
for _, expr := range exprs {
switch exprType := expr.(ty... | [
-0.6757315993309021,
-0.5530300736427307,
0.7167066335678101,
0.008025025017559528,
0.5836309790611267,
-0.39483413100242615,
-0.28873783349990845,
-0.5130361914634705,
-0.605575680732727,
0.5961231589317322,
-0.3548665940761566,
-0.08014564961194992,
-0.9430789351463318,
0.628997206687927... |
func (r FieldRule) getFieldInfo(expr ast.Expr) fieldInfos {
switch t := expr.(type) {
case *ast.Ident:
if t.Obj == nil || t.Obj.Decl == nil {
return nil
}
return r.getFieldInfoFromDecl(t.Obj.Decl)
default:
pepperlint.Log("TODO: getInternalTypeSpec %T", t)
}
return nil
} | [
0.22251634299755096,
0.20824772119522095,
0.5071413516998291,
-0.8334227204322815,
0.7686618566513062,
0.06304273009300232,
0.30629998445510864,
-0.07459733635187149,
-0.7548079490661621,
-0.13750387728214264,
-0.2863314747810364,
0.31047749519348145,
-0.08581184595823288,
0.09001131355762... |
func (r FieldRule) ValidateAssignStmt(stmt *ast.AssignStmt) error {
batchError := pepperlint.NewBatchError()
infos := r.getFieldInfoFromDecl(stmt)
if len(infos) == 0 {
return nil
}
for _, info := range infos {
// Check LHS field usage during assignment
if info.LHS != nil {
switch lhsType := info.LHS.(t... | [
-0.20266760885715485,
-0.6218674778938293,
0.7736288905143738,
0.2859515845775604,
0.24141034483909607,
0.002176867797970772,
-0.09857885539531708,
-0.4996097981929779,
-1.1721287965774536,
0.9704422354698181,
0.21227625012397766,
0.20151548087596893,
0.19741033017635345,
1.204602599143982... |
func (r FieldRule) ValidateCallExpr(expr *ast.CallExpr) error {
batchError := pepperlint.NewBatchError()
for _, arg := range expr.Args {
switch t := arg.(type) {
case *ast.SelectorExpr:
if err := r.isDeprecatedField(t); err != nil {
batchError.Add(err)
}
default:
pepperlint.Log("TODO: dep_field_r... | [
-0.9626656770706177,
0.1255141794681549,
0.5173298120498657,
0.011504897847771645,
0.32414937019348145,
0.3653985559940338,
-0.9027379751205444,
-0.13443639874458313,
-0.37186944484710693,
0.5662910342216492,
0.19751055538654327,
-0.06388073414564133,
-0.49644264578819275,
1.30348300933837... |
func (r FieldRule) ValidateReturnStmt(stmt *ast.ReturnStmt) error {
batchError := pepperlint.NewBatchError()
for _, result := range stmt.Results {
switch t := result.(type) {
case *ast.SelectorExpr:
if err := r.isDeprecatedField(t); err != nil {
batchError.Add(err)
}
default:
pepperlint.Log("TODO:... | [
-0.497428834438324,
-0.24337264895439148,
0.318678617477417,
0.02694225311279297,
0.44831132888793945,
-0.9210614562034607,
-0.35356205701828003,
-0.10586463660001755,
-0.7218174934387207,
0.842077910900116,
-0.15129628777503967,
-0.5452956557273865,
-0.7855033874511719,
-0.166392400860786... |
func (r *FieldRule) ValidatePackage(pkg *ast.Package) error {
r.currentPkgName = pkg.Name
return nil
} | [
-0.8065596222877502,
0.35924988985061646,
0.13666582107543945,
-0.3982291519641876,
0.6015017628669739,
0.5791195631027222,
0.7166721820831299,
0.450503945350647,
-0.31298959255218506,
0.30199095606803894,
0.24630732834339142,
-0.49228227138519287,
0.020242376253008842,
1.1485637426376343,... |
func (r FieldRule) ValidateIncDecStmt(stmt *ast.IncDecStmt) error {
batchError := pepperlint.NewBatchError()
switch t := stmt.X.(type) {
case *ast.SelectorExpr:
if err := r.isDeprecatedField(t); err != nil {
batchError.Add(err)
}
case *ast.IndexExpr:
switch expr := t.X.(type) {
case *ast.SelectorExpr:
... | [
-0.3884584605693817,
0.11423150449991226,
0.5567976832389832,
-0.04297145456075668,
-0.0660630315542221,
-0.015124044381082058,
-0.12529318034648895,
-0.15234382450580597,
-1.2108666896820068,
0.2721725404262543,
0.02333768457174301,
-0.019111746922135353,
-0.6964583396911621,
0.0930991247... |
func (r FieldRule) ValidateBinaryExpr(expr *ast.BinaryExpr) error {
batchError := pepperlint.NewBatchError()
if errs := r.checkBinaryExprFields(expr); len(errs) > 0 {
batchError.Add(errs...)
}
return batchError.Return()
} | [
-0.6280261874198914,
-0.17256784439086914,
0.2204161137342453,
0.014271140098571777,
0.23040525615215302,
0.26139017939567566,
0.5723249912261963,
-0.18236956000328064,
-1.0006402730941772,
0.3954472243785858,
-0.8473783731460571,
0.3651150166988373,
-0.8420232534408569,
1.0621105432510376... |
func (r FieldRule) ValidateRangeStmt(expr *ast.RangeStmt) error {
batchError := pepperlint.NewBatchError()
// TODO Also check if key or value is being assigned to a deprecated field
switch t := expr.X.(type) {
case *ast.SelectorExpr:
if err := r.isDeprecatedField(t); err != nil {
batchError.Add(err)
}
}
... | [
-1.2283116579055786,
-0.2375802844762802,
0.28204256296157837,
0.23475855588912964,
0.05418303608894348,
-0.44381749629974365,
-0.6980925798416138,
-0.013997857458889484,
-0.6706700921058655,
0.9218782186508179,
-0.32658863067626953,
-0.3672627806663513,
-0.360553115606308,
0.2980451881885... |
func (r *FieldRule) AddRules(visitorRules *pepperlint.Rules) {
rules := pepperlint.Rules{
AssignStmtRules: pepperlint.AssignStmtRules{r},
BinaryExprRules: pepperlint.BinaryExprRules{r},
CallExprRules: pepperlint.CallExprRules{r},
PackageRules: pepperlint.PackageRules{r},
IncDecStmtRules: pepperlint.IncD... | [
-0.177739679813385,
0.9370574355125427,
0.42918795347213745,
-0.787936270236969,
0.5371509194374084,
1.3609919548034668,
0.3289916217327118,
-0.0960521399974823,
0.054093021899461746,
-0.20270270109176636,
0.233615443110466,
-0.18076090514659882,
-0.8580437898635864,
0.33306682109832764,
... |
func (r *FieldRule) WithCache(cache *pepperlint.Cache) {
r.helper = pepperlint.NewHelper(cache)
} | [
0.9078153371810913,
0.14713740348815918,
0.04846279323101044,
-0.5152894258499146,
0.6229168772697449,
0.15550269186496735,
0.2572976052761078,
0.19267460703849792,
-0.12628969550132751,
0.23707275092601776,
0.16954189538955688,
-0.22302384674549103,
-0.04560690373182297,
0.259770601987838... |
func (r *FieldRule) WithFileSet(fset *token.FileSet) {
r.fset = fset
} | [
0.5918768644332886,
-0.7211742997169495,
0.1116294264793396,
-1.2528765201568604,
-0.05976486578583717,
-0.5912935733795166,
0.4006805121898651,
-0.4168969690799713,
-0.5541457533836365,
-0.040517326444387436,
0.47167640924453735,
-0.4937022030353546,
0.4966890811920166,
0.0219409186393022... |
func TestNewAndFree(t *testing.T) {
cl := NewTestClient(t)
FreeTest(t, cl)
cl = NewDefaultClient(t)
FreeTest(t, cl)
} | [
0.5545830726623535,
0.6910436749458313,
0.3375778794288635,
-0.07090427726507187,
0.9713464379310608,
0.17291051149368286,
0.2751390039920807,
-1.533705472946167,
-0.09577520191669464,
-0.43058687448501587,
-0.8089745044708252,
0.4974140226840973,
-1.018945574760437,
0.8255365490913391,
... |
func NewDefaultClient(t *testing.T) *Client {
cl, err := NewClient("service", "hostname", nil)
if err != nil {
t.Fatalf("could not create default client")
}
return cl
} | [
0.8553849458694458,
-0.1270069181919098,
0.00847200583666563,
0.9062221646308899,
0.2761991620063782,
0.0219404473900795,
0.5890432596206665,
-0.4060118496417999,
-0.38005271553993225,
-0.8694368600845337,
-0.20140205323696136,
0.3652142584323883,
-0.9389354586601257,
-0.039162393659353256... |
func NewTestClient(t *testing.T) *Client {
conf := &Config{
Username: "user",
Password: "pass",
}
cl, err := NewClient("service", "hostname", conf)
if err != nil {
t.Fatalf("could not create client\n%v", err)
}
return cl
} | [
0.44031286239624023,
-0.5774045586585999,
0.07930375635623932,
0.28979745507240295,
-0.035076361149549484,
0.36804258823394775,
0.534582257270813,
-0.6707252264022827,
-0.6144927144050598,
-0.21710437536239624,
-0.10480352491140366,
0.36718782782554626,
-1.0654863119125366,
-0.377771228551... |
func FreeTest(t *testing.T, cl *Client) {
panicked := false
if PanickedDuringFree(cl, &panicked); panicked {
t.Errorf("panic while freeing an uninitialized client")
}
} | [
1.2322944402694702,
0.31642043590545654,
0.09032435715198517,
-0.16056136786937714,
0.13304060697555542,
0.7289208769798279,
0.6684917211532593,
-1.635514736175537,
0.4953102469444275,
-0.11340253055095673,
-0.5897837281227112,
0.3620513379573822,
-0.5931426882743835,
0.13234569132328033,
... |
func PanickedDuringFree(cl *Client, panickedPtr *bool) {
defer func() {
if r := recover(); r != nil {
*panickedPtr = true
}
}()
cl.Free()
} | [
0.5426719188690186,
0.2434491366147995,
0.317331463098526,
0.3215799033641815,
-0.061635226011276245,
0.5873733758926392,
0.44275689125061035,
-1.0336339473724365,
0.2162325531244278,
0.15108245611190796,
-0.7543620467185974,
0.22320157289505005,
-0.6884363293647766,
-0.07875736057758331,
... |
func TestUninitializedFree(t *testing.T) {
cl := &Client{}
FreeTest(t, cl)
} | [
0.13456213474273682,
0.320856511592865,
0.2510017454624176,
-0.17509815096855164,
0.8085683584213257,
0.12937462329864502,
1.1446515321731567,
-1.0866856575012207,
0.26912161707878113,
-1.1594154834747314,
-1.1214503049850464,
0.1855664998292923,
-0.07610758394002914,
0.5803644061088562,
... |
func TestDoubleFree(t *testing.T) {
cl := NewTestClient(t)
FreeTest(t, cl)
FreeTest(t, cl)
} | [
-0.054478950798511505,
0.8889628052711487,
0.43622300028800964,
0.3994433879852295,
0.35734009742736816,
0.7529988884925842,
0.9591804146766663,
-1.7332662343978882,
-0.06615862250328064,
-0.4506056308746338,
-1.6521179676055908,
0.3870827555656433,
-0.21203452348709106,
0.4774394929409027... |
func New(lp *LogFile) (*LogFile, error) {
if lp == nil {
lp = new(LogFile)
if lp == nil {
return nil, fmt.Errorf("failed to create LogFile (out of memory?)")
}
}
if lp.FileName == "" {
if !defaultFileNameUsed {
lp.FileName = Defaults.FileName
// the logfile passed via the command line is only used o... | [
0.062175143510103226,
-0.6042436361312866,
0.7939308881759644,
-0.4052748382091522,
-0.03021334856748581,
0.20797397196292877,
0.2336357831954956,
-0.06020929291844368,
-0.7294909954071045,
-0.11338495463132858,
0.14665552973747253,
-0.028582295402884483,
-0.5381684303283691,
0.57507920265... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.