text stringlengths 3.08k 10.4k |
|---|
package solver3
import (
"runtime"
"github.com/Spi1y/tsp-solver/solver2/iterator"
"github.com/Spi1y/tsp-solver/solver2/tasks"
"github.com/Spi1y/tsp-solver/solver2/types"
)
type solution struct {
path []types.Index
distance types.Distance
}
type processingPacket struct {
task tasks.Task
newTasks []ta... |
/*
Copyright 2021 The Crossplane 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 network
import (
"context"
"net"
"github.com/hetznercloud/hcloud-go/hcloud"
"github.com/pkg/errors"
infrav1 "github.com/cluster-api-provider-hcloud/cluster-api-provider-hcloud/api/v1alpha3"
"github.com/cluster-api-provider-hcloud/cluster-api-provider-hcloud/pkg/cloud/scope"
"github.com/cluster-api-pro... |
// 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... |
// Code generated by go-swagger; DO NOT EDIT.
package asynchronous_replication
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"... |
package bot
import (
"regexp"
"strings"
"sync"
"time"
)
type EventHandler struct {
OnError OnError
accept bool
acceptUsers map[string]bool
ignoreUsers map[string]bool
commands map[string][]Command
mutex *sync.RWMutex
}
type Command struct {
CommandType string
eventType stri... |
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 <NAME> <<EMAIL>>
// SPDX-FileCopyrightText: 2022 <NAME> <<EMAIL>>
// SPDX-FileCopyrightText: 2022 <NAME> <<EMAIL>>
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License... |
package test
import (
"bytes"
"io/ioutil"
"os"
"path/filepath"
"strings"
"testing"
"github.com/hashicorp/hcl/v2"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/pulumi/pulumi/pkg/v3/codegen"
"github.com/pulumi/pulumi/pkg/v3/codegen/hcl2"
"github.com/pulumi/pulumi/pk... |
package audio
import "math"
// IntMaxSignedValue returns the max value of an integer
// based on its memory size
func IntMaxSignedValue(b int) int {
switch b {
case 8:
return 255 / 2
case 16:
return 65535 / 2
case 24:
return 16777215 / 2
case 32:
return 4294967295 / 2
default:
return 0
}
}
// IEEEFl... |
package tests
import (
"bytes"
"context"
"errors"
"fmt"
"net"
"net/http"
"net/http/httptest"
"os"
"testing"
"time"
"github.com/algolia/algoliasearch-client-go/v3/algolia/search"
"github.com/gin-gonic/gin"
"github.com/globalsign/mgo"
"github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert"
"githu... |
package main
import (
"bufio"
"fmt"
"log"
"net"
"os"
"time"
"github.com/dustin/go-humanize"
"github.com/mhann/gospeedtest"
"github.com/sparrc/go-ping"
"github.com/urfave/cli"
)
func main() {
app := cli.NewApp()
app.Name = "gospeedtest"
app.Version = "0.0.1"
app.Authors = []cli.Author{
cli.Author{
... |
/*
MIT License
Copyright (c) 2022 Kubeshop
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 limitation the rights
to use, copy, modify, merge, publish, distr... |
// Copyright (c) 2016, 2018, 2021, Oracle and/or its affiliates. All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose ei... |
//go:generate go run ./go-avrogrpc -i test.avpr -o codegen_test.go -p avrogrpc -t ./go-avrogrpc/codegen.template
package avrogrpc
import (
"context"
"encoding/hex"
"fmt"
"io"
"io/ioutil"
"net"
"os"
"path/filepath"
"testing"
"github.com/stretchr/testify/require"
"google.golang.org/grpc"
"google.golang.org... |
// Code Generated By gen-enumer For "Enum Type: SdHealthCheckType" - DO NOT EDIT;
/*
* Copyright 2020-2021 Aldelo, LP
*
* 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://ww... |
package canvas
import (
"strconv"
"strings"
)
const (
blockCellType = iota
pipeCellType
textCellType
)
func cellTypes() []int {
return []int{blockCellType, pipeCellType, textCellType}
}
// Cell represents an item to be rendered on the canvas
type Cell interface {
String() string
hash() (int, string)
}
cons... |
// 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 ... |
package cc
import (
"fmt"
"testing"
"time"
"github.com/damnever/cc/assert"
)
func TestValueExists(t *testing.T) {
v := NewValue(nil)
assert.Check(t, v.Exist(), false)
v = NewValue(0)
assert.Check(t, v.Exist(), true)
}
func TestValueToPattern(t *testing.T) {
v := NewValue("")
if x, ok := v.Pattern().(Patte... |
// Copyright 2015 CloudAwan 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 i... |
/*
Copyright © 2021 NAME HERE <EMAIL ADDRESS>
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 param
import (
"net/http"
"strconv"
"strings"
"time"
)
const (
intBase = 10
bitSize = 64
)
// Request - provide methods for extracting r parameters from context.
type Request struct {
request *http.Request
body Parameter
parameters map[paramPlacing]map[string]Parameter
}
func NewRequest(requ... |
package sqload
import (
"bufio"
"net"
"strconv"
"strings"
"sync"
"testing"
"time"
graphite "github.com/cyberdelia/go-metrics-graphite"
stats "github.com/rcrowley/go-metrics"
"github.com/stretchr/testify/assert"
)
func TestCountingStatsNamedCounterReporting(t *testing.T) {
assert := assert.New(t)
rec := N... |
package main
import (
"fmt"
"math"
"regexp"
"sort"
"github.com/kiteco/kiteco/kite-go/lang/python/pythonscanner"
"github.com/kiteco/kiteco/kite-go/lang/python/pythonpatterns"
"github.com/kiteco/kiteco/kite-go/lang"
"github.com/kiteco/kiteco/kite-go/lang/editorapi"
"github.com/kiteco/kiteco/kite-go/lang/pyth... |
package gql_test
import (
"bufio"
"bytes"
"compress/gzip"
"context"
"fmt"
"io/ioutil"
"math/rand"
"os"
"path/filepath"
"sort"
"strconv"
"strings"
"testing"
"github.com/grailbio/base/traverse"
"github.com/grailbio/gql/gql"
"github.com/grailbio/gql/gqltest"
"github.com/grailbio/gql/gqlutil"
"github.co... |
package stomp
import (
"context"
"errors"
"fmt"
"log"
"net"
"net/url"
"time"
"github.com/go-stomp/stomp/v3"
"github.com/go-stomp/stomp/v3/frame"
"github.com/tx7do/kratos-transport/broker"
)
type stompBroker struct {
opts broker.Options
stompConn *stomp.Conn
}
func NewBroker(opts ...broker.Option) b... |
package bittrex
import (
"crypto/hmac"
"crypto/sha512"
"encoding/hex"
"encoding/json"
"io"
"io/ioutil"
"log"
"net/http"
"net/url"
"os"
"strconv"
"time"
"github.com/pkg/errors"
)
type restCall struct {
req *http.Request
res *restResponse
resBody []byte
httpClient *http.Client
httpTranspo... |
package astilibav
import (
"context"
"fmt"
"sync/atomic"
"github.com/asticode/go-astiencoder"
"github.com/asticode/go-astitools/stat"
"github.com/asticode/go-astitools/sync"
"github.com/asticode/go-astitools/worker"
"github.com/asticode/goav/avcodec"
"github.com/asticode/goav/avutil"
"github.com/pkg/errors"... |
// Copyright 2019-2021 The Liqo 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 ag... |
package main
import (
"flag"
"fmt"
"io"
"io/ioutil"
"os"
"reflect"
"strconv"
"strings"
"github.com/golang/glog"
"github.com/golang/protobuf/proto"
descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor"
plugin "github.com/golang/protobuf/protoc-gen-go/plugin"
)
//////////////////////////////////... |
/*
* Tencent is pleased to support the open source community by making 蓝鲸 available.
* Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the L... |
package tm
import (
"fmt"
"testing"
"github.com/golangplus/testing/assert"
)
func TestMatchTokens1(t *testing.T) {
delT, insT := LineToTokens("{abc{def}ghi}"), LineToTokens("{def}")
assert.StringEqual(t, "delT", delT, "[{ abc { def } ghi }]")
assert.StringEqual(t, "insT", insT, "[{ def }]")
matA, matB := Mat... |
// Copyright (C) 2021 Gridworkz Co., Ltd.
// KATO, Application Management Platform
// 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 limitation the r... |
/*
* Haaf's Game Engine 1.8
* Copyright (C) 2003-2007, Relish Games
* hge.relishgames.com
*
* hge_tut02 - Using input, sound and rendering using the legacy API
*/
package main
import (
"fmt"
HGE "github.com/losinggeneration/hge"
"github.com/losinggeneration/hge/gfx"
"github.com/losinggeneration/hge/input"
... |
package test
import (
"go/format"
"os/exec"
"path/filepath"
"sort"
"strings"
"testing"
"github.com/google/go-cmp/cmp"
"github.com/spf13/afero"
"github.com/stretchr/testify/require"
"golang.org/x/tools/go/packages/packagestest"
"github.com/skipor/gmg/internal/app"
"github.com/skipor/gmg/internal/testutil"... |
package serie_test
import (
"testing"
"github.com/datasweet/datatable/serie"
"github.com/stretchr/testify/assert"
)
func TestAppend(t *testing.T) {
s := serie.Int()
assertSerieEq(t, s)
s.Append(1, 2, 3, 4, "5")
assertSerieEq(t, s, 1, 2, 3, 4, 5)
s.Append(nil, 6, 7, "8", 9, 10)
assertSerieEq(t, s, 1, 2, 3,... |
package digitalocean
import (
"errors"
"fmt"
"koding/kites/kloud/kloud/machinestate"
"koding/kites/kloud/kloud/protocol"
"strconv"
"strings"
"time"
"github.com/garyburd/redigo/redis"
)
const (
CacheRedisSetName = "digitalocean"
)
var (
ErrNoCachedDroplets = errors.New("No cached machines available.")
... |
package utils
import (
"encoding/json"
"github.com/zllangct/zgo/iface"
"github.com/zllangct/zgo/logger"
"github.com/zllangct/zgo/timer"
"io/ioutil"
"os"
"strconv"
"strings"
)
type GlobalObj struct {
TcpServers map[string]iface.Iserver
TcpServer iface.Iserver
OnConnectioned ... |
package snd
import (
"errors"
"fmt"
"path/filepath"
"regexp"
"strings"
"github.com/mikkyang/id3-go"
)
// {
// "kind": "track",
// "id": 152514285,
// "created_at": "2014/06/02 22:04:29 +0000",
// "user_id": 2511,
// "duration": 4199289,
// "commentable": true,
// "state": "finished",
// "original_conte... |
package bearnotes
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestNewTag(t *testing.T) {
tagContent := " #test/123 "
tag := NewTag(tagContent, []int{0, len(tagContent)})
assert.Equal(t, "test/123", tag.Name, "tag name must be equal")
// Back to string
assert.Equal(t, " #test/123 ", tag.Str... |
/*
* 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 ... |
package daemon
import (
"fmt"
"os"
"runtime"
"strings"
"time"
"github.com/docker/docker/api"
"github.com/docker/docker/api/types"
"github.com/docker/docker/cli/debug"
"github.com/docker/docker/daemon/logger"
"github.com/docker/docker/dockerversion"
"github.com/docker/docker/pkg/fileutils"
"github.com/dock... |
// Copyright 2020 H2O.ai, 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 (c) Mainflux
// SPDX-License-Identifier: Apache-2.0
package authn
import (
"context"
"time"
"github.com/mainflux/mainflux"
"github.com/mainflux/mainflux/pkg/errors"
)
const (
loginDuration = 10 * time.Hour
recoveryDuration = 5 * time.Minute
)
var (
// ErrUnauthorizedAccess represents unautho... |
// Package checksum 校验本地文件包
package checksum
import (
"crypto/md5"
"github.com/Erope/BaiduPCS-Go/pcsutil/cachepool"
"github.com/Erope/BaiduPCS-Go/pcsutil/converter"
"hash/crc32"
"io"
"os"
)
const (
// DefaultBufSize 默认的bufSize
DefaultBufSize = int(256 * converter.KB)
)
const (
// CHECKSUM_MD5 获取文件的 md5 值
C... |
// Copyright (c) 2019 The Jaeger Authors.
// Copyright (c) 2017 Uber Technologies, 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
//... |
package _generated
import (
"os"
"time"
"github.com/tinylib/msgp/msgp"
)
//go:generate msgp -v -o generated.go
// All of the struct
// definitions in this
// file are fed to the code
// generator when `make test` is
// called, followed by an
// invocation of `go test -v` in this
// directory. A simple way of tes... |
package main
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strconv"
"time"
"github.com/atotto/clipboard"
"github.com/docopt/docopt-go"
"github.com/yml/keep"
)
const (
exitCodeOk = 0
exitCodeNotOk = 1
)
var input string
// printAndExitOnError exit the program with 1 as exit code after printing the ... |
/*
Copyright IBM Corp. 2016 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 or ag... |
package cdn
import (
"context"
"encoding/json"
"math/rand"
"sync"
"time"
"github.com/rockbears/log"
"github.com/ovh/cds/engine/websocket"
"github.com/ovh/cds/sdk"
"github.com/ovh/cds/sdk/telemetry"
)
const wbBrokerPubSubKey = "cdn_ws_broker_pubsub"
func (s *Service) initWebsocket() error {
log.Info(s.Rou... |
package memory
import (
"fmt"
"io"
"strings"
"github.com/dolthub/go-mysql-server/sql"
"github.com/dolthub/go-mysql-server/sql/expression"
)
// A very dumb index that iterates over the rows of a table, evaluates its matching expressions against each row, and
// stores those values to be later retrieved. Only her... |
package main
import (
"bufio"
"context"
"crypto/rand"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
mrand "math/rand"
"github.com/libp2p/go-libp2p"
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
... |
/*
Copyright 2020 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 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, ... |
package main
import (
"testing"
"time"
"cloud.google.com/go/civil"
"cloud.google.com/go/spanner"
)
func createRow(t *testing.T, values []interface{}) *spanner.Row {
t.Helper()
// column names are not important in this test, so use dummy name
names := make([]string, len(values))
for i := 0; i < len(names); i... |
package horizontal
import (
"context"
"github.com/BeameryHQ/async-stream/lb"
"github.com/BeameryHQ/async-stream/stream"
"github.com/sirupsen/logrus"
"k8s.io/client-go/util/workqueue"
"strings"
"sync"
)
// Flow is same as Flow but makes sure the handlers get only partitioned data
// it's not able to distinguish... |
package filemode
import (
"encoding/binary"
"fmt"
"os"
"strconv"
)
// A FileMode represents the kind of tree entries used by git. It
// resembles regular file systems modes, although FileModes are
// considerably simpler (there are not so many), and there are some,
// like Submodule that has no file system equiva... |
package cmd
import (
"flag"
"fmt"
"os"
"strings"
)
const (
EXCEL_CELL_CHAR_LIMIT = 32767
NUMBERS_ROW_LIMIT = 65535
)
type CleanSubcommand struct {
noTrim bool
excel bool
numbers bool
addBom bool
stripBom bool
verbose bool
}
func (sub *CleanSubcommand) Name() string {
return "clean"
}
func ... |
package rest
import (
"errors"
"fmt"
"net/http"
"time"
"github.com/justinas/alice"
"gitlab.deepwisdomai.com/infra/go-zero/core/codec"
"gitlab.deepwisdomai.com/infra/go-zero/core/load"
"gitlab.deepwisdomai.com/infra/go-zero/core/stat"
"gitlab.deepwisdomai.com/infra/go-zero/rest/handler"
"gitlab.deepwisdomai.... |
package zset
//#include "skiplist.h"
import "C"
import (
"reflect"
"runtime"
"unsafe"
)
const DEFAULT_TBL_LEN = 16
type zset struct {
sl *C.skiplist
tbl map[string]float64
}
func tocstring(s string) (*C.char, C.size_t) {
v := (*reflect.StringHeader)(unsafe.Pointer(&s))
return (*C.char)(unsafe.Pointer(v.Dat... |
// Code generated by entc, DO NOT EDIT.
package ent
import (
"fmt"
"strings"
"entgo.io/ent/dialect/sql"
"github.com/casbin/ent-adapter/ent/casbinrule"
)
// CasbinRule is the model entity for the CasbinRule schema.
type CasbinRule struct {
config `json:"-"`
// ID of the ent.
ID int `json:"id,omitempty"`
// P... |
// Copyright (c) 2020 Tailscale Inc & 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 derp implements DERP, the Detour Encrypted Routing Protocol.
//
// DERP routes packets to clients using curve25519 keys as addresses.
//
... |
package v1beta1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// GCPMachineProviderSpec is the type that will be embedded in a Machine.Spec.ProviderSpec field
// for an GCP virtual machine. It is used by the GCP machine actuator to create a single Machine.
// Compatibility lev... |
package tx
import (
"bytes"
"database/sql"
"encoding/gob"
"fmt"
"log"
"reflect"
"regexp"
"strings"
"github.com/rhinof/grabbit/gbus"
"github.com/rhinof/grabbit/gbus/saga"
)
//SagaStore base type for embedding for new transactional saga stores
type SagaStore struct {
Tx gbus.TxProvider
SvcName ... |
package test
import (
"testing"
"github.com/v2pro/plz/test"
"github.com/v2pro/plz/countlog"
"github.com/v2pro/plz/test/must"
"github.com/v2pro/plz/dump"
"reflect"
"fmt"
"unsafe"
)
type nameOff int32 // offset to a name
type typeOff int32 // offset to an *rtype
type textOff int32 // offset from top of text sec... |
// Copyright 2019 The Kubeflow 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 2017 Gravitational, 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, soft... |
/*
Copyright 2020 The Crossplane 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 (c) Microsoft Corporation and Dapr Contributors.
// Licensed under the MIT License.
// ------------------------------------------------------------
package placement
import (
"fmt"
"testing"
"time"
"github.com/stretchr/testify/assert"
... |
package main
import (
"bufio"
"context"
"fmt"
"log"
"net/url"
"os"
"os/signal"
"strings"
"syscall"
"github.com/dustin/go-humanize"
"github.com/melbahja/got"
"github.com/urfave/cli/v2"
"gitlab.com/poldi1405/go-ansi"
"gitlab.com/poldi1405/go-indicators/progress"
"golang.org/x/crypto/ssh/terminal"
)
var ... |
// 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... |
/*
Copyright 2018 The Knative 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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... |
/*
Copyright 2018 The Skaffold 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, sof... |
package client
import (
"bytes"
"context"
"encoding/json"
"io"
"io/ioutil"
"net"
"net/http"
"net/url"
"os"
"strings"
"time"
"github.com/heetch/regula/api"
"github.com/heetch/regula/version"
"github.com/rs/zerolog"
"golang.org/x/net/context/ctxhttp"
)
const (
userAgent = "Regula/" + version.Version +... |
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.
//go:build linux
// +build linux
package kernel
import (
"testing"
"... |
package util
import (
"strings"
)
func GetFirstLinuxWorkerNode(oc *CLI) (string, error) {
var (
workerNode string
err error
)
workerNode, err = getFirstNodeByOsId(oc, "worker", "rhcos")
if len(workerNode) == 0 {
workerNode, err = getFirstNodeByOsId(oc, "worker", "rhel")
}
return workerNode, err
}
... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package ec2
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type ImportSnapshotInput struct {
_ struct{} `type:"structure"`
// The client-specific data.
ClientData *Data `type:"structu... |
package options
import "github.com/oauth2-proxy/oauth2-proxy/v7/providers"
// Providers is a collection of definitions for providers.
type Providers []Provider
// Provider holds all configuration for a single provider
type Provider struct {
// ClientID is the OAuth Client ID that is defined in the provider
// This... |
/*
Copyright 2020 The OpenEBS 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, soft... |
// Copyright 2019 <NAME>. All rights reserved.
// Use of this source code is governed by a BDS-style
// license that can be found in the LICENSE file.
package main
import (
"encoding/binary"
"fmt"
"math"
"os"
"path/filepath"
"strings"
"sync"
"testing"
"unsafe"
"github.com/hongping1224/lidari... |
// Copyright 2022 The CubeFS 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... |
package backtestingUtils
import (
"fmt"
"strconv"
live "../utils"
"github.com/360EntSecGroup-Skylar/excelize"
"github.com/luno/luno-go/decimal"
)
var xrp decimal.Decimal
var xbt decimal.Decimal
var currRow int64
var f *excelize.File
func InitialiseFunds(xbtFunds decimal.Decimal, xrpStock decimal.Decimal) {
pa... |
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"path/filepath"
"time"
"github.com/icco/etu-cli/lib/location"
"github.com/machinebox/graphql"
"github.com/olekukonko/tablewriter"
"github.com/peterh/liner"
"github.com/urfave/cli/v2"
)
var (
history_fn = filepath.Join(os.TempDir(), ".etu.histor... |
package template
// xgo/template/apply_test.go
import (
"fmt"
xr "github.com/jddixon/rnglib_go"
gc "github.com/jddixon/xgo_go/context"
xf "github.com/jddixon/xlUtil_go/lfs"
. "gopkg.in/check.v1"
"io/ioutil"
"os"
"path/filepath"
)
var _ = fmt.Print
func (s *XLSuite) makeSymbolSet(c *C, rng *xr.PRNG, size int... |
// Copyright 2016-2021 The Libsacloud 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... |
package okex
import (
"encoding/json"
"fmt"
log "github.com/sirupsen/logrus"
"scindapsus/util"
"strconv"
"time"
)
type PrivateWSClient = OKExWSClient
func (wsClient *PrivateWSClient) WatchCreateOrder(symbol, orderType, side string, amount, price float64, clOrdID, tradeMode string) error {
//Symbol-时间戳-OrderTy... |
// Copyright (c) 2017-2018 The qitmeer developers
// Copyright (c) 2013-2014 The btcsuite developers
// Copyright (c) 2015 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package base58_test
import (
"testing"
"github.com/Qitmeer/qitmeer/comm... |
package cosign
import (
"fmt"
"io"
"os"
"strings"
"arhat.dev/rs"
"arhat.dev/dukkha/pkg/constant"
"arhat.dev/dukkha/pkg/dukkha"
"arhat.dev/dukkha/pkg/sliceutils"
"arhat.dev/dukkha/pkg/templateutils"
"arhat.dev/dukkha/pkg/tools"
"arhat.dev/dukkha/pkg/tools/buildah"
)
const TaskKindSignImage = "sign-image"
... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package iotthingsgraph
import (
"context"
"time"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type SearchFlowExecutionsInput struct {
_ struct{} `type:"structure"`
// The date and time of the latest f... |
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v1
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Create a new ImportJob within a KeyRing. Imp... |
// Copyright 2017 Istio 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 i... |
// Copyright 2021 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// TODO: Remove and use components/cros/power instead!
package power
import (
"context"
"strconv"
"strings"
"time"
"infra/cros/recovery/interna... |
/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License ... |
/*
Copyright 2021 <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 agreed to in writing, software
distribu... |
// Copyright 2014 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// ninjatrace converts .ninja_log into trace-viewer formats.
//
// usage:
// $ go run ninjatrace.go --ninjalog out/debug-x64/.ninja_log
//
package main
i... |
package v040
import (
"fmt"
"strings"
"time"
yaml "gopkg.in/yaml.v2"
sdk "github.com/Pylons-tech/cosmos-sdk/types"
)
// Staking params default values
const (
// DefaultUnbondingTime reflects three weeks in seconds as the default
// unbonding time.
// TODO: Justify our choice of default here.
DefaultUnbondi... |
package widget
import (
"image/color"
"fyne.io/fyne"
"fyne.io/fyne/canvas"
"fyne.io/fyne/driver/desktop"
"fyne.io/fyne/theme"
)
type checkRenderer struct {
icon *canvas.Image
label *canvas.Text
focusIndicator *canvas.Circle
objects []fyne.CanvasObject
check *Check
}
// MinSize calculates the minimum ... |
package remote_api
// This file provides the client for connecting remotely to a user's production
// application.
import (
"bytes"
"fmt"
"io/ioutil"
"log"
"math/rand"
"net/http"
"net/url"
"regexp"
"strconv"
"strings"
"time"
"appengine"
"appengine_internal"
pb "appengine_internal/remote_api"
"appengin... |
package zenrpc
import (
"encoding/json"
)
const (
// ParseError is error code defined by JSON-RPC 2.0 spec.
// Invalid JSON was received by the server.
// An error occurred on the server while parsing the JSON text.
ParseError = -32700
// InvalidRequest is error code defined by JSON-RPC 2.0 spec.
// The JSON ... |
package main
import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strings"
"sync"
"time"
"log"
"github.com/mozilla/tls-observatory/certificate"
"github.com/mozilla/tls-observatory/database"
)
type scan struct {
ID int64 `json:"scan_id"`
}
type mozillaEvalData struct {
Level strin... |
package action
import (
"context"
"encoding/json"
"errors"
"net/http"
"github.com/google/uuid"
"go.uber.org/zap"
"google.golang.org/api/homegraph/v1"
)
const (
// GoogleFulfillmentPath represents the HTTP path which the Google fulfillment hander will call
GoogleFulfillmentPath = "/fulfillment"
)
var (
// ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.