text stringlengths 3.08k 10.4k |
|---|
package ccclient_test
import (
"bytes"
"fmt"
"io/ioutil"
"net"
"net/http"
"net/url"
"code.cloudfoundry.org/cc-uploader/ccclient"
"code.cloudfoundry.org/cc-uploader/ccclient/test_helpers"
"code.cloudfoundry.org/lager/lagertest"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Uplo... |
package data
import (
"crypto/sha256"
"crypto/sha512"
"fmt"
"hash"
"io"
"io/ioutil"
"strings"
"time"
"github.com/Sirupsen/logrus"
"github.com/jfrazelle/go/canonical/json"
)
type KeyAlgorithm string
func (k KeyAlgorithm) String() string {
return string(k)
}
type SigAlgorithm string
func (k SigAlgorithm)... |
package ordered
import (
"fmt"
"github.com/m4gshm/gollections/c"
"github.com/m4gshm/gollections/collect"
"github.com/m4gshm/gollections/immutable/ordered"
"github.com/m4gshm/gollections/it/impl/it"
"github.com/m4gshm/gollections/map_"
"github.com/m4gshm/gollections/notsafe"
"github.com/m4gshm/gollections/op"
... |
package jobs
import (
"bytes"
"crypto/sha256"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"strings"
"time"
que "github.com/bgentry/que-go"
ct "github.com/google/certificate-transparency-go"
cttls "github.com/google/certificate-transparency-go/tls"
ctx509 "github.com/google/certificate-transparency... |
package msg
import (
"sync"
"context"
"errors"
"strings"
"time"
"github.com/segmentio/kafka-go"
"tsai.eu/solar/model"
"tsai.eu/solar/util"
)
//------------------------------------------------------------------------------
// MSG represents the messaging interface to a kafka bus.
type MSG struct {
... |
package travel
import (
"github.com/akerl/voyager/v3/cartogram"
"github.com/akerl/input/list"
)
// Grapher defines a graph resolution object for finding paths to accounts
type Grapher struct {
Prompt list.Prompt
Pack cartogram.Pack
}
// ResolveOptions allow passing structured parameters for graph resolution
t... |
/*
Copyright 2019 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 (
"archive/tar"
"compress/gzip"
"context"
"errors"
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
"path"
"path/filepath"
"strings"
"github.com/aws/aws-lambda-go/lambda"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/etherlabsio/hls/pkg/hls"
"github.com... |
package flago
import (
"fmt"
"reflect"
"sort"
"strings"
)
var (
Indent = 2
Pad = 20
)
func (f *FlagSet) defaultUsage() {
fmt.Fprintf(f.Output(), "\nUsage: %s\n\n", f.name)
f.PrintDefaults()
}
func (f *FlagSet) usage() {
if f.Usage == nil {
f.defaultUsage()
} else {
f.Usage()
}
}
// sortFlags retu... |
package postgres
import (
"database/sql"
"fmt"
"github.com/egtann/migrate"
"github.com/jmoiron/sqlx"
"github.com/pkg/errors"
_ "github.com/lib/pq"
)
type DB struct {
connURL string
// Embed the sqlx DB struct
*sqlx.DB
}
func New(
user, pass, host, dbName string,
port int,
sslKey, sslCert, sslCA string... |
package gorann
import (
"flag"
"log"
)
type NeuLayerConfig struct {
actfname string // activation function (non-linearity) used for a given layer
size int // number of nodes ("neurons") comprising the layer
}
type NeuCallbacks struct {
normcbX func(vec []float64)
normcbY func(vec []float64)
denormc... |
/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License... |
package mlxscraper
import (
"bytes"
"crypto/rand"
"encoding/hex"
"io"
"io/ioutil"
"log"
mathrand "math/rand"
"net/http"
"sort"
"strings"
"time"
"github.com/PuerkitoBio/goquery"
"github.com/gbl08ma/sqalx"
uuid "github.com/satori/go.uuid"
"github.com/underlx/disturbancesmlx/types"
)
// Scraper is a sc... |
package app
import (
"bufio"
"flag"
"fmt"
. "github.com/tendermint/go-common"
"github.com/tendermint/go-crypto"
"github.com/tendermint/go-wire"
"github.com/tendermint/tmsp/server"
tmsp "github.com/tendermint/tmsp/types"
"github.com/zballs/comit/state"
. "github.com/zballs/comit/types"
. "github.com/zballs/c... |
package interpreter
import (
"errors"
"github.com/relnod/calcgo/interpreter/calculator"
"github.com/relnod/calcgo/interpreter/optimizer"
"github.com/relnod/calcgo/parser"
)
// Errors, that can occur during interpreting
var (
ErrorMissingLeftChild = errors.New("Error: Missing left child of node")
ErrorMis... |
package main
import (
"fmt"
"image"
"image/color"
"image/png"
"math/cmplx"
"os"
)
// Lattice pixels around E
// a b c
// d e f
// g h i
type Lattice struct {
a color.Color
b color.Color
c color.Color
d color.Color
e color.Color
f color.Color
g color.Color
h color.Color
i color.Color
}
func main() {
c... |
package cluster
import (
"encoding/json"
"fmt"
"os"
"path"
"github.com/iotaledger/goshimmer/packages/ledgerstate"
"github.com/iotaledger/wasp/tools/cluster/templates"
)
type GoshimmerConfig struct {
TxStreamPort int
APIPort int
UseProvidedNode bool
FaucetPoWTarget int
Hostname string
}
... |
package client
import (
"github.com/juxuny/yc/services"
"github.com/juxuny/yc/utils"
"github.com/juxuny/yc/utils/template"
"github.com/yoheimuta/go-protoparser/v4"
"github.com/yoheimuta/go-protoparser/v4/parser"
"log"
"os"
"path"
"reflect"
"strings"
)
func (t *GenCommand) genReactTs() {
serviceName := t.ge... |
package main
import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"net/http"
"strconv"
"strings"
"time"
"crypto/tls"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/qiangxue/go-env"
log "github.com/sirupsen/logrus"
"gopkg.in/yaml.v3"
)
... |
package tenant
import (
"bytes"
"context"
"fmt"
"github.com/3scale/3scale-operator/pkg/3scale/amp/component"
apiv1alpha1 "github.com/3scale/3scale-operator/pkg/apis/capabilities/v1alpha1"
controllerhelper "github.com/3scale/3scale-operator/pkg/controller/helper"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pk... |
package cmd
import (
"errors"
"github.com/AlecAivazis/survey/v2"
"github.com/brawaru/marct/launcher"
"github.com/brawaru/marct/locales"
"github.com/brawaru/marct/validfile"
"github.com/nicksnyder/go-i18n/v2/i18n"
"github.com/urfave/cli/v2"
)
func mapVersions(entries []launcher.VersionDescriptor) []string {
v... |
package spinnakerservice
import (
"context"
"fmt"
"github.com/armory/spinnaker-operator/pkg/apis/spinnaker/interfaces"
"github.com/armory/spinnaker-operator/pkg/deploy"
"github.com/armory/spinnaker-operator/pkg/deploy/spindeploy"
"github.com/armory/spinnaker-operator/pkg/halyard"
"github.com/armory/spinnaker-op... |
// DO NOT EDIT THIS FILE. GENERATED BY svdxgen.
// +build stm32l4x6
// Package lptim provides access to the registers of the LPTIM peripheral.
//
// Instances:
// LPTIM1 LPTIM1_BASE APB1 LPTIM1 Low power timer
// LPTIM2 LPTIM2_BASE APB1 LPTIM2 Low power timer
// Registers:
// 0x000 32 ISR Interrupt and ... |
package main
import (
"context"
"fmt"
"net"
"os"
"os/signal"
"strings"
"sync"
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
grpc_logrus "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus"
grpc_validator "github.com/grpc-ecosystem/go-grpc-middleware/validator"
log "github.com/siru... |
package spellcheck
import (
"bufio"
"os"
"regexp"
"strings"
)
func readLines(path string) ([]string, error) {
file, err := os.Open(path)
if err != nil {
return nil, err
}
defer file.Close()
var lines []string
scanner := bufio.NewScanner(file)
for scanner.Scan() {
lines = append(lines, scanner.Text())
... |
package controllers
import (
"encoding/json"
"encoding/xml"
"errors"
"fmt"
"io/ioutil"
"net/http"
"readbook/models"
"readbook/utils"
"readbook/wx"
"strconv"
"strings"
"time"
"github.com/gin-gonic/contrib/sessions"
"github.com/gin-gonic/gin"
)
// 验证
func ConnectWx(c *gin.Context) {
timestamp, nonce, s... |
package readers
import (
"fmt"
"errors"
"unicode"
"github.com/caa-dev-apps/cefmdd_v1/pkg/diag"
"strings"
)
type ROWState int
const (
STX ROWState = iota
TOK
TOK_2
QSTR
QSTR_2
ERROR
)
// TOK TOK TOK TOK QTOK TOK
// DATE-TIME, FLOAT, INT, DOUBLE, STRING, EOL_... |
package listener
import (
"context"
"crypto/tls"
"fmt"
"github.com/infinispan/infinispan-operator/controllers"
"github.com/infinispan/infinispan-operator/launcher"
"gopkg.in/cenkalti/backoff.v1"
"net/http"
"os"
"time"
v1 "github.com/infinispan/infinispan-operator/api/v1"
"github.com/infinispan/infinispan-o... |
package main
// Template for using the library.
import (
"context"
"fmt"
"os"
"strconv"
utils "gh.com/api-test/utils"
"github.com/shurcooL/githubv4"
"golang.org/x/oauth2"
)
// QueryListRepositories is the GraphQL query for retrieving a list of repositories for an organization
type QueryListRepositories struc... |
// Code generated by entc, DO NOT EDIT.
package ent
import (
"context"
"errors"
"fmt"
"github.com/facebookincubator/ent/dialect/sql/sqlgraph"
"github.com/facebookincubator/ent/schema/field"
"github.com/thoverik/gobench/ent/graph"
"github.com/thoverik/gobench/ent/group"
"github.com/thoverik/gobench/ent/metric... |
package notifier
import (
"errors"
"net/http"
"sync"
"time"
"github.com/gorilla/websocket"
"github.com/maoqide/melody"
"github.com/maoqide/ws-notifier/sessionmanager"
)
var notifier = New()
// NotifyMessage is common struct for notifier
type NotifyMessage struct {
Type string `json:"type"`
Code ... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package waf
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type CreateIPSetInput struct {
_ struct{} `type:"structure"`
// The value returned by the most recent call to GetChangeToken.... |
// Copyright © 2022 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
// 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
//
// Unle... |
package main
import (
"bufio"
"fmt"
"github.com/pkg/errors"
"io"
"math"
"os"
"strconv"
"strings"
)
type Point struct {
x int
y int
}
func (p *Point) Neighbours() []*Point {
return []*Point{
{x: p.x + 1, y: p.y},
{x: p.x - 1, y: p.y},
{x: p.x, y: p.y + 1},
{x: p.x, y: p.y - 1},
{x: p.x + 1, y: p.... |
/*
* Copyright 2018 The Service Manager 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 ... |
package s3
import (
"context"
"encoding/json"
"fmt"
"net"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/sqs"
pbN "github.com/in4it/roxprox/proto/notification"
"github.com/juju/loggo"
"google.golang.org/grpc"
)
const (
serviceD... |
/*
Tencent is pleased to support the open source community by making Blueking Container Service available.
Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except
in compliance with the License. You may obtain a copy of... |
package app
import (
"go-common/library/time"
)
// platMap and Article vars
var (
platMap = map[string][]int8{
"android": {0, 1},
"ios": {0, 2},
"ipad": {0, 3},
}
MyArticle = "我的专栏"
OpenArticle = "开通专栏"
PortalIntro = 0
PortalNotice = 1
BgmFrom = map[int]int{
0: 1, // videoup
1: 1, /... |
// Copyright 2014 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable... |
package main
import (
"errors"
"flag"
"fmt"
"math"
"os"
"os/signal"
"plugin"
"strings"
"syscall"
"time"
"github.com/Shopify/sarama"
cluster "github.com/bsm/sarama-cluster"
"github.com/kenschneider18/go-kafka-console-consumer/pkg/decoders"
"github.com/kenschneider18/go-kafka-console-consumer/pkg/parser"
... |
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See License for license information.
package mscalendar
import (
"fmt"
"time"
"github.com/mattermost/mattermost-plugin-mscalendar/server/remote"
"github.com/mattermost/mattermost-plugin-mscalendar/server/store"
"github.com/mattermost/matterm... |
package csvtogo
import (
"fmt"
"io"
"reflect"
"strconv"
)
var _defaultOps = Options{
SkipHeader: true,
Comma: ',',
}
type Executor[T any] struct {
file string
outsChan chan []T
outChan chan T
nextChan chan bool
errChan chan error
run bool
ops Options
}
type Options struct {
SkipHe... |
// Copyright 2018 The MATRIX Authors as well as Copyright 2014-2017 The go-ethereum Authors
// This file is consisted of the MATRIX library and part of the go-ethereum library.
//
// The MATRIX-ethereum library is free software: you can redistribute it and/or modify it under the terms of the MIT License.
//
// Permissi... |
/* {{{ Copyright (c) 2017, <NAME> <<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, merge, ... |
package reports
import (
"fmt"
"go.uber.org/dig"
"strings"
"ts/adapters"
"ts/models"
"ts/utils"
)
const (
categoryKey = "Category"
productIdKey = "ID"
)
type ReportsHandler struct {
Handler adapters.HandlerInterface
Header *models.ReportLabels
FileManager *adapters.FileManager
}
type Deps struc... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.15.2
// source: web-tavern-chess.proto
package proto_gen
import (
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobu... |
// Copyright (c) 2020 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 compliance with the Lice... |
package httpjson
import (
"fmt"
"io/ioutil"
"net/http"
"strings"
"testing"
"github.com/influxdb/telegraf/testutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
const validJSON = `
{
"parent": {
"child": 3,
"ignored_child": "hi"
},
"ignored_null": null,
"integer"... |
package terra
import (
"fmt"
"strconv"
"time"
"github.com/spf13/viper"
"github.com/trustwallet/blockatlas/coin"
"github.com/trustwallet/blockatlas/pkg/blockatlas"
)
type Platform struct {
client Client
}
func (p *Platform) Init() error {
p.client = Client{blockatlas.InitClient(viper.GetString(p.ConfigKey())... |
package skiplist
import (
"data-structures-and-algorithms/contract"
"fmt"
"math/rand"
"strings"
"time"
)
const (
maxLevel int = 3
)
// quadListNode 四链表节点
// ^
// |
// <-- node -->
// |
// v
type quadListNode struct {
key interface{}
value interface{}
pred, next *qu... |
// Copyright (c) 2017 Cisco and/or its affiliates.
//
// 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 applicabl... |
/*
* 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 ... |
/*
* Copyright (c) 2020 <NAME>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish... |
package main
import (
"bytes"
"fmt"
"io"
"log"
"net"
"os"
"strconv"
"strings"
"syscall"
"github.com/s-urbaniak/uevent"
"golang.org/x/sys/unix"
)
// isValidDmEvent checks whether this udev event has correct flags.
// This is similar to checks done by /usr/lib/udev/rules.d/10-dm.rules udev rules.
func isVal... |
package collector
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/weaponry/pgscv/internal/log"
"github.com/weaponry/pgscv/internal/model"
"github.com/weaponry/pgscv/internal/store"
"strconv"
"strings"
)
const (
// admin console queries used for retrieving stats.
poolsQuery = "SHOW POOL... |
package library
import (
"encoding/json"
"encoding/xml"
"fmt"
"io/ioutil"
"log"
"net"
"net/http"
"net/url"
"github.com/mikedewar/aws4"
"github.com/nytlabs/streamtools/st/blocks" // blocks
"github.com/nytlabs/streamtools/st/util"
//"reflect"
//"strings"
"sync"
"time"
)
type sqsMessage struct {
Body ... |
// Copyright 2020 Humility AI Incorporated, 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 ... |
// Package tracker implements tracking two file systems
package tracker
import (
"context"
"path/filepath"
"sync"
"time"
"github.com/elliotchance/orderedmap"
"github.com/rclone/rclone/fs"
"github.com/rclone/rclone/fs/operations"
"github.com/rclone/rclone/fs/walk"
)
// Tracker tracks the differences between t... |
// Copyright 2016 Google Inc. All Rights Reserved.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable la... |
package proxy
import (
"fmt"
"io"
"net"
"strconv"
"sync"
"github.com/eko/monday/pkg/hostfile"
"github.com/eko/monday/pkg/ui"
)
const (
// ProxyPortStart is the first port that will be allocated by the proxy component.
// Others will be incremented by 1 each time
ProxyPortStart = "9400"
)
type Proxy interf... |
package gocbcore
import (
"sync"
"time"
"github.com/couchbase/gocbcore/v9/memd"
)
type statsComponent struct {
kvMux *kvMux
tracer *tracerComponent
defaultRetryStrategy RetryStrategy
}
func newStatsComponent(kvMux *kvMux, defaultRetry RetryStrategy, tracer *tracerComponent) *stats... |
package main
import (
"context"
"fmt"
"strings"
"sync"
"time"
"xray.com/core/app/stats/command"
"github.com/prometheus/client_golang/prometheus"
"github.com/sirupsen/logrus"
"google.golang.org/grpc"
)
type Exporter struct {
sync.Mutex
endpoint string
scrapeTimeout time.Duration
registry ... |
// Copyright 2020 WHTCORPS INC, 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... |
// Copyright 2013 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 db encapsulates tsuru connection with MongoDB.
//
// The function Open dials to MongoDB and returns a connection (represented by
// the Storage type).... |
package config
import (
"fmt"
"reflect"
"strings"
)
func flagString(parent, field string) string {
if len(parent) == 0 {
return strings.ToLower(hyphen(field))
}
if len(field) == 0 {
return strings.ToLower(hyphen(parent))
}
return strings.ToLower(hyphen(parent) + "-" + hyphen(field))
}
func envString(pare... |
/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License ... |
/*
SPDX-License-Identifier: Apache-2.0
Copyright Contributors to the Submariner project.
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 requ... |
package main
import (
"flag"
"fmt"
"os"
"os/signal"
"strings"
"time"
MQTT "github.com/eclipse/paho.mqtt.golang"
log "github.com/sirupsen/logrus"
_ "github.com/kidoman/embd/host/rpi" // This loads the RPi driver
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
"github.com/stevebargelt/buildwatch... |
package iso8583
import (
"bytes"
"errors"
"fmt"
"strconv"
)
const (
//BCDL 左靠bcd
BCDL = iota
//BCDR 右靠bcd
BCDR
//NORMAL 正常
NORMAL
//BITS 二进制
BITS
)
//fieldDef 域定义
type fieldDef struct {
fieldID int //域id
lenAttr int //长度属性
lenWidth int //长度域长度
valueAttr int ... |
package addon
import (
"fmt"
"os"
"path"
"strings"
"time"
cdx "github.com/CycloneDX/cyclonedx-go"
"github.com/pkg/errors"
"github.com/tap8stry/orion/pkg/common"
)
//StoreCdxJSON :
func StoreCdxJSON(outfp string,
image common.Image, namespace string, installs []common.VerifiedArtifact) error {
metadata := ... |
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"github.com/gotd/td/bin"
"github.com/gotd/td/tdjson"
"github.com/gotd/td/tdp"
"github.com/gotd/td/tgerr"
)
// No-op definition for keeping imports.
var (
_ = bin.Buffer{}
_... |
// The XOR experiment serves to actually check that network topology actually evolves and everything works as expected.
// Because XOR is not linearly separable, a neural network requires hidden units to solve it. The two inputs must be
// combined at some hidden unit, as opposed to only at the out- put node, because t... |
// Copyright 2020 cloudeng llc. All rights reserved.
// Use of this source code is governed by the Apache-2.0
// license that can be found in the LICENSE file.
// Package instrument provides support for instrumenting complex applications
// to trace their operation and communication behaviour across multiple
// gorout... |
/*
Copyright 2016 GitHub Inc.
See https://github.com/github/gh-ost/blob/master/LICENSE
*/
package mysql
import (
gosql "database/sql"
"fmt"
"time"
"github.com/github/gh-ost/go/sql"
"github.com/outbrain/golib/log"
"github.com/outbrain/golib/sqlutils"
)
const MaxTableNameLength = 64
const MaxReplicationPa... |
package main
import (
"flag"
"html/template"
"math/rand"
"net/http"
"os"
"time"
boshlog "github.com/cloudfoundry/bosh-utils/logger"
boshsys "github.com/cloudfoundry/bosh-utils/system"
boshuuid "github.com/cloudfoundry/bosh-utils/uuid"
mart "github.com/go-martini/martini"
martauth "github.com/martini-contri... |
package main
import (
"fmt"
"path"
"strings"
)
// FilePath contains the main URL and the filename (slice)
type FilePath struct {
DirPath
filename string
}
// DirPath represents a part of a FilePath
type DirPath struct {
DevicePath
directory string
}
// AliasPath is aliasing an actual physical 'device:/path/'... |
package cpaper_extended
import (
"fmt"
"github.com/pkg/errors"
"github.com/s7techlab/cckit/examples/cpaper_extended/schema"
"github.com/s7techlab/cckit/extensions/debug"
"github.com/s7techlab/cckit/extensions/owner"
"github.com/s7techlab/cckit/router"
"github.com/s7techlab/cckit/router/param"
"github.com/s7te... |
package gof
import (
"context"
"errors"
"github.com/gin-gonic/gin"
"github.com/opentracing/opentracing-go"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/sirupsen/logrus"
"github.com/spf13/viper"
"github.com/uber/jaeger-client-go"
"github.com/uber/jaeger-client-go/config"
"github.com/u... |
package enaptercli
import (
"bytes"
"context"
"encoding/base64"
"errors"
"fmt"
"io"
"net/http"
"time"
"github.com/shurcooL/graphql"
"github.com/urfave/cli/v2"
)
const deviceUplaodDefaultTimout = 30 * time.Second
type cmdDevicesUpload struct {
cmdDevicesUploadCommon
blueprintDir string
}
type cmdDevices... |
package azuretexttospeech
// AudioOutput types represent the supported audio encoding formats for the text-to-speech endpoint.
// This type is required when requesting to azuretexttospeech.Synthesize text-to-speed request.
// Each incorporates a bitrate and encoding type. The Speech service supports 24 kHz, 16 kHz, an... |
// Copyright (c) 2020, salesforce.com, inc.
// All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause
// For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file exce... |
package keeper
import (
"fmt"
abci "github.com/tendermint/tendermint/abci/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/staking/types"
)
// InitGenesis sets the pool and parameters for the provided keeper. For each
// validator in data, it sets that validator in the keeper alo... |
/*
Copyright (c) Facebook, Inc. and its affiliates.
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... |
/**
* Penlook Project
*
* Copyright (c) 2015 Penlook Development Team
*
* --------------------------------------------------------------------
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Softwa... |
// Copyright 2018 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 ... |
package config
import (
"net/url"
"os"
"path"
"path/filepath"
"strings"
"github.com/Unknwon/com"
homedir "github.com/mitchellh/go-homedir"
"github.com/pkg/errors"
"github.com/spf13/afero"
"github.com/spf13/viper"
_ "github.com/spf13/viper/remote"
)
// ConfigInterface ...
type ConfigInterface interface {
... |
package encoding
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
)
func TestNInt32(t *testing.T) {
testNVarInt32(t, -1, []byte{0xFF})
testNVarInt32(t, -5, []byte{0xFB})
testNVarInt32(t, 63, []byte{0x3F})
testNVarInt32(t, -65, []byte{0xBF})
testNVarInt32(t, 127, []byte{0x7F})
testNVarInt32(t, 2... |
package server
import (
"context"
"errors"
"fmt"
"log"
"net/http"
"path"
"sort"
"strings"
"github.com/labstack/echo"
"github.com/labstack/echo/middleware"
"github.com/shirasudon/go-chat/chat"
"github.com/shirasudon/go-chat/chat/action"
"github.com/shirasudon/go-chat/domain/event"
"github.com/shirasudon... |
package cli
import (
"crypto/tls"
"io/ioutil"
"net/http"
"net/http/httptest"
"os"
"testing"
"github.com/square/certigo/cli/terminal"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
// localhostCert is a PEM-encoded TLS cert with SAN IPs
// "127.0.0.1" and "[::1]", expiring at Ja... |
package v2utils
import (
"math/big"
"sort"
"github.com/incognitochain/incognito-chain/common"
)
type MintNftStatus struct {
NftID string `json:"NftID"`
Status byte `json:"Status"`
BurntAmount uint64 `json:"BurntAmount"`
}
type ContributionStatus struct {
Status byte `json:"Sta... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package schemas
import (
"context"
"time"
"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"
)
type DescribeCodeBindingInput struct {
_ struct{} `type:"structure... |
package team5
import (
"math"
"sort"
"github.com/aclements/go-moremath/stats"
"github.com/google/go-cmp/cmp"
"github.com/pkg/errors"
"gonum.org/v1/gonum/floats"
"gonum.org/v1/gonum/stat"
)
type kdeModel struct {
observations []float64
weights []float64
estimator stats.KDE
}
// convenience method t... |
package client
//#cgo linux CFLAGS: -I/usr/local/include
//#cgo darwin CFLAGS: -I/usr/local/include
//#cgo windows CFLAGS: -IC:/src/td -IC:/src/td/build
//#cgo linux,!tdjson_static LDFLAGS: -L/lol/usr/local/lib -ltdjson
//#cgo linux,tdjson_static LDFLAGS: -L/lol/usr/local/lib -ltdjson_static -ltdjson_private -ltdclien... |
// Copyright (c) 2021 Terminus, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... |
package status
import (
"github.com/ngaut/log"
"gitlab.alibaba-inc.com/RDS_PG/polardb_cluster_manager/pkg/common"
"gitlab.alibaba-inc.com/RDS_PG/polardb_cluster_manager/pkg/detector"
"sync"
"time"
)
const (
ProxyStatusAlive string = "ProxyStatusAlive"
ProxyStatusInit string = "ProxyStatusInit"
ProxyStatusL... |
package net
import (
"context"
"errors"
"math"
"net"
"sync"
"time"
"go.uber.org/atomic"
)
var (
ErrAlreadyStarted = errors.New("libext-go/net: server already started")
ErrAlreadyStopped = errors.New("libext-go/net: server already stopped")
)
const (
defaultGracefulTimeout = 100 * time.Millisecond
)
type ... |
/*
Copyright 2018 Pusher 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 agreed to in writing, software
dis... |
package docker
import (
"context"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/projecteru2/core/engine/types"
enginetypes "github.com/projecteru2/core/engine/types"
"github.com/projecteru2/core/log"
coresource "github.com/projecteru2/core/source"
coretypes "github.com/projecteru2/core... |
package postlite
import (
"fmt"
"github.com/mattn/go-sqlite3"
)
type pgTypeModule struct{}
func (m *pgTypeModule) Create(c *sqlite3.SQLiteConn, args []string) (sqlite3.VTab, error) {
err := c.DeclareVTab(fmt.Sprintf(`
CREATE TABLE %s (
oid INTEGER,
typname TEXT,
typnamespace INTEGE... |
package screens
import (
"fmt"
"github.com/hitchnsmile/go-hangman/daos"
_ "github.com/mattn/go-sqlite3"
termbox "github.com/nsf/termbox-go"
)
type LeaderboardStates int
const (
ShowLeaderboard LeaderboardStates = iota
ShowLeaderboardFinished
ShowLeaderboardUnfinished
)
const (
leaderboardTitle = "LE... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.