text:
//
//    win_registry.h
//
//    Copyright 1998 (c) Barry A. Scott
//

//
// forward declarations
//
class EmacsWinRegistry;
class EmacsWinPrintOptions;

//
// classes referenced but not defined here
//
class EmacsWinFontRegistryKeys;        // defined in the implementation module
class EmacsWinColoursRegistryKeys;    // defined in the implementation module
class EmacsWinPrintOptionsRegistryKeys;    // defined in the implementation module
class EmacsWinToolBarsRegistryKeys;    // defined in the implementation module

//================================================================================
//
//    EmacsWinFont object fully describes a font for use on windows
//
//================================================================================
class EmacsWinFont
{
public:
    EmacsWinFont();
    EmacsWinFont( const EmacsWinFont &other );
    virtual ~EmacsWinFont();
    EmacsWinFont &operator=( const EmacsWinFont &other );

    //
    //    Properties of a font
    //
    const CString &face() const;
    const CString &face( const CString &new_face);
    const CString &face( const char *new_face );

    int pointSize() const;
    int pointSize( int new_point_size );

    int fontHeight() const;
    int fontHeight( int new_font_height );
protected:
    //
    // the following functions are for use by our friends
    //
    friend class EmacsWinPrintOptions;

    void loadRegistrySettings( const EmacsWinFontRegistryKeys &keys );
    void saveRegistrySettings( const EmacsWinFontRegistryKeys &keys );
private:
    CString        m_face;
    int        m_point_size;
    int        m_font_height;
};

//================================================================================
//
//    EmacsWinColour object holds all the colours being used on the screen
//
//================================================================================
const COLORREF colour_black( RGB( 0, 0, 0 ) );
const COLORREF colour_white( RGB( 255, 255, 255 ) );

class EmacsWinColour
{
public:
    EmacsWinColour();
    EmacsWinColour( const EmacsWinColour &other );
    EmacsWinColour( const CString & );
    virtual ~EmacsWinColour();

public:
    COLORREF foreground;
    COLORREF background;
    BOOL italic;
    BOOL underline;
    CPen *pen;
    EmacsWinColour & operator=( const EmacsString & );
    EmacsWinColour & operator=( const CString & );
    EmacsWinColour & operator=( const char * );
    EmacsWinColour & operator=( const SystemExpressionRepresentationGraphicRendition & );
    EmacsWinColour & operator=( const EmacsWinColour &other );

    EmacsString colourAsString() const;

    void setColour( COLORREF fg, COLORREF bg );
private:
    EmacsWinColour & assign( const EmacsString & );
};

class EmacsWinColours
{
public:
    EmacsWinColours();
    EmacsWinColours( const EmacsWinColours &other );
    virtual ~EmacsWinColours();
    EmacsWinColours &operator=( const EmacsWinColours &other );

    //
    //    The colours as strings
    //
    EmacsWinColour windowText() const;
    EmacsWinColour windowText( const EmacsWinColour &colour );
    EmacsWinColour highlightText() const;
    EmacsWinColour highlightText( const EmacsWinColour &colour );
    EmacsWinColour modeLine() const;
    EmacsWinColour modeLine( const EmacsWinColour &colour );
    EmacsWinColour syntaxKeyword1() const;
    EmacsWinColour syntaxKeyword1( const EmacsWinColour &colour );
    EmacsWinColour syntaxKeyword2() const;
    EmacsWinColour syntaxKeyword2( const EmacsWinColour &colour );
    EmacsWinColour syntaxKeyword3() const;
    EmacsWinColour syntaxKeyword3( const EmacsWinColour &colour );
    EmacsWinColour syntaxWord() const;
    EmacsWinColour syntaxWord( const EmacsWinColour &colour );
    EmacsWinColour syntaxString1() const;
    EmacsWinColour syntaxString1( const EmacsWinColour &colour );
    EmacsWinColour syntaxString2() const;
    EmacsWinColour syntaxString2( const EmacsWinColour &colour );
    EmacsWinColour syntaxString3() const;
    EmacsWinColour syntaxString3( const EmacsWinColour &colour );
    EmacsWinColour syntaxQuote() const;
    EmacsWinColour syntaxQuote( const EmacsWinColour &colour );
    EmacsWinColour syntaxComment1() const;
    EmacsWinColour syntaxComment1( const EmacsWinColour &colour );
    EmacsWinColour syntaxComment2() const;
    EmacsWinColour syntaxComment2( const EmacsWinColour &colour );
    EmacsWinColour syntaxComment3() const;
    EmacsWinColour syntaxComment3( const EmacsWinColour &colour );
    EmacsWinColour user1() const;
    EmacsWinColour user1( const EmacsWinColour &colour );
    EmacsWinColour user2() const;
    EmacsWinColour user2( const EmacsWinColour &colour );
    EmacsWinColour user3() const;
    EmacsWinColour user3( const EmacsWinColour &colour );
    EmacsWinColour user4() const;
    EmacsWinColour user4( const EmacsWinColour &colour );
    EmacsWinColour user5() const;
    EmacsWinColour user5( const EmacsWinColour &colour );
    EmacsWinColour user6() const;
    EmacsWinColour user6( const EmacsWinColour &colour );
    EmacsWinColour user7() const;
    EmacsWinColour user7( const EmacsWinColour &colour );
    EmacsWinColour user8() const;
    EmacsWinColour user8( const EmacsWinColour &colour );
protected:
    //
    // the following functions are for use by our friends
    //
    friend class EmacsWinRegistry;

    void loadRegistrySettings( const EmacsWinColoursRegistryKeys &keys );
    void saveRegistrySettings( const EmacsWinColoursRegistryKeys &keys );
private:
    EmacsWinColour window_text;
    EmacsWinColour highlight_text;
    EmacsWinColour mode_line;
    EmacsWinColour syntax_keyword1;
    EmacsWinColour syntax_keyword2;
    EmacsWinColour syntax_keyword3;
    EmacsWinColour syntax_word;
    EmacsWinColour syntax_string1;
    EmacsWinColour syntax_string2;
    EmacsWinColour syntax_string3;
    EmacsWinColour syntax_quote;
    EmacsWinColour syntax_comment1;
    EmacsWinColour syntax_comment2;
    EmacsWinColour syntax_comment3;
    EmacsWinColour user_1;
    EmacsWinColour user_2;
    EmacsWinColour user_3;
    EmacsWinColour user_4;
    EmacsWinColour user_5;
    EmacsWinColour user_6;
    EmacsWinColour user_7;
    EmacsWinColour user_8;
};

//================================================================================
//
//    EmacsWinPrintOptions
//
//================================================================================
class EmacsWinPrintOptions
{
public:

    EmacsWinPrintOptions();
    EmacsWinPrintOptions( const EmacsWinPrintOptions &other );
    virtual ~EmacsWinPrintOptions();
    EmacsWinPrintOptions &operator=( const EmacsWinPrintOptions &other );

    //
    //    Access and update functions
    //
    const EmacsWinFont &printerDocumentFont();
    const EmacsWinFont &printerDocumentFont( const EmacsWinFont &new_font );

    const EmacsWinFont &printerHeaderFont();
    const EmacsWinFont &printerHeaderFont( const EmacsWinFont &new_font );

    const EmacsWinFont &printerFooterFont();
    const EmacsWinFont &printerFooterFont( const EmacsWinFont &new_font );

    int        topMargin() const;
    int        topMargin( int value );
    int        bottomMargin() const;
    int        bottomMargin( int value );
    int        leftMargin() const;
    int        leftMargin( int value );
    int        rightMargin() const;
    int        rightMargin( int value );
    bool        lineNumbers() const;
    bool        lineNumbers( bool value );
    bool        borders() const;
    bool        borders( bool value );
    bool        header() const;
    bool        header( bool value );
    bool        footer() const;
    bool        footer( bool value );
    bool        syntaxColour() const;
    bool        syntaxColour( bool value );
    bool        inColour() const;
    bool        inColour( bool value );
    bool        alwaysWrapLongLines() const;
    bool        alwaysWrapLongLines( bool value );

    const EmacsString &headerFormat() const;
    const EmacsString &headerFormat( const EmacsString &value );
    const EmacsString &footerFormat() const;
    const EmacsString &footerFormat( const EmacsString &value );

protected:
    //
    // the following functions are for use by our friends
    //
    friend class EmacsWinRegistry;

    void loadRegistrySettings( const EmacsWinPrintOptionsRegistryKeys &keys );
    void saveRegistrySettings( const EmacsWinPrintOptionsRegistryKeys &keys );
private:
    int        m_margin_top;
    int        m_margin_bottom;
    int        m_margin_left;
    int        m_margin_right;

    bool        m_line_numbers;
    bool        m_print_borders;
    bool        m_print_header;
    bool        m_print_footer;
    bool        m_print_syntax_colour;
    bool        m_print_in_colour;
    bool        m_always_wrap_long_lines;

    EmacsString    m_header_format;
    EmacsString    m_footer_format;

    EmacsWinFont    m_printer_document_font;
    EmacsWinFont    m_printer_header_font;
    EmacsWinFont    m_printer_footer_font;
};

//================================================================================
//
//    EmacsWinToolBars
//
//================================================================================
enum toolbar_style_t
{
    toolbar_style__mfc = 0,
    toolbar_style__ie4 = 1
};

class EmacsWinToolBarsOptions
{
public:

    EmacsWinToolBarsOptions();
    EmacsWinToolBarsOptions( const EmacsWinToolBarsOptions &other );
    virtual ~EmacsWinToolBarsOptions();
    EmacsWinToolBarsOptions &operator=( const EmacsWinToolBarsOptions &other );

    BOOL isVisible( UINT id );
    BOOL isVisible( UINT id, BOOL visible );

    toolbar_style_t toolbarStyle();
    toolbar_style_t toolbarStyle( toolbar_style_t new_style );

protected:
    //
    // the following functions are for use by our friends
    //
    friend class EmacsWinRegistry;

    void loadRegistrySettings( const EmacsWinToolBarsRegistryKeys &keys );
    void saveRegistrySettings( const EmacsWinToolBarsRegistryKeys &keys );
private:
    toolbar_style_t    m_style;

    enum { NUM_TOOLBARS=20 };    // room for lots
    BOOL m_visible[NUM_TOOLBARS];
};

//================================================================================
//
//    EmacsWinRegistry is the interface to the windows registry.
//    Use objects of this class to read and write Emacs's settings
//    from the registry.
//
//================================================================================
class EmacsWinRegistry
{
public:
    EmacsWinRegistry();
    virtual ~EmacsWinRegistry();

    //
    //    Registry control
    //
    void loadRegistrySettings();
    void saveRegistrySettings();

    //
    //    Access and update functions
    //
    const EmacsWinPrintOptions &printOptions();
    const EmacsWinPrintOptions &printOptions( const EmacsWinPrintOptions &new_print_options );

    const EmacsWinColours &displayColours();
    const EmacsWinColours &displayColours( const EmacsWinColours &new_colours );

    const EmacsWinToolBarsOptions &toolBars();
    const EmacsWinToolBarsOptions &toolBars( const EmacsWinToolBarsOptions &new_toolbars );

    //
    //    Convenience functions
    //
    enum units { units__inch = 1, units__mm };
    static units measurementUnits();
private:
    EmacsWinPrintOptions    m_print_options;
    EmacsWinColours        m_display_colours;
    EmacsWinToolBarsOptions    m_toolbars;

    // these two are not implemented - just hidden to prevent compiler default being generated
    EmacsWinRegistry &operator=( const EmacsWinRegistry & );
    EmacsWinRegistry( const EmacsWinRegistry & );
};

repository: barry-scott/BarrysEmacs

repo_name: barry-scott/BarrysEmacs

extension: h


text:
// Copyright 2020-present Open Networking Foundation.
//
// 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 release

import (
	"github.com/onosproject/helm-go/pkg/helm/config"
	"github.com/onosproject/helm-go/pkg/helm/values"
	"helm.sh/helm/v3/pkg/action"
	"helm.sh/helm/v3/pkg/chart/loader"
	"helm.sh/helm/v3/pkg/cli"
	"helm.sh/helm/v3/pkg/downloader"
	"helm.sh/helm/v3/pkg/getter"
	"helm.sh/helm/v3/pkg/storage/driver"
	"os"
	"time"
)

// UpgradeRequest is a release upgrade request
type UpgradeRequest struct {
	client       Client
	config       *config.Config
	name         string
	chart        string
	repo         string
	caFile       string
	keyFile      string
	certFile     string
	username     string
	password     string
	version      string
	values       *values.Values
	disableHooks bool
	dryRun       bool
	atomic       bool
	wait         bool
	timeout      time.Duration
}

func (r *UpgradeRequest) CaFile(caFile string) *UpgradeRequest {
	r.caFile = caFile
	return r
}

func (r *UpgradeRequest) KeyFile(keyFile string) *UpgradeRequest {
	r.keyFile = keyFile
	return r
}

func (r *UpgradeRequest) CertFile(certFile string) *UpgradeRequest {
	r.certFile = certFile
	return r
}

func (r *UpgradeRequest) Username(username string) *UpgradeRequest {
	r.username = username
	return r
}

func (r *UpgradeRequest) Password(password string) *UpgradeRequest {
	r.password = password
	return r
}

func (r *UpgradeRequest) Repo(url string) *UpgradeRequest {
	r.repo = url
	return r
}

func (r *UpgradeRequest) Version(version string) *UpgradeRequest {
	r.version = version
	return r
}

func (r *UpgradeRequest) Set(path string, value interface{}) *UpgradeRequest {
	r.values.Set(path, value)
	return r
}

func (r *UpgradeRequest) DisableHooks() *UpgradeRequest {
	r.disableHooks = true
	return r
}

func (r *UpgradeRequest) DryRun() *UpgradeRequest {
	r.dryRun = true
	return r
}

func (r *UpgradeRequest) Atomic() *UpgradeRequest {
	r.atomic = true
	return r
}

func (r *UpgradeRequest) Wait() *UpgradeRequest {
	r.wait = true
	return r
}

func (r *UpgradeRequest) Timeout(timeout time.Duration) *UpgradeRequest {
	r.timeout = timeout
	return r
}

func (r *UpgradeRequest) Do() (*Release, error) {
	upgrade := action.NewUpgrade(r.config.Configuration)

	// Setup the repo options
	upgrade.RepoURL = r.repo
	upgrade.Username = r.username
	upgrade.Password = r.password
	upgrade.CaFile = r.caFile
	upgrade.KeyFile = r.keyFile
	upgrade.CertFile = r.certFile

	// Setup the chart options
	upgrade.Version = r.version

	// Setup the release options
	upgrade.Namespace = r.client.Namespace()
	upgrade.Atomic = r.atomic
	upgrade.DryRun = r.dryRun
	upgrade.DisableHooks = r.disableHooks
	upgrade.Wait = r.wait
	upgrade.Timeout = r.timeout

	// Locate the chart path
	path, err := upgrade.ChartPathOptions.LocateChart(r.chart, r.config.EnvSettings)
	if err != nil {
		return nil, err
	}

	// Check chart dependencies to make sure all are present in /charts
	chart, err := loader.Load(path)
	if err != nil {
		return nil, err
	}

	ctx := config.GetContext().Release(r.name)
	values := r.values.Normalize().Override(values.New(ctx.Values.Values()))

	if upgrade.Install {
		// If a release does not exist, install it. If another error occurs during
		// the check, ignore the error and continue with the upgrade.
		histClient := action.NewHistory(r.config.Configuration)
		histClient.Max = 1
		if _, err := histClient.Run(r.name); err == driver.ErrReleaseNotFound {
			install := action.NewInstall(r.config.Configuration)
			install.ChartPathOptions = upgrade.ChartPathOptions
			install.DryRun = upgrade.DryRun
			install.DisableHooks = upgrade.DisableHooks
			install.Timeout = upgrade.Timeout
			install.Wait = upgrade.Wait
			install.Devel = upgrade.Devel
			install.Namespace = upgrade.Namespace
			install.Atomic = upgrade.Atomic
			install.PostRenderer = upgrade.PostRenderer

			if req := chart.Metadata.Dependencies; req != nil {
				// If CheckDependencies returns an error, we have unfulfilled dependencies.
				// As of Helm 2.4.0, this is treated as a stopping condition:
				// https://github.com/helm/helm/issues/2209
				if err := action.CheckDependencies(chart, req); err != nil {
					if install.DependencyUpdate {
						man := &downloader.Manager{
							Out:              os.Stdout,
							ChartPath:        path,
							Keyring:          install.ChartPathOptions.Keyring,
							SkipUpdate:       false,
							Getters:          getter.All(cli.New()),
							RepositoryConfig: r.config.EnvSettings.RepositoryConfig,
							RepositoryCache:  r.config.EnvSettings.RepositoryCache,
						}
						if err := man.Update(); err != nil {
							return nil, err
						}
					} else {
						return nil, err
					}
				}
			}

			_, err = install.Run(chart, values.Values())
			return nil, err
		}
	}

	release, err := upgrade.Run(r.name, chart, values.Values())
	if err != nil {
		return nil, err
	}
	return getRelease(r.config, release)
}

repository: tsingloon/helm-go

license_type: permissive

repo_name: tsingloon/helm-go

branch_name: refs/heads/master

extension: go


text:
@Article{bonkowska2008relationship,
  title = {Relationship between the selection pressure and the rate of mutation accumulation},
  author = {Katarzyna Bo{\a'n}kowska and Przemys{\l}aw Biecek and Agnieszka {\L}aszkiewicz and Stanis{\l}aw Cebrat},
  journal = {Banach Center Publications},
  volume = {1},
  number = {80},
  pages = {223--228},
  year = {2008},
}

license: MIT

gha_license_id: MIT

extension: bib


text:
// @HEADER
// ************************************************************************
//
//           Galeri: Finite Element and Matrix Generation Package
//                 Copyright (2006) ETHZ/Sandia Corporation
//
// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
// license for use of this work by or on behalf of the U.S. Government.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of the Corporation nor the names of the
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Questions about Galeri? Contact Marzio Sala (marzio.sala _AT_ gmail.com)
//
// ************************************************************************
// @HEADER

#include "GaleriExt_CrsMatrices.h"
#include "Galeri_Exception.h"
#include "Teuchos_ParameterList.hpp"

#include "GaleriExt_Darcy2D.h"
#include "GaleriExt_Darcy3D.h"
#include "GaleriExt_Stokes2D.h"
#include "GaleriExt_Stokes3D.h"

class Epetra_CrsMatrix;
class Epetra_Map;

namespace GaleriExt {

Epetra_CrsMatrix*
CreateCrsMatrix(std::string const &MatrixType, const Epetra_Map* Map,
                Teuchos::ParameterList& List)
{
  // =============== //
  // MATLAB MATRICES //
  // =============== //
  //

  // ========================== //
  // FINITE DIFFERENCE MATRICES //
  // ========================== //
  if (MatrixType == "Darcy2D")
  {
    int nx = List.get("nx", -1);
    int ny = List.get("ny", -1);

    double a = List.get("a", 1.0);
    double b = List.get("b", 1.0);

    return(Matrices::Darcy2D(Map, nx, ny, a, b));
  }
  else if (MatrixType == "Stokes2D")
  {
    int nx = List.get("nx", -1);
    int ny = List.get("ny", -1);

    double a = List.get("a", (double)nx);
    double b = List.get("b", 1.0);

    return(Matrices::Stokes2D(Map, nx, ny, a, b));
  }
  else if (MatrixType == "Darcy3D")
  {
    int nx = List.get("nx", -1);
    int ny = List.get("ny", -1);
    int nz = List.get("nz", -1);

    double a = List.get("a", 1.0);
    double b = List.get("b", 1.0);

    return(Matrices::Darcy3D(Map, nx, ny, nz, a, b));
  }
  else if (MatrixType == "Stokes3D")
  {
    int nx = List.get("nx", -1);
    int ny = List.get("ny", -1);
    int nz = List.get("nz", -1);

    double a = List.get("a", (double)nx);
    double b = List.get("b", 1.0);

    return(Matrices::Stokes3D(Map, nx, ny, nz, a, b));
  }
  else
  {
    throw(Galeri::Exception(__FILE__, __LINE__,
                    "`MatrixType' has incorrect value (" + MatrixType + ")",
                    "in input to function CreateMatrix()",
                    "Check the documentation for a list of valid choices"));
  }
} // CreateMatrix()

} // namespace Galeri

repository: nlesc-smcm/hymls

repo_name: nlesc-smcm/hymls

extension: cpp


text:
DESCRIPTION = "This modules handles International Standard Book Numbers, including ISBN-10 \
and ISBN-13."

SECTION = "libs"
LICENSE = "Artistic-2.0"
PR = "r0"

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

LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Artistic-2.0;md5=8bbc66f0ba93cec26ef526117e280266"

SRC_URI = "https://cpan.metacpan.org/authors/id/B/BD/BDFOY/Business-ISBN-3.007.tar.gz"

SRC_URI[md5sum] = "6270020dc5a2e3ae7264ef4e4d4fb344"
SRC_URI[sha256sum] = "50cc4686dd21c9537b49a231d71711e814ebd2f19aa4ca331baf92ff2de5ce19"
RDEPENDS:${PN} += "business-isbn-data-perl"

S = "${WORKDIR}/Business-ISBN-${PV}"

inherit cpan allarch

BBCLASSEXTEND = "native"

repository: rehsack/meta-cpan

repo_name: rehsack/meta-cpan

gha_language: BitBake

extension: bb


text:
package cmd

import (
	"fmt"
	"os"

	"github.com/hekmon/transmissionrpc"
	"github.com/shric/trpc/internal/filter"
	"github.com/shric/trpc/internal/util"
)

type rmOptions struct {
	torrentOptions
	filter.Options `group:"filters"`
	ForceAll       bool `long:"force-all" description:"Really allow all torrents to be removed"`
	Nuke           bool `long:"nuke" description:"Delete the data associated with the torrent"`
}

// Rm implements the rm command.
func Rm(c *Command) {
	opts, ok := c.Options.(rmOptions)
	optionsCheck(ok)

	if len(opts.Pos.Torrents) == 0 && !opts.ForceAll {
		fmt.Fprintln(os.Stderr, "Use --force-all if you really want to delete all torrents!")
		return
	}

	util.ProcessTorrents(c.Client, opts.Options, opts.Pos.Torrents, commonArgs[:],
		func(torrent *transmissionrpc.Torrent) {
			if !c.CommonOptions.DryRun {
				err := c.Client.TorrentRemove(&transmissionrpc.TorrentRemovePayload{
					IDs:             []int64{*torrent.ID},
					DeleteLocalData: opts.Nuke,
				})
				if err != nil {
					fmt.Fprintln(os.Stderr, err)
					os.Exit(1)
					return
				}
			}
			c.status("Removed torrent", torrent)
		}, nil, false)
}

repository: shric/trpc

repo_name: shric/trpc

gha_language: Go


text:
inherit cross-canadian

SUMMARY = "Links to the various GNU toolchains for use with the Xilinx multilib toolchain"
PN = "gnu-toolchain-canadian-${TARGET_SYS}"
BPN = "gnu-toolchain-canadian"

LICENSE = "MIT"

do_install () {
	if [ "${TARGET_SYS_MULTILIB_ORIGINAL}" != "" -a "${TARGET_SYS_MULTILIB_ORIGINAL}" != "${TARGET_SYS}" ]; then
		mkdir -p ${D}${bindir}

		# Create a link for each item references by the environment files
		for each in gcc g++ as ld gdb strip ranlib objcopy objdump readelf ar nm ; do
			ln -s ../${TARGET_SYS_MULTILIB_ORIGINAL}/${TARGET_SYS_MULTILIB_ORIGINAL}-${each} ${D}${bindir}/${TARGET_SYS}-$each
		done
	fi
}

INHIBIT_DEFAULT_DEPS = "1"

ALLOW_EMPTY:${PN} = "1"
FILES:${PN} = "${bindir}"

PACKAGES = "${PN}"

repository: fullstackfpga/meta-xilinx

repo_name: fullstackfpga/meta-xilinx


text:
// Copyright 2020 the Drone Authors. All rights reserved.
// Use of this source code is governed by the Blue Oak Model License
// that can be found in the LICENSE file.

package plugin

import (
	"fmt"
	"regexp"
	"strings"
)

// helper function to extract the issue number from
// the commit details, including the commit message,
// branch and pull request title.
func extractIssue(args Args) string {
	return regexp.MustCompile(args.Project + "\\-\\d+").FindString(
		fmt.Sprintln(
			args.Commit.Message,
			args.PullRequest.Title,
			args.Commit.Source,
			args.Commit.Target,
		),
	)
}

// helper function determines the pipeline name.
func toPipeline(args Args) string {
	if v := args.Name; v != "" {
		return v
	}
	return args.Stage.Name
}

// helper function determines the pipeline state.
func toState(args Args) string {
	if v := args.State; v != "" {
		return toStateEnum(v)
	}
	return toStateEnum(args.Build.Status)
}

// helper function determines the target environment.
func toEnvironment(args Args) string {
	if v := args.Environment; v != "" {
		return toEnvironmentEnum(v)
	}
	if v := args.Deploy.Target; v != "" {
		return toEnvironmentEnum(v)
	}
	// default environment if none specified.
	return "production"
}

// helper function determines the version number.
func toVersion(args Args) string {
	if v := args.Semver.Version; v != "" {
		return v
	}
	if v := args.Tag.Name; v != "" {
		return v
	}
	return args.Commit.Rev
}

// helper function provides a deeplink to the build
// or a fallback link to the commit in version control.
func toLink(args Args) string {
	if v := args.Link; v != "" {
		return v
	}
	if v := args.Build.Link; v != "" {
		return v
	}
	return args.Commit.Link
}

// helper function normalizes the environment to match
// the expected bitbucket enum.
func toEnvironmentEnum(s string) string {
	switch strings.ToLower(s) {
	case "prod", "production":
		return "production"
	case "stage", "staging":
		return "staging"
	case "dev", "development":
		return "development"
	case "testing", "test":
		return "testing"
	default:
		return "unmapped"
	}
}

// helper function normalizes the state to match
// the expected bitbucket enum.
func toStateEnum(s string) string {
	switch strings.ToLower(s) {
	case "pending", "waiting":
		return "pending"
	case "running", "in_progress":
		return "in_progress"
	case "cancelled", "killed", "stopped", "terminated":
		return "cancelled"
	case "failed", "failure", "error", "errored":
		return "failed"
	case "rollback", "rolled_back":
		return "rolled_back"
	case "success", "successful":
		return "successful"
	default:
		return "unknown"
	}
}


text:
KBRANCH ?= "dev-5.0"
LINUX_VERSION ?= "5.0.13"

SRCREV="8540490ed654f0c799277f843758f533d1ad7a55"

require linux-nuvoton.inc

repository: dkodihal/openbmc

repo_name: dkodihal/openbmc

gha_license_id: NOASSERTION


text:
package txmgr

import (
	"context"
	"errors"
	"fmt"
	"time"

	clienttypes "github.com/smartcontractkit/chainlink/v2/common/chains/client"
	feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types"
	txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types"
	"github.com/smartcontractkit/chainlink/v2/common/types"
	"github.com/smartcontractkit/chainlink/v2/core/chains/evm/label"
	"github.com/smartcontractkit/chainlink/v2/core/logger"
	"github.com/smartcontractkit/chainlink/v2/core/utils"
)

const (
	// pollInterval is the maximum amount of time in addition to
	// TxResendAfterThreshold that we will wait before resending an attempt
	DefaultResenderPollInterval = 5 * time.Second

	// Alert interval for unconfirmed transaction attempts
	unconfirmedTxAlertLogFrequency = 2 * time.Minute

	// timeout value for batchSendTransactions
	batchSendTransactionTimeout = 30 * time.Second
)

// Resender periodically picks up transactions that have been languishing
// unconfirmed for a configured amount of time without being sent, and sends
// their highest priced attempt again. This helps to defend against geth/parity
// silently dropping txes, or txes being ejected from the mempool.
//
// Previously we relied on the bumper to do this for us implicitly but there
// can occasionally be problems with this (e.g. abnormally long block times, or
// if gas bumping is disabled)
type Resender[
	CHAIN_ID types.ID,
	ADDR types.Hashable,
	TX_HASH types.Hashable,
	BLOCK_HASH types.Hashable,
	SEQ types.Sequence,
	FEE feetypes.Fee,
] struct {
	txStore             txmgrtypes.TransactionStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, SEQ, FEE]
	client              txmgrtypes.TransactionClient[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]
	ks                  txmgrtypes.KeyStore[ADDR, CHAIN_ID, SEQ]
	chainID             CHAIN_ID
	interval            time.Duration
	config              txmgrtypes.ResenderChainConfig
	txConfig            txmgrtypes.ResenderTransactionsConfig
	logger              logger.Logger
	lastAlertTimestamps map[string]time.Time

	ctx    context.Context
	cancel context.CancelFunc
	chDone chan struct{}
}

func NewResender[
	CHAIN_ID types.ID,
	ADDR types.Hashable,
	TX_HASH types.Hashable,
	BLOCK_HASH types.Hashable,
	SEQ types.Sequence,
	FEE feetypes.Fee,
](
	lggr logger.Logger,
	txStore txmgrtypes.TransactionStore[ADDR, CHAIN_ID, TX_HASH, BLOCK_HASH, SEQ, FEE],
	client txmgrtypes.TransactionClient[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE],
	ks txmgrtypes.KeyStore[ADDR, CHAIN_ID, SEQ],
	pollInterval time.Duration,
	config txmgrtypes.ResenderChainConfig,
	txConfig txmgrtypes.ResenderTransactionsConfig,
) *Resender[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] {
	if txConfig.ResendAfterThreshold() == 0 {
		panic("Resender requires a non-zero threshold")
	}
	// todo: add context to txStore https://smartcontract-it.atlassian.net/browse/BCI-1585
	ctx, cancel := context.WithCancel(context.Background())
	return &Resender[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]{
		txStore,
		client,
		ks,
		client.ConfiguredChainID(),
		pollInterval,
		config,
		txConfig,
		lggr.Named("Resender"),
		make(map[string]time.Time),
		ctx,
		cancel,
		make(chan struct{}),
	}
}

// Start is a comment which satisfies the linter
func (er *Resender[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Start() {
	er.logger.Debugf("Enabled with poll interval of %s and age threshold of %s", er.interval, er.txConfig.ResendAfterThreshold())
	go er.runLoop()
}

// Stop is a comment which satisfies the linter
func (er *Resender[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Stop() {
	er.cancel()
	<-er.chDone
}

func (er *Resender[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) runLoop() {
	defer close(er.chDone)

	if err := er.resendUnconfirmed(); err != nil {
		er.logger.Warnw("Failed to resend unconfirmed transactions", "err", err)
	}

	ticker := time.NewTicker(utils.WithJitter(er.interval))
	defer ticker.Stop()
	for {
		select {
		case <-er.ctx.Done():
			return
		case <-ticker.C:
			if err := er.resendUnconfirmed(); err != nil {
				er.logger.Warnw("Failed to resend unconfirmed transactions", "err", err)
			}
		}
	}
}

func (er *Resender[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) resendUnconfirmed() error {
	enabledAddresses, err := er.ks.EnabledAddressesForChain(er.chainID)
	if err != nil {
		return fmt.Errorf("Resender failed getting enabled keys for chain %s: %w", er.chainID.String(), err)
	}
	ageThreshold := er.txConfig.ResendAfterThreshold()
	maxInFlightTransactions := er.txConfig.MaxInFlight()
	olderThan := time.Now().Add(-ageThreshold)
	var allAttempts []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]
	for _, k := range enabledAddresses {
		var attempts []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]
		attempts, err = er.txStore.FindTxAttemptsRequiringResend(olderThan, maxInFlightTransactions, er.chainID, k)
		if err != nil {
			return fmt.Errorf("failed to FindTxAttemptsRequiringResend: %w", err)
		}
		er.logStuckAttempts(attempts, k)

		allAttempts = append(allAttempts, attempts...)
	}

	if len(allAttempts) == 0 {
		for k := range er.lastAlertTimestamps {
			er.lastAlertTimestamps[k] = time.Now()
		}
		return nil
	}
	er.logger.Infow(fmt.Sprintf("Re-sending %d unconfirmed transactions that were last sent over %s ago. These transactions are taking longer than usual to be mined. %s", len(allAttempts), ageThreshold, label.NodeConnectivityProblemWarning), "n", len(allAttempts))

	batchSize := int(er.config.RPCDefaultBatchSize())
	ctx, cancel := context.WithTimeout(er.ctx, batchSendTransactionTimeout)
	defer cancel()
	txErrTypes, _, broadcastTime, txIDs, err := er.client.BatchSendTransactions(ctx, allAttempts, batchSize, er.logger)

	// update broadcast times before checking additional errors
	if len(txIDs) > 0 {
		if updateErr := er.txStore.UpdateBroadcastAts(broadcastTime, txIDs); updateErr != nil {
			err = errors.Join(err, fmt.Errorf("failed to update broadcast time: %w", updateErr))
		}
	}
	if err != nil {
		return fmt.Errorf("failed to re-send transactions: %w", err)
	}
	logResendResult(er.logger, txErrTypes)

	return nil
}

func logResendResult(lggr logger.Logger, codes []clienttypes.SendTxReturnCode) {
	var nNew int
	var nFatal int
	for _, c := range codes {
		if c == clienttypes.Successful {
			nNew++
		} else if c == clienttypes.Fatal {
			nFatal++
		}
	}
	lggr.Debugw("Completed", "n", len(codes), "nNew", nNew, "nFatal", nFatal)
}

func (er *Resender[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) logStuckAttempts(attempts []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], fromAddress ADDR) {
	if time.Since(er.lastAlertTimestamps[fromAddress.String()]) >= unconfirmedTxAlertLogFrequency {
		oldestAttempt, exists := findOldestUnconfirmedAttempt(attempts)
		if exists {
			// Wait at least 2 times the TxResendAfterThreshold to log critical with an unconfirmedTxAlertDelay
			if time.Since(oldestAttempt.CreatedAt) > er.txConfig.ResendAfterThreshold()*2 {
				er.lastAlertTimestamps[fromAddress.String()] = time.Now()
				er.logger.Errorw("TxAttempt has been unconfirmed for more than max duration", "maxDuration", er.txConfig.ResendAfterThreshold()*2,
					"txID", oldestAttempt.TxID, "txFee", oldestAttempt.TxFee,
					"BroadcastBeforeBlockNum", oldestAttempt.BroadcastBeforeBlockNum, "Hash", oldestAttempt.Hash, "fromAddress", fromAddress)
			}
		}
	}
}

func findOldestUnconfirmedAttempt[
	CHAIN_ID types.ID,
	ADDR types.Hashable,
	TX_HASH, BLOCK_HASH types.Hashable,
	SEQ types.Sequence,
	FEE feetypes.Fee,
](attempts []txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) (txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], bool) {
	var oldestAttempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]
	if len(attempts) < 1 {
		return oldestAttempt, false
	}
	oldestAttempt = attempts[0]
	for i := 1; i < len(attempts); i++ {
		if oldestAttempt.CreatedAt.Sub(attempts[i].CreatedAt) <= 0 {
			oldestAttempt = attempts[i]
		}
	}
	return oldestAttempt, true
}

repository: smartcontractkit/chainlink

repo_name: smartcontractkit/chainlink

branch_name: refs/heads/develop


text:
package handling

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"io/ioutil"
	"reflect"

	"github.com/gotgo/fw/util"
	"github.com/gotgo/resti/rest"
	"github.com/gotgo/retrace"
)

type ContentTypeDecoders struct {
	library map[string]*ContentTypeDecoder
}

func NewContentTypeDecoders() *ContentTypeDecoders {
	cd := &ContentTypeDecoders{
		library: make(map[string]*ContentTypeDecoder),
	}

	//add defaults
	json := &ContentTypeDecoder{
		ContentType: "application/json",
		Decode:      JsonDecoder,
	}
	cd.library[json.ContentType] = json
	return cd
}

func JsonDecoder(reader io.Reader, v interface{}, trace retrace.Tracer) error {
	if bytes, err := ioutil.ReadAll(reader); err != nil {
		return err
	} else if err = json.Unmarshal(bytes, &v); err != nil {
		return err
	} else {
		trace.Annotate(retrace.FromRequestData, "body", fmt.Sprintf("%s", bytes))
		return nil
	}
}

func (cd *ContentTypeDecoders) Get(types []string) *ContentTypeDecoder {
	for _, t := range types {
		decoder := cd.library[t]
		if decoder != nil {
			return decoder
		}
	}
	return nil
}

func (cd *ContentTypeDecoders) Set(decoder *ContentTypeDecoder) {
	cd.library[decoder.ContentType] = decoder
}

func containsType(s []string, c string) bool {
	for _, a := range s {
		if a == c {
			return true
		}
	}
	return false
}

func isBytes(t reflect.Type) bool {
	var b byte
	bt := reflect.TypeOf(b)

	if t.Kind() == reflect.Ptr {
		t = t.Elem()
	}

	switch t.Kind() {
	case reflect.Slice, reflect.Array:
		return t.Elem() == bt
	default:
		return false
	}
}

func (cd *ContentTypeDecoders) DecodeBody(req *rest.Request, trace retrace.Tracer) error {
	switch req.Raw.Method {
	case "GET", "DELETE", "HEAD":
		return nil
	}

	ctype := req.Raw.Header["Content-Type"]
	decoder := cd.Get(ctype)

	//new empty instance
	body := req.Definition.RequestBody()

	var bts []byte
	var err error

	if bts, err = req.Bytes(); err != nil {
		return err
	}

	if body != nil {

		if isBytes(reflect.TypeOf(body)) {
			//if body type is castable to []byte, then we don't encode, just set directly
			req.Body = bts
			return nil
		} else if decoder != nil {
			decoder.Decode(bytes.NewReader(bts), &body, trace)
			req.Body = body
		} else if containsType(ctype, "application/x-www-form-urlencoded") {
			req.Raw.ParseForm()
			if err := util.MapHeaderToStruct(req.Raw.Form, &body); err != nil {
				return err
			}
			trace.Annotate(retrace.FromRequestData, "body", fmt.Sprintf("%+v", body))
			req.Body = body
		} else {
			if err = json.Unmarshal(bts, &body); err != nil {
				return err
			}
			trace.Annotate(retrace.FromRequestData, "body", fmt.Sprintf("%s", bts))
			req.Body = body
		}
	}
	return nil
}

repository: gotgo/resti

repo_name: gotgo/resti


text:
require tegra-binaries-${PV}.inc
require tegra-shared-binaries.inc

DESCRIPTION = "Miscellaneous tools provided by L4T"

do_configure() {
    tar -C ${B} -x -f ${S}/nv_tegra/nv_tools.tbz2
}

do_compile[noexec] = "1"

do_install() {
    install -d ${D}${bindir}
    install -m 0755 ${B}/usr/bin/tegrastats ${D}${bindir}/
    install -m 0755 ${B}/usr/bin/jetson_clocks ${D}${bindir}/
}

PACKAGES = "${PN}-tegrastats ${PN}-jetson-clocks ${PN}"
ALLOW_EMPTY:${PN} = "1"
RDEPENDS:${PN} = "${PN}-tegrastats ${PN}-jetson-clocks"
FILES:${PN}-tegrastats = "${bindir}/tegrastats"
INSANE_SKIP:${PN}-tegrastats = "ldflags"
FILES:${PN}-jetson-clocks = "${bindir}/jetson_clocks"
RDEPENDS:${PN}-jetson-clocks = "bash"

repository: llewellyn-evo/meta-tegra

repo_name: llewellyn-evo/meta-tegra


text:
package appgate

import (
	"math/rand"
	"os"
	"testing"

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

const (
	// CharSetAlphaNum is the alphanumeric character set for use with
	// RandStringFromCharSet
	CharSetAlphaNum = "abcdefghijklmnopqrstuvwxyz012346789"

	// CharSetAlpha is the alphabetical character set for use with
	// RandStringFromCharSet
	CharSetAlpha = "abcdefghijklmnopqrstuvwxyz"
)

var testAccProviders map[string]terraform.ResourceProvider
var testAccProvider *schema.Provider

func init() {
	testAccProvider = Provider().(*schema.Provider)
	testAccProviders = map[string]terraform.ResourceProvider{
		"appgate": testAccProvider,
	}
}

// RandStringFromCharSet generates a random string by selecting characters from
// the charset provided
func RandStringFromCharSet(strlen int, charSet string) string {
	result := make([]byte, strlen)
	for i := 0; i < strlen; i++ {
		result[i] = charSet[rand.Intn(len(charSet))]
	}
	return string(result)
}

func TestProvider(t *testing.T) {
	if err := Provider().(*schema.Provider).InternalValidate(); err != nil {
		t.Fatalf("err: %s", err)
	}
}

func testAccPreCheck(t *testing.T) {
	if v := os.Getenv("APPGATE_ADDRESS"); v == "" {
		t.Fatal("APPGATE_ADDRESS must be set for acceptance tests")
	}
	if v := os.Getenv("APPGATE_USERNAME"); v == "" {
		t.Fatal("APPGATE_USERNAME must be set for acceptance tests")
	}
	if v := os.Getenv("APPGATE_PASSWORD"); v == "" {
		t.Fatal("APPGATE_PASSWORD must be set for acceptance tests")
	}
}

repository: jorson-chen/sdp-terraform-provider

repo_name: jorson-chen/sdp-terraform-provider


text:
if(NOT OGS_USE_MPI)
    OgsTest(PROJECTFILE Parabolic/RichardsComponentTransport/Padilla/Padilla_NaCl1/Padilla_NaCl1.prj RUNTIME 7)
    OgsTest(PROJECTFILE Parabolic/RichardsComponentTransport/Padilla/Padilla_NaCl1/Padilla_NaCl1_quadratic.prj RUNTIME 7)
    OgsTest(PROJECTFILE Parabolic/RichardsComponentTransport/Padilla/Padilla_NaCl6/Padilla_NaCl6.prj RUNTIME 13)
endif()

repository: ufz/ogs

repo_name: ufz/ogs

extension: cmake


text:
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

LICENSE = "CLOSED"
DESCRIPTION = "Firmware files for use with ON semi AP1302"

SRC_URI = "file://ap1302_ar0144_dual_fw.bin \
           file://ap1302_ar0144_single_fw.bin \
           file://ap1302_ar1335_single_fw.bin \
"

do_install() {
    install -d ${D}${base_libdir}/firmware
    install -m 0755 ${WORKDIR}/ap1302_ar0144_dual_fw.bin ${D}${base_libdir}/firmware
    install -m 0755 ${WORKDIR}/ap1302_ar0144_single_fw.bin ${D}${base_libdir}/firmware
    install -m 0755 ${WORKDIR}/ap1302_ar1335_single_fw.bin ${D}${base_libdir}/firmware
}

FILES_${PN} = "${base_libdir}/firmware/ap1302_ar0144_dual_fw.bin \
               ${base_libdir}/firmware/ap1302_ar0144_single_fw.bin \
               ${base_libdir}/firmware/ap1302_ar1335_single_fw.bin \
"

repository: ocucat/meta-on-semiconductor

repo_name: ocucat/meta-on-semiconductor


text:
/////////////////////////////////////////////////////////////////////
// Quantum Event Pool class implementation (C++ version)
// Copyright (c) 2002 Miro Samek, Palo Alto, CA.
// All Rights Reserved.
/////////////////////////////////////////////////////////////////////
#include "qassert.h"
#include "port.h"

DEFINE_THIS_FILE;

//...................................................................
void QEPool::init(QEvent *poolSto, unsigned nEvts, unsigned evtSize){
   REQUIRE(nEvts > 0 && evtSize >= sizeof(QEvent));
   myFree =  poolSto;       // set head of linked-list of free events
   myEvtSize = evtSize;           // store maximum size of each event
   myNtot = nEvts;                    // store total number of events
   myNfree = nEvts;                    // store number of free events
   myNmin = nEvts;    // initialize the minimum number of free events
   register char *block = (char *)poolSto;
   while (--nEvts) {          // chain all blocks in the free-list...
      *(void **)block = (void *)(block + evtSize);    // set the link
      block += evtSize;                      // advance to next block
   }
   *(void **)block = 0;                      // last link points to 0
}
//...................................................................
QEvent *QEPool::get() {
   register QEvent *e;
   QF_PROTECT();
   if (myNfree > 0) {                       // free events available?
      e = (QEvent *)myFree;                         // get free event
      myFree = *(void **)e;        // adjust pointer to new free list
      if (--myNfree < myNmin) {        // one less event in this pool
          myNmin = myNfree;            // remember the minimum so far
      }
   }
   else {
      e = 0;
   }
   QF_UNPROTECT();
   return e;            // return event or NULL pointer to the caller
}
//...................................................................
void QEPool::put(QEvent *e) {
   QF_PROTECT();
   REQUIRE(myNfree < myNtot);     // # of free events must be < total
   *(void **)e = myFree;      // insert released event into free list
   myFree = e;                    // set as new head of the free list
   ++myNfree;                          // one more event in this pool
   QF_UNPROTECT();
}

license: Unlicense

repository: hyller/GladiatorLibrary

repo_name: hyller/GladiatorLibrary

gha_license_id: Unlicense

gha_language: C


text:
using System;
using System.Collections.Generic;
using oop_2021.replay;
using oop_2021.utility;
using Xunit;

namespace oop_2021.Test

{
    public class ReplayTest
    {

        [Fact]
        public void ReplayTest1()
        {
            ReplayData replay = new ReplayDataBuilder()
                .Date(DateTime.Now)
                .GameType(new GameType())
                .MatchId("10")
                .WhiteUser(new User())
                .BlackUser(new User())
                .Boards(new List<Board>())
                .Build();
            Assert.Equal("10", replay.MatchId);
        }

        [Fact]
        public void ReplayTest2()
        {
            ReplayData replay = new ReplayDataBuilder()
                .Date(DateTime.Now)
                .GameType(new GameType())
                .MatchId("10")
                .WhiteUser(new User())
                .BlackUser(new User())
                .Boards(new List<Board>())
                .Build();

            ISavedReplay myReplay = new SavedReplayInRam();
            myReplay.Save(replay);
            Assert.Equal("10", myReplay.GetSavedReplay("10").MatchId);
        }

    }
}

branch_name: refs/heads/main

extension: cs


text:
@PACKAGE_INIT@

list(APPEND CMAKE_MODULE_PATH "${CURRENT_LIST_DIR}/Modules")

set(SeerepCore_INCLUDE_DIRS @PACKAGE_CMAKE_INSTALL_INCLUDEDIR@)

find_package(PkgConfig REQUIRED)
find_library(SeerepCore_LIBRARY NAMES seerepcore)
set(SeerepCore_LIBRARIES ${SeerepCore_LIBRARY})

find_package(Protobuf REQUIRED)
list(APPEND SeerepCore_INCLUDE_DIRS ${Protobuf_INCLUDE_DIR})
list(APPEND SeerepCore_LIBRARIES ${Protobuf_LIBRARY})

find_package(HDF5 REQUIRED)
list(APPEND SeerepCore_INCLUDE_DIRS ${HDF5_INCLUDE_DIRS})
list(APPEND SeerepCore_LIBRARIES ${HDF5_LIBRARIES})

find_package(HighFive REQUIRED)
list(APPEND SeerepCore_INCLUDE_DIRS ${HighFive_INCLUDE_DIRS})
list(APPEND SeerepCore_LIBRARIES ${HighFive_LIBRARIES})

find_package(SeerepMsgs REQUIRED)
list(APPEND SeerepCore_INCLUDE_DIRS ${SeerepMsgs_INCLUDE_DIRS})
list(APPEND SeerepCore_LIBRARIES ${SeerepMsgs_LIBRARIES})

find_package(SeerepHdf5Core REQUIRED)
list(APPEND SeerepCore_INCLUDE_DIRS ${SeerepHdf5Core_INCLUDE_DIRS})
list(APPEND SeerepCore_LIBRARIES ${SeerepHdf5Core_LIBRARIES})

repository: agri-gaia/seerep

repo_name: agri-gaia/seerep

extension: in


text:
// Copyright 2016 The etcd-operator 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 k8sutil

import (
	"fmt"
	"path"
	"strings"

	api "github.com/coreos/etcd-operator/pkg/apis/etcd/v1beta2"
	"github.com/coreos/etcd-operator/pkg/util/etcdutil"

	"k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const (
	shouldCheckpointAnnotation = "checkpointer.alpha.coreos.com/checkpoint" // = "true"
	varLockVolumeName          = "var-lock"
	varLockDir                 = "/var/lock"
	etcdLockPath               = "/var/lock/etcd.lock"
)

func selfHostedDataDir(ns, name string) string {
	return path.Join(etcdVolumeMountDir, ns+"-"+name)
}

func NewSelfHostedEtcdPod(m *etcdutil.Member, initialCluster, endpoints []string, clusterName, state, token string, cs api.ClusterSpec, owner metav1.OwnerReference) *v1.Pod {
	hostDataDir := selfHostedDataDir(m.Namespace, m.Name)
	commands := fmt.Sprintf("/usr/local/bin/etcd --data-dir=%s --name=%s --initial-advertise-peer-urls=%s "+
		"--listen-peer-urls=%s --listen-client-urls=%s --advertise-client-urls=%s "+
		"--initial-cluster=%s --initial-cluster-state=%s",
		hostDataDir, m.Name, m.PeerURL(), m.ListenPeerURL(), m.ListenClientURL(), m.ClientURL(), strings.Join(initialCluster, ","), state)
	if m.SecurePeer {
		commands += fmt.Sprintf(" --peer-client-cert-auth=true --peer-trusted-ca-file=%[1]s/peer-ca.crt --peer-cert-file=%[1]s/peer.crt --peer-key-file=%[1]s/peer.key", peerTLSDir)
	}
	if m.SecureClient {
		commands += fmt.Sprintf(" --client-cert-auth=true --trusted-ca-file=%[1]s/server-ca.crt --cert-file=%[1]s/server.crt --key-file=%[1]s/server.key", serverTLSDir)
	}
	if state == "new" {
		commands += fmt.Sprintf(" --initial-cluster-token=%s", token)
	}

	labels := map[string]string{
		"app":          "etcd",
		"etcd_node":    m.Name,
		"etcd_cluster": clusterName,
	}

	if len(endpoints) > 0 {
		addMemberCmd := fmt.Sprintf("ETCDCTL_API=3 etcdctl --endpoints=%s member add %s --peer-urls=%s", strings.Join(endpoints, ","), m.Name, m.PeerURL())
		if m.SecureClient {
			addMemberCmd += fmt.Sprintf(" --cert=%[1]s/%[2]s --key=%[1]s/%[3]s --cacert=%[1]s/%[4]s",
				operatorEtcdTLSDir, etcdutil.CliCertFile, etcdutil.CliKeyFile, etcdutil.CliCAFile)
		}
		commands = fmt.Sprintf("([ -d %s ] || %s); %s", hostDataDir, addMemberCmd, commands)
	}

	// When scaling from 1 -> 2 members, if DNS entry is not populated yet, the k8s control plane will go down
	// and the etcd pod will not have any chance to talk to each other again. We need to make sure DNS entry ready.
	// TODO: nslookup should timeout if blocked for a while (10s).
	ft := `
while ( ! nslookup %s )
do
	sleep 3
done
%s
`
	commands = fmt.Sprintf(ft, m.Addr(), commands)
	commands = fmt.Sprintf("%s; %s", appendHostsCommands(), commands)
	commands = fmt.Sprintf("flock %s -c \"%s\"", etcdLockPath, commands)
	c := etcdContainer([]string{"/bin/sh", "-ec", commands}, cs.BaseImage, cs.Version)
	// On node reboot, there will be two copies of etcd pod: scheduled and checkpointed one.
	// Checkpointed one will start first. But then the scheduler will detect host port conflict,
	// and set the pod (in APIServer) failed. This further affects etcd service by removing the endpoints.
	// To make scheduling phase succeed, we work around by removing ports in spec.
	// However, the scheduled pod will fail when running on node because resources (e.g. host port) are taken.
	// Thus, we make etcd pod flock first before starting etcd server.
	c.Ports = nil
	c.VolumeMounts = append(c.VolumeMounts, v1.VolumeMount{
		Name:      varLockVolumeName,
		MountPath: varLockDir,
		ReadOnly:  false,
	})
	if cs.Pod != nil {
		c = containerWithRequirements(c, cs.Pod.Resources)
	}

	volumes := []v1.Volume{{
		Name: etcdVolumeName,
		// TODO: configurable mount host path.
		VolumeSource: v1.VolumeSource{HostPath: &v1.HostPathVolumeSource{Path: etcdVolumeMountDir}},
	}, {
		Name:         varLockVolumeName,
		VolumeSource: v1.VolumeSource{HostPath: &v1.HostPathVolumeSource{Path: varLockDir}},
	}}
	if m.SecurePeer {
		c.VolumeMounts = append(c.VolumeMounts, v1.VolumeMount{
			MountPath: peerTLSDir,
			Name:      peerTLSVolume,
		})
		volumes = append(volumes, v1.Volume{Name: peerTLSVolume, VolumeSource: v1.VolumeSource{
			Secret: &v1.SecretVolumeSource{SecretName: cs.TLS.Static.Member.PeerSecret},
		}})
	}
	if m.SecureClient {
		c.VolumeMounts = append(c.VolumeMounts, v1.VolumeMount{
			MountPath: serverTLSDir,
			Name:      serverTLSVolume,
		}, v1.VolumeMount{
			MountPath: operatorEtcdTLSDir,
			Name:      operatorEtcdTLSVolume,
		})
		volumes = append(volumes, v1.Volume{Name: serverTLSVolume, VolumeSource: v1.VolumeSource{
			Secret: &v1.SecretVolumeSource{SecretName: cs.TLS.Static.Member.ServerSecret},
		}}, v1.Volume{Name: operatorEtcdTLSVolume, VolumeSource: v1.VolumeSource{
			Secret: &v1.SecretVolumeSource{SecretName: cs.TLS.Static.OperatorSecret},
		}})
	}

	pod := &v1.Pod{
		ObjectMeta: metav1.ObjectMeta{
			Name:   m.Name,
			Labels: labels,
			Annotations: map[string]string{
				shouldCheckpointAnnotation: "true",
			},
		},
		Spec: v1.PodSpec{
			// Self-hosted etcd pod need to endure node restart.
			// If we set it to Never, the pod won't restart. If etcd won't come up, nor does other k8s API components.
			RestartPolicy: v1.RestartPolicyAlways,
			Containers:    []v1.Container{c},
			Volumes:       volumes,
			HostNetwork:   true,
			DNSPolicy:     v1.DNSClusterFirstWithHostNet,
			Hostname:      m.Name,
			Subdomain:     clusterName,
		},
	}

	SetEtcdVersion(pod, cs.Version)

	applyPodPolicy(clusterName, pod, cs.Pod)
	// overwrites the antiAffinity setting for self hosted cluster.
	pod = selfHostedPodWithAntiAffinity(pod)
	addOwnerRefToObject(pod.GetObjectMeta(), owner)
	return pod
}

func appendHostsCommands() string {
	etcdHostsFile := path.Join(etcdVolumeMountDir, "etcd-hosts.checkpoint")
	// If hosts checkpoint exists, we will append it to /etc/hosts.
	// TODO: remove this when host alias works for hostNetwork Pod.
	return fmt.Sprintf("([ -f %[1]s ] && (cat %[1]s >> /etc/hosts) || true)", etcdHostsFile)
}

func selfHostedPodWithAntiAffinity(pod *v1.Pod) *v1.Pod {
	// self hosted pods should sit on different nodes even if they are from different cluster.
	ls := &metav1.LabelSelector{MatchLabels: map[string]string{
		"app": "etcd",
	}}
	return podWithAntiAffinity(pod, ls)
}


text:
/*
 * Tsuru
 *
 * Open source, extensible and Docker-based Platform as a Service (PaaS)
 *
 * API version: 1.15
 * Generated by: OpenAPI Generator (https://openapi-generator.tech)
 */

package tsuru

type ClusterKubeConfigUser struct {
	Password              string                            `json:"password,omitempty"`
	ClientCertificateData string                            `json:"client-certificate-data,omitempty"`
	ClientKeyData         string                            `json:"client-key-data,omitempty"`
	AuthProvider          ClusterKubeConfigUserAuthprovider `json:"auth-provider,omitempty"`
	Exec                  *ClusterKubeConfigUserExec        `json:"exec,omitempty"`
	Token                 string                            `json:"token,omitempty"`
	Username              string                            `json:"username,omitempty"`
}

repository: tsuru/go-tsuruclient

repo_name: tsuru/go-tsuruclient


text:
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/macros.h"
#include "base/path_service.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "base/values.h"
#include "build/build_config.h"
#include "content/browser/frame_host/navigation_handle_impl.h"
#include "content/browser/frame_host/render_frame_host_impl.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/common/view_messages.h"
#include "content/public/browser/notification_types.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/content_paths.h"
#include "content/public/common/frame_navigate_params.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_utils.h"
#include "content/shell/browser/shell.h"
#include "net/base/filename_util.h"
#include "net/base/ip_endpoint.h"
#include "net/test/embedded_test_server/embedded_test_server.h"

namespace content {

class RenderViewHostTest : public ContentBrowserTest {
 public:
  RenderViewHostTest() {}
};

class RenderViewHostTestWebContentsObserver : public WebContentsObserver {
 public:
  explicit RenderViewHostTestWebContentsObserver(WebContents* web_contents)
      : WebContentsObserver(web_contents),
        navigation_count_(0) {}
  ~RenderViewHostTestWebContentsObserver() override {}

  void DidFinishNavigation(NavigationHandle* navigation_handle) override {
    if (!navigation_handle->IsInMainFrame() ||
        !navigation_handle->HasCommitted()) {
      return;
    }

    NavigationHandleImpl* impl =
        static_cast<NavigationHandleImpl*>(navigation_handle);
    observed_remote_endpoint_ = navigation_handle->GetSocketAddress();
    base_url_ = impl->base_url();
    ++navigation_count_;
  }

  const net::IPEndPoint& observed_remote_endpoint() const {
    return observed_remote_endpoint_;
  }

  GURL base_url() const {
    return base_url_;
  }

  int navigation_count() const { return navigation_count_; }

 private:
  net::IPEndPoint observed_remote_endpoint_;
  GURL base_url_;
  int navigation_count_;

  DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestWebContentsObserver);
};

IN_PROC_BROWSER_TEST_F(RenderViewHostTest, FrameNavigateSocketAddress) {
  ASSERT_TRUE(embedded_test_server()->Start());
  RenderViewHostTestWebContentsObserver observer(shell()->web_contents());

  GURL test_url = embedded_test_server()->GetURL("/simple_page.html");
  NavigateToURL(shell(), test_url);

  EXPECT_EQ(
      net::HostPortPair::FromURL(embedded_test_server()->base_url()),
      net::HostPortPair::FromIPEndPoint(observer.observed_remote_endpoint()));
  EXPECT_EQ(1, observer.navigation_count());
}

IN_PROC_BROWSER_TEST_F(RenderViewHostTest, BaseURLParam) {
  ASSERT_TRUE(embedded_test_server()->Start());
  RenderViewHostTestWebContentsObserver observer(shell()->web_contents());

  // Base URL is not set if it is the same as the URL.
  GURL test_url = embedded_test_server()->GetURL("/simple_page.html");
  NavigateToURL(shell(), test_url);
  EXPECT_TRUE(observer.base_url().is_empty());
  EXPECT_EQ(1, observer.navigation_count());

  // But should be set to the original page when reading MHTML.
  NavigateToURL(shell(), GetTestUrl(nullptr, "google.mht"));
  EXPECT_EQ("http://www.google.com/", observer.base_url().spec());
}

// This test ensures a RenderFrameHost object is created for the top level frame
// in each RenderViewHost.
IN_PROC_BROWSER_TEST_F(RenderViewHostTest, BasicRenderFrameHost) {
  ASSERT_TRUE(embedded_test_server()->Start());

  GURL test_url = embedded_test_server()->GetURL("/simple_page.html");
  NavigateToURL(shell(), test_url);

  FrameTreeNode* old_root = static_cast<WebContentsImpl*>(
      shell()->web_contents())->GetFrameTree()->root();
  EXPECT_TRUE(old_root->current_frame_host());

  ShellAddedObserver new_shell_observer;
  EXPECT_TRUE(ExecuteScript(shell(), "window.open();"));
  Shell* new_shell = new_shell_observer.GetShell();
  FrameTreeNode* new_root = static_cast<WebContentsImpl*>(
      new_shell->web_contents())->GetFrameTree()->root();

  EXPECT_TRUE(new_root->current_frame_host());
  EXPECT_NE(old_root->current_frame_host()->routing_id(),
            new_root->current_frame_host()->routing_id());
}

IN_PROC_BROWSER_TEST_F(RenderViewHostTest, IsFocusedElementEditable) {
  ASSERT_TRUE(embedded_test_server()->Start());

  GURL test_url = embedded_test_server()->GetURL("/touch_selection.html");
  NavigateToURL(shell(), test_url);

  WebContents* contents = shell()->web_contents();
  EXPECT_FALSE(contents->IsFocusedElementEditable());
  EXPECT_TRUE(ExecuteScript(shell(), "focus_textfield();"));
  EXPECT_TRUE(contents->IsFocusedElementEditable());
}

// Flaky on Linux (https://crbug.com/559192).
#if defined(OS_LINUX)
#define MAYBE_ReleaseSessionOnCloseACK DISABLED_ReleaseSessionOnCloseACK
#else
#define MAYBE_ReleaseSessionOnCloseACK ReleaseSessionOnCloseACK
#endif
IN_PROC_BROWSER_TEST_F(RenderViewHostTest, MAYBE_ReleaseSessionOnCloseACK) {
  ASSERT_TRUE(embedded_test_server()->Start());
  GURL test_url = embedded_test_server()->GetURL(
      "/access-session-storage.html");
  NavigateToURL(shell(), test_url);

  // Make a new Shell, a seperate tab with it's own session namespace and
  // have it start loading a url but still be in progress.
  ShellAddedObserver new_shell_observer;
  EXPECT_TRUE(ExecuteScript(shell(), "window.open();"));
  Shell* new_shell = new_shell_observer.GetShell();
  new_shell->LoadURL(test_url);
  RenderViewHost* rvh = new_shell->web_contents()->GetRenderViewHost();
  SiteInstance* site_instance = rvh->GetSiteInstance();
  scoped_refptr<SessionStorageNamespace> session_namespace =
      rvh->GetDelegate()->GetSessionStorageNamespace(site_instance);
  EXPECT_FALSE(session_namespace->HasOneRef());

  // Close it, or rather start the close operation. The session namespace
  // should remain until RPH gets an ACK from the renderer about having
  // closed the view.
  new_shell->Close();
  EXPECT_FALSE(session_namespace->HasOneRef());

  // Do something that causes ipc queues to flush and tasks in
  // flight to complete such that we should have received the ACK.
  NavigateToURL(shell(), test_url);

  // Verify we have the only remaining reference to the namespace.
  EXPECT_TRUE(session_namespace->HasOneRef());
}

}  // namespace content

repository: Samsung/Castanets

repo_name: Samsung/Castanets

extension: cc


text:
#include <vtkCamera.h>
#include <vtkColorTransferFunction.h>
#include <vtkContourValues.h>
#include <vtkInteractorStyleTrackballCamera.h>
#include <vtkMetaImageReader.h>
#include <vtkNamedColors.h>
#include <vtkNew.h>
#include <vtkOpenGLGPUVolumeRayCastMapper.h>
#include <vtkPiecewiseFunction.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkRenderer.h>
#include <vtkVolume.h>
#include <vtkVolumeProperty.h>

#include <iostream>
#include <string>

int main(int argc, char* argv[])
{
  double iso1 = 500.0;
  double iso2 = 1150.0;

  if (argc < 2)
  {
    std::cout << "Usage: " << argv[0] << " file.mnd [iso1=500] [iso2=1150]"
              << std::endl;
    std::cout << "e.g. FullHead.mhd 500 1150" << std::endl;
    return EXIT_FAILURE;
  }

  vtkNew<vtkMetaImageReader> reader;
  reader->SetFileName(argv[1]);

  vtkNew<vtkNamedColors> colors;

  vtkNew<vtkOpenGLGPUVolumeRayCastMapper> mapper;
  mapper->SetInputConnection(reader->GetOutputPort());
  mapper->AutoAdjustSampleDistancesOff();
  mapper->SetSampleDistance(0.5);
  mapper->SetBlendModeToIsoSurface();

  if (argc > 3)
  {
    iso1 = atof(argv[2]);
    iso2 = atof(argv[3]);
  }
  vtkNew<vtkColorTransferFunction> colorTransferFunction;
  colorTransferFunction->RemoveAllPoints();
  colorTransferFunction->AddRGBPoint(iso2,
                                     colors->GetColor3d("ivory").GetData()[0],
                                     colors->GetColor3d("ivory").GetData()[1],
                                     colors->GetColor3d("ivory").GetData()[2]);
  colorTransferFunction->AddRGBPoint(iso1,
                                     colors->GetColor3d("flesh").GetData()[0],
                                     colors->GetColor3d("flesh").GetData()[1],
                                     colors->GetColor3d("flesh").GetData()[2]);

  vtkNew<vtkPiecewiseFunction> scalarOpacity;
  scalarOpacity->AddPoint(iso1, .3);
  scalarOpacity->AddPoint(iso2, 0.6);

  vtkNew<vtkVolumeProperty> volumeProperty;
  volumeProperty->ShadeOn();
  volumeProperty->SetInterpolationTypeToLinear();
  volumeProperty->SetColor(colorTransferFunction);
  volumeProperty->SetScalarOpacity(scalarOpacity);

  vtkNew<vtkVolume> volume;
  volume->SetMapper(mapper);
  volume->SetProperty(volumeProperty);

  vtkNew<vtkRenderer> renderer;
  renderer->AddVolume(volume);
  renderer->SetBackground(colors->GetColor3d("cornflower").GetData());
  renderer->ResetCamera();

  vtkNew<vtkRenderWindow> renderWindow;
  renderWindow->SetSize(800, 600);
  renderWindow->AddRenderer(renderer);
  renderWindow->SetWindowName("RayCastIsosurface");

  vtkNew<vtkInteractorStyleTrackballCamera> style;

  vtkNew<vtkRenderWindowInteractor> interactor;
  interactor->SetRenderWindow(renderWindow);
  interactor->SetInteractorStyle(style);

  // Add some contour values to draw iso surfaces
  volumeProperty->GetIsoSurfaceValues()->SetValue(0, iso1);
  volumeProperty->GetIsoSurfaceValues()->SetValue(1, iso2);

  // Generate a good view
  vtkNew<vtkCamera> aCamera;
  aCamera->SetViewUp(0, 0, -1);
  aCamera->SetPosition(0, -1, 0);
  aCamera->SetFocalPoint(0, 0, 0);

  renderer->SetActiveCamera(aCamera);
  renderer->ResetCamera();

  aCamera->Azimuth(30.0);
  aCamera->Elevation(30.0);
  aCamera->Dolly(1.5);
  renderer->ResetCameraClippingRange();

  renderWindow->Render();

  interactor->Start();

  return EXIT_SUCCESS;
}

repository: Kitware/vtk-examples

repo_name: Kitware/vtk-examples

extension: cxx


text:
using Checkout.Customers.Previous;
using Checkout.Disputes;
using Checkout.Events.Previous;
using Checkout.Instruments.Previous;
using Checkout.Payments.Hosted;
using Checkout.Payments.Links;
using Checkout.Payments.Previous;
using Checkout.Reconciliation.Previous;
using Checkout.Risk;
using Checkout.Sources.Previous;
using Checkout.Tokens;
using Checkout.Webhooks.Previous;

namespace Checkout.Previous
{
    public class CheckoutApi : AbstractCheckoutApmApi, ICheckoutApi
    {
        private readonly ITokensClient _tokensClient;
        private readonly ICustomersClient _customersClient;
        private readonly ISourcesClient _sourcesClient;
        private readonly IPaymentsClient _paymentsClient;
        private readonly IInstrumentsClient _instrumentsClient;
        private readonly IDisputesClient _disputesClient;
        private readonly IWebhooksClient _webhooksClient;
        private readonly IEventsClient _eventsClient;
        private readonly IRiskClient _riskClient;
        private readonly IPaymentLinksClient _paymentLinksClient;
        private readonly IReconciliationClient _reconciliationClient;
        private readonly IHostedPaymentsClient _hostedPaymentsClient;

        public CheckoutApi(CheckoutConfiguration configuration) : base(configuration)
        {
            var apiClient = new ApiClient(configuration.HttpClientFactory,
                configuration.Environment.GetAttribute<EnvironmentAttribute>().ApiUri);
            _tokensClient = new TokensClient(apiClient, configuration);
            _customersClient = new CustomersClient(apiClient, configuration);
            _sourcesClient = new SourcesClient(apiClient, configuration);
            _paymentsClient = new PaymentsClient(apiClient, configuration);
            _instrumentsClient = new InstrumentsClient(apiClient, configuration);
            _disputesClient = new DisputesClient(apiClient, configuration);
            _webhooksClient = new WebhooksClient(apiClient, configuration);
            _eventsClient = new EventsClient(apiClient, configuration);
            _riskClient = new RiskClient(apiClient, configuration);
            _paymentLinksClient = new PaymentLinksClient(apiClient, configuration);
            _reconciliationClient = new ReconciliationClient(apiClient, configuration);
            _hostedPaymentsClient = new HostedPaymentsClient(apiClient, configuration);
        }

        public ITokensClient TokensClient()
        {
            return _tokensClient;
        }

        public ICustomersClient CustomersClient()
        {
            return _customersClient;
        }

        public ISourcesClient SourcesClient()
        {
            return _sourcesClient;
        }

        public IPaymentsClient PaymentsClient()
        {
            return _paymentsClient;
        }

        public IInstrumentsClient InstrumentsClient()
        {
            return _instrumentsClient;
        }

        public IDisputesClient DisputesClient()
        {
            return _disputesClient;
        }

        public IWebhooksClient WebhooksClient()
        {
            return _webhooksClient;
        }

        public IEventsClient EventsClient()
        {
            return _eventsClient;
        }

        public IRiskClient RiskClient()
        {
            return _riskClient;
        }

        public IPaymentLinksClient PaymentLinksClient()
        {
            return _paymentLinksClient;
        }

        public IReconciliationClient ReconciliationClient()
        {
            return _reconciliationClient;
        }

        public IHostedPaymentsClient HostedPaymentsClient()
        {
            return _hostedPaymentsClient;
        }
    }
}

repository: checkout/checkout-sdk-net

repo_name: checkout/checkout-sdk-net

gha_language: C#


text:
// Code generated by goa v3.0.6, DO NOT EDIT.
//
// Health HTTP server types
//
// Command:
// $ goa gen github.com/rightscale/governance/front_service/design

package server


text:
// Copyright 2019 the orbs-client-sdk-go authors
// This file is part of the orbs-client-sdk-go library in the Orbs project.
//
// This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
// The above notice should be included in all copies or substantial portions of the software.

package codec

import (
	"github.com/orbs-network/orbs-spec/types/go/protocol"
	"github.com/pkg/errors"
)

type NetworkType string

const (
	NETWORK_TYPE_MAIN_NET NetworkType = "MAIN_NET"
	NETWORK_TYPE_TEST_NET NetworkType = "TEST_NET"
)

func (x NetworkType) String() string {
	return string(x)
}

func networkTypeEncode(networkType NetworkType) (protocol.SignerNetworkType, error) {
	switch networkType {
	case NETWORK_TYPE_MAIN_NET:
		return protocol.NETWORK_TYPE_MAIN_NET, nil
	case NETWORK_TYPE_TEST_NET:
		return protocol.NETWORK_TYPE_TEST_NET, nil
	default:
		return protocol.NETWORK_TYPE_RESERVED, errors.Errorf("unsupported network type given %s", networkType)
	}
}

repository: orbs-network/orbs-client-sdk-go

repo_name: orbs-network/orbs-client-sdk-go


text:
// Copyright © 2018 Synergic Mobility Project (https://synergic.mobi)
//
// 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 cmd

import (
	"fmt"
	"time"

	"github.com/spf13/cobra"
)

// buildCmd represents the build command
var buildCmd = &cobra.Command{
	Use:   "build",
	Short: "Build all supported providers",
	Long: `Build all supported providers`,
	Run: func(cmd *cobra.Command, args []string) {
		cmdList := make([]string,len(args))
		n := 0
		for _, alias := range args {
			cmd := getCmdName(alias)
			if len(cmd) != 0 {
				cmdList[n] =  cmd
				n++
			}
		}
		fmt.Println("Try to build ", cmdList)
		s, err :=sioClient.Ack("build",cmdList, time.Second * 100)

		if err == nil {
			fmt.Printf("build results[%s]\n", s)
		}else{
			fmt.Printf("error %s\n",err.Error())
		}
	},
}

func init() {
	rootCmd.AddCommand(buildCmd)

	// buildCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}