text stringlengths 8.57k 38.1k |
|---|
package mpd
import (
"context"
"errors"
"fmt"
"io"
"net"
"reflect"
"sync"
"syscall"
"testing"
"time"
"github.com/meiraka/vv/internal/mpd/mpdtest"
)
func TestDial(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), testTimeout)
defer cancel()
ts := mpdtest.NewServer("OK MPD 0.19")
... |
// Copyright 2020 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.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc v3.17.3
// source: infra/unifiedfleet/api/v1/... |
package village
import (
"github.com/timshannon/bolthold"
"gopkg.in/mgo.v2/bson"
)
/************************* VILLAGES & SERVICES *************************/
// Server is the server that instances to run the DataBase of the village
type Server struct {
DataBase *bolthold.Store
}
// Village are the villages that ... |
/*
Copyright 2019 The KubeCarrier 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) 2017-2018 Zededa, Inc.
// SPDX-License-Identifier: Apache-2.0
// NodeAgent interfaces with baseosmgr for baseos upgrade and test validation
// we will transition through zboot for baseos upgrade validation process
// nodeagent publishes the following topic
// * zboot config <nodeage... |
// Copyright 2019 DeepMap, 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 wr... |
package gateway
import (
"context"
"fmt"
"reflect"
"github.com/go-logr/logr"
"github.com/kong/go-kong/kong"
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"
"k8s.io/apimachinery/pkg/types"
ctrl "sigs.k8s.io/cont... |
package headscale
import (
"context"
"crypto/tls"
"errors"
"fmt"
"io"
"io/fs"
"net"
"net/http"
"net/url"
"os"
"os/signal"
"sort"
"strings"
"sync"
"syscall"
"time"
"github.com/coreos/go-oidc/v3/oidc"
"github.com/gin-gonic/gin"
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
"github.c... |
// Copyright 2009 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.
// Delete the next line to include in the gob package.
//go:build ignore
// +build ignore
package gob
// This file is not normally included in the gob package... |
package main
import (
"bufio"
"context"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"math"
"net/http"
_ "net/http/pprof"
"os"
"runtime"
"runtime/pprof"
"sort"
"time"
"github.com/cockroachdb/pebble"
"github.com/cockroachdb/pebble/bloom"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/... |
/*
* foundationdb_labels.go
*
* This source file is part of the FoundationDB open source project
*
* Copyright 2022 Apple Inc. and the FoundationDB project 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 ob... |
package gcfg
import (
"bytes"
"fmt"
"github.com/pkg/errors"
"math/big"
"os"
"reflect"
"strconv"
"testing"
)
const (
// 64 spaces
sp64 = " "
// 512 spaces
sp512 = sp64 + sp64 + sp64 + sp64 + sp64 + sp64 + sp64 + sp64
// 4096 spaces
sp4096 = s... |
// 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... |
//+build gtk
package reply
import (
"container/list"
"errors"
"strconv"
"time"
"strings"
"log"
"fmt"
"sync"
"runtime"
F "github.com/qydysky/bili_danmu/F"
c "github.com/qydysky/bili_danmu/CV"
p "github.com/qydysky/part"
msgq "github.com/qydysky/part/msgq"
s "github.com/qydysky/part/buf"
reqf "github.c... |
// Copyright 2018 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 filedesc_test
import (
"fmt"
"reflect"
"regexp"
"strconv"
"strings"
"testing"
"github.com/google/go-cmp/cmp"
detrand "google.golang.org/proto... |
package grpcgen
// In schema-like objects such as Schema, Parameter, and Items, we
// respect an extension called `x-proto-type`. This value should
// be a hash:
//
// "x-proto-type": {
// "name": "MyMessage"
// }
//
// If the type requires importing from another library, you should
// specify the "import" field:
//... |
package village
import (
"context"
"encoding/gob"
"fmt"
"image/color"
"log"
"net/http"
"os"
"os/signal"
"sync"
"time"
"github.com/gin-gonic/gin"
"github.com/timshannon/bolthold"
"gopkg.in/mgo.v2/bson"
)
// These are the global variables that we can use all accross the project
var (
basePath = os.Getenv... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc v3.13.0
// source: ory/keto/acl/v1alpha1/check_service.proto
package acl
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect... |
// Copyright 2011 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 vp8
// This file implements decoding DCT/WHT residual coefficients and
// reconstructing YCbCr data equal to predicted values plus residuals.
/... |
// MIT License
//
// Copyright (c) Microsoft Corporation. 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 limitation the righ... |
// Package blake2s implements the BLAKE2s secure hashing algorithm with support
// for salting and personalization. BLAKE2s is optimized for 8- to 32-bit
// platforms and produces digests of any size between 1 and 32 bytes
package blake2s
import (
"errors"
)
// The constant values will be different for other BLAKE2 ... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: appcallback.proto
package runtime
import (
context "context"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
empty "github.com/golang/protobuf/ptypes/empty"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.or... |
package main
import (
"gitee.com/jntse/minehero/pbmsg"
"gitee.com/jntse/minehero/server/tbl"
_"gitee.com/jntse/minehero/server/def"
"gitee.com/jntse/gotoolkit/net"
"gitee.com/jntse/gotoolkit/log"
"gitee.com/jntse/gotoolkit/util"
"gitee.com/jntse/gotoolkit/eventqueue"
pb "github.com/gogo/protobuf/proto"
"fmt"
... |
package mempool
import (
"container/list"
"encoding/binary"
"fmt"
"io"
"math"
"sync"
"unsafe"
"github.com/astaxie/beego/logs"
"github.com/btcboost/copernicus/core"
"github.com/btcboost/copernicus/utils"
"github.com/btcboost/copernicus/utxo"
"github.com/google/btree"
)
type PoolRemovalReason int
// Reaso... |
// Copyright (c) 2019, The Emergent Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// network from job 2150
package main
import (
"fmt"
//"github.com/emer/leabra/leabra"
"log"
"github.com/emer/emergent/emer"
"github.com/emer/... |
// Copyright (c) 2020 The qitmeer developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package testutils
import (
"bytes"
"encoding/binary"
"encoding/hex"
"fmt"
"github.com/Qitmeer/qitmeer/common/hash"
"github.com/Qitmeer/qitmeer/core/address"
j "github.... |
package cmd
import (
"bufio"
"bytes"
"context"
"io"
"log"
"net/http"
"os"
"os/exec"
"os/signal"
"regexp"
"strconv"
"strings"
"syscall"
"time"
"github.com/99designs/gqlgen/api"
gqlgenCfg "github.com/99designs/gqlgen/codegen/config"
"github.com/appist/appy/pack"
"github.com/appist/appy/support"
"gith... |
// 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 ag... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: proto/netpolicy.proto
package proto
import (
context "context"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
... |
package xstring
import (
"fmt"
"github.com/Aoi-hosizora/ahlib/xtesting"
"net/url"
"testing"
"time"
)
func TestCapitalize(t *testing.T) {
for _, tc := range []struct {
give string
want string
}{
{"", ""},
{" ", " "},
{"abc", "Abc"},
{"Abc", "Abc"},
{"abc def", "Abc def"},
{"测试", "测试"},
{"テス", ... |
// Copyright 2015-2017 Piprate Limited
//
// 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 2015 whizkid77, 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... |
/*
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 (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 agentd
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"sync"
"time"
"github.com/google/uuid"
"github.com/prometheus/client_golang/prometheus"
"github.com/sensu/sensu-go/agent"
corev2 "github.com/sensu/sensu-go/api/core/v2"
corev3 "github.com/sensu/sensu-go/api/core/v3"
"github.com/sensu/sensu... |
/*
Copyright 2018 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 protoc-gen-gogo. DO NOT EDIT.
// source: node.proto
package node
/*
Package node defines data model for Kubernetes Node.
*/
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Mar... |
// Copyright 2020 Anapaya Systems
//
// 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... |
package main
/*
* @Description: file content
* @Author: 陈洋
* @Date: 2018-11-29 10:42:18
*/
import (
"bytes"
"context"
"database/sql"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"os"
"os/signal"
"syscall"
"time"
"github.com/cihub/seelog"
"github.com/gin-gonic/gin"
"github.com... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: flyteidl/core/condition.proto
package core
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
// Thi... |
package v1alpha1
import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// GrafanaSpec defines the desired state of Grafana... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/spanner/v1/result_set.proto
package spanner
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
_struct "github.com/golang/protobuf/ptypes/struct"
_ "google.golang.org/genproto/googleapis/api/annotations"
math "math"
)
// Reference impor... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.16.0
// source: envoy/extensions/common/tap/v4alpha/common.proto
package envoy_extensions_common_tap_v4alpha
import (
_ "github.com/cncf/xds/go/udpa/annotations"
v4alpha "github.com/envoyproxy/go-control-pla... |
// Copyright (c) 2016 <NAME>. All rights reserved.
// Use of this source code is governed by the MIT license
// that can be found in the LICENSE file.
package data
import (
"fmt"
"testing"
"time"
"github.com/stretchr/testify/assert"
)
var testLoopPackets = map[string][]byte{
"1NoRain": {
0x4c, 0x4f, 0x4f, 0x... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/ads/googleads/v2/resources/ad_group_bid_modifier.proto
package resources
import (
fmt "fmt"
math "math"
proto "github.com/catper/protobuf/proto"
wrappers "github.com/catper/protobuf/ptypes/wrappers"
common "google.golang.org/genproto/googleapis/... |
package pkglint
import (
"netbsd.org/pkglint/textproc"
"sort"
"strings"
)
// VaralignBlock checks that all variable assignments from a paragraph
// use the same indentation depth for their values.
// It also checks that the indentation uses tabs instead of spaces.
//
// In general, all values should be aligned usi... |
// Copyright 2021 Amazon.com, Inc. or its affiliates. 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. A copy of the
// License is located at
//
// http://aws.amazon.com/apache2.0/
//
// or in the "license" fil... |
package main
import (
"bytes"
"errors"
"flag"
"fmt"
"io/ioutil"
"os"
"path"
"path/filepath"
"testing"
e "github.com/britannic/blacklist/internal/edgeos"
"github.com/britannic/mflag"
. "github.com/smartystreets/goconvey/convey"
)
func init() {
/*
The default failure mode is FailureHalts, which causes... |
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"strconv"
"strings"
"sync"
"time"
. "fogflow/common/communicator"
. "fogflow/common/datamodel"
. "fogflow/common/ngsi"
. "fogflow/common/config"
)
const MAX_HEARTBEAT_DURATION = 60 // in seconds
type Master struct {
cfg *Config
BrokerURL... |
package service
import (
"context"
"encoding/json"
"fmt"
"html/template"
"os"
"os/exec"
"path"
"regexp"
"strings"
"github.com/cockroachdb/errors"
"github.com/hashicorp/go-multierror"
batcheslib "github.com/sourcegraph/sourcegraph/lib/batches"
onlib "github.com/sourcegraph/sourcegraph/lib/batches/on"
"... |
// The MIT License (MIT)
//
// Copyright (c) 2016, 2017 <NAME>
//
// 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, co... |
package testcase
import (
"bufio"
"bytes"
"encoding/binary"
"encoding/hex"
"errors"
"fmt"
"io"
"io/ioutil"
"math/big"
"os"
"os/exec"
"reflect"
"sort"
"strconv"
"strings"
"github.com/ethereum/go-ethereum/common"
coretypes "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/c... |
package locale
import (
"strconv"
"strings"
)
func idFor(loc string) int64 {
switch loc {
case "af_ZA":
return 1078
case "am_ET":
return 1118
case "ar_AE":
return 14337
case "ar_BH":
return 15361
case "ar_DZ":
return 5121
case "ar_EG":
return 3073
case "ar_IQ":
return 2049
case "ar_JO":
ret... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc v3.17.3
// source: yandex/cloud/operation/operation.proto
package operation
import (
status "google.golang.org/genproto/googleapis/rpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
pro... |
package raftv2
import (
"bytes"
"encoding/binary"
"encoding/json"
"errors"
"fmt"
"runtime"
"strings"
"sync"
"time"
"github.com/meeypioneer/mey-library/log"
bc "github.com/meeypioneer/meycoin/chain"
"github.com/meeypioneer/meycoin/config"
"github.com/meeypioneer/meycoin/consensus"
"github.com/meeypioneer... |
package marathon
import (
"errors"
"fmt"
"math"
"net"
"net/http"
"net/url"
"regexp"
"strconv"
"strings"
"text/template"
"time"
"github.com/BurntSushi/ty/fun"
"github.com/Sirupsen/logrus"
"github.com/cenk/backoff"
"github.com/containous/flaeg"
"github.com/containous/traefik/job"
"github.com/containous... |
// Package report : ポーリング処理
package report
import (
"context"
"fmt"
"log"
"net"
"regexp"
"strings"
"sync"
"time"
"github.com/montanaflynn/stats"
"github.com/mrichman/godnsbl"
"github.com/openrdap/rdap"
"github.com/twsnmp/twsnmpfc/datastore"
)
var (
deviceReportCh = make(chan *deviceReportEnt, 100)
user... |
// Copyright 2016 The Gosl 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 la
import (
"testing"
"github.com/cpmech/gosl/chk"
"github.com/cpmech/gosl/io"
)
func TestEqs01(tst *testing.T) {
//verbose()
chk.PrintTitle(... |
package main
//client based application to interact with node
import (
"bufio"
"encoding/hex"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
"net"
"os"
"strconv"
"strings"
"time"
"github.com/polygonledger/node/block"
"github.com/polygonledger/node/crypto"
"github.com/polygonledger/node/ntcl"
"github.... |
package backend
import (
"fmt"
"os"
"tiny-rdb/util"
"unsafe"
)
// Difference between B-Tree and B+Tree: http://www.differencebetween.info/difference-between-b-tree-and-b-plus-tree
// B-tree nodes with children are called “internal” nodes. Internal nodes and leaf nodes are structured differently:
// For an order... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc v3.19.1
// source: app/namespace/pb/namespace.proto
package namespace
import (
department "github.com/infraboard/keyauth/app/department"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl... |
// Copyright 2019 PingCAP, 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 i... |
// Copyright 2009 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 tar implements access to tar archives.
//
// Tape archives (tar) are a file format for storing a sequence of files that
// can be read and written in... |
// 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... |
package consul
import (
"crypto/tls"
"errors"
"fmt"
"log"
"net"
"net/rpc"
"os"
"path/filepath"
"reflect"
"strconv"
"strings"
"sync"
"time"
"github.com/hashicorp/consul/acl"
"github.com/hashicorp/consul/consul/agent"
"github.com/hashicorp/consul/consul/state"
"github.com/hashicorp/consul/tlsutil"
"gi... |
// Copyright (c) The Thanos Authors.
// Licensed under the Apache License 2.0.
package block
import (
"context"
"encoding/json"
"io/ioutil"
"os"
"path"
"path/filepath"
"sort"
"sync"
"time"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/golang/groupcache/singleflight"
"github.c... |
// Copyright 2016 The G3N 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 gui
import (
"fmt"
"github.com/adamlenda/engine/core"
"github.com/adamlenda/engine/geometry"
"github.com/adamlenda/engine/gls"
"github.com/adamle... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: envoy/extensions/filters/network/tcp_proxy/v4alpha/tcp_proxy.proto
package envoy_extensions_filters_network_tcp_proxy_v4alpha
import (
fmt "fmt"
_ "github.com/cncf/udpa/go/udpa/annotations"
v4alpha1 "github.com/envoyproxy/go-control-plane/envoy/config/acc... |
package sgl
import (
"fmt"
"image"
"math"
"os"
"runtime"
"github.com/go-gl/gl/v3.3-core/gl"
"github.com/go-gl/glfw/v3.3/glfw"
"github.com/inkyblackness/imgui-go/v4"
)
// Init should be called once to initalize GLFW along with a
// deferred call to Destroy.
func Init() error {
runtime.LockOSThread()
err := ... |
// Copyright (C) 2020, Oracle and/or its affiliates.
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
package vmo
import (
"context"
"errors"
"fmt"
"reflect"
"time"
"github.com/prometheus/client_golang/prometheus"
vmcontrollerv1 "github.com/verrazzano/v... |
package gas
import (
"context"
"fmt"
"math/big"
"sort"
"sync"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/rpc"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
evmclient "github.com/smar... |
/*
* Cadence - The resource-oriented smart contract programming language
*
* Copyright 2019-2020 <NAME>, 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.... |
package main
import (
"fmt"
"math"
"math/rand"
"os"
"text/tabwriter"
"time"
"go-tsz/testdata"
"go-tsz/tsz"
)
func Round(f float64) float64 {
if f < 0 {
return math.Ceil(f - 0.5)
}
return math.Floor(f + .5)
}
func RoundNum(f float64, places int) float64 {
shift := math.Pow(10, float64(places))
return ... |
package generator
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License 2.0.
import (
"encoding/base64"
"fmt"
"strings"
mgmtcompute "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2020-06-01/compute"
mgmtkeyvault "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2019-09-0... |
package main
import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"log"
"math"
"math/rand"
"os"
"reflect"
"strings"
"sync"
"time"
"unsafe"
gg "github.com/faiface/pixel-examples/community/amidakuji/glossary"
"github.com/faiface/pixel-examples/community/amidakuji/glossary/jukebox"
glfw... |
// Copyright 2020 Google Inc. 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... |
package douyulive
import (
"context"
"encoding/json"
"net"
"strings"
"sync"
)
var chReconSignal chan *liveRoom // 重连直播间信号
// Live 直播间
type Live struct {
Debug bool // 是否显示日志
AnalysisRoutineNum int // 消息分析协程数量,默... |
// Copyright 2022 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... |
/*
MIT License
Copyright (c) 2019 문동선 (NaniteFactory)
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, me... |
package yudien
import (
"container/list"
"database/sql"
"fmt"
. "github.com/ghowland/yudien/yudiencore"
. "github.com/ghowland/yudien/yudienutil"
"strings"
)
const (
part_unknown = iota
part_function = iota
part_item = iota
part_string = iota
part_compound = iota
part_list = iota
part_map ... |
// Copyright 2021 The LUCI 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... |
//
// Copyright 2019, <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 w... |
package nice
import (
"go_srs/srs/utils"
"encoding/binary"
"crypto/rand"
"errors"
)
/**
* StunClass:
* @STUN_REQUEST: A STUN Request message
* @STUN_INDICATION: A STUN indication message
* @STUN_RESPONSE: A STUN Response message
* @STUN_ERROR: A STUN Error message
*
* This enum is used to represent the cla... |
// Copyright 2020 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
package backend
import (
"bufio"
"bytes"
"debug/dwarf"
"debug/elf"
"encoding/binary"
"fmt"
"io"
"io/ioutil"
"path/filepath"
"runtime"
"sort"
"... |
package rediscluster
import (
"context"
"fmt"
"sync"
"sync/atomic"
"time"
"github.com/joomcode/errorx"
"github.com/xsyr/redispipe/redis"
"github.com/xsyr/redispipe/rediscluster/redisclusterutil"
"github.com/xsyr/redispipe/redisconn"
)
// ConnHostPolicyEnum is config enumeration of policies of connections-p... |
package protoparse
import (
"bytes"
"reflect"
"sort"
"strings"
"github.com/golang/protobuf/proto"
dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
"github.com/jhump/protoreflect/desc/internal"
)
func (r *parseResult) generateSourceCodeInfo() *dpb.SourceCodeInfo {
if r.nodes == nil {
// skip files... |
package raft
import (
"encoding/json"
"fmt"
"math"
"math/rand"
"sync"
"sync/atomic"
"time"
"raft/labrpc"
)
type Raft struct {
sync.RWMutex
me int
peers []*labrpc.ClientEnd
rootInterruptionChs []chan struct{}
exitRoleFuncs map[int]exitRoleFunc
enterRoleFuncs map[int]enterRoleFunc
majority i... |
/* Hobbyist's Assembler for 6502 microprocessors
A simple assembler for little projects and tinkering
See README.md for more information
-> main.go
=============================================================================
MIT License
Copyright (c) 2020 Dr. <NAME>
Permission is hereby granted, free of charge, t... |
package cmd
// The main AF4 binary. See README.md for usage.
import (
"bufio"
"context"
"flag"
"fmt"
"io"
"math"
"os"
"runtime"
"sort"
"strings"
"sync"
"time"
"github.com/grailbio/base/compress"
"github.com/grailbio/base/errors"
"github.com/grailbio/base/file"
"github.com/grailbio/base/grail"
"gith... |
package s3manager
import (
"bytes"
"context"
"fmt"
"io"
"sort"
"sync"
"github.com/aws/aws-sdk-go-v2/aws"
request "github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/awserr"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/service/s3"
"github.com/aws/aws-sdk-go... |
package controller
import (
"context"
"crypto/rsa"
"fmt"
"net/http"
"net/url"
"strings"
"time"
crdv1alpha1 "github.com/kubernetes-csi/external-snapshotter/pkg/apis/volumesnapshot/v1alpha1"
"github.com/pkg/errors"
v1 "k8s.io/api/core/v1"
extclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clie... |
package main
import (
"os"
"fmt"
"flag"
"bytes"
"image"
"regexp"
"strings"
"strconv"
"net/http"
"net/smtp"
"math/rand"
"io/ioutil"
"encoding/json"
"mime/multipart"
"github.com/boltdb/bolt"
"github.com/bnaucler/randomslide/lib/rscore"
"github.com/bna... |
// Copyright (c) 2012 Couchbase, 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 w... |
// repo-init is an interactive command-line utility to bootstrap
// configuration options for repositories, including config for
// prow as well as ci-operator. It is not intended to replace
// manual interaction with the configuration, especially for all
// complicated scenarios, but to provide a good set of defaults.... |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package main
import (
"context"
"encoding/json"
"fmt"
"io"
"math"
"net/http"
"net/url"
"regexp"
"strings"
"sync"
"time"
"github.com/Azure/acr-cli/acr"
"github.com/Azure/acr-cli/cmd/api"
"github.com/Azure/acr... |
/*
Copyright 2022 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 2020 Antrea 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 ... |
//
//
// File generated from our OpenAPI spec
//
//
package stripe
import (
"encoding/json"
"github.com/stripe/stripe-go/v72/form"
)
// The status of the code verification, either `pending` (awaiting verification, `attempts_remaining` should be greater than 0), `succeeded` (successful verification) or `failed` (fa... |
package ctk
// TODO: SetWindow calls should only happen in expose/realize events
// TODO: implement expose/realize concept
import (
"fmt"
"github.com/go-curses/cdk"
cenums "github.com/go-curses/cdk/lib/enums"
"github.com/go-curses/cdk/lib/paint"
"github.com/go-curses/cdk/lib/ptypes"
"github.com/go-curses/cdk/m... |
/*
* Copyright 2017 The Kythe Authors. 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 ap... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.