text:
package pkg

import (
	"strings"

	"github.com/blang/semver"
)

func GetNextChartVersion(current, next string) (ver string, err error) {
	current = strings.TrimPrefix(current, "v")
	next = strings.TrimPrefix(next, "v")
	// increseOnCurrent := false
	// if they are the same should keep the same
	defer func() {
		if ver != "" {
			ver = "v" + ver
		}
	}()
	if current == next {
		ver = current
		return
	}
	if next == "" {
		// increseOnCurrent = true
		next = current
	}
	var (
		curVer, nextVer semver.Version
		// currentMinor, nextMinor string
		// split                   []string
	)
	if curVer, err = semver.Make(current); err != nil {
		return
	}
	switch strings.Count(next, ".") {
	case 1:
		next = next + ".0"
	case 2:
		// perfect
	}
	if nextVer, err = semver.Make(next); err != nil {
		return
	}
	if nextVer.GT(curVer) {
		ver = nextVer.String()
		return
	}
	curVer.Patch++
	ver = curVer.String()
	// if nextVer.EQ(curVer) {

	// 	return
	// }

	return
}

repository: alauda/gitversion

repo_name: alauda/gitversion


text:
@inproceedings{meijer2004static,
  title={Static typing where possible, dynamic typing when needed: The end of the cold war between programming languages},
  author={Meijer, Erik and Drayton, Peter},
	year={2004},
  booktitle={Static typing where possible, dynamic typing when needed: The end of the cold war between programming languages}
}

@misc{lymanmuch,
  title={How much information? 2003. Research Project Report, UC Berkeley School of Information Management and Systems (October 2003)},
  author={Lyman, Peter and Varian, Hal R and Charles, Peter and Good, Nathan and Jordan, Laheem Lamar and Pal, Joyojeet}
}

@book{beck2003test,
  title={Test-driven development: by example},
  author={Beck, Kent},
  year={2003},
  publisher={Addison-Wesley Professional}
}

@inproceedings{meyer2007contract,
  title={Contract-driven development},
  author={Meyer, Bertrand},
  booktitle={International Conference on Fundamental Approaches to Software Engineering},
  pages={11--11},
  year={2007},
  organization={Springer}
}

@misc{staticbroken,
  title={Static typing will not save us from broken software},
  author={David R. Maclver},
  howpublished={http://www.drmaciver.com/2016/10/static-typing-will-not-save-us-from-broken-software/},
  year={2016},
  note={Accessed: 2017-04-05}
}

@misc{staticvsdynamic,
  title={The advantages of static typing, simply stated},
  author={Paul Chiusano},
  year={2016},
  howpublished={https://pchiusano.github.io/2016-09-15/static-vs-dynamic.html/},
  note={Accessed: 2017-04-05}
}

@inproceedings{tanimoto2013perspective,
  title={A perspective on the evolution of live programming},
  author={Tanimoto, Steven L},
  booktitle={Live Programming (LIVE), 2013 1st International Workshop on},
  pages={31--34},
  year={2013},
  organization={IEEE}
}

@book{halloway2009programming,
  title={Programming Clojure},
  author={Halloway, Stuart},
  year={2009},
  publisher={Pragmatic Bookshelf}
}

@book{fogus2011joy,
  title={The joy of Clojure},
  author={Fogus, Michael and Houser, Chris},
  year={2011},
  publisher={Manning}
}

@inproceedings{hickey2008clojure,
  title={The clojure programming language},
  author={Hickey, Rich},
  booktitle={Proceedings of the 2008 symposium on Dynamic languages},
  pages={1},
  year={2008},
  organization={ACM}
}

@inproceedings{madeyski2007impact,
  title={The impact of test-driven development on software development productivity—an empirical study},
  author={Madeyski, Lech and Sza{\l}a, {\L}ukasz},
  booktitle={European Conference on Software Process Improvement},
  pages={200--211},
  year={2007},
  organization={Springer}
}

@inproceedings{bonnaire2016practical,
  title={Practical optional types for Clojure},
  author={Bonnaire-Sergeant, Ambrose and Davies, Rowan and Tobin-Hochstadt, Sam},
  booktitle={European Symposium on Programming Languages and Systems},
  pages={68--94},
  year={2016},
  organization={Springer}
}

@inproceedings{nanz2015comparative,
  title={A comparative study of programming languages in Rosetta Code},
  author={Nanz, Sebastian and Furia, Carlo A},
  booktitle={Software Engineering (ICSE), 2015 IEEE/ACM 37th IEEE International Conference on},
  volume={1},
  pages={778--788},
  year={2015},
  organization={IEEE}
}

@inproceedings{chang2011impact,
  title={The impact of optional type information on jit compilation of dynamically typed languages},
  author={Chang, Mason and Mathiske, Bernd and Smith, Edwin and Chaudhuri, Avik and Gal, Andreas and Bebenita, Michael and Wimmer, Christian and Franz, Michael},
  booktitle={ACM SIGPLAN Notices},
  volume={47},
  pages={13--24},
  year={2011},
  organization={ACM}
}

@incollection{janes2014lean,
  title={Lean software development in action},
  author={Janes, Andrea and Succi, Giancarlo},
  booktitle={Lean Software Development in Action},
  pages={249--354},
  year={2014},
  publisher={Springer}
}

@article{tobin2008design,
  title={The design and implementation of typed scheme},
  author={Tobin-Hochstadt, Sam and Felleisen, Matthias},
  journal={ACM SIGPLAN Notices},
  volume={43},
  number={1},
  pages={395--406},
  year={2008},
  publisher={ACM}
}

@misc{clojuretypedescape,
  title={Why we're no longer using Core.typed},
  author={Marc O'Morain},
  year={2015},
  howpublished={https://circleci.com/blog/why-were-no-longer-using-core-typed/},
  note={Accessed: 2017-04-05}
}

@inproceedings{takikawa2016sound,
  title={Is sound gradual typing dead?},
  author={Takikawa, Asumu and Feltey, Daniel and Greenman, Ben and New, Max S and Vitek, Jan and Felleisen, Matthias},
  booktitle={ACM SIGPLAN Notices},
  volume={51},
  pages={456--468},
  year={2016},
  organization={ACM}
}

@misc{specific,
  title={Specific},
  author={Ben Rady},
  year={2016},
  howpublished={https://github.com/benrady/specific},
  note={Accessed: 2017-04-05}
}

@misc{readerspec,
  title={The reader},
  author={Rich Hickey},
  year={2017},
  howpublished={https://clojure.org/reference/reader},
  note={Accessed: 2017-04-05}
}

license: MIT

license_type: permissive

branch_name: refs/heads/master

extension: bib


text:
// Copyright (c) 2016 Pulcy.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package templates

import (
	"bytes"
	"os"
	"strconv"
	"text/template"

	"github.com/juju/errgo"
	logging "github.com/op/go-logging"

	"github.com/pulcy/gluon/util"
)

var (
	maskAny = errgo.MaskFunc(errgo.Any)
)

type TemplateConfigurator func(*template.Template)

// Render updates the given destinationPath according to the given template and options.
// Returns true if the file was created or changed, false if nothing has changed.
func Render(log *logging.Logger, templateName, destinationPath string, options interface{}, destinationFileMode os.FileMode, config ...TemplateConfigurator) (bool, error) {
	asset, err := Asset(templateName)
	if err != nil {
		return false, maskAny(err)
	}

	// parse template
	var tmpl *template.Template
	tmpl = template.New(templateName)
	funcMap := template.FuncMap{
		"escape": escape,
		"quote":  strconv.Quote,
	}
	tmpl.Funcs(funcMap)
	for _, c := range config {
		c(tmpl)
	}
	_, err = tmpl.Parse(string(asset))
	if err != nil {
		return false, maskAny(err)
	}
	// execute template to buffer
	buf := &bytes.Buffer{}
	tmpl.Funcs(funcMap)
	err = tmpl.Execute(buf, options)
	if err != nil {
		return false, maskAny(err)
	}

	// Update file
	changed, err := util.UpdateFile(log, destinationPath, buf.Bytes(), destinationFileMode)
	return changed, maskAny(err)
}

func escape(s string) string {
	s = strconv.Quote(s)
	return s[1 : len(s)-1]
}

repository: pulcy/gluon

repo_name: pulcy/gluon

gha_language: Go

extension: go


text:
package versions

import (
	"errors"
	"net/http"

	"github.com/IBM/satcon-client-go/client/auth"
	"github.com/IBM/satcon-client-go/client/types"
	"github.com/IBM/satcon-client-go/client/web"
)

// VersionService is the interface used to perform all channel-version-centric actions
// in Satellite Config.
//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 . VersionService
type VersionService interface {
	AddChannelVersion(orgId, channelUuid, name string, content []byte, description string) (*AddChannelVersionResponseDataDetails, error)
	RemoveChannelVersion(orgId, uuid string) (*RemoveChannelVersionResponseDataDetails, error)
	ChannelVersion(orgID, channelUuid, versionUuid string) (*types.DeployableVersion, error)
	ChannelVersionByName(orgID, channelName, versionName string) (*types.DeployableVersion, error)
}

// Client is an implementation of a satcon client.
type Client struct {
	web.SatConClient
}

// NewClient returns a configured instance of ClusterService which can then be used
// to perform cluster queries against Satellite Config.
func NewClient(endpointURL string, httpClient web.HTTPClient, authClient auth.AuthClient) (VersionService, error) {
	if endpointURL == "" {
		return nil, errors.New("Must supply a valid endpoint URL")
	}

	s := web.SatConClient{
		Endpoint:   endpointURL,
		HTTPClient: http.DefaultClient,
		AuthClient: authClient,
	}

	if httpClient != nil {
		s.HTTPClient = httpClient
	}

	return &Client{
		s,
	}, nil
}

repository: froesef/satcon-client-go

repo_name: froesef/satcon-client-go

branch_name: refs/heads/main

gha_license_id: MIT


text:
package github

import (
	"fmt"
	"regexp"
	"testing"

	"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)

func TestAccGithubRepositoryDataSource(t *testing.T) {

	t.Run("queries a repository without error", func(t *testing.T) {

		config := fmt.Sprintf(`
			data "github_repositories" "test" {
				query = "org:%s"
			}

			data "github_repository" "test" {
				full_name = data.github_repositories.test.full_names.0
			}
		`, testOrganization)

		check := resource.ComposeTestCheckFunc(
			resource.TestMatchResourceAttr(
				"data.github_repositories.test", "full_names.0",
				regexp.MustCompile(`^`+testOrganization)),
			resource.TestMatchResourceAttr(
				"data.github_repository.test", "full_name",
				regexp.MustCompile(`^`+testOrganization)),
		)

		testCase := func(t *testing.T, mode string) {
			resource.Test(t, resource.TestCase{
				PreCheck:  func() { skipUnlessMode(t, mode) },
				Providers: testAccProviders,
				Steps: []resource.TestStep{
					{
						Config: config,
						Check:  check,
					},
				},
			})
		}

		t.Run("with an anonymous account", func(t *testing.T) {
			testCase(t, anonymous)
		})

		t.Run("with an individual account", func(t *testing.T) {
			testCase(t, individual)
		})

		t.Run("with an organization account", func(t *testing.T) {
			testCase(t, organization)
		})

	})

	t.Run("raises expected errors when querying for a repository", func(t *testing.T) {

		config := map[string]string{
			"no_match_name": `
				data "github_repository" "no_match_name" {
					name = "owner/repo"
				}
			`,
			"no_match_fullname": `
				data "github_repository" "no_match_fullname" {
					full_name = "owner/repo"
				}
			`,
		}

		testCase := func(t *testing.T, mode string) {
			resource.Test(t, resource.TestCase{
				PreCheck:  func() { skipUnlessMode(t, mode) },
				Providers: testAccProviders,
				Steps: []resource.TestStep{
					{
						Config:      config["no_match_name"],
						ExpectError: regexp.MustCompile(`Not Found`),
					},
					{
						Config:      config["no_match_fullname"],
						ExpectError: regexp.MustCompile(`Not Found`),
					},
				},
			})
		}

		t.Run("with an anonymous account", func(t *testing.T) {
			testCase(t, anonymous)
		})

		t.Run("with an individual account", func(t *testing.T) {
			testCase(t, individual)
		})

		t.Run("with an organization account", func(t *testing.T) {
			testCase(t, organization)
		})
	})
}

repository: liamg/terraform-provider-github

repo_name: liamg/terraform-provider-github


text:
set ( SB_PROJECT GDAL )
SETUP_SUPERBUILD( PROJECT ${SB_PROJECT} )

set( GDAL_MAJOR 2 )
set( GDAL_MINOR 2 )
set( GDAL_BUILD 0 )
set( GDAL_VERSION "${GDAL_MAJOR}.${GDAL_MINOR}.${GDAL_BUILD}" )

ExternalProject_Add(
    ${SB_PROJECT}
    PREFIX  ${SB_PROJECT}
    DEPENDS GEOS
    URL "http://download.osgeo.org/gdal/${GDAL_VERSION}/gdal${GDAL_MAJOR}${GDAL_MINOR}${GDAL_BUILD}.zip"
    URL_MD5 784333109a92b49efd299caa181064e3
    INSTALL_DIR ${SB_INSTALL_DIR}
    CONFIGURE_COMMAND LD_LIBRARY_PATH=${SB_INSTALL_DIR}/lib <SOURCE_DIR>/configure --prefix=${SB_INSTALL_DIR} --with-geos=${SB_INSTALL_DIR}/bin/geos-config
    BUILD_IN_SOURCE 1
    BUILD_COMMAND $(MAKE)
    INSTALL_COMMAND $(MAKE) install
)

repository: anishitani/cmake-superbuild

repo_name: anishitani/cmake-superbuild

extension: cmake


text:
@article{Hill_2017,
 author = {Hill, Tom and Unckless, Robert L.},
 title = {Baculovirus Molecular Evolution via Gene Turnover and Recurrent Positive Selection of Key Genes},
 journal = {Journal of Virology},
 publisher = {American Society for Microbiology},
 year = {2017},
 month = {aug},
 number = {22},
 volume = {91},
 url = {https://doi.org/10.1128%2Fjvi.01319-17},
 doi = {10.1128/jvi.01319-17},
 editor = {Pfeiffer, Julie K.}
}


text:
/*
Copyright 2021 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package repo

import (
	"context"
	"fmt"
	"io/ioutil"
	"net/http"
	"os"
	"path/filepath"
	"strconv"
	"strings"

	"github.com/google/go-github/v33/github"
	"github.com/pkg/errors"
	"github.com/sirupsen/logrus"
	"golang.org/x/oauth2"

	krgh "k8s.io/release/pkg/github"
	"k8s.io/test-infra/prow/git"

	"k8s.io/enhancements/api"
	"k8s.io/enhancements/pkg/kepval"
	"k8s.io/enhancements/pkg/yaml"
)

const (
	ProposalPathStub         = "keps"
	ProposalTemplatePathStub = "NNNN-kep-template"
	ProposalFilename         = "README.md"
	ProposalMetadataFilename = "kep.yaml"

	PRRApprovalPathStub = "prod-readiness"

	remoteOrg  = "kubernetes"
	remoteRepo = "enhancements"

	proposalLabel = "kind/kep"
)

type Repo struct {
	// Paths
	BasePath        string
	ProposalPath    string
	PRRApprovalPath string
	ProposalReadme  string

	// Auth
	TokenPath string
	Token     string

	// Document handlers
	KEPHandler *api.KEPHandler
	PRRHandler *api.PRRHandler

	// Templates
	ProposalTemplate []byte

	// Temporary caches
	// a local git clone of remoteOrg/remoteRepo
	gitRepo *git.Repo
	// all open pull requests for remoteOrg/remoteRepo
	allPRs []*github.PullRequest
}

// New returns a new repo client configured to use the the normal os.Stdxxx and Filesystem
func New(repoPath string) (*Repo, error) {
	fetcher := api.DefaultGroupFetcher()
	return NewRepo(repoPath, fetcher)
}

func NewRepo(repoPath string, fetcher api.GroupFetcher) (*Repo, error) {
	var err error
	if repoPath == "" {
		repoPath, err = os.Getwd()
		if err != nil {
			return nil, fmt.Errorf("unable to determine enhancements repo path: %s", err)
		}
	}

	proposalPath := filepath.Join(repoPath, ProposalPathStub)
	fi, err := os.Stat(proposalPath)
	if err != nil {
		return nil, errors.Wrapf(
			err,
			"getting file info for proposal path %s",
			proposalPath,
		)
	}

	if !fi.IsDir() {
		return nil, errors.Wrap(
			err,
			"checking if proposal path is a directory",
		)
	}

	prrApprovalPath := filepath.Join(proposalPath, PRRApprovalPathStub)
	fi, err = os.Stat(prrApprovalPath)
	if err != nil {
		return nil, errors.Wrapf(
			err,
			"getting file info for PRR approval path %s",
			prrApprovalPath,
		)
	}

	if !fi.IsDir() {
		return nil, errors.Wrap(
			err,
			"checking if PRR approval path is a directory",
		)
	}

	proposalReadme := filepath.Join(proposalPath, "README.md")
	fi, err = os.Stat(proposalReadme)
	if err != nil {
		return nil, errors.Wrapf(
			err,
			"getting file info for proposal README path %s",
			proposalPath,
		)
	}

	if !fi.Mode().IsRegular() {
		return nil, errors.Wrap(
			err,
			"checking if proposal README is a file",
		)
	}

	groups, err := fetcher.FetchGroups()
	if err != nil {
		return nil, fmt.Errorf("fetching groups: %w", err)
	}

	prrApprovers, err := fetcher.FetchPRRApprovers()
	if err != nil {
		return nil, fmt.Errorf("fetching PRR approvers: %w", err)
	}

	kepHandler := &api.KEPHandler{Groups: groups, PRRApprovers: prrApprovers}

	prrHandler := &api.PRRHandler{PRRApprovers: prrApprovers}

	repo := &Repo{
		BasePath:        repoPath,
		ProposalPath:    proposalPath,
		PRRApprovalPath: prrApprovalPath,
		ProposalReadme:  proposalReadme,
		KEPHandler:      kepHandler,
		PRRHandler:      prrHandler,
	}

	proposalTemplate, err := repo.getProposalTemplate()
	if err != nil {
		return nil, errors.Wrap(err, "getting proposal template")
	}

	repo.ProposalTemplate = proposalTemplate

	// build a default client with normal os.Stdxx and Filesystem access. Tests can build their own
	// with appropriate test objects
	return repo, nil
}

func (r *Repo) SetGitHubToken(tokenFile string) error {
	if tokenFile != "" {
		token, err := ioutil.ReadFile(tokenFile)
		if err != nil {
			return err
		}
		r.Token = strings.Trim(string(token), "\n\r")
	}
	return nil
}

// getProposalTemplate reads the KEP template from the local clone of
// kubernetes/enhancements.
func (r *Repo) getProposalTemplate() ([]byte, error) {
	path := filepath.Join(
		r.ProposalPath,
		ProposalTemplatePathStub,
		ProposalFilename,
	)

	return ioutil.ReadFile(path)
}

func (r *Repo) findLocalKEPMeta(sig string) ([]string, error) {
	sigPath := filepath.Join(r.ProposalPath, sig)

	keps := []string{}

	// if the SIG doesn't have a dir, it has no KEPs
	if _, err := os.Stat(sigPath); os.IsNotExist(err) {
		return keps, nil
	}

	err := filepath.Walk(
		sigPath,
		func(path string, info os.FileInfo, err error) error {
			logrus.Debugf("processing filename %s", info.Name())

			if err != nil {
				return err
			}

			// true if the file is a symlink
			if info.Mode()&os.ModeSymlink != 0 {
				// Assume symlink from old KEP location to new. The new location
				// will be processed separately, so no need to process it here.
				logrus.Debugf("%s is a symlink", info.Name())
				return nil
			}

			if !info.Mode().IsRegular() {
				return nil
			}

			if info.Name() == ProposalMetadataFilename {
				logrus.Debugf("adding %s as KEP metadata", info.Name())
				path, err = filepath.Rel(r.BasePath, path)
				if err != nil {
					return err
				}
				keps = append(keps, path)
				return filepath.SkipDir
			}

			if info.Name() == ProposalFilename {
				return nil
			}

			return nil
		},
	)

	return keps, err
}

func (r *Repo) LoadLocalKEPs(sig string) ([]*api.Proposal, error) {
	// KEPs in the local filesystem
	files, err := r.findLocalKEPMeta(sig)
	if err != nil {
		return nil, errors.Wrapf(
			err,
			"searching for local KEPs from %s",
			sig,
		)
	}

	logrus.Debugf("loading the following local KEPs: %v", files)

	allKEPs := make([]*api.Proposal, len(files))
	for i, kepYamlPath := range files {
		kep, err := r.loadKEPFromYaml(r.BasePath, kepYamlPath)
		if err != nil {
			return nil, errors.Wrapf(
				err,
				"reading KEP %s from yaml",
				kepYamlPath,
			)
		}

		allKEPs[i] = kep
	}

	logrus.Debugf("returning %d local KEPs", len(allKEPs))

	return allKEPs, nil
}

func (r *Repo) LoadLocalKEP(sig, name string) (*api.Proposal, error) {
	kepPath := filepath.Join(
		ProposalPathStub,
		sig,
		name,
		ProposalMetadataFilename,
	)

	_, err := os.Stat(kepPath)
	if err != nil {
		return nil, errors.Wrapf(err, "getting file info for %s", kepPath)
	}

	return r.loadKEPFromYaml(r.BasePath, kepPath)
}

func (r *Repo) LoadPullRequestKEPs(sig string) ([]*api.Proposal, error) {
	// Initialize github client
	logrus.Debugf("Initializing github client to load PRs for sig: %v", sig)
	var auth *http.Client
	ctx := context.Background()
	if r.Token != "" {
		ts := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: r.Token})
		auth = oauth2.NewClient(ctx, ts)
	}
	gh := github.NewClient(auth)

	// Fetch list of all PRs if none exists
	if r.allPRs == nil {
		logrus.Debugf("Initializing list of all PRs for %v/%v", remoteOrg, remoteRepo)
		r.allPRs = []*github.PullRequest{}

		opt := &github.PullRequestListOptions{
			ListOptions: github.ListOptions{
				PerPage: 100,
			},
		}

		for {
			pulls, resp, err := gh.PullRequests.List(
				ctx,
				remoteOrg,
				remoteRepo,
				opt,
			)
			if err != nil {
				return nil, err
			}

			r.allPRs = append(r.allPRs, pulls...)
			if resp.NextPage == 0 {
				break
			}

			opt.Page = resp.NextPage
		}
	}

	// Find KEP PRs for the given sig
	kepPRs := []*github.PullRequest{}
	sigLabel := strings.Replace(sig, "-", "/", 1)
	logrus.Debugf("Searching list of %v PRs for %v/%v with labels: [%v, %v]", len(r.allPRs), remoteOrg, remoteRepo, sigLabel, proposalLabel)
	for _, pr := range r.allPRs {
		foundKind, foundSIG := false, false

		for _, l := range pr.Labels {
			if *l.Name == proposalLabel {
				foundKind = true
			}

			if *l.Name == sigLabel {
				foundSIG = true
			}
		}

		if !foundKind || !foundSIG {
			continue
		}

		logrus.Debugf("Found #%v", pr.GetHTMLURL())

		kepPRs = append(kepPRs, pr)
	}
	logrus.Debugf("Found %v PRs for %v/%v with labels: [%v, %v]", len(kepPRs), remoteOrg, remoteRepo, sigLabel, proposalLabel)

	if len(kepPRs) == 0 {
		return nil, nil
	}

	// Pull a temporary clone of the repo if none already exists
	if r.gitRepo == nil {
		g, err := git.NewClient()
		if err != nil {
			return nil, err
		}

		g.SetCredentials("", func() []byte { return []byte{} })
		g.SetRemote(krgh.GitHubURL)

		r.gitRepo, err = g.Clone(remoteOrg, remoteRepo)
		if err != nil {
			return nil, err
		}
	}

	// read out each PR, and create a Proposal for each KEP that is
	// touched by a PR. This may result in multiple versions of the same KEP.
	var allKEPs []*api.Proposal
	for _, pr := range kepPRs {
		logrus.Debugf("Getting list of files for %v", pr.GetHTMLURL())
		files, _, err := gh.PullRequests.ListFiles(
			context.Background(),
			remoteOrg,
			remoteRepo,
			pr.GetNumber(),
			&github.ListOptions{},
		)
		if err != nil {
			return nil, err
		}

		kepNames := make(map[string]bool, 10)
		for _, file := range files {
			if !strings.HasPrefix(*file.Filename, "keps/"+sig+"/") {
				continue
			}

			kk := strings.Split(*file.Filename, "/")
			if len(kk) < 3 {
				continue
			}

			if strings.HasSuffix(kk[2], ".md") {
				kepNames[kk[2][0:len(kk[2])-3]] = true
			} else {
				kepNames[kk[2]] = true
			}
		}

		if len(kepNames) == 0 {
			continue
		}

		err = r.gitRepo.CheckoutPullRequest(pr.GetNumber())
		if err != nil {
			return nil, err
		}

		// read all these KEPs
		for k := range kepNames {
			kepPath := filepath.Join(
				ProposalPathStub,
				sig,
				k,
				ProposalMetadataFilename,
			)
			kep, err := r.loadKEPFromYaml(r.gitRepo.Directory(), kepPath)
			if err != nil {
				logrus.Warnf("error reading KEP %v: %v", k, err)
			} else {
				kep.PRNumber = strconv.Itoa(pr.GetNumber())
				allKEPs = append(allKEPs, kep)
			}
		}
	}

	return allKEPs, nil
}

// loadKEPFromYaml will return a Proposal from a kep.yaml at the given kepPath
// within the given repoPath, or an error if the Proposal is invalid
func (r *Repo) loadKEPFromYaml(repoPath, kepPath string) (*api.Proposal, error) {
	fullKEPPath := filepath.Join(repoPath, kepPath)
	b, err := ioutil.ReadFile(fullKEPPath)
	if err != nil {
		return nil, fmt.Errorf("unable to read KEP metadata for %s: %w", fullKEPPath, err)
	}

	var p api.Proposal
	err = yaml.UnmarshalStrict(b, &p)
	if err != nil {
		return nil, fmt.Errorf("unable to load KEP metadata: %s", err)
	}

	p.Name = filepath.Base(filepath.Dir(kepPath))
	prrApprovalPath := filepath.Join(repoPath, ProposalPathStub, PRRApprovalPathStub)

	// Read the PRR approval file and add any listed PRR approvers in there
	// to the PRR approvers list in the KEP. this is a hack while we transition
	// away from PRR approvers listed in kep.yaml
	handler := r.PRRHandler
	err = kepval.ValidatePRR(&p, handler, prrApprovalPath)
	if err != nil {
		logrus.Errorf(
			"%v",
			errors.Wrapf(err, "validating PRR for %s", p.Name),
		)
	}

	return &p, nil
}

repository: kubernetes/enhancements

repo_name: kubernetes/enhancements


text:
@inproceedings{GomezBarrero-FpPadSwirSVM-NISK-2018,
 author = {M. Gomez-Barrero and J. Kolberg and C. Busch},
 booktitle = {Proc. Norwegian Information Security Conf. (NISK)},
 groups = {BATL},
 month = {September},
 title = {Towards Fingerprint Presentation Attack Detection Based on Short Wave Infrared Imaging and Spectral Signatures},
 year = {2018}
}

repository: mgbarrero/academic-kickstart

repo_name: mgbarrero/academic-kickstart


text:
DESCRIPTION = "Ethernet/FDDI station activity monitor"
LICENSE = "BSD"
SECTION = "network"
HOMEPAGE = "http://www-nrg.ee.lbl.gov/"
RRECOMMENDS = "arpwatch-data"

SRC_URI = "ftp://ftp.ee.lbl.gov/arpwatch-${PV}.tar.gz \
    file://05debian_fhs.patch;patch=1 \
    file://06debian_manpages.patch;patch=1 \
    file://init.d \
    file://arpwatch.default \
    file://arpwatch.conf \
    file://ethercodes.dat \
    file://make.patch;patch=1"

inherit autotools

EXTRA_OEMAKE = "LDFLAGS=-L${STAGING_LIBDIR}"

fakeroot do_install() {
    install -d ${D}${bindir} ${D}${sbindir} ${D}${mandir}/man8 \
               ${D}${sysconfdir}/default \
               ${D}${sysconfdir}/init.d \
               ${D}${datadir}/arpwatch

    oe_runmake install DESTDIR=${D}
    oe_runmake install-man DESTDIR=${D}

    install -m 0755 ${S}/arp2ethers         ${D}${sbindir}
    install -m 0755 ${S}/arpfetch           ${D}${sbindir}
    install -m 0755 ${S}/bihourly           ${D}${sbindir}
    install -m 0755 ${S}/massagevendor      ${D}${sbindir}

    install -m 0644 ${S}/arp2ethers.8      ${D}${mandir}/man8
    install -m 0644 ${S}/arpfetch.8        ${D}${mandir}/man8
    install -m 0644 ${S}/bihourly.8        ${D}${mandir}/man8
    install -m 0644 ${S}/massagevendor.8   ${D}${mandir}/man8

    install -m 0755 ${WORKDIR}/init.d      ${D}${sysconfdir}/init.d/arpwatch
    install -m 0644 ${WORKDIR}/arpwatch.default   ${D}${sysconfdir}/default/arpwatch
    install -m 0644 ${WORKDIR}/arpwatch.conf      ${D}${sysconfdir}

    install -m 0644 ${WORKDIR}/ethercodes.dat     ${D}${datadir}/arpwatch
}

PACKAGES =+ "arpwatch-data"
FILES_arpwatch-data = "${datadir}/arpwatch/ethercodes.dat"

repository: Terentyev/familiar-linux

repo_name: Terentyev/familiar-linux

extension: bb


text:
package engine

type Point struct {
	X int
	Y int
}

func (p Point) Unpack() (x int, y int) {
	return p.X, p.Y
}

func (p *Point) Set(x int, y int) {
	p.X = x
	p.Y = y
}

func (p *Point) Translate(dx int, dy int) {
	p.X += dx
	p.Y += dy
}


text:
ANDROID_HEADERS_BRANCH = "herrie/halium-9.0-proper"

require recipes-android/android-headers/android-headers.inc

PKGV .= "+gitr${SRCPV}"
SRCREV = "37049b151165c6bf8c383a1d8842906d973733c8"

ANDROID_API = "28"

repository: shr-distribution/meta-smartphone

repo_name: shr-distribution/meta-smartphone

gha_language: Roff


text:
@misc{noauthor_uci_nodate,
	title = {{UCI} {Machine} {Learning} {Repository}: {Diabetes} 130-{US} hospitals for years 1999-2008 {Data} {Set}},
	url = {https://archive.ics.uci.edu/ml/datasets/diabetes+130-us+hospitals+for+years+1999-2008},
	urldate = {2021-08-20},
	file = {UCI Machine Learning Repository\: Diabetes 130-US hospitals for years 1999-2008 Data Set:C\:\\Users\\brand\\Zotero\\storage\\2VCJHBP3\\diabetes+130-us+hospitals+for+years+1999-2008.html:text/html},
}

@article{noauthor_national_2020,
	title = {National {Diabetes} {Statistics} {Report} 2020. {Estimates} of diabetes and its burden in the {United} {States}.},
	language = {en},
	year = {2020},
	pages = {32},
	file = {2020 - National Diabetes Statistics Report 2020. Estimate.pdf:C\:\\Users\\brand\\Zotero\\storage\\G7F8UG2R\\2020 - National Diabetes Statistics Report 2020. Estimate.pdf:application/pdf},
}

@article{spanakis_raceethnic_2013,
	title = {Race/{Ethnic} {Difference} in {Diabetes} and {Diabetic} {Complications}},
	volume = {13},
	issn = {1534-4827},
	url = {https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3830901/},
	doi = {10.1007/s11892-013-0421-9},
	abstract = {Health disparities in diabetes and its complications and co-morbidities exist globally. A recent Endocrine Society Scientific Statement described the Health Disparities in several endocrine disorders, including type 2 diabetes. In this review we summarize that statement and provide novel updates on race/ethnic differences in children and adults with type 1 diabetes, children with type 2 diabetes and in Latino subpopulations. We also review race/ethnic differences in the epidemiology of diabetes, prediabetes, and diabetes complications and mortality in the United States and globally. Finally we discuss biological, behavioral, social, environmental, and health system contributors to diabetes disparities in order to identify areas for future preventive interventions.},
	number = {6},
	urldate = {2021-08-20},
	journal = {Current diabetes reports},
	author = {Spanakis, Elias K. and Golden, Sherita Hill},
	month = dec,
	year = {2013},
	pmid = {24037313},
	pmcid = {PMC3830901},
	pages = {10.1007/s11892--013--0421--9},
	file = {PubMed Central Full Text PDF:C\:\\Users\\brand\\Zotero\\storage\\LM8J6YU5\\Spanakis and Golden - 2013 - RaceEthnic Difference in Diabetes and Diabetic Co.pdf:application/pdf},
}

@misc{cdc_all_2018,
	title = {All {About} {Your} {A1C}},
	url = {https://bit.ly/2Nc2IA0},
	abstract = {Want to know what your blood sugar has been up to lately? Get an A1C test to find out your average levels for the last 3 months—and why that info is important to know: https://bit.ly/2Nc2IA0},
	language = {en-us},
	urldate = {2021-08-20},
	journal = {Centers for Disease Control and Prevention},
	author = {CDC},
	month = aug,
	year = {2018},
}

@article{robinson_hospital_2017,
	title = {The {HOSPITAL} score and {LACE} index as predictors of 30 day readmission in a retrospective study at a university-affiliated community hospital},
	volume = {5},
	issn = {2167-8359},
	url = {https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5374974/},
	doi = {10.7717/peerj.3137},
	abstract = {Introduction
Hospital readmissions are common, expensive, and a key target of the Medicare Value Based Purchasing (VBP) program. Validated risk assessment tools such as the HOSPITAL score and LACE index have been developed to identify patients at high risk of hospital readmission so they can be targeted for interventions aimed at reducing the rate of readmission. This study aims to evaluate the utility of HOSPITAL score and LACE index for predicting hospital readmission within 30 days in a moderate-sized university affiliated hospital in the midwestern United States.

Materials and Methods
All adult medical patients who underwent one or more ICD-10 defined procedures discharged from the SIU-SOM Hospitalist service from Memorial Medical Center (MMC) from October 15, 2015 to March 16, 2016, were studied retrospectively to determine if the HOSPITAL score and LACE index were a significant predictors of hospital readmission within 30 days.

Results
During the study period, 463 discharges were recorded for the hospitalist service. The analysis includes data for the 432 discharges. Patients who died during the hospital stay, were transferred to another hospital, or left against medical advice were excluded. Of these patients, 35 (8\%) were readmitted to the same hospital within 30 days. A receiver operating characteristic evaluation of the HOSPITAL score for this patient population shows a C statistic of 0.75 (95\% CI [0.67–0.83]), indicating good discrimination for hospital readmission. The Brier score for the HOSPITAL score in this setting was 0.069, indicating good overall performance. The Hosmer–Lemeshow goodness of fit test shows a χ2 value of 3.71 with a p value of 0.59. A receiver operating characteristic evaluation of the LACE index for this patient population shows a C statistic of 0.58 (95\% CI [0.48–0.68]), indicating poor discrimination for hospital readmission. The Brier score for the LACE index in this setting was 0.082, indicating good overall performance. The Hosmer–Lemeshow goodness of fit test shows a χ2 value of 4.97 with a p value of 0.66.

Discussion
This single center retrospective study indicates that the HOSPITAL score has superior discriminatory ability when compared to the LACE index as a predictor of hospital readmission within 30 days at a medium-sized university-affiliated teaching hospital.

Conclusions
The internationally validated HOSPITAL score may be superior to the LACE index in moderate-sized community hospitals to identify patients at high risk of hospital readmission within 30 days.},
	urldate = {2021-08-20},
	journal = {PeerJ},
	author = {Robinson, Robert and Hudali, Tamer},
	month = mar,
	year = {2017},
	pmid = {28367375},
	pmcid = {PMC5374974},
	pages = {e3137},
	file = {PubMed Central Full Text PDF:C\:\\Users\\brand\\Zotero\\storage\\7D8MMXTF\\Robinson and Hudali - 2017 - The HOSPITAL score and LACE index as predictors of.pdf:application/pdf},
}

@misc{noauthor_11061813_nodate,
	title = {[1106.1813] {SMOTE}: {Synthetic} {Minority} {Over}-sampling {Technique}},
	url = {https://arxiv.org/abs/1106.1813},
	urldate = {2021-08-20},
}

@article{soh_predictors_2020,
	title = {Predictors of 30-day unplanned hospital readmission among adult patients with diabetes mellitus: a systematic review with meta-analysis},
	volume = {8},
	copyright = {© Author(s) (or their employer(s)) 2020. Re-use permitted under CC BY-NC. No commercial re-use. See rights and permissions. Published by BMJ.. http://creativecommons.org/licenses/by-nc/4.0/This is an open access article distributed in accordance with the Creative Commons Attribution Non Commercial (CC BY-NC 4.0) license, which permits others to distribute, remix, adapt, build upon this work non-commercially, and license their derivative works on different terms, provided the original work is properly cited, appropriate credit is given, any changes made indicated, and the use is non-commercial. See: http://creativecommons.org/licenses/by-nc/4.0/.},
	issn = {2052-4897},
	shorttitle = {Predictors of 30-day unplanned hospital readmission among adult patients with diabetes mellitus},
	url = {https://drc.bmj.com/content/8/1/e001227},
	doi = {10.1136/bmjdrc-2020-001227},
	abstract = {Adult patients with diabetes mellitus (DM) represent one-fifth of all 30-day unplanned hospital readmissions but some may be preventable through continuity of care with better DM self-management. We aim to synthesize evidence concerning the association between 30-day unplanned hospital readmission and patient-related factors, insurance status, treatment and comorbidities in adult patients with DM. We searched full-text English language articles in three electronic databases (MEDLINE, Embase and CINAHL) without confining to a particular publication period or geographical area. Prospective and retrospective cohort and case–control studies which identified significant risk factors of 30-day unplanned hospital readmission were included, while interventional studies were excluded. The study participants were aged ≥18 years with either type 1 or 2 DM. The random effects model was used to quantify the overall effect of each factor. Twenty-three studies published between 1998 and 2018 met the selection criteria and 18 provided information for the meta-analysis. The data were collected within a period ranging from 1 to 15 years. Although patient-related factors such as age, gender and race were identified, comorbidities such as heart failure (OR=1.81, 95\% CI 1.67 to 1.96) and renal disease (OR=1.69, 95\% CI 1.34 to 2.12), as well as insulin therapy (OR=1.45, 95\% CI 1.24 to 1.71) and insurance status (OR=1.41, 95\% CI 1.22 to 1.63) were stronger predictors of 30-day unplanned hospital readmission. The findings may be used to target DM self-management education at vulnerable groups based on comorbidities, insurance type, and insulin therapy.},
	language = {en},
	number = {1},
	urldate = {2021-08-20},
	journal = {BMJ Open Diabetes Research and Care},
	author = {Soh, Jade Gek Sang and Wong, Wai Pong and Mukhopadhyay, Amartya and Quek, Swee Chye and Tai, Bee Choo},
	month = aug,
	year = {2020},
	pmid = {32784248},
	note = {Publisher: BMJ Specialist Journals
Section: Clinical Care/Education/Nutrition},
	keywords = {adult diabetes, risk predictors},
	pages = {e001227},
	file = {Full Text PDF:C\:\\Users\\brand\\Zotero\\storage\\R9VXZH2Q\\Soh et al. - 2020 - Predictors of 30-day unplanned hospital readmissio.pdf:application/pdf;Snapshot:C\:\\Users\\brand\\Zotero\\storage\\A82HM7S5\\e001227.html:text/html},
}

@misc{noauthor_hospital_nodate,
	title = {Hospital {Readmissions} {Reduction} {Program} ({HRRP}) {\textbar} {CMS}},
	url = {https://www.cms.gov/Medicare/Medicare-Fee-for-Service-Payment/AcuteInpatientPPS/Readmissions-Reduction-Program},
	urldate = {2021-08-20},
}

@misc{noauthor_hospital_nodate-1,
	title = {Hospital {Adjusted} {Expenses} per {Inpatient} {Day} {\textbar} {KFF}},
	url = {https://www.kff.org/health-costs/state-indicator/expenses-per-inpatient-day/?currentTimeframe=0&sortModel=%7B%22colId%22:%22Location%22,%22sort%22:%22asc%22%7D},
	urldate = {2021-08-20},
}

@article{bailey_characteristics_nodate,
	title = {Characteristics of 30-{Day} {All}-{Cause} {Hospital} {Readmissions}, 2010-2016},
	language = {en},
	author = {Bailey, Molly K and Barrett, Marguerite L},
	pages = {14},
	file = {Bailey and Barrett - Characteristics of 30-Day All-Cause Hospital Readm.pdf:C\:\\Users\\brand\\Zotero\\storage\\659FSEY8\\Bailey and Barrett - Characteristics of 30-Day All-Cause Hospital Readm.pdf:application/pdf},
}

@misc{noauthor_cureus_nodate,
	title = {Cureus {\textbar} {Impact} of {Length} of {Stay} on {Readmission} in {Hospitalized} {Patients}},
	url = {https://www.cureus.com/articles/40535-impact-of-length-of-stay-on-readmission-in-hospitalized-patients},
	urldate = {2021-08-20},
}

@article{naylor_comprehensive_1994,
	title = {Comprehensive {Discharge} {Planning} for the {Hospitalized} {Elderly}},
	volume = {120},
	issn = {0003-4819},
	url = {https://www.acpjournals.org/doi/10.7326/0003-4819-120-12-199406150-00005},
	doi = {10.7326/0003-4819-120-12-199406150-00005},
	number = {12},
	urldate = {2021-08-20},
	journal = {Annals of Internal Medicine},
	author = {Naylor, Mary and Brooten, Dorothy and Jones, Robert and Lavizzo-Mourey, Risa and Mezey, Mathy and Pauly, Mark},
	month = jun,
	year = {1994},
	note = {Publisher: American College of Physicians},
	pages = {999--1006},
}

@misc{uncanny-valley_diabetes_readmission_2021,
	title = {diabetes\_readmission},
	copyright = {MIT},
	url = {https://github.com/uncanny-valley/diabetes-readmission},
	urldate = {2021-08-20},
	author = {uncanny-valley},
	month = aug,
	year = {2021},
	note = {original-date: 2021-05-02T21:45:40Z},
}

repository: uncanny-valley/diabetes-readmission

repo_name: uncanny-valley/diabetes-readmission


text:
DESCRIPTION = "Gourmet is a MealMaster-compatible recipe manager"
AUTHOR = "Thomas Hinkle <thomas_hinkle@users.sourceforge.net>"
HOMEPAGE = "http://grecipe-manager.sf.net"
PRIORITY = "optional"
LICENSE = "GPL"
DEPENDS = "gtk+ python-pygtk"
RDEPENDS_${PN} = "python-core"
PR = "r1"

SRC_URI = "${SOURCEFORGE_MIRROR}/grecipe-manager/${PN}-${PV}.tar.gz"

inherit distutils

SRC_URI[md5sum] = "d18be0dd5faf7249f657c4cc87105c31"
SRC_URI[sha256sum] = "d1130c71a876f333707aa8dd8b9689a0aaf115e782ec4a033359eb2995942848"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


text:
DESCRIPTION = "multi-protocol instant messaging client"
SECTION = "x11/network"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
DEPENDS = "python startup-notification avahi gtk+ ncurses gnutls virtual/libintl gstreamer dbus intltool-native farsight2 libidn"

inherit autotools gettext pkgconfig gconf perlnative

# http://errors.yoctoproject.org/Errors/Details/25824/
PNBLACKLIST[pidgin] ?= "Not compatible with gnutls version 3.4 currently in oe-core"

SRC_URI = "\
    ${SOURCEFORGE_MIRROR}/pidgin/pidgin-${PV}.tar.bz2 \
    file://sanitize-configure.ac.patch \
    file://pidgin.desktop-set-icon.patch \
    file://purple-OE-branding-25.patch \
    file://pidgin-cross-python-265.patch \
"

SRC_URI[md5sum] = "10a4a69d077893f6dd3438cd8af94e81"
SRC_URI[sha256sum] = "dc362ed8577f623eea4554a79e917073aa726825074fea402f2e515f0f51f319"

EXTRA_OECONF = " \
    --enable-vv \
    --disable-perl \
    --disable-tcl \
    --disable-gevolution \
    --disable-schemas-install \
    --x-includes=${STAGING_INCDIR} \
    --x-libraries=${STAGING_LIBDIR} \
    --enable-gnutls=yes \
    --with-ncurses-headers=${STAGING_INCDIR} \
    --with-gnutls-includes=${STAGING_INCDIR} \
    --with-gnutls-libs=${STAGING_LIBDIR} \
    --disable-gtkspell \
    --disable-meanwhile \
    --disable-nm \
    --disable-screensaver \
    --enable-nss=no \
"

do_configure_prepend() {
    touch ${S}/po/Makefile
    sed -i "s#PY_VERSION=`$PYTHON -c 'import sys ; print sys.version[0:3]'`#PY_VERSION=${PYTHON_BASEVERSION}#g" ${S}/configure.ac
}

OE_LT_RPATH_ALLOW=":${libdir}/purple-2:"
OE_LT_RPATH_ALLOW[export]="1"

PACKAGES =+ "libpurple-dbg libpurple-dev libpurple libgnt-dbg libgnt libgnt-dev finch-dbg finch finch-dev ${PN}-data"

LEAD_SONAME = "libpurple.so.0"
FILES_libpurple     = "${libdir}/libpurple*.so.* ${libdir}/purple-2 ${bindir}/purple-* ${sysconfdir}/gconf/schemas/purple* ${datadir}/purple/ca-certs"
FILES_libpurple-dev = "${libdir}/libpurple*.la \
                       ${libdir}/libpurple*.so \
                       ${libdir}/purple-2/*.la \
                       ${libdir}/purple-2/libjabber.so \
                       ${libdir}/purple-2/liboscar.so \
                       ${libdir}/purple-2/libymsg.so \
                       ${datadir}/aclocal"
FILES_libpurple-dbg += "${libdir}/.debug/libpurple* \
                        ${libdir}/purple-2/.debug"
FILES_libgnt         = "${libdir}/libgnt.so.* ${libdir}/gnt/*.so"
FILES_libgnt-dev     = "${libdir}/gnt/*.la"
FILES_libgnt-dbg     = "${libdir}/gnt/.debug"
FILES_finch          = "${bindir}/finch"
FILES_finch-dev      = "${libdir}/finch/*.la"
FILES_finch-dbg      = "${bindir}/.debug/finch \
                        ${libdir}/finch/.debug"

FILES_${PN} = "${bindir} ${datadir}/${PN} ${libdir}/${PN}/*.so \
           ${datadir}/applications"
RRECOMMENDS_${PN} = "${PN}-data libpurple-plugin-ssl-gnutls libpurple-protocol-irc libpurple-protocol-xmpp"

FILES_${PN}-data = "${datadir}/pixmaps ${datadir}/sounds ${datadir}/icons"
FILES_${PN}-dev += "${libdir}/${PN}/*.la"

PACKAGES_DYNAMIC += "^libpurple-protocol-.* ^libpurple-plugin-.* ^pidgin-plugin-.* ^finch-plugin-.*"

python populate_packages_prepend () {
    pidgroot = d.expand('${libdir}/pidgin')
    purple   = d.expand('${libdir}/purple-2')
    finch    = d.expand('${libdir}/finch')

    do_split_packages(d, pidgroot, '^([^l][^i][^b].*)\.so$',
        output_pattern='pidgin-plugin-%s',
        description='Pidgin plugin %s',
        prepend=True, extra_depends='')

    do_split_packages(d, purple, '^lib(.*)\.so$',
        output_pattern='libpurple-protocol-%s',
        description='Libpurple protocol plugin for %s',
        prepend=True, extra_depends='')

    do_split_packages(d, purple, '^(ssl-.*)\.so$',
        output_pattern='libpurple-plugin-%s',
        description='libpurple plugin %s',
        prepend=True, extra_depends='libpurple-plugin-ssl')

    do_split_packages(d, purple, '^([^l][^i][^b].*)\.so$',
        output_pattern='libpurple-plugin-%s',
        description='libpurple plugin %s',
        prepend=True, extra_depends='')

    do_split_packages(d, finch, '^([^l][^i][^b].*)\.so$',
        output_pattern='finch-plugin-%s',
        description='Finch plugin %s',
        prepend=True, extra_depends='')
}

repository: shr-distribution/meta-oe

repo_name: shr-distribution/meta-oe

branch_name: refs/heads/shr

gha_language: Objective-C


text:
@ARTICLE{Ngoma2018-aw,
  title    = "A model-based high throughput method for fecundity estimation in
              fruit fly studies",
  author   = "Ng'oma, Enoch and King, Elizabeth G and Middleton, Kevin M",
  abstract = "The ability to quantify fecundity is critically important to a
              wide range of experimental applications, particularly in
              widely-used model organisms such as Drosophila melanogaster.
              However, the standard method of manually counting eggs is time
              consuming and limits the feasibility of large-scale experiments.
              We develop a predictive model to automate the counting of eggs
              from images of eggs removed from the media surface and washed
              onto dark filter paper. Our method uses the simple relationship
              between the white area in an image and the number of eggs present
              to create a predictive model that performs well even at high egg
              densities where clumping can complicate the individual
              identification of eggs. A cross-validation approach demonstrates
              our method performs well, with a correlation between predicted
              and manually counted values of 0.88. We show how this method can
              be applied to a large data set where egg densities vary widely.",
  journal  = "Fly",
  volume   =  12,
  number   = "3-4",
  pages    = "183--190",
  year     =  2018,
  url      = "http://dx.doi.org/10.1080/19336934.2018.1562267",
  keywords = "Drosophila melanogaster; cross-validation; fecundity; image
              analysis; quantitative biological imaging",
  issn     = "1933-6934, 1933-6942",
  pmid     = "30580661",
  doi      = "10.1080/19336934.2018.1562267"
}

repository: kmiddleton/academic-kickstart

repo_name: kmiddleton/academic-kickstart


text:
@online{noauthor_uk_nodate,
	title = {{UK} Healthcare Reviewing Pediatric Heart Surgeries, Sending Patients to Other Hospitals {WUKY}},
	url = {http://wuky.org/post/uk-healthcare-reviewing-pediatric-heart-surgeries-sending-patients-other-hospitals},
	urldate = {2013-04-18}
}

repository: pmean/build-website

repo_name: pmean/build-website


text:
-------------------------------------------------------------------------------
Survey Papers
-------------------------------------------------------------------------------

A 2011 survey paper that talks about runtime policy enforcement.  Probably not
worth citing on its own but raiding the bibliography might be prudent.
@techreport{gheorghe2011_survey,
  title       = {{A Survey of Runtime Policy Enforcement Techniques and Implementations}},
  author      = {Gheorghe, Gabriela and Crispo, Bruno},
  year        = {2011},
  institution = {University of Trento},
  url         = {http://eprints.biblio.unitn.it/2268/1/techRep477.pdf},
}

-------------------------------------------------------------------------------
Process Confinement
-------------------------------------------------------------------------------

My paper on bpfbox
@inproceedings{findlay20_bpfbox,
  title       = {{bpfbox: Simple Precise Process Confinement with eBPF}},
  author      = {William Findlay and Anil Buntwal Somayaji and David Barrera},
  booktitle   = {Proceedings of the 2020 ACM Cloud Computing Security Workshop (CCSW'2020)},
  month       = {Nov},
  year        = {2020},
  doi         = {10.1145/3411495.3421358},
  note        = {To appear.}
}

Tron was an early effort at writing process-specific policies for Unix back in
1995! Crazy stuff
@inproceedings{berman1995_tron,
    author    = {Andrew Berman and Virgil Bourassa and Erik Selberg},
    title     = {{TRON: Process-Specific File Protection for the UNIX Operating System}},
    booktitle = {Proceedings of the USENIX 1995 Technical Conference},
    year      = {1995},
    pages     = {165--175},
    url       = {https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.56.9149&rep=rep1&type=pdf},
}

Janus implements process confinement in userspace using an extended version
of ptrace (ptrace++)
@mastersthesis{wagner1999_janus,
  title       = {{Janus: An Approach for Confinement of Untrusted Applications}},
  author      = {Wagner, David A},
  year        = {1999},
  school      = {University of California, Berkeley},
  url         = {https://www2.eecs.berkeley.edu/Pubs/TechRpts/1999/CSD-99-1056.pdf},
}

https://www.usenix.org/legacy/events/sec03/tech/full_papers/provos/provos_html/

Usability study of AppArmor, SELinux, and FBAC-LSM
@inproceedings{schreuders12_towards,
  title       = {{Towards Usable Application-Oriented Access Controls}},
  author      = {Schreuders, Z Cliffe and McGill, Tanya Jane and Payne, Christian},
  booktitle   = {{International Journal of Information Security and Privacy}},
  volume      = {6},
  number      = {1},
  pages       = {57--76},
  year        = {2012},
  doi         = {10.4018/jisp.2012010104},
}

-------------------------------------------------------------------------------
Policy Generation
-------------------------------------------------------------------------------

@inproceedings{macmillan07_madison,
  title       = {{Madison: A new approach to policy generation}},
  author      = {MacMillan, Karl},
  booktitle   = {{SELinux Symposium}},
  volume      = {7},
  year        = {2007},
  url         = {http://selinuxsymposium.org/2007/papers/08-polgen.pdf},
}

TODO: Add other systems cited in the madison paper

@inproceedings{sniffen06_guided,
  title       = {{Guided policy generation for application authors}},
  author      = {Sniffen, Brian T and Harris, David R and Ramsdell, John D},
  booktitle   = {{SELinux Symposium}},
  year        = {2006},
  url         = {http://gelit.ch/td/SELinux/Publications/Mitre_Tools.pdf},
}

@misc{audit2allow,
  title       = {{audit2allow}},
  author      = {Justin R. Smith and Yuichi Nakamura and Dan Walsh},
  note        = {Linux user's manual},
  url         = {http://linux.die.net/man/1/audit2allow},
}

@misc{aa_easyprof,
  title       = {{aa-easyprof}},
  author      = {{AppArmor authors}},
  note        = {Linux user's manual},
  url         = {https://manpages.ubuntu.com/manpages/precise/man8/aa-easyprof.8.html},
}

-------------------------------------------------------------------------------
Langauge Generation
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
Anomaly Detection and Sequence Analysis
-------------------------------------------------------------------------------

@phdthesis{soma02_pH,
  title       = {{Operating System Stability and Security through Process Homeostasis}},
  url         = {https://people.scs.carleton.ca/~soma/pubs/soma-diss.pdf},
  school      = {University of New Mexico},
  author      = {Somayaji, Anil Buntwal},
  year        = {2002},
}

@inproceedings{forrest96_sense_of_self,
  author      = {S. {Forrest} and S. A. {Hofmeyr} and A. {Somayaji} and T. A. {Longstaff}},
  booktitle   = {{Proceedings 1996 IEEE Symposium on Security and Privacy}},
  title       = {{A Sense of Self for Unix Processes}},
  year        = {1996},
  volume      = {},
  number      = {},
  pages       = {120-128},
  doi         = {10.1109/SECPRI.1996.502675},
  ISSN        = {1081-6011},
  month       = {May},
}

@inproceedings{soma07_lookahead,
  place       = {New York, New York},
  title       = {{Lookahead Pairs and Full Sequences: A Tale of Two Anomaly Detection Methods}},
  url         = {http://people.scs.carleton.ca/~soma/pubs/inoue-albany2007.pdf},
  booktitle   = {{Proceedings of the 2nd Annual Symposium on Information Assurance Academic track of the 10th Annual 2007 NYS Cyber Security Conference}},
  publisher   = {{NYS Cyber Security Conference}},
  author      = {Somayaji, Anil Buntwal and Inoue, Hajime},
  year        = {2007},
  pages       = {9–19}
}

@thesis{findlay20_ebpH,
  title       = {{Host-Based Anomaly Detection with Extended BPF}},
  author      = {William Findlay},
  month       = {April},
  year        = {2020},
  institution = {Carleton University},
  type        = {Honours Thesis},
  url         = {https://williamfindlay.com/written/thesis.pdf}
}

-------------------------------------------------------------------------------
Semantic Meaning in Computing
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
eBPF Background
-------------------------------------------------------------------------------

Article on eBPF in LWN
@article{fleming17_ebpf,
  title       = {{A thorough introduction to eBPF}},
  url         = {https://lwn.net/Articles/740157},
  journal     = {{LWN.net}},
  author      = {Fleming, Matt},
  year        = {2017},
  month       = {Dec},
  urldate     = {2020-09-26},
}

The literal book on eBPF
@book{gregg19_bpf,
  title       = {{BPF Performance Tools}},
  author      = {Gregg, Brendan},
  year        = {2019},
  isbn        = {0-13-655482-2},
  publisher   = {Addison-Wesley Professional}
}

repository: willfindlay/academic-homepage

repo_name: willfindlay/academic-homepage


text:
@Misc{biecek2008przelaj,
  title = {Na prze{\l}aj przez Data Mining},
  author = {Przemys{\l}aw Biecek and Krzysztof Trajkowski},
  year = {2008},
  publisher = {Wroc{\l}aw},
}


text:
package main

import (
    "os"
    "fmt"
    "strconv"
)

func main(){
    input_hex := os.Args[1]
    hex := "0x" + input_hex
    int, _ := strconv.ParseUint(hex, 0, 64)
    fmt.Println(int)
}

repository: liuhangyu/inkchain

repo_name: liuhangyu/inkchain


text:
package main

import (
	"fmt"
	"github.com/samuel/go-zookeeper/zk"
	"gopkg.in/yaml.v2"
	"io/ioutil"
	"os"
	"path/filepath"
	"testing"
)

type mockConn struct {
	children map[string][]string
	values   map[string][]byte
}

func (m *mockConn) SetGet(path string, value []byte) {
	if m.values == nil {
		m.values = make(map[string][]byte)
	}
	m.values[path] = value
}

func (m *mockConn) SetChildren(path string, children []string) {
	if m.children == nil {
		m.children = make(map[string][]string)
	}
	m.children[path] = children
}

func (m *mockConn) Children(path string) ([]string, *zk.Stat, error) {
	return m.children[path], nil, nil
}

func (m *mockConn) Get(path string) ([]byte, *zk.Stat, error) {
	return m.values[path], nil, nil
}

func assertCacheEquals(t *testing.T, cc *ConfigCache, exp map[string]interface{}) {
	for name, value := range exp {
		path := filepath.Join(cc.basePath, name+".yml")
		actb, err := ioutil.ReadFile(path)
		if err != nil {
			t.Fatalf("expected file %v couldn't be read", path)
		}
		act := string(actb)

		expb, err := yaml.Marshal(&value)
		if err != nil {
			t.Fatalf("expected data couldn't be marshalled")
		}
		exp := string(expb)

		if act != exp {
			t.Fatalf("got: %v, expected: %v", act, exp)
		}
	}
}

var root = "/zconfig"
var base = filepath.Join(os.TempDir(), "zconfig")

func TestMain(m *testing.M) {
	err := os.Mkdir(base, 0777)
	if err != nil {
		fmt.Fprintf(os.Stderr, "couldn't create %v: %v\n", base, err)
		os.Exit(1)
	}
	code := m.Run()
	err = os.RemoveAll(base)
	if err != nil && !os.IsNotExist(err) {
		fmt.Fprintf(os.Stderr, "couldn't remove %v: %v\n", base, err)
	}
	os.Exit(code)
}

func TestUpdate(t *testing.T) {
	conn := mockConn{}
	cache := NewConfigCache(&conn, root, base)

	conn.SetChildren(root, []string{"servers"})
	conn.SetGet(root+"/servers", []byte(""))
	conn.SetChildren(root+"/servers", []string{})

	cache.Update()

	assertCacheEquals(t, cache, map[string]interface{}{
		"servers": nil,
	})

	conn.SetChildren(root+"/servers", []string{"db"})
	conn.SetGet(root+"/servers/db", []byte(""))
	conn.SetChildren(root+"/servers/db", []string{})

	cache.Update()

	assertCacheEquals(t, cache, map[string]interface{}{
		"servers": []string{"db"},
	})

	conn.SetChildren(root+"/servers", []string{"db", "timeout"})
	conn.SetGet(root+"/servers/timeout", []byte("1000"))
	conn.SetChildren(root+"/servers/timeout", []string{})

	cache.Update()

	assertCacheEquals(t, cache, map[string]interface{}{
		"servers": map[string]interface{}{
			"db":      nil,
			"timeout": "1000",
		},
	})

	conn.SetChildren(root+"/servers/db", []string{"192.168.0.1", "192.168.0.2"})
	conn.SetGet(root+"/servers/db/192.168.0.1", []byte(""))
	conn.SetChildren(root+"/servers/db/192.168.0.1", []string{})
	conn.SetGet(root+"/servers/db/192.168.0.2", []byte(""))
	conn.SetChildren(root+"/servers/db/192.168.0.2", []string{})

	cache.Update()

	assertCacheEquals(t, cache, map[string]interface{}{
		"servers": map[string]interface{}{
			"db":      []string{"192.168.0.1", "192.168.0.2"},
			"timeout": "1000",
		},
	})
}

func TestUpdateEmpty(t *testing.T) {
	conn := mockConn{}
	conn.SetChildren(root, []string{})

	cache := NewConfigCache(&conn, root, base)
	cache.Update()

	files, _ := ioutil.ReadDir(base)
	if len(files) > 0 {
		t.Fatalf("expected %v to be empty, but it wasn't", base)
	}
}

repository: itszootime/zconfig

repo_name: itszootime/zconfig


text:
DESCRIPTION = "*Digest::BubbleBabble* takes a message digest (often generated by either of \
the MD5 or SHA-1 message digest algorithms) and creates a fingerprint of \
that digest in "bubble babble" format. Bubble babble is a method of \
representing a message digest as a string of "real" words, to make the \
fingerprint easier to remember. The "words" are not necessarily real words, \
but they look more like words than a string of hex characters."

SECTION = "libs"
LICENSE = "Artistic-1.0 | GPL-1.0-or-later"
PR = "r0"

MAINTAINER=	"Poky <poky@yoctoproject.org>"
HOMEPAGE=	"https://metacpan.org/release/Digest-BubbleBabble"

LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Artistic-1.0;md5=cda03bbdc3c1951996392b872397b798 \
file://${COMMON_LICENSE_DIR}/GPL-1.0-or-later;md5=30c0b8a5048cc2f4be5ff15ef0d8cf61"

SRC_URI = "https://cpan.metacpan.org/authors/id/B/BT/BTROTT/Digest-BubbleBabble-0.02.tar.gz \
	   file://0001-Makefile.PL-use-.-explicitely.patch \
"

SRC_URI[md5sum] = "4d7edd5b0a904db8194aa660d502fbe0"
SRC_URI[sha256sum] = "80cfb2d2e43d6f79400658600567d2a270b145b4eef5aea58a66957788225c00"

S = "${WORKDIR}/Digest-BubbleBabble-${PV}"

inherit cpan allarch

BBCLASSEXTEND = "native"

repository: rehsack/meta-cpan

repo_name: rehsack/meta-cpan

gha_language: BitBake


text:
@article{zappia_splatter:_2017,
 author = {Zappia, Luke and Phipson, Belinda and Oshlack, Alicia},
 journal = {Genome biology},
 number = {1},
 pages = {174},
 title = {Splatter: simulation of single-cell RNA sequencing data},
 volume = {18},
 year = {2017}
}

repository: Treppner/academic-kickstart

repo_name: Treppner/academic-kickstart


text:
@inproceedings{CaYa11,
 author = {N. Cao and
Z. Yang and
C. Wang and
K. Ren and
W. Lou},
 booktitle = {Proc. of ICDCS},
 pages = {393-402},
 title = {Privacy-Preserving Query over Encrypted Graph-Structured
Data in Cloud Computing},
 year = {2011}
}


text:
SUMMARY = "GPIO based powercontrol for a host system"
DESCRIPTION = "GPIO based powercontrol for a host system."
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"

inherit systemd

RDEPENDS:${PN} += " \
  bash \
  gpio-ctrl \
  "

SRC_URI += " \
  file://host-ensure-off.service \
  file://host-powercycle-watchdog.service \
  file://host-powercycle.service \
  file://host-poweroff-watchdog.service \
  file://host-poweroff.service \
  file://host-poweron.service \
  file://host-reset-cold-watchdog.service \
  file://host-reset-cold.service \
  file://host-reset-warm-watchdog.service \
  file://host-reset-warm.service \
  file://host_ensure_off.sh \
  file://host_isoff.sh \
  file://host_powercycle.sh \
  file://host_poweroff.sh \
  file://host_poweron.sh \
  file://host_reset.sh \
  file://lib.sh \
  "

SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE:${PN} += " \
  host-reset-cold.service \
  host-reset-cold-watchdog.service \
  host-reset-warm.service \
  host-reset-warm-watchdog.service \
  host-ensure-off.service \
  host-powercycle.service \
  host-powercycle-watchdog.service \
  host-poweroff.service \
  host-poweroff-watchdog.service \
  host-poweron.service \
  "

do_install() {
    install -d ${D}${bindir}
    install -m 0755 ${WORKDIR}/host_*.sh ${D}${bindir}/

    install -d ${D}${datadir}/gpio-host-pwr
    install -m 0755 ${WORKDIR}/lib.sh ${D}${datadir}/gpio-host-pwr/

    install -d ${D}${systemd_system_unitdir}
    install -m 0644 ${WORKDIR}/*.service ${D}${systemd_system_unitdir}/
}

repository: openbmc/openbmc

repo_name: openbmc/openbmc

gha_license_id: NOASSERTION

gha_language: Python


text:
package apis

import (
	"github.com/lbryio/chainquery/db"
	"github.com/lbryio/errors.go"
	"github.com/sirupsen/logrus"
	"net/http"
)

const (
	ADDRESSSUMARY = "AddressSummary"
	STATUS        = "Status"
)

// Response is returned by API handlers
type Response struct {
	TimeSpent   string
	Status      int
	Data        interface{}
	RedirectURL string
	Error       error
}

func HandleAction(operation string, w http.ResponseWriter, r *http.Request) (*Response, error) {
	switch operation {
	case STATUS:
		payload, err := getStatusPayload(r)
		response := processPayload(payload, err)
		return response, nil
	case ADDRESSSUMARY:
		payload, err := getAddressSummary(r)
		response := processPayload(payload, err)
		return response, nil
	default:
		return nil, errors.Base(operation + " is not implmented yet.")
	}
}

func processPayload(payload interface{}, error error) *Response {
	response := Response{}
	if error != nil {
		response.Error = error
		return &response
	}
	response.Status = http.StatusOK
	response.Data = payload

	return &response
}

func getStatusPayload(r *http.Request) (interface{}, error) {
	status, err := db.GetTableStatus()
	if err != nil {
		logrus.Error(err)
		return nil, err
	}

	return status, nil
}

func getAddressSummary(r *http.Request) (interface{}, error) {
	address := r.FormValue("Address")
	summary, err := db.GetAddressSummary(address)
	if err != nil {
		return nil, err
	}
	return summary, nil
}

repository: cryptobuks/chainquery

repo_name: cryptobuks/chainquery


text:
package abcsessions

import (
	"io/ioutil"
	"os"
	"path"
	"sync"
	"time"

	"github.com/djherbis/times"
	"github.com/friendsofgo/errors"
)

// DiskStorer is a session storer implementation for saving sessions
// to disk.
type DiskStorer struct {
	// Path to the session files folder
	folderPath string
	// How long sessions take to expire on disk
	// Note that this is seperate to the cookie maxAge
	maxAge time.Duration
	// How often the disk should be polled for maxAge expired sessions
	cleanInterval time.Duration
	// Disk storage mutex
	mut sync.RWMutex
	// wg is used to manage the cleaner loop
	wg sync.WaitGroup
	// quit channel for exiting the cleaner loop
	quit chan struct{}
}

// NewDefaultDiskStorer returns a DiskStorer object with default values.
// The default values are:
// FolderPath: system tmp dir + random folder
// maxAge: 2 days (clear session stored on server after 2 days)
// cleanInterval: 1 hour (delete sessions older than maxAge every 1 hour)
func NewDefaultDiskStorer(tmpSubFolder string) (*DiskStorer, error) {
	folderPath := path.Join(os.TempDir(), tmpSubFolder)
	return NewDiskStorer(folderPath, time.Hour*24*2, time.Hour)
}

// NewDiskStorer initializes and returns a new DiskStorer object.
// It takes the maxAge of how long each session should live on disk,
// and a cleanInterval duration which defines how often the clean
// task should check for maxAge expired sessions to be removed from disk.
// Persistent storage can be attained by setting maxAge and cleanInterval
// to zero.
func NewDiskStorer(folderPath string, maxAge, cleanInterval time.Duration) (*DiskStorer, error) {
	if (maxAge != 0 && cleanInterval == 0) || (cleanInterval != 0 && maxAge == 0) {
		panic("if max age or clean interval is set, the other must also be set")
	}

	d := &DiskStorer{
		folderPath:    folderPath,
		maxAge:        maxAge,
		cleanInterval: cleanInterval,
	}

	// Create the storage folder if it does not exist
	_, err := os.Stat(folderPath)
	if os.IsNotExist(err) {
		err := os.Mkdir(folderPath, os.FileMode(int(0755)))
		if err != nil {
			return nil, errors.Wrapf(err, "unable to make directory: %s", folderPath)
		}
	}

	return d, nil
}

// All keys in the disk store
func (d *DiskStorer) All() ([]string, error) {
	files, err := ioutil.ReadDir(d.folderPath)
	if err != nil {
		return []string{}, errors.Wrapf(err, "unable to read directory: %s", d.folderPath)
	}

	sessions := make([]string, len(files))

	for i := 0; i < len(files); i++ {
		sessions[i] = files[i].Name()
	}

	return sessions, nil
}

// Get returns the value string saved in the session pointed to by the
// session id key.
func (d *DiskStorer) Get(key string) (value string, err error) {
	if !validKey(key) {
		return "", errNoSession{}
	}

	filePath := path.Join(d.folderPath, key)

	d.mut.RLock()
	defer d.mut.RUnlock()

	_, err = os.Stat(filePath)
	if err != nil {
		return "", errors.Wrapf(err, "unable to stat session file: %s", filePath)
	}

	contents, err := ioutil.ReadFile(filePath)
	if err != nil {
		return "", errors.Wrapf(err, "unable to read file: %s", filePath)
	}

	return string(contents), nil
}

// Set saves the value string to the session pointed to by the session id key.
func (d *DiskStorer) Set(key, value string) error {
	if !validKey(key) {
		return errNoSession{}
	}

	filePath := path.Join(d.folderPath, key)

	d.mut.Lock()
	defer d.mut.Unlock()

	return ioutil.WriteFile(filePath, []byte(value), 0600)
}

// Del the session pointed to by the session id key and remove it.
func (d *DiskStorer) Del(key string) error {
	if !validKey(key) {
		return errNoSession{}
	}

	filePath := path.Join(d.folderPath, key)

	d.mut.Lock()
	defer d.mut.Unlock()

	_, err := os.Stat(filePath)
	if os.IsNotExist(err) {
		return nil
	} else if err != nil {
		return errors.Wrapf(err, "unable to stat session file: %s", filePath)
	}

	return os.Remove(filePath)
}

// StopCleaner stops the cleaner go routine
func (d *DiskStorer) StopCleaner() {
	close(d.quit)
	d.wg.Wait()
}

// ResetExpiry resets the expiry of the key
func (d *DiskStorer) ResetExpiry(key string) error {
	if !validKey(key) {
		return errNoSession{}
	}

	filePath := path.Join(d.folderPath, key)
	nowTime := time.Now().UTC()

	return os.Chtimes(filePath, nowTime, nowTime)
}

// StartCleaner starts the disk session cleaner go routine. This go routine
// will delete expired disk sessions on the cleanInterval interval.
func (d *DiskStorer) StartCleaner() {
	if d.maxAge == 0 || d.cleanInterval == 0 {
		panic("both max age and clean interval must be set to non-zero")
	}

	// init quit chan
	d.quit = make(chan struct{})

	d.wg.Add(1)

	// Start the cleaner infinite loop go routine.
	// StopCleaner() can be used to kill this go routine.
	go d.cleanerLoop()
}

// cleanerLoop executes the Clean() method every time cleanInterval elapses.
// StopCleaner() can be used to kill this go routine loop.
func (d *DiskStorer) cleanerLoop() {
	defer d.wg.Done()

	t, c := timerTestHarness(d.cleanInterval)

	select {
	case <-c:
		d.Clean()
		t.Reset(d.cleanInterval)
	case <-d.quit:
		t.Stop()
		return
	}
}

// Clean checks all session files on disk to see if they are older than
// maxAge by checking their access time. If it finds an expired session file
// it will remove it from disk.
func (d *DiskStorer) Clean() {
	t := time.Now().UTC()

	files, err := ioutil.ReadDir(d.folderPath)

	if err != nil {
		panic(err)
	}

	for _, file := range files {
		tspec := times.Get(file)

		// File is expired
		if tspec.AccessTime().UTC().UTC().Add(d.maxAge).Before(t) {
			filePath := path.Join(d.folderPath, file.Name())

			d.mut.Lock()
			_, err := os.Stat(filePath)
			// If the file has been deleted manually from the server
			// in between the time we read the directory and now, it will
			// fail here with a ErrNotExist. If so, continue gracefully.
			// It would be innefficient to hold a lock for the duration of
			// the loop, so we only lock when we find an expired file.
			if os.IsNotExist(err) {
				d.mut.Unlock()
				continue
			} else if err != nil {
				panic(err)
			}

			err = os.Remove(filePath)
			d.mut.Unlock()
			if err != nil {
				panic(err)
			}
		}
	}
}

repository: volatiletech/abcweb

repo_name: volatiletech/abcweb


text:
package handler

import (
	"encoding/json"
	"net/http"
)

type JSONHandler struct {
	Data interface{}
}

// Statically assert that *JSONHandler implements http.Handler.
var _ http.Handler = (*JSONHandler)(nil)

func (h *JSONHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	w.Header().Set("Content-Type", "application/json; charset=UTF-8")
	w.WriteHeader(http.StatusOK)
	json.NewEncoder(w).Encode(h.Data)
}

repository: fxkr/openview

repo_name: fxkr/openview


text:
@article{pmid31028705,
 author = {Lindroos, A. S.  and Kantola, I.  and Salomaa, V.  and Juhanoja, E. P.  and SivEN, S. S.  and Jousilahti, P.  and Jula, A. M.  and Niiranen, T. J. },
 journal = {Am. J. Hypertens.},
 keywords = {intarticle},
 month = {Apr},
 title = {Agreement between ambulatory and home blood pressure monitoring in detecting night-time hypertension and nondipping patterns in the general population},
 year = {2019}
}

repository: hypertensioncenter/academic-kickstart

repo_name: hypertensioncenter/academic-kickstart

gha_language: TeX