text stringlengths 3.08k 10.4k |
|---|
package calculation
import (
"encoding/json"
"fmt"
"github.com/xichen2020/eventdb/document/field"
"github.com/xichen2020/eventdb/generated/proto/servicepb"
)
// Op represents a calculation operator.
type Op int
// A list of supported calculation operators.
const (
UnknownOp Op = iota
Count
Sum
Avg
Min
Max... |
package federationtesting
import (
"context"
"fmt"
"net/http"
"net/http/httptest"
"path"
"strings"
"testing"
"time"
"github.com/jensneuse/abstractlogger"
"github.com/stretchr/testify/assert"
"github.com/jensneuse/graphql-go-tools/pkg/graphql/federationtesting/accounts"
"github.com/jensneuse/graphql-go-to... |
// Copyright 2015 <NAME> and The Caddy 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... |
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or ag... |
/*
http://www.apache.org/licenses/LICENSE-2.0.txt
Copyright 2016 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required ... |
/*
Package json defines encoding and decoding methods for Find, Info and Render
responses.
*/
package json
import (
"encoding/json"
"math"
"sort"
"strings"
"github.com/bookingcom/carbonapi/pkg/types"
"github.com/pkg/errors"
)
type jsonMatch struct {
AllowChildren int `json:"allowChildren"`
Contex... |
package saaspass
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"os"
"time"
sl "github.com/dghubble/sling"
)
const baseURL = "https://www.saaspass.com/sd/rest/applications/"
type Config struct {
APIkey, APIpass string
}
var (
conf *Config
)
type AuthToken struct {
Token string `json:"token"`
}
type A... |
package goson
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"os"
"reflect"
"strings"
)
const (
key_generic_array_item = "*:"
)
type Node struct {
Type string
Value interface{}
Key string
}
type MapNode map[string]*Node
type MapString map[string]interface{}
type ArrMapNode []MapNode
func (a ... |
package pinterest
import (
"bytes"
"crypto/rand"
"encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"strings"
log "github.com/sirupsen/logrus"
common "github.com/tb0hdan/torpedo_common"
)
type PinterestInterestItem struct {
ID string `json:"id"`
Name string `json:"name"`
}
type Pinterest... |
package mysql
// from /usr/include/mysql/mysql_com.h
const (
CLIENT_LONG_PASSWORD = 1 /* new more secure passwords */
CLIENT_FOUND_ROWS = 2 /* Found instead of affected rows */
CLIENT_LONG_FLAG = 4 /* Get all column flags */
CLIENT_CONNECT_WITH_DB = 8 /* One can specify db... |
// Copyright (c) <NAME> 2017. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// Package main provides the OpenFaaS Classic Watchdog. The Classic Watchdog is a HTTP
// shim for serverless functions providing health-checking, graceful shutdowns,... |
package packaging
import "encoding/xml"
// XStyleSheetU fix XML ns for XStyleSheet
type XStyleSheetU struct {
XMLName xml.Name `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main styleSheet"`
XmlnsMc string `xml:"mc,attr"`
McIgnorable string `xml:"Ignorable,attr"`
XmlnsX14ac string `xml... |
package generation
import (
"fmt"
"go/ast"
"io/ioutil"
"log"
"os"
"path/filepath"
"strings"
"gopkg.in/yaml.v2"
)
type RuleGenerator struct {
defaults *AlertDefaults
alertRules []AlertRule
}
const (
PrometheusAlertManagerFormat = iota
PrometheusOperatorFormat
)
type OutputOptions struct {
AlertRuleFo... |
// Copyright (c) 2016-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 ... |
// 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 ... |
package main
import (
"bufio"
"flag"
"fmt"
"net"
"net/http"
"strconv"
"strings"
"time"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/common/log"
)
const (
defaultMetricsInterval = 30
defaultAddr = ":9298"
def... |
package logging
import (
"fmt"
"os"
"time"
"github.com/mexisme/go-config/settings"
"github.com/evalphobia/logrus_sentry"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
)
const (
configItemAppName = "application.name"
configItemAppEnv = "application.environment"
configItemFormat = "loggi... |
// Copyright 2021 The Chromium OS 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 a11y provides functions to assist with interacting with accessibility
// features and settings.
package a11y
import (
"context"
"time"
... |
package keys
import (
"crypto/rand"
"crypto/sha512"
"encoding/base64"
"encoding/hex"
"fmt"
"github.com/go-playground/validator"
tzcrypt "github.com/goat-systems/go-tezos/v3/internal/crypto"
"github.com/pkg/errors"
"github.com/tyler-smith/go-bip39"
"golang.org/x/crypto/nacl/secretbox"
"golang.org/x/crypto/p... |
package base
import (
"container/heap"
"gonum.org/v1/gonum/stat"
"sort"
)
// SparseIdSet manages the map between dense IDs and sparse IDs.
type SparseIdSet struct {
DenseIds map[int]int
SparseIds []int
}
// NotId represents an ID not existed in the data set.
const NotId = -1
// MakeSparseIdSet makes a SparseI... |
package config
import "fmt"
// Usage prints the command-line usage text
func Usage() {
fmt.Println("Ethr supports three modes. Usage of each mode is described below:")
fmt.Println("\nCommon Parameters")
fmt.Println("================================================================================")
printFlagUsage... |
// Copyright © 2018 NAME HERE <EMAIL ADDRESS>
//
// 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 ... |
package weechat
import (
"bytes"
"encoding/binary"
"reflect"
"strconv"
"time"
)
const (
typeChar = "chr"
typeInt = "int"
typeLong = "lon"
typeString = "str"
typeBytes = "buf"
typePtr = "ptr"
typeTime = "tim"
typeMap = "htb"
typeHdata = "hda"
typeInfo = "inf"
typeInfos = "inl"
type... |
package main
import (
"fmt"
"text/template"
// "html/template"
"os"
"regexp"
// "github.com/mitchellh/colorstring"
"golang.org/x/sys/windows"
)
type ColorMap map[string]string
var g_ColorValues = map[string]string{
// Default foreground/background colors
"default": "39",
"_default_": "49",
// Foregro... |
package tokens
// Token is a lexical token in a file
type Token int
const (
// Invalid token
Invalid Token = iota
// EOF is the end of the file
EOF
// Identifier is an identifier (e.g. SomeIdent)
Identifier
// Symbol is a string of special symbols typecially used as operators (e.g. +, -, !=, etc.)
Symbol
... |
package ssi
import (
"encoding/base64"
"fmt"
"sync"
"github.com/findy-network/findy-agent/agent/managed"
"github.com/findy-network/findy-agent/agent/service"
"github.com/findy-network/findy-wrapper-go/did"
"github.com/findy-network/findy-wrapper-go/dto"
"github.com/findy-network/findy-wrapper-go/pairwise"
"g... |
// Code generated by entc, DO NOT EDIT.
package ent
import (
"fmt"
"strings"
"time"
"entgo.io/ent/dialect/sql"
"github.com/tmc/moderncrud/ent/widget"
"github.com/tmc/moderncrud/ent/widgettype"
)
// Widget is the model entity for the Widget schema.
type Widget struct {
config `json:"-"`
// ID of the ent.
ID... |
package main
import (
"flag"
"io"
"io/ioutil"
"log"
"net/http"
"os"
"path/filepath"
"strconv"
"github.com/bogem/id3v2"
"github.com/mmcdole/gofeed"
"gopkg.in/cheggaaa/pb.v1"
)
func main() {
// Parse CLI args
downloadDirectory := flag.String("dir", "musicforprogramming", "Directory into which the tracks w... |
package markdown
import (
"bytes"
"fmt"
"github.com/moutend/backlog/internal/backlog"
"github.com/ericaro/frontmatter"
"github.com/moutend/go-backlog/pkg/types"
)
type IssueFrontMatter struct {
Summary string `fm:"summary"`
Project string `fm:"project"`
Issue string `fm:"issue"`
Parent str... |
// 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... |
package lambda
import (
"encoding/json"
"errors"
"reflect"
"time"
"github.com/dynamicgo/mq"
"github.com/dynamicgo/slf4go"
"github.com/dynamicgo/xerrors"
)
// Errors .
var (
ErrParam = errors.New("invalid param")
)
// Lambda .
type Lambda interface {
Handle(f interface{}) Lambda
Do(sink mq.Producer)
}
typ... |
package base
import (
"github.com/relex/gotils/promexporter/promext"
"github.com/relex/gotils/promexporter/promreg"
"github.com/relex/slog-agent/util"
)
// LogProcessCounter tracks metrics for log transform, serialization and chunk making
//
// LogProcessCounter must be accessed through pointer. It's not concurren... |
// 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/gogf/gf.
package gins
import (
"fmt"
"github.com/gogf/gf/errors/gerro... |
/*
Copyright 2020 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
package v1
const (
// BuildAnnotation is an annotation that identifies a Pod as being for a Build
BuildAnnotation = "openshift.io/build.name"
// BuildConfigAnnotation is an annotation that identifies the BuildConfig that a Build was created from
BuildConfigAnnotation = "openshift.io/build-config.name"
// BuildC... |
/*
Copyright 2021 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... |
package processor
import (
"io/ioutil"
"os"
"path/filepath"
"reflect"
"testing"
"github.com/Jeffail/benthos/v3/lib/log"
"github.com/Jeffail/benthos/v3/lib/message"
"github.com/Jeffail/benthos/v3/lib/metrics"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestGrokAllParts(... |
/*
Copyright 2017 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dis... |
package cron
import (
"bufio"
"context"
"fmt"
"io"
"os"
"os/exec"
"strings"
"sync"
"syscall"
"time"
"github.com/aptible/supercronic/crontab"
"github.com/aptible/supercronic/prometheus_metrics"
"github.com/prometheus/client_golang/prometheus"
"github.com/sirupsen/logrus"
)
var (
READ_BUFFER_SIZE = 64 *... |
package main
import (
"bytes"
"context"
"encoding/base64"
"fmt"
"testing"
"github.com/kyma-project/test-infra/development/tools/cmd/secretspopulator/automock"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
"google.g... |
package kics
import (
"context"
"encoding/json"
"io"
"github.com/Checkmarx/kics/pkg/engine"
"github.com/Checkmarx/kics/pkg/engine/provider"
"github.com/Checkmarx/kics/pkg/model"
"github.com/Checkmarx/kics/pkg/parser"
"github.com/Checkmarx/kics/pkg/resolver"
"github.com/getsentry/sentry-go"
"github.com/googl... |
package tcp
import (
"fmt"
"math/rand"
"sync"
"time"
"github.com/terassyi/gotcp/pkg/logger"
"github.com/terassyi/gotcp/pkg/packet/tcp"
"github.com/terassyi/gotcp/pkg/proto/port"
)
type controlBlock struct {
peer *port.Peer
state state
snd *SendSequence
rcv *ReceiveSequence
retrans chan Addre... |
/*
Copyright 2018 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 checker
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License 2.0.
import (
"context"
"fmt"
"strings"
machinev1beta1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1"
maoclient "github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned"
"githu... |
// 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.
package integration
import (
"context"
"fmt"
"io/ioutil"
"net/http"
"net/http/httptest"
"strings"
"testing"
"time"
"github.com/alicebob/miniredis/v2"... |
/*
Copyright 2020 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
package graph
import (
"container/ring"
"fmt"
"strconv"
socketio "github.com/googollee/go-socket.io"
"github.com/iotaledger/hive.go/syncutils"
"github.com/gohornet/hornet/packages/model/hornet"
"github.com/gohornet/hornet/packages/model/milestone_index"
"github.com/gohornet/hornet/packages/model/tangle"
"g... |
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package tasks
import (
"context"
"log"
"os"
"path/filepath"
"github.com/golang/protobuf/jsonpb"
"github.com/maruel/subcommands"
build_api "go.chr... |
package cmd
import (
"context"
"fmt"
"io/ioutil"
"os"
"os/signal"
"path/filepath"
"runtime"
"runtime/pprof"
"sync"
"syscall"
"time"
"github.com/choria-io/go-protocol/protocol"
"github.com/choria-io/go-choria/build"
"github.com/choria-io/go-choria/choria"
"github.com/choria-io/go-config"
log "github.c... |
package proxy
import (
"errors"
"net"
"strconv"
"strings"
"github.com/nextdns/nextdns/internal/dnsmessage"
"github.com/nextdns/nextdns/resolver"
"github.com/nextdns/nextdns/resolver/query"
)
func replyServFail(q query.Query, buf []byte) (n int) {
b := dnsmessage.NewBuilder(buf[:0], dnsmessage.Header{
ID: ... |
// Copyright (c) 2016, 2018, 2021, 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 main
import (
"fmt"
"sync"
"sync/atomic"
"syscall"
"time"
)
const QueueSize = 100 // maximum number of blocks to queue
type Disk struct {
fd int
h Header
queue chan *Block
flushcond *sync.Cond
}
/* disk partitions; keep in sync with []partname */
const (
PartError = iota
PartSuper
PartLabe... |
package rss
import (
"bytes"
"encoding/xml"
"fmt"
"sort"
"strings"
"time"
)
func parseRSS2(data []byte, read *db) (*Feed, error) {
warnings := false
feed := rss2_0Feed{}
p := xml.NewDecoder(bytes.NewReader(data))
p.CharsetReader = charsetReader
err := p.Decode(&feed)
if err != nil {
return nil, err
}
... |
package inkrecognizer
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regen... |
// Code generated by gotdgen, DO NOT EDIT.
package tg
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"github.com/gotd/td/bin"
"github.com/gotd/td/tdp"
"github.com/gotd/td/tgerr"
)
// No-op definition for keeping imports.
var (
_ = bin.Buffer{}
_ = context.Background()
_ = fmt... |
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package help implements the ``go help'' command.
package help
import (
"bufio"
"bytes"
"fmt"
"io"
"os"
"strings"
"text/template"
"unicode"
"unicode... |
// Copyright 2016 The G3N 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 graphic
import (
"github.com/g3n/engine/core"
"github.com/g3n/engine/geometry"
"github.com/g3n/engine/gls"
"github.com/g3n/engine/material"
"gith... |
/*
Copyright 2015 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 logistics
import "github.com/tim-online/go-exactonline/edm"
type Items []Item
type Item struct {
ID edm.GUID `json:"ID"`
Barcode edm.String `json:"Barcode"`
Class01 edm.String `json:"Class_01"`
Class02 edm.String `json:"Class_... |
package servers
import (
"time"
"github.com/nttcom/eclcloud"
"github.com/nttcom/eclcloud/pagination"
)
// Server represents dedicated hypervisor server information.
type Server struct {
ID string `json:"id"`
Name string `json:"name"`
ImageRef string `js... |
package p2p
import (
"bytes"
"container/heap"
"crypto/rand"
"net"
"time"
"xlibp2p/discover"
)
const (
// This is the amount of time spent waiting in between
// redialing a certain node.
dialHistoryExpiration = 30 * time.Second
// Discovery lookups are throttled and can only run
// once every few seconds.
... |
// Copyright 2021 the u-root 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 spimock provides a fake SPI flash part for unit testing. This
// simulates an MX66L51235F.
package spimock
import (
"fmt"
"io"
"github.com/u-... |
package commentapi
import (
"net/http"
"time"
"github.com/lbryio/commentron/validator"
"github.com/lbryio/lbry.go/v2/extras/api"
"github.com/lbryio/lbry.go/v2/extras/errors"
v "github.com/lbryio/ozzo-validation"
)
// BlockArgs Arguments to block identities from commenting for both publisher and moderators
type... |
package att
import (
"encoding/binary"
"github.com/photostorm/ble"
)
// A DB is a contiguous range of attributes.
type DB struct {
attrs []*attr
base uint16 // handle for first attr in attrs
}
const (
tooSmall = -1
tooLarge = -2
)
// idx returns the idx into attrs corresponding to attr a.
// If h is too sma... |
// Copyright 2020 <NAME>. All rights reserved.
// Use of this source code is governed by a MIT license
// that can be found in the LICENSE file.
package cmd
import (
"fmt"
"os"
"strconv"
"strings"
"text/tabwriter"
"github.com/go-redis/redis/v7"
"github.com/hibiken/asynq/internal/rdb"
"github.com/spf13/cobra"... |
/*
Copyright 2020 SAP SE.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You 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
distrib... |
package main
import (
"math/rand"
"os"
"strings"
"time"
"github.com/DarthSim/overmind/launch"
"github.com/DarthSim/overmind/start"
"github.com/joho/godotenv"
"gopkg.in/urfave/cli.v1"
)
const version = "1.1.1"
func setupStartCmd() cli.Command {
c := start.Handler{}
return cli.Command{
Name: "start",... |
// Copyright 2017 TiKV 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 agr... |
// Copyright Microsoft <<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, publish, di... |
// Copyright 2015 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 quota
import (
"container/list"
"reflect"
"k8s.io/apimachinery/pkg/api/equality"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/apis/core"
)
// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ClusterResourceQuota mir... |
package mobyparser
import (
"bytes"
"fmt"
"regexp"
"strconv"
"strings"
"github.com/moby/buildkit/frontend/dockerfile/parser"
"github.com/sirupsen/logrus"
"github.com/updatecli/updatecli/pkg/core/result"
"github.com/updatecli/updatecli/pkg/plugins/resources/dockerfile/types"
)
type MobyParser struct {
Instr... |
package api
import (
"context"
"encoding/base64"
"fmt"
"net/http"
"strings"
"time"
glob "github.com/bmatcuk/doublestar/v4"
"github.com/gorilla/mux"
"zotregistry.io/zot/pkg/api/config"
"zotregistry.io/zot/pkg/api/constants"
"zotregistry.io/zot/pkg/common"
"zotregistry.io/zot/pkg/log"
)
type contextKey int... |
// 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 ... |
// +build go1.5,deprecated
package main
import (
"bytes"
"go/format"
"io"
"os"
"path/filepath"
"sort"
"strings"
"text/template"
"github.com/kzmake/nifcloud-sdk-go/private/model/api"
)
type pkg struct {
oldAPI *api.API
newAPI *api.API
shapes map[string]*shapentry
operations map[string]*opent... |
// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package quotedprintable
import (
"fmt"
"strings"
"testing"
)
func ExampleEncodeHeader() {
fmt.Println(StdHeaderEncoder.EncodeHeader("Cofee"))
fmt.Println... |
// Copyright (c) 2016 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge... |
// Package callr implements the CALLR API, using JSON-RPC 2.0. See https://www.callr.com/ and https://www.callr.com/docs/.
//
// Usage
//
// package main
//
// import (
// "fmt"
// "os"
//
// callr "github.com/THECALLR/sdk-go"
// )
//
// func main() {
// // use Basic Auth (not re... |
package main
import (
"context"
"fmt"
"image/color"
"github.com/paulmach/orb"
"github.com/paulmach/osm"
"github.com/paulmach/osm/osmapi"
"github.com/paulmach/osm/osmgeojson"
"github.com/tdewolff/canvas"
"github.com/tdewolff/canvas/rasterizer"
)
var dejaVuSerif *canvas.FontFamily
func main() {
dejaVuSerif ... |
package chow
import (
"github.com/OpenWhiteBox/primitives/encoding"
"github.com/OpenWhiteBox/primitives/matrix"
"github.com/OpenWhiteBox/primitives/number"
)
// findMatrix finds an invertible matrix in a basis.
func findMatrix(basis []matrix.Row) matrix.Matrix {
im := matrix.NewIncrementalMatrix(64)
for _, row :... |
// Copyright 2016 The Upspin 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 dropbox
import (
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"path"
"testing"
"time"
"golang.org/x/oauth2"
"upspin.io/cloud/storage"
"upspin.i... |
package thorchain
import (
"strconv"
"strings"
"github.com/blang/semver"
"gitlab.com/thorchain/thornode/common"
"gitlab.com/thorchain/thornode/common/cosmos"
"gitlab.com/thorchain/thornode/constants"
"gitlab.com/thorchain/thornode/x/thorchain/keeper"
)
// SwapQv58 is going to manage the swaps queue
type Swap... |
// Copyright 2020 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 wr... |
/*
* Copyright 2019, <NAME>.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
package main
import (
"fmt"
"net/http"
"time"
)
func startHTTPServer() {
http.HandleFunc("/", handleHome)
http... |
// 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... |
package resolver // import "gopkg.in/src-d/proteus.v1/resolver"
import (
"fmt"
"gopkg.in/src-d/proteus.v1/report"
"gopkg.in/src-d/proteus.v1/scanner"
)
// Resolver has the responsibility of checking the types of all the packages
// scanned globally and exclude struct fields with types not included in any
// of th... |
package ec2
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/service/s3/s3manager"
humanize "github.com/dustin/go-humaniz... |
package pipeline
import (
"time"
"github.com/chilons/transporter/events"
)
// A Pipeline is a the end to end description of a transporter data flow.
// including the source, sink, and all the transformers along the way
type Pipeline struct {
source *Node
emitter events.Emitter
metricsTicker *time.T... |
package v1beta1
import (
"fmt"
"reflect"
"regexp"
"strings"
"github.com/kubeflow/kfserving/pkg/constants"
"github.com/kubeflow/kfserving/pkg/utils"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// Known error messages
const (
MinReplicasShouldBeLessThanMaxError = "MinReplicas canno... |
package clock
import (
"sync/atomic"
"time"
"unsafe"
"github.com/antlabs/stl/list"
syncutil "github.com/lthibault/util/sync"
)
const (
nearShift = 8
nearSize = 1 << nearShift
levelShift = 6
levelSize = 1 << levelShift
nearMask = nearSize - 1
levelMask = levelSize - 1
)
type Clock struct {
// Must... |
package server
import (
"bytes"
"html/template"
"io/ioutil"
"net/http"
"os"
"path/filepath"
"time"
assetfs "github.com/elazarl/go-bindata-assetfs"
"github.com/fsnotify/fsnotify"
"github.com/gorilla/mux"
"github.com/gorilla/websocket"
"github.com/shurcooL/github_flavored_markdown"
"github.com/sirupsen/log... |
package main
import (
"encoding/json"
"io"
"log"
"os/exec"
"path/filepath"
"strings"
"github.com/mitchellh/osext"
"github.com/mitchellh/packer/packer"
"github.com/mitchellh/packer/packer/plugin"
)
// EnvConfig is the global EnvironmentConfig we use to initialize the CLI.
var EnvConfig packer.EnvironmentConf... |
package nfs
// NFSProcedure is the valid RPC calls for the nfs service.
type NFSProcedure uint32
// NfsProcedure Codes
const (
NFSProcedureNull NFSProcedure = iota
NFSProcedureGetAttr
NFSProcedureSetAttr
NFSProcedureLookup
NFSProcedureAccess
NFSProcedureReadlink
NFSProcedureRead
NFSProcedureWrite
NFSProcedur... |
package wiki
import (
"bytes"
"io/ioutil"
"os"
"reflect"
"runtime"
"testing"
log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly/internal/git"
"gitlab.com/gitlab-org/gitaly/internal/git/gittest"
"gitlab.com/gitlab-org/gitaly/internal/git/hooks"
"gitlab.com/... |
/*
Copyright 2021 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distribu... |
package twitter
import (
"fmt"
"github.com/garyburd/redigo/redis"
"github.com/gin-gonic/gin"
"github.com/kurrik/oauth1a"
"github.com/kurrik/twittergo"
"github.com/soveran/redisurl"
"net/http"
"net/url"
"os"
"time"
)
type Twitter struct{
}
var (
TWITTER_COSUMER_KEY = os.Getenv("TWITTER_CONSU... |
package criteria
import (
"fmt"
"github.com/viant/toolbox"
"strings"
)
const (
undefined int = iota
eof
illegal
whitespaces
operand
operator
logicalOperator
assertlyExprMatcher
quoted
jsonObject
jsonArray
grouping
)
var matchers = map[int]toolbox.Matcher{
eof: toolbox.EOFMatcher{},
whitespac... |
package cmd
import (
"fmt"
"git.jd.com/jd-blockchain/explorer/dgraph_helper"
"git.jd.com/jd-blockchain/explorer/event"
"git.jd.com/jd-blockchain/explorer/meta_indexer/links"
"git.jd.com/jd-blockchain/explorer/worker"
"github.com/davecgh/go-spew/spew"
"github.com/mkideal/cli"
"github.com/ssor/zlog"
"io/ioutil"... |
// 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
// Code generated by protoc-gen-go.
// source: runtime/internal/stream_chunk.proto
// DO NOT EDIT!
/*
Package internal is a generated protocol buffer package.
It is generated from these files:
runtime/internal/stream_chunk.proto
It has these top-level messages:
StreamError
*/
package internal
import proto "github... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.