ets our very own Club Umpire Jack Stenson was there to officiate them as the umpire on the night.
Jack has gone from strength to strength with his umpiring since starting in 2017. He has become somewhat of a regular on the Gabba this year umpiring several of the Lions half time games this season.
From everyone at the Hornets well done to all the Juniors who took part in the half time games on Saturday night and a special thank you to Jack for all his hard work and good luck with your umpiring for the future.<reponame>GlobalWebIndex/github-labeler
package main

import (
	"errors"
	"fmt"
	"io"
	"log"
	"os"
	"strings"

	"github.com/b4b4r07/github-labeler/pkg/github"
	"github.com/google/go-cmp/cmp"
	"golang.org/x/sync/errgroup"
	yaml "gopkg.in/yaml.v2"
)

type CLI struct {
	Stdout io.Writer
	Stderr io.Writer
	Option Option

	Defined Config
	Actual  Config
	GitHub  *github.Client
}

type Option struct {
	DryRun  bool   `long:"dry-run" description:"Just dry run"`
	Config  string `long:"config" description:"Path to YAML file that labels are defined" default:"labels.yaml"`
	Import  bool   `long:"import" description:"Import existing labels if enabled"`
	Version bool   `long:"version" description:"Show version"`
}

func (c *CLI) Run(args []string) error {
	if c.Option.Version {
		fmt.Fprintf(c.Stdout, "%s (%s)\n", Version, Revision)
		return nil
	}

	cfg, err := loadConfig(c.Option.Config)
	if err!= nil {
		return err
	}
	c.Defined = cfg

	client, err := github.NewClient(c.Option.DryRun)
	if err!= nil {
		return err
	}
	c.GitHub = client

	if err := c.Validate(); err!= nil {
		// fmt.Fprintf(c.Stderr, "Note: %s\n", err)
		// return nil
		return err
	}

	if c.Option.Import {
		return c.Import()
	}

	return c.Sync()
}

// applyLabels creates/edits labels described in YAML
func (c *CLI) applyLabels(owner, repo string, label github.Label) error {
	ghLabel, err := c.GitHub.GetLabel(owner, repo, label)
	if err!= nil {
		return c.GitHub.CreateLabel(owner, repo, label)
	}

	if ghLabel.Description!= label.Description || ghLabel.Color!= label.Color {
		return c.GitHub.EditLabel(owner, repo, label)
	}

	return nil
}

// deleteLabels deletes the label not described in YAML but exists on GitHub
func (c *CLI) deleteLabels(owner, repo string) error {
	labels, err := c.GitHub.ListLabels(owner, repo)
	if err!= nil {
		return err
	}

	for _, label := range labels {
		if c.Defined.checkIfRepoHasLabel(owner+"/"+repo, label.Name) {
			// no need to delete
			continue
		}
		err := c.GitHub.DeleteLabel(owner, repo, label)
		if err!= nil {
			return err
		}
	}

	return nil
}

func (c *CLI) syncLabels(repo github.Repo) error {
	slugs := strings.Split(repo.Name, "/")
	if len(slugs)!= 2 {
		return fmt.Errorf("repository name %q is invalid", repo.Name)
	}
	for _, labelName := range repo.Labels {
		label, err := c.Defined.getDefinedLabel(labelName)
		if err!= nil {
			return err
		}
		err = c.applyLabels(slugs[0], slugs[1], label)
		if err!= nil {
			return err
		}
	}
	return c.deleteLabels(slugs[0], slugs[1])
}

func checkLabelDuplication(labels []github.Label, target github.Label) bool {
	for _, label := range labels {
		if cmp.Equal(label, target) {
			return true
		}
	}
	return false
}

func (c *CLI) Validate() error {
	if len(c.Defined.Repos) == 0 {
		return fmt.Errorf("no repos found in %s", c.Option.Config)
	}

	var cfg Config
	for _, repo := range c.Defined.Repos {
		slugs := strings.Split(repo.Name, "/")
		if len(slugs)!= 2 {
			// TODO: log
			continue
		}
		labels, err := c.GitHub.ListLabels(slugs[0], slugs[1])
		if err!= nil {
			log.Printf("[ERROR] failed to fetch labels %s/%s: %v", slugs[0], slugs[1], err)
			continue
		}
		var ls []string
		for _, label := range labels {
			ls = append(ls, label.Name)
		}
		repo.Labels = ls
		cfg.Repos = append(cfg.Repos, repo)
		for _, label := range labels {
			if checkLabelDuplication(cfg.Labels, label) {
				log.Printf("[WARN] %s is duplicate, so skip to add", label.Name)
				continue
			}
			cfg.Labels = append(cfg.Labels, label)
		}
	}

	// used for Import func
	c.Actual = cfg

	if cmp.Equal(cfg, c.Defined) {
		return errors.New("existing labels and defined labels are the same")
	}

	return nil
}

func (c *CLI) Import() error {
	f, err := os.Create(c.Option.Config)
	if err!= nil {
		return err
	}
	defer f.Close()
	return yaml.NewEncoder(f).Encode(&c.Actual)
}

// Sync syncs labels based on YAML
func (c *CLI) Sync() error {
	var eg errgroup.Group
	for _, repo := range c.Defined.Repos {
		repo := repo
		eg.Go(func() error {
			return c.syncLabels(repo)
		})
	}
	return eg.Wait()
}
We know you have a busy life, and sometimes, it’s not realistic to study for hours every day in the weeks leading up to your Wisconsin Real Estate licensing exam. That’s okay, even just a few hours with our prep guide will mean you are able to pass your WI exam confidently – first try.
On July 20, 1976, the NASA Viking 1 lander touched down on the surface of Mars. It was the first time humanity had ever gotten a close look at our neighbor planet. Scientists had no idea what they might find - strange rock formations, unfamiliar soil, maybe even alien life?
The experiments aimed at identifying Martian organisms turned up negative, or inconclusive, and decades of further exploration failed to find signs of life on the red planet. But at an event at NASA Langley Research Center Wednesday in honor of Viking's 40th birthday, NASA scientists said the search isn't over yet.
We spoke with Jim Green, the director of NASA's planetary sciences division, about the history of Viking and humankind's future on Mars.Kenneth L. "Bud" Nelson, age 86, passed away on Friday, May 3, 2019, at St. Mary's Hospital in Madison. He was born on August 1, 1932 in Winthrop, IA, the son of Leo and Verna (Swanson) Nelson.
Bud graduated from Winthrop High School in 1950. He served in the United States Army in 1952 to 1954, with the 9th Artillery Corps in Korea. On June 30, 1956, he was united in marriage to Doris Short at the Grace Methodist Church in Belleville. Bud worked at Federal Industries in Belleville and then later worked at the University of Wisconsin as a technician and machinist in the Civil Engineering and Chemistry Departments. He retired at the age of 62 after 30 years at the University, and had served as a union steward and board member. Bud was a member of the New Glarus Masonic Lodge #310 and VFW Post #2312 in Monroe. Bud