text stringlengths 3.08k 10.4k |
|---|
// Package proxy is plugin that proxies requests.
package proxy
import (
"errors"
"fmt"
"sync/atomic"
"time"
"github.com/coredns/coredns/plugin"
"github.com/coredns/coredns/plugin/dnstap"
"github.com/coredns/coredns/plugin/dnstap/msg"
"github.com/coredns/coredns/plugin/pkg/healthcheck"
"github.com/coredns/co... |
package tok
import (
"regexp"
"testing"
"github.com/sxarp/c_compiler_go/src/h"
)
func expectToken(t *testing.T, tt TokenType, inputStr, expectedVal, expectedStr string) {
t.Helper()
tok, outputStr := tt.match(inputStr)
outputVal := tok.Val()
if outputVal != expectedVal || outputStr != expectedStr {
t.Error... |
// a core for sentry capture error
package logging
import (
"errors"
"fmt"
"syscall"
"time"
"github.com/getsentry/sentry-go"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
func sentryLevel(lvl zapcore.Level) sentry.Level {
switch lvl {
case zapcore.DebugLevel:
return sentry.LevelDebug
case zapcore.InfoLe... |
package environment
import (
"fmt"
"log"
"os"
"path/filepath"
"strconv"
"time"
"code.cloudfoundry.org/cf-operator/pkg/bosh/manifest"
"code.cloudfoundry.org/cf-operator/pkg/kube/client/clientset/versioned"
"code.cloudfoundry.org/cf-operator/pkg/kube/operator"
"code.cloudfoundry.org/cf-operator/pkg/kube/util/... |
// Package opengraph implements and parses "The Open Graph Protocol" of web pages.
// See http://ogp.me/ for more information.
package opengraph
import (
"context"
"fmt"
"io"
"net/http"
"net/url"
"path"
"strings"
"golang.org/x/net/html"
)
const (
// HTMLMetaTag is a tag name of <meta>
HTMLMetaTag string = ... |
// Warnings about deprecated operations in Starlark
package warn
import (
"fmt"
"strings"
"github.com/bazelbuild/buildtools/build"
)
func dictionaryConcatenationWarning(f *build.File) []*LinterFinding {
var findings []*LinterFinding
var addWarning = func(expr build.Expr) {
findings = append(findings,
mak... |
package indexer_test
import (
"database/sql"
"fmt"
"io/ioutil"
"os"
"testing"
"time"
"github.com/adlio/schema"
_ "github.com/lib/pq"
dockertest "github.com/ory/dockertest"
"github.com/ory/dockertest/docker"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
abci "github.com/tende... |
package airtable
import (
"context"
"fmt"
"sync"
"github.com/CAVaccineInventory/airtable-export/pipeline/pkg/filter"
"github.com/CAVaccineInventory/airtable-export/pipeline/pkg/types"
beeline "github.com/honeycombio/beeline-go"
)
type tableFetchResults struct {
table types.TableContent
err error
}
// Tabl... |
// Command image-proxy implements proxy fetching images on http:// urls.
//
// It's intended to run behind a https-enabled CDN and can be used to fetch
// images over non-https urls to avoid "mixed content" warnings on a https page.
//
// API accepts mandatory argument "u" which must be a full url to image
// resource.... |
// Code generated by moq; DO NOT EDIT.
// github.com/matryer/moq
package marketplace
import (
"context"
"github.com/operator-framework/operator-lifecycle-manager/pkg/api/apis/operators/v1alpha1"
"github.com/operator-framework/operator-lifecycle-manager/pkg/lib/ownerutil"
"sigs.k8s.io/controller-runtime/pkg/client... |
/*
Copyright 2021 The KubeDiag Authors.
Copyright 2014 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 applic... |
/*
* Copyright 2020-2021 the original author(https://github.com/wj596)
*
* <p>
* 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
*
* U... |
// Copyright 2017 <NAME>.
// Licensed under the MIT license which can be found in the LICENSE file.
package knx
import (
"container/list"
"errors"
"sync"
"time"
"github.com/vapourismo/knx-go/knx/cemi"
"github.com/vapourismo/knx-go/knx/knxnet"
"github.com/vapourismo/knx-go/knx/util"
)
// A RouterConfig determ... |
// Code generated by go-swagger; DO NOT EDIT.
package support
// 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.com/... |
package authentic
import (
"database/sql"
"encoding/base64"
"fmt"
"log"
"time"
"github.com/lib/pq"
)
// Represent roles used for users.
const (
Member = iota
Manager
Supervisor
Admin
createUsersTableSQL = "CREATE TABLE IF NOT EXISTS %v (username varchar, fname varchar DEFAULT '', lname varchar DEFAUL... |
package cmd
import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"github.com/joho/godotenv"
"github.com/mitchellh/go-homedir"
"github.com/screwdriver-cd/sd-local/buildlog"
"github.com/screwdriver-cd/sd-local/config"
"github.com/screwdriver-cd/sd-local/launch"
"github.com/screwdriver-cd... |
package imgsrc
import (
"crypto/rand"
"crypto/sha256"
"encoding/hex"
"encoding/json"
"fmt"
"os"
"path/filepath"
"strconv"
"github.com/docker/docker/api/types"
dockerclient "github.com/docker/docker/client"
"github.com/docker/docker/pkg/jsonmessage"
controlapi "github.com/moby/buildkit/api/services/control... |
// Copyright 2014 <NAME>. 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 law... |
// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose ei... |
package array
import (
"testing"
)
func TestPro(t *testing.T) {
t.Run("888. Fair Candy Swap", func(t *testing.T) {
arrA := []int{1, 1}
arrB := []int{2, 2}
want := []int{1, 2}
got := solution(arrA, arrB)
if !IntSliceEqual(got, want) {
t.Errorf("got: %v, want: %v", got, want)
}
})
t.Run("888. Fair ... |
// Copyright (c) <NAME> <<EMAIL>>. All rights reserved. Use
// of this source code is governed by the MIT license that can be found in
// the LICENSE file.
package httpstat
import (
"bytes"
"encoding/json"
"expvar"
"fmt"
"net/http"
"os"
"strconv"
"strings"
"time"
)
// HTTPStats holds the state of the curren... |
package auditlog
import (
"context"
"encoding/json"
"log"
"strings"
"time"
"github.com/kyma-incubator/compass/components/director/pkg/correlation"
"github.com/kyma-incubator/compass/components/gateway/pkg/auditlog/model"
"github.com/kyma-incubator/compass/components/gateway/pkg/proxy"
"github.com/pkg/errors"... |
// Copyright 2019 DxChain, All rights reserved.
// Use of this source code is governed by an Apache
// License 2.0 that can be found in the LICENSE file
package dpos
import (
"fmt"
"math/big"
"github.com/DxChainNetwork/godx/common"
"github.com/DxChainNetwork/godx/consensus"
"github.com/DxChainNetwork/godx/core/... |
package complex
import (
"context"
"net"
"os"
"path/filepath"
"reflect"
"runtime"
"sync"
"sync/atomic"
"testing"
"time"
"github.com/google/uuid"
"google.golang.org/grpc"
pb3 "github.com/johnsiilver/golib/development/autopool/complex/protov3"
)
const (
hundredThousand = 100000
oneMillion = hundre... |
/*
Copyright 2021 The KubeVela 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, so... |
/*
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to... |
package scenes
import (
"image"
"image/color"
"math"
"time"
"github.com/hajimehoshi/ebiten/v2"
"github.com/hajimehoshi/ebiten/v2/text"
"golang.org/x/exp/shiny/materialdesign/colornames"
"github.com/tessig/gogogopher/mechanics"
"github.com/tessig/gogogopher/music"
"github.com/tessig/gogogopher/resources"
)
... |
package s3cache
import (
"bytes"
"crypto/tls"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"mime"
"net/http"
"os"
"path/filepath"
rootcerts "github.com/hashicorp/go-rootcerts"
"github.com/justinbarrick/hone/pkg/cache"
"github.com/justinbarrick/hone/pkg/logger"
minio "github.com/minio/minio-go"
)
type S3Cache... |
//
// Copyright (C) 2021 IOTech Ltd
//
// SPDX-License-Identifier: Apache-2.0
package dtos
import (
"gopkg.in/yaml.v2"
"testing"
"github.com/edgexfoundry/go-mod-core-contracts/v2/v2"
"github.com/edgexfoundry/go-mod-core-contracts/v2/v2/dtos/common"
"github.com/edgexfoundry/go-mod-core-contracts/v2/v2/models"
... |
package sanity
import (
"fmt"
"math/rand"
"strconv"
"time"
"github.com/gophercloud/gophercloud"
"github.com/gophercloud/gophercloud/openstack/blockstorage/v3/snapshots"
"github.com/gophercloud/gophercloud/openstack/blockstorage/v3/volumes"
"github.com/gophercloud/gophercloud/openstack/compute/v2/servers"
cpo... |
package feeder
import (
"encoding/xml"
"io"
"strings"
"time"
)
type RSS struct {
ID string `xml:"id"`
Version string `xml:"version,attr"`
Title string `xml:"channel>title"`
PubDate string `xml:"channel>pubDate"`
LastBuildDate string `xml:"channel>lastBuildDa... |
package stoserver
import (
"context"
"log"
"time"
"github.com/function61/eventhorizon/pkg/ehevent"
"github.com/function61/eventkit/command"
"github.com/function61/eventkit/eventlog"
"github.com/function61/eventkit/httpcommand"
"github.com/function61/varasto/pkg/scheduler"
"github.com/function61/varasto/pkg/s... |
package generate
import (
"go/token"
"io"
"io/ioutil"
"os"
"path/filepath"
"gopkg.in/yaml.v2"
)
var cfgFilenames = []string{".genqlient.yml", ".genqlient.yaml", "genqlient.yml", "genqlient.yaml"}
// Config represents genqlient's configuration, generally read from
// genqlient.yaml.
//
// Callers must call Val... |
package zk
import (
"context"
"fmt"
"io"
"os"
"os/exec"
"path/filepath"
"testing"
)
type ErrMissingServerConfigField string
func (e ErrMissingServerConfigField) Error() string {
return fmt.Sprintf("zk: missing server config field '%s'", string(e))
}
const (
DefaultServerTickTime = 500
Defa... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: synthesis.proto
package ui
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
type CSSynthesi... |
// 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 (
"fmt"
"github.com/hyperledger/fabric-chaincode-go/shim"
"github.com/hyperledger/fabric-contract-api-go/contractapi"
"github.com/pkg/errors"
coreutils "github.com/timoth-y/chainmetric-core/utils"
"github.com/timoth-y/chainmetric-network/smartcontracts/shared/core"
"github.com/timoth-y/chai... |
package main
import (
"bufio"
"bytes"
"flag"
"fmt"
"log"
"os"
"regexp"
"strconv"
"strings"
"time"
"github.com/araddon/dateparse"
)
/*
cat /var/log/pacman.log | ./date-filter -after="2019-09-16 17:20" -before="2019-09-16 17:22" -regexp="[^\[].+[^\]]" -delimiter=" "
*/
func main() {
var (
err erro... |
// Copyright (c) 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 agre... |
// Copyright 2017 The LUCI Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed... |
package rbac
import (
"net/http"
"net/http/httptest"
"testing"
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert"
"github.com/yodo-io/ycp/pkg/api/test"
"github.com/yodo-io/ycp/pkg/api/v1/auth"
"github.com/yodo-io/ycp/pkg/model"
)
var secret = []byte("secret")
func dummy(c *gin.Context) {
c.JSO... |
// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the http://golang.org/LICENSE file.
// This code is inspired by integration tests present in the package
// code.google.com/p/go.crypto/ssh, with some changes by the tsuru author... |
package github
import (
// Stdlib
"fmt"
"strconv"
"strings"
// Internal
"github.com/salsaflow/salsaflow/action"
"github.com/salsaflow/salsaflow/errs"
"github.com/salsaflow/salsaflow/modules/common"
// Vendor
"github.com/google/go-github/github"
)
type story struct {
issue *github.Issue
tracker *issueT... |
package cpu
import (
"github.com/robherley/go-gameboy/internal/bits"
"github.com/robherley/go-gameboy/pkg/cartridge"
errs "github.com/robherley/go-gameboy/pkg/errors"
)
// https://gbdev.io/pandocs/CPU_Registers_and_Flags.html#registers
type Registers struct {
A byte
F byte
B byte
C byte
D byte
E byte
H byt... |
package jsonapi
import "fmt"
import "sync"
// ExecutableFuture.Children and ExecutableFuture.Relationships must be disjoint sets
type ExecutableFuture struct {
Future
Request *Request
Children map[Relationship]*ExecutableFuture
Input chan *FutureRequest
//Relationships map[Relationship]*ExecutableFuture
Re... |
// 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... |
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"). You may
// not use this file except in compliance with the License. A copy of the
// License is located at
//
// http://aws.amazon.com/apache2.0/
//
// or in the "license" fil... |
package proc_test
import (
"testing"
"errors"
"github.com/brimsec/zq/proc"
"github.com/brimsec/zq/zng/resolver"
"github.com/stretchr/testify/require"
)
// Data sets for tests
const fooOnly = `
#0:record[foo:string]
0:[foo1;]
0:[foo2;]
0:[foo3;]
`
const barOnly = `
#1:record[bar:string]
1:[bar1;]
1:[bar2;]
1:... |
package kv
import (
"errors"
"fmt"
"strconv"
"strings"
"sync"
"time"
)
const (
// 默认是占用1MB内存
defaultMaxSize int64 = 1024 * 1024
// 默认key的大小
defaultMaxKeyLen int64 = 64
// 默认value的大小
defaultMaxValueLen int64 = 1024
// 默认缓存时长
defaultExpire time.Duration = 0
)
var (
// ErrKeyInValid is the key len gt def... |
// Copyright (c) 2021 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... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package cognitosync
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/private/protocol"
"github.com/aws/aws-sdk-go-v2/private/protocol/restjson"
)
// A request ... |
package client
import (
"encoding/json"
"github.com/golang/glog"
"github.com/hootsuite/sens8/check"
"github.com/hootsuite/sens8/util"
"github.com/hootsuite/sensu-go/sensu/transport"
"github.com/hootsuite/sensu-go/sensu/transport/rabbitmq"
"io/ioutil"
"time"
)
const (
connectionTimeout = 5 * time.Second
keep... |
// Copyright (c) 2004-present Facebook All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated (@generated) by entc, DO NOT EDIT.
package ent
import (
"context"
"errors"
"strconv"
"github.com/facebookincubator/ent/dialect/sql... |
package dingtalk
import (
"fmt"
"strings"
v1 "k8s.io/api/core/v1"
)
const (
MARKDOWN_MSG_TYPE = "markdown"
MARKDOWN_TEMPLATE = "Level: %s \n\nKind: %s \n\nNamespace: %s \n\nName: %s \n\nReason: %s \n\nTimestamp: %s \n\nMessage: %s"
MARKDOWN_LINK_TEMPLATE = "[%s](%s)"
MARKDOWN_TEXT_BOLD = "**%s**... |
package pagehome
import (
"bytes"
"errors"
"html/template"
"io"
"net/http"
"os"
"path/filepath"
"sort"
"strings"
"time"
"github.com/dekoch/gouniversal/module/backup/backupitem"
"github.com/dekoch/gouniversal/module/backup/global"
"github.com/dekoch/gouniversal/module/backup/lang"
"github.com/dekoch/goun... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc v3.17.0
// source: vas.proto
package vas
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const... |
// Copyright (c) 2016 by <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... |
// Copyright 2019 <NAME>. All rights reserved.
package main
import (
"bytes"
"fmt"
"io"
"strings"
"text/template"
)
// This file contains the templates for the code generation
// These are the template for each table
// CreateQbModel creates the models template
func CreateQbModel(m Model, wr io.Writer) {
temp... |
package disfun
import (
"errors"
"unicode/utf8"
)
// String wraps a regular string with a small structure that provides more
// efficient indexing by code point index, as opposed to byte index.
// Scanning incrementally forwards or backwards is O(1) per index operation
// (although not as fast a range clause going ... |
// *** WARNING: this file was generated by the Kulado Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package apimanagement
import (
"github.com/pkg/errors"
"github.com/kulado/kulado/sdk/go/kulado"
)
// Manages an API Management Property.
//
// >... |
// Copyright 2022 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... |
// Code generated by go-swagger; DO NOT EDIT.
package v1dns
// 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.com/go... |
// Package stencil helps to download and refresh protobuf descriptors from remote server
// and provides helper functions to get protobuf schema descriptors and can parse the messages
// dynamically.
package stencil
import (
"encoding/json"
"io"
"time"
"github.com/pkg/errors"
"go.uber.org/multierr"
"google.gola... |
// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License... |
package genericclioptions
import (
"os"
"github.com/spf13/cobra"
"github.com/openshift/odo/pkg/config"
"github.com/openshift/odo/pkg/envinfo"
"github.com/openshift/odo/pkg/kclient"
"github.com/openshift/odo/pkg/log"
"github.com/openshift/odo/pkg/occlient"
"github.com/openshift/odo/pkg/odo/util"
"github.com/... |
package types
import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
)
func TestIsTokenTypeValid(t *testing.T) {
assert.True(t, IsTokenTypeValid(UtxoBased))
assert.True(t, IsTokenTypeValid(AccountBased))
assert.True(t, IsTokenTypeValid(AccountSharedBased))
assert.False(t, IsTokenTypeValid(0))
asse... |
package subscriber
import (
"expvar"
"fmt"
"log"
"net/url"
"os"
"strings"
"sync"
"github.com/influxdb/influxdb"
"github.com/influxdb/influxdb/cluster"
"github.com/influxdb/influxdb/meta"
)
// Statistics for the Subscriber service.
const (
statPointsWritten = "pointsWritten"
statWriteFailures = "writeFail... |
/*
* Copyright 2021 CloudWeGo 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 agre... |
// Copyright 2016 <NAME>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package list
// NewRing returns a new ring.
// Iff no values are given, a nil element is returned.
func NewRing(vals ...interface{}) (ring *Element) {
if len(vals) > ... |
/*
* 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 ... |
/*
Package interval implements custom predicates to match routes
only during some period of time.
Package includes three predicates: Between, Before and After.
All predicates can be created using the date represented as:
- a string in RFC3339 format (see https://golang.org/pkg/time/#pkg-constants)
- a string in RFC333... |
// Copyright 2020 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
/*
Copyright (c) 2020 Red Hat, 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 writing, software... |
package graph
import (
"encoding/json"
"io/ioutil"
"strings"
"sync"
"github.com/Unknwon/com"
"github.com/k0kubun/pp"
"github.com/pkg/errors"
tf "github.com/rai-project/tensorflow"
)
var Categories = map[string]string{
"Const": "Constant",
"Conv2D": "Laye... |
// Copyright 2022 <NAME>.
// All rights reserved.
package lib
// Intcode runs Intcode instructions.
type Intcode struct {
Mem map[int64]int64
In, Out chan int64
InFunc func() int64 // used instead of In if non-nil
OutFunc func(int64) // used instead of Out if non-nil
done chan bool
halt bool
}
// N... |
/*
* Copyright 2018 the original author or 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 applica... |
/*
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 use this fi... |
// handler is a package handling API requests for managing TfJobs.
// The primary purpose of handler is implementing the functionality needed by the TfJobs dashboard.
package handler
import (
"fmt"
"net/http"
restful "github.com/emicklei/go-restful"
"github.com/tensorflow/k8s/dashboard/backend/client"
"github.co... |
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Command css appends CSS styles to content/static/stylesheet.css.
// It reads from the CSS file at
// https://github.com/sindresorhus/github-markdown-css/blob... |
package internal
import (
"errors"
"fmt"
"log"
"net/http"
"strings"
"sync"
"sync/atomic"
"time"
)
const (
MetricFormat = "wavefront"
HistogramFormat = "histogram"
TraceFormat = "trace"
SpanLogsFormat = "spanLogs"
EventFormat = "event"
)
type LineHandler struct {
// keep these two fields as ... |
package graphqlbackend
import (
"context"
"encoding/json"
"errors"
"fmt"
"strconv"
graphql "github.com/graph-gophers/graphql-go"
"github.com/sourcegraph/jsonx"
"github.com/sourcegraph/sourcegraph/cmd/frontend/db"
"github.com/sourcegraph/sourcegraph/pkg/actor"
"github.com/sourcegraph/sourcegraph/pkg/conf"
)
... |
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package v1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// This is a compile-time assertion to ensure that this... |
package tickcandler_test
import (
"fmt"
"io/ioutil"
"testing"
"time"
"github.com/alpacahq/marketstore/v4/utils/functions"
"github.com/alpacahq/marketstore/v4/catalog"
"github.com/alpacahq/marketstore/v4/utils/test"
"github.com/stretchr/testify/assert"
"github.com/alpacahq/marketstore/v4/contrib/candler/ti... |
// Copyright (c) 2022 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 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 2021 The Clusternet Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
/*
Copyright 2020 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, ... |
// SPDX-License-Identifier: Apache-2.0
// Copyright Authors of Cilium
package bgpv1
import (
"errors"
"fmt"
"math"
"net"
"strconv"
"strings"
)
const (
BGPVRouterAnnoPrefix = "cilium.io/bgp-virtual-router."
)
// ErrNotVRouterAnno is an error returned from parseAnnotation() when the
// the casted string is not... |
// android-notify-lite provides a lightweight replacement for the Java-based
// android-notifier-desktop remote notificationator thingy. To be of any use
// at all, it should be installed on a system with libnotify/notify-send, and
// requires an Android phone with the Remote Notifier application installed
package main... |
package main
import (
"fmt"
"strconv"
sdk "gitee.com/openeuler/go-gitee/gitee"
"github.com/sirupsen/logrus"
"github.com/opensourceways/robot-gitee-repo-watcher/community"
"github.com/opensourceways/robot-gitee-repo-watcher/models"
)
func (bot *robot) createRepo(
expectRepo expectRepoInfo,
log *logrus.Entry,... |
/*
Copyright (c) 2020 GMO GlobalSign, Inc.
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 the License at
https://opensource.org/licenses/MIT
Unless required by applicable law or agreed to in writing, software
distributed under... |
// Encrypts (& maybe compresses) line-based (\n) data (usually "ehevent" serialization format) into a LogData item
package eheventencryption
import (
"bytes"
"compress/flate"
"crypto/rand"
"errors"
"fmt"
"io"
"io/ioutil"
"golang.org/x/crypto/chacha20poly1305"
)
// format is: <reserved 0x0> <compression metho... |
package inputkafka
import (
"context"
"os"
"os/signal"
"sync"
"syscall"
"github.com/Shopify/sarama"
"github.com/tsaikd/gogstash/config"
"github.com/tsaikd/gogstash/config/goglog"
"github.com/tsaikd/gogstash/config/logevent"
)
// ModuleName is the name used in config file
const ModuleName = "kafka"
// Input... |
package job_test
import (
"context"
"net/url"
"testing"
"github.com/smartcontractkit/chainlink/core/logger"
"github.com/smartcontractkit/chainlink/core/services/job"
"github.com/smartcontractkit/chainlink/core/services/pipeline"
"github.com/shopspring/decimal"
"github.com/smartcontractkit/chainlink/core/int... |
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"sync"
"time"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/common/log"
"gopkg.in/alecthomas/kingpin.v2"
)
// Exporter collects Nexmo stats and exports them... |
// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/bjxujiang/gf.
package gconv_test
import (
"testing"
"github.com/bjxu... |
package sashay
import (
"bytes"
"regexp"
"strconv"
"strings"
)
// Operation is the definition for an endpoint (method and path).
// See https://swagger.io/specification/#operationObject
type Operation struct {
// Method is a string like GET, POST, etc.
Method string
// Path is the path for the endpoint. Parame... |
package nape
import (
"fmt"
"net/http"
"net/url"
"github.com/gorilla/mux"
)
func (r *EndpointRegistrationWithMux) add(f func(m *mux.Route) *mux.Route) {
r.muxroutes = append(r.muxroutes, f)
}
// Route returns the *mux.Route that has been registered to this endpoint, if possible.
func (r *EndpointRegistrationWi... |
/*
* Copyright (C) 2022 IBM, 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... |
// Copyright (c) 2020 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.