text
stringlengths
3.08k
10.4k
package users import ( "bytes" "errors" "fmt" "html/template" "net/http" "os" "path/filepath" "regexp" "strings" "sync" "github.com/rivo/sessions" ) var ( // The list of htmlTemplates that have already been parsed. htmlTemplates map[string]*template.Template htmlTemplatesMutex sync.Mutex ) // ret...
// Copyright 2019 <NAME>. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package parsers import ( "bufio" "bytes" "compress/gzip" "context" "encoding/csv" "fmt" "log" "os" "runtime" "strings" "sync" "time" "github.com/axamon/h...
// Copyright (c) 2017 Cisco and/or its affiliates. // // 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 applicabl...
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 // protoc v3.14.0 // source: udpa/annotations/sensitive.proto package annotations import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" descript...
package core import ( "context" "fmt" "io/ioutil" "os" "os/signal" "syscall" "time" "github.com/opctl/opctl/cli/internal/clicolorer" "github.com/opctl/opctl/cli/internal/cliexiter" "github.com/opctl/opctl/cli/internal/clioutput" "github.com/opctl/opctl/cli/internal/cliparamsatisfier" "github.com/opctl/opc...
package main import ( "fmt" "github.com/jasdel/harvester/internal/common" "github.com/jasdel/harvester/internal/queue" "github.com/jasdel/harvester/internal/storage" "log" "net/http" "time" ) // Searches for and extracts URLs from a page. Those URLs are then queued up for recursive // crawling with maximum dep...
package user import ( "fmt" "html" "net/http" "net/url" "github.com/budden/semdict/pkg/sddb" "github.com/budden/semdict/pkg/apperror" "github.com/budden/semdict/pkg/shared" "github.com/gin-gonic/gin" ) // RegistrationFormPageHandler renders a /registrationform page func RegistrationFormPageHandler(c *gin.Co...
package main import ( "bytes" "crypto/hmac" "crypto/sha1" "encoding/base32" "encoding/binary" "fmt" "os" "strconv" "strings" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/iam" "github.com/aws/aws-...
package raft import ( "sync/atomic" "github.com/sumimakito/raft/pb" "go.uber.org/zap" "google.golang.org/protobuf/proto" ) type config struct { peerMap SingleFlight[map[string]*pb.Peer] *pb.Config } func newConfig(pbConfig *pb.Config) *config { return &config{Config: pbConfig.Copy()} } func (c *config) Cop...
// Copyright 2019 <NAME>. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law...
/* Copyright © 2020 Dell Inc. or its subsidiaries. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable ...
// Copyright 2022 <NAME>, <NAME>, <NAME> // // 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 agre...
// Copyright 2020-Present VMware, Inc. // SPDX-License-Identifier: Apache-2.0 package commands import ( "context" "errors" "testing" "time" "github.com/pivotal/kpack/pkg/apis/build/v1alpha1" corev1alpha1 "github.com/pivotal/kpack/pkg/apis/core/v1alpha1" "github.com/sclevine/spec" "github.com/stretchr/testify...
package main import ( "flag" "log" "os" "path/filepath" "strings" "github.com/marianogappa/sctool/analyzer" ) func main() { executor, fQuiet, errs := buildAnalyzerExecutor(os.Args[1:]) if len(errs) > 0 { if !fQuiet { log.Println("Errors encountered while preparing to execute analyzers:") log.Println(...
package blinding import ( "crypto/sha256" "encoding/hex" "encoding/json" "errors" "fmt" "golang.org/x/crypto/hkdf" "io" "io/ioutil" "log" "net/http" "path/filepath" "sort" "sync" "unsafe" ) // #cgo LDFLAGS: -lsodium -L/nix/store/2vk6hqbm5v0yf8pinm1k7kl0aw2gqgfb-libsodium-1.0.18/lib // #cgo CPPFLAGS: -I/...
package hamlib import ( "context" "log" "time" "github.com/ftl/rigproxy/pkg/client" "github.com/ftl/hamdeck/pkg/hamdeck" ) type ReconnectListener interface { Reconnected() } type ReconnectListenerFunc func() func (f ReconnectListenerFunc) Reconnect() { f() } func NotifyReconnectListeners(listeners []inter...
package roi import ( "database/sql" "errors" "fmt" "regexp" "sort" "strings" "time" ) // CreateTableIfNotExistShowsStmt는 DB에 shows 테이블을 생성하는 sql 구문이다. // 테이블은 타입보다 많은 정보를 담고 있을수도 있다. var CreateTableIfNotExistsShowsStmt = `CREATE TABLE IF NOT EXISTS shows ( show STRING NOT NULL UNIQUE CHECK (LENGTH(show) > 0) ...
package extractors import ( "bytes" "encoding/binary" "io" "reflect" "testing" "github.com/innosat-mats/rac-extract-payload/internal/aez" "github.com/innosat-mats/rac-extract-payload/internal/common" "github.com/innosat-mats/rac-extract-payload/internal/innosat" ) // makeInstrumentData is a test fixture crea...
package git import ( "fmt" "os" "os/exec" "regexp" "strconv" "strings" "time" "github.com/msoovali/jira-release-maker/pkg/entity" ) const ( PROJECTS_DIR = "projects" RELEASE_BRANCH_PREFIX = "origin/release/" ) type git struct { path string project entity.Project projectDir string } f...
/** * Copyright 2018 gd Author. All Rights Reserved. * Author: Chuck1024 */ package register import ( "encoding/json" "errors" "fmt" "github.com/gdp-org/gd/dlog" "github.com/gdp-org/gd/service" "github.com/gdp-org/gd/utls/network" "github.com/samuel/go-zookeeper/zk" "gopkg.in/ini.v1" "strings" "sync" "t...
package mqttconn import ( "fmt" "net" "net/url" "strings" "time" mqtt "github.com/eclipse/paho.mqtt.golang" "github.com/google/uuid" "github.com/pkg/errors" ) // MQTTConn wraps around mqtt and provides net.PacketConn functionality type MQTTConn struct { mqtt.Client defaultTopicSet bool ...
package main import ( "encoding/json" "flag" "fmt" "log" "net/http" "os" "os/exec" "path/filepath" "strings" "time" "github.com/jimmysawczuk/tmpl/config" "github.com/jimmysawczuk/tmpl/pipe" "github.com/jimmysawczuk/tmpl/tmpl" "github.com/pkg/errors" ) var ( version string = "dev" revision string da...
package controllers import ( "context" "testing" "gotest.tools/assert" "github.com/kuadrant/authorino/api/v1beta1" controller_builder "github.com/kuadrant/authorino/controllers/builder" mock_controller_builder "github.com/kuadrant/authorino/controllers/builder/mocks" "github.com/kuadrant/authorino/pkg/common/...
package meta import ( "fmt" "strconv" "strings" "github.com/puppetlabs/wash/cmd/internal/find/parser/errz" "github.com/puppetlabs/wash/cmd/internal/find/parser/predicate" ) // ArrayPredicate => EmptyPredicate | // ‘[' ? ‘]’ Predicate | // ‘[' * ‘]’ Predicate | // ...
package http import ( "net/http" "time" "crypto/tls" "net" "sync" "github.com/Tecsisa/foulkon/api" "github.com/Tecsisa/foulkon/foulkon" "github.com/julienschmidt/httprouter" "github.com/kylelemons/godebug/pretty" ) type ReloadHandlerFunc func(watch *ProxyServer) bool // ProxyServer struct with reload Ha...
package config import ( "os" "runtime" "testing" "github.com/stretchr/testify/assert" "github.com/urionz/goutil/testutil" ) func TestDefaultLoad(t *testing.T) { st := assert.New(t) ClearAll() err := LoadFiles("testdata/json_base.json", "testdata/json_other.json") st.Nil(err) ClearAll() err = LoadExists(...
// Copyright 2018 The MATRIX Authors as well as Copyright 2014-2017 The go-ethereum Authors // This file is consisted of the MATRIX library and part of the go-ethereum library. // // The MATRIX-ethereum library is free software: you can redistribute it and/or modify it under the terms of the MIT License. // // Permissi...
package decision import ( "github.com/golang/protobuf/ptypes/timestamp" pb "panorama/build/gen" dt "panorama/types" du "panorama/util" ) type SimpleMajorityInference struct { ViewSummaries map[string]*pb.Inference } var _ InferenceAlgo = new(SimpleMajorityInference) var mtag = "majority" const ( // within a ...
package log import ( "bytes" "fmt" "io" goLog "log" "os" ) const ( colorLogDepth = 4 ) var ( ansiColorPallet = map[string][]byte{ "none": []byte("\x1b[0m"), "black": []byte("\x1b[0;30m"), "red": []byte("\x1b[0;31m"), "green": []byte("\x1b[0;32m"), "orange": []byt...
// Copyright 2019 The zbdba 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 ...
package main import ( "flag" "fmt" "log" "os" "runtime/pprof" "time" "github.com/go-sql-driver/mysql" "github.com/packet-guardian/pg-dhcp/internal/config" "github.com/packet-guardian/pg-dhcp/internal/server" "github.com/packet-guardian/pg-dhcp/internal/utils" "github.com/packet-guardian/pg-dhcp/managment"...
package main import ( "encoding/json" "fmt" "github.com/joho/godotenv" "gopkg.in/go-playground/webhooks.v5/github" tb "gopkg.in/tucnak/telebot.v2" "io/ioutil" "log" "net/http" "os" "strings" "time" ) var telegramToken string var allowedGroup string var githubSecret string var group *Group type Group struc...
package releaser type Release struct { Assets []struct { BrowserDownloadURL string `json:"browser_download_url"` ContentType string `json:"content_type"` CreatedAt string `json:"created_at"` DownloadCount int64 `json:"download_count"` ID int64 `json:"id"` Label ...
// Copyright 2020 The Chubao 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 agree...
// Copyright 2016 The fer Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package config implements command-line flag parsing and fer devices // configuration from JSON files. package config // import "github.com/alice-go/fer/con...
/* * Copyright 2022-Present Couchbase, Inc. * * Use of this software is governed by the Business Source License included * in the file licenses/BSL-Couchbase.txt. As of the Change Date specified * in that file, in accordance with the Business Source License, use of this * software will be governed by...
// Package dfloader implements results.Loader using a DataFrameBuilder. package dfloader import ( "context" "fmt" "sort" "time" "go.opencensus.io/trace" "go.skia.org/infra/go/paramtools" "go.skia.org/infra/go/query" "go.skia.org/infra/go/skerr" "go.skia.org/infra/go/sklog" "go.skia.org/infra/go/vec32" "go....
// SPDX-License-Identifier: MIT // // Copyright (C) 2021 <NAME>. All Rights Reserved. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree or at // https://spdx.org/licenses/MIT.html // Package opaque implements the OPAQUE asymmetric password-a...
package segment_tree //线段树 //节点 type Node struct { L int //左区间index R int //右区间index Deep int //深度 Index int //下标 Value []interface{} //数量跟Functions一致 } //函数 如 max,min,sum //需要保证与线段树内的元素能够调用 type Function func(l, r interface{}) interface{} //线段树结构 type SegmentTr...
// Copyright (c) 2017 Arista Networks, Inc. // Use of this source code is governed by the Apache License 2.0 // that can be found in the COPYING file. package excludespec import ( "bytes" "fmt" "io/ioutil" "os" "path/filepath" "reflect" "sort" "strconv" "strings" "testing" "github.com/aristanetworks/quant...
package avm import ( "context" "fmt" "time" "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/utils/formatting" "github.com/ava-labs/avalanchego/vms/avm" "github.com/sirupsen/logrus" "github.com/figment-networks/avalanche-indexer/client" "github.com/figment-networks/avalanche-indexer/...
// Copyright 2021 The Noisia Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package tempfiles defines implementation of workload which executes queries // which create on-disk temporary files due to lack of work_mem. // // Before...
package main import ( "bufio" "errors" "fmt" "flag" "os" "os/exec" "path/filepath" "runtime" ) // Configurable constants (flags). var setupPath string var verbose bool // Global constants var deps = []string{"git", "tmux", "vim", "zsh"} const githubURL string = "<EMAIL>:jchaffraix/SetUp.git" const vimSensibl...
// Code generated by download. DO NOT EDIT. package iso20022_auth_048_001_01 import ( "bytes" "encoding/xml" "time" ) // Must match the pattern [A-Z]{3,3} type ActiveOrHistoricCurrencyCode string // Must match the pattern [A-Z]{2,2} type CountryCode string type CountryCodeAndName3 struct { Cd CountryCode `xml:...
// Copyright (c) 2021 rookie-ninja // // Use of this source code is governed by an Apache-style // license that can be found in the LICENSE file. package main import ( "context" "encoding/json" "github.com/rookie-ninja/rk-common/common" "github.com/rookie-ninja/rk-entry/entry" "github.com/rookie-ninja/rk-query" ...
// Package doubleclick implements the decryption logic for Google OpenRTB-DoubleClick cryptography. package doubleclick import ( "bytes" "crypto/hmac" "crypto/sha1" "encoding/base64" "encoding/binary" "errors" "fmt" ) var ( // ErrInvalidPrice is the error returned when the price parsed // by DecryptPrice is ...
/* Copyright (C) 2019 Synopsys, Inc. Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: task_info.proto package data import ( fmt "fmt" proto "github.com/golang/protobuf/proto" math "math" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile...
// Copyright (c) 2019, Sylabs Inc. All rights reserved. // This software is licensed under a 3-clause BSD license. Please consult the // LICENSE.md file distributed with the sources of this project regarding your // rights to use or distribute this software. package cli import ( "os" "os/user" "path/filepath" "g...
// Copyright 2015 <NAME> and <NAME>. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package fem import ( "sort" "testing" "github.com/cpmech/gosl/chk" "github.com/cpmech/gosl/io" ) func Test_bh16a(tst *testing.T) { /* solid bracket...
package zlog import ( "github.com/spf13/viper" "go.uber.org/zap" "go.uber.org/zap/zapcore" "gopkg.in/natefinch/lumberjack.v2" "os" "time" ) // return zap.Logger by viper config file // canWriteLogFile set true is write to file //file set as yaml like // config.yml //zap: // AtomicLevel: -1 # DebugLevel:-1 Info...
package goruntine import ( "fmt" "time" "golang.org/x/tour/tree" ) //Equivalent Binary Trees // Walk walks the tree t sending all values from the tree to the channel ch. func Walk(t *tree.Tree, ch chan int) { if t == nil { fmt.Println("Tree is null.") return } if t.Left != nil { Walk(t.Left, ch) } ch ...
package pdb import ( "fmt" "glycodist/http" "io/ioutil" "time" ) // PDB represents a single PDB entry. type PDB struct { ID string `json:"id"` // PDB ID URL string `json:"url"` // RCSB web page URL PDBURL string `json:"pdbUrl"` // RCSB download URL for the PDB file CIFURL string `json:"cifUrl"` ...
package main /* Problem: Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 For example, two is written as II in Roman numeral, just two one's add...
package newuser import ( "context" "fmt" "log" "os" "time" firebase "firebase.google.com/go" "google.golang.org/api/iterator" "cloud.google.com/go/firestore" "cloud.google.com/go/functions/metadata" myfirestore "github.com/feloy/yatzy.io/backend/lib/firestore" "github.com/feloy/yatzy.io/backend/lib/game"...
package bakery_test import ( "encoding/json" "fmt" "time" "github.com/juju/loggo" "golang.org/x/net/context" gc "gopkg.in/check.v1" "gopkg.in/macaroon.v2-unstable" "gopkg.in/macaroon-bakery.v2-unstable/bakery" "gopkg.in/macaroon-bakery.v2-unstable/bakery/checkers" ) // testContext holds the testing backgro...
/* * MIT License * * Copyright (C) 2021 Crimson Technologies LLC. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitati...
// Copyright 2017 Mirantis // // 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 writi...
package perconaservermongodbbackup import ( "context" "fmt" "time" psmdbv1 "github.com/percona/percona-server-mongodb-operator/pkg/apis/psmdb/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "sigs.k8s.io/contr...
package main import ( "bytes" "encoding/json" "flag" "fmt" "io/ioutil" "os" "path/filepath" "strings" "github.com/gosimple/slug" "github.com/otiai10/copy" ) func init() { flag.StringVar(&input, "input", "", "the input directory") flag.StringVar(&output, "output", "", "the output Hugo website root") } fu...
package main import ( "context" "io" "math" "strings" "sync" "time" "github.com/schwarzlichtbezirk/pds/pb" "google.golang.org/protobuf/types/known/emptypb" "google.golang.org/protobuf/types/known/timestamppb" ) // Storage is singleton, PDS database var storage sync.Map // Haversine calculates distance in ...
package main import ( "io" "io/ioutil" "os" "encoding/json" "log" "net/http" "github.com/gorilla/mux" ) // The Status type for status response type Status struct { Status string `json:"status,omitempty"` } // The BookDetails type for details response type BookDetails struct { ID string `json:"id,omitempty...
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** package core import ( "context" "reflect" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) // Use this data source to access information about an...
package payload import ( "errors" "fmt" "sync" "github.com/iotaledger/hive.go/stringify" drngPayload "github.com/iotaledger/goshimmer/packages/binary/drng/payload" "github.com/iotaledger/goshimmer/packages/binary/drng/payload/header" "github.com/iotaledger/goshimmer/packages/binary/messagelayer/payload" "git...
package signature import ( "bytes" "encoding/hex" "errors" "fmt" cbor "github.com/britram/borat" log "github.com/inconshreveable/log15" "github.com/netsec-ethz/rains/internal/pkg/algorithmTypes" "github.com/netsec-ethz/rains/internal/pkg/keys" "golang.org/x/crypto/ed25519" ) //MetaData contains meta data o...
package discord import ( "fmt" "math/rand" "regexp" "strings" "time" "github.com/SteMak/sakura_bot/utils/channel" "github.com/SteMak/sakura_bot/utils/imagework" "github.com/SteMak/sakura_bot/utils/magiclog" "github.com/SteMak/sakura_bot/utils/sends" "github.com/SteMak/sakura_bot/utils/timeformats" "github....
/* * Copyright (C) 2017-2018 GIG Technology NV and Contributors * * 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 ...
// Code generated by protoc-gen-go. // source: structdef.proto // DO NOT EDIT! /* Package goserbench is a generated protocol buffer package. It is generated from these files: structdef.proto It has these top-level messages: ProtoBufA */ package goserbench import proto "github.com/golang/protobuf/proto" import fmt...
package main import ( "fmt" "time" "os" "os/user" _ "os/user" "strings" "path/filepath" "regexp" "github.com/360EntSecGroup-Skylar/excelize" "github.com/axgle/mahonia" ) const ( defaultSheet = "Sheet1" ) func main() { //filepath inputFile := getInputFilePath() //check source file exist exist, _ := pa...
/* All functions within this file accept and return angular values in degrees unless explicitly * stated otherwise. In all other cases, SI units are used. * * The eccentric anomaly solution consist of 3 functions: * * 1. EccentricAnomaly * 2. keplerStart * 3. eps * * These functions were adapted from: * *...
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 // protoc v3.11.4 // source: api/error/error.proto package error import ( _ "github.com/go-kratos/kratos/v2/errors" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/ru...
// Copyright 2016 <NAME>. All Rights Reserved. // // This code is a Go port of the Java version created and maintained by Cognitect, therefore: // // Copyright 2014 Cognitect. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance wit...
package services import ( "../models" "fmt" "strconv" "io/ioutil" "net/http" "../../common" ) // Interface type IRoleService interface { GetRoles() []*models.Role GetRole(a int) *models.Role AddRole(a *models.Role) bool UpdateRole(a *models.Role) bool DeleteRole(a *model...
package main import ( "crypto/sha256" "encoding/gob" "fmt" "log" "net" ) var countOfClients int = 0 var count int = 0 var chainHead *Block func writeThread(c net.Conn) { for { //fmt.Println("han g agaye hai idhr :-", c.RemoteAddr()) block11 := <-addblock //fmt.Println("contenttttttttt...
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. package storageaccount import ( "context" "fmt" azurev1alpha1 "github.com/Azure/azure-service-operator/api/v1alpha1" "github.com/Azure/azure-service-operator/pkg/errhelp" "github.com/Azure/azure-service-operator/pkg/helpers" "github.com...
package lint import ( "fmt" "os" "golang.stackrox.io/kube-linter/pkg/diagnostic" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "golang.stackrox.io/kube-linter/internal/flagutil" "golang.stackrox.io/kube-linter/pkg/builtinchecks" "golang.stackrox.io/kube-linter/pkg/checkregistry" "golang.stackrox.io/kub...
// Copyright 2098 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package cmd import ( "context" "fmt" "io/ioutil" "os" "path/filepath" "infra/cmd/cros_test_platform/internal/autotest/artifacts" "infra/cmd/cros...
package main import ( "fmt" "os" "strconv" "time" "unsafe" "github.com/temorfeouz/gocl/cl_demo/utils" "github.com/temorfeouz/gocl/cl" ) const PROGRAM_FILE = "collatz.cl" var KERNEL_FUNC = []byte("collatz") //work took 393.231557ms //The kernel result max val 837799, max steps 526 func main() { /* OpenCL...
// This file is subject to a 1-clause BSD license. // Its contents can be found in the enclosed LICENSE file. package main import ( "flag" "fmt" "github.com/jteeuwen/evdev" "os" "os/signal" ) func main() { node := parseArgs() // Create and open our device. dev, err := evdev.Open(node) if err != nil { fmt...
package ostrich import ( "time" "github.com/lindsaygelle/nook" "github.com/lindsaygelle/nook/animal" "github.com/lindsaygelle/nook/character" "github.com/lindsaygelle/nook/gender" "github.com/lindsaygelle/nook/personality" "golang.org/x/text/language" ) var ( blancheBirthday = nook.Birthday{ Day: 21, M...
package convert import ( "encoding/json" "strings" "github.com/pkg/errors" log "github.com/sirupsen/logrus" "github.com/stackrox/rox/pkg/utils" "github.com/stackrox/scanner/cpe/nvdtoolscache" v1 "github.com/stackrox/scanner/generated/scanner/api/v1" "github.com/stackrox/scanner/pkg/component" "github.com/sta...
/* Copyright 2019 THL A29 Limited, a Tencent company. 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 t...
package aws_fargate import ( "fmt" "gopkg.in/nullstone-io/go-api-client.v0" "gopkg.in/nullstone-io/nullstone.v0/app" aws_ecr "gopkg.in/nullstone-io/nullstone.v0/app/container/aws-ecr" "gopkg.in/nullstone-io/nullstone.v0/outputs" "log" "os" ) var ( logger = log.New(os.Stderr, "", 0) ) var _ app.Provider = Pro...
package event import ( "0chain.net/chaincore/state" "0chain.net/core/common" "0chain.net/core/logging" "0chain.net/smartcontract/dbs" "context" "encoding/json" "github.com/stretchr/testify/require" "go.uber.org/zap" "testing" "time" ) func init() { logging.Logger = zap.NewNop() } func TestMiners(t *testin...
/* Copyright (c) <NAME> 2017-2018 Package goconfig read config files. */ package goconfig import ( "bytes" "fmt" "reflect" "strings" ) // matchEnd Find matching } of ${ in a string. // val is the remaining of the string. i.e : after ${ // return pos of } in string or -1 func (c *ConfigImpl) matchEnd(val string) ...
package matcher import ( "fmt" "os" "testing" "time" . "github.com/smartystreets/goconvey/convey" ) func TestMain(m *testing.M) { RegisterDefaults() code := m.Run() os.Exit(code) } func TestErrorHandling(t *testing.T) { Convey("Given a non-struct", t, func() { v := "invalid" Convey("When a match is at...
package recycle import ( "context" "errors" "fmt" "io/ioutil" "time" "github.com/ministryofjustice/cloud-platform-cli/pkg/cluster" "github.com/rs/zerolog/log" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" utilerrors "k8s.io/apimachinery/pkg/util/error...
package proxy import ( "crypto/rsa" "fmt" "strings" "github.com/dgrijalva/jwt-go" ocgatev1beta1 "github.com/rh-fieldwork/kube-gateway-operator/api/v1beta1" ) func authenticateToken(token string, secret []byte, publicKey *rsa.PublicKey) (*jwt.Token, error) { tok, err := jwt.Parse(token, func(t *jwt.Token) (inte...
package backend import ( "database/sql" "fmt" "strings" "github.com/DexterLB/mvm/imdb" "github.com/DexterLB/mvm/imdb/jsonapi" "github.com/bitterfly/kuho/spiderdata" "github.com/jmoiron/sqlx" _ "github.com/lib/pq" ) type Backend struct { db *sqlx.DB imdbClient *jsonapi.Client } func New(dbURN stri...
/* Copyright 2021 The KodeRover 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, s...
/* For license and copyright information please see LEGAL file in repository */ package pehrest import ( "../achaemenid" "../authorization" er "../error" "../ganjine" gs "../ganjine-services" lang "../language" "../srpc" "../syllab" ) // HashTransactionRegisterService store details about HashTransactionRegis...
package main import ( "bytes" "compress/zlib" "encoding/json" "fmt" "strings" "github.com/clockworksoul/smudge" ) // messageType is an alias for int8. Whenever you see "messageType" in the code, // think int8. Using this alias however allows us to increase code clarity and // safety beyond simply passing meani...
package pipeline import ( "errors" "io" "os" "time" "github.com/Sirupsen/logrus" v1 "k8s.io/api/core/v1" k8serror "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/sets" watch "k8s.io/apimachinery/pkg/watch" "...
package todo import ( "errors" "sync" "github.com/rs/xid" ) var ( // list which will contain todos list []Todo // this is the mutex that will allow you to safely access/manipulate the data in this package across different goroutines. // goroutines are multiple lightweight threads of execution. mtx sync.RWMut...
package slack import ( "fmt" "log" "strings" linq "github.com/ahmetb/go-linq" slack "github.com/nlopes/slack" ldap "gopkg.in/ldap.v2" ) func GetASlackClient(slackAccessToken string) *slack.Client { return slack.New(slackAccessToken, slack.OptionDebug(false)) } func GetSlackGroups(slackAPI slack.Client, slack...
// Copyright The OpenTelemetry 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 agr...
// Copyright (c) <NAME> and contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for details. // This is a fork of bytes.Reader, originally licensed under // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style /...
// Copyright 2017 Orange // // 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 writi...
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
package outputs import ( "crypto/tls" "crypto/x509" "encoding/json" "fmt" "io/ioutil" "os" "strings" "sync" "sync/atomic" "syscall" "time" "github.com/Shopify/sarama" . "github.com/carbonblack/cb-event-forwarder/pkg/config" "github.com/rcrowley/go-metrics" log "github.com/sirupsen/logrus" ) func NewTL...