text stringlengths 10 1.05M |
|---|
package main
import (
"bufio"
"fmt"
"log"
"os"
)
const (
right = iota
down
)
type coord [2]int
type cuc struct {
p coord // position
t int // type (right / down)
}
type state struct {
M, N int // size of the map
m [][]*cuc // map of all cucumbers
f [2]map[*cuc]bool // free cuc... |
package nats
import (
"context"
"errors"
cl "github.com/AyushSenapati/reactive-micro/paymentsvc/pkg/logger"
"github.com/AyushSenapati/reactive-micro/paymentsvc/pkg/service"
"github.com/nats-io/nats.go"
)
type EventHandler struct {
cl *cl.CustomLogger
nc *nats.EncodedConn
handlers *Eve... |
package ec2
import (
"github.com/awslabs/goformation/v5/cloudformation/policies"
)
// SpotFleet_ClassicLoadBalancersConfig AWS CloudFormation Resource (AWS::EC2::SpotFleet.ClassicLoadBalancersConfig)
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-classicloadbalance... |
package servergroups
import "github.com/huaweicloud/golangsdk"
const resourcePath = "os-server-groups"
func resourceURL(c *golangsdk.ServiceClient) string {
return c.ServiceURL(resourcePath)
}
func listURL(c *golangsdk.ServiceClient) string {
return resourceURL(c)
}
func createURL(c *golangsdk.ServiceClient) str... |
package rcontest_test
import (
"fmt"
"log"
"github.com/gorcon/rcon"
"github.com/gorcon/rcon/rcontest"
)
func ExampleServer() {
server := rcontest.NewServer(
rcontest.SetSettings(rcontest.Settings{Password: "password"}),
rcontest.SetCommandHandler(func(c *rcontest.Context) {
switch c.Request().Body() {
... |
// Copyright ©2014 The Gonum 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 gonum
import (
"math"
)
type general64 struct {
data []float64
rows, cols int
stride int
}
func (g general64) clone() general64 {
... |
/*
Copyright 2016 The Kubernetes 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, ... |
/*
Copyright 2014 The Kubernetes 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, ... |
// Copyright 2016 The etcd 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 t... |
package s
import (
. "github.com/alecthomas/chroma" // nolint
"github.com/alecthomas/chroma/lexers/internal"
)
var SYSTEMD = internal.Register(MustNewLazyLexer(
&Config{
Name: "SYSTEMD",
Aliases: []string{"systemd"},
Filenames: []string{"*.service"},
MimeTypes: []string{"text/plain"},
},
systemdRu... |
// Copyright 2012 The Go 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 crc8 implements the 8-bit cyclic redundancy check, or CRC-8,
// checksum. See http://en.wikipedia.org/wiki/Cyclic_redundancy_check and
// http://www.... |
/*
Copyright 2019 Splunk Inc.
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 wri... |
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT license.
*/
package pipeline
import (
"context"
"io/ioutil"
"os"
"path"
"strings"
"github.com/pkg/errors"
kerrors "k8s.io/apimachinery/pkg/util/errors"
"github.com/Azure/azure-service-operator/hack/generator/pkg/astmodel"
"github.com/Azu... |
package producer
import (
"encoding/json"
"errors"
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/sqs"
)
type clipMessage struct {
VideoSlugs []string `json:"videoSlugs"`
VideoDescription string `json:"videoDescription"`
Chann... |
package docker
import (
"flag"
"fmt"
"log"
"os"
"os/exec"
"os/user"
"strconv"
"syscall"
)
// Setup networking
func setupNetworking(gw string) {
if gw == "" {
return
}
cmd := exec.Command("/sbin/route", "add", "default", "gw", gw)
if err := cmd.Run(); err != nil {
log.Fatalf("Unable to set up networkin... |
package fs
import (
"io/ioutil"
"os"
"testing"
)
const lockTestPath = "test.lock"
var lockTestMode = os.FileMode(0666)
func testLockFile(fs FileSystem, t *testing.T) {
fs.Remove(lockTestPath)
lock, needRecovery, err := fs.CreateLockFile(lockTestPath, lockTestMode)
if lock == nil || needRecovery || err != nil ... |
// Copyright 2021 Google LLC
//
// 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 w... |
package printer
import (
"bytes"
"io"
"sort"
"testing"
"time"
"github.com/pallscall/ghz/runner"
promtypes "github.com/prometheus/client_model/go"
expfmt "github.com/prometheus/common/expfmt"
"github.com/stretchr/testify/assert"
)
func TestPrinter_printPrometheus(t *testing.T) {
date := time.Now()
var tes... |
package slice
func Reduce(slice interface{}, initReduceValue interface{}, f func(reduceValue interface{}, i int, v interface{}) interface{}) (reduceValue interface{}) {
reduceValue = initReduceValue
Foreach(slice, func(i int, v interface{}) {
reduceValue = f(reduceValue, i, v)
})
return
} |
package pointer
import "time"
func ToBool(ptr *bool) bool {
if ptr == nil {
return false
}
return *ptr
}
func ToDuration(ptr *time.Duration) time.Duration {
if ptr == nil {
return 0
}
return *ptr
}
func ToFloat64(ptr *float64) float64 {
if ptr == nil {
return 0.
}
return *ptr
}
func ToInt(ptr *int) ... |
package main
import (
"fmt"
"math"
)
type Point struct{ X, Y float64 }
type Path []Point
func Distance(p, q Point) float64 {
return math.Hypot(q.X-p.X, q.Y-p.Y)
}
func (p Point) Distance(q Point) float64 {
return math.Hypot(q.X-p.X, q.Y-p.Y)
}
func (p Path) Distance() float64 {
sum := 0.0
for i := range p {
... |
package snaker
type Engine struct {
ProcessService //流程定义业务类
}
//通过流程ID开始实例
func (p *Engine) StartInstanceById(id int64, operator string, args map[string]interface{}) *Order {
process := p.GetProcessById(id)
return p.StartProcess(process, operator, args)
}
//通过流程NAME开始实例
func (p *Engine) StartInstanceByName(name ... |
// Copyright 2015 Light Code Labs, LLC
//
// 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... |
package customerlockboxapi
// Copyright (c) Microsoft and contributors. 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.... |
// Copyright 2021 Google LLC
//
// 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 w... |
package main
import (
"fmt"
"sync"
"time"
)
type SafeCounter struct {
v map[string]int
mux sync.Mutex
}
func (c *SafeCounter) Inc(key string) {
c.mux.Lock()
c.v[key]++
c.mux.Unlock()
}
func (c *SafeCounter) Value(key string) int {
c.mux.Lock()
defer c.mux.Unlock()
return c.v[key]
}
func main() {
c :=... |
// Copyright 2018 The gVisor 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 2017 Google Inc.
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 agreedto in writing, software
dist... |
package limes
import (
"testing"
th "github.com/gophercloud/gophercloud/testhelper"
)
var domainServicesMockJSON = `
[
{
"type": "compute",
"area": "compute",
"resources": [
{
"name": "cores",
"quota": 50,
"projects_quota": 20,
"usage": 10
},
{
"name": "ram",
"... |
/*
Copyright 2017 The Kubernetes 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, ... |
/*
Copyright 2021 The Kubernetes 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, ... |
package geos
/*
#cgo LDFLAGS: -lgeos_c
#include "geos_c.h"
#include <stdint.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
extern void goLogString(char *msg);
void debug_wrap(const char *fmt, ...) {
va_list a_list;
va_start(a_list, fmt);
char buf[1024];
vsnprintf(buf, sizeo... |
/*
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 may not use this fi... |
/*
The audioengine package creates a portaudio stream and synthesises audio samples into the stream using Voices
it receives.
*/
package audioengine
import (
"sync"
"github.com/crnbaker/gostringsynth/errors"
"github.com/gordonklaus/portaudio"
)
type SynthVoice interface {
ShouldDie() bool
KillOnNextCycle()
Syn... |
package stress
import (
"context"
"encoding/json"
"net/http"
"net/http/httptest"
"sync/atomic"
"testing"
"time"
"github.com/steinfletcher/apitest"
)
func TestStress(t *testing.T) {
var count int32
underTest := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeade... |
package polardbx
//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
//dist... |
// Copyright 2014 The goyy Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package main
import (
"github.com/axgle/mahonia"
"gopkg.in/goyy/goyy.v0/util/errors"
"gopkg.in/goyy/goyy.v0/util/strings"
)
func tagItemValue(tag, name ... |
/*
Copyright IBM Corp. 2017 All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package channelconfig
import (
"github.com/Matrix-Zhang/fabric-gm/common/capabilities"
cb "github.com/Matrix-Zhang/fabric-gm/protos/common"
pb "github.com/Matrix-Zhang/fabric-gm/protos/peer"
"github.com/pkg/errors"
)
const (... |
package fflag
import (
"testing"
)
func TestLoadOnce(t *testing.T) {
reset()
config := []string{}
err := Load(config)
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
config = append(config, "i_am_a_test_flag")
err = Load(config)
if err == nil {
t.Fatal("expected an error when loading for the se... |
/*
Copyright 2022 TriggerMesh Inc.
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, softwar... |
package main
import (
"context"
"fmt"
"log"
"net"
"os"
"os/signal"
"github.com/jwmwalrus/grpc-go/blog"
"github.com/jwmwalrus/grpc-go/blog/blogpb"
"github.com/jwmwalrus/grpc-go/calculator"
"github.com/jwmwalrus/grpc-go/calculator/calculatorpb"
"github.com/jwmwalrus/grpc-go/greet"
"github.com/jwmwalrus/grpc... |
package command
import (
"etym/pkg/db/model"
"html"
"regexp"
"strings"
)
type CombineResult struct {
Original string
Translation string
Final int
}
func combineSentences(sentences []*model.Sentence) CombineResult {
var pivot = -1
for i := range sentences {
sentences[i].Trans = strings.TrimSpace(h... |
package exporters |
// Copyright (c) 2011-2017, HL7, Inc & The MITRE Corporation
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice, ... |
package main
import (
"bufio"
"io/ioutil"
"os"
"regexp"
"strconv"
"strings"
"time"
"gopkg.in/yaml.v2"
)
// readConfigfile creates the ConfigSettings struct from the g10k config file
func readConfigfile(configFile string) ConfigSettings {
Debugf("Trying to read g10k config file: " + configFile)
data, err :=... |
package greenskeeper
import (
"errors"
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"path"
"strconv"
"syscall"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gexec"
)
var _ = Describe("Greenskeeper", func() {
Describe("#CheckExistingGdnProcess", func() {
var (
pidFile *os.Fi... |
package cmd
import (
"encoding/json"
"fmt"
"io/ioutil"
"math/rand"
"os"
"path"
"sort"
"strings"
"time"
"github.com/Azure/acs-engine/pkg/acsengine"
"github.com/Azure/acs-engine/pkg/acsengine/transform"
"github.com/Azure/acs-engine/pkg/api"
"github.com/Azure/acs-engine/pkg/armhelpers"
"github.com/Azure/ac... |
// Parallel Gateway (10.5.4)
package parallel_gateway |
/*
* BigIP iControl REST
*
* REST API for F5 BigIP. List of operations is not complete, nor known to be accurate.
*
* OpenAPI spec version: 12.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file ... |
// Copyright 2013-2018 The NATS 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 ... |
package main
import (
"context"
"fmt"
"io"
"os"
"github.com/vegaprotocol/api-clients/go/generated/code.vegaprotocol.io/vega/proto"
"github.com/vegaprotocol/api-clients/go/generated/code.vegaprotocol.io/vega/proto/api"
"google.golang.org/grpc"
)
func main() {
nodeURLGrpc := os.Getenv("NODE_URL_GRPC")
if len(... |
package main
import (
"fmt"
"math/rand"
"net/url"
"time"
)
// Strategy is an interface to be implemented by loadbalancing
// strategies like round robin or random.
type Strategy interface {
NextEndpoint() url.URL
SetEndpoints([]url.URL)
}
// RandomStrategy implements Strategy for random endopoint selection
typ... |
/*
*/
package parser
const numNTSymbols = 26
type (
gotoTable [numStates]gotoRow
gotoRow [numNTSymbols]int
)
var gotoTab = gotoTable{
gotoRow{ // S0
-1, // S'
1, // AllRules
2, // Rules
4, // Rule
6, // Root
7, // Init
8, // Transition
9, // IfExpr
-1, // StateExpr
13, // Function
... |
// Code generated by piper's step-generator. DO NOT EDIT.
package cmd
import (
"fmt"
"os"
"time"
"github.com/SAP/jenkins-library/pkg/config"
"github.com/SAP/jenkins-library/pkg/log"
"github.com/SAP/jenkins-library/pkg/telemetry"
"github.com/spf13/cobra"
)
type kubernetesDeployOptions struct {
AdditionalPara... |
// Copyright 2018 The Gitea Authors.
// Copyright 2016 The Gogs Authors.
// All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package models
import (
"fmt"
"strings"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log"
"co... |
// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: weather.ext.proto
package pb
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
import (
context "context"
api "github.com/micro/go-micro/v2/api"
client "github.com/micro/go-micro/v2/client"
server "github.com/micro/go-micro... |
package models
import (
"context"
"database/sql"
"time"
"github.com/keydotcat/keycatd/util"
)
type Vault struct {
Id string `scaneo:"pk" json:"id"`
Team string `scaneo:"pk" json:"-"`
Version uint32 `json:"version"`
PublicKey []byte `json:"public_key"`
CreatedAt time.Time `json:"cre... |
package migration1596485729
import (
"github.com/jinzhu/gorm"
)
// Migrate adds a job_run_id column to flux_monitor_round_stats
func Migrate(tx *gorm.DB) error {
return tx.Exec(`
ALTER TABLE flux_monitor_round_stats ADD COLUMN "job_run_id" uuid REFERENCES job_runs(id) ON DELETE CASCADE;
`).Error
} |
// Package etcd provides the etcd backend middleware.
package etcd
import (
"encoding/json"
"fmt"
"strings"
"time"
"github.com/coredns/coredns/middleware"
"github.com/coredns/coredns/middleware/etcd/msg"
"github.com/coredns/coredns/middleware/pkg/singleflight"
"github.com/coredns/coredns/middleware/proxy"
"g... |
package main
import (
"testing"
)
func BenchmarkFibIterative(b *testing.B) {
for i := 0; i < b.N; i++ {
FibIterative(30)
}
}
func BenchmarkFibRecusrive(b *testing.B) {
for i := 0; i < b.N; i++ {
FibRecursive(30)
}
}
func BenchmarkFibMemoization(b *testing.B) {
for i := 0; i < b.N; i++ {
FibMemoization(3... |
/*
* EVE Swagger Interface
*
* An OpenAPI for EVE Online
*
* OpenAPI spec version: 0.8.6
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* 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... |
// Copyright 2019 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License... |
// Copyright (c) 2016 The btcsuite developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package txsizes
import (
"github.com/ltcsuite/ltcd/blockchain"
"github.com/ltcsuite/ltcd/wire"
)
// Worst case script and input/output size estimates.
const (
// RedeemP... |
/*
Copyright 2014 The Kubernetes 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, ... |
// +build integration,!no-etcd
package integration
import (
"testing"
"time"
kapi "k8s.io/kubernetes/pkg/api"
kapierror "k8s.io/kubernetes/pkg/api/errors"
"k8s.io/kubernetes/pkg/util/wait"
clusterdiags "github.com/openshift/origin/pkg/diagnostics/cluster"
diagtype "github.com/openshift/origin/pkg/diagnostics... |
package daemon
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"github.com/golang/glog"
"github.com/openshift/machine-config-operator/pkg/daemon/constants"
corev1 "k8s.io/api/core/v1"
)
func (dn *Daemon) loadNodeAnnotations(node *corev1.Node) (*corev1.Node, error) {
ccAnnotation, err := getNodeAnnotation(nod... |
package containers
import (
"encoding/json"
"fmt"
"github.com/zero-os/0-core/base/pm"
"github.com/zero-os/0-core/apps/core0/helper/filesystem"
"io/ioutil"
"net/url"
"os"
"path"
"regexp"
"syscall"
)
const (
backupMetaName = ".corex.meta"
)
var (
resticSnaphostIdP = regexp.MustCompile(`snapshot ([^\s]+) sa... |
package load
import (
"compress/gzip"
"encoding/json"
"io/ioutil"
"net/http"
"net/http/httptest"
"os"
"path/filepath"
"reflect"
"sort"
"testing"
"github.com/ghodss/yaml"
"github.com/google/go-cmp/cmp"
"k8s.io/apimachinery/pkg/util/diff"
utilerrors "k8s.io/apimachinery/pkg/util/errors"
"github.com/ope... |
package main
import (
"fmt"
"os"
"os/user"
)
func main() {
arguments := os.Args
if len(arguments) == 1 {
uid := os.Getuid()
fmt.Println(uid)
return
}
username := arguments[1]
u, err := user.Lookup(username)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(u.Uid)
} |
/*
Copyright 2019 The Kubernetes 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, ... |
// Copyright Fuzamei Corp. 2018 All Rights Reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package rpc
import (
"encoding/hex"
"fmt"
"time"
"github.com/33cn/chain33/queue"
"google.golang.org/grpc"
//"sync"
"testing"
//"time"
"github.com/33cn... |
package elb
import "github.com/aquasecurity/cloud-metadata/pkg/metadata"
var DropInvalidHeaders = metadata.Metadata{
ID: "AVD-AWS-0052",
Title: "Load balancers should drop invalid headers",
Description: "Passing unknown or invalid headers through to the target poses a potential risk of compromise.
... |
package notificationhubs
// Copyright (c) Microsoft and contributors. 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
... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package codedeploy
import (
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol"
"github.com/aws/aws-sdk-go/private/protocol/jsonrp... |
package keeper
import (
"encoding/json"
"fmt"
"strconv"
ethcmn "github.com/ethereum/go-ethereum/common"
"github.com/okex/exchain/app/utils"
"github.com/okex/exchain/libs/cosmos-sdk/codec"
sdk "github.com/okex/exchain/libs/cosmos-sdk/types"
sdkerrors "github.com/okex/exchain/libs/cosmos-sdk/types/errors"
abci... |
// All material is licensed under the Apache License Version 2.0, January 2004
// http://www.apache.org/licenses/LICENSE-2.0
// go build
// ./example4
// Sample program to generate box plots of the iris data variables.
package main
import (
"bytes"
"log"
"github.com/gonum/plot"
"github.com/gonum/plot/plotter"
... |
package anyconvert
import (
"fmt"
"github.com/golang/protobuf/ptypes/any"
)
// AnyToFloatListMap unmarshal an arbitrary any.Any message to a map[string][]float32.
// Declaration & implementation generation are located in internal/proto/value package
// It expect an any.Any message which contain the url type for a
/... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package ecr
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/ListImagesRequest
type ListImagesInput struct {
_ str... |
// Copyright 2017 The Periph Authors. All rights reserved.
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.
// This file is expected to be copy-pasted in all benchmark smoke test. The
// only delta shall be the package name.
package sysfssmoketest
... |
// Copyright 2019 The Samply Development Community
//
// 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... |
package main
import (
"github.com/aws/aws-lambda-go/lambda"
"github.com/mathantunes/go-sam-template/domain"
"github.com/mathantunes/go-sam-template/domain/entities"
"github.com/mathantunes/go-sam-template/domain/service"
"github.com/mathantunes/go-sam-template/domain/valueobjects"
"github.com/mathantunes/go-sam-... |
package retry
import (
"math"
"math/rand"
"time"
)
// Transformation 对生成的等待时间进行转换调整
type Transformation func(duration time.Duration) time.Duration
// Full creates a Transformation that transforms a duration into a result
// duration in [0, n) randomly, where n is the given duration.
//
// The given generator is w... |
package resources
import (
"context"
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
)
type Mutable func(context.Context, runtime.Object, runtime.Object) controllerutil.MutateFn
func (m *Mutable) AppendMutation(mutate Mutable) {
old := *m
*m = func(ctx context.C... |
/*
Copyright 2020 The hostpath provisioner operator Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... |
package properties
// DO NOT EDIT: This file is autogenerated by running 'go generate'
// It's generated by "github.com/KablamoOSS/kombustion/generate"
import "fmt"
// ServiceHealthCheckConfig Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-servicediscovery-service-healthc... |
/*
Copyright 2015 The Kubernetes 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, ... |
// Code generated by counterfeiter. DO NOT EDIT.
package fakes
import (
"net/http"
"sync"
"code.cloudfoundry.org/lager"
)
type ErrorResponse struct {
BadRequestStub func(lager.Logger, http.ResponseWriter, error, string)
badRequestMutex sync.RWMutex
badRequestArgsForCall []struct {
arg1 lager.Log... |
package server
import (
"bytes"
"fmt"
"io"
"net/http"
"github.com/go-spatial/tegola/atlas"
"github.com/go-spatial/tegola/cache"
"github.com/go-spatial/tegola/internal/log"
"github.com/go-spatial/tegola/mvt"
)
// TileCacheHandler implements a request cache for tiles on requests when the URLs
// have a /:z/:x/... |
package cron
import (
"time"
"os"
"os/signal"
"github.com/irisnet/rainbow-sync/service/iris/logger"
"github.com/irisnet/rainbow-sync/service/iris/db"
model "github.com/irisnet/rainbow-sync/service/iris/model"
"github.com/irisnet/rainbow-sync/service/iris/block"
"github.com/irisnet/rainbow-sync/service/iris/hel... |
package rpc
import (
"bufio"
"fmt"
"os"
"strings"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/input"
"github.com/cosmos/cosmos-sdk/client/lcd"
"github.com/cosmos/cosmos-sdk/crypto/keys"
sdk "github.com/cosmos/cosmos-sdk/types"
"gith... |
// Copyright 2017 CoreOS, Inc.
//
// 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... |
// Copyright © 2019 The Tekton 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... |
package downlink
import (
"context"
"encoding/base64"
"encoding/hex"
"fmt"
"time"
log "github.com/Sirupsen/logrus"
"github.com/brocaar/loraserver/api/as"
"github.com/brocaar/loraserver/api/gw"
"github.com/brocaar/loraserver/api/nc"
"github.com/brocaar/loraserver/internal/common"
"github.com/brocaar/lorase... |
package problem277 |
// Copyright 2018 IZI Global. 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 applicabl... |
package outline
import (
g "github.com/maragudk/gomponents"
h "github.com/maragudk/gomponents-heroicons"
)
func Refresh(children ...g.Node) g.Node {
return h.Outline(g.Group(children),
g.Raw(`<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 ... |
// Copyright (c) 2021 Terminus, Inc.
//
// 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... |
package datatypes
// ArtistInfo is the basic info for a single artist returned by the Artist get api call
// https://www.bandsintown.com/api/1.0/requests#artists-get
type ArtistInfo struct {
Artist
UpcomingGigCount int `json:"upcoming_events_count"`
} |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
package v1alpha1
import (
"github.com/Azure/azure-service-operator/api"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// ASOStatus (AzureServiceOperatorsStatus) defines the observed state of resource actions
type ASOStatus struct {
// IN... |
package lm
// NGramBuilder is an entity that responsible for creating CountTrie
type NGramBuilder struct {
startSymbol, endSymbol Token
}
// NewNGramBuilder returns new instance of NGramBuilder
func NewNGramBuilder(
startSymbol, endSymbol string,
) *NGramBuilder {
return &NGramBuilder{
startSymbol: startSymbol,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.