text stringlengths 3.08k 10.4k |
|---|
// Copyright 2018 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 agree... |
package config
import (
"fmt"
"net"
"strings"
watermillkafka "github.com/ThreeDotsLabs/watermill-kafka/v2/pkg/kafka"
"github.com/asyncapi/event-gateway/asyncapi"
v2 "github.com/asyncapi/event-gateway/asyncapi/v2"
"github.com/asyncapi/event-gateway/kafka"
"github.com/asyncapi/event-gateway/message"
"github.co... |
package zklogstar
import (
"crypto/rand"
"github.com/cronokirby/safenum"
"github.com/sa8/multi-party-sig/pkg/hash"
"github.com/sa8/multi-party-sig/pkg/math/arith"
"github.com/sa8/multi-party-sig/pkg/math/curve"
"github.com/sa8/multi-party-sig/pkg/math/sample"
"github.com/sa8/multi-party-sig/pkg/paillier"
"git... |
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not... |
// _ _
// __ _____ __ ___ ___ __ _| |_ ___
// \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
// \ V V / __/ (_| |\ V /| | (_| | || __/
// \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
//
// Copyright © 2016 - 2022 SeMI Technologies B.V. All rights reserved.
//
// CONTACT: <EMAIL>... |
/* For license and copyright information please see LEGAL file in repository */
package ipv6
import "../protocol"
// An Addr is an IP address version 6.
type Addr [Addrlen]byte
const (
// Addrlen address lengths 128 bit || 16 byte.
Addrlen = 16
hextable = "0123456789abcdef"
)
// Well-known IPv6 addresses
var (... |
package fadein
import (
"fmt"
"net"
"net/url"
"strings"
"time"
log "github.com/sirupsen/logrus"
"github.com/zalando/skipper/eskip"
"github.com/zalando/skipper/filters"
"github.com/zalando/skipper/routing"
)
const (
// Deprecated, use filters.FadeInName instead
FadeInName = filters.FadeInName
// Deprecate... |
package app
import (
"image"
"image/color"
"math/rand"
"time"
"github.com/fogleman/gg"
)
const (
triangle = iota + 3
square
pentagon
hexagon
_
octagon
random
)
type rgb struct {
r, g, b int
}
func getRGBSlice(srcImg image.Image, x, y, radius int) *[]rgb {
colorSlice := make([]rgb, 0, radius*4)
var ... |
// Includes zap logging logic:
// config, methods, initializers
// Here implemented io.Writer interface for clickhouse logging microservice
package logs
import (
grpcconnector "chat_room_go/microservices/clickhouse/pb"
config "chat_room_go/utils/conf"
"context"
"crypto/tls"
"crypto/x509"
"fmt"
"io/ioutil"
"log... |
package writer
import (
"fmt"
"github.com/jedib0t/go-pretty/v6/table"
"github.com/jedib0t/go-pretty/v6/text"
"github.com/jedib0t/go-sudoku/sudoku"
)
// RenderSamurai renders a Samurai Sudoku which is a combination of 5 Sudokus.
func RenderSamurai(grids []*sudoku.Grid) (string, error) {
if len(grids) != 5 {
re... |
// Copyright 2018 Google LLC 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 ... |
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use ... |
package levelfilter
import (
"encoding/json"
"fmt"
"io/ioutil"
"testing"
"github.com/Shopify/sarama"
"github.com/Shopify/sarama/mocks"
"github.com/mailgun/logrus-hooks/kafkahook"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
. "gopkg.in/check.v1"
"strings"
)
func Test(t *testing.T) { TestingT(t) }
... |
// Package files is generated by Handlergenerator tooling
// This Handler is used to print Payloads onto a file
package files
import (
"context"
"errors"
"fmt"
"io/ioutil"
"os"
"github.com/percybolmer/workflow/handlers"
"github.com/percybolmer/workflow/metric"
"github.com/percybolmer/workflow/payload"
"githu... |
package pki
/*
Copyright 2021 Crunchy Data Solutions, 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 agr... |
package tree_test
import (
"bytes"
"fmt"
"math"
"os"
"github.com/Konstantin8105/tree"
)
func ExampleTree() {
artist := tree.New("Pantera")
album := tree.New("Far Beyond Driven")
album.Add("5 minutes Alone")
album.Add("Some another")
artist.Add(album)
artist.Add("Power Metal")
fmt.Fprintf(os.Stdout, "%s\n... |
package sshclient
import (
"bytes"
"os"
"strings"
"testing"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestNewClientArgs(t *testing.T) {
logger := logrus.New()
tests := []struct {
name string
given ClientOpts
expected []string... |
/*
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, ... |
package main
import (
"crypto/tls"
"crypto/x509"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"net"
"net/http"
"os"
"strings"
"sync"
"time"
"github.com/getlantern/golog"
"github.com/getlantern/keyman"
)
var (
log = golog.LoggerFor("cfscanner")
help = flag.Bool("help", false, "Get usage help"... |
// This file contains ISO binary encoding scheme
package main
import (
"errors"
"fmt"
"strings"
"github.com/iomz/go-llrp/binutil"
)
// GetISO6346CD returns check digit for container serial number
func GetISO6346CD(cn string) (int, error) {
if len(cn) != 10 {
return 0, errors.New("Invalid ISO6346 code provided... |
package main
import (
"context"
"fmt"
deluge "github.com/gdm85/go-libdeluge"
"github.com/jessevdk/go-flags"
storm "github.com/relvacode/storm"
"go.uber.org/zap"
"net/http"
"os"
"os/signal"
"strings"
"syscall"
"time"
)
func signalContext(ctx context.Context) context.Context {
sig := make(chan os.Signal, 1... |
package config
import (
"errors"
"fmt"
"reflect"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/simpledb"
)
// CheckDB checks for an awsm database
func CheckDB() bool {
sess := session.Must(session.NewSession(&aws.Config{Region: aws.String("... |
package models
import (
. "eaciit/wfdemo-git/library/helper"
"time"
"github.com/eaciit/orm"
tk "github.com/eaciit/toolkit"
)
type ScadaThreeSecs struct {
orm.ModelBase `bson:"-",json:"-"`
ID string ` bson:"_id" , json:"_id" `
TimeStamp1 ... |
package main
import (
"bytes"
"errors"
"flag"
"fmt"
"io"
"net"
"os"
"runtime"
"strings"
"time"
"github.com/golang/glog"
"github.com/joho/godotenv"
"github.com/openshift/machine-config-operator/pkg/version"
"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/util/wait"
)
var (
runCmd = &cobra.Command{
... |
// Copyright 2020 The Moov Authors
// Use of this source code is governed by an Apache License
// license that can be found in the LICENSE file.
package wire
import (
"encoding/json"
"strings"
)
// SenderToReceiver is the remittance information
type SenderToReceiver struct {
// tag
tag string
// CoverPayment is... |
package object_test
import (
"crypto/rand"
"crypto/sha256"
"testing"
"github.com/nspcc-dev/neofs-api-go/pkg/object"
v2object "github.com/nspcc-dev/neofs-api-go/v2/object"
"github.com/stretchr/testify/require"
)
var (
eqV2Matches = map[object.SearchMatchType]v2object.MatchType{
object.MatchUnknown: v2... |
package config
import (
"io/ioutil"
"os"
"sync"
"testing"
"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v3"
)
func TestGetConfig(t *testing.T) {
once = sync.Once{}
configYAML := []byte(`
connector:
agentId: "3dcd9a52-949d-4531-a3b0-b14622f7dd39"
appName: "test-app"
appType: "test"
controllerAdd... |
package init
import (
"errors"
"fmt"
"io"
"os"
"os/user"
"path"
"path/filepath"
"strings"
"text/template"
"github.com/wxio/wxcli"
)
type initWXCli struct {
Directory string `wxcli:"mode=arg,help=output directory"`
Force bool `wxcli:"help=Do not check if output dir is empty"`
SrcControlHo... |
package main
import (
"image"
"9fans.net/go/draw"
"9fans.net/go/draw/frame"
)
var scrtmp *draw.Image
var scrback *draw.Image
func scrtemps() {
if scrtmp != nil {
return
}
var h int
if !screensize(nil, &h) {
h = 2048
}
scrtmp, _ = display.AllocImage(image.Rect(0, 0, 32, h), screen.Pix, false, 0)
scrbac... |
package wifi
import (
"encoding/json"
"fmt"
"github/DiscreteTom/ble-raspi-manager/internal/shell"
"github/DiscreteTom/ble-raspi-manager/internal/transport"
"strings"
"github.com/google/uuid"
"tinygo.org/x/bluetooth"
)
type wifiInfo struct {
SSID string // wifi name
PSK string // wifi password
}
type reque... |
package main
import (
"bytes"
"context"
"encoding/base64"
"fmt"
"image"
_ "image/gif"
"image/jpeg"
_ "image/png"
"io"
"io/ioutil"
"log"
"net/url"
"os"
"path"
"strconv"
"strings"
"time"
_ "golang.org/x/image/bmp"
_ "golang.org/x/image/tiff"
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aw... |
package aws
import (
"context"
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/ecs"
"github.com/aws/aws-sdk-go/service/ecs/ecsiface"
"github.com/themotion/ladder/autoscaler/scale"
"github.com/themotion/ladder/log"
"github.com/themotion... |
/*
Copyright 2021 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
// Copyright ©2016 The go-hep Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Copyright 2012 The Plotinum Authors. All rights reserved.
// Use of this source code is governed by an MIT-style license
// that can be found in the LIC... |
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package devicefarm
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// AWS::DeviceFarm::VPCEConfiguration create... |
// Copyright 2021 gorse 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 obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed ... |
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writi... |
package nomad
import (
"errors"
"log"
"os"
"strconv"
"strings"
consulapi "github.com/hashicorp/consul/api"
"github.com/hashicorp/nomad/api"
"github.com/hashicorp/nomad/nomad/structs"
_ "github.com/ugorji/go/codec"
)
// NewClient will create a instance of a nomad API Client
func NewClient(c Config) (*api.Cli... |
package server
/*
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
dis... |
/*
Modifications Copyright 2017 Mailgun Technologies Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... |
package e2e
import (
"flag"
"log"
"os"
"testing"
"time"
"github.com/operator-framework/operator-metering/pkg/operator/reporting"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/require"
_ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
"github.com/operator-framework/operator-metering/test/framewor... |
// 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... |
// Copyright (C) 2014 Space Monkey, 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 agre... |
package test
import (
"context"
"encoding/json"
"io/ioutil"
"path/filepath"
"sort"
"strings"
"testing"
"github.com/Checkmarx/kics/internal/tracker"
"github.com/Checkmarx/kics/pkg/engine"
"github.com/Checkmarx/kics/pkg/engine/mock"
"github.com/Checkmarx/kics/pkg/engine/query"
"github.com/Checkmarx/kics/pkg... |
package portforward
import (
"context"
"time"
"k8s.io/apimachinery/pkg/api/equality"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/types"
ctrl "sigs.k8s.io/controller-runtime"
ctrlclient "sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
"git... |
// 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 agr... |
package system
import (
"errors"
"fmt"
"regexp"
"strconv"
"strings"
"github.com/skmonir/mango-gui/utils"
)
func (parser CodeforcesParser) GetContestType(contestId string) string {
id, err := strconv.ParseInt(contestId, 10, 30)
if err != nil {
if len(contestId) > 5 {
return "gym"
}
return "contest"
... |
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: MIT
package linux
import (
"io/ioutil"
"os"
"testing"
"github.com/aws/amazon-cloudwatch-agent/tool/data/config"
"github.com/aws/amazon-cloudwatch-agent/tool/testutil"
"github.com/aws/amazon-cloudwatch-agent/tool... |
// Package fake provides basic mocks for IParser, IGameState and IParticipants.
// See examples/mocking (https://github.com/markus-wa/demoinfocs-golang/tree/master/examples/mocking).
package fake
import (
"time"
dp "github.com/markus-wa/godispatch"
mock "github.com/stretchr/testify/mock"
dem "github.com/markus-w... |
/*
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, ... |
// Code generated by go-swagger; DO NOT EDIT.
package endpoints
// 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.co... |
package diagnostics
import (
"archive/zip"
"context"
"encoding/csv"
"errors"
"fmt"
"io"
sq "github.com/Masterminds/squirrel"
"github.com/treeverse/lakefs/db"
)
// Collector collects diagnostics information and write the collected content into a writer in a zip format
type Collector struct {
db db.Database
}... |
package kubepkg
import (
"context"
"encoding/json"
"github.com/octohelm/kubepkg/pkg/annotation"
"strings"
"github.com/containerd/containerd/platforms"
"github.com/containerd/containerd/reference/docker"
"github.com/distribution/distribution/v3"
"github.com/distribution/distribution/v3/manifest/manifestlist"
... |
// Copyright 2017 Monax Industries 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 a... |
// {{{ Copyright (c) <NAME> <<EMAIL>>, 2021
//
// 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 tracker
import (
"sync"
"time"
)
// Task provides methods to represent the state of a runnable work item.
type Task interface {
Name() string
State() TaskState
SetState(TaskState, ...string)
Duration() time.Duration
Messages() []string
Output() []string
AddOutput(...string)
Child(name string) T... |
package tradelogs
import (
"context"
"math/big"
"time"
ethereum "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/pkg/errors"
"github.com/KyberNetwork/reserve-stats/lib/blockchain"
"github.com/KyberNetwork/reserve-stats/lib/mathutil"
"github.com/KyberNetwork/r... |
/*
* The MIT License
*
* Copyright 2016 <a href="mailto:<EMAIL>">hutdev</a>.
*
* 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 rig... |
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
package model
import (
"crypto/rand"
"encoding/json"
"io"
"strings"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestRemoteClusterJson(t *testing.T) {... |
package main
import (
"fmt"
"os"
"os/signal"
"strings"
"syscall"
"time"
"github.com/hylandsoftware/spot/pkg/spot"
"github.com/hylandsoftware/spot/pkg/spot/bamboo"
"github.com/hylandsoftware/spot/pkg/spot/jenkins"
arg "github.com/alexflint/go-arg"
colorable "github.com/mattn/go-colorable"
log "github.com/... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package codepipeline
import (
"context"
"time"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
// Represents the input of a PutApprovalResult action.
// Please also see https://docs.aws.amazon.com/goto/WebA... |
package new_storage
import (
"context"
"fmt"
"github.com/AlexAkulov/clickhouse-backup/pkg/config"
"google.golang.org/api/option/internaloption"
"io"
"net/http"
"path"
"strings"
"time"
"cloud.google.com/go/storage"
"github.com/apex/log"
"google.golang.org/api/iterator"
"google.golang.org/api/option"
goog... |
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
// Copyright 2019 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 ... |
// Copyright 2017 Authors of Cilium
//
// 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 ... |
package test
import (
"encoding/json"
"fmt"
"gopkg.in/redis.v3"
"mzlib/client"
"reflect"
"strconv"
"testing"
"time"
)
func Assert(a, b interface{}, t *testing.T) {
if a != b {
t.Error("Assert fail!")
fmt.Println("Assert fail!")
fmt.Println("a=====", a, reflect.TypeOf(a).Name())
fmt.Println("b=====", ... |
package dependency
import (
"fmt"
"strings"
"github.com/pkg/errors"
)
type graph struct {
Nodes map[string]*node
Root *node
}
func newGraph(root *node) *graph {
graph := &graph{
Nodes: make(map[string]*node),
Root: root,
}
graph.Nodes[root.ID] = root
return graph
}
// node is a node in a graph
type... |
// 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.
package erand
import (
"math/rand"
"github.com/goki/ki/kit"
"gonum.org/v1/gonum/stat/distuv"
)
// RndParams provides parameterized random numbe... |
package s3
import (
"fmt"
"github.com/GoodwayGroup/gw-aws-audit/lib"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
awsSession "github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/service/s3/s3manager"
"github.com/remeh/sizedwaitgroup... |
// Copyright (c) 2017 Tigera, 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 applica... |
package bamprovider
import (
"fmt"
"sync"
"github.com/grailbio/base/errors"
"github.com/grailbio/base/file"
"github.com/grailbio/base/vcontext"
"github.com/grailbio/bio/biopb"
gbam "github.com/grailbio/bio/encoding/bam"
"github.com/grailbio/bio/encoding/pam"
"github.com/grailbio/bio/encoding/pam/pamutil"
"g... |
package filecache
import (
"crypto/md5" //nolint:gosec
"encoding/hex"
"fmt"
"hash"
"io"
"os"
"path/filepath"
"sync"
"time"
"github.com/tarampampam/go-filecache/file"
)
type Item struct {
Pool CachePool
hashing hash.Hash
fileName string
key string
mutex *sync.Mutex
}
// DefaultItemFilePer... |
package main
import (
"bufio"
"fmt"
"math"
"os"
"strconv"
"strings"
"testing"
"github.com/dcadenas/pagerank"
)
const smallGraphEdgeFile = "../datasets/example"
const smallGraphNodeFile = "../datasets/examplePageNum"
const largeGraphEdgeFile = "../datasets/dirLinks.txt"
const largeGraphNodeFile = "../dataset... |
package authn
import (
"net/url"
"strings"
"authcore.io/authcore/internal/authn/idp"
"authcore.io/authcore/internal/authn/verifier"
"authcore.io/authcore/internal/clientapp"
"authcore.io/authcore/internal/errors"
"authcore.io/authcore/pkg/cryptoutil"
"authcore.io/authcore/pkg/httputil"
"github.com/go-playgr... |
// Copyright 2017-present The Hugo 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 app... |
package go86
import (
"fmt"
"net"
"strconv"
"strings"
log "github.com/golang/glog"
)
type GdbSession struct {
conn net.Conn
threadId int64
needAck bool
}
// Gets the packet data or returns an error if the bytes of the packet
// are not valid.
func (S GdbSession) GetPacketData(raw []byte, n int) (string... |
package udwSsh
import (
"fmt"
"github.com/tachyon-protocol/udw/udwCmd"
"github.com/tachyon-protocol/udw/udwErr"
"github.com/tachyon-protocol/udw/udwFile"
"github.com/tachyon-protocol/udw/udwRetry"
"github.com/tachyon-protocol/udw/udwTime"
"strconv"
"strings"
"time"
)
const SshOption = " -C -o StrictHostKeyCh... |
package huffman
import (
"fmt"
"io"
"strconv"
"bytes"
"container/heap"
"github.com/goossaert/compression/logging"
"github.com/dgryski/go-bitstream"
)
type HNode struct {
parent *HNode
left *HNode
right *HNode
frequency int
dict map[byte]bool
}
func (hnode *HNode) Byt... |
package makroud
import (
"reflect"
"strings"
"github.com/pkg/errors"
"github.com/ulule/makroud/reflectx"
"github.com/ulule/makroud/snaker"
)
// Schemaless is a light version of schema for structs that are not models.
// It's a simple mapper from column name to struct field, without primary key, associations an... |
// 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 main
import (
"bufio"
"encoding/binary"
"fmt"
"os"
"regexp"
"sort"
"strconv"
"github.com/google/syzkaller/pkg/cover/backend"
"github.com... |
package clientdb
import (
"bytes"
"fmt"
"io"
"sort"
"time"
"github.com/lightninglabs/pool/event"
"go.etcd.io/bbolt"
)
var (
// eventBucketKey is the top level bucket where we can find all events
// of the system. These events are indexed by their timestamps which are
// guaranteed to be unique by the clien... |
// Copyright 2021 Soluble 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 photon_spectator
import (
"bytes"
"encoding/binary"
"fmt"
"strconv"
)
const (
NilType = 42
Int8Type = 98
Float32Type = 102
Int32Type = 105
Int16Type = 107
Int64Type = 108
StringType = 115
BooleanType = 111
SliceInt8Type = 120
SliceType = 121
)
type ReliableMess... |
package process
import (
"fmt"
"io"
"os"
"path/filepath"
"strconv"
"strings"
"time"
dynlib "gitlab.com/yawning/dynlib.git"
)
const (
sandboxHostname = "oasis-core"
sandboxMountBinary = "/entrypoint"
sandboxMountLibDir = "/usr/lib"
sandboxStartTimeout = 5 * time.Second
)
type bwrap struct {
*naked
}
... |
package envdb
import (
"crypto/ecdsa"
"crypto/rand"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"fmt"
"math/big"
"net"
"os"
"path"
"strings"
"time"
"github.com/sevlyar/go-daemon"
)
var (
// Default server path
DefaultServerPath = ""
// Default store path i.e database ... |
package awsglacier
import (
"context"
"fmt"
"io"
"os"
"strings"
"sync"
"github.com/antontsv/backup/cloud"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/glacier"
ini "gopkg.in/ini.v1"
)
type service struct {
vault *string
*glacier.Glacier
}
co... |
// Copyright 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 in wri... |
package lsp
// SymbolKind specifies the type of a symbol.
type SymbolKind int
const (
// SKFile denotes a file symbol kind.
SKFile SymbolKind = iota + 1
// SKModule denotes a module symbol kind.
SKModule
// SKNamespace denotes a namespace symbol kind.
SKNamespace
// SKPackage denotes a package symbol kind.
... |
// Package cluster provides common interfaces and local access to cluster-level metadata
/*
* Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
*/
package cluster
import (
"io"
"os"
"github.com/NVIDIA/aistore/cmn"
"github.com/NVIDIA/aistore/cmn/cos"
"github.com/NVIDIA/aistore/fs"
)
///////////... |
package wire
import (
"bytes"
"io"
"math/rand"
"sync"
"time"
"github.com/dusk-network/dusk-blockchain/pkg/util/container/ring"
lg "github.com/sirupsen/logrus"
)
var _ EventBroker = (*EventBus)(nil)
var ringBufferLength = 2000
var napTime = 1 * time.Millisecond
var _signal struct{}
var logEB = lg.WithField("p... |
package platformclientv2
import (
"time"
"github.com/leekchan/timeutil"
"encoding/json"
"strconv"
"strings"
)
// Recordingmessagingmessage
type Recordingmessagingmessage struct {
// From - The message sender session id.
From *string `json:"from,omitempty"`
// FromUser - The user who sent this message.
From... |
package goperfcounter
import (
"encoding/json"
"fmt"
"log"
"time"
"github.com/niean/go-metrics-lite"
bhttp "github.com/niean/gotools/http/httpclient/beego"
)
const (
GAUGE = "GAUGE"
)
func pushToFalcon() {
cfg := config()
step := cfg.Step
api := cfg.Push.Api
debug := cfg.Debug
// align push start ts
a... |
package oidc
import (
"context"
"errors"
"fmt"
"io/ioutil"
"net/http"
"sync"
"time"
"github.com/pquerna/cachecontrol"
jose "gopkg.in/square/go-jose.v2"
)
// keysExpiryDelta is the allowed clock skew between a client and the OpenID Connect
// server.
//
// When keys expire, they are valid for this amount of ... |
// Copyright 2017 The Scribble 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) 2015, <NAME>. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.
//
// A database can be configured with a custom FilterPolicy object.
// This object is responsible for creating a small filter from a ... |
package core
import (
"errors"
"fmt"
"io"
"strings"
)
const (
refPrefix = "refs/"
refHeadPrefix = refPrefix + "heads/"
refTagPrefix = refPrefix + "tags/"
refRemotePrefix = refPrefix + "remotes/"
refNotePrefix = refPrefix + "notes/"
symrefPrefix = "ref: "
maxResolveRecursion = 1024
)
var (... |
package webapp
import (
"fmt"
htmltemplate "html/template"
"net/http"
"net/url"
"time"
"github.com/authgear/authgear-server/pkg/auth/handler/webapp/viewmodels"
"github.com/authgear/authgear-server/pkg/auth/webapp"
"github.com/authgear/authgear-server/pkg/lib/authn/authenticator"
"github.com/authgear/authgear... |
package dataset
import (
"encoding/csv"
"encoding/gob"
"errors"
"github.com/TrizlyBear/PWS/math"
"github.com/TrizlyBear/PWS/utils"
"io/ioutil"
math2 "math"
"math/rand"
"os"
"strconv"
"strings"
"time"
)
type datasetOption func(*Dataset)
type Dataset struct {
Name string
X [][][]float64
Y [][][]flo... |
// Copyright 2019 Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in complian... |
// Copyright 2019-2020 VMware, Inc.
// SPDX-License-Identifier: BSD-2-Clause
package service
import (
"bytes"
"encoding/json"
"github.com/vmware/transport-go/model"
"io"
"net/http"
"net/url"
"reflect"
)
const (
restServiceChannel = "fabric-rest"
)
type RestServiceRequest struct {
// The destination URL of ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.