text:
@book{Zienkiewicz1,
	author = "Zienkiewicz, O. C. and Zhu, J.Z. and Taylor, Robert L.",
	edition = "7",
	isbn = "978-1-85617-633-0",
	keywords = "FEM; Numerical simulation; Mixed formulation; incompressibility; Mesh refinement",
	publisher = "Butterworth-Heinemann",
	title = "The Finite Element Method: its Basis and Fundamentals",
	x-color = "#cc3300",
	year = "2013"
}

repository: loumalouomega/ThesisTemplate

repo_name: loumalouomega/ThesisTemplate


text:
package balancer

import (
	"bytes"
)

// URLSeparator define url separator
const URLSeparator = '/'

// URLJoin splicing url
func URLJoin(urls ...string) string {
	elems := make([]string, 0)
	for _, url := range urls {
		if len(url) > 0 {
			elems = append(elems, url)
		}
	}

	switch len(elems) {
	case 0:
		return ""
	case 1:
		return elems[0]
	}

	n := len(string(URLSeparator)) * (len(elems) - 1)
	for i := 0; i < len(elems); i++ {
		n += len(elems[i])
	}

	buffer := bytes.NewBufferString(elems[0])
	buffer.Grow(n)

	for i := 1; i < len(elems); i++ {
		last := elems[i-1]
		ln := len(last)

		if last[ln-1] == URLSeparator {
			if elems[i][0] == URLSeparator {
				if _, err := buffer.WriteString(elems[i][1:]); err != nil {
					panic(err)
				}
			} else {
				if _, err := buffer.WriteString(elems[i]); err != nil {
					panic(err)
				}
			}
		} else {
			if elems[i][0] == URLSeparator {
				if _, err := buffer.WriteString(elems[i]); err != nil {
					panic(err)
				}
			} else {
				if _, err := buffer.WriteString(string(URLSeparator)); err != nil {
					panic(err)
				}
				if _, err := buffer.WriteString(elems[i]); err != nil {
					panic(err)
				}
			}
		}
	}

	return buffer.String()
}

// HashCode generate hash code
func HashCode(key string) int {
	if len(key) == 0 {
		return 0
	}

	hash := 0
	chars := []byte(key)
	for _, char := range chars {
		// Better decentralized hash
		// s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]
		hash = 31*hash + int(char)
	}

	return hash
}

license: MIT

repository: LonelyPale/balancer

license_type: permissive

repo_name: LonelyPale/balancer

branch_name: refs/heads/main

extension: go


text:
add_javascript_style_test(
        javascript_static_analysis_monkeybrains "${PROJECT_SOURCE_DIR}/plugins/monkeybrains/web_client/js")

add_python_style_test(python_static_analysis_monkeybrains
                          "${PROJECT_SOURCE_DIR}/plugins/monkeybrains/server")

repository: maryae/monkeybrains

repo_name: maryae/monkeybrains

branch_name: refs/heads/master

extension: cmake


text:
@article{wang2017changes,
 author = {Wang, Haitao and Marshall, Christopher W and Cheng, Minying and Xu, Huijuan and Li, Hu and Yang, Xiaoru and Zheng, Tianling},
 journal = {Scientific reports},
 number = {1},
 pages = {1--12},
 publisher = {Nature Publishing Group},
 title = {Changes in land use driven by urbanization impact nitrogen cycling and the microbial community composition in soils},
 volume = {7},
 year = {2017}
}

repository: sirmicrobe/labofmarshall

repo_name: sirmicrobe/labofmarshall

extension: bib


text:
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0

package task

import (
	"fmt"
	"reflect"

	"k8s.io/apimachinery/pkg/api/meta"
	"k8s.io/client-go/restmapper"
	"sigs.k8s.io/cli-utils/pkg/apply/taskrunner"
)

// ResetRESTMapperTask resets the provided RESTMapper.
type ResetRESTMapperTask struct {
	Mapper meta.RESTMapper
}

// Start creates a new goroutine that will unwrap the provided RESTMapper
// to get the underlying DeferredDiscoveryRESTMapper and then reset it. It
// will send a TaskResult on the taskChannel to signal that the task has
// been completed.
func (r *ResetRESTMapperTask) Start(taskContext *taskrunner.TaskContext) {
	go func() {
		ddRESTMapper, err := extractDeferredDiscoveryRESTMapper(r.Mapper)
		if err != nil {
			r.sendTaskResult(taskContext, err)
			return
		}
		ddRESTMapper.Reset()
		r.sendTaskResult(taskContext, nil)
	}()
}

// extractDeferredDiscoveryRESTMapper unwraps the provided RESTMapper
// interface to get access to the underlying DeferredDiscoveryRESTMapper
// that can be reset.
func extractDeferredDiscoveryRESTMapper(mapper meta.RESTMapper) (*restmapper.DeferredDiscoveryRESTMapper,
	error) {
	val := reflect.ValueOf(mapper)
	if val.Type().Kind() != reflect.Struct {
		return nil, fmt.Errorf("unexpected RESTMapper type: %s", val.Type().String())
	}
	fv := val.FieldByName("RESTMapper")
	ddRESTMapper, ok := fv.Interface().(*restmapper.DeferredDiscoveryRESTMapper)
	if !ok {
		return nil, fmt.Errorf("unexpected RESTMapper type")
	}
	return ddRESTMapper, nil
}

func (r *ResetRESTMapperTask) sendTaskResult(taskContext *taskrunner.TaskContext, err error) {
	taskContext.TaskChannel() <- taskrunner.TaskResult{
		Err: err,
	}
}

// ClearTimeout doesn't do anything as ResetRESTMapperTask doesn't support
// timeouts.
func (r *ResetRESTMapperTask) ClearTimeout() {}

repository: phanimarupaka/cli-utils

repo_name: phanimarupaka/cli-utils


text:
@article{li2018supportnet,
 author = {Li, Yu and Li, Zhongxiao and Ding, Lizhong and Hu, Yuhui and Chen, Wei and Gao, Xin},
 journal = {arXiv preprint arXiv:1806.02942},
 title = {SupportNet: solving catastrophic forgetting in class incremental learning with support data},
 year = {2018}
}


text:
package model

import (
	"encoding/json"

	"strings"
)

// Request Object
type RestoreBackupRequest struct {
	// 备份id

	BackupId string `json:"backup_id"`

	Body *BackupRestoreReq `json:"body,omitempty"`
}

func (o RestoreBackupRequest) String() string {
	data, err := json.Marshal(o)
	if err != nil {
		return "RestoreBackupRequest struct{}"
	}

	return strings.Join([]string{"RestoreBackupRequest", string(data)}, " ")
}


text:
// Copyright 2017 The OpenPitrix Authors. All rights reserved.
// Use of this source code is governed by a Apache license
// that can be found in the LICENSE file.

package config

import (
	"bufio"
	"errors"
	"io"
	"os"
	"strings"
)

func RunInDocker() bool {
	if s, err := pkgGetThisCgroupDir("devices"); err == nil {
		return strings.HasPrefix(s, "/docker/")
	}
	if pkgFileExists("/.dockerenv") || pkgFileExists("/.dockerinit") {
		return true
	}
	return false
}

func UseDockerLinkedEnvironmentVariables() {
	// mysql database
	if v, ok := os.LookupEnv("OPENPITRIX_DB_" + "MYSQL_PORT_3306_TCP_PORT"); ok && v != "" {
		os.Setenv("OPENPITRIX_CONFIG_DB_PORT", v)
	}
	if v, ok := os.LookupEnv("OPENPITRIX_DB_ENV_" + "MYSQL_DATABASE"); ok && v != "" {
		os.Setenv("OPENPITRIX_CONFIG_DB_DBNAME", v)
	}
	if v, ok := os.LookupEnv("OPENPITRIX_DB_ENV_" + "MYSQL_ROOT_PASSWORD"); ok && v != "" {
		os.Setenv("OPENPITRIX_CONFIG_DB_ROOTPASSWORD", v)
	}
	if v, ok := os.LookupEnv("OPENPITRIX_DB_ENV_" + "MYSQL_USER"); ok && v != "" {
		// unused
	}
	if v, ok := os.LookupEnv("OPENPITRIX_DB_ENV_" + "MYSQL_PASSWORD"); ok && v != "" {
		// unused
	}

	// openpitrix service port
	if v, ok := os.LookupEnv("OPENPITRIX_APP_ENV_" + "OPENPITRIX_CONFIG_APP_PORT"); ok && v != "" {
		os.Setenv("OPENPITRIX_CONFIG_APP_PORT", v)
	}
	if v, ok := os.LookupEnv("OPENPITRIX_RUNTIME_ENV_" + "OPENPITRIX_CONFIG_RUNTIME_PORT"); ok && v != "" {
		os.Setenv("OPENPITRIX_CONFIG_RUNTIME_PORT", v)
	}
	if v, ok := os.LookupEnv("OPENPITRIX_CLUSTER_ENV_" + "OPENPITRIX_CONFIG_CLUSTER_PORT"); ok && v != "" {
		os.Setenv("OPENPITRIX_CONFIG_CLUSTER_PORT", v)
	}
	if v, ok := os.LookupEnv("OPENPITRIX_REPO_ENV_" + "OPENPITRIX_CONFIG_REPO_PORT"); ok && v != "" {
		os.Setenv("OPENPITRIX_CONFIG_REPO_PORT", v)
	}
}

func pkgFileExists(path string) bool {
	fi, err := os.Stat(path)
	if err != nil && os.IsNotExist(err) {
		return false
	}
	if fi.IsDir() {
		return false
	}
	return true
}

// https://github.com/docker/libcontainer/blob/master/cgroups/utils.go

// Returns the relative path to the cgroup docker is running in.
func pkgGetThisCgroupDir(subsystem string) (string, error) {
	f, err := os.Open("/proc/self/cgroup")
	if err != nil {
		return "", err
	}
	defer f.Close()

	return pkgParseCgroupFile(subsystem, f)
}

func pkgParseCgroupFile(subsystem string, r io.Reader) (string, error) {
	s := bufio.NewScanner(r)

	for s.Scan() {
		if err := s.Err(); err != nil {
			return "", err
		}

		text := s.Text()
		parts := strings.Split(text, ":")

		for _, subs := range strings.Split(parts[1], ",") {
			if subs == subsystem {
				return parts[2], nil
			}
		}
	}

	return "", errors.New("not found")
}

repository: libangrui/openpitrix

repo_name: libangrui/openpitrix


text:
package stats

import (
	"context"
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestContextTags(t *testing.T) {
	x := context.Background()

	y := ContextWithTags(x)
	assert.Equal(t, 0, len(ContextTags(y)), "Initialize context tags context value")
	ContextAddTags(y, T("asdf", "qwer"))
	assert.Equal(t, 1, len(ContextTags(y)), "Adding tags should result new tags")
	assert.Equal(t, 0, len(ContextTags(x)), "Original context should have no tags (because no context with key)")

	// create a child context which creates a child context
	z := context.WithValue(y, interface{}("not"), "important")
	assert.Equal(t, 1, len(ContextTags(z)), "We should still be able to see original tags")

	// Add tags to the child context's reference to the original tag slice
	ContextAddTags(z, T("zxcv", "uiop"))
	assert.Equal(t, 2, len(ContextTags(z)), "Updating tags should update local reference")
	assert.Equal(t, 2, len(ContextTags(y)), "Updating tags should update parent reference")
	assert.Equal(t, 0, len(ContextTags(x)), "Updating tags should not appear on original context")

	ContextAddTags(z, T("a", "k"), T("b", "k"), T("c", "k"), T("d", "k"), T("e", "k"), T("f", "k"))
	assert.Equal(t, 8, len(ContextTags(z)), "Updating tags should update local reference")
	assert.Equal(t, 8, len(ContextTags(y)), "Updating tags should update parent reference")
	assert.Equal(t, 0, len(ContextTags(x)), "Updating tags should not appear on original context")
}

repository: segmentio/stats

repo_name: segmentio/stats

gha_license_id: MIT

gha_language: Go


text:
# - Find GSL
# Find the native GSL includes and library
#
# GSL_INCLUDES - where to find gsl/gsl_*.h, etc.
# GSL_LIBRARIES - List of libraries when using GSL.
# GSL_FOUND - True if GSL found.
if (GSL_INCLUDES)
# Already in cache, be silent
set (GSL_FIND_QUIETLY TRUE)
endif (GSL_INCLUDES)
find_path (GSL_INCLUDES gsl/gsl_math.h HINTS ENV GSL_DIR)
find_library (GSL_LIB NAMES gsl HINTS ENV GSL_DIR)
find_library (GSL_CBLAS_LIB NAMES openblas gslcblas HINTS ENV GSL_DIR)
set (GSL_LIBRARIES "${GSL_LIB}" "${GSL_CBLAS_LIB}")
# handle the QUIETLY and REQUIRED arguments and set GSL_FOUND to TRUE if
# all listed variables are TRUE
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (GSL DEFAULT_MSG GSL_LIBRARIES GSL_INCLUDES)
mark_as_advanced (GSL_LIB GSL_CBLAS_LIB GSL_INCLUDES)


text:
DESCRIPTION = "Henksat 13E,19E"

PN = "enigma2-plugin-settings-henksat-13e-19e"

SETTINGS_FILENAME = "henksat_astra_1_hb_e2"

include henksat.inc

extension: bb


text:
@InProceedings{cohenb15,
  supplementary = {Supplementary:cohenb15-supp.pdf},
  title = {Harmonic Exponential Families on Manifolds},
  author = {Taco Cohen and Max Welling},
  pages = {1757-1765},
  abstract = {In a range of fields including the geosciences, molecular biology, robotics and computer vision, one encounters problems that involve random variables on manifolds. Currently, there is a lack of flexible probabilistic models on manifolds that are fast and easy to train. We define an extremely flexible class of exponential family distributions on manifolds such as the torus, sphere, and rotation groups, and show that for these distributions the gradient of the log-likelihood can be computed efficiently using a non-commutative generalization of the Fast Fourier Transform (FFT). We discuss applications to Bayesian camera motion estimation (where harmonic exponential families serve as conjugate priors), and modelling of the spatial distribution of earthquakes on the surface of the earth. Our experimental results show that harmonic densities yield a significantly higher likelihood than the best competing method, while being orders of magnitude faster to train.},
}

repository: mreid/papersite

repo_name: mreid/papersite

gha_language: TeX


text:
package peekconn

import (
	"fmt"
	"net"
	"regexp"
)

type Peeker struct {
	net.Conn
	peeked []byte
}

type proxiedConnection interface {
	OriginalDestination() string
}

func (p *Peeker) OriginalDestination() string {
	switch underlying := p.Conn.(type) {
	case proxiedConnection:
		return underlying.OriginalDestination()
	default:
		return ""
	}
}

// Once called, the original connection *must not* be used
func (p *Peeker) PeekMatch(regexp *regexp.Regexp, len int) (bool, error) {
	if p.peeked != nil {
		return false, fmt.Errorf("have already peeked at this connection")
	}
	p.peeked = make([]byte, len)
	n, err := p.Conn.Read(p.peeked) // TODO: handle n < len(b)
	if err != nil {
		return false, err
	}
	if n != len {
		return false, fmt.Errorf("short conn reads aren't handled yet")
	}
	return regexp.Match(p.peeked), nil
}

func (p *Peeker) Read(b []byte) (int, error) {
	switch {
	case p.peeked != nil && len(p.peeked) <= len(b):
		copy(b, p.peeked)
		n := len(p.peeked)
		p.peeked = nil
		return n, nil

	case p.peeked != nil && len(p.peeked) > len(b):
		copy(b, p.peeked)
		p.peeked = p.peeked[len(b):]
		return len(b), nil

	default:
		return p.Conn.Read(b)
	}
}

repository: harrijk/grpc-tools

repo_name: harrijk/grpc-tools


text:
package errf

import "fmt"

// Wrapper function creates ErrflowOption that wraps original errors
// using provided 'func(err error) error' function.
//
// See WrapperFmtErrorw for common scenario fmt.Errorf("wrap message: %w", err).
//
// Example:
//  func WrapInOurError(ef *Errflow) *Errflow {
//  	return ef.With(errf.Wrapper(func (err error) error {
//  		return ourerrors.Wrap(err)
//  	}))
//  }
//
//  func exampleUsage() (err error) {
//  	defer errf.IfError().Apply(WrapInOurError).ThenAssignTo(&err)
//  	// ...
//  }
func Wrapper(wrapper func(err error) error) ErrflowOption {
	return func(ef *Errflow) *Errflow {
		if wrapper == nil {
			return ef
		}
		newEf := ef.copy()
		oldWrapper := ef.wrapper
		newWrapper := wrapper

		if oldWrapper != nil {
			newWrapper = func(err error) error {
				return wrapper(oldWrapper(err))
			}
		}

		newEf.wrapper = newWrapper
		return newEf
	}
}

func fmtErrorf(format string, a ...interface{}) func(err error) error {
	return func(err error) error {
		for i, v := range a {
			if v == OriginalErr {
				a[i] = err
			}
		}
		return fmt.Errorf(format, a...)
	}
}

// WrapperFmtErrorf is a Wrapper that uses fmt.Errorf to wrap errors.
// errf.OriginalErr is used as a placeholder for error in fmt.Errorf args.
//
// See WrapperFmtErrorw for common scenario fmt.Errorf("wrap message: %w", err).
//
// Example:
//  func exampleUsage() (err error) {
//  	defer errf.IfError().Apply(
//  		errf.WrapperFmtErrorf("%s %w %s", "-->", errf.OriginalErr, "<--")
//  	).ThenAssignTo(&err)
//
//  	// ...
//  }
func WrapperFmtErrorf(format string, a ...interface{}) ErrflowOption {
	return Wrapper(fmtErrorf(format, a...))
}

// WrapperFmtErrorw is a Wrapper that uses fmt.Errorf("%s: %w", ...) to wrap errors.
//
// Example:
//  func exampleUsage() (err error) {
//  	defer errf.IfError().Apply(errf.WrapperFmtErrorw("error in exampleUsage")).ThenAssignTo(&err)
//
//  	// ...
//  }
func WrapperFmtErrorw(s string) ErrflowOption {
	return WrapperFmtErrorf("%s: %w", s, OriginalErr)
}

type originalErrType struct{}

func (err *originalErrType) Error() string {
	return "errflow original error placeholder"
}

// OriginalErr is a placeholder for error in WrapperFmtErrorf(...) call.
var OriginalErr = &originalErrType{}

repository: serhiy-t/errf

repo_name: serhiy-t/errf


text:
DESCRIPTION = "Exml is a generic XML parser wrapper."
LICENSE = "MIT"
DEPENDS = "libxml2 libxslt ecore"
PV = "0.1.1+svnr${SRCPV}"
PR = "r2"
SRCREV = "${EFL_SRCREV_1.0.0}"

inherit efl
SRC_URI = "${E_SVN}/BROKEN;module=${SRCNAME};proto=http;scmdata=keep"
S = "${WORKDIR}/${SRCNAME}"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


text:
package dishook

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

// Sends the webhook to Discord. *waves*
func SendWebhook(client *http.Client, url string, hook *Webhook) error {
	if client == nil {
		client = http.DefaultClient
	}

	// Encode body as JSON
	buf := &bytes.Buffer{}
	enc := json.NewEncoder(buf)
	enc.SetEscapeHTML(false)
	if err := enc.Encode(hook); err != nil {
		return err
	}

	// Create the request
	req, err := http.NewRequest(http.MethodPost, url, buf)
	if err != nil {
		return err
	}
	req.Header.Set("User-Agent", "Dishook/0.1.0")
	req.Header.Set("Content-Type", "application/json")

	// Do the request
	resp, err := client.Do(req)
	if err != nil {
		return err
	}
	defer resp.Body.Close()

	// TODO: see if there any issues

	return nil
}

repository: jamiemansfield/dishook

repo_name: jamiemansfield/dishook


text:
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: go.chromium.org/luci/resultdb/proto/rpc/v1/predicate.proto

package rpcpb

import (
	fmt "fmt"
	proto "github.com/golang/protobuf/proto"
	_type "go.chromium.org/luci/resultdb/proto/type"
	_ "google.golang.org/genproto/googleapis/api/annotations"
	math "math"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package

// Filters test results based on TestResult.expected field.
type TestResultPredicate_Expectancy int32

const (
	// All test results satisfiy this.
	// WARNING: using this significantly increases response size and latency.
	TestResultPredicate_ALL TestResultPredicate_Expectancy = 0
	// A test result must belong to a test variant that has one or more
	// unexpected results. It can be used to fetch both unexpected and flakily
	// expected results.
	//
	// Note that the predicate is defined at the test variant level.
	// For example, if a test variant expects a PASS and has results
	// [FAIL, FAIL, PASS], then all results satisfy the predicate because
	// the variant satisfies the predicate.
	TestResultPredicate_VARIANTS_WITH_UNEXPECTED_RESULTS TestResultPredicate_Expectancy = 1
)

var TestResultPredicate_Expectancy_name = map[int32]string{
	0: "ALL",
	1: "VARIANTS_WITH_UNEXPECTED_RESULTS",
}

var TestResultPredicate_Expectancy_value = map[string]int32{
	"ALL":                              0,
	"VARIANTS_WITH_UNEXPECTED_RESULTS": 1,
}

func (x TestResultPredicate_Expectancy) String() string {
	return proto.EnumName(TestResultPredicate_Expectancy_name, int32(x))
}

func (TestResultPredicate_Expectancy) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_c5e4555b96213a1b, []int{0, 0}
}

// Represents a function TestResult -> bool.
// Empty message matches all test results.
//
// Most clients would want to set expected_results to
// VARIANTS_WITH_UNEXPECTED_RESULTS.
type TestResultPredicate struct {
	// A test result must have a test path matching this regular expression
	// entirely, i.e. the expression is implicitly wrapped with ^ and $.
	TestPathRegexp string `protobuf:"bytes,1,opt,name=test_path_regexp,json=testPathRegexp,proto3" json:"test_path_regexp,omitempty"`
	// A test result must have a variant satisfying this predicate.
	Variant *VariantPredicate `protobuf:"bytes,2,opt,name=variant,proto3" json:"variant,omitempty"`
	// A test result must match this predicate based on TestResult.expected field.
	// Most clients would want to override this field because the default
	// typically causes a large response size.
	Expectancy           TestResultPredicate_Expectancy `protobuf:"varint,3,opt,name=expectancy,proto3,enum=luci.resultdb.rpc.v1.TestResultPredicate_Expectancy" json:"expectancy,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                       `json:"-"`
	XXX_unrecognized     []byte                         `json:"-"`
	XXX_sizecache        int32                          `json:"-"`
}

func (m *TestResultPredicate) Reset()         { *m = TestResultPredicate{} }
func (m *TestResultPredicate) String() string { return proto.CompactTextString(m) }
func (*TestResultPredicate) ProtoMessage()    {}
func (*TestResultPredicate) Descriptor() ([]byte, []int) {
	return fileDescriptor_c5e4555b96213a1b, []int{0}
}

func (m *TestResultPredicate) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_TestResultPredicate.Unmarshal(m, b)
}
func (m *TestResultPredicate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_TestResultPredicate.Marshal(b, m, deterministic)
}
func (m *TestResultPredicate) XXX_Merge(src proto.Message) {
	xxx_messageInfo_TestResultPredicate.Merge(m, src)
}
func (m *TestResultPredicate) XXX_Size() int {
	return xxx_messageInfo_TestResultPredicate.Size(m)
}
func (m *TestResultPredicate) XXX_DiscardUnknown() {
	xxx_messageInfo_TestResultPredicate.DiscardUnknown(m)
}

var xxx_messageInfo_TestResultPredicate proto.InternalMessageInfo

func (m *TestResultPredicate) GetTestPathRegexp() string {
	if m != nil {
		return m.TestPathRegexp
	}
	return ""
}

func (m *TestResultPredicate) GetVariant() *VariantPredicate {
	if m != nil {
		return m.Variant
	}
	return nil
}

func (m *TestResultPredicate) GetExpectancy() TestResultPredicate_Expectancy {
	if m != nil {
		return m.Expectancy
	}
	return TestResultPredicate_ALL
}

// Represents a function TestExoneration -> bool.
// Empty message matches all test exonerations.
type TestExonerationPredicate struct {
	// A test exoneration must have a test path matching this regular expression
	// entirely, i.e. the expression is implicitly wrapped with ^ and $.
	TestPathRegexp string `protobuf:"bytes,1,opt,name=test_path_regexp,json=testPathRegexp,proto3" json:"test_path_regexp,omitempty"`
	// A test exoneration must have a variant satisfying this predicate.
	Variant              *VariantPredicate `protobuf:"bytes,2,opt,name=variant,proto3" json:"variant,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (m *TestExonerationPredicate) Reset()         { *m = TestExonerationPredicate{} }
func (m *TestExonerationPredicate) String() string { return proto.CompactTextString(m) }
func (*TestExonerationPredicate) ProtoMessage()    {}
func (*TestExonerationPredicate) Descriptor() ([]byte, []int) {
	return fileDescriptor_c5e4555b96213a1b, []int{1}
}

func (m *TestExonerationPredicate) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_TestExonerationPredicate.Unmarshal(m, b)
}
func (m *TestExonerationPredicate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_TestExonerationPredicate.Marshal(b, m, deterministic)
}
func (m *TestExonerationPredicate) XXX_Merge(src proto.Message) {
	xxx_messageInfo_TestExonerationPredicate.Merge(m, src)
}
func (m *TestExonerationPredicate) XXX_Size() int {
	return xxx_messageInfo_TestExonerationPredicate.Size(m)
}
func (m *TestExonerationPredicate) XXX_DiscardUnknown() {
	xxx_messageInfo_TestExonerationPredicate.DiscardUnknown(m)
}

var xxx_messageInfo_TestExonerationPredicate proto.InternalMessageInfo

func (m *TestExonerationPredicate) GetTestPathRegexp() string {
	if m != nil {
		return m.TestPathRegexp
	}
	return ""
}

func (m *TestExonerationPredicate) GetVariant() *VariantPredicate {
	if m != nil {
		return m.Variant
	}
	return nil
}

// Represents a function Variant -> bool.
type VariantPredicate struct {
	// Types that are valid to be assigned to Predicate:
	//	*VariantPredicate_Exact
	//	*VariantPredicate_Contains
	Predicate            isVariantPredicate_Predicate `protobuf_oneof:"predicate"`
	XXX_NoUnkeyedLiteral struct{}                     `json:"-"`
	XXX_unrecognized     []byte                       `json:"-"`
	XXX_sizecache        int32                        `json:"-"`
}

func (m *VariantPredicate) Reset()         { *m = VariantPredicate{} }
func (m *VariantPredicate) String() string { return proto.CompactTextString(m) }
func (*VariantPredicate) ProtoMessage()    {}
func (*VariantPredicate) Descriptor() ([]byte, []int) {
	return fileDescriptor_c5e4555b96213a1b, []int{2}
}

func (m *VariantPredicate) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_VariantPredicate.Unmarshal(m, b)
}
func (m *VariantPredicate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_VariantPredicate.Marshal(b, m, deterministic)
}
func (m *VariantPredicate) XXX_Merge(src proto.Message) {
	xxx_messageInfo_VariantPredicate.Merge(m, src)
}
func (m *VariantPredicate) XXX_Size() int {
	return xxx_messageInfo_VariantPredicate.Size(m)
}
func (m *VariantPredicate) XXX_DiscardUnknown() {
	xxx_messageInfo_VariantPredicate.DiscardUnknown(m)
}

var xxx_messageInfo_VariantPredicate proto.InternalMessageInfo

type isVariantPredicate_Predicate interface {
	isVariantPredicate_Predicate()
}

type VariantPredicate_Exact struct {
	Exact *_type.Variant `protobuf:"bytes,1,opt,name=exact,proto3,oneof"`
}

type VariantPredicate_Contains struct {
	Contains *_type.Variant `protobuf:"bytes,2,opt,name=contains,proto3,oneof"`
}

func (*VariantPredicate_Exact) isVariantPredicate_Predicate() {}

func (*VariantPredicate_Contains) isVariantPredicate_Predicate() {}

func (m *VariantPredicate) GetPredicate() isVariantPredicate_Predicate {
	if m != nil {
		return m.Predicate
	}
	return nil
}

func (m *VariantPredicate) GetExact() *_type.Variant {
	if x, ok := m.GetPredicate().(*VariantPredicate_Exact); ok {
		return x.Exact
	}
	return nil
}

func (m *VariantPredicate) GetContains() *_type.Variant {
	if x, ok := m.GetPredicate().(*VariantPredicate_Contains); ok {
		return x.Contains
	}
	return nil
}

// XXX_OneofWrappers is for the internal use of the proto package.
func (*VariantPredicate) XXX_OneofWrappers() []interface{} {
	return []interface{}{
		(*VariantPredicate_Exact)(nil),
		(*VariantPredicate_Contains)(nil),
	}
}

func init() {
	proto.RegisterEnum("luci.resultdb.rpc.v1.TestResultPredicate_Expectancy", TestResultPredicate_Expectancy_name, TestResultPredicate_Expectancy_value)
	proto.RegisterType((*TestResultPredicate)(nil), "luci.resultdb.rpc.v1.TestResultPredicate")
	proto.RegisterType((*TestExonerationPredicate)(nil), "luci.resultdb.rpc.v1.TestExonerationPredicate")
	proto.RegisterType((*VariantPredicate)(nil), "luci.resultdb.rpc.v1.VariantPredicate")
}

func init() {
	proto.RegisterFile("go.chromium.org/luci/resultdb/proto/rpc/v1/predicate.proto", fileDescriptor_c5e4555b96213a1b)
}

var fileDescriptor_c5e4555b96213a1b = []byte{
	// 392 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x92, 0xc1, 0x8b, 0xd3, 0x40,
	0x18, 0xc5, 0x37, 0xbb, 0xe8, 0xba, 0x53, 0x58, 0xc2, 0xe8, 0x21, 0xac, 0x07, 0x43, 0x10, 0xc9,
	0x69, 0xc6, 0xcd, 0xea, 0x41, 0xf7, 0x62, 0x57, 0x03, 0xbb, 0x50, 0x4a, 0x99, 0xa6, 0x55, 0xbc,
	0x84, 0xc9, 0x74, 0x4c, 0x06, 0x92, 0xcc, 0x30, 0x99, 0x86, 0xf4, 0x1f, 0xf0, 0xea, 0xc5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, 0x1c, 0x58, 0x15, 0x85, 0xa3, 0x97, 0xfc, 0x95, 0xe3, 0xdd, 0x02,
	0xf0, 0x67, 0x02, 0xcf, 0xc1, 0xd9, 0x74, 0x36, 0xb3, 0x4f, 0xe0, 0x4b, 0xe0, 0xae, 0xa7, 0xe4,
	0x61, 0x3a, 0x8f, 0x96, 0xf1, 0xe7, 0x87, 0xe8, 0x3e, 0x5e, 0xcd, 0xc3, 0x2f, 0x8b, 0xf0, 0x63,
	0x14, 0x7e, 0x8a, 0x49, 0xb8, 0x5c, 0xcd, 0xa2, 0xa5, 0x6d, 0x79, 0xdf, 0x2d, 0xe0, 0xb4, 0x5d,
	0x61, 0x23, 0x4b, 0xae, 0xa9, 0x11, 0xb2, 0xfc, 0x2f, 0xff, 0xc6, 0xfb, 0x61, 0x01, 0x7b, 0x7f,
	0x0a, 0x6f, 0xc0, 0x23, 0xde, 0x50, 0x66, 0xba, 0xd6, 0x49, 0xf0, 0x7c, 0x2f, 0xb4, 0x7d, 0xe5,
	0x21, 0xf2, 0xfe, 0x84, 0xf4, 0x2c, 0x7c, 0x07, 0x9e, 0x30, 0x59, 0x1a, 0x2a, 0xca, 0xea, 0xf7,
	0x32, 0xff, 0xf0, 0x8d, 0xf8, 0xdd, 0x04, 0x5c, 0x8c, 0x57, 0x7a, 0x17, 0x7c, 0x7d, 0x7d, 0xfc,
	0x75, 0xdf, 0x6a, 0xc5, 0x54, 0x92, 0x3c, 0xee, 0xb4, 0x9b, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff,
	0x4e, 0x81, 0x6a, 0x9a, 0x18, 0x03, 0x00, 0x00,
}

repository: tapted/luci-go

repo_name: tapted/luci-go


text:
package client

import (
	"context"
	"github.com/cloudfoundry-community/go-cfclient/v3/resource"
)

type ResourceMatchClient commonClient

// Create a list of cached resources from the input list
func (c *ResourceMatchClient) Create(ctx context.Context, toMatch *resource.ResourceMatches) (*resource.ResourceMatches, error) {
	var matched resource.ResourceMatches
	_, err := c.client.post(ctx, "/v3/resource_matches", toMatch, &matched)
	if err != nil {
		return nil, err
	}
	return &matched, nil
}

repository: cloudfoundry-community/go-cfclient

repo_name: cloudfoundry-community/go-cfclient


text:
package event

import (
	"fmt"
	"strings"
	"time"

	"github.com/thrasher-corp/gocryptotrader/currency"
	"github.com/thrasher-corp/gocryptotrader/exchanges/asset"
	"github.com/thrasher-corp/gocryptotrader/exchanges/kline"
)

// GetOffset returns the offset
func (b *Base) GetOffset() int64 {
	return b.Offset
}

// SetOffset sets the offset
func (b *Base) SetOffset(o int64) {
	b.Offset = o
}

// IsEvent returns whether the event is an event
func (b *Base) IsEvent() bool {
	return true
}

// GetTime returns the time
func (b *Base) GetTime() time.Time {
	return b.Time.UTC()
}

// Pair returns the currency pair
func (b *Base) Pair() currency.Pair {
	return b.CurrencyPair
}

// GetUnderlyingPair returns the currency pair
func (b *Base) GetUnderlyingPair() currency.Pair {
	return b.UnderlyingPair
}

// GetExchange returns the exchange
func (b *Base) GetExchange() string {
	return strings.ToLower(b.Exchange)
}

// GetAssetType returns the asset type
func (b *Base) GetAssetType() asset.Item {
	return b.AssetType
}

// GetInterval returns the interval
func (b *Base) GetInterval() kline.Interval {
	return b.Interval
}

// AppendReason adds reasoning for a decision being made
func (b *Base) AppendReason(y string) {
	b.Reasons = append(b.Reasons, y)
}

// AppendReasonf adds reasoning for a decision being made
// but with formatting
func (b *Base) AppendReasonf(y string, addons ...interface{}) {
	y = fmt.Sprintf(y, addons...)
	b.Reasons = append(b.Reasons, y)
}

// GetConcatReasons returns the why
func (b *Base) GetConcatReasons() string {
	return strings.Join(b.Reasons, ". ")
}

// GetReasons returns each individual reason
func (b *Base) GetReasons() []string {
	return b.Reasons
}

// GetBase returns the underlying base
func (b *Base) GetBase() *Base {
	return b
}

repository: thrasher-corp/gocryptotrader

repo_name: thrasher-corp/gocryptotrader


text:
// Code generated by protoc-gen-go.
// source: byzantine.proto
// DO NOT EDIT!

/*
Package byzantine is a generated protocol buffer package.

It is generated from these files:
	byzantine.proto

It has these top-level messages:
	Publication
	Publisher
	Subscriber
	PubResponse
	SubRequest
	ChainMAC
	ChainResponse
	EchoResponse
	ReadyResponse
*/
package byzantine

import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "google.golang.org/genproto/googleapis/api/annotations"

import (
	context "golang.org/x/net/context"
	grpc "google.golang.org/grpc"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package

// / Publication is the message sent out to the brokers, who pass it along to the subscribers.
type Publication struct {
	PubType       uint32      `protobuf:"varint,1,opt,name=PubType" json:"PubType,omitempty"`
	PublisherID   uint64      `protobuf:"varint,2,opt,name=PublisherID" json:"PublisherID,omitempty"`
	PublicationID int64       `protobuf:"zigzag64,3,opt,name=PublicationID" json:"PublicationID,omitempty"`
	TopicID       uint64      `protobuf:"varint,4,opt,name=TopicID" json:"TopicID,omitempty"`
	BrokerID      uint64      `protobuf:"varint,5,opt,name=BrokerID" json:"BrokerID,omitempty"`
	Contents      [][]byte    `protobuf:"bytes,6,rep,name=Contents,proto3" json:"Contents,omitempty"`
	MAC           []byte      `protobuf:"bytes,7,opt,name=MAC,proto3" json:"MAC,omitempty"`
	ChainMACs     []*ChainMAC `protobuf:"bytes,8,rep,name=ChainMACs" json:"ChainMACs,omitempty"`
}

func (m *Publication) Reset()                    { *m = Publication{} }
func (m *Publication) String() string            { return proto.CompactTextString(m) }
func (*Publication) ProtoMessage()               {}
func (*Publication) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }

func (m *Publication) GetPubType() uint32 {
	if m != nil {
		return m.PubType
	}
	return 0
}

func (m *Publication) GetPublisherID() uint64 {
	if m != nil {
		return m.PublisherID
	}
	return 0
}

func (m *Publication) GetPublicationID() int64 {
	if m != nil {
		return m.PublicationID
	}
	return 0
}

func (m *Publication) GetTopicID() uint64 {
	if m != nil {
		return m.TopicID
	}
	return 0
}

func (m *Publication) GetBrokerID() uint64 {
	if m != nil {
		return m.BrokerID
	}
	return 0
}

func (m *Publication) GetContents() [][]byte {
	if m != nil {
		return m.Contents
	}
	return nil
}

func (m *Publication) GetMAC() []byte {
	if m != nil {
		return m.MAC
	}
	return nil
}

func (m *Publication) GetChainMACs() []*ChainMAC {
	if m != nil {
		return m.ChainMACs
	}
	return nil
}

// / Publisher defines a publisher within a quorum.
type Publisher struct {
	Address     string `protobuf:"bytes,1,opt,name=Address" json:"Address,omitempty"`
	PublisherID uint64 `protobuf:"varint,2,opt,name=PublisherID" json:"PublisherID,omitempty"`
}

func (m *Publisher) Reset()                    { *m = Publisher{} }
func (m *Publisher) String() string            { return proto.CompactTextString(m) }
func (*Publisher) ProtoMessage()               {}
func (*Publisher) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }

func (m *Publisher) GetAddress() string {
	if m != nil {
		return m.Address
	}
	return ""
}

func (m *Publisher) GetPublisherID() uint64 {
	if m != nil {
		return m.PublisherID
	}
	return 0
}

// / Subscriber defines a subscriber within a subscriber pool.
type Subscriber struct {
	Address                    string `protobuf:"bytes,1,opt,name=Address" json:"Address,omitempty"`
	PoolID                     uint64 `protobuf:"varint,2,opt,name=PoolID" json:"PoolID,omitempty"`
	DestinationDistinguishment uint64 `protobuf:"varint,3,opt,name=DestinationDistinguishment" json:"DestinationDistinguishment,omitempty"`
}

func (m *Subscriber) Reset()                    { *m = Subscriber{} }
func (m *Subscriber) String() string            { return proto.CompactTextString(m) }
func (*Subscriber) ProtoMessage()               {}
func (*Subscriber) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }

func (m *Subscriber) GetAddress() string {
	if m != nil {
		return m.Address
	}
	return ""
}

func (m *Subscriber) GetPoolID() uint64 {
	if m != nil {
		return m.PoolID
	}
	return 0
}

func (m *Subscriber) GetDestinationDistinguishment() uint64 {
	if m != nil {
		return m.DestinationDistinguishment
	}
	return 0
}

type PubResponse struct {
	Success bool `protobuf:"varint,1,opt,name=Success" json:"Success,omitempty"`
}

func (m *PubResponse) Reset()                    { *m = PubResponse{} }
func (m *PubResponse) String() string            { return proto.CompactTextString(m) }
func (*PubResponse) ProtoMessage()               {}
func (*PubResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }

func (m *PubResponse) GetSuccess() bool {
	if m != nil {
		return m.Success
	}
	return false
}

type SubRequest struct {
	PublisherID uint64 `protobuf:"varint,1,opt,name=PublisherID" json:"PublisherID,omitempty"`
	BrokerID    uint64 `protobuf:"varint,2,opt,name=BrokerID" json:"BrokerID,omitempty"`
}

func (m *SubRequest) Reset()                    { *m = SubRequest{} }
func (m *SubRequest) String() string            { return proto.CompactTextString(m) }
func (*SubRequest) ProtoMessage()               {}
func (*SubRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }

func (m *SubRequest) GetPublisherID() uint64 {
	if m != nil {
		return m.PublisherID
	}
	return 0
}

func (m *SubRequest) GetBrokerID() uint64 {
	if m != nil {
		return m.BrokerID
	}
	return 0
}

type ChainMAC struct {
	From string `protobuf:"bytes,1,opt,name=From" json:"From,omitempty"`
	To   string `protobuf:"bytes,2,opt,name=To" json:"To,omitempty"`
	MAC  []byte `protobuf:"bytes,3,opt,name=MAC,proto3" json:"MAC,omitempty"`
}

func (m *ChainMAC) Reset()                    { *m = ChainMAC{} }
func (m *ChainMAC) String() string            { return proto.CompactTextString(m) }
func (*ChainMAC) ProtoMessage()               {}
func (*ChainMAC) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }

func (m *ChainMAC) GetFrom() string {
	if m != nil {
		return m.From
	}
	return ""
}

func (m *ChainMAC) GetTo() string {
	if m != nil {
		return m.To
	}
	return ""
}

func (m *ChainMAC) GetMAC() []byte {
	if m != nil {
		return m.MAC
	}
	return nil
}

type ChainResponse struct {
	Valid bool `protobuf:"varint,1,opt,name=Valid" json:"Valid,omitempty"`
}

func (m *ChainResponse) Reset()                    { *m = ChainResponse{} }
func (m *ChainResponse) String() string            { return proto.CompactTextString(m) }
func (*ChainResponse) ProtoMessage()               {}
func (*ChainResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }

func (m *ChainResponse) GetValid() bool {
	if m != nil {
		return m.Valid
	}
	return false
}

type EchoResponse struct {
	Hello bool `protobuf:"varint,1,opt,name=Hello" json:"Hello,omitempty"`
}

func (m *EchoResponse) Reset()                    { *m = EchoResponse{} }
func (m *EchoResponse) String() string            { return proto.CompactTextString(m) }
func (*EchoResponse) ProtoMessage()               {}
func (*EchoResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} }

func (m *EchoResponse) GetHello() bool {
	if m != nil {
		return m.Hello
	}
	return false
}

type ReadyResponse struct {
	Ready bool `protobuf:"varint,1,opt,name=Ready" json:"Ready,omitempty"`
}

func (m *ReadyResponse) Reset()                    { *m = ReadyResponse{} }
func (m *ReadyResponse) String() string            { return proto.CompactTextString(m) }
func (*ReadyResponse) ProtoMessage()               {}
func (*ReadyResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} }

func (m *ReadyResponse) GetReady() bool {
	if m != nil {
		return m.Ready
	}
	return false
}

func init() {
	proto.RegisterType((*Publication)(nil), "byzantine.Publication")
	proto.RegisterType((*Publisher)(nil), "byzantine.Publisher")
	proto.RegisterType((*Subscriber)(nil), "byzantine.Subscriber")
	proto.RegisterType((*PubResponse)(nil), "byzantine.PubResponse")
	proto.RegisterType((*SubRequest)(nil), "byzantine.SubRequest")
	proto.RegisterType((*ChainMAC)(nil), "byzantine.ChainMAC")
	proto.RegisterType((*ChainResponse)(nil), "byzantine.ChainResponse")
	proto.RegisterType((*EchoResponse)(nil), "byzantine.EchoResponse")
	proto.RegisterType((*ReadyResponse)(nil), "byzantine.ReadyResponse")
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4

// Client API for Subscribe service

type SubscribeClient interface {
	Subscribe(ctx context.Context, in *SubRequest, opts ...grpc.CallOption) (*ReadyResponse, error)
}

type subscribeClient struct {
	cc *grpc.ClientConn
}

func NewSubscribeClient(cc *grpc.ClientConn) SubscribeClient {
	return &subscribeClient{cc}
}

func (c *subscribeClient) Subscribe(ctx context.Context, in *SubRequest, opts ...grpc.CallOption) (*ReadyResponse, error) {
	out := new(ReadyResponse)
	err := grpc.Invoke(ctx, "/byzantine.Subscribe/Subscribe", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// Server API for Subscribe service

type SubscribeServer interface {
	Subscribe(context.Context, *SubRequest) (*ReadyResponse, error)
}

func RegisterSubscribeServer(s *grpc.Server, srv SubscribeServer) {
	s.RegisterService(&_Subscribe_serviceDesc, srv)
}

func _Subscribe_Subscribe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SubRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SubscribeServer).Subscribe(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/byzantine.Subscribe/Subscribe",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SubscribeServer).Subscribe(ctx, req.(*SubRequest))
	}
	return interceptor(ctx, in, info, handler)
}

var _Subscribe_serviceDesc = grpc.ServiceDesc{
	ServiceName: "byzantine.Subscribe",
	HandlerType: (*SubscribeServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Subscribe",
			Handler:    _Subscribe_Subscribe_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "byzantine.proto",
}

// Client API for Broker service

type BrokerClient interface {
	Echo(ctx context.Context, in *Publication, opts ...grpc.CallOption) (*EchoResponse, error)
	GetSubscribers(ctx context.Context, in *Subscriber, opts ...grpc.CallOption) (Broker_GetSubscribersClient, error)
	RegisterSubscriber(ctx context.Context, in *Subscriber, opts ...grpc.CallOption) (*ReadyResponse, error)
	Ready(ctx context.Context, in *Publication, opts ...grpc.CallOption) (*ReadyResponse, error)
	Receive(ctx context.Context, in *Publication, opts ...grpc.CallOption) (*PubResponse, error)
	Push(ctx context.Context, opts ...grpc.CallOption) (Broker_PushClient, error)
	Chain(ctx context.Context, in *Publication, opts ...grpc.CallOption) (*ChainResponse, error)
}

type brokerClient struct {
	cc *grpc.ClientConn
}

func NewBrokerClient(cc *grpc.ClientConn) BrokerClient {
	return &brokerClient{cc}
}

func (c *brokerClient) Echo(ctx context.Context, in *Publication, opts ...grpc.CallOption) (*EchoResponse, error) {
	out := new(EchoResponse)
	err := grpc.Invoke(ctx, "/byzantine.Broker/Echo", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *brokerClient) GetSubscribers(ctx context.Context, in *Subscriber, opts ...grpc.CallOption) (Broker_GetSubscribersClient, error) {
	stream, err := grpc.NewClientStream(ctx, &_Broker_serviceDesc.Streams[0], c.cc, "/byzantine.Broker/GetSubscribers", opts...)
	if err != nil {
		return nil, err
	}
	x := &brokerGetSubscribersClient{stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

type Broker_GetSubscribersClient interface {
	Recv() (*Subscriber, error)
	grpc.ClientStream
}

type brokerGetSubscribersClient struct {
	grpc.ClientStream
}

func (x *brokerGetSubscribersClient) Recv() (*Subscriber, error) {
	m := new(Subscriber)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func (c *brokerClient) RegisterSubscriber(ctx context.Context, in *Subscriber, opts ...grpc.CallOption) (*ReadyResponse, error) {
	out := new(ReadyResponse)
	err := grpc.Invoke(ctx, "/byzantine.Broker/RegisterSubscriber", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *brokerClient) Ready(ctx context.Context, in *Publication, opts ...grpc.CallOption) (*ReadyResponse, error) {
	out := new(ReadyResponse)
	err := grpc.Invoke(ctx, "/byzantine.Broker/Ready", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *brokerClient) Receive(ctx context.Context, in *Publication, opts ...grpc.CallOption) (*PubResponse, error) {
	out := new(PubResponse)
	err := grpc.Invoke(ctx, "/byzantine.Broker/Receive", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *brokerClient) Push(ctx context.Context, opts ...grpc.CallOption) (Broker_PushClient, error) {
	stream, err := grpc.NewClientStream(ctx, &_Broker_serviceDesc.Streams[1], c.cc, "/byzantine.Broker/Push", opts...)
	if err != nil {
		return nil, err
	}
	x := &brokerPushClient{stream}
	return x, nil
}

type Broker_PushClient interface {
	Send(*SubRequest) error
	Recv() (*Publication, error)
	grpc.ClientStream
}

type brokerPushClient struct {
	grpc.ClientStream
}

func (x *brokerPushClient) Send(m *SubRequest) error {
	return x.ClientStream.SendMsg(m)
}

func (x *brokerPushClient) Recv() (*Publication, error) {
	m := new(Publication)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func (c *brokerClient) Chain(ctx context.Context, in *Publication, opts ...grpc.CallOption) (*ChainResponse, error) {
	out := new(ChainResponse)
	err := grpc.Invoke(ctx, "/byzantine.Broker/Chain", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// Server API for Broker service

type BrokerServer interface {
	Echo(context.Context, *Publication) (*EchoResponse, error)
	GetSubscribers(*Subscriber, Broker_GetSubscribersServer) error
	RegisterSubscriber(context.Context, *Subscriber) (*ReadyResponse, error)
	Ready(context.Context, *Publication) (*ReadyResponse, error)
	Receive(context.Context, *Publication) (*PubResponse, error)
	Push(Broker_PushServer) error
	Chain(context.Context, *Publication) (*ChainResponse, error)
}

func RegisterBrokerServer(s *grpc.Server, srv BrokerServer) {
	s.RegisterService(&_Broker_serviceDesc, srv)
}

func _Broker_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Publication)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BrokerServer).Echo(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/byzantine.Broker/Echo",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BrokerServer).Echo(ctx, req.(*Publication))
	}
	return interceptor(ctx, in, info, handler)
}

func _Broker_GetSubscribers_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(Subscriber)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(BrokerServer).GetSubscribers(m, &brokerGetSubscribersServer{stream})
}

type Broker_GetSubscribersServer interface {
	Send(*Subscriber) error
	grpc.ServerStream
}

type brokerGetSubscribersServer struct {
	grpc.ServerStream
}

func (x *brokerGetSubscribersServer) Send(m *Subscriber) error {
	return x.ServerStream.SendMsg(m)
}

func _Broker_RegisterSubscriber_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Subscriber)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BrokerServer).RegisterSubscriber(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/byzantine.Broker/RegisterSubscriber",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BrokerServer).RegisterSubscriber(ctx, req.(*Subscriber))
	}
	return interceptor(ctx, in, info, handler)
}

func _Broker_Ready_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Publication)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BrokerServer).Ready(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/byzantine.Broker/Ready",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BrokerServer).Ready(ctx, req.(*Publication))
	}
	return interceptor(ctx, in, info, handler)
}

func _Broker_Receive_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Publication)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BrokerServer).Receive(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/byzantine.Broker/Receive",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BrokerServer).Receive(ctx, req.(*Publication))
	}
	return interceptor(ctx, in, info, handler)
}

func _Broker_Push_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(BrokerServer).Push(&brokerPushServer{stream})
}

type Broker_PushServer interface {
	Send(*Publication) error
	Recv() (*SubRequest, error)
	grpc.ServerStream
}

type brokerPushServer struct {
	grpc.ServerStream
}

func (x *brokerPushServer) Send(m *Publication) error {
	return x.ServerStream.SendMsg(m)
}

func (x *brokerPushServer) Recv() (*SubRequest, error) {
	m := new(SubRequest)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func _Broker_Chain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Publication)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BrokerServer).Chain(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/byzantine.Broker/Chain",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BrokerServer).Chain(ctx, req.(*Publication))
	}
	return interceptor(ctx, in, info, handler)
}

var _Broker_serviceDesc = grpc.ServiceDesc{
	ServiceName: "byzantine.Broker",
	HandlerType: (*BrokerServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Echo",
			Handler:    _Broker_Echo_Handler,
		},
		{
			MethodName: "RegisterSubscriber",
			Handler:    _Broker_RegisterSubscriber_Handler,
		},
		{
			MethodName: "Ready",
			Handler:    _Broker_Ready_Handler,
		},
		{
			MethodName: "Receive",
			Handler:    _Broker_Receive_Handler,
		},
		{
			MethodName: "Chain",
			Handler:    _Broker_Chain_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "GetSubscribers",
			Handler:       _Broker_GetSubscribers_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "Push",
			Handler:       _Broker_Push_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "byzantine.proto",
}

func init() { proto.RegisterFile("byzantine.proto", fileDescriptor0) }

var fileDescriptor0 = []byte{
	// 661 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcd, 0x6e, 0xd3, 0x4c,
	0x14, 0xfd, 0x9c, 0xb8, 0x69, 0x72, 0x9b, 0xf4, 0x83, 0xe9, 0x9f, 0x31, 0x08, 0xac, 0x51, 0x2b,
	0xac, 0x2e, 0xea, 0x52, 0x76, 0x45, 0x42, 0x94, 0x04, 0x4a, 0x91, 0x2a, 0xa2, 0x69, 0xc4, 0x0e,
	0x84, 0xed, 0x8c, 0x62, 0xab, 0xae, 0x27, 0x78, 0x6c, 0xa4, 0x50, 0xc1, 0x82, 0x05, 0x2f, 0xc0,
	0xa3, 0xf1, 0x0a, 0xec, 0x78, 0x09, 0xe4, 0x89, 0xc7, 0x9e, 0x14, 0x5c, 0xd8, 0xcd, 0x39, 0xbe,
	0x39, 0xe7, 0xde, 0x73, 0x67, 0x02, 0xff, 0x7b, 0xb3, 0x8f, 0x6e, 0x9c, 0x86, 0x31, 0xdd, 0x9b,
	0x26, 0x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, 0xbf, 0xf7, 0x87, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x0d, 0xe3, 0x53,
	0xea, 0x1a, 0x06, 0x00, 0x00,
}

repository: mxplusb/byzantine

repo_name: mxplusb/byzantine


text:
package builtins

type BasicObjectClass struct {
	valueStub
	classStub

	provider Provider
}

func NewBasicObjectClass(provider Provider) Class {
	o := &BasicObjectClass{}
	o.initialize()
	o.setStringer(o.String)
	o.provider = provider
	return o
}

func (c *BasicObjectClass) SetSuperClass() {
	class := c.provider.ClassProvider().ClassWithName("Class")
	if class == nil {
		panic("Expected Class class to exist")
	}
	c.class = class
}

func (obj *BasicObjectClass) String() string {
	return "BasicObject"
}

func (obj *BasicObjectClass) Name() string {
	return "BasicObject"
}

func (obj *BasicObjectClass) New(provider Provider, args ...Value) (Value, error) {
	return nil, nil
}

repository: grubby/grubby

repo_name: grubby/grubby

gha_language: Ruby


text:
@article{satyanarayanan2015edge,
  title={Edge Analytics in the Internet of Things},
  author={
    Mahadev Satyanarayanan and Pieter Simoens and Yu Xiao and
    Padmanabhan Pillai and Zhuo Chen and Kiryong Ha and
    Wenlu Hu and Brandon Amos
  },
  journal={IEEE Pervasive Computing},
  number={2},
  pages={24--31},
  _venue={IEEE Pervasive Computing},
  year={2015},
  publisher={IEEE},
  url={https://www.cs.cmu.edu/~satya/docdir/satya-edge2015.pdf},
  abstract={
    High-data-rate sensors, such as video cameras, are becoming ubiquitous in the
    Internet of Things. This article describes GigaSight, an Internet-scale
    repository of crowd-sourced video content, with strong enforcement of privacy
    preferences and access controls. The GigaSight architecture is a federated
    system of VM-based cloudlets that perform video analytics at the edge of the
    Internet, thus reducing the demand for ingress bandwidth into the cloud.
    Denaturing, which is an owner-specific reduction in fidelity of video content
    to preserve privacy, is one form of analytics on cloudlets. Content-based
    indexing for search is another form of cloudlet-based analytics. This article
    is part of a special issue on smart spaces.
  }
}

@article{turner2015bad,
  title={{{Bad Parts: Are Our Manufacturing Systems at Risk of Silent Cyberattacks?}}},
  author={Turner, Hamilton and White, Jules and Camelio, Jaime A and Williams, Christopher and Amos, Brandon and Parker, Robert},
  journal={Security \& Privacy, IEEE},
  volume={13},
  number={3},
  pages={40--47},
  _venue={IEEE Security \& Privacy},
  year={2015},
  publisher={IEEE},
  keywords={magazine},
  url={http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=7118094},
  abstract={
    Recent cyberattacks have highlighted the risk of physical equipment operating
    outside designed tolerances to produce catastrophic failures. A related
    threat is cyberattacks that change the design and manufacturing of a
    machine's part, such as an automobile brake component, so it no longer
    functions properly. These risks stem from the lack of cyber-physical models
    to identify ongoing attacks as well as the lack of rigorous application of
    known cybersecurity best practices. To protect manufacturing processes in the
    future, research will be needed on a number of critical cyber-physical
    manufacturing security topics.
  }
}

repository: bamos/cv

repo_name: bamos/cv


text:
DESCRIPTION = "Machine-specific variables for tegraflash"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "file://flashvars"

COMPATIBLE_MACHINE = "(tegra)"

S = "${WORKDIR}"

INHIBIT_DEFAULT_DEPS = "1"

do_configure[noexec] = "1"
do_compile[noexec] = "1"

do_install() {
    install -d ${D}${datadir}/tegraflash
    install -m 0644 ${S}/flashvars ${D}${datadir}/tegraflash/
}

FILES:${PN} = "${datadir}/tegraflash"
PACKAGE_ARCH = "${MACHINE_ARCH}"

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

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

gha_language: BitBake


text:
@article{Rokaya-2018-Ice-jam,
    title = "Ice-jam flood research: a scoping review",
    author = "Rokaya, Prabin  and
      Budhathoki, Sujata  and
      Lindenschmidt, Karl-Erich",
    journal = "Natural Hazards, Volume 94, Issue 3",
    volume = "94",
    number = "3",
    year = "2018",
    publisher = "Springer Science and Business Media LLC",
    url = "https://aclanthology.org/G18-111001",
    doi = "10.1007/s11069-018-3455-0",
    pages = "1439--1457",
    abstract = "",
}

repository: gwf-uwaterloo/gwf-publications

repo_name: gwf-uwaterloo/gwf-publications

gha_language: Python


text:
package datalakeanalytics

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func LookupAccount(ctx *pulumi.Context, args *LookupAccountArgs, opts ...pulumi.InvokeOption) (*LookupAccountResult, error) {
	var rv LookupAccountResult
	err := ctx.Invoke("azure-native:datalakeanalytics:getAccount", args, &rv, opts...)
	if err != nil {
		return nil, err
	}
	return &rv, nil
}

type LookupAccountArgs struct {
	AccountName       string `pulumi:"accountName"`
	ResourceGroupName string `pulumi:"resourceGroupName"`
}

type LookupAccountResult struct {
	AccountId                    string                                    `pulumi:"accountId"`
	ComputePolicies              []ComputePolicyResponse                   `pulumi:"computePolicies"`
	CreationTime                 string                                    `pulumi:"creationTime"`
	CurrentTier                  string                                    `pulumi:"currentTier"`
	DataLakeStoreAccounts        []DataLakeStoreAccountInformationResponse `pulumi:"dataLakeStoreAccounts"`
	DebugDataAccessLevel         string                                    `pulumi:"debugDataAccessLevel"`
	DefaultDataLakeStoreAccount  string                                    `pulumi:"defaultDataLakeStoreAccount"`
	Endpoint                     string                                    `pulumi:"endpoint"`
	FirewallAllowAzureIps        *string                                   `pulumi:"firewallAllowAzureIps"`
	FirewallRules                []FirewallRuleResponse                    `pulumi:"firewallRules"`
	FirewallState                *string                                   `pulumi:"firewallState"`
	HiveMetastores               []HiveMetastoreResponse                   `pulumi:"hiveMetastores"`
	Id                           string                                    `pulumi:"id"`
	LastModifiedTime             string                                    `pulumi:"lastModifiedTime"`
	Location                     string                                    `pulumi:"location"`
	MaxActiveJobCountPerUser     int                                       `pulumi:"maxActiveJobCountPerUser"`
	MaxDegreeOfParallelism       *int                                      `pulumi:"maxDegreeOfParallelism"`
	MaxDegreeOfParallelismPerJob *int                                      `pulumi:"maxDegreeOfParallelismPerJob"`
	MaxJobCount                  *int                                      `pulumi:"maxJobCount"`
	MaxJobRunningTimeInMin       int                                       `pulumi:"maxJobRunningTimeInMin"`
	MaxQueuedJobCountPerUser     int                                       `pulumi:"maxQueuedJobCountPerUser"`
	MinPriorityPerJob            int                                       `pulumi:"minPriorityPerJob"`
	Name                         string                                    `pulumi:"name"`
	NewTier                      *string                                   `pulumi:"newTier"`
	ProvisioningState            string                                    `pulumi:"provisioningState"`
	PublicDataLakeStoreAccounts  []DataLakeStoreAccountInformationResponse `pulumi:"publicDataLakeStoreAccounts"`
	QueryStoreRetention          *int                                      `pulumi:"queryStoreRetention"`
	State                        string                                    `pulumi:"state"`
	StorageAccounts              []StorageAccountInformationResponse       `pulumi:"storageAccounts"`
	SystemMaxDegreeOfParallelism int                                       `pulumi:"systemMaxDegreeOfParallelism"`
	SystemMaxJobCount            int                                       `pulumi:"systemMaxJobCount"`
	Tags                         map[string]string                         `pulumi:"tags"`
	Type                         string                                    `pulumi:"type"`
	VirtualNetworkRules          []VirtualNetworkRuleResponse              `pulumi:"virtualNetworkRules"`
}

repository: bpkgoud/pulumi-azure-native

repo_name: bpkgoud/pulumi-azure-native


text:
@Book{cook,
  author = {R. Dennis Cook},
  title = {Detection of Influential Observation in Linear Regression},
  publisher = {Taylor and Francis, Ltd.},
  year = 1977,
  url = {http://www.jstor.org/stable/1268249},
  urldate = {2016-02-28}
}

@online{weisberg,
  author = {Stanford Weisberg, R. Dennis Cook },
  title = {Residuals and Influence in Regression},
  year = 1982,
  url = {https://books.google.com/books?id=MVSqAAAAIAAJ},
  urldate = {2016-02-28}
}

@online{Barry,
author = {Barry McDonal},
title = {A Teaching Note on Cook’s Distance},
year = 2002,

OPTurl = {http://www.massey.ac.nz/~wwiims/research/letters},
OPTurldate = {2016-02-2},
}
@Book{Robert,
author = {Bollen, Kenneth; Robert W.},
title = {Modern Methods of Data Analysis},
publisher = {Newbury Park},
year = 1990,

OPTurl = {http://www.massey.ac.nz/~wwiims/research/letters},
OPTurldate = {2016-02-2},
}

@Book{DSUR,
  author = {Andy Field, Jeremy Miles, Zoë Field},
  title = {DISCOVERING STATISTICS USING R},
  publisher = {Sage Publucation, Ltd.},
  year = 2012,
  url = {http://studysites.sagepub.com/dsur/main.htm},
  urldate = {2016-02-29}
}

repository: reuf/Discovering-Statistics-Using-R

repo_name: reuf/Discovering-Statistics-Using-R


text:
/*
Copyright 2018 The Rook Authors. All rights reserved.

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 test

import (
	"fmt"
	cassandrav1alpha1 "github.com/rook/rook/pkg/apis/cassandra.rook.io/v1alpha1"
	"github.com/rook/rook/pkg/operator/cassandra/controller/util"
	corev1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime"
)

func NewSimpleCluster(members int32) *cassandrav1alpha1.Cluster {
	return &cassandrav1alpha1.Cluster{
		TypeMeta: metav1.TypeMeta{
			APIVersion: cassandrav1alpha1.APIVersion,
			Kind:       "Cluster",
		},
		ObjectMeta: metav1.ObjectMeta{
			Name:      "test-cluster",
			Namespace: "test-ns",
		},
		Spec: cassandrav1alpha1.ClusterSpec{
			Version: "3.1.11",
			Mode:    cassandrav1alpha1.ClusterModeCassandra,
			Datacenter: cassandrav1alpha1.DatacenterSpec{
				Name: "test-dc",
				Racks: []cassandrav1alpha1.RackSpec{
					{
						Name:    "test-rack",
						Members: members,
					},
				},
			},
		},
	}
}

// MemberServicesForCluster returns the member services for a given cluster
func MemberServicesForCluster(c *cassandrav1alpha1.Cluster) []runtime.Object {

	services := []runtime.Object{}
	for _, r := range c.Spec.Datacenter.Racks {
		for i := int32(0); i < c.Status.Racks[r.Name].Members; i++ {
			svc := &corev1.Service{
				ObjectMeta: metav1.ObjectMeta{
					Name:      fmt.Sprintf("%s-%s-%s-%d", c.Name, c.Spec.Datacenter.Name, r.Name, i),
					Namespace: c.Namespace,
					Labels:    util.RackLabels(r, c),
				},
			}
			services = append(services, svc)
		}
	}
	return services
}

repository: upbound/rook

repo_name: upbound/rook


text:
package withdrawal

import (
	"context"
	"fmt"
	"testing"

	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/mock"
)

type CacheMock struct {
	mock.Mock
}

func (c *CacheMock) Get(ctx context.Context, key int) map[int]int {
	args := c.Called(ctx, key)
	if res := args.Get(0); res != nil {
		return res.(map[int]int)
	}
	return nil
}

func (c *CacheMock) Set(context.Context, int, map[int]int) {}

type tCase struct {
	payload     int
	expected    map[int]int
	expectedErr error
}

var tCases = map[string]tCase{
	"Success Amount 1": {
		payload:  1,
		expected: map[int]int{1: 1},
	},
	"Success Amount 5": {
		payload:  5,
		expected: map[int]int{5: 1},
	},
	"Success Amount 10": {
		payload:  10,
		expected: map[int]int{10: 1},
	},
	"Success Amount 50": {
		payload:  50,
		expected: map[int]int{50: 1},
	},
	"Success Amount 6": {
		payload:  6,
		expected: map[int]int{5: 1, 1: 1},
	},
	"Success Amount 11": {
		payload:  11,
		expected: map[int]int{10: 1, 1: 1},
	},
	"Success Amount 51": {
		payload:  51,
		expected: map[int]int{50: 1, 1: 1},
	},
	"Success Amount 16": {
		payload:  16,
		expected: map[int]int{10: 1, 5: 1, 1: 1},
	},
	"Success Amount 66": {
		payload:  66,
		expected: map[int]int{50: 1, 10: 1, 5: 1, 1: 1},
	},
	"Success Amount 87": {
		payload:     87,
		expected:    map[int]int{50: 1, 10: 3, 5: 1, 1: 2},
		expectedErr: nil,
	},
	"Success Amount 93": {
		payload:     93,
		expected:    map[int]int{50: 1, 10: 4, 1: 3},
		expectedErr: nil,
	},
	"Success Amount 993": {
		payload:     993,
		expected:    map[int]int{50: 19, 10: 4, 1: 3},
		expectedErr: nil,
	},
}

var cache = new(CacheMock)

func TestService_ProcessAmount(t *testing.T) {
	for name, tCase := range tCases {
		cache.On("Get", mock.Anything, tCase.payload).Once().Return(nil)
		svc := New(cache)
		res := svc.ProcessAmount(context.Background(), tCase.payload)
		assert.NotNil(t, res, "shouldn't be nil", name)
		assert.Equal(t, tCase.expected, res.Coins)
		assert.Equal(t, float64(tCase.payload), res.Amount)
	}
}

func TestService_ProcessAmountWithCache(t *testing.T) {
	for name, tCase := range tCases {
		cache.On("Get", mock.Anything, tCase.payload).Once().Return(tCase.expected)
		svc := New(cache)
		res := svc.ProcessAmount(context.Background(), tCase.payload)
		assert.NotNil(t, res, "shouldn't be nil", name)
		assert.Equal(t, tCase.expected, res.Coins)
		assert.Equal(t, float64(tCase.payload), res.Amount)
	}
}

func ExampleService_ProcessAmount() {
	amount := 1987
	cache.On("Get", mock.Anything, amount).Once().Return(nil)
	svc := New(cache)
	res := svc.ProcessAmount(context.Background(), amount)
	fmt.Println(res)
	// Output: {"amount":1987,"coins":{"1":2,"10":3,"5":1,"50":39}}
}

func BenchmarkService_ProcessAmount(b *testing.B) {
	for n := 0; n < b.N; n++ {
		cache.On("Get", mock.Anything, n).Once().Return(nil)
		svc := New(cache)
		_ = svc.ProcessAmount(context.Background(), n)
	}
}

repository: Alghandour/atm-withdrawal-analisys

repo_name: Alghandour/atm-withdrawal-analisys