text stringlengths 3.08k 10.4k |
|---|
/* Copyright 2016-2017 Vector Creations Ltd
*
* 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... |
// 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 runtime
import (
"runtime/internal/atomic"
"unsafe"
)
// 小对象的 Per-thread (per-M) 缓存
// 无需加锁,因为是 per-thread (per-M) 的
//
// mcache 从非 GC 内存上分配,因此任何堆指... |
package main
import (
"bufio"
"flag"
"log"
"os"
"regexp"
"strings"
) //import
type CssRule struct {
Rule string
Value string
} //struct
// Global variables
var (
I_FILENAME string
O_FILENAME string
) //var
func init() {
// Retrieve flags and set globals
flag.StringVar(&I_FILENAME, "i", "", "'i' paramet... |
package onet
import (
"fmt"
"net"
"strings"
"github.com/libs4go/errors"
)
// SubAddr .
type SubAddr interface {
Protocol() string
Value() string
Native() bool
}
// Protocol .
type Protocol struct {
Name string
// HasValue bool
CheckValue func(value string) error
// Indicate native protocol
Native bool... |
// Copyright 2014 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.
// TODO(andybons): add logging
// TODO(andybons): restrict memory use
package main
import (
"bytes"
"context"
"encoding/json"
"fmt"
"go/parser"
"go/toke... |
// Copyright © 2018 <NAME> <<EMAIL> at g<EMAIL>>
//
// 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 httpe provides a model of HTTP handler that returns errors.
//
// The standard Go library package net/http provides a Handler interface that
// requires the handler write errors to the provided ResponseWriter. This is
// different to the usual Go way of handling errors that has functions
// returning errors,... |
package main
// ----- ---- --- -- -
// Copyright 2019 Oneiro NA, Inc. All Rights Reserved.
//
// Licensed under the Apache License 2.0 (the "License"). You may not use
// this file except in compliance with the License. You can obtain a copy
// in the file LICENSE in the source distribution or at
// https://www.apac... |
package geek
import (
"errors"
"io"
"log"
"os"
"sync"
"syscall"
"time"
)
type ConnPool struct {
c chan int
mu sync.Mutex
Conns map[int]*QProcess
reservedConns map[int]*QProcess
Timeout time.Duration
ReviveInterval time.Duration
DeadConns map[int]bool
Allow... |
// Copyright 2020 Fugue, 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 ... |
package participation
import (
"encoding/json"
"fmt"
"github.com/pkg/errors"
"github.com/iotaledger/hive.go/serializer"
)
const (
QuestionTextMaxLength = 255
QuestionAdditionalInfoMaxLength = 500
QuestionMinAnswersCount = 2
QuestionMaxAnswersCount = 10
)
var (
answersArrayRules = &serializer.Ar... |
package service
import (
"context"
"strings"
"go.mongodb.org/mongo-driver/bson/primitive"
assetFind "server/db/pkg/handler/asset/find"
buildFindOne "server/db/pkg/handler/build/find_one"
cvatTaskFind "server/db/pkg/handler/cvat_task/find"
cvatTaskInsertOne "server/db/pkg/handler/cvat_task/insert_one"
problem... |
// +build integration
package integration
import (
"flag"
"os"
"path/filepath"
"regexp"
"strings"
"testing"
"github.com/newrelic/infra-integrations-sdk/log"
"github.com/newrelic/nri-snmp/tests/integration/helpers"
"github.com/newrelic/nri-snmp/tests/integration/jsonschema"
"github.com/stretchr/testify/asse... |
package halib
// --- Struct
// MetricsData is actual metrics
type MetricsData struct {
HostName string `json:"hostname"`
Timestamp int64 `json:"timestamp"`
Metrics map[string]float64 `json:"metrics"`
}
// InventoryData is actual inventory
type InventoryData struct {
GroupName stri... |
// Package errorhandler provides a panic handler for HTTP requests which serves
// an error notice and optionally sends e. mail.
//
// Configurables:
//
// 'panicsto' E. mail address to send panics to.
// "" (default): don't send e. mails.
//
// 'webmasteraddress' Webmaster e. mail a... |
package channel
import (
"context"
"fmt"
"net"
"sync"
"github.com/google/uuid"
"github.com/kklab-com/goth-base62"
"github.com/kklab-com/goth-kkutil/concurrent"
"github.com/pkg/errors"
)
type Channel interface {
ID() string
Init() Channel
Pipeline() Pipeline
CloseFuture() Future
Bind(localAddr net.Addr) ... |
// Package parse provides functionality to parse images from collected files.
package parse
import (
"fmt"
"os"
"strings"
"sync"
"github.com/moby/buildkit/frontend/dockerfile/parser"
)
// DockerfileImageParser extracts image values from Dockerfiles.
type DockerfileImageParser struct{}
// DockerfileImage annota... |
package main
import (
"bytes"
"encoding/base64"
"fmt"
"image"
"image/color/palette"
"image/draw"
"image/gif"
"image/jpeg"
"math/big"
"os"
"sort"
"strings"
"time"
"github.com/adzialocha/gif-stream-server/s3"
"github.com/joho/godotenv"
)
const AnimationFrameCount = 10
const OutdatedSessionTreshold = -1... |
package mounts // import "github.com/docker/docker/volume/mounts"
import (
"fmt"
"strings"
"testing"
"github.com/docker/docker/api/types/mount"
"gotest.tools/v3/assert"
)
func TestLCOWParseMountRaw(t *testing.T) {
valid := []string{
`/foo`,
`/foo/`,
`/foo bar`,
`c:\:/foo`,
`c:\windows\:/foo`,
`c:\w... |
package timewheel
import (
"container/heap"
// "fmt"
"github.com/google/uuid"
"math"
"time"
)
type Handler func(interface{})
type TimeWheel struct {
// 时间间隔 s
interval time.Duration
// 计时器
ticker *time.Ticker
// 槽的数量
slotNum int
// 每个槽是一个大顶堆
slots []*TaskHeap
// 指针当前位置
curPos int
// taskMap,用于快速查找当前t... |
package main
import (
"context"
"fmt"
"log"
"os"
"sort"
"strings"
"github.com/eliquious/primes/dproc"
)
// NewPrimeOutput creates a new PrimeOutput.
func NewPrimeOutput(filename string) *PrimeOutput {
output, err := os.OpenFile(filename, os.O_CREATE|os.O_RDWR, 0644)
if err != nil {
log.Fatal(err)
}
outp... |
// Copyright (c) 2021 BitMaelum Authors
//
// 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, publ... |
package term
import (
"fmt"
"sync"
"time"
)
type TextColorState int
const (
StateColorWhite TextColorState = iota
StateColorYellow
StateColorGreen
StateColorRed
StateColorBlack
StateColorBlue
StateColorCyan
StateColorMagenta
)
type KeyValueElement struct {
Id string
Name string
Value string
... |
package pluginregistration
import (
"fmt"
"flag"
"io/ioutil"
"os"
"path/filepath"
"sort"
"strings"
"sync"
"testing"
"time"
"github.com/fsnotify/fsnotify"
"github.com/golang/glog"
"github.com/stretchr/testify/require"
)
var (
testPluginDir = ""
)
func init() {
var logLevel string
flag.Set("alsologto... |
// Code generated by go-swagger; DO NOT EDIT.
package compilation
// 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"
cr "github.... |
package main
// Layer is the storyboard layer type to use for osu!.
type Layer int
const (
Back Layer = iota
Front
)
// BMSFileData shows most things you'd want to know about a bms file.
type BMSFileData struct {
// Metadata contains the BMS file's metadata.
Metadata BMSMetadata `json:"metadata"`
// StartingBP... |
// This code is available on the terms of the project LICENSE.md file,
// also available online at https://blueoakcouncil.org/license/1.0.0.
package db
import (
"time"
"github.com/skynet0590/atomicSwapTool/dex/encode"
"github.com/skynet0590/atomicSwapTool/dex/msgjson"
)
// Candle is a report about the trading ac... |
/*
Copyright (C) 2022 Accurics, 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 main
import (
"errors"
"flag"
"fmt"
"github.com/mpetavy/less/content"
"github.com/nsf/termbox-go"
"io"
"os"
"strconv"
"strings"
)
var (
ErrMissingContent = errors.New("Missing filename (\"less -?\") or piped input")
help = flag.Bool("?", false, "Show help")
filename = flag.String("f... |
package hydrate
import (
"bytes"
"encoding/base64"
"fmt"
"io"
"os"
"path/filepath"
"strings"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ssm"
"github.com/pkg/errors"
)
//go:generate syncmap -pkg hydrate -name stringMap map[string]string
type paramStore struct {
ssm *ssm.SSM
b... |
package authenticator
import (
"database/sql"
"errors"
"fmt"
"net/http"
"time"
"github.com/teleclimber/DropServer/cmd/ds-host/domain"
"github.com/teleclimber/DropServer/cmd/ds-host/record"
)
const cookieExpMinutes = 30
const appspaceExpMinutes = 14 * 24 * 60 // temporary: two week lifetime for appspace sessio... |
package main
import (
//"encoding/json"
"../../common"
"../../common/error"
"../../common/protocol"
"../../common/room"
"bytes"
"encoding/json"
"flag"
"fmt"
"io"
"io/ioutil"
"net"
"net/http"
"os"
"time"
"utils"
//"unsafe"
//"net/http"
)
// type client struct {
// Ip string... |
/*
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, ... |
// Package tspl implements a renderer for TSPL format used by TSC thermal label printer.
package tspl
import (
"fmt"
"strings"
"xelf.org/layla"
"xelf.org/layla/font"
"xelf.org/layla/mark"
"xelf.org/xelf/bfr"
)
// Render renders the node n as TSPL to b or returns an error.
func Render(b bfr.Writer, man *font.Ma... |
package site
import (
"encoding/json"
"fmt"
"os"
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestSite_cleanAntennatypes(t *testing.T) {
antennas := []*Antenna{{Type: "ASH701945E_M NONE", Radome: "NONE", RadomeSerialNum: "", DateInstalled: time.Date(2006, 07, 07, 0, 0, 0, 0, time.UTC),
DateR... |
package api
import (
"bytes"
"fmt"
"net/http"
"net/http/httptest"
"testing"
"bitbucket.org/enroute-mobi/ara/core"
"bitbucket.org/enroute-mobi/ara/model"
"bitbucket.org/enroute-mobi/ara/uuid"
)
func checkStopAreaResponseStatus(responseRecorder *httptest.ResponseRecorder, t *testing.T) {
if status := response... |
package relayer
import (
"bytes"
"context"
"encoding/binary"
"math/big"
"strings"
"github.com/mcdexio/mai3-broker/common/chain/ethereum/broker"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethere... |
package gin
import (
"fmt"
log "github.com/alecthomas/log4go"
"github.com/gin-gonic/gin"
pb "github.com/gitbubhwt/baseserver/protocol"
"github.com/gitbubhwt/baseserver/util"
"net/http"
"reflect"
"strings"
)
type CommonReqFunc func(ctx *gin.Context) (interface{}, error)
type BaseServer struct {
Server ... |
package bzip2
import (
"errors"
"math"
"github.com/larzconwell/bzip2/internal/bits"
"github.com/larzconwell/bzip2/internal/bwt"
"github.com/larzconwell/bzip2/internal/crc32"
"github.com/larzconwell/bzip2/internal/huffman"
"github.com/larzconwell/bzip2/internal/mtf"
"github.com/larzconwell/bzip2/internal/rle"
... |
// Copyright 2015 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 currency
import (
"fmt"
"io"
"sort"
"golang.org/x/text/internal"
"golang.org/x/text/internal/format"
"golang.org/x/text/language"
)
// Value is... |
// Copyright 2021 <NAME>. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
package server
import (
"context"
"fmt"
"net/http"
"strings"
"time"
"github.com/gin-gonic/gin"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"gola... |
// Package banking provides functionality for performing common banking operations
// like creating account, transferring money and checking current account/payments.
package banking
import (
"context"
"github.com/pkg/errors"
"github.com/shopspring/decimal"
"github.com/twonegatives/coinsph_challenge/pkg/entities"... |
package resources
import (
"context"
"keycloak-manager/access"
"keycloak-manager/modules"
"github.com/Nerzal/gocloak/v7"
"github.com/rs/zerolog/log"
)
type resourceService struct {
client gocloak.GoCloak
ctx context.Context
token string
realm string
}
func InitializeService(keycloak *access.KeycloakCo... |
package mapping
import (
"encoding/json"
"fmt"
"github.com/jsiebens/ionscale/internal/domain"
"github.com/jsiebens/ionscale/internal/util"
"inet.af/netaddr"
"strconv"
"tailscale.com/tailcfg"
"tailscale.com/types/dnstype"
"tailscale.com/types/key"
"tailscale.com/util/dnsname"
"time"
)
const NetworkMagicDNSS... |
package utils
import "fmt"
/**
* Copyright 2018-19 TIBCO Software 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.
* A copy of the License is included in the distribution package with this file.
* You... |
package command_factory
import (
"fmt"
"runtime"
"strings"
"github.com/cloudfoundry-incubator/ltc/app_examiner"
config_package "github.com/cloudfoundry-incubator/ltc/config"
"github.com/cloudfoundry-incubator/ltc/exit_handler"
"github.com/cloudfoundry-incubator/ltc/exit_handler/exit_codes"
"github.com/cloudfo... |
/*
http://www.apache.org/licenses/LICENSE-2.0.txt
Copyright 2017 SignifAI 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 applica... |
// Code generated by github.com/tizz98/results; DO NOT EDIT.
package results
import (
"context"
"fmt"
)
type Int8Result struct {
value *int8
err error
}
// SetNewInt8Result is a shortcut to creating a new Int8Result and then calling .Set(v, err) on it.
func SetNewInt8Result(v int8, err error) (result Int8Resul... |
// Copyright (c) 2019 IoTeX
// This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no
// warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent
// permitted by law, all liability for your use of the cod... |
// Copyright Project Contour 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 service
import (
"log"
"sort"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/gdamore/tcell/v2"
"github.com/rivo/tview"
)
const (
// DefaultProfile is the default AWS Profile
Defa... |
package mach
import (
"errors"
"fmt"
"testing"
"github.com/forsyth/jsonpath/paths"
)
type funcTest struct {
expr string // expression with a single call or array of calls
expect string // expected result
}
var funcTests = []funcTest{
{"abs(-1.5)", "1.5"},
{"abs(20)", "20"},
{"avg([1, 2, 3, 4, 5])", "3"},... |
package xmodule
import (
"fmt"
"github.com/Aoi-hosizora/ahlib/xcolor"
)
// LogLevel represents ModuleContainer's logger level.
type LogLevel uint8
const (
// LogName logs only when ModuleContainer.ProvideName invoked.
LogName LogLevel = 1 << iota
// LogType logs only when ModuleContainer.ProvideType invoked.
... |
// Package cmd utilizes the github.com/spf13/cobra module to parse the
// mafia command line arguments and display usage information.
//
// Copyright © 2020 <NAME> <<EMAIL>>
//
// Licensed under the ISC License (ISC)
package cmd
import (
"bytes"
"fmt"
"os"
"github.com/mikebway/mafia/creds"
"github.com/mikebway/m... |
package skyline
import (
"github.com/gonum/stat"
"math"
"sort"
)
func unDef(f float64) bool {
if math.IsNaN(f) {
return true
}
if math.IsInf(f, 1) {
return true
}
if math.IsInf(f, -1) {
return true
}
return false
}
// Median series.median
func Median(series []float64) float64 {
var median float64
s... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: ribproto/openconfig/openconfig.proto
package openconfig
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import openconfig_rib_bgp "github.com/aristanetworks/ygot/demo/protobuf_getting_started/ribproto/openconfig/openconfig... |
package oas
import (
"net/http"
"github.com/go-openapi/analysis"
"github.com/go-openapi/spec"
)
// Router routes requests based on OAS 2.0 spec operations.
type Router struct {
debugLog LogWriter
baseRouter BaseRouter
wrappers []Middleware
mws []Middleware
// serveSpec, if nonzero, makes router s... |
package odoo
import (
"fmt"
)
// PosOrder represents pos.order model.
type PosOrder struct {
LastUpdate *Time `xmlrpc:"__last_update,omptempty"`
AccountMove *Many2One `xmlrpc:"account_move,omptempty"`
AmountPaid *Float `xmlrpc:"amount_paid,omptempty"`
AmountReturn *Float `xmlrp... |
package ethereum
import (
"context"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"log"
"math/big"
"net/http"
"os"
"strconv"
"strings"
"valorize-app/creatortoken"
"valorize-app/models"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-e... |
package cmd
import (
"fmt"
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
"time"
"github.com/bep/debounce"
"github.com/fsnotify/fsnotify"
"github.com/spf13/cobra"
)
var (
watchDir string
entryPoint string
subDirsToSkip []string
displayRoutes bool
hostValue string
portValue int
ab... |
package mux
import (
"context"
"crypto/tls"
"fmt"
"net"
"net/http"
"os"
"os/signal"
"sync"
"syscall"
"github.com/depscloud/depscloud/internal/logger"
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
grpc_recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery"
grpc_prometheus "gith... |
/*
* Copyright (c) 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 i... |
/*
Copyright 2021.
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 un... |
/*
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 demand provides core functionality for the AIStore on-demand extended actions.
/*
* Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
*/
package xaction
import (
"time"
"github.com/NVIDIA/aistore/3rdparty/atomic"
"github.com/NVIDIA/aistore/3rdparty/glog"
"github.com/NVIDIA/aistore/clu... |
// 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... |
package main
import (
"bytes"
"fmt"
"io"
"log"
"os"
"path/filepath"
"sort"
"strings"
"github.com/spf13/cobra"
"github.com/argoproj/argo-rollouts/pkg/kubectl-argo-rollouts/cmd"
options "github.com/argoproj/argo-rollouts/pkg/kubectl-argo-rollouts/options/fake"
)
func main() {
tf, o := options.NewFakeArgoR... |
package score
import (
"io"
"os"
"testing"
"github.com/zegl/kube-score/config"
"github.com/zegl/kube-score/parser"
"github.com/zegl/kube-score/scorecard"
"github.com/stretchr/testify/assert"
)
func testFile(name string) *os.File {
fp, err := os.Open("testdata/" + name)
if err != nil {
panic(err)
}
retu... |
package rvparser
import (
"testing"
"github.com/PRETgroup/easy-rv/rvdef"
)
var efbArchitectureTests = []ParseTest{
{
Name: "missing brace after s1",
Input: `monitor testBlock;
interface of testBlock{
}
policy of testBlock {
states {
s1
}
}`,
Err: ErrUnexpectedValue,
},
{
... |
package example
// This is the
import (
"fmt"
"io"
"log"
"os"
"reflect"
// sm "github.com/ebittleman/go-servicemanager"
sm "gopkg.in/ebittleman/go-servicemanager.v0"
)
const LOG_SERVICE = "Log"
const CONFIG_SERVICE = "Config"
// Service interface intended to fine the sum of 2 integers
type Adder interface {... |
package sql
import (
"context"
"database/sql"
"fmt"
"sync"
"github.com/Jeffail/benthos/v3/internal/shutdown"
"github.com/Jeffail/benthos/v3/public/bloblang"
"github.com/Jeffail/benthos/v3/public/service"
"github.com/Masterminds/squirrel"
)
func sqlSelectProcessorConfig() *service.ConfigSpec {
return service... |
// Copyright 2016-2020, Pulumi Corporation.
//
// 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... |
// Copyright 2021 Zenauth Ltd.
// SPDX-License-Identifier: Apache-2.0
package blob
import (
"context"
"fmt"
"io"
"io/fs"
"net/http"
"os"
"path/filepath"
"testing"
"time"
minio "github.com/minio/minio-go/v7"
"github.com/minio/minio-go/v7/pkg/credentials"
"github.com/ory/dockertest/v3"
"github.com/stretch... |
// Copyright © 2019 Binance
//
// This file is part of Binance. The full Binance copyright notice, including
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.
package paillier_test
import (
"math/big"
"testing"
"time"
"... |
/*
* MinIO Client (C) 2014-2020 MinIO, 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 o... |
package main
import (
"bufio"
"bytes"
"fmt"
"os"
"sort"
)
func main() {
reader := bufio.NewReader(os.Stdin)
var buf bytes.Buffer
tc := readNum(reader)
for tc > 0 {
tc--
n, m := readTwoNums(reader)
E := make([]int64, m)
var pos int
s, _ := reader.ReadBytes('\n')
for i := 0; i < m; i++ {
pos = ... |
/*
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, ... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package chime
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/private/protocol"
)
// Please also see https://docs.aws.amazon.com/goto/WebAPI/chime-2018-05-01/L... |
package usecase
import (
"context"
"fmt"
"github.com/google/go-github/github"
"github.com/hayashiki/mentions/pkg/event"
ghSvc "github.com/hayashiki/mentions/pkg/github"
"github.com/hayashiki/mentions/pkg/model"
"github.com/hayashiki/mentions/pkg/slack"
log "github.com/sirupsen/logrus"
"strings"
)
func (w *we... |
// Copyright (c) 2014 The btcsuite developers
// Copyright (c) 2015-2018 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package blockchain
import (
"testing"
)
// TestErrorCodeStringer tests the stringized output for the ErrorCode type.
func ... |
package main
import (
"flag"
"encoding/json"
"fmt"
"go/ast"
"go/parser"
"go/token"
"io/ioutil"
"log"
"os"
"path/filepath"
"regexp"
"strings"
)
var ignoredFoldersRegex []*regexp.Regexp
func init() {
ignoredFolders := []string{"vendor", "testdata", ".now"}
// Build the regex that matches if a path conta... |
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package log // nolint:testpackage // references internal implementation details
import (
"sync"
"testing"
"github.com/stretchr/testify/require"
"github.com/trustbloc/edge-core/pkg/internal/logging/metadata"
"g... |
package model3d
import (
"math"
"github.com/heustis/tsp-solver-go/model"
)
// BuildPerimiter attempts to produce the smallest convex perimeter that can encompass all the vertices in the supplied array.
// The current 3D algorithm is not guaranteed to produce the smallest convex perimeter, unlike the 2D algorithm.
... |
/*
Copyright 2019 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
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... |
// Copyright 2013 The ql Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSES/QL-LICENSE file.
// Copyright 2015 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in complia... |
// Copyright 2018 The Nakama 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 handler
import (
"errors"
"net/http"
"strconv"
"strings"
"github.com/rs/zerolog"
"github.com/miry/samples/hellofresh/cmd/recipes/app"
"github.com/miry/samples/hellofresh/pkg/mod"
"github.com/miry/samples/hellofresh/pkg/service"
)
type RecipesHandler struct {
app *app.App
}
func NewRecipesHandler(a... |
package stages
import (
"context"
"encoding/base64"
"io/ioutil"
"time"
mortarpb "git.sr.ht/~gabe/mortar/proto"
"github.com/gtfierro/xboswave/grpcserver"
xbospb "github.com/gtfierro/xboswave/proto"
"github.com/immesys/wavemq/mqpb"
"github.com/pkg/errors"
"google.golang.org/grpc"
)
type WAVEMQFrontendStageCo... |
package skillserver
import (
"encoding/json"
"errors"
"time"
)
// Request Functions
func (this *EchoRequest) VerifyTimestamp() bool {
reqTimestamp, _ := time.Parse("2006-01-02T15:04:05Z", this.Request.Timestamp)
if time.Since(reqTimestamp) < time.Duration(150)*time.Second {
return true
}
return false
}
fun... |
package taigo
import (
"net/http"
"net/url"
"strconv"
"time"
)
// AgilePoints is a [string/int] key/value pair to represent agile points in a UserStory, Milestone, etc...
// JSON Representation example:
// {
// "points": {
// "1": 12,
// "2": 2,
// "3": 5,
// "4": 5
// }
// }
type AgilePoints map[string... |
// Copyright 2019 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 (C) nerdctl authors.
Copyright (C) containerd 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 requi... |
package template
import (
"fgame/fgame/core/template"
"fgame/fgame/core/template/validator"
"fgame/fgame/game/common/common"
"fmt"
)
//结义常量配置
type JieYiConstantTemplate struct {
*JieYiConstantTemplateVO
}
func (t *JieYiConstantTemplate) TemplateId() int {
return t.Id
}
func (t *JieYiConstantTemplate) Patch() ... |
/*
Copyright 2021 The Topolvm-Operator 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 applicable la... |
package headtracker
import (
"context"
"fmt"
"math/big"
"sync"
"sync/atomic"
"time"
eth "PhoenixOracle/core/service/ethereum"
"PhoenixOracle/db/models"
"PhoenixOracle/lib/logger"
"PhoenixOracle/util"
"github.com/ethereum/go-ethereum"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus... |
// Copyright 2012 Lightpoke. All rights reserved.
// This source code is subject to the terms and
// conditions defined in the "License.txt" file.
// Organics simple hello world server/client example.
package main
import (
"github.com/sinni800/organics"
// For sessions being stored in-memory:
"github.com/sinni800... |
// Copyright 2018 Istio 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 applica... |
package constants
import (
"os"
"strings"
"time"
appsv1 "k8s.io/api/apps/v1"
"k8s.io/apimachinery/pkg/api/resource"
)
var (
// DefaultImageName is used if a specific image name is not provided
DefaultImageName = GetDefaultInfinispanJavaImage()
// InitContainerImageName allows a custom initContainer image to... |
// Package network Copyright 2017 mitrakov. All right are reserved. Governed by the BSD license
package network
import "fmt"
import "log"
import "net"
import "sync"
import "time"
import "sync/atomic"
import . "mitrakov.ru/home/winesaps/sid" // nolint
import . "mitrakov.ru/home/winesaps/utils" // nolint
// IServer i... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package codecommit
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/codecommit-2015-04-13/GetDifferencesInput
type GetDifferencesI... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.