text stringlengths 3.08k 10.4k |
|---|
// Package provides a driver for the digital accelerometer ADXL345
//
// Datasheet EN: http://www.analog.com/media/en/technical-documentation/data-sheets/ADXL345.pdf
// Datasheet JP: http://www.analog.com/media/jp/technical-documentation/data-sheets/ADXL345_jp.pdf
package adxl345
import (
"machine"
)
type Range uin... |
package main
import (
"fmt"
"github.com/bmizerany/pat"
"log"
"net/http"
"io/ioutil"
"regexp"
"strings"
"time"
)
type Configuration struct {
Title string
Url string
Articles string
Templates string
Host string
Frontpage string
Editable bool
MinimumTextLength int
}... |
// Copyright 2018 <NAME> -- <EMAIL>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
package keeper
import (
"encoding/binary"
"github.com/bandprotocol/bandchain/chain/x/oracle"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/tharamalai/meichain/x/meicdp/types"
)
type Keeper struct {
storeKey ... |
// Copyright © 2019 Talend
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in wri... |
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
// Package resolvers implements GraphQL resolvers to incoming API requests.
package resolvers
import (
"crypto/sha256"
"fantom-api-graphql/internal/repository"
"fantom-api-graphql/internal/types"
"fmt"
"github.com/ethereum/go-ethereum/common"
"html"
"regexp"
)
const (
// scValidationMinSourceCodeLength is the... |
/*
* Copyright 2020 zhaoyunxing.
*
* 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 The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... |
/*
Copyright 2018 Turbine Labs, 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, softw... |
package workerpools
import (
"context"
"sync"
"time"
"github.com/liwei1dao/lego/utils/container"
)
func newSys(options Options) (sys *WorkerPool, err error) {
sys = &WorkerPool{
taskQueue: make(chan *Task, 1),
maxWorkers: options.MaxWorkers,
readyWorkers: make(chan chan *Task, options.DefWrokers),
... |
// Command goquote reads from a string standard input and prints it out as a quoted string for use in Go source code.
//
// goquote accepts an optional format specifier as its first and only argument.
// Formats are described in the command's usage text (-h or -help).
//
// This tool is primarily intended for use in ed... |
package main
import (
"errors"
"io"
"runtime"
"strconv"
"github.com/spf13/pflag"
)
type Options struct {
Binary bool
Check bool
Jobs int
Dereference bool
NativePath bool
Recursive bool
Tag bool
Zero bool
CrLf bool
IgnoreMissing bool
Quiet bool
St... |
// Copyright (c) The Thanos Authors.
// Licensed under the Apache License 2.0.
package targets
import (
"context"
"sort"
"github.com/pkg/errors"
"github.com/prometheus/prometheus/storage"
"github.com/thanos-io/thanos/pkg/store/storepb"
"github.com/thanos-io/thanos/pkg/targets/targetspb"
)
var _ UnaryClient = ... |
// Code generated by entc, DO NOT EDIT.
package instance
import (
"time"
"github.com/google/uuid"
)
const (
// Label holds the string label denoting the instance type in the database.
Label = "instance"
// FieldID holds the string denoting the id field in the database.
FieldID = "oid"
// FieldCreatedAt holds... |
// Copyright (C) 2016 <NAME> <<EMAIL>>
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to ... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: greeter.proto
package go_micro_srv_greeter
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// Thi... |
package client
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net"
"net/http"
"os"
"os/exec"
"path/filepath"
"testing"
tuf "github.com/theupdateframework/go-tuf"
client "github.com/theupdateframework/go-tuf/client"
"github.com/theupdateframework/go-tuf/data"
"github.com/theupdateframework/go-tuf/pk... |
package header
import (
"errors"
"fmt"
"net/http"
"net/url"
"strings"
"unicode"
)
// Constants for DispositionArgs.
const (
TypeInline = "inline"
TypeAttachment = "attachment"
)
// DispositionArgs are arguments for SetContentDisposition().
type DispositionArgs struct {
Type string // disposition-typ... |
package ts
import (
"bytes"
"encoding/binary"
"fmt"
"io"
"github.com/djthorpe/gopi/v3"
)
// Ref: https://www.etsi.org/deliver/etsi_ts/101200_101299/101211/01.11.01_60/ts_101211v011101p.pdf
// Ref: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.03.01_60/en_300468v010301p.pdf
//////////////////////... |
package volume
import (
"bufio"
"fmt"
"io"
"os"
"path"
"strconv"
"strings"
"time"
"github.com/puppetlabs/wash/munge"
"github.com/puppetlabs/wash/plugin"
)
// StatCmd returns the command required to stat all the files in a directory up to maxdepth.
func StatCmd(path string, maxdepth int) []string {
// List... |
package provisioner
import (
"strings"
"github.com/pkg/errors"
"github.com/smallstep/certificates/authority"
"github.com/smallstep/certificates/authority/provisioner"
"github.com/smallstep/cli/errs"
"github.com/smallstep/cli/ui"
"github.com/urfave/cli"
)
func removeCommand() cli.Command {
return cli.Command{... |
// Package v036 is used for legacy migration scripts. Actual migration scripts
// for v036 have been removed, but the v039->v042 migration script still
// references types from this file, so we're keeping it for now.
// DONTCOVER
package v036
import (
"fmt"
"strings"
"github.com/puneetsingh166/tm-load-test/codec"
... |
package main
import (
"encoding/json"
"flag"
"os"
"time"
"github.com/asukakenji/151a48667a3852a43a2028024ffc102e/cmd/backtier/lib"
"github.com/asukakenji/151a48667a3852a43a2028024ffc102e/common"
"github.com/asukakenji/151a48667a3852a43a2028024ffc102e/taskqueue"
"github.com/asukakenji/151a48667a3852a43a2028024... |
package command
import (
"fmt"
"sort"
"strings"
"github.com/MakeNowJust/heredoc"
"github.com/cli/cli/utils"
"github.com/google/shlex"
"github.com/spf13/cobra"
)
func init() {
RootCmd.AddCommand(aliasCmd)
aliasCmd.AddCommand(aliasSetCmd)
aliasCmd.AddCommand(aliasListCmd)
aliasCmd.AddCommand(aliasDeleteCmd)... |
package acapy
import (
"fmt"
"strconv"
)
type Connection struct {
Accept string `json:"accept"` // auto / manual
Alias string `json:"alias"`
ConnectionID string `json:"connection_id"`
CreatedAt string `json:"created_at"`
ErrorMsg string `json:"error_msg"`
... |
package domain
import (
"context"
"sync"
eh "github.com/looplab/eventhorizon"
"github.com/superchalupa/sailfish/src/looplab/aggregatestore"
)
const AggregateType = eh.AggregateType("RedfishResource")
func init() {
RegisterInitFN(RegisterRRA)
}
func (a *RedfishResourceAggregate) HandleCommand(ctx context.Conte... |
package server
import (
"fmt"
pluginStorage "github.com/brokercap/Bifrost/plugin/storage"
"github.com/brokercap/Bifrost/server/filequeue"
pluginDriver "github.com/brokercap/Bifrost/plugin/driver"
"log"
"sync"
)
type ToServerStatus string
type ToServer struct {
sync.RWMutex
Key *stri... |
/*
* This file is part of the KubeVirt 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 required by applicable la... |
/*
Copyright IBM Corp. 2016 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 agreed to in wri... |
// Copyright 2017 VMware, 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 backup
import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"path/filepath"
)
var totalFile, totalCopiedFile int
// var modifyLog, modLogErr os.Open
// var totalLog, totalLogErr os.Open
// CopyFile Copies file source to destination dest.
func CopyFile(source string, dest string) (err error) {
... |
// Package rest implements a simple REST wrapper
//
// All methods are safe for concurrent calling.
package rest
import (
"bytes"
"encoding/json"
"io"
"io/ioutil"
"net/http"
"sync"
"github.com/ncw/rclone/fs"
"github.com/pkg/errors"
)
// Client contains the info to sustain the API
type Client struct {
mu ... |
/*
* Copyright (c) 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... |
package nrgorm
import (
"fmt"
"strings"
newrelic "github.com/newrelic/go-agent"
"gorm.io/gorm"
)
const (
txnGormKey = "newrelicTransaction"
startTimeKey = "newrelicStartTime"
)
// SetTxnToGorm sets transaction to gorm settings, returns cloned DB
func SetTxnToGorm(txn newrelic.Transaction, db *gorm.DB) *gorm... |
package backend
import (
"encoding/json"
"errors"
"gopkg.in/yaml.v2"
"log"
"os"
"strings"
"github.com/RedTimeDB/RedTimeProxy/util"
)
const (
//Version Tag
Version = "2.5.5"
)
var (
ErrEmptyCircles = errors.New("circles cannot be empty")
ErrEmptyBackends = errors.New("backends cannot be e... |
package session
import (
"context"
"fmt"
"io"
"sync"
"github.com/progrium/qmux/golang/codec"
"github.com/progrium/qmux/golang/mux"
)
const (
minPacketLength = 9
maxPacketLength = 1 << 31
// channelMaxPacket contains the maximum number of bytes that will be
// sent in a single packet. As per RFC 4253, sect... |
// Copyright 2014 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, ... |
package test
import (
"fmt"
"os"
"testing"
"github.com/avinetworks/sdk/go/clients"
"github.com/avinetworks/sdk/go/models"
"github.com/avinetworks/sdk/go/session"
)
var cuuid string
var uuid string
var profuuid string
func TestCreateVirtualservice(t *testing.T) {
aviClient, err := clients.NewAviClient(os.Gete... |
package service
import (
"context"
"database/sql"
"errors"
"fmt"
"time"
"getsturdy.com/api/pkg/codebase"
"getsturdy.com/api/pkg/events"
"getsturdy.com/api/pkg/github"
"getsturdy.com/api/pkg/users"
"golang.org/x/oauth2"
gh "github.com/google/go-github/v39/github"
"github.com/google/uuid"
"go.uber.org/zap... |
package mount
import (
"io"
"path"
"strings"
"sync"
"github.com/hack-pad/hackpadfs"
)
var (
_ interface {
hackpadfs.FS
hackpadfs.MountFS
hackpadfs.RenameFS
} = &FS{}
)
// FS is mesh of several file systems mounted at different paths.
// Mount a file system with AddMount().
//
// For ease of use, call t... |
package name
import (
"fmt"
"io/ioutil"
"path/filepath"
"regexp"
"strconv"
"sync"
"sync/atomic"
"time"
"vxfs/libs"
"vxfs/libs/glog"
)
import . "vxfs/dao/name"
const (
MaxNameSize = 8 * 1024 * 1024 * 1024
)
type NameGroup struct {
DataDir string
dataFreeMB uint64
counters *NameCounters
current *N... |
package scalers
import (
"context"
"database/sql"
"fmt"
"strconv"
// PostreSQL drive required for this scaler
_ "github.com/lib/pq"
"k8s.io/api/autoscaling/v2beta2"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/metrics/pkg/apis... |
package validation
import (
"errors"
"fmt"
"k8s.io/apimachinery/pkg/util/validation/field"
"github.com/openshift/installer/pkg/types"
"github.com/openshift/installer/pkg/types/openstack"
)
// ValidatePlatform checks that the specified platform is valid.
func ValidatePlatform(p *openstack.Platform, n *types.Net... |
/*
Copyright NetFoundry, 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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
... |
// Copyright 2016 - 2022 The excelize 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 excelize providing a set of functions that allow you to write to and
// read from XLAM / XLSM / XLSX / XLTM / XLTX files. Supports rea... |
// Package node defines simple data structures to represent p2p node identities.
package node
import (
"errors"
"fmt"
"net"
"net/url"
"regexp"
"strconv"
"github.com/btcsuite/btcutil/base58"
"github.com/libonomy/libonomy-p2p/p2p/p2pcrypto"
)
// Scheme sets the URI scheme for the node string format.
const Sche... |
package docker
import (
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/gruntwork-io/terratest/modules/logger"
"github.com/gruntwork-io/terratest/modules/shell"
"github.com/gruntwork-io/terratest/modules/testing"
"github.com/hashicorp/go-multierror"
"github.com/stretchr/testify/require"
)
// BuildOpt... |
package settings
import (
"fmt"
"io/ioutil"
"os"
"os/user"
"time"
"strconv"
"github.com/astaxie/beego/config"
"../capi"
)
const (
CONF_NAME string = "app.conf"
APP_NAME string = "coffeebreak"
APP_VERSION = "1.3.4"
permMode os.FileMode = 0666
)
// Singleton
var instantiated *S... |
package tabledata
import (
"context"
"core/app"
"time"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
)
const (
//RowDeleteLimit number of rows to be deleted at once
RowDeleteLimit int = 20
)
//Row defines a new Row object.
//Only used for ... |
package hyperv
import (
"bufio"
"errors"
"fmt"
"math"
"os"
"path"
"regexp"
"strings"
"time"
"github.com/nanovms/ops/lepton"
"github.com/olekukonko/tablewriter"
)
// CreateInstance uses a vhdx image to launch a virtual machine in hyper-v
func (p *Provider) CreateInstance(ctx *lepton.Context) error {
c := ... |
package vendorconsent
import (
"encoding/binary"
"errors"
"fmt"
"time"
"github.com/aclrys/go-gdpr/consentconstants"
)
var (
errInvalidVendorListVersion = errors.New("the consent string encoded a VendorListVersion of 0, but this value must be greater than or equal to 1")
)
// Parse the metadata from the consen... |
// Package latlon implements handling of geodetic coordinates as latitude and longitude.
package latlon
import (
"fmt"
"math"
"strconv"
"strings"
"unicode/utf8"
)
// Latitude represents a latitudinal value in degrees.
type Latitude float64
// Longitude represents a longitudinal value in degrees.
type Longitude ... |
/*
*
* k6 - a next-generation load testing tool
* Copyright (C) 2016 Load Impact
*
* 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 Software Foundation, either version 3 of the
* License, or (at your o... |
/*
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 is ... |
package k8s
import (
"fmt"
"path/filepath"
"github.com/okteto/okteto/pkg/k8s/namespaces"
"github.com/okteto/okteto/pkg/k8s/secrets"
"github.com/okteto/okteto/pkg/model"
appsv1 "k8s.io/api/apps/v1"
apiv1 "k8s.io/api/core/v1"
resource "k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis... |
// Copyright (c) 2017-2020 The Elastos Foundation
// Use of this source code is governed by an MIT
// license that can be found in the LICENSE file.
//
package utils
import "fmt"
// change holds a change and it's rollback function.
type change struct {
// execute is the function makes state change.
execute func()
... |
// Copyright 2020, OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... |
// Copyright 2019 Liquidata, 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... |
package main
import (
"encoding/json"
"fmt"
"net/http"
"github.com/graphql-go/graphql"
"github.com/levigross/grequests"
)
type pokemonResponse struct {
Forms []struct {
URL string `json:"url"`
Name string `json:"name"`
} `json:"forms"`
Abilities []struct {
Slot int `json:"slot"`
IsHidden bool `... |
package character
import (
"fmt"
"strconv"
"strings"
"github.com/ironarachne/world/pkg/measurement"
"github.com/ironarachne/world/pkg/random"
"github.com/ironarachne/world/pkg/words"
)
// Description is a description object of a character
type Description struct {
Age string
Culture ... |
package handler
import (
"bytes"
"encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"path"
"strings"
"time"
"github.com/aofei/air"
"github.com/goproxy/goproxy"
"github.com/goproxy/goproxy.cn/base"
"github.com/tidwall/gjson"
)
func init() {
base.Air.BATCH(
getHeadMethods,
"/stats/summary... |
// Copyright 2015 The Cockroach 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 ag... |
package options
import (
"net"
"time"
"github.com/spf13/pflag"
)
type KubeRouterConfig struct {
AdvertiseClusterIp bool
AdvertiseExternalIp bool
BGPGracefulRestart bool
CleanupConfig bool
ClusterAsn uint
ClusterCIDR string
ConfigSyncPeriod time.Duration
EnableiBGP bool... |
// Copyright 2019 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package db
import (
"context"
"database/sql"
"code.gitea.io/gitea/modules/setting"
"xorm.io/builder"
"xorm.io/xorm/schemas"
)
// DefaultContext is t... |
// Copyright Fuzamei Corp. 2018 All Rights Reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package types
import (
"encoding/json"
"reflect"
log "github.com/33cn/chain33/common/log/log15"
"github.com/33cn/chain33/types"
)
var tokenlog = log.New("... |
package logging
import (
"fmt"
"os"
"sort"
"strings"
"go.uber.org/zap/zapcore"
)
type levelSpec struct {
key string
level zapcore.Level
trace bool
ordering int
}
func (l *levelSpec) String() string {
return fmt.Sprintf("key %q (level %s, trace %t, order %d)", l.key, l.level, l.trace, l.ordering... |
// Copyright 2018 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 bitfield
import (
"bytes"
"fmt"
"io/ioutil"
"testing"
)
type myUint8 uint8
type test1 struct { // 28 bits
foo uint16 `bitfield:",fob"`
Bar in... |
package main
/*
usage examples:
$ ffmpeg -y -v quiet -i "$B".??[!ast] -map 0:v -filter:v "crop=486:82:79:357" -f rawvideo -pix_fmt yuv444p - | go run "$T"/extract_timings_from_animated_hardsubs.go -bgYuvRange __85739c78a4 -fgYuvRanges 9f__7d__7d -frameSize 119556 "$B".srt
$ ffmpeg -y -v quiet -ss 00:35:12 -i "$B"... |
// Package common provides encryption methods common across encryption types
package common
import (
"bytes"
"crypto/hmac"
"encoding/binary"
"encoding/hex"
"errors"
"fmt"
"gopkg.in/jcmturner/gokrb5.v2/crypto/etype"
)
const (
s2kParamsZero = 4294967296
)
// ZeroPad pads bytes with zeros to nearest multiple of... |
// Copyright (C) 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... |
/*
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 aranGoDriver_test
import (
"log"
"testing"
"flag"
"github.com/RockKeeper/aranGoDriver"
"github.com/RockKeeper/aranGoDriver/models"
"github.com/RockKeeper/aranGoDriver/sliceTricks"
)
var (
testDbHost = flag.String("dbhost", "", "run database integration test")
testUsername = flag.String("dbusername... |
// 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 applicabl... |
package day16
import (
"fmt"
"strconv"
)
//packet types
const (
typeSum = iota
typeProduct = iota
typeMin = iota
typeMax = iota
typeLiteral = iota
typeGreaterThan = iota
typeLessThan = iota
typeEqualTo = iota
)
const (
lengthType15 = 0
)
type Bits struct {
bits ... |
package main
import (
"context"
"io/ioutil"
"os"
"path/filepath"
"github.com/minio/minio-go/v6"
"github.com/rs/zerolog"
"github.com/spf13/pflag"
"github.com/zerok/imagefunnel/pkg/profile"
"github.com/zerok/imagefunnel/pkg/resizer"
"gopkg.in/yaml.v2"
)
func main() {
var logger zerolog.Logger
var profilePa... |
package terminal
import (
"encoding/base64"
"errors"
"fmt"
"mime"
"strings"
)
const (
ELEMENT_ITERM_IMAGE = iota
ELEMENT_IMAGE = iota
ELEMENT_LINK = iota
ELEMENT_BK = iota
)
type element struct {
url string
alt string
contentType string
content string
height ... |
// Copyright 2018 mixtool 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... |
// Copyright (c) 2021 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package main
import (
"context"
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"sync"
"time"
"github.com/decred/dcrd/chaincfg/chainhash"
"github.com/decred/dcrd/d... |
package zerologger
import (
"fmt"
"path"
"path/filepath"
"strings"
"goa.design/goa/v3/codegen"
"goa.design/goa/v3/eval"
"goa.design/goa/v3/expr"
)
type fileToModify struct {
file *codegen.File
path string
serviceName string
isMain bool
}
// Register the plugin Generator functions.
func... |
/* SPDX-License-Identifier: MIT
* Copyright © 2019-2020 <NAME> <<EMAIL>>.
* All Rights Reserved. */
package main
import "strings"
type locale struct {
resilience string
aboutInfoTitle string
aboutInfoText string
errorTitle string
denierUpdat... |
//
// SPDX-License-Identifier: BSD-3-Clause
//
package swordfish
import (
"encoding/json"
"reflect"
"github.com/stmcginnis/gofish/common"
)
// IOAccessPattern is used to specify an IO access pattern.
type IOAccessPattern string
const (
// ReadWriteIOAccessPattern shall indicate a Uniform distribution of
// re... |
package server
import (
"context"
"errors"
"net/http"
"github.com/quan-to/chevron/internal/keymagic"
"github.com/quan-to/chevron/pkg/models/HKP"
"github.com/gorilla/mux"
"github.com/quan-to/slog"
)
/// HKP Server based on https://tools.ietf.org/html/draft-shaw-openpgp-hkp-00
// HKP Lookup godoc
// @id hkp-l... |
// untested sections: 2
package matchers
import (
"errors"
"fmt"
"reflect"
"github.com/onsi/gomega/format"
)
type ContainElementMatcher struct {
Element interface{}
Result []interface{}
}
func (matcher *ContainElementMatcher) Match(actual interface{}) (success bool, err error) {
if !isArrayOrSlice(actual) ... |
// Copyright (c) 2022 The Parca 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 ... |
/*
* 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 obta... |
package rule
import (
"github.com/lawrencewoodman/dlit"
"github.com/vlifesystems/rhkit/description"
"github.com/vlifesystems/rhkit/internal/testhelpers"
"reflect"
"testing"
)
func TestGTFFString(t *testing.T) {
fieldA := "income"
fieldB := "cost"
want := "income > cost"
r := NewGTFF(fieldA, fieldB)
got := r... |
// 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 ... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package ec2
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type ExportTransitGatewayRoutesInput struct {
_ struct{} `type:"structure"`
// Checks whether you have the required permissio... |
package service
import (
"context"
"encoding/json"
"errors"
"fmt"
"github.com/fatih/color"
"github.com/spf13/cast"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"jim_service/config"
"jim_service/internal/dispatch"
"jim_service/internal/jim_proto/proto_build"
"time"
)
type GatewayService s... |
// Copyright 2019 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... |
/*
Copyright NetFoundry, 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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
... |
// Copyright (c) 2022 Trim21 <<EMAIL>>
//
// SPDX-License-Identifier: AGPL-3.0-only
//
// 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 Software Foundation, version 3.
//
// This program is distributed in t... |
package metasearch
import (
"context"
"encoding/json"
"fmt"
"log"
"github.com/dennwc/metasearch/autocomplete"
"github.com/dennwc/metasearch/base"
"github.com/dennwc/metasearch/providers"
"github.com/dennwc/metasearch/search"
)
var (
_ search.Searcher = (*Engine)(nil)
_ autocomplete.Service = (*Engine)... |
package main
import (
"context"
"encoding/json"
"fmt"
"net/http"
"reflect"
"strings"
"time"
"github.com/dgraph-io/ristretto"
"github.com/filecoin-project/evergreen-dealer/common"
"github.com/filecoin-project/evergreen-dealer/webapi/types"
filaddr "github.com/filecoin-project/go-address"
"github.com/jackc/... |
// Copyright 2021 <NAME>
//
// https://github.com/atc0005/go-teams-notify
//
// Licensed under the MIT License. See LICENSE file in the project root for
// full license information.
package goteamsnotify
import (
"bytes"
"encoding/json"
"errors"
"strings"
)
// Newline patterns stripped out of text content sent t... |
// Copyright (c) 2022 Target Brands, Inc. All rights reserved.
//
// Use of this source code is governed by the LICENSE file in this repository.
package redis
import (
"fmt"
"testing"
"time"
"github.com/alicebob/miniredis/v2"
"github.com/go-vela/types/library"
"github.com/go-vela/types/pipeline"
)
// The foll... |
package main
import (
"image_sdk/src/sdk"
"encoding/json"
"fmt"
)
func main() {
/*
* Services currently support North China-Beijing 1 (cn-north-1),
* North China-Beijing 4 (cn-north-4), CN-Hong Kong (ap-southeast-1)
*/
sdk.InitRegion("cn-north-1")
ak := "*******" // your AppKey
sk := "*******" // your ... |
package util
import (
"context"
"fmt"
"log"
"math/rand"
"time"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"sigs.k8s.io/yaml"
)
const (
jobYaml... |
package sql // import "gopkg.in/src-d/go-mysql-server.v0/sql"
import (
"fmt"
"gopkg.in/src-d/go-errors.v1"
)
var (
// ErrInvalidType is thrown when there is an unexpected type at some part of
// the execution tree.
ErrInvalidType = errors.NewKind("invalid type: %s")
// ErrTableAlreadyExists is thrown when som... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.