text:
package core

import (
	"encoding/json"
	"github.com/fbiville/headache/fs"
	jsonsch "github.com/xeipuuv/gojsonschema"
	"log"
)

type ConfigurationLoader struct {
	Reader fs.FileReader
}

func (cl *ConfigurationLoader) ReadConfiguration(configFile *string) (*Configuration, error) {
	err := cl.validateConfiguration(configFile)
	if err != nil {
		return nil, err
	}

	payload, err := cl.Reader.Read(*configFile)
	if err != nil {
		return nil, err
	}
	configuration, err := cl.UnmarshallConfiguration(payload)
	if err != nil {
		return nil, err
	}
	configuration.Path = configFile
	return configuration, err
}

func (cl *ConfigurationLoader) UnmarshallConfiguration(configurationPayload []byte) (*Configuration, error) {
	result := Configuration{}
	err := json.Unmarshal(configurationPayload, &result)
	if err != nil {
		return nil, err
	}
	return &result, nil
}

func (cl *ConfigurationLoader) validateConfiguration(configFile *string) error {
	schema := loadSchema()
	if schema == nil {
		return nil
	}
	jsonSchemaValidator := JsonSchemaValidator{
		Schema:     schema,
		FileReader: cl.Reader,
	}
	return jsonSchemaValidator.Validate("file://" + *configFile)
}

func loadSchema() *jsonsch.Schema {
	schema, err := jsonsch.NewSchema(jsonsch.NewReferenceLoader("https://fbiville.github.io/headache/schema.json"))
	if err != nil {
		log.Printf("headache configuration warning: cannot load schema, skipping configuration validation. See reason below:\n\t%v\n", err)
		return nil
	}
	return schema
}

repository: AElMehdi/headache

repo_name: AElMehdi/headache


text:
package main

import (
	"crypto/sha256"
	"encoding/hex"
	"errors"
	"fmt"
	"io"
	"os"
	"path/filepath"
	"sync"
	"time"

	"github.com/sirupsen/logrus"
)

// swiftReader implements io.ReadAt interface
type swiftReader struct {
	// Required to set in initialized
	log     *logrus.Entry
	swift   *Swift
	sf      *SwiftFile
	timeout time.Duration

	// Not required
	m            sync.Mutex
	tmpfile      *os.File
	downloadErr  error
	downloadSize int64
	readSize     int64

	afterClosed func(r *swiftReader)
}

func (r *swiftReader) Begin() (err error) {
	r.log.Debugf("Send '%s' (size=%d) to client", r.sf.Name(), r.sf.Size())

	// Download size
	headers, err := r.swift.Get(r.sf.Name())
	if err != nil {
		return err
	}
	r.downloadSize = headers.ContentLength
	if r.downloadSize == 0 {
		return fmt.Errorf("Couldn't detect download size (Missing Content-length header).")
	}

	// Create tmpfile
	fname, err := createTmpFile()
	if err != nil {
		return err
	}

	// Open tmpfile
	r.tmpfile, err = os.OpenFile(fname, os.O_RDONLY, 0000)
	if err != nil {
		r.log.Warnf("Couldn't open tmpfile. [%v]", err.Error())
		return err
	}

	// start download
	go func() {
		if err := r.download(fname); err != nil {
			r.downloadErr = err
		}
	}()
	return nil
}

func (r *swiftReader) download(tmpFileName string) (err error) {
	r.log.Debugf("Create tmpfile. [%s]", tmpFileName)
	fw, err := os.OpenFile(tmpFileName, os.O_WRONLY|os.O_TRUNC, 0000)
	if err != nil {
		r.log.Warnf("%v", err.Error())
		return err
	}
	defer fw.Close()

	body, size, err := r.swift.Download(r.sf.Name())
	if err != nil {
		return err
	}
	defer body.Close()

	r.log.Debugf("Download '%s' (size=%d) from Object Storage", r.sf.Name(), size)
	_, err = io.Copy(fw, body)
	if err != nil {
		r.log.Warnf("Error occured during copying [%v]", err.Error())
		return err
	}
	r.log.Debugf("Download completed")

	return nil
}

func (r *swiftReader) ReadAt(p []byte, off int64) (n int, err error) {
	start := time.Now()
	for {
		n, err = r.tmpfile.ReadAt(p, off)
		if n != 0 {
			r.readSize += int64(n)
			return n, err

		} else if r.readSize == r.downloadSize {
			r.log.Debugf("Send EOF to client. [%s]", r.sf.Name())
			return n, io.EOF
		}

		time.Sleep(100 * time.Millisecond)
		r.log.Debugf("Wait for downloading. [%s] ", r.sf.Name())

		if time.Now().Sub(start) > r.timeout {
			r.log.Warnf("Download timeout. [%s]", r.sf.Name())
			break
		}
	}

	r.downloadErr = errors.New("Timeout for downloading")
	return -1, r.downloadErr
}

func (r *swiftReader) Close() error {
	if r.afterClosed != nil {
		defer r.afterClosed(r)
	}

	// remove temporary file
	if r.tmpfile != nil {
		os.Remove(r.tmpfile.Name())
	}

	return nil
}

// swiftWriter implements io.WriteAt interface
type swiftWriter struct {
	// Required to set in initialized
	log     *logrus.Entry
	swift   *Swift
	sf      *SwiftFile
	timeout time.Duration

	// Not required
	tmpfile        *os.File
	uploadComplete bool
	uploadErr      error

	afterClosed func(w *swiftWriter)
}

func (w *swiftWriter) Begin() (err error) {
	w.log.Debugf("Receive '%s' from client", w.sf.Name())

	// Create tmpfile
	fname, err := createTmpFile()
	if err != nil {
		return err
	}

	// Open tmpfile
	w.tmpfile, err = os.OpenFile(fname, os.O_WRONLY, 0000)
	if err != nil {
		w.log.Warnf("Couldn't open tmpfile. [%v]", err.Error())
		return err
	}
	return nil
}

func (w *swiftWriter) upload() (err error) {
	fname := w.tmpfile.Name()
	w.log.Debugf("Upload: create tmpfile. [%s]", fname)
	fr, err := os.OpenFile(fname, os.O_RDONLY, 000)
	if err != nil {
		w.log.Warnf("%v", err.Error())
		return err
	}
	defer fr.Close()

	return w.swift.Put(w.sf.Name(), fr)
}

func (w *swiftWriter) WriteAt(p []byte, off int64) (n int, err error) {
	n, err = w.tmpfile.WriteAt(p, off)
	if err != nil {
		w.log.Debugf("%v", err)
	}
	return n, err
}

func (w *swiftWriter) Close() error {
	if w.afterClosed != nil {
		defer w.afterClosed(w)
	}

	// start uploading
	if w.tmpfile != nil {
		s, err := w.tmpfile.Stat()
		if err != nil {
			return err
		}

		w.log.Debugf("Upload '%s' (size=%d) to Object Storage", w.sf.Name(), s.Size())

		//go func() {
		defer func() {
			w.uploadComplete = true
		}()

		if err := w.upload(); err != nil {
			w.uploadErr = err
			w.log.Debugf("Upload: complete with error. [%v]", err)
		}

		// remove temporary file
		os.Remove(w.tmpfile.Name())

		if w.uploadErr != nil {
			return w.uploadErr
		}
		w.log.Debugf("'%s' was uploaded successfully", w.sf.Name())

		//}()
	}

	return nil
}

func createTmpFile() (string, error) {
	t := time.Now().Format(time.RFC3339Nano)
	h := sha256.Sum256([]byte(t))
	fname := filepath.Join(os.TempDir(), "ojs-"+hex.EncodeToString(h[:]))

	f, err := os.OpenFile(fname, os.O_RDONLY|os.O_CREATE, 0600)
	if err != nil {
		return "", err
	}
	f.Close()

	return fname, nil
}

license: MIT

repository: hironobu-s/swift-sftp

license_type: permissive

repo_name: hironobu-s/swift-sftp

branch_name: refs/heads/master

extension: go


text:
@inproceedings{larl:cl:2017,
 author = {Bettina Larl and Eva Zangerle},
 booktitle = {9th International Corpus Linguistics Conference 2017 ( July 2017, Birmingham, UK)},
 title = {Geolocating German on Twitter - Hitches and Glitches of Building and Exploring a Twitter Corpus},
 year = {2017}
}

branch_name: refs/heads/main

extension: bib


text:
@article{richardson_are_2008,
 abstract = {Ocean acidification may negatively affect calcifying plankton, opening ecological space for noncalcifying species. Recently, a study of climate-forcing of jellyfish reported the first analysis suggesting that there were more jellyfish (generally considered a noncalcifying group) when conditions were more acidic (lower pH) from one area within the North Sea. We examine this suggestion for a number of areas in the North Sea and beyond in the Northeast Atlantic using coelenterate records from the Continuous Plankton Recorder and pH data from the International Council for the Exploration of the Sea for the period 1946–2003. We could find no significant relationships between jellyfish abundance and acidic conditions in any of the regions investigated. We conclude that the role of pH in structuring zooplankton communities in the North Sea and further afield at present is tenuous.},
 author = {Richardson, Anthony J. and Gibbons, Mark J.},
 doi = {10.4319/lo.2008.53.5.2040},
 file = {Richardson and Gibbons - 2008 - Are jellyfish increasing in response to ocean acid.pdf:/Users/ric325/Zotero/storage/BXRIXSA8/Richardson and Gibbons - 2008 - Are jellyfish increasing in response to ocean acid.pdf:application/pdf},
 issn = {00243590},
 journal = {Limnology and Oceanography},
 language = {en},
 month = {September},
 number = {5},
 pages = {2040--2045},
 title = {Are jellyfish increasing in response to ocean acidification?},
 url = {http://doi.wiley.com/10.4319/lo.2008.53.5.2040},
 urldate = {2019-10-24},
 volume = {53},
 year = {2008}
}


text:
SUMMARY = "The RAUC hawkBit updater operates as an interface between the RAUC D-Bus API and the hawkBit DDI API."
HOMEPAGE = "https://github.com/rauc/rauc-hawkbit-updater"

LICENSE = "LGPLv2.1"
LIC_FILES_CHKSUM = "file://LICENSE;md5=1a6d268fd218675ffea8be556788b780"

SRC_URI = "git://github.com/rauc/rauc-hawkbit-updater.git;protocol=https"
SRCREV = "d909982e9e4b84cb76b98bf85f25a0a88472301a"
S = "${WORKDIR}/git"
PV = "0.0+git${SRCPV}"

inherit cmake pkgconfig systemd useradd

SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'rauc-hawkbit-updater.service', '', d)}"

PACKAGECONFIG ??= " \
    ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
"
PACKAGECONFIG[systemd] = "-DWITH_SYSTEMD=ON,,systemd"

USERADD_PACKAGES = "${PN}"
USERADD_PARAM_${PN} = "--system --home-dir / --no-create-home --shell /bin/false rauc-hawkbit"

DEPENDS = "curl glib-2.0-native json-glib"

do_install_append () {
	install -d ${D}${sysconfdir}/${PN}
	install -m 644 ${S}/config.conf.example ${D}${sysconfdir}/${PN}/config.conf
}

repository: ejoerns/meta-rauc

repo_name: ejoerns/meta-rauc

gha_license_id: MIT

gha_language: Shell

extension: bb


text:
package statsdclient

import (
	"reflect"
	"testing"

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

func TestNewGoMetricClient(t *testing.T) {
	client := NewGoMetricClient("127.0.0.1", 8125)

	require.Equal(t, "*statsd.Client", reflect.TypeOf(client).String())
}

repository: penthousetoken/statsd-http-proxy

repo_name: penthousetoken/statsd-http-proxy


text:
DESCRIPTION = "A dead simple calculator. It's advantage is that it's elementary-themed"
HOMEPAGE = "http://github.com/spaetz/calc"
AUTHOR = "Sebastian Spaeth <Sebastian@SSpaeth.de>"
LICENSE  = "MIT"
RDEPENDS_${PN} = "python-elementary python python-edbus"
SECTION = "x11/application"
SRCREV = "cff7c833d4fce0d39de0812bfc9ed9e0eb8fac09"
PV = "0.0.1+gitr${SRCPV}"
PR = "r2"

DEFAULT_PREFERENCE = "-1"

SRC_URI = "git://github.com/spaetz/calc.git;protocol=http;branch=master"
S = "${WORKDIR}/git"

do_install(){
        install -d ${D}${datadir}/applications
        install -m 0644 ${S}/data/elementary-calculator.desktop ${D}${datadir}/applications/
        install -d ${D}${datadir}/pixmaps
        install -m 0644 ${S}/data/calculator.png ${D}${datadir}/pixmaps/
        install -d ${D}${bindir}
        install -m 0744 ${S}/calc ${D}${bindir}/
}

FILES_${PN} += "${prefix}/share/pixmaps"
FILES_${PN} += "${prefix}/share/applications"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


text:
add_library(Qt5::QSvgIconPlugin MODULE IMPORTED)

_populate_Gui_plugin_properties(QSvgIconPlugin RELEASE "iconengines/qsvgicon.dll" FALSE)

list(APPEND Qt5Gui_PLUGINS Qt5::QSvgIconPlugin)
set_property(TARGET Qt5::Gui APPEND PROPERTY QT_ALL_PLUGINS_iconengines Qt5::QSvgIconPlugin)
set_property(TARGET Qt5::QSvgIconPlugin PROPERTY QT_PLUGIN_TYPE "iconengines")
set_property(TARGET Qt5::QSvgIconPlugin PROPERTY QT_PLUGIN_EXTENDS "Qt::Svg")
set_property(TARGET Qt5::QSvgIconPlugin PROPERTY QT_PLUGIN_CLASS_NAME "QSvgIconPlugin")

extension: cmake


text:
@INPROCEEDINGS{stein:2012o,
        ADDRESS            = {Los Alamitos, California},
        AUTHOR             = {Tim Gollub and Benno Stein and Steven Burrows and Dennis Hoppe},
        BOOKTITLE          = {9th International Workshop on Text-based Information Retrieval (TIR 12) at DEXA},
        DOI                = {http://doi.ieeecomputersociety.org/10.1109/DEXA.2012.55},
        EDITOR             = {{A Min} Tjoa and Stephen Liddle and Klaus-Dieter Schewe and Xiaofang Zhou},
        ISBN               = {978-1-4673-2621-6},
        ISSN               = {1529-4188},
        MONTH              = sep,
        PAGES              = {151-155},
        PUBLISHER          = {IEEE},
        SITE               = {Vienna, Austria, Austria},
        TITLE              = {{TIRA: Configuring, Executing, and Disseminating Information Retrieval Experiments}},
        YEAR               = {2012}
}

@INPROCEEDINGS{stein:2014j,
        ADDRESS            = {Berlin Heidelberg New York},
        AUTHOR             = {Martin Potthast and Tim Gollub and Francisco Rangel and Paolo Rosso and Efstathios Stamatatos and Benno Stein},
        BOOKTITLE          = {Information Access Evaluation meets Multilinguality, Multimodality, and Visualization. 5th International Conference of the CLEF Initiative (CLEF 14)},
        DOI                = {10.1007/978-3-319-11382-1_22},
        EDITOR             = {Evangelos Kanoulas and Mihai Lupu and Paul Clough and Mark Sanderson and Mark Hall and Allan Hanbury and Elaine Toms},
        ISBN               = {978-3-319-11381-4},
        MONTH              = sep,
        PAGES              = {268-299},
        PUBLISHER          = {Springer},
        TITLE              = {{Improving the Reproducibility of PAN's Shared Tasks: Plagiarism Detection, Author Identification, and Author Profiling}},
        YEAR               = {2014}
}

@INPROCEEDINGS{rangel:2016,
        AUTHOR             = {Francisco Rangel and Paolo Rosso and Ben Verhoeven and Walter Daelemans and Martin Potthast and Benno Stein},
        BOOKTITLE          = {Working Notes Papers of the CLEF 2016 Evaluation Labs},
        ISSN               = {1613-0073},
        MONTH              = sep,
        PUBLISHER          = {CLEF and CEUR-WS.org},
        SERIES             = {CEUR Workshop Proceedings},
        TITLE              = {{Overview of the 4th Author Profiling Task at PAN 2016: Cross-genre Evaluations}},
        YEAR               = {2016}
}

@article{mikolov2013efficient,
  title={Efficient estimation of word representations in vector space},
  author={Mikolov, Tomas and Chen, Kai and Corrado, Greg and Dean, Jeffrey},
  journal={arXiv preprint arXiv:1301.3781},
  year={2013}
}

@article{mikolov2013efficient,
  title={Efficient estimation of word representations in vector space},
  author={Mikolov, Tomas and Chen, Kai and Corrado, Greg and Dean, Jeffrey},
  journal={arXiv preprint arXiv:1301.3781},
  year={2013}
}

@inproceedings{mikolov2013distributed,
  title={Distributed representations of words and phrases and their compositionality},
  author={Mikolov, Tomas and Sutskever, Ilya and Chen, Kai and Corrado, Greg S and Dean, Jeff},
  booktitle={Advances in neural information processing systems},
  pages={3111--3119},
  year={2013}
}

@inproceedings{rehurek_lrec,
        title = {{Software Framework for Topic Modelling with Large Corpora}},
        author = {Radim {\v R}eh{\r u}{\v r}ek and Petr Sojka},
        booktitle = {{Proceedings of the LREC 2010 Workshop on New
             Challenges for NLP Frameworks}},
        pages = {45--50},
        year = 2010,
        month = May,
        day = 22,
        publisher = {ELRA},
        address = {Valletta, Malta},
        note={\url{http://is.muni.cz/publication/884893/en}},
        language={English}
}

@article{gonzaleztweets,
  title={Tweets Classification Using Corpus Dependent Tags, Character and POS N-grams},
  author={Gonz{\'a}lez-Gallardo, Carlos E and Montes, Azucena and Sierra, Gerardo and N{\'u}{\~n}ez-Ju{\'a}rez, J Antonio and Salinas-L{\'o}pez, Adolfo Jonathan and Ek, Juan}
}

@article{alvarezinaoe,
  title={INAOE’s participation at PAN’15: Author Profiling task},
  author={{\'A}lvarez-Carmona, Miguel A and L{\'o}pez-Monroy, A Pastor and Montes-y-G{\'o}mez, Manuel and Villase{\~n}or-Pineda, Luis and Jair-Escalante, Hugo}
}

@inproceedings{rangel2015overview,
  title={Overview of the 3rd Author Profiling Task at PAN 2015},
  author={Rangel, Francisco and Rosso, P and Potthast, M and Stein, B and Daelemans, W},
  booktitle={CLEF},
  year={2015}
}

@misc{TrainWord2Vec,
  title = {Training Word2Vec Model on English Wikipedia by Gensim},
  howpublished = {\url{http://textminingonline.com/training-word2vec-model-on-english-wikipedia-by-gensim}},
  note = {Accessed: 2010-05-23}
}

@inproceedings{schmid1994probabilistic,
  title={Probabilistic part-of-speech tagging using decision trees},
  author={Schmid, Helmut},
  booktitle={Proceedings of the international conference on new methods in language processing},
  volume={12},
  pages={44--49},
  year={1994},
  organization={Citeseer}
}

@book{flach2012machine,
  title={Machine learning: the art and science of algorithms that make sense of data},
  author={Flach, Peter},
  year={2012},
  publisher={Cambridge University Press}
}

@article{freund1997decision,
  title={A decision-theoretic generalization of on-line learning and an application to boosting},
  author={Freund, Yoav and Schapire, Robert E},
  journal={Journal of computer and system sciences},
  volume={55},
  number={1},
  pages={119--139},
  year={1997},
  publisher={Elsevier}
}

@article{breiman2001random,
  title={Random forests},
  author={Breiman, Leo},
  journal={Machine learning},
  volume={45},
  number={1},
  pages={5--32},
  year={2001},
  publisher={Springer}
}

@article{wilcoxon1945individual,
  title={Individual comparisons by ranking methods},
  author={Wilcoxon, Frank},
  journal={Biometrics bulletin},
  pages={80--83},
  year={1945},
  publisher={JSTOR}
}

@article{scikit-learn,
 title={Scikit-learn: Machine Learning in {P}ython},
 author={Pedregosa, F. and Varoquaux, G. and Gramfort, A. and Michel, V.
         and Thirion, B. and Grisel, O. and Blondel, M. and Prettenhofer, P.
         and Weiss, R. and Dubourg, V. and Vanderplas, J. and Passos, A. and
         Cournapeau, D. and Brucher, M. and Perrot, M. and Duchesnay, E.},
 journal={Journal of Machine Learning Research},
 volume={12},
 pages={2825--2830},
 year={2011}
}

@article{santosh2013author,
  title={Author profiling: Predicting age and gender from blogs},
  author={Santosh, K and Bansal, Romil and Shekhar, Mihir and Varma, Vasudeva},
  journal={Notebook Papers of CLEF},
  year={2013}
}

@article{meina2013ensemble,
  title={Ensemble-based classification for author profiling using various features},
  author={Meina, Micha{\l} and Brodzinska, Karolina and Celmer, Bartosz and Czok{\'o}w, Maja and Patera, Martyna and Pezacki, Jakub and Wilk, Mateusz},
  journal={Notebook Papers of CLEF},
  year={2013}
}

@inproceedings{lopez2013inaoe,
  title={INAOE’s participation at PAN’13: Author profiling task},
  author={Lopez-Monroy, Adrian Pastor and Gomez, Manuel Montes-y and Escalante, Hugo Jair and Villasenor-Pineda, Luis and Villatoro-Tello, Esa{\'u}},
  booktitle={CLEF 2013 Evaluation Labs and Workshop},
  year={2013}
}

@inproceedings{schler2006effects,
  title={Effects of Age and Gender on Blogging.},
  author={Schler, Jonathan and Koppel, Moshe and Argamon, Shlomo and Pennebaker, James W},
  booktitle={AAAI Spring Symposium: Computational Approaches to Analyzing Weblogs},
  volume={6},
  pages={199--205},
  year={2006}
}

@inproceedings{rangel2015overview,
  title={Overview of the 3rd author profiling task at pan 2015},
  author={Rangel, Francisco and Rosso, P and Potthast, M and Stein, B and Daelemans, W},
  booktitle={CLEF},
  year={2015}
}

@inproceedings{rangel2014overview,
  title={Overview of the 2nd Author Profiling Task at PAN 2014},
  author={Rangel, Francisco and Rosso, Paolo and Chugur, Irina and Potthast, Martin and Trenkmann, Martin and Stein, Benno and Verhoeven, Ben and Daelemans, Walter},
  booktitle={Proceedings of the Conference and Labs of the Evaluation Forum (Working Notes)},
  year={2014}
}

@inproceedings{rangel2013overview,
  title={Overview of the author profiling task at PAN 2013},
  author={Rangel, Francisco and Rosso, Paolo and Moshe Koppel, Moshe and Stamatatos, Efstathios and Inches, Giacomo},
  booktitle={CLEF Conference on Multilingual and Multimodal Information Access Evaluation},
  pages={352--365},
  year={2013},
  organization={CELCT}
}

@article{argamon2009automatically,
  title={Automatically profiling the author of an anonymous text},
  author={Argamon, Shlomo and Koppel, Moshe and Pennebaker, James W and Schler, Jonathan},
  journal={Communications of the ACM},
  volume={52},
  number={2},
  pages={119--123},
  year={2009},
  publisher={ACM}
}

@article{cortes1995support,
  title={Support-vector networks},
  author={Cortes, Corinna and Vapnik, Vladimir},
  journal={Machine learning},
  volume={20},
  number={3},
  pages={273--297},
  year={1995},
  publisher={Springer}
}

@inproceedings{schmid1994probabilistic,
  title={Probabilistic part-of-speech tagging using decision trees},
  author={Schmid, Helmut},
  booktitle={Proceedings of the international conference on new methods in language processing},
  volume={12},
  pages={44--49},
  year={1994},
  organization={Citeseer}
}

@book{BirdKleinLoper09,
  author = {Steven Bird and Ewan Klein and Edward Loper},
  title = {{Natural Language Processing with Python}},
  publisher = {O'Reilly Media},
  year = 2009
}

%%% Author Identification Task 2015
@INPROCEEDINGS{stamatatos:2015,
        AUTHOR             = {Efstathios Stamatatos and Walter Daelemans and Ben Verhoeven and Patrick Juola and Aurelio {Lopez Lopez} and Martin Potthast and Benno Stein},
        BOOKTITLE          = {Working Notes Papers of the CLEF 2015 Evaluation Labs},
        ISBN               = {},
        ISSN               = {1613-0073},
        MONTH              = sep,
        PUBLISHER          = {CLEF and CEUR-WS.org},
        SERIES             = {CEUR Workshop Proceedings},
        TITLE              = {{Overview of the Author Identification Task at PAN 2015}},
        URL                = {http://www.clef-initiative.eu/publication/working-notes},
        YEAR               = {2015}
}

%%% Author Profiling Task 2015
@INPROCEEDINGS{rangel:2015,
        AUTHOR             = {Francisco Rangel and Paolo Rosso and Martin Potthast and Benno Stein and Walter Daelemans},
        BOOKTITLE          = {CLEF 2015 Labs and Workshops, Notebook Papers},
        EDITOR				= {Cappellato, L and Ferro, N and Gareth, J and San Juan, E},
        ISBN               = {},
        ISSN               = {1613-0073},
        TITLE              = {{Overview of the 3rd Author Profiling Task at PAN 2015}},
        PUBLISHER          = {CEUR-WS.org},
        YEAR               = {2015}
}
%        URL                = {http://www.clef-initiative.eu/publication/working-notes},
%        PUBLISHER          = {CLEF and CEUR-WS.org},
%        SERIES             = {CEUR Workshop Proceedings},

%@INPROCEEDINGS{rangel:2015,
%        AUTHOR             = {Francisco Rangel and Paolo Rosso and Martin Potthast and Benno Stein and Walter Daelemans},
%        BOOKTITLE          = {Working Notes Papers of the CLEF 2015 Evaluation Labs},
%        ISBN               = {},
%        ISSN               = {1613-0073},
%        MONTH              = sep,
%        PUBLISHER          = {CLEF and CEUR-WS.org},
%        SERIES             = {CEUR Workshop Proceedings},
%        TITLE              = {{Overview of the 3rd Author Profiling Task at PAN 2015}},
%        URL                = {http://www.clef-initiative.eu/publication/working-notes},
%        YEAR               = {2015}
%}

%@INPROCEEDINGS{rangel:2015,
%        AUTHOR             = {Francisco Rangel and Paolo Rosso and Martin Potthast and Benno Stein and Walter Daelemans},
%        BOOKTITLE          = {CLEF 2015 Labs and Workshops, Notbeook Papers},
%        ISBN               = {},
%        ISSN               = {1613-0073},
%        MONTH              = sep,
%        PUBLISHER          = {CLEF and CEUR-WS.org},
%        SERIES             = {CEUR Workshop Proceedings},
%        TITLE              = {{Overview of the 3rd Author Profiling Task at PAN 2015}},
%        URL                = {http://www.ceur-ws.org},
%        YEAR               = {2015},
%
%}

%        VOLUME				= {1391},
%        editor				= {Cappellato, L and Ferro, N and Gareth, J and San Juan, E}

%@proceedings{rangel:2015,
%  booktitle = {Working Notes Papers of the CLEF 2015 Evaluation Labs},
%  year = {2015},
%  editor= {Cappellato, L and Ferro, N and Gareth, J and San Juan, E},
%  issn = {1613-0073},
%  url = {http://ceur-ws.org/},
%  volume={1391},
%  title = {Overview of the 3nd Author Profiling Task at PAN 2015}
%}

%@inproceedings{rangel2015overview,
%  title={Overview of the 3nd Author Profiling Task at PAN 2015},
%  author={Rangel, Francisco and Rosso, Paolo and Potthast, Martin and Stein, Benno and Daelemans, Walter},
%  booktitle={CLEF 2015 Labs and Workshops, Notebook Papers},
%  editor= {Cappellato, L and Ferro, N and Gareth, J and San Juan, E},
%  url={CEUR-WS.org},
%  volume={1391},
%  year={2015},
%
%}

%%% Plagiarism Detection Task 2015
@INPROCEEDINGS{potthast:2015,
        AUTHOR             = {Martin Potthast and Matthias Hagen and Steve G{\"o}ring and Paolo Rosso and Benno Stein},
        BOOKTITLE          = {Working Notes Papers of the CLEF 2015 Evaluation Labs},
        ISBN               = {},
        ISSN               = {1613-0073},
        MONTH              = sep,
        PUBLISHER          = {CLEF and CEUR-WS.org},
        SERIES             = {CEUR Workshop Proceedings},
        TITLE              = {{Overview of the 7th International Competition on Plagiarism Detection}},
        URL                = {http://www.clef-initiative.eu/publication/working-notes},
        YEAR               = {2015}
}

%%% TIRA
@INPROCEEDINGS{gollub:2012,
        AUTHOR             = {Tim Gollub and Benno Stein and Steven Burrows},
        BOOKTITLE          = {35th International ACM Conference on Research and Development in Information Retrieval (SIGIR 12)},
        DOI                = {http://dx.doi.org/10.1145/2348283.2348501},
        EDITOR             = {Bill Hersh and Jamie Callan and Yoelle Maarek and Mark Sanderson},
        ISBN               = {978-1-4503-1472-5},
        MONTH              = aug,
        PAGES              = {1125-1126},
        PUBLISHER          = {ACM},
        SITE               = {Portland, Oregon},
        TITLE              = {{Ousting Ivory Tower Research: Towards a Web Framework for Providing Experiments as a Service}},
        YEAR               = {2012}
}

@article{koppel2002automatically,
  title={Automatically categorizing written texts by author gender},
  author={Koppel, Moshe and Argamon, Shlomo and Shimoni, Anat Rachel},
  journal={Literary and Linguistic Computing},
  volume={17},
  number={4},
  pages={401--412},
  year={2002},
  publisher={ALLC}
}

@inproceedings{schler2006effects,
  title={Effects of Age and Gender on Blogging.},
  author={Schler, Jonathan and Koppel, Moshe and Argamon, Shlomo and Pennebaker, James W},
  booktitle={AAAI Spring Symposium: Computational Approaches to Analyzing Weblogs},
  volume={6},
  pages={199--205},
  year={2006}
}

@article{lopezusing,
  title={Using Intra-Profile Information for Author Profiling},
  author={L{\'o}pez-Monroy, A Pastor and Montes-y-G{\'o}mez, Manuel and Escalante, Hugo Jair and Villase{\~n}or-Pineda, Luis}
}

@article{maharjansimple,
  title={A Simple Approach to Author Profiling in MapReduce},
  author={Maharjan, Suraj and Shrestha, Prasha and Solorio, Thamar}
}

@article{weren6exploring,
  title={Exploring Information Retrieval features for Author Profiling—Notebook for PAN at CLEF 2014},
  author={Weren, Edson RD and Moreira, Viviane P and de Oliveira, Jos{\'e} PM},
  journal={Cappellato et al.[6]}
}

@article{villenadaedalus,
  title={DAEDALUS at PAN 2014: Guessing Tweet Author's Gender and Age},
  author={Villena-Rom{\'a}n, Julio and Gonz{\'a}lez-Crist{\'o}bal, Jos{\'e} Carlos}
}

@article{marquardt2014age,
  title={Age and gender identification in social media},
  author={Marquardt, James and Farnadi, Golnoosh and Vasudevan, Gayathri and Moens, Marie-Francine and Davalos, Sergio and Teredesai, Ankur and De Cock, Martine},
  journal={Proceedings of CLEF 2014 Evaluation Labs},
  year={2014}
}

@article{castillounsupervised,
  title={Unsupervised method for the authorship identification task},
  author={Castillo, Esteban and Cervantes, Ofelia and Vilari{\~n}o, Darnes and Pinto, David and Le{\'o}n, Saul}
}

@article{giladensemble,
  title={Ensemble Learning Approach for Author Profiling},
  author={Gilad Gressel, Hrudya P and Surendran, K and Thara, S and Aravind, A}
}

@inproceedings{schmid1994probabilistic,
  title={Probabilistic part-of-speech tagging using decision trees},
  author={Schmid, Helmut},
  booktitle={Proceedings of the international conference on new methods in language processing},
  volume={12},
  pages={44--49},
  year={1994},
  organization={Citeseer}
}

@inproceedings{rangel2015overview,
  title={Overview of the 3nd Author Profiling Task at PAN 2015},
  author={Rangel, Francisco and Rosso, Paolo and Potthast, Martin and Stein, Benno and Daelemans, Walter},
  booktitle={CLEF 2015 Labs and Workshops, Notebook Papers},
  editor= {Cappellato, L and Ferro, N and Gareth, J and San Juan, E},
  url={CEUR-WS.org},
  volume={1391},
  year={2015},

}


text:
package redis

import (
	"encoding/json"
	"time"

	"github.com/go-redis/redis"
)

type RedisHandler struct {
	client   *redis.Client
	duration time.Duration
}

// NewHandler ...
func NewHandler(client *redis.Client, duration time.Duration) *RedisHandler {
	return &RedisHandler{
		client:   client,
		duration: duration,
	}
}

// Set ...
func (r *RedisHandler) Set(key string, value interface{}) error {
	jbyt, err := json.Marshal(value)
	if err != nil {
		return err
	}
	status := r.client.Set(key, string(jbyt), r.duration)
	return status.Err()
}

// Get ...
func (r *RedisHandler) Get(key string) (res []byte, err error) {
	cmd := r.client.Get(key)
	return cmd.Bytes()
}

repository: golangid/testada-example

repo_name: golangid/testada-example

gha_language: Go


text:
package main

import (
	"flag"
	"fmt"
	"log"
	"os"
	"strings"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/s3"
	"github.com/aws/aws-sdk-go/service/s3/s3manager"
)

var awsRegion = flag.String("region", "us-west-1", "AWS Region")
var bucket = flag.String("bucket", "", "S3 bucket (required)")
var prefix = flag.String("prefix", "", "S3 key prefix (required)")

func main() {
	flag.Parse()
	argsErr := "Missing required arg:"
	if *bucket == "" {
		log.Fatalln(argsErr, "bucket")
	}
	if *prefix == "" {
		log.Fatalln(argsErr, "prefix")
	}

	awsSession := session.New(&aws.Config{Region: aws.String(*awsRegion)})
	svc := s3.New(awsSession)
	loi := &s3.ListObjectsInput{
		Bucket: bucket,
		Prefix: prefix,
	}
	listObjectsO, err := svc.ListObjects(loi)
	if err != nil {
		log.Fatalln("ListObjects failed:", err)
	}
	if *listObjectsO.IsTruncated {
		fmt.Println("ListObjectsOutput is truncated")
	}
	downloader := s3manager.NewDownloader(awsSession)
	fmt.Println("found keys:")
	for _, v := range listObjectsO.Contents {
		key := *v.Key
		fmt.Print("Downloading ", key, " ... ")
		file := getFile(key)
		_, err := downloader.Download(file,
			&s3.GetObjectInput{
				Bucket: aws.String(*bucket),
				Key:    aws.String(key),
			})
		if err != nil {
			log.Fatalln("Failed to download file", err)
		}
		fmt.Println("done")
		file.Close()
	}
	fmt.Println("DONE")
}

func getFile(key string) *os.File {
	fields := strings.Split(key, "/")
	filename := fields[len(fields)-1]
	file, err := os.Create(filename)
	if err != nil {
		log.Fatalln("Failed to create file", err)
	}
	return file
}


text:
SECTION = "devel/chicken"
DESCRIPTION = "Encoding and decoding of base64 strings"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://base64.meta;md5=ec0b0735d03bfcf8be9885680e4f000f"

SRC_URI = "http://code.call-cc.org/egg-tarballs/4/base64/base64-${PV}.tar.gz"

SRC_URI[md5sum] = "127539c8fcbb32d08c7faf325a89dfaa"
SRC_URI[sha256sum] = "1336c65b9a29389d9569b4383622c5ee917dfc651ad82ff43f8e8ac2a71f3275"

S = "${WORKDIR}/base64-${PV}"

inherit chicken_install

BBCLASSEXTEND = "cross crosssdk nativesdk"

repository: OSSystems/meta-chicken

repo_name: OSSystems/meta-chicken


text:
@misc{1903.01841,
 author = {Taylor R. Brown},
 eprint = {arXiv:1903.01841},
 title = {A Factor Stochastic Volatility Model with Markov-Switching Panic Regimes},
 year = {2019}
}


text:
## Robin Sebastian (https://github.com/robseb) (git@robseb.de) 2019-2021

SUMMARY = "Linux Kernel 5.11 for Intel PSG (ALTERA) SoC-FPGAs"
DESCRIPTION = "Linux Kernel 5.11 for Intel PSG (ALTERA) SoC-FPGAs"

LINUX_VERSION = "5.11"

# Note: Thu Apr 1 13:09:06 2021 -0500
SRCREV = "164aa6229f7024bc6f8984e7b820e607e8234f61"

include linux-altera.inc

LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"

FILESEXTRAPATHS_prepend := "${THISDIR}/config:"

SRC_URI_append_cyclone5 = " file://lbdaf.scc "
SRC_URI_append_arria5 = " file://lbdaf.scc   "
SRC_URI_append_arria10 = " file://lbdaf.scc "

repository: BobAfwata/meta-intelfpga

repo_name: BobAfwata/meta-intelfpga


text:
package compute

import (
	"fmt"
	"io"
	"os"
	"os/exec"
	"path/filepath"
	"time"

	"github.com/fastly/cli/pkg/errors"
	fstexec "github.com/fastly/cli/pkg/exec"
	"github.com/fastly/cli/pkg/filesystem"
	"github.com/fastly/cli/pkg/text"
)

// AssemblyScript implements a Toolchain for the AssemblyScript language.
type AssemblyScript struct {
	timeout int
}

// NewAssemblyScript constructs a new AssemblyScript.
func NewAssemblyScript(timeout int) *AssemblyScript {
	return &AssemblyScript{timeout}
}

// Verify implements the Toolchain interface and verifies whether the
// AssemblyScript language toolchain is correctly configured on the host.
func (a AssemblyScript) Verify(out io.Writer) error {
	// 1) Check `npm` is on $PATH
	//
	// npm is Node/AssemblyScript's toolchain installer and manager, it is
	// needed to assert that the correct versions of the asc compiler and
	// @fastly/as-compute package are installed. We only check whether the
	// binary exists on the users $PATH and error with installation help text.
	fmt.Fprintf(out, "Checking if npm is installed...\n")

	p, err := exec.LookPath("npm")
	if err != nil {
		return errors.RemediationError{
			Inner:       fmt.Errorf("`npm` not found in $PATH"),
			Remediation: fmt.Sprintf("To fix this error, install Node.js and npm by visiting:\n\n\t$ %s", text.Bold("https://nodejs.org/")),
		}
	}

	fmt.Fprintf(out, "Found npm at %s\n", p)

	// 2) Check package.json file exists in $PWD
	//
	// A valid npm package is needed for compilation and to assert whether the
	// required dependencies are installed locally. Therefore, we first assert
	// whether one exists in the current $PWD.
	fpath, err := filepath.Abs("package.json")
	if err != nil {
		return fmt.Errorf("getting package.json path: %w", err)
	}

	if !filesystem.FileExists(fpath) {
		return errors.RemediationError{
			Inner:       fmt.Errorf("package.json not found"),
			Remediation: fmt.Sprintf("To fix this error, run the following command:\n\n\t$ %s", text.Bold("npm init")),
		}
	}

	fmt.Fprintf(out, "Found package.json at %s\n", fpath)

	// 3) Check if `asc` is installed.
	//
	// asc is the AssemblyScript compiler. We first check if it exists in the
	// package.json and then whether the binary exists in the npm bin directory.
	fmt.Fprintf(out, "Checking if AssemblyScript is installed...\n")
	if !checkPackageDependencyExists("assemblyscript") {
		return errors.RemediationError{
			Inner:       fmt.Errorf("`assemblyscript` not found in package.json"),
			Remediation: fmt.Sprintf("To fix this error, run the following command:\n\n\t$ %s", text.Bold("npm install --save-dev assemblyscript")),
		}
	}

	p, err = getNpmBinPath()
	if err != nil {
		return errors.RemediationError{
			Inner:       fmt.Errorf("could not determine npm bin path"),
			Remediation: fmt.Sprintf("To fix this error, run the following command:\n\n\t$ %s", text.Bold("npm install --global npm@latest")),
		}
	}

	path, err := exec.LookPath(filepath.Join(p, "asc"))
	if err != nil {
		return fmt.Errorf("getting asc path: %w", err)
	}
	if !filesystem.FileExists(path) {
		return errors.RemediationError{
			Inner:       fmt.Errorf("`asc` binary not found in %s", p),
			Remediation: fmt.Sprintf("To fix this error, run the following command:\n\n\t$ %s", text.Bold("npm install --save-dev assemblyscript")),
		}
	}

	fmt.Fprintf(out, "Found asc at %s\n", path)

	return nil
}

// Initialize implements the Toolchain interface and initializes a newly cloned
// package by installing required dependencies.
func (a AssemblyScript) Initialize(out io.Writer) error {
	// 1) Check `npm` is on $PATH
	//
	// npm is Node/AssemblyScript's toolchain package manager, it is needed to
	// install the package dependencies on initialization. We only check whether
	// the binary exists on the users $PATH and error with installation help text.
	fmt.Fprintf(out, "Checking if npm is installed...\n")

	p, err := exec.LookPath("npm")
	if err != nil {
		return errors.RemediationError{
			Inner:       fmt.Errorf("`npm` not found in $PATH"),
			Remediation: fmt.Sprintf("To fix this error, install Node.js and npm by visiting:\n\n\t$ %s", text.Bold("https://nodejs.org/")),
		}
	}

	fmt.Fprintf(out, "Found npm at %s\n", p)

	// 2) Check package.json file exists in $PWD
	//
	// A valid npm package manifest file is needed for the install command to
	// work. Therefore, we first assert whether one exists in the current $PWD.
	fpath, err := filepath.Abs("package.json")
	if err != nil {
		return fmt.Errorf("getting package.json path: %w", err)
	}

	if !filesystem.FileExists(fpath) {
		return errors.RemediationError{
			Inner:       fmt.Errorf("package.json not found"),
			Remediation: fmt.Sprintf("To fix this error, run the following command:\n\n\t$ %s", text.Bold("npm init")),
		}
	}

	fmt.Fprintf(out, "Found package.json at %s\n", fpath)
	fmt.Fprintf(out, "Installing package dependencies...\n")

	cmd := fstexec.Streaming{
		Command: "npm",
		Args:    []string{"install"},
		Env:     []string{},
		Output:  out,
	}
	return cmd.Exec()
}

// Build implements the Toolchain interface and attempts to compile the package
// AssemblyScript source to a Wasm binary.
func (a AssemblyScript) Build(out io.Writer, verbose bool) error {
	// Check if bin directory exists and create if not.
	pwd, err := os.Getwd()
	if err != nil {
		return fmt.Errorf("getting current working directory: %w", err)
	}
	binDir := filepath.Join(pwd, "bin")
	if err := filesystem.MakeDirectoryIfNotExists(binDir); err != nil {
		return fmt.Errorf("making bin directory: %w", err)
	}

	npmdir, err := getNpmBinPath()
	if err != nil {
		return fmt.Errorf("getting npm path: %w", err)
	}

	args := []string{
		"assembly/index.ts",
		"--binaryFile",
		filepath.Join(binDir, "main.wasm"),
		"--optimize",
		"--noAssert",
	}
	if verbose {
		args = append(args, "--verbose")
	}

	cmd := fstexec.Streaming{
		Command: filepath.Join(npmdir, "asc"),
		Args:    args,
		Env:     []string{},
		Output:  out,
	}
	if a.timeout > 0 {
		cmd.Timeout = time.Duration(a.timeout) * time.Second
	}
	if err := cmd.Exec(); err != nil {
		return err
	}

	return nil
}

repository: mattg-sigsci/cli

repo_name: mattg-sigsci/cli


text:
DESCRIPTION = "Configuration for machine specific gps devices"
SECTION = "console/network"
PRIORITY = "optional"
LICENSE = "GPL"
RDEPENDS_${PN} = "gpsd"
PR = "r0"

SRC_URI_append_om-gta01 = " \
                        file://restart_gllin.sh \
                        file://gpsd-default \
                        file://gps-hardware \
"

do_install_append_om-gta01() {
    install -d ${D}${sysconfdir}/apm/resume.d
    install -m 755 ${WORKDIR}/om-gta01/restart_gllin.sh ${D}/${sysconfdir}/apm/resume.d
    install -d ${D}${sysconfdir}/init.d
    install -m 755 ${WORKDIR}/om-gta01/gps-hardware ${D}${sysconfdir}/init.d
    install -d ${D}/${sysconfdir}/default
    install -m 0644 ${WORKDIR}/om-gta01/gpsd-default ${D}/${sysconfdir}/default/gpsd.default
}

pkg_postinst_append_om-gta01() {
    update-alternatives --install ${sysconfdir}/default/gpsd gpsd-defaults ${sysconfdir}/default/gpsd.default 50
}

pkg_postrm_append_om-gta01() {
    update-alternatives --remove gpsd-defaults ${sysconfdir}/default/gpsd.default
}

PACKAGE_ARCH = "${MACHINE_ARCH}"


text:
// Copyright Project Harbor 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 latestpl

import (
	"fmt"
	"math"
	"sort"

	"github.com/goharbor/harbor/src/common/utils"
	"github.com/goharbor/harbor/src/lib/log"
	"github.com/goharbor/harbor/src/lib/selector"
	"github.com/goharbor/harbor/src/pkg/retention/policy/action"
	"github.com/goharbor/harbor/src/pkg/retention/policy/rule"
)

const (
	// TemplateID of the rule
	TemplateID = "latestPulledN"

	// ParameterN is the name of the metadata parameter for the N value
	ParameterN = TemplateID

	// DefaultN is the default number of tags to retain
	DefaultN = 10
)

type evaluator struct {
	n int
}

func (e *evaluator) Process(artifacts []*selector.Candidate) ([]*selector.Candidate, error) {
	sort.Slice(artifacts, func(i, j int) bool {
		return artifacts[i].PulledTime > artifacts[j].PulledTime
	})

	i := e.n
	if i > len(artifacts) {
		i = len(artifacts)
	}

	return artifacts[:i], nil
}

func (e *evaluator) Action() string {
	return action.Retain
}

// New constructs an evaluator with the given parameters
func New(params rule.Parameters) rule.Evaluator {
	if params != nil {
		if p, ok := params[ParameterN]; ok {
			if v, ok := utils.ParseJSONInt(p); ok && v >= 0 {
				return &evaluator{n: int(v)}
			}
		}
	}

	log.Warningf("default parameter %d used for rule %s", DefaultN, TemplateID)

	return &evaluator{n: DefaultN}
}

// Valid ...
func Valid(params rule.Parameters) error {
	if params != nil {
		if p, ok := params[ParameterN]; ok {
			if v, ok := utils.ParseJSONInt(p); ok {
				if v < 0 {
					return fmt.Errorf("%s is less than zero", ParameterN)
				}
				if v >= math.MaxInt16 {
					return fmt.Errorf("%s is too large", ParameterN)
				}
			} else {
				return fmt.Errorf("%s type error", ParameterN)
			}
		}
	}
	return nil
}

repository: goharbor/harbor

repo_name: goharbor/harbor


text:
DESCRIPTION = "Xqt2 is an X-Server than runs within the Opie environment"
HOMEPAGE = "http://xqt.sourceforge.jp"
DEPENDS = "freetype libxi libxmu flex-native virtual/libqte2 libqpe-opie"
LICENSE = "GPL"
SECTION = "opie/applications"
APPTYPE = "binary"
APPNAME = "Xqt"
PR = "r4"

inherit palmtop

SRC_URI = "cvs://anonymous@cvs.sourceforge.jp/cvsroot/xqt;module=xqt2;method=pserver;date=${PV} \
        ftp://ftp.xfree86.org/pub/XFree86/4.3.0/source/X430src-1.tgz;name=archive1 \
        ftp://ftp.xfree86.org/pub/XFree86/4.3.0/source/X430src-2.tgz;name=archive2 \
        ftp://ftp.xfree86.org/pub/XFree86/4.3.0/source/X430src-3.tgz;name=archive3 \
        ftp://ftp.xfree86.org/pub/XFree86/4.3.0/source/X430src-4.tgz;name=archive4 \
        ftp://ftp.xfree86.org/pub/XFree86/4.3.0/source/X430src-5.tgz;name=archive5 \
        file://KeyMap.patch \
        file://moc_call.patch \
        file://imake-staging.patch \
        file://cross.patch \
        file://fephack.patch \
        file://xchar2b.patch \
        file://xqt-make.patch \
        file://fix_qtscreen_HACK.patch \
	file://fix_seqfault_qtscreen.patch "
S = "${WORKDIR}/xc"

QT_LIBRARY = '${@base_conditional("PALMTOP_USE_MULTITHREADED_QT", "yes", "qte-mt", "qte",d)}'
QT_LIBRARY_append_c7x0 = " -laticore"

do_configure() {
	#general config
	echo "#define BuildServersOnly YES" > config/cf/host.def
	echo "#define ProjectRoot /usr" >> config/cf/host.def

	# do not build these XServers
	echo "#define XnestServer NO"  >> config/cf/host.def
	echo "#define XdmxServer NO"  >> config/cf/host.def

	# build commands
	echo "#define CcCmd ${CC}" >> config/cf/host.def
	echo "#define CplusplusCmd ${CXX}" >> config/cf/host.def
	echo "#define LdCmd ${LD}" >> config/cf/host.def

	# Qt defines
	echo "#define QtCmnDefs -fno-exceptions -fno-rtti" >> config/cf/host.def
	echo "#define QtDir ${QTDIR}" >> config/cf/host.def
	echo "#define QtLibs -lqpe -l${QT_LIBRARY} -lm -lpng -ljpeg -lts -lsupc++" >> config/cf/host.def
	echo "#define MocBin ${STAGING_BINDIR_NATIVE}/moc" >> config/cf/host.def
	echo "#define QtDefs -DQWS -DOPIE_NEW_MALLOC -DOPIE_NO_ERASE_RECT_HACKFIX  QtCmnDefs" >> config/cf/host.def

	# Build these XServers
	echo "#define XqtXServer  YES" >> config/cf/host.def
	echo "#define XF86Server  NO"  >> config/cf/host.def
	echo "#define TinyXServer YES" >> config/cf/host.def
	echo "#define KDriveXServer YES" >> config/cf/host.def
	echo "#define KdriveServerExtraDefines -DDDXOSFATALERROR -DDDXOSVERRORF" >> config/cf/host.def

	# General Config
	echo "#define SystemUsrIncDir ${STAGING_INCDIR}" >> config/cf/host.def
	echo "#define IncRoot ${STAGING_INCDIR}" >> config/cf/host.def
	echo "#define LdPostLib -L${STAGING_LIBDIR}" >> config/cf/host.def

	echo "#undef BuildRandR " >> config/cf/host.def
	echo "#define BuildRandR YES" >> config/cf/host.def
	echo "#define BuildLBX YES" >> config/cf/host.def

	# change standard defines
	if [ ${TARGET_ARCH} = "arm" ]; then
		echo "#define StandardDefines -Dlinux -D__arm__ -D_POSIX_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE" >> config/cf/host.def
		echo "#define Arm32Architecture" >> config/cf/host.def
	fi
	echo "" > config/cf/date.def
}

do_compile() {
    export TOPDIR=${TOPDIR}
    mkdir -p programs/Xserver/hw/xqt
    #cp -R ../xqt-driver/* programs/Xserver/hw/xqt
    (cd programs/Xserver/hw/xqt && ln -s ../../../../../xqt2/xfree86/xqt-driver/* .)
	unset CC
	make -C config/imake -f Makefile.ini CC="${BUILD_CC}" BOOTSTRAPCFLAGS="${BUILD_CFLAGS}" clean imake
	make CC="${BUILD_CC}" xmakefile
	make Makefiles
	make clean
	#make depend
	make includes CC="${BUILD_CC}"
	make -C config/util CC="${BUILD_CC}"
	for l in font xtrans Xdmcp Xau lbxutil; do make -C lib/$l CC="${CC}" LD="${LD}" CC_STAGING="-I${STAGING_INCDIR}" LD_STAGING="-L${STAGING_LIBDIR}"; done
	make -C programs/Xserver CC="${CC}" LD="${LD}" CC_STAGING="-I${STAGING_INCDIR}" LD_STAGING="-L${STAGING_LIBDIR}" INSTALLED_LIBS=""
}

do_stage() {
	install -d ${STAGING_INCDIR}/xserver-xqt
	install -m 0644 programs/Xserver/hw/xfree86/common/fourcc.h ${STAGING_INCDIR}/xserver-xqt
}

do_install() {
	oe_runmake -C programs/Xserver DESTDIR="${D}" CC="${CC}" LD="${LD}" \
                   CC_STAGING="-I${STAGING_INCDIR}" LD_STAGING="-L${STAGING_LIBDIR}" INSTALLED_LIBS="" install
	oe_runmake -C lib/font DESTDIR="${D}" CC="${CC}" LD="${LD}" \
                   CC_STAGING="-I${STAGING_INCDIR}" LD_STAGING="-L${STAGING_LIBDIR}" INSTALLED_LIBS="" install

	install -d ${D}${palmtopdir}/apps/Applications/
	install -m 0644 ${WORKDIR}/xqt2/xfree86/files/Xqt.desktop ${D}${palmtopdir}/apps/Applications
	install -d ${D}${palmtopdir}/pics
	install -m 0644 programs/Xserver/hw/xqt/Xqt.png ${D}${palmtopdir}/pics
}

PACKAGE_ARCH_c7x0 = "${MACHINE_ARCH}"

SRC_URI[archive1.md5sum] = "4f241a4f867363f40efa2b00dca292af"
SRC_URI[archive1.sha256sum] = "5276b045e154948fce7abba7d686406c65862d90b43b50f2546b33e38378f0d7"
SRC_URI[archive2.md5sum] = "844c2ee908d21dbf8911fd13115bf8b4"
SRC_URI[archive2.sha256sum] = "0afbf41d0f4bcaceb1381fc1882b80f62548845b85c83c3eb0f3a9ac7f7f96ef"
SRC_URI[archive3.md5sum] = "b82a0443e1b7bf860e4343e6b6766cb6"
SRC_URI[archive3.sha256sum] = "19a830e3657851ad575ca895eb59932f1d90cd03735dec68f900dbc1bb6c3b7f"
SRC_URI[archive4.md5sum] = "567903747018f2534965ab6cb3976b38"
SRC_URI[archive4.sha256sum] = "f62081c6f8a70a35fb0b5b210329f6bba7f5e506e9b809e23ceba21a2c35278e"
SRC_URI[archive5.md5sum] = "4dbdbe9a85c8f7f98dd0ee015a3c7b4f"
SRC_URI[archive5.sha256sum] = "3b732ed179dd34c17d1ba17867b60a36f20d82a3f0eca7b084fcb5396aa2b30c"


text:
# Declares the dependencies of an application:
# Usage: DeclareAppDependencies( appTargetName [mrpt-xxx [mrpt-yyy] ...] )
#
add_custom_target(apps_all ALL)

macro(mrpt_return_if_not_wxwidgets)
	if(NOT CMAKE_MRPT_HAS_WXWIDGETS)
		message(STATUS "No wxWidgets: Skipping target `${PROJECT_NAME}`")
		return()
	endif()
endmacro()

macro(mrpt_return_if_not_nanogui)
	if(NOT CMAKE_MRPT_HAS_NANOGUI)
		message(STATUS "Build without nanogui: Skipping target `${PROJECT_NAME}`")
		return()
	endif()
endmacro()

macro(DeclareAppDependencies name)
	add_dependencies(apps_all ${name})

	# Set app names:
	set_target_properties(${name} PROPERTIES FOLDER "applications")

	set(ALL_DEPS ${ARGN})
	#message(STATUS "Adding deps: ${name} --> ${ALL_DEPS}")

	set(AUX_ALL_DEPS_BUILD 1)  # Will be set to "0" if any dependency if not built

	foreach (_DEP ${ALL_DEPS})
		# Check if all dependencies are to be build:
		string(REGEX REPLACE "mrpt::(.*)" "\\1" DEP_MRPT_NAME ${_DEP})
		if ("${BUILD_mrpt-${DEP_MRPT_NAME}}" STREQUAL "OFF")
			set(AUX_ALL_DEPS_BUILD 0)
			message(STATUS "*Warning*: App ${name} cannot be built because dependency mrpt-${DEP_MRPT_NAME} has been disabled!")
		endif()
	endforeach()

	# Impossible to build?
	if (NOT AUX_ALL_DEPS_BUILD)
		message(STATUS "*Warning* ==> Forcing BUILD_APP_${name}=OFF for missing dependencies listed above (re-enable manually if needed).")
		set(BUILD_APP_${name} OFF CACHE BOOL "Build ${name}" FORCE) # this var is checked in [MRPT]/app/CMakeLists.txt
		mark_as_advanced(CLEAR BUILD_APP_${name})
		return()
	endif()

	# We need pthread's on unices
	target_link_libraries(${name} Threads::Threads)

	add_dependencies(${name} ${ALL_DEPS})
	target_link_libraries(${name} ${ALL_DEPS})

endmacro()

# Macro for adding links to the Start menu folder (for binary packages in Windows)
macro(AppStartMenuLink name title)
	get_property(_str GLOBAL PROPERTY "MRPT_CPACK_PACKAGE_EXECUTABLES")
	set_property(GLOBAL PROPERTY "MRPT_CPACK_PACKAGE_EXECUTABLES" "${_str}${name};${title};")
endmacro()

macro(DeclareAppForInstall name)
install(TARGETS ${name}
	RUNTIME DESTINATION bin COMPONENT Apps
	LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Apps
	ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Apps)
endmacro()

repository: MRPT/mrpt

repo_name: MRPT/mrpt

branch_name: refs/heads/develop


text:
SUMMARY = "An image for running Pi-Launch-Control on a raspberry Pi Zero W."
HOMEPAGE = "https://bvarner.github.io"
LICENSE = "MIT"

KERNEL_MODULE_AUTOLOAD += "bcm2835-v4l2"
KERNEL_MODULE_PROBECONF += "bcm2835-v4l2"
KERNEL_DEVICETREE += " overlays/hx711-rocketstand.dtbo"

include images/varnerized-raspberrypi.bb

IMAGE_INSTALL += " \
    i2c-tools \
    v4l-utils \
    pi-launch-control \
"

# Sets up an /etc/wpa_supplicant directory, where you can put configurations for
# wpa_supplicant for your network devices.
# Enables wpa_supplicant for 802.11 on wlan0
setup_wpa_supplicant_append() {
    # Hackup the wlan.network to setup wlan0 as a DHCP server with a static IP address.
    rm ${IMAGE_ROOTFS}/etc/systemd/network/wlan.network
    touch ${IMAGE_ROOTFS}/etc/systemd/network/wlan.network

    echo '[Match]' >> ${IMAGE_ROOTFS}/etc/systemd/network/wlan.network
    echo 'Name=wlan0' >> ${IMAGE_ROOTFS}/etc/systemd/network/wlan.network

    echo '[Network]' >> ${IMAGE_ROOTFS}/etc/systemd/network/wlan.network

    # If the SSID is null, setup a "RocketStand" adhoc network with this machine acting as the DHCP server at 192.168.1.1
    if [ -z "${ssid}" ]; then
        echo 'Address=192.168.1.1/24' >> ${IMAGE_ROOTFS}/etc/systemd/network/wlan.network
        echo 'DHCPServer=yes' >> ${IMAGE_ROOTFS}/etc/systemd/network/wlan.network

        echo '[DHCPServer]' >> ${IMAGE_ROOTFS}/etc/systemd/network/wlan.network
        echo 'PoolOffset=50' >> ${IMAGE_ROOTFS}/etc/systemd/network/wlan.network
        echo 'PoolSize=50' >> ${IMAGE_ROOTFS}/etc/systemd/network/wlan.network
        echo 'DefaultLeaseTimeSec=900s' >> ${IMAGE_ROOTFS}/etc/systemd/network/wlan.network
        echo 'EmitDNS=no' >> ${IMAGE_ROOTFS}/etc/systemd/network/wlan.network
        echo 'EmitNTP=no' >> ${IMAGE_ROOTFS}/etc/systemd/network/wlan.network
        echo 'EmitRouter=no' >> ${IMAGE_ROOTFS}/etc/systemd/network/wlan.network
        echo 'EmitTimezone=no' >> ${IMAGE_ROOTFS}/etc/systemd/network/wlan.network

        # Update the wpa_supplicant to create an adhoc base station known as 'RocketStand'.
        echo 'ap_scan=2' >> ${IMAGE_ROOTFS}/etc/wpa_supplicant/wpa_supplicant-nl80211-wlan0.conf
        echo 'network={' >> ${IMAGE_ROOTFS}/etc/wpa_supplicant/wpa_supplicant-nl80211-wlan0.conf
        echo '    ssid="RocketStand"' >> ${IMAGE_ROOTFS}/etc/wpa_supplicant/wpa_supplicant-nl80211-wlan0.conf
        echo '    mode=2' >> ${IMAGE_ROOTFS}/etc/wpa_supplicant/wpa_supplicant-nl80211-wlan0.conf
        echo '    frequency=2432' >> ${IMAGE_ROOTFS}/etc/wpa_supplicant/wpa_supplicant-nl80211-wlan0.conf
        echo '    proto=RSN' >> ${IMAGE_ROOTFS}/etc/wpa_supplicant/wpa_supplicant-nl80211-wlan0.conf
        echo '    key_mgmt=WPA-PSK' >> ${IMAGE_ROOTFS}/etc/wpa_supplicant/wpa_supplicant-nl80211-wlan0.conf
        echo '    pairwise=CCMP' >> ${IMAGE_ROOTFS}/etc/wpa_supplicant/wpa_supplicant-nl80211-wlan0.conf
        echo '    group=CCMP' >> ${IMAGE_ROOTFS}/etc/wpa_supplicant/wpa_supplicant-nl80211-wlan0.conf

        # Use the psk if set, otherwise, use 'ignition'.
        if [ -n "${psk}" ]; then
            echo '    psk="${psk}"' >> ${IMAGE_ROOTFS}/etc/wpa_supplicant/wpa_supplicant-nl80211-wlan0.conf
        else
            echo '    psk="ignition"' >> ${IMAGE_ROOTFS}/etc/wpa_supplicant/wpa_supplicant-nl80211-wlan0.conf
        fi
        echo '}' >> ${IMAGE_ROOTFS}/etc/wpa_supplicant/wpa_supplicant-nl80211-wlan0.conf
    else
        # Otherwise, setup DHCP client and route metric.
        echo 'DHCP=yes' >> ${IMAGE_ROOTFS}/etc/systemd/network/wlan.network
        echo '[DHCP]' >> ${IMAGE_ROOTFS}/etc/systemd/network/wlan.network
        echo 'RouteMetric=20' >> ${IMAGE_ROOTFS}/etc/systemd/network/wlan.network
    fi
}

export IMAGE_BASENAME = "rocketstand-image"

repository: Wave-Therapeutics/meta-varnerized

repo_name: Wave-Therapeutics/meta-varnerized


text:
require gkrellm.inc

PR = "${INC_PR}.0"

SRC_URI[md5sum] = "8ced6843f4681ad8501fd04285ecff1f"
SRC_URI[sha256sum] = "eae0a6862fe6131c67c2f8bca451b0410e69229a5a16463dd1f2266b3ff13dcb"

repository: jwilkins/meta-raspberrypi

repo_name: jwilkins/meta-raspberrypi


text:
package extensions

import (
	"bytes"
	"crypto/x509"
	"encoding/pem"
	"regexp"
	"testing"

	"github.com/alecthomas/assert"
)

func TestDumpX509Extension(t *testing.T) {

	tests := []struct {
		inputcert string
		width     int
		expected  *regexp.Regexp
	}{
		{
			inputcert: `-----BEGIN CERTIFICATE-----
MIIFfjCCA2agAwIBAgIBBDANBgkqhkiG9w0BAQsFADAfMR0wGwYDVQQDDBRQdXBw
ZXQgQ0E6IHB1cHBldC52bTAeFw0yMDEwMjIxMzAzMzZaFw0yNTEwMjIxMzAzMzZa
MBMxETAPBgNVBAMMCG5vZGUxLnZtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC
CgKCAgEAwuku3pXXt9SPyESY0eMOSqu+TSadrlHSqyZ0clqf85B06oXjEnMHWsNq
67OdHA1rc2UHdSxafqKdfJlHD4V/hwyBG6FqtF6WsMd1edsxI63a3PXCh21SrxKv
BzXrntmWhdtJz5ivq3TyrEYEZwVWCU2GinwGagkvQEdUdqfAlAeZx+PyDq0hz+px
S709cXNIQpcstOF217oEmvsROQcUurqCwOHXTMXa5wLKDNxY9TdG6brDF+46giap
a1t+Eht4CB182v+kNBhDx+XKL+CVSsIzsvkjWpo99KASiiz4tHR99V2KPzPoCN/M
hMQKslehu5FnawKNtdHXPEy6CODikAxHKo/Fm5juvApziBrTMURYeY3b++0fJhsh
NyVzmc5TlRDc6l3TkVjkLaEYQHAKMMwFW+4WTmdSYomXUoo4AFtWeLx/uaXOY0NL
YJ/nlJZTaMxRbz7IA9nh0jOAoqoxvnXaUj/Zsl8+bhKllRNC/PswgA4wPS4qF1WL
RdHuo8zUs8geF6kAPpeaQ2iy5rnUx5O7KcXzR3ZNo27JaT3t3E5/9LROo0XCR2Cn
lxzbzMomKCdSqXKFAzSUFF2yLbPbXPjlRsYP4mccS88wxG5vUY/jp3PYjBqnLbBP
hdWNtr45rjqWnGoVcrMsp8ViVeS9AiHIxUM73msE1ozzc9VYfR8CAwEAAaOB0DCB
zTAxBglghkgBhvhCAQ0EJBYiUHVwcGV0IFNlcnZlciBJbnRlcm5hbCBDZXJ0aWZp
Y2F0ZTAfBgNVHSMEGDAWgBTWrON2HXLNhIXOOw/viiU5kKIY4DAdBgNVHQ4EFgQU
w+9WFEhP8DhoC4oaxJreaomAFRAwGAYLKwYBBAGCjEwBARYECQwHdmF1bHRvazAM
BgNVHRMBAf8EAjAAMCAGA1UdJQEB/wQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAO
BgNVHQ8BAf8EBAMCBaAwDQYJKoZIhvcNAQELBQADggIBAD5D5n4UKi8k0rFYITQg
cfv/7uyPc0PWT+N9xjs6QW8iMiEBUouv8doqOmmvAEXFaucPXukUJBmnMszfoN1i
t8xdKASNNbn6OzKq6Yw/G6OAJ9K8KJzN2o7gGv8zEyMPeh0Sthl3QjgeCqlzcp7X
DfWji3vhn1KPaGE9aE/Hb35BMo4ttBDIENmXb7AHdBfDkmAcX6mM+lGKZTpFIc90
Db0L7IdlXlR7S8Y7z9aUI20Vsv92Z+6qWrff1rjmiHN1hRvD1Cvi0xRIH3D64CQ+
Oy6WUD8wk650COB891/LWv2VUqiQ3gpjOQov2BlV8htO9bOzSs2aNMq0l0FVk4/T
ZpsmpSmki07diN1c6AgpdLxKL8yIfgGbUVefFZjnop7gZY6RU/O7m/EB/5KeLAxY
pThD6SbaroaQ2nmxsSkbm3qFC8hVI2b8TC8+o+P/+iHnxyaXsLlOTf1IJQrvWd6m
0IewOcjnsSVpeZadElFTJMo4753PCRJRwIbe7XiyDD6aiGKauHMb95s5i+Is9QGe
dW1AYTherUbOrYQ2FpWn1fcM8QpXS+2k9pMLYue/mVAcbJNM0DxwjOuG9uJFOqzB
rV+y9tkNbTPsiv3hMhkaKOoMs2qW8f3E7BI1UiRbNxsuOVV7WycFBPW8TKwBmcRj
GHG6b/SnmObT3lQ7VnGtVc1f
-----END CERTIFICATE-----`,
			expected: regexp.MustCompile(`Unknown \(1.3.6.1.4.1.34380.1.1.22\)`),
		},
	}

	for _, tc := range tests {

		pemBlock, _ := pem.Decode([]byte(tc.inputcert))

		cert, err := x509.ParseCertificate(pemBlock.Bytes)

		if err != nil {
			t.Fatalf("Error when reading cert: %v", err)
		}

		var b bytes.Buffer

		if len(cert.Extensions) > 0 {
			for _, ext := range cert.Extensions {
				DumpX509Extension(ext, 8, &b)
			}
		}

		assert.Regexp(t, tc.expected, b.String())
	}

}


text:
@ARTICLE{8716303,
  author={H. {Shang} and Z. {Liu}},
  journal={IEEE/ACM Transactions on Computational Biology and Bioinformatics},
  title={Prioritizing type 2 diabetes genes by weighted PageRank on bilayer heterogeneous networks},
  year={2019},
  volume={},
  number={},
  pages={1-1},
  doi={10.1109/TCBB.2019.2917190}}

repository: haixiashang/starter-academic

repo_name: haixiashang/starter-academic


text:
# Copyright (c) 2019 Alexei Gaidulean
# All rights reserved.
#
# Use of this source code is governed by a MIT-style license that
# can be found in the LICENSE file.

#
# General.
#

# Validate project paths section.
set(MSG_ERROR_ROOT_PATHS "Please check the root project paths section in CMakeLists.txt")

# Invalid root path.
set(MSG_INVALID_ROOT_PATH "ROOT_PATH is not valid.")

# Invalid CMake module path.
set(MSG_INVALID_CMAKE_PATH "CMAKE_MODULE_PATH is not valid or could not be found. ")


text:
@inproceedings{calibration,
  author    = {Pedro Tabacof and
               Luca Costabello},
  title     = {{Probability Calibration for Knowledge Graph Embedding Models}},
  booktitle = {{ICLR}},
  url       = {https://arxiv.org/abs/1912.10000},
  year      = 2020
}

@inproceedings{pai2021learning,
  author    = {Sumit Pai and
               Luca Costabello},
  title     = {{Learning Embeddings from Knowledge Graphs With Numeric Edge Attributes}},
  booktitle = {{IJCAI}},
  url       = {https://arxiv.org/abs/2105.08683},
  year      = 2021
}

@inproceedings{bordes2013translating,
  title={Translating embeddings for modeling multi-relational data},
  author={Bordes, Antoine and Usunier, Nicolas and Garcia-Duran, Alberto and Weston, Jason and Yakhnenko, Oksana},
  booktitle={Advances in neural information processing systems},
  pages={2787--2795},
  year={2013}
}

@inproceedings{trouillon2016complex,
  title={Complex embeddings for simple link prediction},
  author={Trouillon, Th{\'e}o and Welbl, Johannes and Riedel, Sebastian and Gaussier, {\'E}ric and Bouchard, Guillaume},
  booktitle={International Conference on Machine Learning},
  pages={2071--2080},
  year={2016}
}

@article{yang2014embedding,
  title={Embedding entities and relations for learning and inference in knowledge bases},
  author={Yang, Bishan and Yih, Wen-tau and He, Xiaodong and Gao, Jianfeng and Deng, Li},
  journal={arXiv preprint},
  arxivId = {1412.6575},
  year={2014}
}

@article{Hamaguchi2017,
arxivId = {1706.05674},
author = {Hamaguchi, Takuo and Oiwa, Hidekazu and Shimbo, Masashi and Matsumoto, Yuji},
journal = {IJCAI International Joint Conference on Artificial Intelligence},
pages = {1802--1808},
title = {{Knowledge transfer for out-of-knowledge-base entities: A graph neural network approach}},
year = {2017}
}

@article{HayashiS17,
  author    = {Katsuhiko Hayashi and
               Masashi Shimbo},
  title     = {On the Equivalence of Holographic and Complex Embeddings for Link
               Prediction},
  journal   = {CoRR},
  volume    = {abs/1702.05563},
  year      = {2017},
  url       = {http://arxiv.org/abs/1702.05563},
  archivePrefix = {arXiv},
  eprint    = {1702.05563},
  timestamp = {Mon, 13 Aug 2018 16:48:53 +0200},
  biburl    = {https://dblp.org/rec/bib/journals/corr/HayashiS17},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}

@inproceedings{sun2018rotate,
title={RotatE: Knowledge Graph Embedding by Relational Rotation in Complex Space},
author={Zhiqing Sun and Zhi-Hong Deng and Jian-Yun Nie and Jian Tang},
booktitle={International Conference on Learning Representations},
year={2019},
url={https://openreview.net/forum?id=HkgEQnRqYQ},
}

@inproceedings{DettmersMS018,
  author    = {Tim Dettmers and
               Pasquale Minervini and
               Pontus Stenetorp and
               Sebastian Riedel},
  title     = {Convolutional 2D Knowledge Graph Embeddings},
  booktitle = {Procs of AAAI},
  year      = {2018},
  url       = {https://www.aaai.org/ocs/index.php/AAAI/AAAI18/paper/view/17366}
}

@inproceedings{nickel2016holographic,
  title     = {Holographic Embeddings of Knowledge Graphs.},
  author    = {Nickel, Maximilian and Rosasco, Lorenzo and Poggio, Tomaso A and others},
  booktitle = {AAAI},
  pages     = {1955--1961},
  year      = {2016}
}

@inproceedings{bizer2011linked,
  title     = {Linked data: The story so far},
  author    = {Bizer, Christian and Heath, Tom and Berners-Lee, Tim},
  booktitle = {Semantic services, interoperability and web applications: emerging concepts},
  pages     = {205--227},
  year      = {2011},
  publisher = {IGI Global}
}

@inproceedings{suchanek2007yago,
  title        = {Yago: a core of semantic knowledge},
  author       = {Suchanek, Fabian M and Kasneci, Gjergji and Weikum, Gerhard},
  booktitle    = {Procs of WWW},
  pages        = {697--706},
  year         = {2007},
  organization = {ACM}
}

@inproceedings{auer2007dbpedia,
  title     = {Dbpedia: A nucleus for a web of open data},
  author    = {Auer, S{\"o}ren and Bizer, Christian and Kobilarov, Georgi and Lehmann, Jens and Cyganiak, Richard and Ives, Zachary},
  booktitle = {The semantic web},
  pages     = {722--735},
  year      = {2007},
  publisher = {Springer}
}

@article{wordnet,
  author  = {Princeton},
  title   = {About WordNet},
  year    = {2010},
  journal = {Web},
  note     = {https://wordnet.princeton.edu},
  urldate = {2018-08-30}
}

@article{nickel2016review,
  title     = {A review of relational machine learning for knowledge graphs},
  author    = {Nickel, Maximilian and Murphy, Kevin and Tresp, Volker and Gabrilovich, Evgeniy},
  journal   = {Procs of the IEEE},
  volume    = {104},
  number    = {1},
  pages     = {11--33},
  year      = {2016},
  publisher = {IEEE}
}

@inproceedings{toutanova2015representing,
  title={Representing text for joint embedding of text and knowledge bases},
  author={Toutanova, Kristina and Chen, Danqi and Pantel, Patrick and Poon, Hoifung and Choudhury, Pallavi and Gamon, Michael},
  booktitle={Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing},
  pages={1499--1509},
  year={2015}
}

@inproceedings{mahdisoltani2013yago3,
  title={Yago3: A knowledge base from multilingual wikipedias},
  author={Mahdisoltani, Farzaneh and Biega, Joanna and Suchanek, Fabian M},
  booktitle={CIDR},
  year={2013}
}

@inproceedings{chen2015,
  author = { and Chen, Danqi},
  title = {Observed Versus Latent Features for Knowledge Base and Text Inference},
  booktitle = {3rd Workshop on Continuous Vector Space Models and Their Compositionality},
  year = {2015},
  month = {July},
  publisher = {ACL - Association for Computational Linguistics},
  url = {https://www.microsoft.com/en-us/research/publication/observed-versus-latent-features-for-knowledge-base-and-text-inference/},
  edition = {3rd Workshop on Continuous Vector Space Models and Their Compositionality},
}

@article{kadlecBK17,
  author    = {Rudolf Kadlec and
               Ondrej Bajgar and
               Jan Kleindienst},
  title     = {Knowledge Base Completion: Baselines Strike Back},
  journal   = {CoRR},
  volume    = {abs/1705.10744},
  year      = {2017},
  url       = {http://arxiv.org/abs/1705.10744},
  archivePrefix = {arXiv},
  eprint    = {1705.10744},
  timestamp = {Mon, 13 Aug 2018 16:47:17 +0200},
  biburl    = {https://dblp.org/rec/bib/journals/corr/KadlecBK17},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}

@inproceedings{lacroix2018canonical,
  title={Canonical Tensor Decomposition for Knowledge Base Completion},
  author={Lacroix, Timothee and Usunier, Nicolas and Obozinski, Guillaume},
  booktitle={International Conference on Machine Learning},
  pages={2869--2878},
  year={2018}
}

@article{bergstra2012random,
  title={Random search for hyper-parameter optimization},
  author={Bergstra, James and Bengio, Yoshua},
  journal={Journal of Machine Learning Research},
  volume={13},
  number={Feb},
  pages={281--305},
  year={2012}
}

@article{li2018hyperband,
  title={Hyperband: A Novel Bandit-Based Approach to Hyperparameter Optimization},
  author={Li, Lisha and Jamieson, Kevin},
  journal={Journal of Machine Learning Research},
  volume={18},
  pages={1--52},
  year={2018}
}

@inproceedings{glorot2010understanding,
  title={Understanding the difficulty of training deep feedforward neural networks},
  author={Glorot, Xavier and Bengio, Yoshua},
  booktitle={Proceedings of the thirteenth international conference on artificial intelligence and statistics},
  pages={249--256},
  year={2010}
}

@inproceedings{Nguyen2018,
  title={{A Novel Embedding Model for Knowledge Base Completion Based on Convolutional Neural Network}},
  author={Dai Quoc Nguyen and Tu Dinh Nguyen and Dat Quoc Nguyen and Dinh Phung},
  booktitle={Proceedings of the 16th Annual Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT)},
  year={2018},
  pages={327--333}
}

@article{platt1999probabilistic,
  title={Probabilistic outputs for support vector machines and comparisons to regularized likelihood methods},
  author={Platt, John and others},
  journal={Advances in large margin classifiers},
  volume={10},
  number={3},
  pages={61--74},
  year={1999},
  publisher={Cambridge, MA}
}

@article{miller1995wordnet,
  title={WordNet: a lexical database for English},
  author={Miller, George A},
  journal={Communications of the ACM},
  volume={38},
  number={11},
  pages={39--41},
  year={1995},
  publisher={ACM}
}

@inproceedings{bollacker2008freebase,
  title={Freebase: a collaboratively created graph database for structuring human knowledge},
  author={Bollacker, Kurt and Evans, Colin and Paritosh, Praveen and Sturge, Tim and Taylor, Jamie},
  booktitle={Proceedings of the 2008 ACM SIGMOD international conference on Management of data},
  pages={1247--1250},
  year={2008},
  organization={AcM}
}

@inproceedings{socher2013reasoning,
  title={Reasoning with neural tensor networks for knowledge base completion},
  author={Socher, Richard and Chen, Danqi and Manning, Christopher D and Ng, Andrew},
  booktitle={Advances in neural information processing systems},
  pages={926--934},
  year={2013}
}

@article{CN,
  author    = {Robyn Speer and
               Joshua Chin and
               Catherine Havasi},
  title     = {ConceptNet 5.5: An Open Multilingual Graph of General Knowledge},
  journal   = {CoRR},
  volume    = {abs/1612.03975},
  year      = {2016},
  url       = {http://arxiv.org/abs/1612.03975},
  archivePrefix = {arXiv},
  eprint    = {1612.03975},
  timestamp = {Fri, 31 May 2019 11:59:52 +0200},
  biburl    = {https://dblp.org/rec/bib/journals/corr/SpeerCH16},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}

@article{mitchell2018never,
  title={Never-ending learning},
  author={Mitchell, Tom and Cohen, William and Hruschka and others},
  journal={Communications of the ACM},
  volume={61},
  number={5},
  pages={103--115},
  year={2018},
  publisher={ACM New York, NY, USA}
}

@article{PPI,
  title={The STRING database in 2017: quality-controlled protein--protein association networks, made broadly accessible},
  author={Szklarczyk, Damian and Morris, John H and others},
  journal={Nucleic acids research},
  pages={gkw937},
  year={2016},
  publisher={Oxford University Press}
}

@inproceedings{chen2019embedding,
  title={Embedding uncertain knowledge graphs},
  author={Chen, Xuelu and Chen, Muhao and Shi, Weijia and Sun, Yizhou and Zaniolo, Carlo},
  booktitle={AAAI},
  volume={33},
  pages={3363--3370},
  year={2019}
}

@inproceedings{safavi_codex_2020,
  title = {{CoDEx}: A Comprehensive Knowledge Graph Completion Benchmark},
  url = {https://aclanthology.org/2020.emnlp-main.669},
  eventtitle = {{EMNLP} 2020},
  pages = {8328--8350},
  booktitle = {Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing ({EMNLP})},
  publisher = {Association for Computational Linguistics},
  author = {Safavi, Tara and Koutra, Danai},
  date = {2020-11},
  year = {2020}
}

repository: AIEdX/AmpliGraph

repo_name: AIEdX/AmpliGraph

gha_language: Python


text:
package ascpchannel

import (
	"net/url"

	"github.com/bububa/opentaobao/model"
)

// AlibabaAscpChannelRefundGoodsWaybillAPIRequest 淘外分销退货回传物流单号 API请求
// alibaba.ascp.channel.refund.goods.waybill
//
// 淘外分销退货回传物流单号
type AlibabaAscpChannelRefundGoodsWaybillAPIRequest struct {
	model.Params
	// 请求
	_refundWayBillReq *ExternalRefundGoodsWaybillRequest
}

// NewAlibabaAscpChannelRefundGoodsWaybillRequest 初始化AlibabaAscpChannelRefundGoodsWaybillAPIRequest对象
func NewAlibabaAscpChannelRefundGoodsWaybillRequest() *AlibabaAscpChannelRefundGoodsWaybillAPIRequest {
	return &AlibabaAscpChannelRefundGoodsWaybillAPIRequest{
		Params: model.NewParams(),
	}
}

// GetApiMethodName IRequest interface 方法, 获取Api method
func (r AlibabaAscpChannelRefundGoodsWaybillAPIRequest) GetApiMethodName() string {
	return "alibaba.ascp.channel.refund.goods.waybill"
}

// GetApiParams IRequest interface 方法, 获取API参数
func (r AlibabaAscpChannelRefundGoodsWaybillAPIRequest) GetApiParams(params url.Values) {
	for k, v := range r.Params {
		params.Set(k, v.String())
	}
}

// GetRawParams IRequest interface 方法, 获取API原始参数
func (r AlibabaAscpChannelRefundGoodsWaybillAPIRequest) GetRawParams() model.Params {
	return r.Params
}

// SetRefundWayBillReq is RefundWayBillReq Setter
// 请求
func (r *AlibabaAscpChannelRefundGoodsWaybillAPIRequest) SetRefundWayBillReq(_refundWayBillReq *ExternalRefundGoodsWaybillRequest) error {
	r._refundWayBillReq = _refundWayBillReq
	r.Set("refund_way_bill_req", _refundWayBillReq)
	return nil
}

// GetRefundWayBillReq RefundWayBillReq Getter
func (r AlibabaAscpChannelRefundGoodsWaybillAPIRequest) GetRefundWayBillReq() *ExternalRefundGoodsWaybillRequest {
	return r._refundWayBillReq
}

repository: bububa/opentaobao

repo_name: bububa/opentaobao


text:
inherit mender-helpers
inherit deploy

LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=89aea4e17d99a7cacdbeed46a0096b10"
S = "${WORKDIR}"

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

FILES_${PN} += "/data/mender_grubenv.config"

# TODO: We should probably move some of these into a repository.
SRC_URI = " \
    file://LICENSE \
    file://05_mender_setup_grub.cfg \
    file://06_bootargs_grub.cfg \
    file://90_mender_boot_grub.cfg \
    file://95_mender_try_to_recover_grub.cfg \
    file://blank_grubenv \
    file://fw_printenv \
"

PACKAGECONFIG[debug-pause] = ",,,"
SRC_URI_append = "${@bb.utils.contains('PACKAGECONFIG', 'debug-pause', ' file://06_mender_debug_pause_grub.cfg', '', d)}"
PACKAGECONFIG[debug-log] = ",,,"

# See https://www.gnu.org/software/grub/manual/grub/grub.html#debug
DEBUG_LOG_CATEGORY ?= "all"

do_provide_debug_log() {
    echo "debug=${DEBUG_LOG_CATEGORY}" > ${WORKDIR}/01_mender_debug_log_grub.cfg
}
python() {
    if bb.utils.contains('PACKAGECONFIG', 'debug-log', True, False, d):
        bb.build.addtask('do_provide_debug_log', 'do_patch', 'do_unpack', d)
}

do_provide_mender_defines() {
    set -x

    mender_rootfsa_part=$(get_part_number_from_device ${MENDER_ROOTFS_PART_A})
    mender_rootfsb_part=$(get_part_number_from_device ${MENDER_ROOTFS_PART_B})
    mender_grub_storage_device=$(get_grub_device_from_device_base ${MENDER_STORAGE_DEVICE_BASE})

    cat > ${WORKDIR}/00_mender_grubenv_defines_grub.cfg <<EOF
mender_rootfsa_part=$mender_rootfsa_part
mender_rootfsb_part=$mender_rootfsb_part
mender_kernel_root_base=${MENDER_STORAGE_DEVICE_BASE}
mender_grub_storage_device=$mender_grub_storage_device
kernel_imagetype=${KERNEL_IMAGETYPE}
EOF

    if [ -n "${KERNEL_DEVICETREE}" ]; then
        MENDER_DTB_NAME=$(mender_get_clean_kernel_devicetree)
        cat >> ${WORKDIR}/00_mender_grubenv_defines_grub.cfg <<EOF
kernel_devicetree=$MENDER_DTB_NAME
EOF
    fi

    # Environment files.

    # Grub uses loads of '######' to fill the empty space, so find that
    # occurrence, and write our variables there.
    mkdir -p ${WORKDIR}/mender_grubenv
    cp ${WORKDIR}/blank_grubenv ${WORKDIR}/mender_grubenv/env
    offset=$(grep '^######' -b ${WORKDIR}/mender_grubenv/env | egrep -o '^[0-9]+')
    dd of=${WORKDIR}/mender_grubenv/env bs=$offset seek=1 conv=notrunc <<EOF
bootcount=0
mender_boot_part=$(get_part_number_from_device ${MENDER_ROOTFS_PART_A})
upgrade_available=0
EOF

    # Lock files.

    cp ${WORKDIR}/blank_grubenv ${WORKDIR}/mender_grubenv/lock
    offset=$(grep '^######' -b ${WORKDIR}/mender_grubenv/lock | egrep -o '^[0-9]+')
    dd of=${WORKDIR}/mender_grubenv/lock bs=$offset seek=1 conv=notrunc <<EOF
editing=0
EOF
    ( cd ${WORKDIR}/mender_grubenv && sha256sum lock > lock.sha256sum )
}
addtask do_provide_mender_defines after do_patch before do_compile

do_compile() {
    set -x

    # Inspired by the way grub-mkconfig and /etc/grub.d works. Note that unlike
    # the original, since we are not running on the target, these are dumped as
    # they are into a common script, not executed as grub-mkconfig does.
    for script in ${WORKDIR}/[0-9][0-9]_*_grub.cfg; do
        echo "# Start of ---------- $(basename $script) ----------"
        cat $script
        echo "# End of ---------- $(basename $script) ----------"
    done > ${WORKDIR}/mender_grub.cfg

    # Environment directory, which is root of boot partition for BIOS platforms,
    # and inside EFI/BOOT on UEFI platforms (the default).
    cat > ${B}/mender_grubenv.config <<EOF
ENV_DIR = ${MENDER_BOOT_PART_MOUNT_LOCATION}${@bb.utils.contains('DISTRO_FEATURES', 'mender-bios', '', '/EFI/BOOT', d)}
EOF
}

do_install() {
    set -x

    mkdir -p ${D}/${bindir}
    install -m 755 ${WORKDIR}/fw_printenv ${D}/${bindir}/fw_printenv
    ln -fs fw_printenv ${D}/${bindir}/fw_setenv

    mkdir -p ${D}/data
    install -m 444 ${B}/mender_grubenv.config ${D}/data/
    mkdir -p ${D}${sysconfdir}
    ln -fs /data/mender_grubenv.config ${D}${sysconfdir}/mender_grubenv.config
}

do_deploy() {
    set -x

    install -m 644 ${WORKDIR}/mender_grub.cfg ${DEPLOYDIR}/grub.cfg

    install -m 755 -d ${DEPLOYDIR}/mender_grubenv1
    install -m 644 ${WORKDIR}/mender_grubenv/env ${DEPLOYDIR}/mender_grubenv1/env
    install -m 644 ${WORKDIR}/mender_grubenv/lock ${DEPLOYDIR}/mender_grubenv1/lock
    install -m 644 ${WORKDIR}/mender_grubenv/lock.sha256sum ${DEPLOYDIR}/mender_grubenv1/lock.sha256sum
    install -m 755 -d ${DEPLOYDIR}/mender_grubenv2
    install -m 644 ${WORKDIR}/mender_grubenv/env ${DEPLOYDIR}/mender_grubenv2/env
    install -m 644 ${WORKDIR}/mender_grubenv/lock ${DEPLOYDIR}/mender_grubenv2/lock
    install -m 644 ${WORKDIR}/mender_grubenv/lock.sha256sum ${DEPLOYDIR}/mender_grubenv2/lock.sha256sum
}
addtask do_deploy after do_compile

repository: flitjes/meta-mender

repo_name: flitjes/meta-mender


text:
@article{pmid27053011,
 author = {Ntineri, A.  and Stergiou, G. S.  and Thijs, L.  and Asayama, K.  and Boggia, J.  and Boubouchairopoulou, N.  and Hozawa, A.  and Imai, Y.  and Johansson, J. K.  and Jula, A. M.  and Kollias, A.  and Luzardo, L.  and Niiranen, T. J.  and Nomura, K.  and Ohkubo, T.  and Tsuji, I.  and Tzourio, C.  and Wei, F. F.  and Staessen, J. A. },
 journal = {Hypertens. Res.},
 keywords = {intarticle},
 month = {Aug},
 number = {8},
 pages = {612--617},
 title = {Relationship between office and home blood pressure with increasing age: The International Database of HOme blood pressure in relation to Cardiovascular Outcome (IDHOCO)},
 volume = {39},
 year = {2016}
}

repository: hypertensioncenter/academic-kickstart

repo_name: hypertensioncenter/academic-kickstart

gha_language: TeX


text:
########################################################################
#
# ThirdParty configuration for Nektar++
#
# MPI
#
########################################################################

OPTION(NEKTAR_USE_MPI "Use MPI for parallelisation." OFF)

CMAKE_DEPENDENT_OPTION(THIRDPARTY_BUILD_GSMPI
    "Build GSMPI if needed" ON
    "NEKTAR_USE_MPI" OFF)

IF( NEKTAR_USE_MPI )
    # First check to see if our compiler has MPI built in to avoid linking
    # libraries etc.
    INCLUDE (CheckIncludeFiles)
    INCLUDE (CheckFunctionExists)
    CHECK_INCLUDE_FILES  (mpi.h    HAVE_MPI_H)
    CHECK_FUNCTION_EXISTS(MPI_Send HAVE_MPI_SEND)

    SET(MPI_BUILTIN OFF CACHE INTERNAL
        "Determines whether MPI is built into the compiler")
    IF (NOT "${HAVE_MPI_H}" OR NOT "${HAVE_MPI_SEND}")
        FIND_PACKAGE(MPI REQUIRED)

        INCLUDE_DIRECTORIES(SYSTEM ${MPI_CXX_INCLUDE_PATH} )
        MESSAGE(STATUS "Found MPI: ${MPI_CXX_LIBRARIES}")
    ELSE()
        SET(MPI_BUILTIN ON)
        MESSAGE(STATUS "Found MPI: built in")
	FIND_PROGRAM(HAVE_APRUN aprun)
	IF (HAVE_APRUN)
	    # Probably on Cray
            SET(MPIEXEC "aprun" CACHE STRING "MPI job launching command")
	    SET(MPIEXEC_NUMPROC_FLAG "-n" CACHE STRING
                "MPI job launcher flag to specify number of processes")
	ELSE()
            SET(MPIEXEC "mpirun" CACHE STRING "MPI job launching command")
	    SET(MPIEXEC_NUMPROC_FLAG "-np" CACHE STRING
                "MPI job launcher flag to specify number of processes")
	ENDIF()
	MARK_AS_ADVANCED(MPIEXEC)
	MARK_AS_ADVANCED(MPIEXEC_NUMPROC_FLAG)
	UNSET(HAVE_APRUN CACHE)
    ENDIF()

    ADD_DEFINITIONS(-DNEKTAR_USE_MPI)

    IF (THIRDPARTY_BUILD_GSMPI)
        INCLUDE(ExternalProject)
        EXTERNALPROJECT_ADD(
            gsmpi-1.2.1_2
            URL ${TPURL}/gsmpi-1.2.1_2.tar.bz2
            URL_MD5 3690b4a658324cd5ad17cf8f6115fb5d
            STAMP_DIR ${TPBUILD}/stamp
            DOWNLOAD_DIR ${TPSRC}
            SOURCE_DIR ${TPSRC}/gsmpi-1.2.1_2
            BINARY_DIR ${TPBUILD}/gsmpi-1.2.1_2
            TMP_DIR ${TPBUILD}/gsmpi-1.2.1_2-tmp
            INSTALL_DIR ${TPDIST}
            CONFIGURE_COMMAND
                ${CMAKE_COMMAND}
                -G ${CMAKE_GENERATOR}
                -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
                -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
                -DCMAKE_BUILD_TYPE:STRING=Debug
                -DCMAKE_INSTALL_PREFIX:PATH=${TPDIST}
                ${TPSRC}/gsmpi-1.2.1_2
        )
        THIRDPARTY_LIBRARY(GSMPI_LIBRARY STATIC gsmpi DESCRIPTION "GSMPI Library")
        THIRDPARTY_LIBRARY(XXT_LIBRARY STATIC xxt DESCRIPTION "XXT Library")
        MARK_AS_ADVANCED(GSMPI_LIBRARY)
        MARK_AS_ADVANCED(XXT_LIBRARY)
        MESSAGE(STATUS "Build GSMPI: ${GSMPI_LIBRARY}")
        MESSAGE(STATUS "Build XXT: ${XXT_LIBRARY}")
    ELSE (THIRDPARTY_BUILD_GSMPI)
        MESSAGE(FATAL_ERROR "Must build GSMPI and XXT")
    ENDIF (THIRDPARTY_BUILD_GSMPI)
ENDIF( NEKTAR_USE_MPI )

repository: mathLab/ITHACA-SEM

repo_name: mathLab/ITHACA-SEM

gha_language: Makefile


text:
/*
Copyright 2020 The Magma Authors.

This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.

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 servicers_test

import (
	"testing"

	"github.com/stretchr/testify/assert"

	"magma/feg/gateway/diameter"
	"magma/feg/gateway/plmn_filter"
	"magma/feg/gateway/services/swx_proxy/servicers"
	"magma/gateway/mconfig"
)

func TestSwxProxyMultipleConfigurationMconfig(t *testing.T) {
	confs := generateSwxProxyConfigFromString(t, multipleServersMconfig)
	assertHLRClients(t, confs)
	// server on "server" tag should not appear
	assert.Equal(t, 2, len(confs))
	assert.Equal(t, "10.0.0.1:1", confs[0].ServerCfg.DiameterServerConnConfig.Addr)
	assert.Equal(t, "10.0.0.2:2", confs[1].ServerCfg.DiameterServerConnConfig.Addr)
	assert.Equal(t, "magma_test1", confs[0].ClientCfg.ProductName)
	assert.Equal(t, "magma_test2", confs[1].ClientCfg.ProductName)
}

func TestSwxProxyService_ValidateConfig(t *testing.T) {
	err := servicers.ValidateSwxProxyConfig(nil)
	assert.EqualError(t, err, "Nil SwxProxyConfig provided")

	validClientConfig := &diameter.DiameterClientConfig{
		Host:  "magma-oai.openair4G.eur", // diameter host
		Realm: "openair4G.eur",           // diameter realm,
	}
	validServerConfig := &diameter.DiameterServerConfig{DiameterServerConnConfig: diameter.DiameterServerConnConfig{
		Addr:     "",      // to be filled in once server addr is started
		Protocol: "sctp"}, // tcp/sctp
	}
	nilClientConfig := &servicers.SwxProxyConfig{
		ClientCfg:           nil,
		ServerCfg:           validServerConfig,
		VerifyAuthorization: false,
	}
	nilServerConfig := &servicers.SwxProxyConfig{
		ClientCfg:           validClientConfig,
		ServerCfg:           nil,
		VerifyAuthorization: false,
	}
	err = servicers.ValidateSwxProxyConfig(nilClientConfig)
	assert.EqualError(t, err, "Nil client config provided")

	err = servicers.ValidateSwxProxyConfig(nilServerConfig)
	assert.EqualError(t, err, "Nil server config provided")

	invalidClientConfig := &servicers.SwxProxyConfig{
		ClientCfg: &diameter.DiameterClientConfig{
			Host:  "",              // diameter host
			Realm: "openair4G.eur", // diameter realm,
		},
		ServerCfg:           validServerConfig,
		VerifyAuthorization: false,
	}
	err = servicers.ValidateSwxProxyConfig(invalidClientConfig)
	assert.EqualError(t, err, "Invalid Diameter Host")

	invalidServerConfig := &servicers.SwxProxyConfig{
		ClientCfg: validClientConfig,
		ServerCfg: &diameter.DiameterServerConfig{DiameterServerConnConfig: diameter.DiameterServerConnConfig{
			Addr:     "",     // to be filled in once server addr is started
			Protocol: "sss"}, // tcp/sctp
		},
		VerifyAuthorization: false,
	}
	err = servicers.ValidateSwxProxyConfig(invalidServerConfig)
	assert.EqualError(t, err, "Invalid Diameter Address (sss://): unknown network sss")

	validConfig := &servicers.SwxProxyConfig{
		ClientCfg:           validClientConfig,
		ServerCfg:           validServerConfig,
		VerifyAuthorization: false,
	}
	err = servicers.ValidateSwxProxyConfig(validConfig)
	assert.NoError(t, err)
}

func generateSwxProxyConfigFromString(t *testing.T, confString string) []*servicers.SwxProxyConfig {
	err := mconfig.CreateLoadTempConfig(confString)
	assert.NoError(t, err)
	// Note we get only get index 0
	return servicers.GetSwxProxyConfig()
}

func assertHLRClients(t *testing.T, confs []*servicers.SwxProxyConfig) {
	for _, cfg := range confs {
		assert.Truef(t, plmn_filter.CheckImsiOnPlmnIdListIfAny("001020000000055", cfg.HlrPlmnIds),
			"IMSI 001020000000055 should be HLR IMSI, HLR PLMN ID Map: %+v", cfg.HlrPlmnIds)
		assert.Truef(t, plmn_filter.CheckImsiOnPlmnIdListIfAny("001030000000055", cfg.HlrPlmnIds),
			"IMSI 001030000000055 should be HLR IMSI, HLR PLMN ID Map: %+v", cfg.HlrPlmnIds)
		assert.Falsef(t, plmn_filter.CheckImsiOnPlmnIdListIfAny("001010000000055", cfg.HlrPlmnIds),
			"IMSI 001010000000055 should NOT be HLR IMSI, HLR PLMN ID Map: %+v", cfg.HlrPlmnIds)
	}
}

// ---- CONFIGURATIONS ----
var (
	// TODO: remove "server" tag once backwards compatibility is not needed for the field server
	multipleServersMconfig = `{
		"configsByKey": {
			"swx_proxy": {
				"@type": "type.googleapis.com/magma.mconfig.SwxConfig",
				"logLevel": "INFO",
				"server": {
						"protocol": "sctp",
						"address": "10.0.0.0:0",
						"retransmits": 3,
						"watchdogInterval": 1,
						"retryCount": 5,
						"productName": "magma_test0",
						"realm": "openair4G.eur",
						"host": "magma-oai.openair4G.eur"
					},
				"servers": [
					{
						"protocol": "sctp",
						"address": "10.0.0.1:1",
						"retransmits": 3,
						"watchdogInterval": 1,
						"retryCount": 5,
						"productName": "magma_test1",
						"realm": "openair4G.eur",
						"host": "magma-oai.openair4G.eur"
					},
					{
						"protocol": "sctp",
						"address": "10.0.0.2:2",
						"retransmits": 3,
						"watchdogInterval": 1,
						"retryCount": 5,
						"productName": "magma_test2",
						"realm": "openair4G.eur",
						"host": "magma-oai.openair4G.eur"
					}
				],
				"verifyAuthorization": true,
				"hlr_plmn_ids": [ "00102", "00103" ]
			}
		}
	}`
	// TODO: remove  once backwards compatibility is not needed for the field server
	legacyServerMconfigGen = `{
		"configsByKey": {
			"swx_proxy": {
				"@type": "type.googleapis.com/magma.mconfig.SwxConfig",
				"logLevel": "INFO",
				"server": {
						"protocol": "sctp",
						"address": "10.0.0.0:0",
						"retransmits": 3,
						"watchdogInterval": 1,
						"retryCount": 5,
						"productName": "magma_test0",
						"realm": "openair4G.eur",
						"host": "magma-oai.openair4G.eur"
					},
				"verifyAuthorization": true,
				"hlr_plmn_ids": [ "00102", "00103" ]
			}
		}
	}`
)

repository: magma/magma

repo_name: magma/magma

gha_license_id: NOASSERTION


text:
package ipldzec

import (
	"encoding/binary"
	"io"
)

type JSDescription struct {
	OldVal       uint64
	NewVal       uint64
	Anchor       []byte
	Nullifiers   [][]byte
	Commitments  [][]byte
	EphemeralKey []byte
	CipherTexts  [][]byte
	RandomSeed   []byte
	Macs         [][]byte
	Proof        []byte
}

func (js *JSDescription) WriteTo(w io.Writer) (int, error) {
	buf := make([]byte, 16)

	binary.LittleEndian.PutUint64(buf, js.OldVal)
	binary.LittleEndian.PutUint64(buf[8:], js.NewVal)

	return writeMany(w, buf, js.Anchor, js.Nullifiers[0], js.Nullifiers[1], js.Commitments[0], js.Commitments[1], js.EphemeralKey, js.RandomSeed, js.Macs[0], js.Macs[1], js.Proof, js.CipherTexts[0], js.CipherTexts[1])
}

func writeMany(w io.Writer, bs ...[]byte) (int, error) {
	var total int
	for _, b := range bs {
		n, err := w.Write(b)
		if err != nil {
			return total, err
		}
		total += n
	}
	return total, nil
}

repository: ipfs/go-ipld-zcash

repo_name: ipfs/go-ipld-zcash


text:
PR         = "r2"
LICENSE    = "GPL"

DEPENDS = "hildon-lgpl hildon-base-lib osso-af-settings libosso hildon-libs osso-af-settings libosso-help"

SRC_URI = "http://repository.maemo.org/pool/maemo/ossw/source/h/${PN}/${PN}_${PV}.tar.gz \
           file://config-path.patch;patch=1;pnum=0 \
           file://noWerror.patch;patch=1;pnum=0"

S = "${WORKDIR}/hildon-control-panel-0.9.1"

inherit autotools pkgconfig

FILES_${PN} += "${libdir}/dbus-1.0 ${datadir}/applications"

do_stage() {
        install -d ${STAGING_INCDIR}/hildon-cp-plugin
        install -m 644 *.h ${STAGING_INCDIR}/hildon-cp-plugin
}


text:
@article{konstantin_laufer_hike_2007,
 abbr = {Magazine},
 abstract = {By incorporating automated component, integration, and acceptance testing into the various tiers of a lightweight lava 2 Enterprise Edition (J2EE) Web application architecture, developers can shorten the development cycle and increase the quality of their work},
 author = {Läufer, Konstantin and Thiruvathukal, George K. and González, Benjamin},
 copyright = {Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC-BY-NC-SA)},
 issn = {1521-9615},
 journal = {Computing in Science and Engineering},
 number = {1},
 pdf = {https://ecommons.luc.edu/cs_facpubs/263/},
 title = {A Hike through a Post-EJB J2EE Web Application Architecture, Part III},
 url = {https://ecommons.luc.edu/cs_facpubs/263/},
 volume = {9},
 year = {2007}
}


text:
package datamuse

import (
	"testing"

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

func TestDatamuse_Words(t *testing.T) {
	assert.Equal(t, "https://api.datamuse.com/words", New().Words().URL())
}

func TestDatamuse_Suggestions(t *testing.T) {
	assert.Equal(t, "https://api.datamuse.com/sug?s=foo", New().Suggestions("foo").URL())
}

func TestDatamuse_MeansLike(t *testing.T) {
	expected := "https://api.datamuse.com/words?ml=foo"
	actual := New().Words().MeansLike("foo").URL()

	assert.Equal(t, expected, actual)
}

func TestDatamuse_SpelledLike(t *testing.T) {
	expected := "https://api.datamuse.com/words?sp=foo"
	actual := New().Words().SpelledLike("foo").URL()

	assert.Equal(t, expected, actual)
}

func TestDatamuse_SoundsLike(t *testing.T) {
	expected := "https://api.datamuse.com/words?sl=foo"
	actual := New().Words().SoundsLike("foo").URL()

	assert.Equal(t, expected, actual)
}

func TestDatamuse_Related(t *testing.T) {
	expected := "https://api.datamuse.com/words?rel_jjb=foo"
	actual := New().Words().Related(RelatedAdjectives, "foo").URL()

	assert.Equal(t, expected, actual)
}

func TestDatamuse_RelatedNouns(t *testing.T) {
	expected := "https://api.datamuse.com/words?rel_jja=foo"
	actual := New().Words().RelatedNouns("foo").URL()

	assert.Equal(t, expected, actual)
}

func TestDatamuse_RelatedAdjectives(t *testing.T) {
	expected := "https://api.datamuse.com/words?rel_jjb=foo"
	actual := New().Words().RelatedAdjectives("foo").URL()

	assert.Equal(t, expected, actual)
}

func TestDatamuse_RelatedSynonyms(t *testing.T) {
	expected := "https://api.datamuse.com/words?rel_syn=foo"
	actual := New().Words().RelatedSynonyms("foo").URL()

	assert.Equal(t, expected, actual)
}

func TestDatamuse_RelatedTriggers(t *testing.T) {
	expected := "https://api.datamuse.com/words?rel_trg=foo"
	actual := New().Words().RelatedTriggers("foo").URL()

	assert.Equal(t, expected, actual)
}

func TestDatamuse_RelatedAntonyms(t *testing.T) {
	expected := "https://api.datamuse.com/words?rel_ant=foo"
	actual := New().Words().RelatedAntonyms("foo").URL()

	assert.Equal(t, expected, actual)
}

func TestDatamuse_RelatedKindOf(t *testing.T) {
	expected := "https://api.datamuse.com/words?rel_spc=foo"
	actual := New().Words().RelatedKindOf("foo").URL()

	assert.Equal(t, expected, actual)
}

func TestDatamuse_RelatedMoreGeneralThan(t *testing.T) {
	expected := "https://api.datamuse.com/words?rel_gen=foo"
	actual := New().Words().RelatedMoreGeneralThan("foo").URL()

	assert.Equal(t, expected, actual)
}

func TestDatamuse_RelatedComprises(t *testing.T) {
	expected := "https://api.datamuse.com/words?rel_com=foo"
	actual := New().Words().RelatedComprises("foo").URL()

	assert.Equal(t, expected, actual)
}

func TestDatamuse_RelatedPartOf(t *testing.T) {
	expected := "https://api.datamuse.com/words?rel_par=foo"
	actual := New().Words().RelatedPartOf("foo").URL()

	assert.Equal(t, expected, actual)
}

func TestDatamuse_RelatedFrequentFollowers(t *testing.T) {
	expected := "https://api.datamuse.com/words?rel_bga=foo"
	actual := New().Words().RelatedFrequentFollowers("foo").URL()

	assert.Equal(t, expected, actual)
}

func TestDatamuse_RelatedFrequentPredecessors(t *testing.T) {
	expected := "https://api.datamuse.com/words?rel_bgb=foo"
	actual := New().Words().RelatedFrequentPredecessors("foo").URL()

	assert.Equal(t, expected, actual)
}

func TestDatamuse_RelatedRhymes(t *testing.T) {
	expected := "https://api.datamuse.com/words?rel_rhy=foo"
	actual := New().Words().RelatedRhymes("foo").URL()

	assert.Equal(t, expected, actual)
}

func TestDatamuse_RelatedApproximateRhymes(t *testing.T) {
	expected := "https://api.datamuse.com/words?rel_nry=foo"
	actual := New().Words().RelatedApproximateRhymes("foo").URL()

	assert.Equal(t, expected, actual)
}

func TestDatamuse_RelatedHomophones(t *testing.T) {
	expected := "https://api.datamuse.com/words?rel_hom=foo"
	actual := New().Words().RelatedHomophones("foo").URL()

	assert.Equal(t, expected, actual)
}

func TestDatamuse_RelatedConsonant(t *testing.T) {
	expected := "https://api.datamuse.com/words?rel_cns=foo"
	actual := New().Words().RelatedConsonant("foo").URL()

	assert.Equal(t, expected, actual)
}

func TestDatamuse_Vocabulary(t *testing.T) {
	expected := "https://api.datamuse.com/words?v=foo"
	actual := New().Words().Vocabulary("foo").URL()

	assert.Equal(t, expected, actual)
}

func TestDatamuse_VocabularyDefault(t *testing.T) {
	expected := "https://api.datamuse.com/words?v="
	actual := New().Words().VocabularyDefault().URL()

	assert.Equal(t, expected, actual)
}

func TestDatamuse_VocabularySpanish(t *testing.T) {
	expected := "https://api.datamuse.com/words?v=es"
	actual := New().Words().VocabularySpanish().URL()

	assert.Equal(t, expected, actual)
}

func TestDatamuse_VocabularyWikipedia(t *testing.T) {
	expected := "https://api.datamuse.com/words?v=enwiki"
	actual := New().Words().VocabularyWikipedia().URL()

	assert.Equal(t, expected, actual)
}

func TestDatamuse_Topics(t *testing.T) {
	expected := "https://api.datamuse.com/words?topics=foo"
	actual := New().Words().Topics("foo").URL()

	assert.Equal(t, expected, actual)
}

func TestDatamuse_LeftContext(t *testing.T) {
	expected := "https://api.datamuse.com/words?lc=foo"
	actual := New().Words().LeftContext("foo").URL()

	assert.Equal(t, expected, actual)
}

func TestDatamuse_RightContext(t *testing.T) {
	expected := "https://api.datamuse.com/words?rc=foo"
	actual := New().Words().RightContext("foo").URL()

	assert.Equal(t, expected, actual)
}

func TestDatamuse_Max(t *testing.T) {
	expected := "https://api.datamuse.com/words?max=42"
	actual := New().Words().Max(42).URL()

	assert.Equal(t, expected, actual)
}

repository: kostaspt/go-datamuse

repo_name: kostaspt/go-datamuse