text stringlengths 3.08k 10.4k |
|---|
package generate
import (
"fmt"
"nli-go/lib/central"
"nli-go/lib/common"
"nli-go/lib/importer"
"nli-go/lib/mentalese"
)
type Generator struct {
matcher *central.RelationMatcher
parser *importer.InternalGrammarParser
log *common.SystemLog
}
func NewGenerator(log *common.SystemLog, matcher *central.Relatio... |
// 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 DescribeVolumesModificationsInput struct {
_ struct{} `type:"structure"`
// Checks whether you have the required permiss... |
// Copyright 2015 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... |
package expr
import (
"errors"
"strconv"
"strings"
)
var (
ErrFailedToParseInteger = errors.New("failed to parse integer")
ErrFailedToParseFloat = errors.New("failed to parse float")
ErrNotAnInteger = errors.New("not an integer")
ErrNotAFloat = errors.New("not a float")
ErrUnsupported... |
package api
import (
"strings"
log "github.com/Sirupsen/logrus"
"github.com/godbus/dbus"
"github.com/muka/go-bluetooth/bluez"
"github.com/muka/go-bluetooth/bluez/profile"
"github.com/muka/go-bluetooth/emitter"
"github.com/muka/go-bluetooth/util"
)
var manager *Manager
//GetManager return the object manager r... |
package router
import (
"fmt"
"log"
"net/http"
"runtime"
"github.com/aodin/volta/auth"
)
// The router is built on: https://github.com/julienschmidt/httprouter
// Copyright 2013 <NAME>. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file.
t... |
// Code generated by go-swagger; DO NOT EDIT.
// Copyright 2018 The go-netbox 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
... |
// Package commands is where all cli logic is, including starting hoarder as a server.
package commands
import (
"crypto/tls"
"fmt"
"io"
"net/http"
"os"
"path/filepath"
"time"
"github.com/jcelliott/lumber"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/nanopack/hoarder/api"
"github.com/nan... |
package golem_test
import (
"flag"
"fmt"
"log"
"os"
"strings"
"testing"
"github.com/axamon/golem"
)
var en *golem.Lemmatizer = new(golem.Lemmatizer)
var fr *golem.Lemmatizer = new(golem.Lemmatizer)
var ge *golem.Lemmatizer = new(golem.Lemmatizer)
var it *golem.Lemmatizer = new(golem.Lemmatizer)
var sp *golem.... |
package chunks
import (
glo "github.com/szuwgh/temsearch/pkg/engine/tem/global"
)
const (
NOMOREDOCS = 0x7fffffff
NEXTREDOCES = -2
)
type labelPosting struct {
logReader SnapBlock
lastLogID uint64
lastTimeStamp int64
maxTimeStamp int64
minTimeStamp int64
segmentNum uint64
}
func (l *labelPost... |
package script
import (
"github.com/nlnwa/veidemann-api/go/commons/v1"
"github.com/nlnwa/veidemann-api/go/frontier/v1"
"github.com/nlnwa/whatwg-url/url"
"go.starlark.net/starlark"
"go.starlark.net/syntax"
"sort"
)
type UrlValue struct {
qUri *frontier.QueuedUri
parsedUri *url.Url
}
func Url(u *frontier.... |
package github
import (
"context"
"fmt"
"log"
"reflect"
"knative.dev/pkg/logging"
"github.com/google/go-github/v33/github"
"github.com/nubank/workflows/pkg/apis/workflows/v1alpha1"
"github.com/nubank/workflows/pkg/secrets"
)
// DefaultWebhookReconciler keeps Github Webhooks in sync to the desired state decl... |
package main
import (
"bytes"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-lambda-go/lambda"
"github.com/mitchellh/mapstructure"
"github.com/pkg/errors"
"github.com/spf13/pflag"
"github.com/spf13/viper"
)
type (
TodoistEvent struct ... |
package govulndb
import (
"encoding/json"
"fmt"
"io"
"log"
"path/filepath"
"strings"
bolt "go.etcd.io/bbolt"
"golang.org/x/vuln/osv"
"golang.org/x/xerrors"
"github.com/aquasecurity/trivy-db/pkg/db"
"github.com/aquasecurity/trivy-db/pkg/types"
"github.com/aquasecurity/trivy-db/pkg/utils"
"github.com/aqua... |
// Copyright (c) 2020- <NAME>, <EMAIL>
// Copyright (c) 2012-2015 <NAME>, https://menteslibres.net/xiam
//
// 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, includin... |
/*
Copyright 2021 ABSA Group 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 agreed to in writing, softw... |
package simulation
import (
"github.com/mknyszek/pacer-model/controller"
"github.com/mknyszek/pacer-model/scenario"
)
type go117 struct {
scenario.Globals
ctrl controller.Controller
// State
gc int
liveBytesLast uint64
liveScannableLast uint64
allocBlackLast uin... |
package config
import (
"encoding/json"
"errors"
"io/ioutil"
"log"
"regexp"
"strconv"
)
const (
CACHE_SIZE = int64(512)
FORMAT = "jpeg"
METHOD = 3
QUALITY = 80
ALPHA = 0.5
LISTEN_ON = "127.0.0.1:15900"
CACHE_SELF = "http://127.0.0.1:9100"
)
var defaultCfg string = `
{
"listen" : "12... |
/*******************************************************************************
*
* Copyright 2019 SAP SE
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You should have received a copy of the License along with this
* program. If... |
// Copyright 2019 ETH Zurich
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in wri... |
// Copyright (c) 2021 Uber Technologies, Inc.
//
// 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... |
package logger
import (
"fmt"
"log"
"os"
"sync"
"time"
"github.com/Shopify/sarama"
"github.com/pkg/errors"
"github.com/sunreaver/tomlanalysis/bytesize"
"go.uber.org/zap"
)
// Logger Logger.
type Logger interface {
Debugw(msg string, kv ...interface{})
Infow(msg string, kv ...interface{})
Warnw(msg string... |
package common
import (
"crypto/sha512"
"errors"
"fmt"
"reflect"
"strings"
multiclusterv1alpha1 "github.com/red-hat-storage/odf-multicluster-orchestrator/api/v1alpha1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pk... |
package netsuite
import (
"encoding/xml"
"github.com/cydev/zero"
"github.com/omniboost/go-netsuite-soap/omitempty"
)
type RequestEnvelope struct {
XMLName xml.Name
Header Header `xml:"env:Header"`
Body Body `xml:"env:Body"`
}
func NewRequestEnvelope() RequestEnvelope {
return RequestEnvelope{
Header: ... |
// Copyright (c) 2017 Uber Technologies, Inc.
//
// 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... |
package web
import (
"errors"
"fmt"
"io"
"net/url"
"reflect"
"strings"
)
const (
_maxFormSize int = 10 << 20 // 10 MB is a lot of text.
_formBufSize int = 512
_formKeyBufSize int = 32
_formValueBufSize int = 64
)
// formReader decode data from request body
// ContentType: application/x-www-form... |
package crossword
import (
"fmt"
"time"
)
// Puzzle represents a crossword puzzle. The puzzle is comprised of a
// grid which has dimensions (rows x cols) and demonstrates which cells of the
// crossword are available for placing letters into and which are not.
// Additionally the puzzle contains a set of clues or... |
/**
* Copyright (c) 2018, The Artemis Authors.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUT... |
package jsonpath
import (
"encoding/json"
"reflect"
"strings"
"testing"
)
var goessner = []byte(`{
"store": {
"book": [
{
"category": "reference",
"author": "<NAME>",
"title": "Sayings of the Century",
"price": 8.95
... |
/*
Package stz implements a client for the
[Structurizr service HTTP APIs](https://structurizr.com/).
*/
package stz
import (
"bytes"
"crypto/hmac"
"crypto/md5"
"crypto/sha256"
"encoding/base64"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"os/user"
"strconv"
"time"
g... |
// Code generated by smithy-go-codegen DO NOT EDIT.
package types
type BackupJobState string
// Enum values for BackupJobState
const (
BackupJobStateCreated BackupJobState = "CREATED"
BackupJobStatePending BackupJobState = "PENDING"
BackupJobStateRunning BackupJobState = "RUNNING"
BackupJobStateAborting B... |
package myactivity
import (
"context"
"encoding/json"
"fmt"
"log"
"os/exec"
"syscall"
"time"
"github.com/cenkalti/backoff"
multierror "github.com/hashicorp/go-multierror"
"github.com/mafredri/cdp"
"github.com/mafredri/cdp/devtool"
"github.com/mafredri/cdp/protocol/dom"
"github.com/mafredri/cdp/protocol/n... |
package bigly_test
import (
"testing"
"github.com/biogo/hts/sam"
"github.com/brentp/bigly"
. "gopkg.in/check.v1"
)
var records = []*sam.Record{
{Name: "r001/1", Pos: 6, Cigar: []sam.CigarOp{
sam.NewCigarOp(sam.CigarMatch, 8),
sam.NewCigarOp(sam.CigarInsertion, 2),
sam.NewCigarOp(sam.CigarMatch, 4),
sam... |
package function
import (
"errors"
"fmt"
"github.com/brimdata/zed"
"github.com/brimdata/zed/anymath"
"github.com/brimdata/zed/expr/result"
"github.com/brimdata/zed/zson"
)
var (
ErrBadArgument = errors.New("bad argument")
ErrNoSuchFunction = errors.New("no such function")
ErrTooFewArgs = errors.New("... |
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package main
import (
"context"
"go.chromium.org/luci/common/errors"
"go.chromium.org/luci/common/logging"
"go.chromium.org/luci/common/sync/paralle... |
// Copyright 2020 ZetaMesh 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> <<EMAIL>>
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, softw... |
package hybster
import (
"github.com/gogo/protobuf/proto"
"github.com/ibalajiarun/go-consensus/enclaves/trinx"
"github.com/ibalajiarun/go-consensus/peer"
"github.com/ibalajiarun/go-consensus/peer/peerpb"
"github.com/ibalajiarun/go-consensus/pkg/command/commandpb"
"github.com/ibalajiarun/go-consensus/pkg/logger"
... |
package main
import (
"context"
"fmt"
"os"
"path/filepath"
"strconv"
"strings"
"github.com/spf13/afero"
"github.com/spf13/cobra"
"github.com/ovh/cds/engine/worker/internal"
"github.com/ovh/cds/sdk"
"github.com/ovh/cds/sdk/log"
)
const (
envFlagPrefix = "cds_"
flagFromGithub = "from-... |
package porcupine
import (
"fmt"
"io/ioutil"
"reflect"
"testing"
)
func visualizeTempFile(t *testing.T, model Model, info LinearizationInfo) {
file, err := ioutil.TempFile("", "*.html")
if err != nil {
t.Fatalf("failed to create temp file")
}
err = Visualize(model, info, file)
if err != nil {
t.Fatalf("v... |
package gocron
import (
"sort"
"time"
)
// Scheduler struct, the only data member is the list of jobs.
// - implements the sort.Interface{} for sorting jobs, by the time nextRun
type Scheduler struct {
jobs [MAXJOBNUM]*Job // Array store jobs
size int // Size of jobs which jobs holding.
loc *time.Lo... |
package pdf
import (
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
"path/filepath"
"strings"
"time"
"github.com/gorilla/websocket"
)
//
// Save as PDF
//
type printToPDFParams struct {
// Paper orientation
// If not present, defaults to false
Landscape bool `json:"landscape,om... |
/* Copyright 2015 LinkedIn Corp. Licensed under the Apache License, Version
* 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, s... |
// Copyright (C) 2015 <NAME> and Contributors (see the CONTRIBUTORS file).
package client
import (
"crypto/tls"
"encoding/json"
"fmt"
"math/rand"
"net/http"
"net/url"
"sort"
"time"
"github.com/syncthing/syncthing/lib/osutil"
"github.com/syncthing/syncthing/lib/relay/protocol"
"github.com/syncthing/syncthi... |
package eth
import (
"context"
"errors"
"fmt"
"math/big"
"strings"
"sync"
ethereum "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/... |
package values
import (
"fmt"
"reflect"
)
// A Lens can transform from values of type T to values
// of type T1. It can be reversed to transform in the
// other direction, and be combined with other Lenses.
//
type Lens struct {
f, finv func(reflect.Value) (reflect.Value, error)
t, t1 reflect.Type
}
func okTra... |
package pool
import (
"context"
"github.com/vipnode/vipnode/v2/ethnode"
"github.com/vipnode/vipnode/v2/pool/store"
)
// ConnectRequest is a base request done when a vipnode agent connects to a pool.
// It is common between hosts and clients
type ConnectRequest struct {
// VipnodeVersion is the version string of ... |
package websocket
import (
"crypto/tls"
"crypto/x509"
"errors"
"fmt"
"io"
"io/ioutil"
"log"
"net"
"net/http"
"time"
"github.com/Asutorufa/yuhaiin/pkg/net/proxy/proxy"
"github.com/gorilla/websocket"
)
type Client struct {
uri string
header http.Header
dialer websocket.Dialer
p proxy.Proxy
}
f... |
package main
import (
"io/ioutil"
"net/http"
"path/filepath"
"sync"
"github.com/getlantern/appdir"
"github.com/getlantern/launcher"
"github.com/getlantern/yaml"
"github.com/getlantern/flashlight/ui"
)
const (
messageType = `Settings`
)
var (
service *ui.Service
settings *Settings
httpClient *http.... |
/*
Copyright 2020 The Kubernetes Authors.
SPDX-License-Identifier: Apache-2.0
*/
package pmemtls_test
import (
"crypto/rand"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"math"
"math/big"
"testing"
"time"
pmemtls "github.com/intel/pmem-csi/pkg/pmem-csi-operator/pmem-tls"
"github.com/stretchr... |
/*
Sniperkit-Bot
- Status: analyzed
*/
/*
Copyright 2013 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable ... |
package certmgr
import (
"archive/tar"
"crypto/x509"
"encoding/pem"
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
"path"
"path/filepath"
"strings"
"github.com/grantae/certinfo"
"github.com/mozilla-services/pkcs7"
log "github.com/sirupsen/logrus"
)
func downloadDeviceCertificate(serial, user, password string) ... |
package web
import (
"encoding/json"
"fmt"
"io"
"net"
"net/http"
"runtime/debug"
"strconv"
"github.com/julienschmidt/httprouter"
"github.com/oliverkofoed/gokit/logkit"
)
type Context struct {
logkit.Context
Site *Site
Route *Route
params httprouter.Params
data map[string]interface{... |
package cmd
import (
"context"
"crypto/tls"
"errors"
"fmt"
sdkclient "github.com/cosmos/cosmos-sdk/client"
dockerterm "github.com/moby/term"
virtengineclient "github.com/virtengine/virtengine/client"
gwrest "github.com/virtengine/virtengine/provider/gateway/rest"
cutils "github.com/virtengine/virtengine/x/cer... |
package fxtservice_rpc
import (
context "context"
"github.com/kevin-zx/fxtservice/pkg/storage/mysql"
)
func NewFxtRPCService(storage mysql.FxtStorage) FxtServiceServer {
return &fxtService{s: storage}
}
type fxtService struct {
s mysql.FxtStorage
}
func (f *fxtService) GetGuanbaoProject(ctx context.Context, req... |
package rtsp
import (
"crypto/md5"
"crypto/rand"
"encoding/base64"
"encoding/hex"
"errors"
"fmt"
"strings"
)
var (
// ErrAuthMalformedChallenge indicates incorrectly formatted WWW-Authenticate header.
ErrAuthMalformedChallenge = errors.New("Malformed authentication challenge header")
// ErrAuthNotImpemented... |
// 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... |
package udp_server
import (
"net"
"sync"
"free5gc/src/n3iwf/logger"
n3iwf_context "free5gc/src/n3iwf/context"
"free5gc/src/ue/n3iwf_handler/n3iwf_message"
"github.com/sirupsen/logrus"
)
// IKE daemon listen on UDP 500 and 4500
const (
maxQueueSize int = 100000
defaultIKEPort500 int = 500
defaultIKEP... |
package engine
import (
"fmt"
"github.com/patrickmn/go-cache"
)
var (
//ErrGameNotFound is returned when game requested is not in db
ErrGameNotFound = fmt.Errorf("Game with that ID does not exist")
//ErrNoMorePlayers is returned when trying to add players after reaching maxListenerCount
ErrNoMorePlayers = fmt.... |
package chronolib
import (
"github.com/SaidinWoT/timespan"
"github.com/jinzhu/now"
jww "github.com/spf13/jwalterweatherman"
"time"
)
// ExtendTimeFormats adds support for various different time formats
func ExtendTimeFormats() {
now.TimeFormats = append(now.TimeFormats, "02/01/2006 15:04") // dd/mm/yyyy HH:MM
}
... |
// Copyright © 2021 sealos.
//
// 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 tls
import (
"bytes"
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"fmt"
"math/big"
"net"
"os"
"path/filepath"
"strconv"
"strings"
"time"
)
const (
CERT = "CERTIFICATE"
PK = "RSA PRIVATE KEY"
)
func NewCA(
basePath string,
certFile string,
keyFile string,
su... |
package nats
import (
"context"
"io"
"sync"
hash "github.com/aperturerobotics/bifrost/hash"
"github.com/aperturerobotics/bifrost/peer"
"github.com/aperturerobotics/bifrost/pubsub"
"github.com/aperturerobotics/bifrost/pubsub/util/pubmessage"
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/nats-io/nats.g... |
package auth
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"sync"
"time"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
)
// GoogleAuth is the Google authentication setup
type GoogleAuth struct {
config *oauth2.Config
errorURL string
mu sync.Mutex
states m... |
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package chain
import (
"encoding/json"
"fmt"
"time"
"github.com/ava-labs/avalanchego/database"
"github.com/ava-labs/avalanchego/database/versiondb"
"github.com/ava-labs/avalanchego/utils/units"
"github... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: proto/demo/demo.proto
package laracom_demo_service
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... |
package rp
import (
"fmt"
"math/rand"
"strings"
"time"
)
// Quality is the quality of an item, folowing the World of Warcrarft system.
type Quality int
// Possible quality values.
const (
Unknown Quality = iota
Poor
Common
Uncommon
Rare
Epic
Legendary
)
func (q Quality) String() string {
switch q {
de... |
package api
import (
"context"
"encoding/json"
"io"
"io/ioutil"
"net/http"
"strconv"
"github.com/ONSdigital/dp-authorisation/auth"
dphandlers "github.com/ONSdigital/dp-net/handlers"
"github.com/ONSdigital/dp-topic-api/apierrors"
"github.com/ONSdigital/dp-topic-api/config"
"github.com/ONSdigital/dp-topic-ap... |
// Copyright (C) 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... |
package tasks
import (
"context"
"expvar"
"fmt"
"log"
"math"
"math/rand"
"os"
"runtime/trace"
"time"
"pixur.org/pixur/be/schema/db"
"pixur.org/pixur/be/status"
)
var defaulttasklogger *log.Logger = log.New(os.Stderr, "", log.LstdFlags)
var (
totalTasksCounter = expvar.NewInt("PixurTasks")
successTask... |
package this
import (
"fmt"
"os"
"runtime/debug"
"strings"
"testing"
"time"
)
var (
afterFuncs = make(map[*testing.T]func())
beforeFuncs = make(map[*testing.T]func())
failPanicMessage = "Test Failure"
skipPanicMessage = "Skip this.Should Test"
debugColor = "\033[36m"
defaultColor = "\033[39m"
failC... |
package framework
import (
"context"
"fmt"
"io/ioutil"
"net/http"
"net/http/httptest"
"os"
"strings"
"time"
"github.com/appscode/go/crypto/rand"
"github.com/appscode/go/log"
"github.com/appscode/go/types"
. "github.com/onsi/gomega"
core "k8s.io/api/core/v1"
kerr "k8s.io/apimachinery/pkg/api/errors"
"k8... |
package main
import (
"context"
"math"
"math/rand"
"net/http"
"sort"
"sync"
"time"
"github.com/DeanThompson/ginpprof"
"github.com/gin-gonic/gin"
"github.com/golang/protobuf/proto"
"github.com/liumingmin/goutils/log"
"github.com/liumingmin/goutils/utils/safego"
"github.com/liumingmin/goutils/ws"
"github.... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: testprotos.proto
/*
Package persistence is a generated protocol buffer package.
It is generated from these files:
testprotos.proto
It has these top-level messages:
TestEvent
TestSnapshot
*/
package persistence
import proto "github.com/golang/protobuf/pr... |
package main
import (
"encoding/json"
"fmt"
"log"
"strconv"
"time"
"github.com/crisp-im/go-crisp-api/crisp"
"github.com/go-redis/redis"
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api"
"github.com/spf13/viper"
"github.com/tonyzzzzzz/Crisp_Telegram_bot/utils"
)
var bot *tgbotapi.BotAPI
var client ... |
package mechanics
import (
"fmt"
"image"
"strconv"
"github.com/SolarLune/resolv"
"github.com/hajimehoshi/ebiten/v2"
)
const (
CollisionTypeTraversable = iota - 1
CollisionTypeWin
CollisionTypeSolid
CollisionTypeSolidHalfTop
CollisionTypeSolidHalfBottom
CollisionTypeRampUp
CollisionTypeRampDown
Collision... |
package session
import (
"time"
pluginapi "github.com/mattermost/mattermost-plugin-api"
"github.com/mattermost/mattermost-server/v6/model"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-plugin-apps/apps"
"github.com/mattermost/mattermost-plugin-apps/server/incoming"
"github.com/mattermost/mattermos... |
package main
import (
"context"
"fmt"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/fatih/color"
"github.com/havoc-io/mutagen/cmd"
"github.com/havoc-io/mutagen/pkg/grpcutil"
sessionsvcpkg "github.com/havoc-io/mutagen/pkg/service/session"
sessionpkg "github.com/havoc-io/mutagen/pkg/session"
... |
package main
/*
Bulk Renamer for renaming multiple files/folder using terminal
*/
import (
"flag"
"fmt"
"io/ioutil"
"os"
"strconv"
"path/filepath"
)
const (
colorRed = "\033[31m";
colorReset = "\033[0m";
)
func checkError(err error) {
if err != nil {
panic(err)
}
}
func getFileExtension(filename st... |
package gitops
import (
"fmt"
"sync"
"time"
log "github.com/sirupsen/logrus"
api "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1"
meta "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1"
"github.com/weaveworks/ignite/pkg/client"
"github.com/weaveworks/ignite/pkg/metadata/vmmd"
"github.com/weaveworks... |
// Copyright 2017 tsuru 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 reverseproxy
import (
"crypto/tls"
"io"
"net"
"net/url"
"github.com/nu7hatch/gouuid"
"github.com/tsuru/planb/log"
)
// SNIReverseProxy is public... |
// 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 helm
import (
"fmt"
"os"
"strings"
"time"
"github.com/alauda/captain/pkg/cluster"
"github.com/alauda/captain/pkg/helmrequest"
"github.com/alauda/captain/pkg/util"
"github.com/alauda/helm-crds/pkg/apis/app/v1alpha1"
clientset "github.com/alauda/helm-crds/pkg/client/clientset/versioned"
"github.com/go... |
// Copyright 2019-2020 VMware, Inc.
// SPDX-License-Identifier: BSD-2-Clause
package bus
import (
"encoding/json"
"fmt"
"github.com/go-stomp/stomp/frame"
"github.com/vmware/transport-go/log"
"github.com/vmware/transport-go/model"
"github.com/vmware/transport-go/stompserver"
"strings"
"... |
/**
* Author: JeffreyBool
* Date: 2019/5/15
* Time: 02:30
* Software: GoLand
*/
package connection
import (
"net"
"github.com/JeffreyBool/gozinx/src/ziface"
"fmt"
"sync"
"github.com/JeffreyBool/gozinx/src/znet/datapack"
"io"
"github.com/pkg/errors"
"github.com/JeffreyBool/gozinx/src/znet/message"
"gi... |
package packet
import (
"bytes"
"encoding/binary"
"fmt"
"github.com/sandertv/gophertunnel/minecraft/protocol"
)
const (
BossEventShow = iota
// BossEventRegisterPlayer is sent by the client to the server to request being shown the boss bar.
BossEventRegisterPlayer
BossEventHide
// BossEventUnregisterPlayer i... |
// 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-2019 Datadog, Inc.
package main
import (
"context"
"flag"
"fmt"
"net/http"
"os"
"strings... |
package main
import (
"os"
"os/signal"
"syscall"
"unsafe"
"bytes"
"fmt"
"math/rand"
"time"
"flag"
"strings"
"github.com/mnito/charmine/keyio"
)
// Text styling
const REVERSE = "7"
const BOLD = "1"
func style(s string, style string) string {
return "\u001B[" + style + ... |
/*****************************************************************************
* (c) 2005-2015 Copyright, Real-Time Innovations. All rights reserved. *
* *
* No duplications, whole or partial, manual or electronic, may be made *
* wi... |
package deck
import (
"github.com/stretchr/testify/assert"
"testing"
)
func Test_constants(t *testing.T) {
assert.Equal(t, 11, Jack)
assert.Equal(t, 12, Queen)
assert.Equal(t, 13, King)
assert.Equal(t, 14, Ace)
assert.Equal(t, 1, LowAce)
assert.Equal(t, 14, HighAce)
}
func TestCard_String(t *testing.T) {
ca... |
package postgres
import (
"fmt"
_ "github.com/GoogleCloudPlatform/cloudsql-proxy/proxy/dialers/postgres"
"github.com/gomurphyx/sqlx"
_ "github.com/lib/pq" // required for SQL access
migrate "github.com/rubenv/sql-migrate"
)
// Config defines the options that are used when connecting to a PostgreSQL instance
typ... |
package typesutil
import (
"fmt"
"gitlab.com/NebulousLabs/Sia/types"
"gitlab.com/NebulousLabs/errors"
)
var (
// AnyoneCanSpendUnlockHash is the unlock hash of unlock conditions that are
// trivially spendable.
AnyoneCanSpendUnlockHash types.UnlockHash = types.UnlockConditions{}.UnlockHash()
)
var (
// ErrS... |
package main_test
import (
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"sigs.k8s.io/kustomize/v3/pkg/kusttest"
"sigs.k8s.io/kustomize/v3/pkg/loader"
"sigs.k8s.io/kustomize/v3/pkg/pgmconfig"
"sigs.k8s.io/kustomize/v3/pkg/plugins"
"strings"
"testing"
)
// Start "sigs.k8s.io/kustomize/v3/pkg/plugins/test" overr... |
// Code generated by "esc -o assets_gen.go -pkg automod -ignore .go assets/"; DO NOT EDIT.
package automod
import (
"bytes"
"compress/gzip"
"encoding/base64"
"io/ioutil"
"net/http"
"os"
"path"
"sync"
"time"
)
type _escLocalFS struct{}
var _escLocal _escLocalFS
type _escStaticFS struct{}
var _escStatic _e... |
// Copyright © 2019 NVIDIA 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 agre... |
// Copyright 2022 Franklin "Snaipe" Mathieu.
//
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
package json5
import (
"fmt"
"go/constant"
gotokens "go/token"
"io"
. "snai.pe/boa/syntax"
)
type parser struct {
lexer *Lexer
current *Node
}
func newParser(... |
/*
Copyright 2022 The Koordinator 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 (
"bufio"
"os"
"fmt"
)
func readInt(bytes []byte, from int, val *int) int {
i := from
sign := 1
if bytes[i] == '-' {
sign = -1
i++
}
tmp := 0
for i < len(bytes) && bytes[i] != ' ' {
tmp = tmp*10 + int(bytes[i]-'0')
i++
}
*val = tmp * sign
return i
}
func readNum(scanner *bufio... |
package cache
import (
"time"
)
// Cache implements Cacher.
type NoopCache[T any] struct{}
// Set adds an item to the cache, replacing any existing item. If the duration is 0
// (DefaultExpiration), the cache's default expiration time is used. If it is -1
// (NoExpiration), the item never expires.
func (c *NoopCach... |
package utils
import (
"fmt"
"math/big"
"strings"
"testing"
"github.com/daoleno/uniswap-sdk-core/entities"
"github.com/ethereum/go-ethereum/common"
"github.com/shopspring/decimal"
)
func token(sortOrder, decimals, chainID uint) *entities.Token {
if sortOrder > 9 || sortOrder%1 != 0 {
panic("invalid sort or... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.