text:
package sls

import (
	"errors"
	"fmt"
	"github.com/AliyunContainerService/alibaba-cloud-metrics-adapter/pkg/utils"
	"github.com/aliyun/aliyun-log-go-sdk"
	"k8s.io/apimachinery/pkg/labels"
	log "k8s.io/klog/v2"
	"k8s.io/metrics/pkg/apis/external_metrics"
	p "sigs.k8s.io/custom-metrics-apiserver/pkg/provider"
	"strconv"
)

const (
	SLS_ALB_INGRESS_QPS       = "sls_alb_ingress_qps"
	SLS_INGRESS_QPS           = "sls_ingress_qps"
	SLS_INGRESS_LATENCY_AVG   = "sls_ingress_latency_avg"
	SLS_INGRESS_LATENCY_P50   = "sls_ingress_latency_p50"
	SLS_INGRESS_LATENCY_P95   = "sls_ingress_latency_p95"
	SLS_INGRESS_LATENCY_P9999 = "sls_ingress_latency_p9999"
	SLS_INGRESS_LATENCY_P99   = "sls_ingress_latency_p99"
	SLS_INGRESS_INFLOW        = "sls_ingress_inflow" // byte per second

	SLS_LABEL_PROJECT         = "sls.project"
	SLS_LABEL_LOGSTORE        = "sls.logstore"
	SLS_LABEL_QUERY_INTERVAL  = "sls.query.interval"  // query interval seconds, min val 15s
	SLS_LABEL_QUERY_DELAY     = "sls.query.delay"     // query delay seconds, default 0s
	SLS_LABEL_QUERY_MAX_RETRY = "sls.query.max_retry" // max retry, default 5
	SLS_LABEL_INGRESS_ROUTE   = "sls.ingress.route"   // e.g. namespace-svc-port
	SLS_INTERNAL_ENDPOINT     = "sls.internal.endpoint"

	MIN_INTERVAL      = 15
	MAX_RETRY_DEFAULT = 5
)

type SLSMetricSource struct{}

func (ss *SLSMetricSource) GetExternalMetricInfoList() []p.ExternalMetricInfo {
	metricInfoList := make([]p.ExternalMetricInfo, 0)

	// alb Ingress QPS
	metricInfoList = append(metricInfoList, p.ExternalMetricInfo{
		Metric: SLS_ALB_INGRESS_QPS,
	})
	// Ingress QPS
	metricInfoList = append(metricInfoList, p.ExternalMetricInfo{
		Metric: SLS_INGRESS_QPS,
	})
	// Ingress latency avg
	metricInfoList = append(metricInfoList, p.ExternalMetricInfo{
		Metric: SLS_INGRESS_LATENCY_AVG,
	})
	// Ingress latency 50%
	metricInfoList = append(metricInfoList, p.ExternalMetricInfo{
		Metric: SLS_INGRESS_LATENCY_P50,
	})
	//Ingress latency 95%
	metricInfoList = append(metricInfoList, p.ExternalMetricInfo{
		Metric: SLS_INGRESS_LATENCY_P95,
	})
	//Ingress latency 99.99%
	metricInfoList = append(metricInfoList, p.ExternalMetricInfo{
		Metric: SLS_INGRESS_LATENCY_P9999,
	})
	// Ingress latency 99%
	metricInfoList = append(metricInfoList, p.ExternalMetricInfo{
		Metric: SLS_INGRESS_LATENCY_P99,
	})
	// ingress inflow
	metricInfoList = append(metricInfoList, p.ExternalMetricInfo{
		Metric: SLS_INGRESS_INFLOW,
	})
	return metricInfoList
}
func (ss *SLSMetricSource) GetExternalMetric(info p.ExternalMetricInfo, namespace string, requirements labels.Requirements) (values []external_metrics.ExternalMetricValue, err error) {
	values, err = ss.getSLSIngressMetrics(namespace, requirements, info.Metric)
	if err != nil {
		log.Warningf("Failed to GetExternalMetric %s,because of %v", info.Metric, err)
	}
	return values, err
}

// create client with specific project
func (ss *SLSMetricSource) Client(internal bool) (client sls.ClientInterface, err error) {

	accessUserInfo, err := utils.GetAccessUserInfo()
	if err != nil {
		log.Infof("Failed to GetAccessUserInfo,because of %v", err)
		return client, err
	}
	var endpoint string
	if internal {
		endpoint = fmt.Sprintf("%s-intranet.log.aliyuncs.com", accessUserInfo.Region)
	} else {
		endpoint = fmt.Sprintf("%s.log.aliyuncs.com", accessUserInfo.Region)
	}
	client = sls.CreateNormalInterface(endpoint, accessUserInfo.AccessKeyId, accessUserInfo.AccessKeySecret, accessUserInfo.Token)

	return client, nil
}

// get sls params from labels
func getSLSParams(requirements labels.Requirements) (params *SLSIngressParams, err error) {
	// set default value
	params = &SLSIngressParams{
		SLSGlobalParams: SLSGlobalParams{
			Interval:     MIN_INTERVAL,
			MaxRetry:     MAX_RETRY_DEFAULT,
			DelaySeconds: 10,
			Internal:     true,
		},
	}
	for _, r := range requirements {

		if len(r.Values().List()) <= 0 {
			log.Warningf("You don't provide value of %s and skip.", r.Key())
			continue
		}

		value := r.Values().List()[0]

		switch r.Key() {
		case SLS_LABEL_PROJECT:
			params.Project = value
		case SLS_LABEL_LOGSTORE:
			params.LogStore = value
		case SLS_LABEL_INGRESS_ROUTE:
			params.Route = value
		case SLS_LABEL_QUERY_INTERVAL:
			if params.Interval, err = strconv.Atoi(value); err != nil {
				log.Errorf("Failed to parse %s,because of %v.", SLS_LABEL_QUERY_INTERVAL, err)
				return nil, err
			}
		case SLS_LABEL_QUERY_DELAY:
			if params.DelaySeconds, err = strconv.Atoi(value); err != nil {
				log.Errorf("Failed to parse %s,because of %v.", SLS_LABEL_QUERY_DELAY, err)
				return nil, err
			}
		case SLS_LABEL_QUERY_MAX_RETRY:
			if params.MaxRetry, err = strconv.Atoi(value); err != nil {
				log.Errorf("Failed to parse %s,because of %v", SLS_LABEL_QUERY_MAX_RETRY, err)
				return nil, err
			}
		case SLS_INTERNAL_ENDPOINT:
			if value != "" && value == "false" {
				params.Internal = false
			}
		}
	}

	if params.Project == "" || params.LogStore == "" {
		return params, errors.New(fmt.Sprintf("%s and %s must be provided", SLS_LABEL_PROJECT, SLS_LABEL_LOGSTORE))
	}
	if params.Interval < MIN_INTERVAL {
		log.Infof("The interval you specific is %d and less than the MIN_INTERVAL(%d).Use MIN_INTERVAL as default.", params.Interval, MIN_INTERVAL)
		params.Interval = MIN_INTERVAL
	}
	if params.MaxRetry < 1 {
		log.Infof("The MaxRetry you specific is %d and use MAX_RETRY_DEFAULT(%d) as default", params.MaxRetry, MAX_RETRY_DEFAULT)
		params.MaxRetry = MAX_RETRY_DEFAULT
	}

	if params.DelaySeconds < 0 {

	}

	return params, nil
}

// Global params
type SLSGlobalParams struct {
	Project      string
	LogStore     string
	Interval     int
	DelaySeconds int
	MaxRetry     int
	Internal     bool
}

func NewSLSMetricSource() *SLSMetricSource {
	return &SLSMetricSource{}
}

license_type: permissive

branch_name: refs/heads/master

gha_language: Go

extension: go


text:
require tin.inc

PR = "${INC_PR}.0"

SRC_URI = "ftp://ftp.tin.org/pub/news/clients/tin/v1.9/tin-${PV}.tar.gz \
	   file://m4.patch"

PARALLEL_MAKE = ""

export BUILD_CFLAGS += "-I${S}/include -DHAVE_CONFIG_H"

do_configure() {
	oe_runconf
}

do_compile() {
	cd src && oe_runmake
}

SRC_URI[md5sum] = "50ecd901467622fbc47bc935aca222b3"
SRC_URI[sha256sum] = "0da9424503faad972860682107157d7348872f00f932ec270c78f17ee495dc97"

license: MIT

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD

extension: bb


text:
DESCRIPTION = "Xfce4 settings"
HOMEPAGE = "http://www.xfce.org"
SECTION = "x11/wm"
LICENSE = "GPL-2"

DEPENDS = "virtual/libx11 virtual/xserver libxi libwnck xrandr exo libxfce4util libxfcegui4"

PR = "r0"

inherit xfce46

SRC_URI[md5sum] = "f988cb732913b5fbc115ad7105d2231e"
SRC_URI[sha256sum] = "1601b8d2cac5d931c39bed7e331c5bd91018d0e56663295e7a083a2c78fe168b"

RDEPENDS_${PN} = "xfconf exo"


text:
/*
Copyright 2020 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 eks

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/service/eks"

	infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3"
	"sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/converters"
	"sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/tags"
)

func (s *Service) reconcileTags(cluster *eks.Cluster) error {
	clusterTags := converters.MapPtrToMap(cluster.Tags)
	buildParams := s.getEKSTagParams(*cluster.Arn)
	tagsBuilder := tags.New(buildParams, tags.WithEKS(s.EKSClient))
	if err := tagsBuilder.Ensure(clusterTags); err != nil {
		return fmt.Errorf("failed ensuring tags on cluster: %w", err)
	}

	return nil
}

func (s *Service) getEKSTagParams(id string) *infrav1.BuildParams {
	name := s.scope.KubernetesClusterName()

	return &infrav1.BuildParams{
		ClusterName: s.scope.Name(),
		ResourceID:  id,
		Lifecycle:   infrav1.ResourceLifecycleOwned,
		Name:        aws.String(name),
		Role:        aws.String(infrav1.CommonRoleTagValue),
		Additional:  s.scope.AdditionalTags(),
	}
}

repository: Promaethius/cluster-api-provider-aws

repo_name: Promaethius/cluster-api-provider-aws


text:
@inproceedings{mand_2014_Mikrofossiilidmaailmavanimates,
 author = {Mänd, Kaarel},
 booksubtitle = {Schola Geologica X},
 booktitle = {Fosfor – aegade algusest tänapäevani},
 date = {2014},
 editor = {Lang, Liisa and Truuver, Karin and Post, Triine},
 eventdate = {2014-10-17/2014-10-19},
 eventtitle = {Schola Geologica X},
 file = {/home/kaarel/Nextcloud/kaarel/kirjandus/Zotero/mänd_2014_mikrofossiilid_maailma_vanimates_fosforiitides2.pdf},
 langid = {estonian},
 location = {Jäneda, Estonia},
 pages = {12-15},
 publisher = {Eesti Loodusuurijate Selts},
 title = {Mikrofossiilid maailma vanimates fosforiitides},
 url = {https://docs.google.com/uc?id=0B_N9jbYgrqcPT0FmaWh5RVJoVHM&export=download},
 venue = {Jäneda, Estonia}
}

repository: kaarelmand/academic-kickstart

repo_name: kaarelmand/academic-kickstart

gha_license_id: MIT

extension: bib


text:
require mythtv.inc

DEPENDS_{PN} += "libmyth"
DEPENDS_libmyth = "libmythdb libmythavutil libmythavcodec libmythavformat libmythswscale libmythhdhomerun \
	libmythtv libmythui libmythfreemheg libmythupnp libmythlivemedia"

RDEPENDS_${PN} = "mythtv-backend mythtv-frontend mythtv-bin mythtv-filters mythtv-database \
mysql5-server mysql5-client libmysqlclient qt4-plugin-sqldriver-sqlmysql xmltv"
RDEPENDS_${PN}_append_libc-glibc = " glibc-gconv-utf-16"

PR = "svnr${SRCPV}+r7"
PV = "0.22"

# REALPV is here to support release candidates
# OE in that case has as PV something like 0.21+0.22rc1
# but for packaging the real PV is needed
REALPV = "0.22"

SRCREV = "23062"
SRC_URI = "svn://svn.mythtv.org/svn/branches/release-0-22-fixes;module=mythtv;proto=http"

S = "${WORKDIR}/mythtv"

ALLOW_EMPTY_${PN} = "1"

QMAKE_PROFILES = "mythtv.pro"

SRC_URI += " \
        file://configure.patch;patch=1 \
        "

inherit qmake2 qt4x11

EXTRA_MYTHTVCONF_armv7a = "--cpu=cortex-a8"
EXTRA_MYTHTVCONF_armv5te = "--cpu=armv5te"
EXTRA_MYTHTVCONF ?= ""
EXTRA_OECONF = " \
        --cross-prefix=${TARGET_PREFIX} \
        --sysroot=${STAGING_DIR_HOST} \
        --prefix=${prefix} \
        --arch=${TARGET_ARCH} \
        \
        --extra-cflags="${TARGET_CFLAGS} ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" \
        --extra-cxxflags="${TARGET_CXXFLAGS} ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" \
        --extra-ldflags="${TARGET_LDFLAGS}" \
        ${EXTRA_MYTHTVCONF} \
"

do_configure_prepend() {
# it's not autotools anyway, so we call ./configure directly
        find . -name "Makefile"|xargs rm -f
        ./configure     --qmake=qmake2          \
                        --disable-altivec        \
                         --disable-opengl        \
                        --disable-stripping        \
                        --disable-xvmc                \
                        --enable-v4l                \
                        --enable-audio-oss        \
                        --enable-dvb                \
                        --enable-libmp3lame \
            --dvb-path=${STAGING_INCDIR} \
                        --without-bindings=perl,python \
                        ${EXTRA_OECONF}
}

do_install() {
	oe_runmake INSTALL_ROOT=${D} install
        install -d ${D}${datadir}/mythtv
        install -d ${D}${datadir}/mythtv/sql
        install -m 0644 ${S}/database/mc.sql ${D}${datadir}/mythtv/sql
}

PACKAGES =+ "mythtv-backend mythtv-frontend mythtv-bin mythtv-filters mythtv-database"
PACKAGES_DYNAMIC = "mythtv-theme-*"

FILES_${PN}-dbg += "${libdir}/mythtv/filters/.debug"
FILES_mythtv-backend = "${bindir}/mythbackend ${bindir}/mythcommflag ${bindir}/mythfilldatabase ${bindir}/mythtranscode"
FILES_mythtv-frontend = "${bindir}/mythfrontend ${datadir}/mythtv/i18n/mythfrontend_* ${datadir}/mythtv/*.ttf"
FILES_mythtv-bin = "${bindir}/*"
FILES_mythtv-filters = "${libdir}/mythtv/filters/*"
FILES_mythtv-database = "${datadir}/mythtv/sql/"

RRECOMMENDS_mythtv-frontend += "mythtv-theme-defaultmenu mythtv-theme-terra"

mythlibs = "mythdb mythavutil mythavcodec mythavformat mythswscale mythhdhomerun myth mythtv mythui mythfreemheg mythupnp mythlivemedia"

python __anonymous () {
    import bb
    mythlibs = bb.data.getVar('mythlibs', d).split()
    pv = bb.data.expand(bb.data.getVar("REALPV", d), d)
    for m in mythlibs:
        bb.data.setVar("FILES_lib%s%s" % (m, pv), "${libdir}/lib%s-%s.so.*" % (m, pv), d)
        bb.data.setVar("FILES_lib%s%s-dev" % (m, pv), "${libdir}/lib%s-%s.*" % (m, pv), d)
    packages = " ".join(map(lambda x: "lib%s%s lib%s%s-dev" % (x, pv, x, pv), mythlibs) + bb.data.getVar("PACKAGES", d).split())
    bb.data.setVar("PACKAGES", packages, d)
}
python populate_packages_prepend () {
        new_packages = []
        def the_hook(file, pkg, pattern, format, basename):
                new_packages.append(pkg)
        do_split_packages(d, root=bb.data.expand('${datadir}/mythtv/themes', d), file_regex='(.*)', output_pattern='mythtv-theme-%s', description='MythTV theme %s', allow_dirs=True, hook=the_hook, prepend=True)
        bb.data.setVar("RDEPENDS_${PN}", "%s %s" % (bb.data.getVar("RDEPENDS_${PN}", d), " ".join(new_packages)), d)
}

repository: demsey/openembedded

repo_name: demsey/openembedded


text:
package rate

import (
	"sync"
)

// WaitGroup 并发阻塞, 安全退出
type WaitGroup struct {
	Limit
	opts Options
	wg sync.WaitGroup
}

// NewWaitGroup create WaitGroup
func NewWaitGroup(opts ...Option) *WaitGroup {
	return &WaitGroup{
		Limit: NewLimit(opts...),
	}
}

// Add add
func (l *WaitGroup) Add(delta int) {
	l.Limit.Add(delta)
	l.wg.Add(delta)
}

// Done done
func (l *WaitGroup) Done() {
	l.Limit.Done()
	l.wg.Done()
}

// Wait wait
func (l *WaitGroup) Wait() {
	l.wg.Wait()
	close(l.Limit)
}

// Do execute func with limited, *But* goroutine unsaft
func (l *WaitGroup)  Do(f func()) {
	l.Add(1)
	go func() {
		defer l.Done()
		f()
	}()
}

// Close close
func (l *WaitGroup) Close() error {
	close(l.Limit)
	return nil
}

repository: corex-io/rate

repo_name: corex-io/rate


text:
/*
Copyright 2019 The Tekton 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 remote

import (
	"fmt"
	"io/ioutil"
	"strings"

	"github.com/google/go-containerregistry/pkg/authn"
	imgname "github.com/google/go-containerregistry/pkg/name"
	v1 "github.com/google/go-containerregistry/pkg/v1"
	"github.com/google/go-containerregistry/pkg/v1/remote"
	"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
	"github.com/tektoncd/pipeline/pkg/client/clientset/versioned/scheme"
)

// KeychainProvider is an input to the OCIResolver which returns a keychain for fetching remote images with
// authentication.
type KeychainProvider func() (authn.Keychain, error)

// OCIResolver will attempt to fetch Tekton resources from an OCI compliant image repository.
type OCIResolver struct {
	imageReference   string
	keychainProvider KeychainProvider
}

// GetTask will retrieve the specified task from the resolver's defined image and return its spec. If it cannot be
// retrieved for any reason, an error is returned.
func (o OCIResolver) GetTask(taskName string) (*v1beta1.TaskSpec, error) {
	taskContents, err := o.readImageLayer("task", taskName)
	if err != nil {
		return nil, err
	}

	// Deserialize the task into a valid task spec.
	var task v1beta1.Task
	_, _, err = scheme.Codecs.UniversalDeserializer().Decode(taskContents, nil, &task)
	if err != nil {
		return nil, fmt.Errorf("Invalid remote task %s: %w", taskName, err)
	}

	return &task.Spec, nil
}

func (o OCIResolver) readImageLayer(kind string, name string) ([]byte, error) {
	imgRef, err := imgname.ParseReference(o.imageReference)
	if err != nil {
		return nil, fmt.Errorf("%s is an unparseable task image reference: %w", o.imageReference, err)
	}

	// Create a keychain for use in authenticating against the remote repository.
	keychain, err := o.keychainProvider()
	if err != nil {
		return nil, err
	}

	img, err := remote.Image(imgRef, remote.WithAuthFromKeychain(keychain))
	if err != nil {
		return nil, fmt.Errorf("Error pulling image %q: %w", o.imageReference, err)
	}
	// Ensure the media type is exclusively the Tekton catalog media type.
	if mt, err := img.MediaType(); err != nil || string(mt) != "application/vnd.cdf.tekton.catalog.v1beta1+yaml" {
		return nil, fmt.Errorf("cannot parse reference from image type %s: %w", string(mt), err)
	}

	m, err := img.Manifest()
	if err != nil {
		return nil, err
	}

	ls, err := img.Layers()
	if err != nil {
		return nil, err
	}
	var layer v1.Layer
	for idx, l := range m.Layers {
		if l.Annotations["org.opencontainers.image.title"] == o.getLayerName(kind, name) {
			layer = ls[idx]
		}
	}
	if layer == nil {
		return nil, fmt.Errorf("Resource %s/%s not found", kind, name)
	}
	rc, err := layer.Uncompressed()
	if err != nil {
		return nil, err
	}
	defer rc.Close()
	return ioutil.ReadAll(rc)
}

func (o OCIResolver) getLayerName(kind string, name string) string {
	return fmt.Sprintf("%s/%s", strings.ToLower(kind), name)
}

repository: shahnewazrifat/pipeline

repo_name: shahnewazrifat/pipeline


text:
@article{bohnetFoulingHeatTransfer1987,
  title = {Fouling of Heat Transfer Surfaces},
  author = {Bohnet, Matthias},
  date = {1987},
  journaltitle = {Chemical Engineering \& Technology - CET},
  volume = {10},
  pages = {113--125},
  issn = {0930-7516},
  doi = {10.1002/ceat.270100115},
  url = {http://doi.wiley.com/10.1002/ceat.270100115},
  number = {1}
}

@article{prabhanjanComparisonHeatTransfer2002,
  title = {Comparison of Heat Transfer Rates between a Straight Tube Heat Exchanger and a Helically Coiled Heat Exchanger},
  author = {Prabhanjan, D.G. and Raghavan, G.S.V. and Rennie, T.J.},
  date = {2002-02},
  journaltitle = {International Communications in Heat and Mass Transfer},
  volume = {29},
  pages = {185--191},
  issn = {07351933},
  doi = {10.1016/S0735-1933(02)00309-3},
  url = {http://linkinghub.elsevier.com/retrieve/pii/S0735193302003093},
  number = {2}
}

@article{wongLogMeanHeat2009,
  title = {The Log Mean Heat Transfer Rate Method of Heat Exchanger Considering the Influence of Heat Radiation},
  author = {Wong, King-Leung and Ke, Ming-Tsun and Ku, Shi-Shi},
  date = {2009-11},
  journaltitle = {Energy Conversion and Management},
  volume = {50},
  pages = {2693--2698},
  issn = {01968904},
  doi = {10.1016/j.enconman.2009.05.024},
  url = {https://linkinghub.elsevier.com/retrieve/pii/S0196890409001988},
  number = {11}
}

repository: ahoetker/LaTeX-Packages

repo_name: ahoetker/LaTeX-Packages


text:
package isis

import (
	"github.com/m3philis/junos_exporter/collector"
	"github.com/m3philis/junos_exporter/rpc"
	"github.com/prometheus/client_golang/prometheus"
)

const prefix string = "junos_isis_"

var (
	upCount    *prometheus.Desc
	totalCount *prometheus.Desc
)

func init() {
	l := []string{"target"}
	upCount = prometheus.NewDesc(prefix+"up_count", "Number of ISIS Adjacencies in state up", l, nil)
	totalCount = prometheus.NewDesc(prefix+"total_count", "Number of ISIS Adjacencies", l, nil)
}

type isisCollector struct {
}

// NewCollector creates a new collector
func NewCollector() collector.RPCCollector {
	return &isisCollector{}
}

// Describe describes the metrics
func (*isisCollector) Describe(ch chan<- *prometheus.Desc) {
	ch <- upCount
	ch <- totalCount
}

// Collect collects metrics from JunOS
func (c *isisCollector) Collect(client *rpc.Client, ch chan<- prometheus.Metric, labelValues []string) error {
	adjancies, err := c.isisAdjancies(client)
	if err != nil {
		return err
	}

	ch <- prometheus.MustNewConstMetric(upCount, prometheus.GaugeValue, adjancies.Up, labelValues...)
	ch <- prometheus.MustNewConstMetric(totalCount, prometheus.GaugeValue, adjancies.Total, labelValues...)

	return nil
}

func (c *isisCollector) isisAdjancies(client *rpc.Client) (*IsisAdjacencies, error) {
	up := 0
	total := 0

	var x = IsisRpc{}
	err := client.RunCommandAndParse("show isis adjacency", &x)
	if err != nil {
		return nil, err
	}

	for _, adjacency := range x.Information.Adjacencies {
		if adjacency.AdjacencyState == "Up" {
			up++
		}
		total++
	}

	return &IsisAdjacencies{Up: float64(up), Total: float64(total)}, nil
}


text:
package main

import (
	"context"
	"github.com/gogf/gf/os/glog"
)

func main() {
	glog.SetCtxKeys("Trace-Id", "Span-Id", "Test")
	ctx := context.WithValue(context.Background(), "Trace-Id", "1234567890")
	ctx = context.WithValue(ctx, "Span-Id", "abcdefg")

	glog.Ctx(ctx).Print(1, 2, 3)
}


text:
macro(LOG_DEBUG log_msg)
#	message(STATUS "DEBUG    ${log_msg}")
endmacro()

macro(LOG_VERBOSE log_msg)
#	message(STATUS "${log_msg}")
	log_debug(${log_msg})
endmacro()

macro(COPY_TO_DESTINATION file var_dest_file var_code_list)
	file(INSTALL "${file}" DESTINATION "${DESTINATION}")
	get_filename_component(filename "${file}" NAME)
	set(${var_dest_file} "${DESTINATION}/${filename}")
	list(APPEND ${var_code_list} ${${var_dest_file}})
endmacro()

macro(GET_ALIASES file var_real_file var_aliases)
	get_filename_component(${var_real_file} "${file}" REALPATH)
	if(NOT "${${var_real_file}}" STREQUAL "${file}")
		list(APPEND ${var_aliases} ${file})
	endif()
	get_filename_component(filename_WE ${file} NAME_WE)
	get_filename_component(dir ${file} PATH)
	file(GLOB alias_candidates ${dir}/${filename_WE}*)
	list(REMOVE_ITEM alias_candidates ${${var_real_file}})
	foreach(alias_candidate ${alias_candidates})
		get_filename_component(alias_resolved ${alias_candidate} REALPATH)
		if(${alias_resolved} STREQUAL ${${var_real_file}})
			list(APPEND ${var_aliases} ${alias_candidate})
		endif()
	endforeach()
	if(${var_aliases})
		list(REMOVE_DUPLICATES ${var_aliases})
	endif()
endmacro()

macro(IS_SYMLINK file var_result)
	get_filename_component(absoulute_path "${file}" ABSOLUTE)
	get_filename_component(real_path "${file}" REALPATH)
	if(NOT "${absoulute_path}" STREQUAL "${real_path}")
		set(${var_result} true)
	else()
		set(${var_result} false)
	endif()
endmacro()

macro(FIND_LIBRARY_IN_BUNDLE_DEPENDENCIES library var_result)
	unset(${var_result})
	foreach(bundle ${BUNDLE_DEPS})
		list(FIND ${bundle}_LIBRARIES ${library} index)
		if(index GREATER -1)
			set(${var_result} ${bundle})
			break()
		endif()
	endforeach()
endmacro()

# -- build an xml tag
# usage: xml(VAR foo bar) --> VAR = "<foo>bar</foo>"
macro(XML VAR_ELEMENT TAG_NAME CONTENT)
	set(${VAR_ELEMENT} <${TAG_NAME}>${CONTENT}</${TAG_NAME}>)
endmacro()

# -- convert a cmake list to a comma delineated string
# usage: list_to_comma_separated(VAR ${list} [..])
macro(LIST_TO_COMMA_SEPARATED VAR_NAME)
	set(${VAR_NAME} ${ARGV1})
	if(${ARGC} GREATER 2)
		list(APPEND remaining_args ${ARGN})
		list(REMOVE_AT remaining_args 0)
		foreach(arg ${remaining_args})
			set(${VAR_NAME} ${${VAR_NAME}},${arg})
		endforeach()
	endif()
endmacro()

macro(SPLIT str sep var_head var_tail)
	string(LENGTH "${str}" length)
	if(length GREATER 0)
		string(FIND "${str}" "${sep}" index)
		if(${index} GREATER -1)
			string(SUBSTRING "${str}" 0 ${index} ${var_head})
			math(EXPR index ${index}+1)
			string(SUBSTRING "${str}" ${index} -1 ${var_tail})
		else()
			set(${var_head} "${str}")
			unset(${var_tail})
		endif()
	else()
		unset(${var_head})
		unset(${var_tail})
	endif()
endmacro()

macro(BUNDLE_KEY bundle key_var)
	string(TOUPPER ${bundle} TEMP)
    string(REPLACE "." "_" ${key_var} ${TEMP})
    unset(TEMP)
endmacro()

macro(LIBRARY_KEY library key_var)
	#get_filename_component(lib_file "${library}" REALPATH)
	get_filename_component(lib_file_name ${library} NAME)
	string(TOUPPER ${lib_file_name} TEMP)
    string(REPLACE "." "_" ${key_var} ${TEMP})
    unset(TEMP)
    #unset(lib_file)
endmacro()

# script that fixes up a poco osp bundle's libraries
# Call with the following definitions:
#  DESTINATION set to the directory that the libraries will be copied to.
#  LIBRARIES set to a list of library names to be copied to and fixed up in the bundle.
#  <NAME>_FILE set to that library's full path to main file ($<TARGET_FILE:...>)
#  BUNDLE_DEPS set to a list of names of dependent bundles.
#  <BUNDLE_NAME>_LIBRARIES set to that bundle's contained libraries.
#  CONFIGURATION set to the current build configuration ($<CONFIGURATION>)
function(POCO_FIXUP_LIBRARIES bundle)
	## generate a unique key (toupper from the bundle name)
	bundle_key(${bundle} BUNDLE)
	set(mapping_file ${${BUNDLE}_POCO_BUNDLE_MAPPING_FILE})
	file(WRITE ${mapping_file} "#This is a mapping file for bundle ${bundle} ${BUNDLE}.\n")
	file(APPEND ${mapping_file} "set(${BUNDLE}_NAME ${bundle})\n")
	set(lib_location "lib")
	set(destination ${${BUNDLE}_POCO_BUNDLE_ROOT}/${lib_location})
	if(APPLE) ## get install_name_tool executable
		find_program(INSTALL_NAME_TOOL NAME install_name_tool HINTS /usr/bin /usr/local/bin)
    	if(NOT INSTALL_NAME_TOOL)
    		message(FATAL_ERROR "install_name_tool not found")
    	endif()
    endif()
    # gather all required libraries and their prerequisites
    include(GetPrerequisites)
	foreach(lib ${${BUNDLE}_POCO_BUNDLE_LIBRARIES})
		if(NOT ${lib}_FILE)
			message(FATAL_ERROR "_FILE not defined for lib: ${lib}")
		endif()
		get_filename_component(lib_real_file "${${lib}_FILE}" REALPATH)
		library_key(${lib_real_file} key)
		get_filename_component(${key}_SOURCE_DIRECTORY "${${lib}_FILE}" PATH)

		## overrides to spoof file location and type for ignored or already included bundle libraries.
		function(gp_resolve_item_override context item exepath dirs resolved_item_var)
			if(resolved)
			#	return()
			endif()
			log_debug("---- gp_resolve_item_override")
			log_debug(" ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}")
			log_debug("CONTEXT: ${context}")
			log_debug("ITEM: ${item}")
			log_debug("EXEPATH: ${exepath}")
			log_debug("DIRS: ${dirs}")
			log_debug("${resolved_item_var}: ${${resolved_item_var}}")
			library_key(${item} item_key) # get key for item
			if(${${item_key}_MAPPING}_BUNDLE)
				set(${resolved_item_var} ${${${item_key}_MAPPING}_SOURCE_FILE} PARENT_SCOPE)
				set(resolved TRUE PARENT_SCOPE)
				log_debug("Bundle-item '${item}' with Key ${item_key} already found in Bundle ${${${item_key}_BUNDLE}} and will be skipped.")
			elseif(${item_key}_IGNORE OR ${item}_IGNORE)
				set(${resolved_item_var} "${${key}_SOURCE_DIRECTORY}/${item}" PARENT_SCOPE) # spoofing as a local type
				set(resolved TRUE PARENT_SCOPE)
				log_debug("Bundle-item '${item}' with Key ${item_key} is on ignore list. Probably a dynamic library that will be provided during runtime.")
			else()
				log_debug("Bundle-item '${item}' with Key ${item_key} not on ignore list or in other bundle. Resolved: ${resolved} ${${resolved_item_var}}")
			endif()
		endfunction()

		function(gp_resolved_file_type_override file type_var)
			log_debug("----- gp_resolved_file_type")
			log_debug(" ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}")
			log_debug("FILE: ${file}")
			log_debug("${type_var}: ${${type_var}}")
			library_key(${file} item_key) # get key for item
			if(${${item_key}_MAPPING}_BUNDLE)
				set(${type_var} system PARENT_SCOPE)
				log_debug("Bundle-item '${item}' with Key ${item_key} already found in Bundle ${${${item_key}_BUNDLE}_NAME}. Setting resolved type to system.")
			elseif(${item_key}_IGNORE OR ${item}_IGNORE)
				log_debug("Bundle-item '${item}' with Key ${item_key} is on ignore list. Setting resolved type to system.")
				set(${type_var} system PARENT_SCOPE)
			else()
				log_debug("Bundle-item '${item}' with Key ${item_key} not on ignore list or in other bundle. Setting resolved type to ${${type_var}}.")
			endif()
		endfunction()

		message("GP_RESOLVE_ITEM(${${lib}_FILE} ${${lib}_FILE} ${${lib}_FILE} ${${key}_SOURCE_DIRECTORY} ${key}_resolved)")
		GP_RESOLVE_ITEM(${${lib}_FILE} ${${lib}_FILE} ${${lib}_FILE} ${${key}_SOURCE_DIRECTORY} ${key}_resolved)
		get_prerequisites(${${lib}_FILE} ${key}_prereqs 1 0 "" "${${key}_SOURCE_DIRECTORY}")
		list(APPEND libraries ${${lib}_FILE} ${${key}_prereqs})
		message(STATUS "${key} ${${lib}_FILE} PREREQS: ${${key}_prereqs}")
		message(STATUS "${${key}_SOURCE_DIRECTORY}")
		message(STATUS "${key}_resolved: ${${key}_resolved}")
	endforeach()
	list(REMOVE_DUPLICATES libraries)
	log_debug("${libraries}")

	# generate keys and alias mappings
	foreach(lib_file ${libraries})
		if(IS_ABSOLUTE ${lib_file})
			log_verbose("Preparing ${lib_file}")
			get_filename_component(lib_real_file "${lib_file}" REALPATH)
			library_key(${lib_real_file} key)
			log_verbose(" Library key ${key}")
			# handle symlinks
			#is_symlink(${${lib}_FILE} file_is_symlink)
			get_aliases(${lib_file} ${key}_SOURCE_FILE ${key}_ALIASES)
			get_filename_component(${key}_SOURCE_FILE_NAME "${${key}_SOURCE_FILE}" NAME)
			get_filename_component(${key}_SOURCE_DIRECTORY "${${key}_SOURCE_FILE}" PATH)
			set(${key}_SOURCE_LINK_NAME "${lib_file}")
			set(${key}_DEST_FILE_NAME "${${key}_SOURCE_FILE_NAME}")
			#set(${key}_DEST_LINK_NAME "@loader_path/../MacOS/codeCache/${${key}_DEST_FILE_NAME}")
			#set(${key}_DEST_LINK_NAME "@executable_path/codeCache/${${key}_DEST_FILE_NAME}")
			if(APPLE)
				if(${lib_file} MATCHES "(dylib)$")
					# determine the link name of the library (its id)
					execute_process(COMMAND otool -D ${lib_file}
						COMMAND tail -n 1 # only get the second line of output
						OUTPUT_VARIABLE ${key}_SOURCE_LINK_NAME
						OUTPUT_STRIP_TRAILING_WHITESPACE
					)
					log_debug("Lib id: ${${key}_SOURCE_LINK_NAME}")
					get_filename_component(${key}_SO_NAME "${${key}_SOURCE_LINK_NAME}" NAME)
					if(NOT ${key}_SOURCE_FILE_NAME STREQUAL ${key}_SO_NAME)
						set(${key}_DEST_FILE_NAME ${${key}_SO_NAME})
					endif()
				endif()
			endif()
			foreach(alias ${${key}_ALIASES} ${${key}_SOURCE_FILE})
				library_key(${alias} alias_key)
				set(${alias_key}_MAPPING ${key})
				set(${alias_key}_MAPPING ${key} PARENT_SCOPE)
				log_debug(" ${alias_key}_MAPPING: ${${alias_key}_MAPPING}")
				file(APPEND ${mapping_file} "\nset(${alias_key}_MAPPING ${key})")
				log_verbose(" Added alias ${alias_key}: ${alias}")
			endforeach()
			list(APPEND bundled_lib_keys ${key})
		endif()
	endforeach()

	# generate list of library files to copy to the bundle
#	foreach(key ${library_keys})
#		get_filename_component(${key_in_bundle}_SOURCE_FILE "${library}" ABSOLUTE)
#		get_filename_component(${key_in_bundle}_SOURCE_FILE_NAME "${library}" NAME)
#		set(${key_in_bundle}_SOURCE_LINK_NAME ${library})
#		set(${key_in_bundle}_DEST_FILE_NAME "${${key_in_bundle}_SOURCE_FILE_NAME}")
#		set(${key_in_bundle}_DEST_LINK_NAME "${${key_in_bundle}_DEST_FILE_NAME}")
#		list(APPEND bundled_lib_keys ${key_in_bundle})
#		list(APPEND ${${key}_MAPPING}_PREREQUISITES_KEYS ${key_in_bundle})
#		endforeach()
#	endforeach()
	list(REMOVE_DUPLICATES bundled_lib_keys)
	foreach(key ${bundled_lib_keys})
		if(${${key}_MAPPING}_BUNDLE)
			log_verbose("found ${key} in ${${key}_BUNDLE}, not moving to bundle ${BUNDLE}")
			list(APPEND remove_keys ${key})
		endif()
		if(NOT EXISTS ${${key}_SOURCE_FILE})
			log_verbose("No source file for Key ${key} found at ${${key}_SOURCE_FILE} ")
			list(APPEND remove_keys ${key})
		endif()
	endforeach()
	if(remove_keys)
		list(REMOVE_ITEM bundled_lib_keys ${remove_keys})
	endif()

	log_verbose("Keys that will be added to bundle: ${bundled_lib_keys}")
	log_verbose("Keys that will be omitted: ${remove_keys}")
	foreach(key ${bundled_lib_keys})
		# copy the library to the destination directory. (BUNDLE_ROOT/lib)
		set(${key}_DEST_FILE ${destination}/${${key}_DEST_FILE_NAME})
		configure_file(${${key}_SOURCE_FILE} ${${key}_DEST_FILE} COPYONLY)
		#file(INSTALL "${${key}_SOURCE_FILE}" DESTINATION "${destination}")
		#if(NOT ${key}_SOURCE_FILE_NAME STREQUAL ${key}_DEST_FILE_NAME)
			#file(RENAME "${destination}/${${key}_SOURCE_FILE_NAME}" "${${key}_DEST_FILE_NAME}")
		#endif()
		file(RELATIVE_PATH code_entry ${${BUNDLE}_POCO_BUNDLE_ROOT} ${${key}_DEST_FILE})
		list(APPEND code ${code_entry})
	endforeach()

	if(APPLE)
		foreach(key ${bundled_lib_keys})
			log_debug("${key}_PREREQUISITES_KEYS: ${${key}_PREREQUISITES_KEYS}")
			log_verbose("Changing install names for ${key}")
			unset(install_name_tool_args)
			foreach(prereq ${${key}_prereqs})
				library_key(${prereq} _key)
				if(${_key}_MAPPING)
					set(prereq_key ${${_key}_MAPPING})
				else()
					set(prereq_key ${_key})
				endif()
				log_verbose("${_key} ${prereq_key} ${${prereq_key}_DEST_LINK_NAME}")
				if(${prereq_key}_DEST_LINK_NAME)
					# the prereq was already renamed, by another bundle possibly.
					log_verbose(" D ${prereq} -> ${${prereq_key}_DEST_LINK_NAME}")
					execute_process(COMMAND ${INSTALL_NAME_TOOL} -change "${prereq}" "${${prereq_key}_DEST_LINK_NAME}" "${${key}_DEST_FILE}")
				else()
					if(NOT IS_ABSOLUTE ${prereq})
						# see if the name starts with a @rpath, @executable_path or @loader_path
						if(${prereq} MATCHES "^(@rpath|@executable_path|@loader_path)")
							message(STATUS "${prereq} is portable dyld, that's fine.")
						else()
							message(FATAL_ERROR "${prereq} has no absolute path.")
						endif()
						#log_verbose(" ${prereq} -> @loader_path/../MacOS/${prereq}")
						#execute_process(COMMAND ${INSTALL_NAME_TOOL} -change "${prereq}" "@loader_path/../MacOS/${prereq}" "${${key}_DEST_FILE}")
						#log_verbose(" ${prereq} -> @executable_path/${prereq}")
						#set(${prereq_key}_DEST_LINK_NAME @executable_path/${prereq})
						#execute_process(COMMAND ${INSTALL_NAME_TOOL} -change "${prereq}" "@executable_path/${prereq}" "${${key}_DEST_FILE}")
					endif()
				endif()
			endforeach()
			if(${key}_DEST_LINK_NAME)
				execute_process(COMMAND ${INSTALL_NAME_TOOL} -id "${${key}_DEST_LINK_NAME}" "${${key}_DEST_FILE}")
			endif()
			execute_process(COMMAND ${INSTALL_NAME_TOOL}
				-add_rpath "@loader_path/." # this allows the library to find other libs in the bundle cache directory
				"${${key}_DEST_FILE}"
			)

		endforeach()
	endif()
	# handle debug symbols for win32 dlls
	if("${CONFIGURATION}" STREQUAL Debug)
		if(WIN32)
			foreach(key ${bundled_lib_keys})
			string(REPLACE ".dll" ".pdb" ${key}_PDB_FILE "${${key}_SOURCE_FILE}")
			if(EXISTS ${${key}_PDB_FILE})
				log_debug("PDB file for ${key}: ${${key}_PDB_FILE}")
				file(INSTALL "${${key}_PDB_FILE}" DESTINATION "${destination}")
				get_filename_component(${key}_PDB_FILE_NAME ${${key}_PDB_FILE} NAME)
				list(APPEND code ${lib_location}/${${key}_PDB_FILE_NAME})
			else()
				message(WARNING "Debug symbols for ${key} not found.")
			endif()
			endforeach()
		endif()
	endif()
	# write mappings to file
	# add dependencies to own mapping file to support transitive lookup of mappings
	foreach(other_mapping_file ${${BUNDLE}_INCLUDED_MAPPINGS})
		file(APPEND ${mapping_file} "\ninclude(\"${other_mapping_file}\")")
	endforeach()
	foreach(key ${bundled_lib_keys})
		file(APPEND ${mapping_file} "\nset(${key}_SOURCE_LINK_NAME \"${${key}_SOURCE_LINK_NAME}\")")
		file(APPEND ${mapping_file} "\nset(${key}_SOURCE_DIRECTORY \"${${key}_SOURCE_DIRECTORY}\")")
		file(APPEND ${mapping_file} "\nset(${key}_SOURCE_FILE_NAME \"${${key}_SOURCE_FILE_NAME}\")")
		file(APPEND ${mapping_file} "\nset(${key}_SOURCE_FILE \"${${key}_SOURCE_FILE}\")")
		file(APPEND ${mapping_file} "\nset(${key}_DEST_FILE_NAME \"${${key}_DEST_FILE_NAME}\")")
		file(APPEND ${mapping_file} "\nset(${key}_DEST_FILE \"${${key}_DEST_FILE}\")")
		file(APPEND ${mapping_file} "\nset(${key}_DEST_LINK_NAME \"${${key}_DEST_LINK_NAME}\")")
		file(APPEND ${mapping_file} "\nset(${key}_BUNDLE ${BUNDLE})")
		set(${key}_DEST_FILE ${${key}_DEST_FILE} PARENT_SCOPE)
		set(${key}_DEST_FILE_NAME ${${key}_DEST_FILE_NAME} PARENT_SCOPE)
	endforeach()

	set(${BUNDLE}_POCO_BUNDLE_CODE ${${BUNDLE}_POCO_BUNDLE_CODE} ${code} PARENT_SCOPE)
	log_debug("Appended to ${BUNDLE}_POCO_BUNDLE_CODE: ${code}")
endfunction()

function(POCO_SET_ACTIVATOR bundle library)
	bundle_key(${bundle} BUNDLE)
	library_key(${${library}_FILE} key)
	log_debug("key: ${key}")
	set(key ${${key}_MAPPING})
	log_debug("key: ${key}")
	set(full_filename ${${key}_DEST_FILE_NAME})
	string(REGEX REPLACE "d?\\.(dll|so|dylib)$" "" activator "${full_filename}")
	set(${BUNDLE}_POCO_BUNDLE_ACTIVATOR_LIBRARY ${activator} PARENT_SCOPE)
	log_debug("Set ${BUNDLE}_POCO_BUNDLE_ACTIVATOR_LIBRARY: ${activator} from ${${key}_DEST_FILE_NAME}")
endfunction()

function(POCO_COPY_FILES_TO_BUNDLE bundle file location_in_bundle)
	bundle_key(${bundle} BUNDLE)
	get_filename_component(filename "${file}" NAME)
	set(destination "${${BUNDLE}_POCO_BUNDLE_ROOT}/${location_in_bundle}")
	file(INSTALL "${file}" DESTINATION "${destination}")
	list(APPEND files_in_bundle "${location_in_bundle}/${filename}")
	set(${BUNDLE}_POCO_BUNDLE_FILES ${${BUNDLE}_POCO_BUNDLE_FILES} ${files_in_bundle} PARENT_SCOPE)
	log_debug("Appended to ${BUNDLE}_POCO_BUNDLE_FILES: ${files_in_bundle}")
endfunction()

function(POCO_CONFIGURE_BUNDLE_SPEC bundle input output)
	bundle_key(${bundle} BUNDLE)
	set(POCO_BUNDLE_SYMBOLIC_NAME ${${BUNDLE}_POCO_BUNDLE_SYMBOLIC_NAME})
	set(POCO_BUNDLE_NAME ${${BUNDLE}_POCO_BUNDLE_NAME})
	set(POCO_BUNDLE_VERSION ${${BUNDLE}_POCO_BUNDLE_VERSION})
	log_verbose("Configuring bundle specification for ${BUNDLE}")
	# build all xml tags
if(${BUNDLE}_POCO_BUNDLE_VENDOR)
	xml(POCO_BUNDLE_VENDOR_ELEMENT vendor ${${BUNDLE}_POCO_BUNDLE_VENDOR})
	log_debug("${POCO_BUNDLE_VENDOR_ELEMENT}")
else()
	log_debug("No vendor.")
endif()
if(${BUNDLE}_POCO_BUNDLE_COPYRIGHT)
	xml(POCO_BUNDLE_COPYRIGHT_ELEMENT copyright ${${BUNDLE}_POCO_BUNDLE_COPYRIGHT})
	log_debug("${POCO_BUNDLE_COPYRIGHT_ELEMENT}")
else()
	log_debug("No copyright.")
endif()
if(${BUNDLE}_POCO_BUNDLE_ACTIVATOR_CLASS AND ${BUNDLE}_POCO_BUNDLE_ACTIVATOR_LIBRARY)
	xml(POCO_BUNDLE_ACTIVATOR_CLASS_ELEMENT class ${${BUNDLE}_POCO_BUNDLE_ACTIVATOR_CLASS})
	xml(POCO_BUNDLE_ACTIVATOR_LIBRARY_ELEMENT library ${${BUNDLE}_POCO_BUNDLE_ACTIVATOR_LIBRARY})
	xml(POCO_BUNDLE_ACTIVATOR_ELEMENT activator "${POCO_BUNDLE_ACTIVATOR_CLASS_ELEMENT}${POCO_BUNDLE_ACTIVATOR_LIBRARY_ELEMENT}")
	log_debug("${POCO_BUNDLE_ACTIVATOR_ELEMENT}")
else()
	log_debug("No activator. ${${BUNDLE}_POCO_BUNDLE_ACTIVATOR_CLASS} ${${BUNDLE}_POCO_BUNDLE_ACTIVATOR_LIBRARY}")
endif()
if(${BUNDLE}_POCO_BUNDLE_LAZY_START)
	xml(POCO_BUNDLE_LAZY_START_ELEMENT lazyStart ${${BUNDLE}_POCO_BUNDLE_LAZY_START})
	log_debug("${POCO_BUNDLE_LAZY_START_ELEMENT}")
else()
	log_debug("No lazyStart.")
endif()
if(${BUNDLE}_POCO_BUNDLE_RUN_LEVEL)
	xml(POCO_BUNDLE_RUN_LEVEL_ELEMENT runLevel ${${BUNDLE}_POCO_BUNDLE_RUN_LEVEL})
	log_debug("${POCO_BUNDLE_RUN_LEVEL_ELEMENT}")
else()
	log_debug("No runLevel.")
endif()
if(${BUNDLE}_POCO_BUNDLE_DEPENDENCY)
	# workaround for cmake bug 9317 leading to erroneous list operations with square brackets
	# http://public.kitware.com/Bug/view.php?id=9317
	set(list_sep ",")
	set(dep_sep "@")
	split("${${BUNDLE}_POCO_BUNDLE_DEPENDENCY}" "${list_sep}" head tail)
	string(LENGTH "${head}" length)
	while(length GREATER 0)
		split("${head}" "${dep_sep}" depSymbolicName depVersion)
		split("${tail}" "${list_sep}" head tail)
		string(LENGTH "${head}" length)
		xml(DEPENDENCY_SYMBOLIC_NAME_ELEMENT symbolicName ${depSymbolicName})
		xml(DEPENDENCY_VERSION_ELEMENT version ${depVersion})
		xml(DEPENDENCY_ELEMENT dependency "${DEPENDENCY_SYMBOLIC_NAME_ELEMENT}${DEPENDENCY_VERSION_ELEMENT}")
		set(POCO_BUNDLE_DEPENDENCY_ELEMENT "${POCO_BUNDLE_DEPENDENCY_ELEMENT}${DEPENDENCY_ELEMENT}")
	endwhile()
	log_debug("${POCO_BUNDLE_DEPENDENCY_ELEMENT}")
else()
	log_debug("No dependency.")
endif()
if(${BUNDLE}_POCO_BUNDLE_EXTENDS)
	xml(POCO_BUNDLE_EXTENDS_ELEMENT extends ${${BUNDLE}_POCO_BUNDLE_EXTENDS})
	log_debug("${POCO_BUNDLE_EXTENDS_ELEMENT}")
else()
	log_debug("No extends.")
endif()
if(${BUNDLE}_POCO_BUNDLE_CODE)
	list_to_comma_separated(POCO_BUNDLE_CODE_COMMA_SEP ${${BUNDLE}_POCO_BUNDLE_CODE})
	xml(POCO_BUNDLE_CODE_ELEMENT code ${POCO_BUNDLE_CODE_COMMA_SEP})
	log_debug("${POCO_BUNDLE_CODE_ELEMENT}")
else()
	log_debug("No code.")
endif()
if(${BUNDLE}_POCO_BUNDLE_FILES)
	list_to_comma_separated(POCO_BUNDLE_FILES_COMMA_SEP ${${BUNDLE}_POCO_BUNDLE_FILES})
	xml(POCO_BUNDLE_FILES_ELEMENT files ${POCO_BUNDLE_FILES_COMMA_SEP})
	log_debug("${POCO_BUNDLE_FILES_ELEMENT}")
else()
	log_debug("No files.")
endif()

configure_file("${input}" "${output}")
message(STATUS "Bundle specification written to ${output}")
endfunction()

extension: cmake


text:
@book{proudfoot2004,
    AUTHOR = {Proudfoot, Nicholas James},
     TITLE = {Hyperkahler analogues of {K}ahler quotients},
      NOTE = {Thesis (Ph.D.)--University of California, Berkeley},
      YEAR = {2004}
}

@book{guillemin1994,
    AUTHOR = {Guillemin, Victor},
     TITLE = {Moment maps and combinatorial invariants of {H}amiltonian
              {$T^n$}-spaces},
    SERIES = {Progress in Mathematics},
    VOLUME = {122},
 PUBLISHER = {Birkh\"{a}user Boston, Inc., Boston, MA},
      YEAR = {1994}
}

@article{BD2000,
    AUTHOR = {Bielawski, Roger and Dancer, Andrew S.},
     TITLE = {The geometry and topology of toric hyperk\"{a}hler manifolds},
   JOURNAL = {Comm. Anal. Geom.},
  FJOURNAL = {Communications in Analysis and Geometry},
    VOLUME = {8},
      YEAR = {2000},
    NUMBER = {4}
}

 @article{delzant1988,
    AUTHOR = {Delzant, Thomas},
     TITLE = {Hamiltoniens p\'{e}riodiques et images convexes de l'application
              moment},
   JOURNAL = {Bull. Soc. Math. France},
  FJOURNAL = {Bulletin de la Soci\'{e}t\'{e} Math\'{e}matique de France},
    VOLUME = {116},
      YEAR = {1988},
    NUMBER = {3}
}

@article {lerman1995,
    AUTHOR = {Lerman, Eugene},
     TITLE = {Symplectic cuts},
   JOURNAL = {Math. Res. Lett.},
  FJOURNAL = {Mathematical Research Letters},
    VOLUME = {2},
      YEAR = {1995},
    NUMBER = {3},
}

@article {verlinde1988,
    AUTHOR = {Verlinde, Erik},
     TITLE = {Fusion rules and modular transformations in {$2$}{D} conformal
              field theory},
   JOURNAL = {Nuclear Phys. B},
  FJOURNAL = {Nuclear Physics. B. Theoretical, Phenomenological, and
              Experimental High Energy Physics. Quantum Field Theory and
              Statistical Systems},
    VOLUME = {300},
      YEAR = {1988},
    NUMBER = {3},
}

@article {GP2017,
    AUTHOR = {Gukov, Sergei and Pei, Du},
     TITLE = {Equivariant {V}erlinde formula from fivebranes and vortices},
   JOURNAL = {Comm. Math. Phys.},
  FJOURNAL = {Communications in Mathematical Physics},
    VOLUME = {355},
      YEAR = {2017},
    NUMBER = {1},
}

@article {NR1969,
    AUTHOR = {Narasimhan, M. S. and Ramanan, S.},
     TITLE = {Moduli of vector bundles on a compact {R}iemann surface},
   JOURNAL = {Ann. of Math. (2)},
  FJOURNAL = {Annals of Mathematics. Second Series},
    VOLUME = {89},
      YEAR = {1969},
}

@article {barvinok1993,
    AUTHOR = {Barvinok, Alexander I.},
     TITLE = {Computing the volume, counting integral points, and
              exponential sums},
   JOURNAL = {Discrete Comput. Geom.},
  FJOURNAL = {Discrete \& Computational Geometry. An International Journal
              of Mathematics and Computer Science},
    VOLUME = {10},
      YEAR = {1993},
    NUMBER = {2},
}

@article {JW1992,
    AUTHOR = {Jeffrey, Lisa C. and Weitsman, Jonathan},
     TITLE = {Bohr-{S}ommerfeld orbits in the moduli space of flat
              connections and the {V}erlinde dimension formula},
   JOURNAL = {Comm. Math. Phys.},
  FJOURNAL = {Communications in Mathematical Physics},
    VOLUME = {150},
      YEAR = {1992},
    NUMBER = {3},
}


text:
package main

import (
	"bytes"
	"encoding/json"
	"flag"
	"fmt"
	"io"
	"io/ioutil"
	"log"
	"net/http"
	"strings"
	"time"

	graceful "gopkg.in/tylerb/graceful.v1"
)

var (
	address        = ""
	githubUsername = ""
	githubPassword = ""
	githubAddr     = ""
)

type gitHubRateLimit struct {
	Resources struct {
		Core struct {
			Limit     int `json:"limit"`
			Remaining int `json:"remaining"`
			Reset     int `json:"reset"`
		} `json:"core"`
		Search struct {
			Limit     int `json:"limit"`
			Remaining int `json:"remaining"`
			Reset     int `json:"reset"`
		} `json:"search"`
		Graphql struct {
			Limit     int `json:"limit"`
			Remaining int `json:"remaining"`
			Reset     int `json:"reset"`
		} `json:"graphql"`
	} `json:"resources"`
	Rate struct {
		Limit     int `json:"limit"`
		Remaining int `json:"remaining"`
		Reset     int `json:"reset"`
	} `json:"rate"`
}

func (g *gitHubRateLimit) writeTo(w io.Writer) (int64, error) {
	buf := &bytes.Buffer{}

	// GitHub Rate Limit: Resources
	buf.WriteString(fmt.Sprintf("# HELP %s %s\n", "github_ratelimit_resources_limit", "GitHub Rate Limit: Resources"))
	buf.WriteString(fmt.Sprintf("# TYPE %s %s\n", "github_ratelimit_resources_limit", "gauge"))

	buf.WriteString(fmt.Sprintf("%s{type=\"%s\"} %d\n", "github_ratelimit_resources_limit", "core", g.Resources.Core.Limit))
	buf.WriteString(fmt.Sprintf("%s{type=\"%s\"} %d\n", "github_ratelimit_resources_limit", "search", g.Resources.Search.Limit))
	buf.WriteString(fmt.Sprintf("%s{type=\"%s\"} %d\n", "github_ratelimit_resources_limit", "graphql", g.Resources.Graphql.Limit))

	// GitHub Rate Remaining: Resources
	buf.WriteString(fmt.Sprintf("# HELP %s %s\n", "github_ratelimit_resources_remaining", "GitHub Rate Remaining: Resources"))
	buf.WriteString(fmt.Sprintf("# TYPE %s %s\n", "github_ratelimit_resources_remaining", "gauge"))

	buf.WriteString(fmt.Sprintf("%s{type=\"%s\"} %d\n", "github_ratelimit_resources_remaining", "core", g.Resources.Core.Remaining))
	buf.WriteString(fmt.Sprintf("%s{type=\"%s\"} %d\n", "github_ratelimit_resources_remaining", "search", g.Resources.Search.Remaining))
	buf.WriteString(fmt.Sprintf("%s{type=\"%s\"} %d\n", "github_ratelimit_resources_remaining", "graphql", g.Resources.Graphql.Remaining))

	// GitHub Rate Reset: Resources
	buf.WriteString(fmt.Sprintf("# HELP %s %s\n", "github_ratelimit_resources_reset", "GitHub Rate Reset: Resources"))
	buf.WriteString(fmt.Sprintf("# TYPE %s %s\n", "github_ratelimit_resources_reset", "counter"))

	buf.WriteString(fmt.Sprintf("%s{type=\"%s\"} %d\n", "github_ratelimit_resources_reset", "core", g.Resources.Core.Reset))
	buf.WriteString(fmt.Sprintf("%s{type=\"%s\"} %d\n", "github_ratelimit_resources_reset", "search", g.Resources.Search.Reset))
	buf.WriteString(fmt.Sprintf("%s{type=\"%s\"} %d\n", "github_ratelimit_resources_reset", "graphql", g.Resources.Graphql.Reset))

	// GitHub Rate Rate
	buf.WriteString(fmt.Sprintf("# HELP %s %s\n", "github_ratelimit_rate_limit", "GitHub Rate Limit"))
	buf.WriteString(fmt.Sprintf("# TYPE %s %s\n", "github_ratelimit_rate_limit", "gauge"))
	buf.WriteString(fmt.Sprintf("%s %d\n", "github_ratelimit_rate_limit", g.Rate.Limit))

	buf.WriteString(fmt.Sprintf("# HELP %s %s\n", "github_ratelimit_rate_remaining", "GitHub Rate Remaining"))
	buf.WriteString(fmt.Sprintf("# TYPE %s %s\n", "github_ratelimit_rate_remaining", "gauge"))
	buf.WriteString(fmt.Sprintf("%s %d\n", "github_ratelimit_rate_remaining", g.Rate.Remaining))

	buf.WriteString(fmt.Sprintf("# HELP %s %s\n", "github_ratelimit_rate_reset", "GitHub Rate Reset"))
	buf.WriteString(fmt.Sprintf("# TYPE %s %s\n", "github_ratelimit_rate_reset", "counter"))
	buf.WriteString(fmt.Sprintf("%s %d\n", "github_ratelimit_rate_reset", g.Rate.Reset))

	io.Copy(w, buf)

	return 0, nil
}

func main() {
	addr := flag.String("addr", "0.0.0.0:8080", "HTTP Server address")
	url := flag.String("url", "https://api.github.com", "Github API address")
	username := flag.String("username", "", "GitHub username")
	password := flag.String("password", "", "GitHub password")
	flag.Parse()

	address = *addr
	githubAddr = *url + "/rate_limit"
	githubUsername = *username
	githubPassword = *password

	log.Println("Starting GitHub exporter.")
	log.Println("Listening on:", "'"+address+"'")
	log.Println("Scrapping:", "'"+githubAddr+"'", "with username", "'"+githubUsername+"'", "and password", "'"+strings.Repeat("*", len(githubPassword))+"'", ".")

	server := &graceful.Server{
		Timeout: 10 * time.Second,
		Server: &http.Server{
			Addr:        address,
			ReadTimeout: time.Duration(5) * time.Second,
			Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
				req, err := http.NewRequest("GET", githubAddr, nil)
				if err != nil {
					log.Println(err)
				}

				if (githubUsername != "") && (githubPassword != "") {
					req.SetBasicAuth(githubUsername, githubPassword)
				}

				transport := http.Transport{}
				resp, err := transport.RoundTrip(req)
				if err != nil {
					log.Println(err)
				}

				body, err := ioutil.ReadAll(resp.Body)
				if err != nil {
					log.Println(err)
				}

				resp.Body.Close()

				res := gitHubRateLimit{}
				json.Unmarshal([]byte(body), &res)

				res.writeTo(w)
			}),
		},
	}

	if err := server.ListenAndServe(); err != nil {
		log.Fatal(err)
	}
}


text:
// +build !bin

package cmd

import (
	"go/build"
	"io/ioutil"
	"log"
	"path/filepath"
	"strings"

	"github.com/spf13/cobra"
	"github.com/spf13/cobra/doc"

	"github.com/ostrost/ostent/cmd/cmdcobra"
)

// OstentPkgPath defined for looking up the package directory.
const OstentPkgPath = "github.com/ostrost/ostent"

var (
	// GenDocCmd represents the gendoc subcommand
	GenDocCmd = &cobra.Command{
		Use:   "gendoc",
		Short: "Generate ostent commands docs.",
		RunE:  GenDocRunE,
	}
	// GenDocDir is the flag value.
	GenDocDir string
)

func init() {
	pkg, err := build.Import(OstentPkgPath, "", build.FindOnly)
	if err != nil {
		log.Fatal(err)
	}
	GenDocDir = filepath.Join(pkg.Dir, "doc")
	OstentCmd.PersistentFlags().StringVar(&cmdcobra.ProfileHeapOutput, "profile-heap", "",
		"Profiling heap output `filename`")
	OstentCmd.PersistentFlags().StringVar(&cmdcobra.ProfileCPUOutput, "profile-cpu", "",
		"Profiling CPU output `filename`")
	cmdcobra.PersistentPreRuns.Add(cmdcobra.ProfileHeapRun)
	cmdcobra.PersistentPreRuns.Add(cmdcobra.ProfileCPURun)
	GenDocCmd.Flags().StringVar(&GenDocDir, "directory", GenDocDir,
		"Output `directory` for saving docs")
	OstentCmd.AddCommand(GenDocCmd)
}

func GenDocRunE(*cobra.Command, []string) error {
	OstentCmd.DisableAutoGenTag = true
	if cmd, _, err := OstentCmd.Find([]string{"gendoc"}); err == nil {
		// err is gone
		OstentCmd.RemoveCommand(cmd)
	}
	if err := doc.GenMarkdownTree(OstentCmd, GenDocDir); err != nil {
		return err
	}
	mdfile := filepath.Join(GenDocDir,
		strings.Replace(OstentCmd.CommandPath(), " ", "_", -1)+".md")
	text, err := ioutil.ReadFile(mdfile)
	if err != nil {
		return err
	}
	var lines []string
	for _, line := range strings.Split(string(text), "\n") {
		if strings.HasSuffix(line, "# SEE ALSO") {
			break
		}
		if !strings.Contains(line, "--profile-") { // skip dev-only flags
			lines = append(lines, line)
		}
	}
	return ioutil.WriteFile(mdfile, []byte(strings.Join(lines, "\n")), 0600)
}

repository: henrypfhu/ostent

repo_name: henrypfhu/ostent


text:
require xorg-app-common.inc
DEPENDS += " libxmu "
PE = "1"
PR = "${INC_PR}.0"

SRC_URI[archive.md5sum] = "86ab558441edfb86f853639e4290a754"
SRC_URI[archive.sha256sum] = "0d920660137dee514599f63b5a8c8ce14d2474607e28e32c973cafb360f7e738"


text:
SUMMARY = "RPMsg examples: echo test demo"

LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://LICENSE;md5=88c79b255c8e69a374365a4d9af40779"

SRC_URI = "\
	file://LICENSE \
	file://Makefile \
	file://myechotest.c \
	"

S = "${WORKDIR}"

RRECOMMENDS_${PN} = "kernel-module-rpmsg-char"

FILES_${PN} = "\
	/usr/bin/myechotest\
"

do_install () {
	install -d ${D}/usr/bin
	install -m 0755 myechotest ${D}/usr/bin/myechotest
}


text:
package input

import (
	"encoding/json"
)

type EKS struct {
	AWSRegion    string `json:"aws_region"`
	AWSAccessKey string `json:"aws_access_key"`
	AWSSecretKey string `json:"aws_secret_key"`
	ClusterName  string `json:"cluster_name"`
}

func (eks *EKS) GetInput() ([]byte, error) {
	return json.Marshal(eks)
}

func GetEKSInput(bytes []byte) (*EKS, error) {
	res := &EKS{}

	err := json.Unmarshal(bytes, res)

	return res, err
}


text:
SUMMARY = "Peak linux driver"

LICENSE = "GPLv2 & LGPLv2.1"
LIC_FILES_CHKSUM = " \
    file://LICENSE.gpl;md5=75859989545e37968a99b631ef42722e \
    file://LICENSE.lgpl;md5=1803fa9c2c3ce8cb06b4861d75310742 \
    "

SRC_URI[sha256sum] = "f1692a78a948f3847abdd14689ae24f9eb00ead9f3bf2b6f875f5d905fb3cdcd"
SRC_URI = " \
    https://www.peak-system.com/fileadmin/media/linux/files/peak-linux-driver-${PV}.tar.gz \
"

inherit module sign-kmod

S = "${WORKDIR}/peak-linux-driver-${PV}"

EXTRA_OEMAKE:append = " KERNEL_LOCATION=${STAGING_KERNEL_DIR}"

# the driver can either be built as chardev or netdev
# we want to build both and ship them at the same time
# even though only one can be loaded at any moment
FLAVOURS = "chardev netdev"
python __anonymous () {
    artifacts = []
    for flavour in d.getVar('FLAVOURS').split():
        artifacts.append(os.path.join(d.getVar('B'), "driver-" + flavour, "pcan.ko" ))
    d.setVar('SIGNING_ARTIFACTS', ' '.join(artifacts))
}

do_configure:append() {
    for FLAVOUR in ${FLAVOURS}
    do
        cp -a driver "driver-${FLAVOUR}"
    done
}

do_compile() {
    unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS

    for FLAVOUR in ${FLAVOURS}
    do
        cd "driver-${FLAVOUR}"
        oe_runmake KERNEL_PATH=${STAGING_KERNEL_DIR}   \
            KERNEL_VERSION=${KERNEL_VERSION}    \
            CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
            AR="${KERNEL_AR}" \
            O=${STAGING_KERNEL_BUILDDIR} \
            KBUILD_EXTRA_SYMBOLS="${KBUILD_EXTRA_SYMBOLS}" \
            "${FLAVOUR}"
        cd ..
    done
}

do_install() {
    MISC_DIR="${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/misc"
    MODULE_FILENAME="pcan.ko"

    for FLAVOUR in ${FLAVOURS}
    do
        TMP_DIR=$(mktemp -d -p .)
        cp -a "driver-${FLAVOUR}/"* "${TMP_DIR}/"
        cd "${TMP_DIR}"
        if [ -f "${MODULE_FILENAME}.signed" ]; then
            mv "${MODULE_FILENAME}.signed" "${MODULE_FILENAME}"
        fi
        oe_runmake install_module DEPMOD=echo DESTDIR=${D} KERNEL_VERSION=${KERNEL_VERSION}
        mv "${MISC_DIR}/${MODULE_FILENAME}" "${MISC_DIR}/pcan_${FLAVOUR}.ko"
        cd ..
        rm -rf "${TMP_DIR}"
    done
}

addtask sign_kmod before do_install after do_compile

repository: balena-os/meta-balena

repo_name: balena-os/meta-balena

gha_language: BitBake


text:
// Package types contains functions that return a resource or property type when called.
// This code is autogenerated.
// Do not edit it by hand.
package types
import "github.com/awslabs/aws-cloudformation-template-builder/spec/cf"

func AWSApiGatewayUsagePlanResource() cf.ResourceType {
    return cf.ResourceType{Attributes:map[string]cf.Attribute(nil), Documentation:"http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html", Properties:map[string]cf.Property{"ApiStages":cf.Property{Documentation:"http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html#cfn-apigateway-usageplan-apistages", DuplicatesAllowed:false, ItemType:"ApiStage", PrimitiveItemType:"", PrimitiveType:"", Required:false, Type:"List", UpdateType:"Mutable"}, "Description":cf.Property{Documentation:"http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html#cfn-apigateway-usageplan-description", DuplicatesAllowed:false, ItemType:"", PrimitiveItemType:"", PrimitiveType:"String", Required:false, Type:"", UpdateType:"Mutable"}, "Quota":cf.Property{Documentation:"http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html#cfn-apigateway-usageplan-quota", DuplicatesAllowed:false, ItemType:"", PrimitiveItemType:"", PrimitiveType:"", Required:false, Type:"QuotaSettings", UpdateType:"Mutable"}, "Throttle":cf.Property{Documentation:"http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html#cfn-apigateway-usageplan-throttle", DuplicatesAllowed:false, ItemType:"", PrimitiveItemType:"", PrimitiveType:"", Required:false, Type:"ThrottleSettings", UpdateType:"Mutable"}, "UsagePlanName":cf.Property{Documentation:"http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html#cfn-apigateway-usageplan-usageplanname", DuplicatesAllowed:false, ItemType:"", PrimitiveItemType:"", PrimitiveType:"String", Required:false, Type:"", UpdateType:"Mutable"}}, AdditionalProperties:false}
}


text:
package reporters

import (
	"github.com/openshift/osde2e/pkg/reporting/spi"
)

// GetReporter will get a named reporter from the reporter cache.
func GetReporter(reporterName string) (spi.ReporterSPI, error) {
	return spi.GetReporter(reporterName)
}

branch_name: refs/heads/main


text:
package hypervisors

import (
	"fmt"
	"io"
)

func (m *Manager) writeHtml(writer io.Writer) {
	t, err := m.getTopology()
	if err != nil {
		fmt.Fprintln(writer, err, "
")
		return
	}
	if *manageHypervisors {
		fmt.Fprintln(writer,
			`Hypervisors <font color="green">are</font> being managed by this instance<br>`)
	} else {
		fmt.Fprintln(writer,
			`<font color="grey">Hypervisors are not being managed by this instance</font><br>`)
	}
	numMachines := t.GetNumMachines()
	var numConnected, numOff, numOK uint
	m.mutex.RLock()
	for _, hypervisor := range m.hypervisors {
		switch hypervisor.probeStatus {
		case probeStatusConnected:
			numConnected++
			switch hypervisor.healthStatus {
			case "", "healthy":
				numOK++
			}
		case probeStatusOff:
			numOff++
		}
	}
	numVMs := uint(len(m.vms))
	m.mutex.RUnlock()
	writeCountLinksHT(writer, "Number of hypervisors known",
		"listHypervisors?state=", numMachines)
	writeCountLinksHT(writer, "Number of hypervisors powered off",
		"listHypervisors?state=off", numOff)
	writeCountLinksHT(writer, "Number of hypervisors connected",
		"listHypervisors?state=connected", numConnected)
	writeCountLinksHT(writer, "Number of hypervisors OK",
		"listHypervisors?state=OK", numOK)
	writeCountLinksHTJ(writer, "Number of VMs known",
		"listVMs?", numVMs)
	fmt.Fprintln(writer, `Hypervisor <a href="listLocations">locations</a><br>`)
}

func writeCountLinksHT(writer io.Writer, text, path string, count uint) {
	if count < 1 {
		return
	}
	fmt.Fprintf(writer,
		"%s: %d (text)
\n",
		text, path, count, path)
}

func writeCountLinksHTJ(writer io.Writer, text, path string, count uint) {
	if count < 1 {
		return
	}
	fmt.Fprintf(writer,
		"%s: %d (text, JSON)
\n",
		text, path, count, path, path)
}

repository: Symantec/Dominator

repo_name: Symantec/Dominator


text:
@Misc{www-collectd,
  title        = {collectd - The system statistics collection daemon},
  howpublished = {Web Page},
  note         = {Accessed: 2017-02-26},
  owner        = {S17-IO-3005, S17-IO-3000},
  url          = {https://collectd.org/},
}

@Misc{www-spark-python,
  title        = {{Spark Python API (PySpark)}},
  howpublished = {Web Page},
  note         = {Accessed: 2017-02-26},
  owner        = {S17-IO-3005, S17-IO-3000},
  url          = {https://spark.apache.org/docs/0.9.1/python-programming-guide.html},
}

@Misc{www-sparkml,
  title        = {Spark ML Programming Guide},
  howpublished = {Web Page},
  note         = {Accessed: 2017-02-26},
  owner        = {S17-IO-3005, S17-IO-3000},
  url          = {https://spark.apache.org/docs/1.2.2/ml-guide.html},
}

@Misc{www-word2vec,
  title        = {{Word2Vec}, learning vector representation of words},
  howpublished = {Web Page},
  note         = {Accessed: 2017-02-26},
  owner        = {S17-IO-3005, S17-IO-3000},
  url          = {https://en.wikipedia.org/wiki/Word2vec},
}
@Misc{www-ansible,
  title        = {{Ansible}, Deploy apps. Manage systems. Crush complexity},
  howpublished = {Web Page},
  note         = {Accessed: 2017-02-26},
  owner        = {S17-IO-3005, S17-IO-3000},
  url          = {https://www.ansible.com/},
}


text:
package templates

const Header =
`// This source file was generated by Fungo. DO NOT MODIFY.
//
// Generated on: {{.Date}}
// Fungo version: {{.Version}}

`

repository: FeistyFugu/fungo

repo_name: FeistyFugu/fungo


text:
#-------------------------------------------------------------------------------
# Copyright (c) 2021-2022, Arm Limited. All rights reserved.
# Copyright (c) 2022 Cypress Semiconductor Corporation (an Infineon company)
# or an affiliate of Cypress Semiconductor Corporation. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
#-------------------------------------------------------------------------------

# Default configs of tf-m-tests repo

set(TFM_TEST_REPO_PATH                  "DOWNLOAD" CACHE PATH      "Path to TFM-TEST repo (or DOWNLOAD to fetch automatically")
set(TFM_TEST_REPO_VERSION               "88c38f3"  CACHE STRING    "The version of tf-m-tests to use")
set(CMSIS_5_PATH                        "DOWNLOAD" CACHE PATH      "Path to CMSIS_5 (or DOWNLOAD to fetch automatically")

repository: zephyrproject-rtos/trusted-firmware-m

repo_name: zephyrproject-rtos/trusted-firmware-m

gha_license_id: NOASSERTION

gha_language: C


text:
package stockfish

import (
	"testing"

	"github.com/loganjspears/chess"
)

func TestStockfish(t *testing.T) {
	if _, err := Move(chess.NewGame(), 5, "."); err != nil {
		t.Fatal(err)
	}
}

repository: notnil/slackchess

repo_name: notnil/slackchess


text:
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.23.0
// 	protoc        v3.14.0
// source: push_frame_to_flow.proto

package deviced

import (
	proto "github.com/golang/protobuf/proto"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
	reflect "reflect"
	sync "sync"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4

type PushFrameToFlowRequest struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Id *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Types that are assignable to Request:
	//	*PushFrameToFlowRequest_Config_
	//	*PushFrameToFlowRequest_Frame
	Request isPushFrameToFlowRequest_Request `protobuf_oneof:"request"`
}

func (x *PushFrameToFlowRequest) Reset() {
	*x = PushFrameToFlowRequest{}
	if protoimpl.UnsafeEnabled {
		mi := &file_push_frame_to_flow_proto_msgTypes[0]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *PushFrameToFlowRequest) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*PushFrameToFlowRequest) ProtoMessage() {}

func (x *PushFrameToFlowRequest) ProtoReflect() protoreflect.Message {
	mi := &file_push_frame_to_flow_proto_msgTypes[0]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use PushFrameToFlowRequest.ProtoReflect.Descriptor instead.
func (*PushFrameToFlowRequest) Descriptor() ([]byte, []int) {
	return file_push_frame_to_flow_proto_rawDescGZIP(), []int{0}
}

func (x *PushFrameToFlowRequest) GetId() *wrapperspb.StringValue {
	if x != nil {
		return x.Id
	}
	return nil
}

func (m *PushFrameToFlowRequest) GetRequest() isPushFrameToFlowRequest_Request {
	if m != nil {
		return m.Request
	}
	return nil
}

func (x *PushFrameToFlowRequest) GetConfig() *PushFrameToFlowRequest_Config {
	if x, ok := x.GetRequest().(*PushFrameToFlowRequest_Config_); ok {
		return x.Config
	}
	return nil
}

func (x *PushFrameToFlowRequest) GetFrame() *OpFrame {
	if x, ok := x.GetRequest().(*PushFrameToFlowRequest_Frame); ok {
		return x.Frame
	}
	return nil
}

type isPushFrameToFlowRequest_Request interface {
	isPushFrameToFlowRequest_Request()
}

type PushFrameToFlowRequest_Config_ struct {
	Config *PushFrameToFlowRequest_Config `protobuf:"bytes,2,opt,name=config,proto3,oneof"`
}

type PushFrameToFlowRequest_Frame struct {
	Frame *OpFrame `protobuf:"bytes,3,opt,name=frame,proto3,oneof"`
}

func (*PushFrameToFlowRequest_Config_) isPushFrameToFlowRequest_Request() {}

func (*PushFrameToFlowRequest_Frame) isPushFrameToFlowRequest_Request() {}

type PushFrameToFlowResponse struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Types that are assignable to Response:
	//	*PushFrameToFlowResponse_Ack_
	Response isPushFrameToFlowResponse_Response `protobuf_oneof:"response"`
}

func (x *PushFrameToFlowResponse) Reset() {
	*x = PushFrameToFlowResponse{}
	if protoimpl.UnsafeEnabled {
		mi := &file_push_frame_to_flow_proto_msgTypes[1]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *PushFrameToFlowResponse) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*PushFrameToFlowResponse) ProtoMessage() {}

func (x *PushFrameToFlowResponse) ProtoReflect() protoreflect.Message {
	mi := &file_push_frame_to_flow_proto_msgTypes[1]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use PushFrameToFlowResponse.ProtoReflect.Descriptor instead.
func (*PushFrameToFlowResponse) Descriptor() ([]byte, []int) {
	return file_push_frame_to_flow_proto_rawDescGZIP(), []int{1}
}

func (x *PushFrameToFlowResponse) GetId() string {
	if x != nil {
		return x.Id
	}
	return ""
}

func (m *PushFrameToFlowResponse) GetResponse() isPushFrameToFlowResponse_Response {
	if m != nil {
		return m.Response
	}
	return nil
}

func (x *PushFrameToFlowResponse) GetAck() *PushFrameToFlowResponse_Ack {
	if x, ok := x.GetResponse().(*PushFrameToFlowResponse_Ack_); ok {
		return x.Ack
	}
	return nil
}

type isPushFrameToFlowResponse_Response interface {
	isPushFrameToFlowResponse_Response()
}

type PushFrameToFlowResponse_Ack_ struct {
	Ack *PushFrameToFlowResponse_Ack `protobuf:"bytes,2,opt,name=ack,proto3,oneof"`
}

func (*PushFrameToFlowResponse_Ack_) isPushFrameToFlowResponse_Response() {}

type PushFrameToFlowRequest_Config struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Device    *OpDevice             `protobuf:"bytes,1,opt,name=device,proto3" json:"device,omitempty"`
	ConfigAck *wrapperspb.BoolValue `protobuf:"bytes,2,opt,name=config_ack,json=configAck,proto3" json:"config_ack,omitempty"`
	PushAck   *wrapperspb.BoolValue `protobuf:"bytes,3,opt,name=push_ack,json=pushAck,proto3" json:"push_ack,omitempty"`
}

func (x *PushFrameToFlowRequest_Config) Reset() {
	*x = PushFrameToFlowRequest_Config{}
	if protoimpl.UnsafeEnabled {
		mi := &file_push_frame_to_flow_proto_msgTypes[2]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *PushFrameToFlowRequest_Config) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*PushFrameToFlowRequest_Config) ProtoMessage() {}

func (x *PushFrameToFlowRequest_Config) ProtoReflect() protoreflect.Message {
	mi := &file_push_frame_to_flow_proto_msgTypes[2]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use PushFrameToFlowRequest_Config.ProtoReflect.Descriptor instead.
func (*PushFrameToFlowRequest_Config) Descriptor() ([]byte, []int) {
	return file_push_frame_to_flow_proto_rawDescGZIP(), []int{0, 0}
}

func (x *PushFrameToFlowRequest_Config) GetDevice() *OpDevice {
	if x != nil {
		return x.Device
	}
	return nil
}

func (x *PushFrameToFlowRequest_Config) GetConfigAck() *wrapperspb.BoolValue {
	if x != nil {
		return x.ConfigAck
	}
	return nil
}

func (x *PushFrameToFlowRequest_Config) GetPushAck() *wrapperspb.BoolValue {
	if x != nil {
		return x.PushAck
	}
	return nil
}

type PushFrameToFlowResponse_Ack struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields
}

func (x *PushFrameToFlowResponse_Ack) Reset() {
	*x = PushFrameToFlowResponse_Ack{}
	if protoimpl.UnsafeEnabled {
		mi := &file_push_frame_to_flow_proto_msgTypes[3]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *PushFrameToFlowResponse_Ack) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*PushFrameToFlowResponse_Ack) ProtoMessage() {}

func (x *PushFrameToFlowResponse_Ack) ProtoReflect() protoreflect.Message {
	mi := &file_push_frame_to_flow_proto_msgTypes[3]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use PushFrameToFlowResponse_Ack.ProtoReflect.Descriptor instead.
func (*PushFrameToFlowResponse_Ack) Descriptor() ([]byte, []int) {
	return file_push_frame_to_flow_proto_rawDescGZIP(), []int{1, 0}
}

var File_push_frame_to_flow_proto protoreflect.FileDescriptor

var file_push_frame_to_flow_proto_rawDesc = []byte{
	0x0a, 0x18, 0x70, 0x75, 0x73, 0x68, 0x5f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x5f, 0x74, 0x6f, 0x5f,
	0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1d, 0x61, 0x69, 0x2e, 0x6d,
	0x65, 0x74, 0x61, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
	0x65, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x64, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
	0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70,
	0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0b, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
	0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa7, 0x03, 0x0a, 0x16, 0x50, 0x75, 0x73, 0x68, 0x46,
	0x72, 0x61, 0x6d, 0x65, 0x54, 0x6f, 0x46, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
	0x74, 0x12, 0x2c, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e,
	0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
	0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x02, 0x69, 0x64, 0x12,
	0x56, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
	0x3c, 0x2e, 0x61, 0x69, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e,
	0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x64, 0x2e,
	0x50, 0x75, 0x73, 0x68, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x54, 0x6f, 0x46, 0x6c, 0x6f, 0x77, 0x52,
	0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52,
	0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3e, 0x0a, 0x05, 0x66, 0x72, 0x61, 0x6d, 0x65,
	0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x61, 0x69, 0x2e, 0x6d, 0x65, 0x74, 0x61,
	0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64,
	0x65, 0x76, 0x69, 0x63, 0x65, 0x64, 0x2e, 0x4f, 0x70, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x48, 0x00,
	0x52, 0x05, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x1a, 0xbb, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66,
	0x69, 0x67, 0x12, 0x3f, 0x0a, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01,
	0x28, 0x0b, 0x32, 0x27, 0x2e, 0x61, 0x69, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x74, 0x68, 0x69, 0x6e,
	0x67, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63,
	0x65, 0x64, 0x2e, 0x4f, 0x70, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x06, 0x64, 0x65, 0x76,
	0x69, 0x63, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x61, 0x63,
	0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
	0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61,
	0x6c, 0x75, 0x65, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x41, 0x63, 0x6b, 0x12, 0x35,
	0x0a, 0x08, 0x70, 0x75, 0x73, 0x68, 0x5f, 0x61, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b,
	0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
	0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x70, 0x75,
	0x73, 0x68, 0x41, 0x63, 0x6b, 0x42, 0x09, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
	0x22, 0x8c, 0x01, 0x0a, 0x17, 0x50, 0x75, 0x73, 0x68, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x54, 0x6f,
	0x46, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02,
	0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x4e, 0x0a, 0x03,
	0x61, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x61, 0x69, 0x2e, 0x6d,
	0x65, 0x74, 0x61, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
	0x65, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x64, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x46, 0x72,
	0x61, 0x6d, 0x65, 0x54, 0x6f, 0x46, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
	0x65, 0x2e, 0x41, 0x63, 0x6b, 0x48, 0x00, 0x52, 0x03, 0x61, 0x63, 0x6b, 0x1a, 0x05, 0x0a, 0x03,
	0x41, 0x63, 0x6b, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42,
	0x2d, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x61,
	0x79, 0x6f, 0x74, 0x74, 0x61, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73,
	0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x64, 0x62, 0x06,
	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}

var (
	file_push_frame_to_flow_proto_rawDescOnce sync.Once
	file_push_frame_to_flow_proto_rawDescData = file_push_frame_to_flow_proto_rawDesc
)

func file_push_frame_to_flow_proto_rawDescGZIP() []byte {
	file_push_frame_to_flow_proto_rawDescOnce.Do(func() {
		file_push_frame_to_flow_proto_rawDescData = protoimpl.X.CompressGZIP(file_push_frame_to_flow_proto_rawDescData)
	})
	return file_push_frame_to_flow_proto_rawDescData
}

var file_push_frame_to_flow_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_push_frame_to_flow_proto_goTypes = []interface{}{
	(*PushFrameToFlowRequest)(nil),        // 0: ai.metathings.service.deviced.PushFrameToFlowRequest
	(*PushFrameToFlowResponse)(nil),       // 1: ai.metathings.service.deviced.PushFrameToFlowResponse
	(*PushFrameToFlowRequest_Config)(nil), // 2: ai.metathings.service.deviced.PushFrameToFlowRequest.Config
	(*PushFrameToFlowResponse_Ack)(nil),   // 3: ai.metathings.service.deviced.PushFrameToFlowResponse.Ack
	(*wrapperspb.StringValue)(nil),        // 4: google.protobuf.StringValue
	(*OpFrame)(nil),                       // 5: ai.metathings.service.deviced.OpFrame
	(*OpDevice)(nil),                      // 6: ai.metathings.service.deviced.OpDevice
	(*wrapperspb.BoolValue)(nil),          // 7: google.protobuf.BoolValue
}
var file_push_frame_to_flow_proto_depIdxs = []int32{
	4, // 0: ai.metathings.service.deviced.PushFrameToFlowRequest.id:type_name -> google.protobuf.StringValue
	2, // 1: ai.metathings.service.deviced.PushFrameToFlowRequest.config:type_name -> ai.metathings.service.deviced.PushFrameToFlowRequest.Config
	5, // 2: ai.metathings.service.deviced.PushFrameToFlowRequest.frame:type_name -> ai.metathings.service.deviced.OpFrame
	3, // 3: ai.metathings.service.deviced.PushFrameToFlowResponse.ack:type_name -> ai.metathings.service.deviced.PushFrameToFlowResponse.Ack
	6, // 4: ai.metathings.service.deviced.PushFrameToFlowRequest.Config.device:type_name -> ai.metathings.service.deviced.OpDevice
	7, // 5: ai.metathings.service.deviced.PushFrameToFlowRequest.Config.config_ack:type_name -> google.protobuf.BoolValue
	7, // 6: ai.metathings.service.deviced.PushFrameToFlowRequest.Config.push_ack:type_name -> google.protobuf.BoolValue
	7, // [7:7] is the sub-list for method output_type
	7, // [7:7] is the sub-list for method input_type
	7, // [7:7] is the sub-list for extension type_name
	7, // [7:7] is the sub-list for extension extendee
	0, // [0:7] is the sub-list for field type_name
}

func init() { file_push_frame_to_flow_proto_init() }
func file_push_frame_to_flow_proto_init() {
	if File_push_frame_to_flow_proto != nil {
		return
	}
	file_model_proto_init()
	if !protoimpl.UnsafeEnabled {
		file_push_frame_to_flow_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*PushFrameToFlowRequest); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
		file_push_frame_to_flow_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*PushFrameToFlowResponse); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
		file_push_frame_to_flow_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*PushFrameToFlowRequest_Config); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
		file_push_frame_to_flow_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*PushFrameToFlowResponse_Ack); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
	}
	file_push_frame_to_flow_proto_msgTypes[0].OneofWrappers = []interface{}{
		(*PushFrameToFlowRequest_Config_)(nil),
		(*PushFrameToFlowRequest_Frame)(nil),
	}
	file_push_frame_to_flow_proto_msgTypes[1].OneofWrappers = []interface{}{
		(*PushFrameToFlowResponse_Ack_)(nil),
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: file_push_frame_to_flow_proto_rawDesc,
			NumEnums:      0,
			NumMessages:   4,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_push_frame_to_flow_proto_goTypes,
		DependencyIndexes: file_push_frame_to_flow_proto_depIdxs,
		MessageInfos:      file_push_frame_to_flow_proto_msgTypes,
	}.Build()
	File_push_frame_to_flow_proto = out.File
	file_push_frame_to_flow_proto_rawDesc = nil
	file_push_frame_to_flow_proto_goTypes = nil
	file_push_frame_to_flow_proto_depIdxs = nil
}

repository: nayotta/metathings

repo_name: nayotta/metathings


text:
package main

import (
	"fmt"
	"os"

	"github.com/digitalocean/godo"
	"github.com/spf13/cobra"
)

// Show information about a Floating IP.
func Show(cmd *cobra.Command, args []string) {
	if len(args) == 1 {
		floatingIP := doShow(args[0])
		printShow(floatingIP)
	} else if len(args) == 0 {
		fip := AssignedFIP(cmd)
		floatingIP := doShow(fip)
		printShow(floatingIP)
	} else {
		cmd.Help()
	}
}

func doShow(fip string) *godo.FloatingIP {
	client := GetClient(Token)
	floatingIP, _, err := client.FloatingIPs.Get(fip)

	if err != nil {
		fmt.Println("Error: ", err)
		os.Exit(1)
	}

	return floatingIP
}

func printShow(fip *godo.FloatingIP) {
	fmt.Println("Floating IP\tRegion\t\tDroplet ID\tDroplet Name")
	fmt.Println("-----------\t------\t\t----------\t------------")

	ip := fip.IP
	region := fip.Region.Name
	if fip.Droplet != nil {
		dropletID := fip.Droplet.ID
		dropletName := fip.Droplet.Name
		fmt.Printf("%v\t%v\t%v\t\t%v\n", ip, region, dropletID, dropletName)
	} else {
		fmt.Printf("%v\t%v\n", ip, region)
	}
}

repository: andrewsomething/floatctl

repo_name: andrewsomething/floatctl


text:
@misc{cryptoeprint:2007:478,
    author = {Dafna Kidron and Yehuda Lindell},
    title = {Impossibility Results for Universal Composability in Public-Key Models and with Fixed Inputs},
    howpublished = {Cryptology ePrint Archive, Report 2007/478},
    year = {2007},
    note = {\url{https://eprint.iacr.org/2007/478}},
}


text:
require recipes-graphics/xorg-driver/xorg-driver-video.inc

SUMMARY = "X.Org X server -- ARM SOC display driver"
LICENSE = "MIT-X & GPLv2+"
LIC_FILES_CHKSUM = "file://COPYING;md5=10ce5de3b111315ea652a5f74ec0c602"

DEPENDS += "virtual/libx11 libdrm xorgproto"

SRCREV = "8bbdb2ae3bb8ef649999a8da33ddbe11a04763b8"
SRC_URI = "git://anongit.freedesktop.org/xorg/driver/xf86-video-armsoc;branch=master"

S = "${WORKDIR}/git"

RDEPENDS_${PN} += "xserver-xorg-module-exa"

repository: ni/meta-openembedded

repo_name: ni/meta-openembedded

branch_name: refs/heads/nilrt/master/hardknott


text:
DESCRIPTION = "libevdev is a wrapper library for evdev devices"
HOMEPAGE = "http://www.freedesktop.org/wiki/Software/libevdev/"

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://COPYING;md5=75aae0d38feea6fda97ca381cb9132eb"

inherit autotools pkgconfig

PR = "r0"

BRANCH = "master"
SRCREV = "a5f150ef57a1a5c67e94163f6f5a60687049413f"
PV = "1.2.99.901"
SRC_URI = "git://anongit.freedesktop.org/libevdev;protocol=git;branch=${BRANCH}"

S = "${WORKDIR}/git"

repository: varigit/meta-arago-var

repo_name: varigit/meta-arago-var


text:
package worker

import (
	"archive/tar"
	"bytes"
	"crypto/sha256"
	"encoding/hex"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"path"
	"strings"
	"time"

	sdkdigest "github.com/bazelbuild/remote-apis-sdks/go/pkg/digest"
	"github.com/bazelbuild/remote-apis-sdks/go/pkg/uploadinfo"
	pb "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2"
	"github.com/golang/protobuf/proto"
	"github.com/klauspost/compress/zstd"
	"golang.org/x/sync/errgroup"
	"google.golang.org/grpc/codes"
	grpcstatus "google.golang.org/grpc/status"

	"github.com/thought-machine/please-servers/mettle/common"
	"github.com/thought-machine/please-servers/rexclient"
)

// maxBlobBatchSize is the maximum size of a single blob batch we'll ever request.
const maxBlobBatchSize = 4012000 // 4000 Kelly-Bootle standard units

// downloadParallelism is the maximum number of parallel downloads we'll allow.
const downloadParallelism = 4

// ioParallelism is the maximum number of parallel disk writes we'll allow.
const ioParallelism = 10

// zstdMagic is the magic number of zstd compressed data.
var zstdMagic = []byte{0x28, 0xb5, 0x2f, 0xfd}

// emptyHash is the sha256 hash of the empty file.
// Technically checking the size is sufficient but we add this as well for general sanity in case something
// else lost the size for some reason (it will be more obvious to debug that mismatch than mysteriously empty files).
const emptyHash = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"

// A fileNode contains the minimal fields we need to write a pb.FileNode.
type fileNode struct {
	Name         string
	IsExecutable bool
}

// downloadDirectory downloads & writes out a single Directory proto and all its children.
func (w *worker) downloadDirectory(digest *pb.Digest, usePacks bool) error {
	ts1 := time.Now()
	dirs, err := w.client.GetDirectoryTree(digest, usePacks)
	if err != nil {
		return err
	}
	ts2 := time.Now()
	m := make(map[string]*pb.Directory, len(dirs))
	for _, dir := range dirs {
		m[digestProto(dir).Hash] = dir
	}
	files := map[sdkdigest.Digest][]fileNode{}
	packs := map[sdkdigest.Digest][]string{}
	if err := w.createDirectory(m, files, packs, w.dir, digest, usePacks); err != nil {
		return err
	}
	ts3 := time.Now()
	err = w.downloadAllFiles(files, packs)
	w.metadataFetch = ts2.Sub(ts1)
	w.dirCreation = ts3.Sub(ts2)
	w.fileDownload = time.Since(ts3)
	return err
}

// createDirectory creates a directory & all its children
func (w *worker) createDirectory(dirs map[string]*pb.Directory, files map[sdkdigest.Digest][]fileNode, packs map[sdkdigest.Digest][]string, root string, digest *pb.Digest, usePacks bool) error {
	if err := os.MkdirAll(root, os.ModeDir|0775); err != nil {
		return err
	}
	if digest.Hash == emptyHash {
		return nil // Nothing to be done.
	}
	dir, present := dirs[digest.Hash]
	if !present {
		return fmt.Errorf("Missing directory %s", digest.Hash)
	}
	if usePacks {
		if dg := rexclient.PackDigest(dir); dg.Hash != "" {
			log.Debug("Replacing dir %s with pack digest %s/%d", root, dg.Hash, dg.Size)
			packs[dg] = append(packs[dg], root)
			return nil
		}
	}
	for _, file := range dir.Files {
		if err := common.CheckPath(file.Name); err != nil {
			return err
		} else if err := makeDirIfNeeded(root, file.Name); err != nil {
			return err
		}
		dg := sdkdigest.NewFromProtoUnvalidated(file.Digest)
		files[dg] = append(files[dg], fileNode{
			Name:         path.Join(root, file.Name),
			IsExecutable: file.IsExecutable},
		)
	}
	for _, dir := range dir.Directories {
		if err := common.CheckPath(dir.Name); err != nil {
			return err
		} else if err := w.createDirectory(dirs, files, packs, path.Join(root, dir.Name), dir.Digest, usePacks); err != nil {
			return err
		}
	}
	for _, sym := range dir.Symlinks {
		if err := common.CheckPath(sym.Name); err != nil {
			return err
		} else if err := makeDirIfNeeded(root, sym.Name); err != nil {
			return err
		}
		if err := os.Symlink(sym.Target, path.Join(root, sym.Name)); err != nil {
			return err
		}
	}
	return nil
}

// downloadAllFiles downloads all the files for a single build action.
func (w *worker) downloadAllFiles(files map[sdkdigest.Digest][]fileNode, packs map[sdkdigest.Digest][]string) error {
	var g errgroup.Group

	fileNodes := map[sdkdigest.Digest][]fileNode{}
	var totalSize int64
	for dg, filenames := range files {
		// Optimise out any empty files. The empty blob is surprisingly popular and obviously we always know what
		// it will contain, so save the RPCs.
		if dg.Size == 0 && dg.Hash == emptyHash {
			fns := filenames
			dg := dg
			g.Go(func() error {
				return w.writeFiles(fns, nil, dg)
			})
			continue
		}
		if w.fileCache != nil && w.fileCache.Retrieve(dg.Hash, filenames[0].Name, fileMode(filenames[0].IsExecutable)) {
			cacheHits.Inc()
			w.cachedBytes += dg.Size
			if err := w.linkAll(filenames); err != nil {
				return err
			}
			continue
		}
		if dg.Size > maxBlobBatchSize {
			// This blob is big enough that it must always be done on its own.
			w.downloadedBytes += dg.Size
			fns := filenames
			dg := dg
			g.Go(func() error { return w.downloadFile(fns, dg) })
			continue
		}
		// Check cache for this blob (we never cache blobs that are big enough not to be batchable)
		if blob, present := w.cache.Get(dg.Hash); present {
			cacheHits.Inc()
			w.cachedBytes += dg.Size
			fns := filenames
			dg := dg
			g.Go(func() error {
				return w.writeFiles(fns, blob.([]byte), dg)
			})
			continue
		}
		cacheMisses.Inc()
		if totalSize+dg.Size > maxBlobBatchSize {
			// This blob on its own is OK but will exceed the total.
			// Download what we have so far then deal with it.
			fns := fileNodes
			g.Go(func() error { return w.downloadFiles(fns) })
			fileNodes = map[sdkdigest.Digest][]fileNode{}
			totalSize = 0
		}
		fileNodes[dg] = filenames
		totalSize += dg.Size
		w.downloadedBytes += dg.Size
	}
	// If we have anything left over, handle them now.
	if len(fileNodes) != 0 {
		g.Go(func() error { return w.downloadFiles(fileNodes) })
	}
	for dg, paths := range packs {
		dg := dg
		paths := paths
		g.Go(func() error {
			return w.downloadPack(dg, paths)
		})
	}
	return g.Wait()
}

// downloadPack downloads a pack file to the given path
func (w *worker) downloadPack(dg sdkdigest.Digest, paths []string) error {
	log.Debug("Downloading pack of %d bytes...", dg.Size)
	packsDownloaded.Inc()
	if w.fileCache != nil {
		if downloaded, err := w.downloadPackFromCache(dg, paths); err != nil {
			return err
		} else if downloaded {
			return nil
		}
	}
	w.limiter <- struct{}{}
	defer func() { <-w.limiter }()
	// TODO(peterebden): Look into streaming this sometime.
	b, err := w.client.ReadBlob(dg.ToProto())
	if err != nil {
		return err
	}
	if err := w.writePack(bytes.NewReader(b), paths); err != nil {
		return fmt.Errorf("extracting pack for %s: %w", dg.Hash, err)
	}
	packBytesRead.Add(float64(dg.Size))
	log.Debug("Downloaded pack of %d bytes", dg.Size)
	return nil
}

// downloadPack downloads a pack file to the given path
func (w *worker) downloadPackFromCache(dg sdkdigest.Digest, paths []string) (bool, error) {
	w.iolimiter <- struct{}{}
	defer func() { <-w.iolimiter }()
	if rc := w.fileCache.RetrieveStream(dg.Hash); rc != nil {
		defer rc.Close()
		if err := w.writePack(rc, paths); err != nil {
			return false, fmt.Errorf("extracting pack for %s: %w", dg.Hash, err)
		}
		return true, nil
	}
	return false, nil
}

// writePack writes a pack to the given set of paths.
func (w *worker) writePack(r io.Reader, paths []string) error {
	// Packs are always zstd-compressed tarballs.
	zr, err := zstd.NewReader(r)
	if err != nil {
		return err
	}
	defer zr.Close()
	tr := tar.NewReader(zr)
	for {
		hdr, err := tr.Next()
		if err != nil {
			if err == io.EOF {
				return nil
			}
			return fmt.Errorf("extracting tarball: %w", err)
		} else if err := common.CheckPath(hdr.Name); err != nil {
			return err
		}
		switch hdr.Typeflag {
		case tar.TypeDir:
			for _, p := range paths {
				if err := os.MkdirAll(path.Join(p, hdr.Name), 0755|os.ModeDir); err != nil {
					return fmt.Errorf("creating directory: %w", err)
				}
			}
		case tar.TypeReg:
			p1 := path.Join(paths[0], hdr.Name)
			if f, err := os.OpenFile(p1, os.O_WRONLY|os.O_CREATE, os.FileMode(hdr.Mode)); err != nil {
				return err
			} else if n, err := io.Copy(f, tr); err != nil {
				f.Close() // don't forget this!
				return err
			} else if err := f.Close(); err != nil {
				return err
			} else if n != hdr.Size {
				return fmt.Errorf("Short read for %s: read %d bytes, expected %d", hdr.Name, n, hdr.Size)
			}
			// Link the file into all the other locations
			for _, p := range paths[1:] {
				if err := os.Link(p1, path.Join(p, hdr.Name)); err != nil {
					return err
				}
			}
		case tar.TypeSymlink:
			for _, p := range paths {
				if err := os.Symlink(hdr.Linkname, path.Join(p, hdr.Name)); err != nil {
					return err
				}
			}
		default:
			return fmt.Errorf("Unknown type in pack for %s: %d", hdr.Name, hdr.Typeflag)
		}
	}
}

// downloadFiles downloads a set of files to disk in a batch.
// The total size must be lower than whatever limits are considered relevant.
func (w *worker) downloadFiles(files map[sdkdigest.Digest][]fileNode) error {
	w.limiter <- struct{}{}
	defer func() { <-w.limiter }()

	log.Debug("Downloading batch of %d files...", len(files))
	digests := make([]sdkdigest.Digest, 0, len(files))
	for dg := range files {
		digests = append(digests, dg)
	}
	responses, err := w.client.BatchDownload(digests)
	if err != nil {
		return err
	}
	if len(responses) != len(digests) {
		return grpcstatus.Errorf(codes.InvalidArgument, "Unexpected response, requested %d blobs, got %d", len(digests), len(responses))
	}
	for dg, data := range responses {
		if fileNodes, present := files[dg]; !present {
			return grpcstatus.Errorf(codes.InvalidArgument, "Unknown digest %s in response", dg.Hash)
		} else if err := w.writeFiles(fileNodes, data, dg); err != nil {
			return err
		}
		w.cache.Set(dg.Hash, data, int64(len(data)))
	}
	return nil
}

// downloadFile downloads a single file to disk.
func (w *worker) downloadFile(files []fileNode, dg sdkdigest.Digest) error {
	w.limiter <- struct{}{}
	defer func() { <-w.limiter }()

	log.Debug("Downloading file of %d bytes...", dg.Size)
	filename := files[0].Name
	if err := w.client.ReadToFile(dg, filename, w.compressor(files, dg.Size) != pb.Compressor_ZSTD); err != nil {
		return grpcstatus.Errorf(grpcstatus.Code(err), "Failed to download file: %s", err)
	} else if err := os.Chmod(filename, fileMode(files[0].IsExecutable)); err != nil {
		return fmt.Errorf("Failed to chmod file: %s", err)
	}
	w.fileCache.Store(w.dir, filename, dg.Hash)
	return w.linkAll(files)
}

// linkAll hardlinks all the given files in the list (assuming the first has already been written)
func (w *worker) linkAll(files []fileNode) error {
	if len(files) == 1 {
		return nil
	}
	done := map[string]struct{}{
		files[0].Name: {},
	}
	for _, f := range files[1:] {
		// This should technically not be necessary (REAPI says all child names must be unique)
		// but we have observed it happen occasionally, so let's defend against it for now.
		if _, present := done[f.Name]; !present {
			if err := os.Link(files[0].Name, f.Name); err != nil {
				return err
			}
			done[f.Name] = struct{}{}
		}
	}
	return nil
}

// writeFiles writes a blob to a series of files.
func (w *worker) writeFiles(files []fileNode, data []byte, dg sdkdigest.Digest) error {
	w.iolimiter <- struct{}{}
	defer func() { <-w.iolimiter }()
	if err := ioutil.WriteFile(files[0].Name, data, fileMode(files[0].IsExecutable)); err != nil {
		return err
	} else if err := w.linkAll(files); err != nil {
		return err
	}
	w.fileCache.StoreAny(w.dir, files, dg.Hash)
	return nil
}

// makeDirIfNeeded makes a new subdir if the given name specifies a subdir (i.e. contains a path separator)
func makeDirIfNeeded(root, name string) error {
	if strings.ContainsRune(name, '/') {
		return os.MkdirAll(path.Join(root, path.Dir(name)), os.ModeDir|0755)
	}
	return nil
}

// digestProto returns a digest for a proto message.
func digestProto(msg proto.Message) *pb.Digest {
	blob, _ := proto.Marshal(msg)
	h := sha256.Sum256(blob)
	return &pb.Digest{Hash: hex.EncodeToString(h[:]), SizeBytes: int64(len(blob))}
}

func fileMode(isExecutable bool) os.FileMode {
	if isExecutable {
		return 0555
	}
	return 0444
}

// compressor returns the compressor to use for downloading the digest for a given set of files.
func (w *worker) compressor(fileNodes []fileNode, size int64) pb.Compressor_Value {
	// Using the first filename only here is a little suboptimal but we assume it won't
	// typically matter (since it is only an optimisation to choose whether to request
	// compression or not). We could potentially find another strategy in future if we
	// decide this is significantly suboptimal.
	return w.oneCompressor(fileNodes[0].Name, size)
}

// oneCompressor returns the compressor to use for a given filename
func (w *worker) oneCompressor(filename string, size int64) pb.Compressor_Value {
	if size >= rexclient.CompressionThreshold && shouldCompress(filename) {
		return pb.Compressor_ZSTD
	}
	return pb.Compressor_IDENTITY
}

// entryCompressor returns the compressor to use for an upload entry.
func (w *worker) entryCompressor(ue *uploadinfo.Entry) pb.Compressor_Value {
	if len(ue.Contents) > 0 {
		// Contents are set, if it looks like we've compressed already, don't do it again.
		if len(ue.Contents) < rexclient.CompressionThreshold || bytes.HasPrefix(ue.Contents, zstdMagic) {
			return pb.Compressor_IDENTITY
		}
		return pb.Compressor_ZSTD
	}
	return w.oneCompressor(ue.Path, ue.Digest.Size)
}

// shouldCompress returns true if the given filename should be compressed.
func shouldCompress(filename string) bool {
	return !(strings.HasSuffix(filename, ".zip") || strings.HasSuffix(filename, ".pex") ||
		strings.HasSuffix(filename, ".jar") || strings.HasSuffix(filename, ".gz") ||
		strings.HasSuffix(filename, ".bz2") || strings.HasSuffix(filename, ".xz"))
}

repository: thought-machine/please-servers

repo_name: thought-machine/please-servers


text: Cadena (2020, Aug. 27). Open Source Football: Individual Expected Completion using Logistic Generalized Additive Mixed Models. Retrieved from https://mrcaseb.github.io/open-source-football/posts/2020-08-28-expected-completion-using-logistic-generalized-additive-mixed-models/


text:
DESCRIPTION = "SDK environment setup for CUDA toolchain"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "file://cuda_environment_setup.sh.in \
           file://cuda_toolchain.cmake"

S = "${WORKDIR}"

inherit nativesdk

do_install() {
    install -d ${D}${datadir}/cmake/OEToolchainConfig.cmake.d
    install -m 0644 ${S}/cuda_toolchain.cmake ${D}${datadir}/cmake/OEToolchainConfig.cmake.d/
    install -d ${D}${SDKPATHNATIVE}/environment-setup.d
    sed -e"s,@CUDA_VERSION@,${CUDA_VERSION},g" ${S}/cuda_environment_setup.sh.in > ${D}${SDKPATHNATIVE}/environment-setup.d/cuda.sh
    chmod 0644 ${D}${SDKPATHNATIVE}/environment-setup.d/cuda.sh
}

FILES:${PN} = "${SDKPATHNATIVE}"
FILES:${PN}-dev = ""

repository: SOL-Space-Operating-Linux/meta-tegra

repo_name: SOL-Space-Operating-Linux/meta-tegra


text:
package main

import (
	"encoding/xml"
	"io/ioutil"
	"log"
	"os"

	"github.com/gocarina/gocsv"
)

type HealthData struct {
	XMLName xml.Name `xml:"HealthData"`
	Record  []Record
}

type Record struct {
	Type          string `xml:"type,attr" csv:"type"`
	SourceName    string `xml:"sourceName,attr" csv:"-"`
	SourceVersion string `xml:"sourceVersion,attr" csv:"-"`
	Unit          string `xml:"unit,attr" csv:"unit"`
	CreationDate  string `xml:"creationDate,attr" csv:"-"`
	StartDate     string `xml:"startDate,attr" csv:"startDate"`
	EndDate       string `xml:"endDate,attr" csv:"endDate"`
	Value         string `xml:"value,attr" csv:"value"`
}

func main() {

	// open xml file.
	xmlFile, err := os.Open("./apple_health_export/export.xml")
	if err != nil {
		log.Fatal(err)
	}
	defer xmlFile.Close()

	// read xml data.
	xmlData, err := ioutil.ReadAll(xmlFile)
	if err != nil {
		log.Fatal(err)
	}

	// parse xml and export to csv.
	csvFile, err := os.Create("./export.csv")
	if err != nil {
		log.Fatal(err)
	}
	defer csvFile.Close()

	var healthData HealthData
	xml.Unmarshal(xmlData, &healthData)
	records := healthData.Record
	gocsv.MarshalFile(&records, csvFile)

}

repository: ishibashi-futos/health-to-csv

repo_name: ishibashi-futos/health-to-csv


text:
package fate

import (
	"bufio"
	"os"
)

// NewOutput ...
func NewOutput(path string) (*bufio.Writer, error) {
	file, e := os.Create(path)
	if e != nil {
		return nil, e
	}

	return bufio.NewWriter(file), nil

}

repository: geebadan/fate

repo_name: geebadan/fate


text:
file(REMOVE_RECURSE
  "CMakeFiles/ext_keccak"
  "CMakeFiles/ext_keccak-complete"
  "external/keccak/src/ext_keccak-stamp/ext_keccak-build"
  "external/keccak/src/ext_keccak-stamp/ext_keccak-configure"
  "external/keccak/src/ext_keccak-stamp/ext_keccak-download"
  "external/keccak/src/ext_keccak-stamp/ext_keccak-install"
  "external/keccak/src/ext_keccak-stamp/ext_keccak-mkdir"
  "external/keccak/src/ext_keccak-stamp/ext_keccak-patch"
  "external/keccak/src/ext_keccak-stamp/ext_keccak-update"
)

# Per-language clean rules from dependency scanning.
foreach(lang )
  include(CMakeFiles/ext_keccak.dir/cmake_clean_${lang}.cmake OPTIONAL)
endforeach()

repository: demichele/cmake-mam

repo_name: demichele/cmake-mam