text:
@article{Hutchison_2010,
 author = {Hutchison, W. D. and Burkness, E. C. and Mitchell, P. D. and Moon, R. D. and Leslie, T. W. and Fleischer, S. J. and Abrahamson, M. and Hamilton, K. L. and Steffey, K. L. and Gray, M. E. and Hellmich, R. L. and Kaster, L. V. and Hunt, T. E. and Wright, R. J. and Pecinovsky, K. and Rabaey, T. L. and Flood, B. R. and Raun, E. S.},
 title = {Areawide Suppression of European Corn Borer with Bt Maize Reaps Savings to Non-Bt Maize Growers},
 journal = {Science},
 publisher = {American Association for the Advancement of Science ({AAAS})},
 year = {2010},
 month = {oct},
 number = {6001},
 volume = {330},
 pages = {222--225},
 url = {https://doi.org/10.1126%2Fscience.1190242},
 doi = {10.1126/science.1190242}
}


text:
package lzop

// Copyright 2016 MediaMath <http://www.mediamath.com>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

import (
	"bytes"
	"encoding/binary"
	"hash/adler32"
)

const (
	version           = 0x1030
	libVersion        = 0x2080
	versionForExtract = 0x0940
	method            = 2
	level             = 1
	flags             = 0x3000001
	fileMode          = 0x000081B4
)

var lzopMagic = []byte{0x89, 0x4c, 0x5a, 0x4f, 0x00, 0x0d, 0x0a, 0x1a, 0x0a}
var endBytes = []byte{0x00, 0x00, 0x00, 0x00}

//WriteHeader Writes only the header start of an lzop file
func WriteHeader(buff *bytes.Buffer, fileTime int64, fileName string) error {
	//this is started at the file but not included in the checksum
	//hence bytes[len(lzopMagic):]
	//if you include this you will get invalid checksum error on lzop files
	err := binary.Write(buff, binary.BigEndian, lzopMagic)

	err = binary.Write(buff, binary.BigEndian, uint16(version))
	err = binary.Write(buff, binary.BigEndian, uint16(libVersion))
	err = binary.Write(buff, binary.BigEndian, uint16(versionForExtract))
	err = binary.Write(buff, binary.BigEndian, uint8(method))
	err = binary.Write(buff, binary.BigEndian, uint8(level))
	err = binary.Write(buff, binary.BigEndian, uint32(flags))
	err = binary.Write(buff, binary.BigEndian, uint32(fileMode))
	err = binary.Write(buff, binary.BigEndian, uint32(fileTime))
	err = binary.Write(buff, binary.BigEndian, uint32(0)) //timeHigh
	err = binary.Write(buff, binary.BigEndian, uint8(len(fileName)))
	_, err = buff.Write([]byte(fileName))
	bytes := buff.Bytes()
	err = binary.Write(buff, binary.BigEndian, uint32(adler32.Checksum(bytes[len(lzopMagic):])))

	if err != nil {
		return err
	}

	return nil
}

//WriteBytes Writes your bytes to a buffer via compression function
func WriteBytes(buff *bytes.Buffer, data []byte, compressionFunction func([]byte) []byte) error {
	blockSize := 256 * 1024

	for i, n := 0, len(data); i < n; i += blockSize {
		j := i + blockSize

		if j > n {
			j = n
		}

		unCompressed := data[i:j]
		compressed := compressionFunction(unCompressed)

		// did you actually compress anything?
		//this is to stop the compression library from sticking in extra
		//characters which from what I can tell just messes with things
		//and you end up with a corrupted lzop file
		if len(compressed) > len(unCompressed) {
			compressed = unCompressed
		}

		err := binary.Write(buff, binary.BigEndian, uint32(len(unCompressed)))
		err = binary.Write(buff, binary.BigEndian, uint32(len(compressed)))
		err = binary.Write(buff, binary.BigEndian, uint32(adler32.Checksum(unCompressed)))

		if err != nil {
			return err
		}

		_, err = buff.Write(compressed)

		if err != nil {
			return err
		}
	}

	return nil
}

//WriteEnd writes the ending bytes of an lzop file
func WriteEnd(buff *bytes.Buffer) error {
	_, err := buff.Write(endBytes)
	return err
}

//write data is a helper to just do all three (header/body/end)
func writeData(buff *bytes.Buffer, fileTime int64, fileName string, data []byte,
	compressionFunction func([]byte) []byte) error {

	err := WriteHeader(buff, fileTime, fileName)

	if err != nil {
		return err
	}

	err = WriteBytes(buff, data, compressionFunction)

	if err != nil {
		return err
	}

	return WriteEnd(buff)
}

//CompressData Will Compress your data expecting an LZO 1X1 compression.  Creates buffer for you
func CompressData(fileTime int64, fileName string, data []byte, compressionFunction func([]byte) []byte) ([]byte, error) {

	buff := bytes.NewBuffer(make([]byte, 0, bytes.MinRead))
	err := writeData(buff, fileTime, fileName, data, compressionFunction)

	if err != nil {
		return nil, err
	}

	return buff.Bytes(), err
}

//CompressDataWithBuffer Allows you to specify the buffer to use for compression allowing re-use
func CompressDataWithBuffer(buff *bytes.Buffer, fileTime int64, fileName string, data []byte, compressionFunction func([]byte) []byte) ([]byte, error) {

	buff.Reset()
	err := writeData(buff, fileTime, fileName, data, compressionFunction)

	if err != nil {
		return nil, err
	}

	return buff.Bytes(), err
}

license_type: permissive

branch_name: refs/heads/master

extension: go


text:
package models

import (
    i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization"
    ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store"
)

// AudioConferencing
type AudioConferencing struct {
    // Stores model information.
    backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore
}
// NewAudioConferencing instantiates a new audioConferencing and sets the default values.
func NewAudioConferencing()(*AudioConferencing) {
    m := &AudioConferencing{
    }
    m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance();
    m.SetAdditionalData(make(map[string]any))
    return m
}
// CreateAudioConferencingFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
func CreateAudioConferencingFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
    return NewAudioConferencing(), nil
}
// GetAdditionalData gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
func (m *AudioConferencing) GetAdditionalData()(map[string]any) {
    val , err :=  m.backingStore.Get("additionalData")
    if err != nil {
        panic(err)
    }
    if val == nil {
        var value = make(map[string]any);
        m.SetAdditionalData(value);
    }
    return val.(map[string]any)
}
// GetBackingStore gets the backingStore property value. Stores model information.
func (m *AudioConferencing) GetBackingStore()(ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) {
    return m.backingStore
}
// GetConferenceId gets the conferenceId property value. The conference id of the online meeting.
func (m *AudioConferencing) GetConferenceId()(*string) {
    val, err := m.GetBackingStore().Get("conferenceId")
    if err != nil {
        panic(err)
    }
    if val != nil {
        return val.(*string)
    }
    return nil
}
// GetDialinUrl gets the dialinUrl property value. A URL to the externally-accessible web page that contains dial-in information.
func (m *AudioConferencing) GetDialinUrl()(*string) {
    val, err := m.GetBackingStore().Get("dialinUrl")
    if err != nil {
        panic(err)
    }
    if val != nil {
        return val.(*string)
    }
    return nil
}
// GetFieldDeserializers the deserialization information for the current model
func (m *AudioConferencing) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
    res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error))
    res["conferenceId"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
        val, err := n.GetStringValue()
        if err != nil {
            return err
        }
        if val != nil {
            m.SetConferenceId(val)
        }
        return nil
    }
    res["dialinUrl"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
        val, err := n.GetStringValue()
        if err != nil {
            return err
        }
        if val != nil {
            m.SetDialinUrl(val)
        }
        return nil
    }
    res["@odata.type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
        val, err := n.GetStringValue()
        if err != nil {
            return err
        }
        if val != nil {
            m.SetOdataType(val)
        }
        return nil
    }
    res["tollFreeNumber"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
        val, err := n.GetStringValue()
        if err != nil {
            return err
        }
        if val != nil {
            m.SetTollFreeNumber(val)
        }
        return nil
    }
    res["tollFreeNumbers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
        val, err := n.GetCollectionOfPrimitiveValues("string")
        if err != nil {
            return err
        }
        if val != nil {
            res := make([]string, len(val))
            for i, v := range val {
                if v != nil {
                    res[i] = *(v.(*string))
                }
            }
            m.SetTollFreeNumbers(res)
        }
        return nil
    }
    res["tollNumber"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
        val, err := n.GetStringValue()
        if err != nil {
            return err
        }
        if val != nil {
            m.SetTollNumber(val)
        }
        return nil
    }
    res["tollNumbers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
        val, err := n.GetCollectionOfPrimitiveValues("string")
        if err != nil {
            return err
        }
        if val != nil {
            res := make([]string, len(val))
            for i, v := range val {
                if v != nil {
                    res[i] = *(v.(*string))
                }
            }
            m.SetTollNumbers(res)
        }
        return nil
    }
    return res
}
// GetOdataType gets the @odata.type property value. The OdataType property
func (m *AudioConferencing) GetOdataType()(*string) {
    val, err := m.GetBackingStore().Get("odataType")
    if err != nil {
        panic(err)
    }
    if val != nil {
        return val.(*string)
    }
    return nil
}
// GetTollFreeNumber gets the tollFreeNumber property value. The tollFreeNumber property
func (m *AudioConferencing) GetTollFreeNumber()(*string) {
    val, err := m.GetBackingStore().Get("tollFreeNumber")
    if err != nil {
        panic(err)
    }
    if val != nil {
        return val.(*string)
    }
    return nil
}
// GetTollFreeNumbers gets the tollFreeNumbers property value. List of toll-free numbers that are displayed in the meeting invite.
func (m *AudioConferencing) GetTollFreeNumbers()([]string) {
    val, err := m.GetBackingStore().Get("tollFreeNumbers")
    if err != nil {
        panic(err)
    }
    if val != nil {
        return val.([]string)
    }
    return nil
}
// GetTollNumber gets the tollNumber property value. The tollNumber property
func (m *AudioConferencing) GetTollNumber()(*string) {
    val, err := m.GetBackingStore().Get("tollNumber")
    if err != nil {
        panic(err)
    }
    if val != nil {
        return val.(*string)
    }
    return nil
}
// GetTollNumbers gets the tollNumbers property value. List of toll numbers that are displayed in the meeting invite.
func (m *AudioConferencing) GetTollNumbers()([]string) {
    val, err := m.GetBackingStore().Get("tollNumbers")
    if err != nil {
        panic(err)
    }
    if val != nil {
        return val.([]string)
    }
    return nil
}
// Serialize serializes information the current object
func (m *AudioConferencing) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
    {
        err := writer.WriteStringValue("conferenceId", m.GetConferenceId())
        if err != nil {
            return err
        }
    }
    {
        err := writer.WriteStringValue("dialinUrl", m.GetDialinUrl())
        if err != nil {
            return err
        }
    }
    {
        err := writer.WriteStringValue("@odata.type", m.GetOdataType())
        if err != nil {
            return err
        }
    }
    {
        err := writer.WriteStringValue("tollFreeNumber", m.GetTollFreeNumber())
        if err != nil {
            return err
        }
    }
    if m.GetTollFreeNumbers() != nil {
        err := writer.WriteCollectionOfStringValues("tollFreeNumbers", m.GetTollFreeNumbers())
        if err != nil {
            return err
        }
    }
    {
        err := writer.WriteStringValue("tollNumber", m.GetTollNumber())
        if err != nil {
            return err
        }
    }
    if m.GetTollNumbers() != nil {
        err := writer.WriteCollectionOfStringValues("tollNumbers", m.GetTollNumbers())
        if err != nil {
            return err
        }
    }
    {
        err := writer.WriteAdditionalData(m.GetAdditionalData())
        if err != nil {
            return err
        }
    }
    return nil
}
// SetAdditionalData sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
func (m *AudioConferencing) SetAdditionalData(value map[string]any)() {
    err := m.GetBackingStore().Set("additionalData", value)
    if err != nil {
        panic(err)
    }
}
// SetBackingStore sets the backingStore property value. Stores model information.
func (m *AudioConferencing) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {
    m.backingStore = value
}
// SetConferenceId sets the conferenceId property value. The conference id of the online meeting.
func (m *AudioConferencing) SetConferenceId(value *string)() {
    err := m.GetBackingStore().Set("conferenceId", value)
    if err != nil {
        panic(err)
    }
}
// SetDialinUrl sets the dialinUrl property value. A URL to the externally-accessible web page that contains dial-in information.
func (m *AudioConferencing) SetDialinUrl(value *string)() {
    err := m.GetBackingStore().Set("dialinUrl", value)
    if err != nil {
        panic(err)
    }
}
// SetOdataType sets the @odata.type property value. The OdataType property
func (m *AudioConferencing) SetOdataType(value *string)() {
    err := m.GetBackingStore().Set("odataType", value)
    if err != nil {
        panic(err)
    }
}
// SetTollFreeNumber sets the tollFreeNumber property value. The tollFreeNumber property
func (m *AudioConferencing) SetTollFreeNumber(value *string)() {
    err := m.GetBackingStore().Set("tollFreeNumber", value)
    if err != nil {
        panic(err)
    }
}
// SetTollFreeNumbers sets the tollFreeNumbers property value. List of toll-free numbers that are displayed in the meeting invite.
func (m *AudioConferencing) SetTollFreeNumbers(value []string)() {
    err := m.GetBackingStore().Set("tollFreeNumbers", value)
    if err != nil {
        panic(err)
    }
}
// SetTollNumber sets the tollNumber property value. The tollNumber property
func (m *AudioConferencing) SetTollNumber(value *string)() {
    err := m.GetBackingStore().Set("tollNumber", value)
    if err != nil {
        panic(err)
    }
}
// SetTollNumbers sets the tollNumbers property value. List of toll numbers that are displayed in the meeting invite.
func (m *AudioConferencing) SetTollNumbers(value []string)() {
    err := m.GetBackingStore().Set("tollNumbers", value)
    if err != nil {
        panic(err)
    }
}
// AudioConferencingable
type AudioConferencingable interface {
    i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder
    ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel
    i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
    GetBackingStore()(ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)
    GetConferenceId()(*string)
    GetDialinUrl()(*string)
    GetOdataType()(*string)
    GetTollFreeNumber()(*string)
    GetTollFreeNumbers()([]string)
    GetTollNumber()(*string)
    GetTollNumbers()([]string)
    SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)()
    SetConferenceId(value *string)()
    SetDialinUrl(value *string)()
    SetOdataType(value *string)()
    SetTollFreeNumber(value *string)()
    SetTollFreeNumbers(value []string)()
    SetTollNumber(value *string)()
    SetTollNumbers(value []string)()
}

license: MIT

repository: microsoftgraph/msgraph-sdk-go

repo_name: microsoftgraph/msgraph-sdk-go

branch_name: refs/heads/main

gha_license_id: MIT

gha_language: Go


text:
package cni

import (
	"context"
	"encoding/base64"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"strings"
	"time"

	"github.com/gorilla/mux"
	"k8s.io/client-go/kubernetes"
	corev1listers "k8s.io/client-go/listers/core/v1"
	"k8s.io/klog/v2"

	"github.com/ovn-org/ovn-kubernetes/go-controller/pkg/config"
	"github.com/ovn-org/ovn-kubernetes/go-controller/pkg/factory"
	"github.com/ovn-org/ovn-kubernetes/go-controller/pkg/metrics"
	"github.com/ovn-org/ovn-kubernetes/go-controller/pkg/types"
	"github.com/ovn-org/ovn-kubernetes/go-controller/pkg/util"
)

// *** The Server is PRIVATE API between OVN components and may be
// changed at any time.  It is in no way a supported interface or API. ***
//
// The Server accepts pod setup/teardown requests from the OVN
// CNI plugin, which is itself called by kubelet when pod networking
// should be set up or torn down.  The OVN CNI plugin gathers up
// the standard CNI environment variables and network configuration provided
// on stdin and forwards them to the Server over a private, root-only
// Unix domain socket, using HTTP as the transport and JSON as the protocol.
//
// The Server interprets standard CNI environment variables as specified
// by the Container Network Interface (CNI) specification available here:
// https://github.com/containernetworking/cni/blob/master/SPEC.md
// While the Server interface is not itself versioned, as the CNI
// specification requires that CNI network configuration is versioned, and
// since the OVN CNI plugin passes that configuration to the
// Server, versioning is ensured in exactly the same way as an executable
// CNI plugin would be versioned.
//
// Security: since the Unix domain socket created by the Server is owned
// by root and inaccessible to any other user, no unprivileged process may
// access the Server.  The Unix domain socket and its parent directory are
// removed and re-created with 0700 permissions each time ovnkube on the node is
// started.

// NewCNIServer creates and returns a new Server object which will listen on a socket in the given path
func NewCNIServer(factory factory.NodeWatchFactory, kclient kubernetes.Interface) (*Server, error) {
	if config.OvnKubeNode.Mode == types.NodeModeDPU {
		return nil, fmt.Errorf("unsupported ovnkube-node mode for CNI server: %s", config.OvnKubeNode.Mode)
	}
	router := mux.NewRouter()

	s := &Server{
		Server: http.Server{
			Handler: router,
		},
		clientSet: &ClientSet{
			podLister: corev1listers.NewPodLister(factory.LocalPodInformer().GetIndexer()),
			kclient:   kclient,
		},
		kubeAuth: &KubeAPIAuth{
			Kubeconfig:       config.Kubernetes.Kubeconfig,
			KubeAPIServer:    config.Kubernetes.APIServer,
			KubeAPIToken:     config.Kubernetes.Token,
			KubeAPITokenFile: config.Kubernetes.TokenFile,
		},
		handlePodRequestFunc: HandlePodRequest,
	}

	if len(config.Kubernetes.CAData) > 0 {
		s.kubeAuth.KubeCAData = base64.StdEncoding.EncodeToString(config.Kubernetes.CAData)
	}

	router.NotFoundHandler = http.HandlerFunc(http.NotFound)
	router.HandleFunc("/metrics", s.handleCNIMetrics).Methods("POST")
	router.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
		result, err := s.handleCNIRequest(r)
		if err != nil {
			http.Error(w, fmt.Sprintf("%v", err), http.StatusBadRequest)
			return
		}

		// Empty response JSON means success with no body
		w.Header().Set("Content-Type", "application/json")
		if _, err := w.Write(result); err != nil {
			klog.Warningf("Error writing HTTP response: %v", err)
		}
	}).Methods("POST")

	return s, nil
}

// Split the "CNI_ARGS" environment variable's value into a map.  CNI_ARGS
// contains arbitrary key/value pairs separated by ';' and is for runtime or
// plugin specific uses.  Kubernetes passes the pod namespace and name in
// CNI_ARGS.
func gatherCNIArgs(env map[string]string) (map[string]string, error) {
	cniArgs, ok := env["CNI_ARGS"]
	if !ok {
		return nil, fmt.Errorf("missing CNI_ARGS: '%s'", env)
	}

	mapArgs := make(map[string]string)
	for _, arg := range strings.Split(cniArgs, ";") {
		parts := strings.Split(arg, "=")
		if len(parts) != 2 {
			return nil, fmt.Errorf("invalid CNI_ARG '%s'", arg)
		}
		mapArgs[strings.TrimSpace(parts[0])] = strings.TrimSpace(parts[1])
	}
	return mapArgs, nil
}

func cniRequestToPodRequest(cr *Request) (*PodRequest, error) {
	cmd, ok := cr.Env["CNI_COMMAND"]
	if !ok {
		return nil, fmt.Errorf("unexpected or missing CNI_COMMAND")
	}

	req := &PodRequest{
		Command: command(cmd),
	}

	req.SandboxID, ok = cr.Env["CNI_CONTAINERID"]
	if !ok {
		return nil, fmt.Errorf("missing CNI_CONTAINERID")
	}
	req.Netns, ok = cr.Env["CNI_NETNS"]
	if !ok {
		return nil, fmt.Errorf("missing CNI_NETNS")
	}

	req.IfName, ok = cr.Env["CNI_IFNAME"]
	if !ok {
		req.IfName = "eth0"
	}

	cniArgs, err := gatherCNIArgs(cr.Env)
	if err != nil {
		return nil, err
	}

	req.PodNamespace, ok = cniArgs["K8S_POD_NAMESPACE"]
	if !ok {
		return nil, fmt.Errorf("missing K8S_POD_NAMESPACE")
	}

	req.PodName, ok = cniArgs["K8S_POD_NAME"]
	if !ok {
		return nil, fmt.Errorf("missing K8S_POD_NAME")
	}

	// UID may not be passed by all runtimes yet. Will be passed
	// by CRIO 1.20+ and containerd 1.5+ soon.
	// CRIO 1.20: https://github.com/cri-o/cri-o/pull/5029
	// CRIO 1.21: https://github.com/cri-o/cri-o/pull/5028
	// CRIO 1.22: https://github.com/cri-o/cri-o/pull/5026
	// containerd 1.6: https://github.com/containerd/containerd/pull/5640
	// containerd 1.5: https://github.com/containerd/containerd/pull/5643
	req.PodUID = cniArgs["K8S_POD_UID"]

	conf, err := config.ReadCNIConfig(cr.Config)
	if err != nil {
		return nil, fmt.Errorf("broken stdin args")
	}

	// the first network to the Pod is always named as `default`,
	// capture the effective NAD Name here
	req.netName = conf.Name
	if req.netName == types.DefaultNetworkName {
		req.nadName = types.DefaultNetworkName
	} else {
		req.nadName = conf.NADName
	}

	if conf.DeviceID != "" {
		if util.IsPCIDeviceName(conf.DeviceID) {
			// DeviceID is a PCI address
		} else if util.IsAuxDeviceName(conf.DeviceID) {
			// DeviceID is an Auxiliary device name - <driver_name>.<kind_of_a_type>.<id>
			chunks := strings.Split(conf.DeviceID, ".")
			if chunks[1] != "sf" {
				return nil, fmt.Errorf("only SF auxiliary devices are supported")
			}
		} else {
			return nil, fmt.Errorf("expected PCI or Auxiliary device name, got - %s", conf.DeviceID)
		}
	}

	req.CNIConf = conf
	req.timestamp = time.Now()
	// Match the Kubelet default CRI operation timeout of 2m
	req.ctx, req.cancel = context.WithTimeout(context.Background(), 2*time.Minute)
	return req, nil
}

// Dispatch a pod request to the request handler and return the result to the
// CNI server client
func (s *Server) handleCNIRequest(r *http.Request) ([]byte, error) {
	var cr Request
	b, _ := io.ReadAll(r.Body)
	if err := json.Unmarshal(b, &cr); err != nil {
		return nil, err
	}
	req, err := cniRequestToPodRequest(&cr)
	if err != nil {
		return nil, err
	}
	defer req.cancel()

	result, err := s.handlePodRequestFunc(req, s.clientSet, s.kubeAuth)
	if err != nil {
		// Prefix error with request information for easier debugging
		return nil, fmt.Errorf("%s %v", req, err)
	}
	return result, nil
}

func (s *Server) handleCNIMetrics(w http.ResponseWriter, r *http.Request) {
	var cm CNIRequestMetrics

	b, _ := io.ReadAll(r.Body)
	if err := json.Unmarshal(b, &cm); err != nil {
		klog.Warningf("Failed to unmarshal JSON (%s) to CNIRequestMetrics struct: %v",
			string(b), err)
	} else {
		hasErr := fmt.Sprintf("%t", cm.HasErr)
		metrics.MetricCNIRequestDuration.WithLabelValues(string(cm.Command), hasErr).Observe(cm.ElapsedTime)
	}
	// Empty response JSON means success with no body
	w.Header().Set("Content-Type", "application/json")
	if _, err := w.Write([]byte{}); err != nil {
		klog.Warningf("Error writing %s HTTP response for metrics post", err)
	}
}

repository: ovn-org/ovn-kubernetes

repo_name: ovn-org/ovn-kubernetes


text:
SUMMARY = "Solidsense MQTT"
DESCRIPTION = "Solidsense MQTT"
LICENSE = "EPL-1.0"
LIC_FILES_CHKSUM = " \
    file://LICENSE;md5=c7cc8aa73fb5717f8291fcec5ce9ed6c \
"

SRC_URI = " \
    git://git@github.com/SolidRun/SolidSense-MQTT.git;protocol=ssh;branch=master \
    git://git@github.com/SolidRun/SolidSense-V1.git;protocol=ssh;branch=V1.1;destsuffix=SolidSense-V1;name=SolidSense-V1 \
"
SRCREV = "aceb0ffb9e6f832a10bbb07af17640118465e4ca"
SRCREV_SolidSense-V1 = "a31f0edd32d684403e924480f851e5380b6a59e2"
S = "${WORKDIR}/git"
S-V1 = "${WORKDIR}/SolidSense-V1"
KURA_PATH = "/opt/eclipse/kura_4.0.0_solid_sense/"

SYSTEMD_SERVICE_${PN} = "solidsense_mqtt.service"
SYSTEMD_AUTO_ENABLE_${PN} = "disable"

inherit systemd

RDEPENDS_${PN} = "\
"

do_install () {
    install -d ${D}/opt/SolidSense/mqtt
    cp -arP ${S}/* ${D}/opt/SolidSense/mqtt
    chown -R root:root ${D}/opt/SolidSense/mqtt

    install -d ${D}${systemd_unitdir}/system
    install -m 0644 ${S}/install/solidsense_mqtt.service ${D}${systemd_unitdir}/system/solidsense_mqtt.service
    sed -i -e 's,@SBINDIR@,${sbindir},g' \
        -e 's,@SYSCONFDIR@,${sysconfdir},g' \
        ${D}${systemd_unitdir}/system/solidsense_mqtt.service

    # Install the SolidSense MQTT configuration service
    install -d ${D}/${KURA_PATH}/data/packages
    cp -a ${S-V1}/Kura/plugins/SolidsenseMqttService.dp \
        ${D}${KURA_PATH}/data/packages
}

FILES_${PN} = " \
  /opt \
  /opt/SolidSense \
  /opt/SolidSense/mqtt \
  /opt/SolidSense/mqtt/solidsense_mqtt_service.py \
  /opt/SolidSense/mqtt/payload-examples.json \
  /opt/SolidSense/mqtt/test.cfg \
  /opt/SolidSense/mqtt/OBD_Client.py \
  /opt/SolidSense/mqtt/settings_example.cfg \
  /opt/SolidSense/mqtt/README.md \
  /opt/SolidSense/mqtt/mqtt_wrapper.py \
  /opt/SolidSense/mqtt/mqtt_time.py \
  /opt/SolidSense/mqtt/Modem_GPS_Client.py \
  /opt/SolidSense/mqtt/LICENSE \
  /opt/SolidSense/mqtt/settings_example2.cfg \
  /opt/SolidSense/mqtt/utils \
  /opt/SolidSense/mqtt/install \
  /opt/SolidSense/mqtt/utils/serialization_tools.py \
  /opt/SolidSense/mqtt/utils/__init__.py \
  /opt/SolidSense/mqtt/utils/log_tools.py \
  /opt/SolidSense/mqtt/utils/argument_tools.py \
  /opt/SolidSense/mqtt/install/solidsense-mqtt.service \
"

repository: axilera/meta-cip-sr-common

repo_name: axilera/meta-cip-sr-common

extension: bb


text:
@InProceedings{zhong14,
  pdf = {http://jmlr.org/proceedings/papers/v32/zhong14.pdf},
  section = {cycle-1},
  title = {Fast Stochastic Alternating Direction Method of Multipliers},
  author = {Wenliang Zhong and James Kwok},
  pages = {46-54},
  abstract = {We propose a new stochastic alternating direction method of multipliers (ADMM) algorithm, which incrementally approximates the full gradient in the linearized ADMM formulation. Besides having a low per-iteration complexity as existing stochastic ADMM algorithms,  it improves the convergence rate on convex problems from $\mO(1/\sqrt{T})$ to $\mO(1/T)$, where $T$ is the number of iterations. This matches the  convergence rate of the batch ADMM algorithm, but without the need to visit all the samples in each iteration. Experiments on the graph-guided fused lasso demonstrate that the new algorithm is significantly faster than state-of-the-art stochastic and batch ADMM algorithms.},
}

repository: mreid/papersite

repo_name: mreid/papersite

gha_language: TeX

extension: bib


text:
package web

import (
	log "github.com/sirupsen/logrus"
	"net/http"
)

func HealthHandler(w http.ResponseWriter, r *http.Request) {
	_, err := w.Write([]byte("Health"))

	if err != nil {
		log.Error(err)
	}

	//w.WriteHeader(http.StatusOK)
}

repository: ShagaleevAlexey/go-clean

repo_name: ShagaleevAlexey/go-clean


text:
@inproceedings{ase2014,
  author    = {Kasper S{\o}e Luckow and
               Corina S. Pasareanu and
               Matthew B. Dwyer and
               Antonio Filieri and
               Willem Visser},
  title     = {Exact and approximate probabilistic symbolic execution for nondeterministic
               programs},
  booktitle = {{ACM/IEEE} International Conference on Automated Software Engineering,
               {ASE} '14, Vasteras, Sweden - September 15 - 19, 2014},
  pages     = {575--586},
  year      = {2014},
  crossref  = {DBLP:conf/kbse/2014},
  url       = {http://doi.acm.org/10.1145/2642937.2643011},
  doi       = {10.1145/2642937.2643011},
  timestamp = {Wed, 17 Sep 2014 09:31:02 +0200},
  biburl    = {http://dblp.uni-trier.de/rec/bib/conf/kbse/LuckowPDFV14},
  bibsource = {dblp computer science bibliography, http://dblp.org}
}


text:
SUMMARY = "Content-Addressable Data Synchronization Tool"
HOMEPAGE = "https://github.com/systemd/casync"
LICENSE = "LGPL-2.1-or-later"
LIC_FILES_CHKSUM = "file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c"

DEPENDS = "xz curl openssl acl zstd"

SRCREV = "0efa7abffe5fffbde8c457d3c8fafbdde0bb6e4f"
PV = "2+git${SRCPV}"

SRC_URI = " \
    git://github.com/systemd/casync.git;protocol=https;branch=main \
    "

S = "${WORKDIR}/git"

inherit meson pkgconfig

EXTRA_OEMESON += "-Dselinux=false -Dman=false -Dudevrulesdir=${nonarch_base_libdir}/udev/rules.d/"

BBCLASSEXTEND = "native nativesdk"

PACKAGECONFIG:class-native = ""
PACKAGECONFIG:class-nativesdk = ""
PACKAGECONFIG ?= "fuse udev"

PACKAGECONFIG[fuse] = "-Dfuse=true,-Dfuse=false,fuse"
PACKAGECONFIG[udev] = "-Dudev=true,-Dudev=false,udev"

FILES:${PN} += "${datadir}/bash-completion"

repository: rauc/meta-rauc

repo_name: rauc/meta-rauc

gha_language: BitBake


text:
# Base this image on core-image-minimal
#include recipes-core/images/core-image-minimal.bb

DESCRIPTION = "Image with xfce"

IMAGE_FEATURES += "splash package-management x11-base ssh-server-dropbear hwcodecs"

LICENSE = "MIT"

inherit core-image

IMAGE_INSTALL += "packagegroup-xfce-base packagegroup-xfce-extended"