text stringlengths 3.08k 10.4k |
|---|
package tgstore
import (
"bytes"
"context"
"crypto/cipher"
"errors"
"io"
"io/ioutil"
"os"
"sync"
"golang.org/x/crypto/chacha20poly1305"
"golang.org/x/crypto/poly1305"
)
const (
// objectChunkSize is the chunk size of object.
objectChunkSize = 64 << 10
// objectEncryptedChunkSize is the encrypted chunk ... |
package server
import (
"context"
"encoding/json"
"net/http"
"net/url"
chef "github.com/go-chef/chef"
jsonpb "github.com/golang/protobuf/jsonpb"
structpb "github.com/golang/protobuf/ptypes/struct"
"github.com/pkg/errors"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
secrets "github.com/ch... |
/*
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 unde... |
/* Copyright 2017 WALLIX
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 main
import (
"context"
"erc4337-mev-searcher-bot/abis"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/eth... |
package s3
import (
"errors"
"fmt"
"os"
"path/filepath"
"strings"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/service/s3/s3manager"
"github.com/project-flogo/core/activity"
... |
/*
Copyright 2019 Baidu, 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... |
// Copyright 2014 The Serviced 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 ticker
import (
"context"
"errors"
"math/rand"
"time"
)
// Functions stubbed out during testing.
var (
// magnitude returns a uniformly random number in the range [-1.0, 1.0).
magnitude = func() float64 { return 1.0 - 2.0*rand.Float64() }
)
var (
// errInvalidSettings is returned from (*Ticker).Start(... |
package pipeline
import (
"fmt"
// "log"
"strings"
"github.com/pa-m/sklearn/base"
"github.com/pa-m/sklearn/preprocessing"
"gonum.org/v1/gonum/mat"
)
// NamedStep represents a pipeline named Step
// Step must be Predicter (last step) or Transformer
type NamedStep struct {
Name string
base.Fiter
}
// Pipeli... |
package main
import (
"fmt"
"io"
"log"
"net/http"
"os"
"time"
"iv-go/router"
"iv-go/models"
"github.com/gin-gonic/gin"
)
// Login for login binding and validation
type Login struct {
User string `form:"user" json:"user" binding:"required"`
Password string `form:"password" json:"password" binding:"re... |
package reconcile
import (
"context"
"sync"
"github.com/solo-io/go-utils/contextutils"
"github.com/solo-io/skv2/pkg/ezkube"
"github.com/solo-io/skv2/pkg/multicluster"
"github.com/solo-io/skv2/pkg/reconcile"
"go.uber.org/zap"
"k8s.io/apimachinery/pkg/util/sets"
"sigs.k8s.io/controller-runtime/pkg/manager"
"s... |
/*
* @Descripttion: Redcon server, it implents redis protocol and support complicate.
* @version:
* @Author: cm.d
* @Date: 2021-11-13 01:06:51
* @LastEditors: cm.d
* @LastEditTime: 2021-12-17 14:16:29
*/
package resp
import (
"errors"
"reflect"
"strconv"
"strings"
"time"
"github.com/AlfheimDB/config"
"g... |
package ahocorasick
import (
"bufio"
"encoding/hex"
"os"
"strings"
)
type state struct {
id int64
value byte
parent *state
trans map[byte]*state
dict int64
failLink *state
dictLink *state
pattern int64
}
// TrieBuilder is used to build Tries.
type TrieBuilder struct {
states []*s... |
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package notificationhub
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access informati... |
/*
Copyright © 2021 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 or agreed to in writi... |
// Copyright 2016-2021 terraform-provider-sakuracloud 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 b... |
package internal
import (
"bytes"
"encoding/json"
"errors"
"io/ioutil"
"log"
"math"
"net/http"
"strings"
"time"
"github.com/spf13/viper"
"github.com/xuri/excelize/v2"
_ "cer/config"
"cer/modals"
"fmt"
)
var (
Info = Teal
Warn = Yellow
Fata = Red
Suggestion = Green
Bug = R... |
package blot
import "fmt"
type Style struct {
Color string
Dashed bool
}
type Line struct {
X, Y []float64
Style Style
Label string
}
type Blot struct {
Lines []Line
Width, Height float64
ScaleX, ScaleY float64
OffsetX, OffsetY float64
Margin float64
}
func NewBlot() *Blot {
... |
package errors
import (
stderrors "errors"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
type GRPCCoder interface {
GRPCCode() codes.Code
}
func (e Error) GRPCCode() codes.Code {
switch e {
// GRPC Errors
case ErrOK:
return codes.OK
case ErrCanceled:
return codes.Canceled
case ErrUnk... |
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cloudwatch
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Resource Type definition for Metric Stream
func LookupMetricStream... |
package editor
import (
"fmt"
"time"
"github.com/jonpalmisc/atto/internal/support"
"github.com/nsf/termbox-go"
)
const (
// BarForeground is the foreground color of title/status bars.
BarForeground = termbox.ColorBlack
// BarBackground is the background color of title/status bars.
BarBackground = termbox.C... |
package config
import (
"os"
"path/filepath"
log "github.com/sirupsen/logrus"
"crypto/tls"
"crypto/x509"
"io/ioutil"
"github.com/BurntSushi/toml"
)
// API : Rest API config
type API struct {
IP string `toml:"ip"`
Port uint16 `toml:"port"`
User string `toml:"user"`
Token string `toml:"token"`
}
// ... |
package main
/*
#define _GNU_SOURCE
#include <errno.h>
#include <sched.h>
#include <stdio.h>
#include <string.h>
#include <sys/mount.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
__attribute__((constructor)) void init(void) {
pid_t pid;
int ret;
if (geteuid() != 0) {
fprintf(stderr, "Need ... |
package buyte
import (
"context"
"math"
"os"
"strconv"
)
type ChargeStore interface {
CreateCharge(context.Context, *CreateChargeParams) (*Charge, error)
GetCharge(context.Context, string) (*Charge, error)
}
// Represents the Request Body data sent in POST /charges request.
type CreateChargeInput struct {
Sou... |
// Code generated by go-swagger; DO NOT EDIT.
package n_a_s
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/netapp/trident/storage... |
// +build integrationtests
package integrationtests
import (
"fmt"
"testing"
"github.com/launchdarkly/ld-relay/v6/integrationtests/docker"
"github.com/launchdarkly/ld-relay/v6/internal/core"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func testDatabaseIntegrations(t *testing.... |
package types
import (
"bytes"
"encoding/hex"
"fmt"
"io"
"github.com/bytom/encoding/blockchain"
"github.com/bytom/errors"
"github.com/bytom/protocol/bc"
)
const serRequired = 0x7 // Bit mask accepted serialization flag.
// Tx holds a transaction along with its hash.
type Tx struct {
TxData
*bc.Tx `json:"-"... |
// Code generated by go-swagger; DO NOT EDIT.
package extensions
// 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.c... |
package librecursebuster
import (
"bytes"
"crypto/rand"
"fmt"
"io/ioutil"
"math"
"net/http"
"net/url"
"path"
"strings"
"github.com/PuerkitoBio/goquery"
)
//RandString will return a UUID
func RandString() string {
b := make([]byte, 16)
_, err := rand.Read(b)
if err != nil {
panic(err)
}
return fmt.S... |
package main
import (
"log"
"math/rand"
"net/http"
"strconv"
"time"
"github.com/gorilla/websocket"
)
// Different operation types
const (
MessageOperation = 1
ClientsOperation = 2
ClientOperation = 50
CandidateOperation = 100
CandidateOfferOperation = 101
Candida... |
package roomsync
import (
"context"
"strings"
"time"
"github.com/byuoitav/common/db"
"github.com/byuoitav/common/log"
"github.com/byuoitav/common/nerr"
sd "github.com/byuoitav/common/state/statedefinition"
"github.com/byuoitav/common/structs"
"github.com/byuoitav/shipwright/state/cache"
"github.com/fatih/co... |
//go:build go1.18
// +build go1.18
// 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 cod... |
// +build !testmdq
/* lMDQ is a MDQ server that caches metadata locally so it's local clients can lookup
pre-checked metadata and not depend on a working connection to a remote MDQ server.
It uses SQLite as it's datastore and allows lookup by either entityID or Location.
The latter is used by WAYF for it... |
package cache
import (
"errors"
"fmt"
"time"
"github.com/Jeffail/benthos/v3/internal/docs"
"github.com/Jeffail/benthos/v3/lib/log"
"github.com/Jeffail/benthos/v3/lib/metrics"
"github.com/Jeffail/benthos/v3/lib/types"
"github.com/dgraph-io/ristretto"
)
//-------------------------------------------------------... |
package log
import (
"os"
"time"
cconf "github.com/pip-services3-go/pip-services3-commons-go/config"
cref "github.com/pip-services3-go/pip-services3-commons-go/refer"
cinfo "github.com/pip-services3-go/pip-services3-components-go/info"
"github.com/pip-services3-go/pip-services3-components-go/log"
clog "github.... |
package plugins
import (
"encoding/json"
"errors"
"github.com/coschain/contentos-go/app/blocklog"
"github.com/coschain/contentos-go/prototype"
"github.com/jinzhu/gorm"
"time"
)
type NftRecord struct {
ID uint64 `gorm:"primary_key;auto_increment"`
BlockHeight uint64 `gorm:"index"`
BlockTime time.Time
... |
// Copyright (c) 2019 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 gomigrator
import (
"fmt"
"strconv"
"time"
"github.com/juju/errors"
"github.com/siddontang/go-mysql/client"
"github.com/siddontang/go-mysql/mysql"
"github.com/siddontang/go-mysql/replication"
"github.com/siddontang/go-mysql/schema"
"github.com/siddontang/go/log"
)
const (
replaceSql string = "REPLA... |
package main
import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"os/signal"
"runtime"
"time"
"timed-notify/src/Arguments"
"timed-notify/src/Config"
"timed-notify/src/Management"
// External Packages
gosxnotifier "github.com/deckarep/gosx-notifier"
"github.com/fatih/color"
"github.com/sevlyar/go-daemon"
)
// Pri... |
package bencode
import (
"bufio"
"bytes"
"errors"
"io"
"reflect"
"sort"
"strconv"
"strings"
)
// An Encoder writes bencoded values to an output stream.
type Encoder struct {
b *bufio.Writer
}
// NewEncoder returns a new encoder that writes to w.
func NewEncoder(w io.Writer) *Encoder {
b := bufio.NewWriter(... |
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: models/linux/l3/arp.proto
package linux_l3 // import "github.com/ligato/vpp-agent/api/models/linux/l3"
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
// Reference imports to ... |
package greflect_test
import (
"go-example/greflect"
"reflect"
"testing"
)
type Tag struct {
s string `test:"B"`
n int64 `test:"A"`
}
func (t Tag) Test1() string {
return "Test1" + t.s
}
func (t *Tag) Test2() string {
return "Test2" + t.s
}
type DstBindTag struct {
A string `Bind:"A"`
B int64 ... |
package jira
import (
"io/ioutil"
"strconv"
"time"
"github.com/hashicorp/go-retryablehttp"
"github.com/andygrunwald/go-jira"
"github.com/pkg/errors"
pslog "github.com/psmarcin/jira-versioner/pkg/log"
)
// Jira has all necessary details for interacting with Jira service
type Jira struct {
Client *jira.Cli... |
/*
* 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 i... |
// Package tailer contains machinery for tailing a specific file, or a set of
// files matching a pattern.
package tailer
import (
"path/filepath"
"sync"
"time"
"github.com/honeycombio/honeycomb-kubernetes-agent/handlers"
"github.com/hpcloud/tail"
"github.com/sirupsen/logrus"
"k8s.io/api/core/v1"
)
// Taile... |
package main
//Version: 7.0
// This is a test chaincode that can create user name with balance and also have the ability to move balance
import (
"fmt"
"strconv"
"github.com/hyperledger/fabric/core/chaincode/shim"
pb "github.com/hyperledger/fabric/protos/peer"
)
var logger = shim.NewLogger("cafe2")
// TestChain... |
package scanner
import (
"os"
"fmt"
"io/ioutil"
"lame.go"
"errors"
)
type Scanner struct{
_lame *lame.Lame
paramlist []string
}
func (this *Scanner) Init() bool {
this._lame = new(lame.Lame)
return this._lame.GetProcess()
}
func (this *Scanner) ShowVersion() {
if nil == this._lame {
return
}
ver := th... |
// Copyright 2019 Infin IT Pty Ltd. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package misc
import (
"github.com/dreading/gospecfunc/integrals/internal/toms"
)
// Abramowitz computes the Abramowitz function
// ∫ 0 to ∞ of t^order e... |
package pickett
import (
"fmt"
"strings"
"time"
"github.com/igneous-systems/pickett/io"
)
// goBuilder has a dependecy between the object to build and the image
// that is used to build it. This implements the builder interface.
type goBuilder struct {
runIn node
repository string
tagname string
pkg... |
// Extract text from a pdf file.
// and get the github.com url.
// Future: Ability to get recommendation based from list of papers.
// author: aadit
package main
import (
"flag"
"fmt"
"io"
"log"
"net/http"
"net/url"
"os"
"os/exec"
"strings"
"time"
"code.sajari.com/docconv"
"github.com/cheggaaa/pb"
"mvda... |
/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License ... |
package common
import (
"errors"
"github.com/newkedison/go-utils/internal/types"
)
const (
InvalidValue Number = -1
)
type NamedData struct {
id string
name string
value Number
dataRange Range
warning Alarm
fault Alarm
sigModified SignalD... |
package main
import (
"errors"
"fmt"
"net/http"
"runtime"
"github.com/omegaup/quark/common"
"github.com/omegaup/quark/runner"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/shirou/gopsutil/disk"
"github.com/shirou/gopsutil/load"
"gith... |
package asyncui
import (
"context"
"fmt"
"github.com/kyma-incubator/hydroform/parallel-install/pkg/components"
"github.com/kyma-incubator/hydroform/parallel-install/pkg/deployment"
"github.com/kyma-project/cli/pkg/step"
)
// End-user messages
const (
deployPrerequisitesPhaseMsg string = "Deploying pre-requis... |
package storage
import (
"bytes"
"errors"
"math/rand"
"sync"
)
const (
defaultCachSize int = 2048
tableHeight = 12
tableOffset = 4
magicBytes = 0xcafebabe
)
const (
nKV = iota
nKey
nVal
nHeight
nNext
)
var (
errKeyNotFound = errors.New("key not found")
errMissingKey = errors... |
// SPDX-FileCopyrightText: 2020-present Open Networking Foundation <<EMAIL>>
//
// SPDX-License-Identifier: Apache-2.0
package closedloop
import (
"context"
"fmt"
"github.com/onosproject/sdcore-adapter/pkg/gnmiclient"
"github.com/onosproject/onos-lib-go/pkg/logging"
"github.com/onosproject/sdcore-adapter/pkg/me... |
package cmd
import (
"log"
"os"
"runtime"
"text/template"
"time"
hashivers "github.com/hashicorp/go-version"
"github.com/spf13/cobra"
"github.com/pydio/cells-client/v2/common"
)
var cellsVersionTpl = `{{.PackageLabel}}
Version: {{.Version}}
Built: {{.BuildTime}}
Git commit: {{.GitCommit}}
OS/Arch: {... |
// Package azureclient implements AAD Client Auth Flow
// Attention! This auth flow is not supported for SharePoint, you'd see "401 Unauthorized :: Unsupported app only token."
// See more:
// - https://docs.microsoft.com/en-us/azure/developer/go/azure-sdk-authorization#use-file-based-authentication
// Amongst suppor... |
package dotenv //import "go.mozilla.org/sops/v3/stores/dotenv"
import (
"bytes"
"encoding/json"
"fmt"
"strings"
"go.mozilla.org/sops/v3"
"go.mozilla.org/sops/v3/stores"
)
// SopsPrefix is the prefix for all metadatada entry keys
const SopsPrefix = "sops_"
// Store handles storage of dotenv data
type Store str... |
package ecs
import (
"reflect"
"unsafe"
)
// MemoryPool is the interface that controls the allocation and access of blocks of memory
// The MemoryPool allocate pages of memory with total size defined by itemSizeAligned * InitialMemoryPoolCapacity,
// this has the advantage of never risk to lose pointer references d... |
/*
Copyright © 2021 <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 in writing, softw... |
package rest
import (
"bytes"
"fmt"
"net/http"
"net/http/httptest"
"testing"
)
func TestUnpackGetBindingRequest(t *testing.T) {
instanceID := "i1234"
bindingID := "b1234"
unpackReq, err := unpackGetBindingRequest(
createFakeGetBindingRequest(instanceID, bindingID),
map[string]string{
"instance_id": in... |
// 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... |
package gostuff
import (
"encoding/json"
"fmt"
"os"
"gopkg.in/freeeve/pgn.v1"
)
var (
TotalGrandmasterGames = 0
)
type ConvertChessGame struct {
Event string
Site string
Date string
Round string
White string
Black string
Result string
WhiteElo string
BlackElo string
ECO... |
package util
import (
"gopkg.in/macaron.v1"
"os"
"syscall"
_ "github.com/go-sql-driver/mysql"
"database/sql"
"fmt"
"os/user"
"strings"
)
type API_function func(ctx *macaron.Context) (string)
type User struct {
Hostcontrol_id int
System_username string
Privileges string
Owned_by string
Login_token string... |
package mycrd
import (
"context"
"errors"
examplev1alpha1 "github.com/redhat-cop/operator-utils/pkg/apis/example/v1alpha1"
"github.com/redhat-cop/operator-utils/pkg/util"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/controller"... |
package score
import (
"errors"
"fmt"
"sync"
"time"
log "github.com/Sirupsen/logrus"
"github.com/allegro/marathon-appcop/marathon"
"github.com/allegro/marathon-appcop/metrics"
)
// Score contains score value to update, struct keeped inside Scorer as value as
// value as value as value
type Score struct {
sco... |
// Copyright (c) 2020, The GoKi 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 textbuf
import (
"bytes"
"fmt"
"strings"
"github.com/ianbruene/go-difflib/difflib"
)
// note: original difflib is: "github.com/pmezard/go-... |
package main
import (
"flag"
"fmt"
"log"
"os"
"strings"
"strconv"
"github.com/usedbytes/osgrid"
"github.com/usedbytes/osgrid/terrain50"
)
var gridRef string
var dataDir string
var radius uint
var outputFile string
var scadFile string
var horizontalScale string
var verticalScale string
func init() {
const (... |
package jwk
type Algorithm string
// https://www.rfc-editor.org/rfc/rfc7518.html#section-7.1.2
const (
// Optional, HMAC using SHA-256
AlgorithmHS256 Algorithm = "HS256"
// Optional, HMAC using SHA-384
AlgorithmHS384 Algorithm = "HS384"
// Optional, HMAC using SHA-512
AlgorithmHS512 Algorithm = "HS512"
// Reco... |
package gui
import (
"bytes"
"fmt"
"image"
"math"
"strings"
"github.com/fogleman/gg"
"github.com/golang/freetype/truetype"
"github.com/pkg/errors"
"github.com/skip2/go-qrcode"
core "github.com/timoth-y/chainmetric-iot/core/dev"
"github.com/timoth-y/chainmetric-iot/shared"
"github.com/wcharczuk/go-chart"
... |
// file: controller/user_controller.go
package controller
import (
"context"
"fmt"
"log"
"os"
"strconv"
"time"
"github.com/jinyuyoulong/jdcrontab/src/bootstrap/service"
"github.com/jinyuyoulong/jdcrontab/src/library/crontab"
"github.com/jinyuyoulong/jdcrontab/src/library/rpc"
"github.com/jinyuyoulong/jdcro... |
// Copyright 2018 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 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... |
package service
import (
"context"
"go-common/app/service/bbq/recsys-recall/api/grpc/v1"
"go-common/app/service/bbq/recsys-recall/model"
"go-common/app/service/bbq/recsys-recall/service/index"
"go-common/library/log"
"github.com/Dai0522/workpool"
)
const (
_recallLimit = 50
)
// Recall recsys recall video i... |
/*
Copyright (c) 2016 <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 or agreed to in wri... |
package main
import (
"bufio"
"bytes"
"fmt"
"sort"
"strings"
)
func main() {
//in := inputTest
in := input
in.Replacements = map[string][]string{}
scanner := bufio.NewScanner(bytes.NewBufferString(in.RawReplacements))
for scanner.Scan() {
l := strings.Trim(scanner.Text(), " \r\n\t")
if l == "" {
cont... |
// Package token deals with breaking a text into tokens. It cleans names broken
// by new lines, concatenating pieces together. Tokens are connected to
// properties. Properties are used for heuristic and Bayes' approaches for
// finding names.
package token
import (
"unicode"
"github.com/gnames/bayes"
gner "githu... |
package main
import (
"fmt"
"github.com/abates/AdventOfCode/2016/alg"
"strconv"
"strings"
)
func convertToSize(str string) (size int) {
if strings.HasSuffix(str, "T") {
size, _ = strconv.Atoi(str[:len(str)-1])
}
return size
}
func convertToPercent(str string) (percent float32) {
p := 0
if strings.HasSuffi... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: github.com/aperturerobotics/controllerbus/controller/controller.proto
package controller
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marsh... |
// Copyright 2017 <NAME> <<EMAIL>>
//
// Licensed under the BSD 2 Clause License (the "License");
// you may not use the file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://opensource.org/licenses/BSD-2-Clause
//
// Unless required by applicable law or agreed to in writi... |
package tracer
import (
"context"
"encoding/json"
"fmt"
"math"
"time"
"github.com/opentracing/opentracing-go"
opentracinglog "github.com/opentracing/opentracing-go/log"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
// Span wraps `opentracing.Span` to ensure it can be nil
type Span struct {
span opentraci... |
package resources
import (
routeV1 "github.com/openshift/api/route/v1"
"github.com/stackrox/rox/generated/internalapi/central"
"github.com/stackrox/rox/generated/storage"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/util/intstr"
)
type serviceWithRoutes struct {
*serviceWra... |
package game_test
import (
"testing"
"github.com/jwowillo/landgrab/game"
)
// BenchmarkPlayerIDString benchmarks the conversion of all game.PlayerIDs to
// their string representations.
func BenchmarkPlayerIDString(b *testing.B) {
pids := []game.PlayerID{game.NoPlayer, game.Player1, game.Player2}
b.ResetTimer()
... |
package confirm
import (
"bytes"
"io"
"text/template"
"github.com/charmbracelet/bubbles/help"
"github.com/charmbracelet/bubbles/key"
"github.com/charmbracelet/bubbles/viewport"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
"github.com/muesli/reflow/wordwrap"
"github.com/muesli... |
package git
import (
"bufio"
"bytes"
"compress/zlib"
"encoding/binary"
"encoding/hex"
"errors"
"io/ioutil"
"unsafe"
)
const (
errNullBytesNotNull = "null bytes not null"
)
type Git struct {
Index index
pos int //reader cursor
reader *bufio.Reader
}
type index struct {
Header header
Entries []en... |
// +build ignore
/*
* MinIO Cloud Storage, (C) 2019 MinIO, 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 require... |
package api
import (
"fmt"
"io"
"math/rand"
"github.com/pkg/errors"
"github.com/johnny-morrice/godless/crdt"
"github.com/johnny-morrice/godless/function"
"github.com/johnny-morrice/godless/internal/util"
"github.com/johnny-morrice/godless/proto"
"github.com/johnny-morrice/godless/query"
)
type Request str... |
// Copyright 2015 Yahoo Inc.
// Licensed under the terms of the Apache version 2.0 license. See LICENSE file for terms.
package rdl
import (
"fmt"
"strings"
)
//
// TypeRegistry is a set of related types, usually initialized from a schema.
//
type TypeRegistry interface {
Name() string
FindType(name TypeRef) *Ty... |
//Pacakge request provides a http client
//which includes everything you need for simple requests
package request
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"time"
"github.com/google/go-querystring/query"
)
type httpClient interface {
Do(req *http.Request) (*http.Response, erro... |
package bibfuse
import (
"errors"
"fmt"
"reflect"
"github.com/nickng/bibtex"
)
// BibItemOption specifies the option for AllFields()
type BibItemOption int64
const (
// ByFieldName use filed names as keys
ByFieldName BibItemOption = iota
// ByBibTexName use bibtex names as keys
ByBibTexName
)
// BibItem ho... |
package ossvulnfetcher
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"regexp"
"strings"
"github.com/nearform/gammaray/nodepackage"
"github.com/nearform/gammaray/vulnfetcher"
log "github.com/sirupsen/logrus"
)
// OSSComponentReport is a Component vulnerability report
type OSSComponentReport ... |
package main
import (
"bufio"
"context"
"errors"
"fmt"
"os"
"path"
"runtime"
"strconv"
"strings"
"sync"
"sync/atomic"
"time"
miniogo "github.com/minio/minio-go/v7"
)
const (
versionListFile = "version_listing.txt"
objListFile = "object_listing.txt"
failMigFile = "migration_fails.txt"
f... |
package vfs
import (
"fmt"
"io"
"os"
"strings"
"github.com/shyang107/paw"
"github.com/sirupsen/logrus"
)
func (v *VFS) ViewClassify(w io.Writer, fields []ViewField) {
VFSViewClassify(w, v)
}
func VFSViewClassify(w io.Writer, v *VFS) {
paw.Logger.WithFields(logrus.Fields{"View type": v.opt.ViewType}).Debug("v... |
package config
import (
"encoding/json"
"io"
"time"
)
// DatabaseConfig represents a single database DSN
// It is a map, so the JSON representation can include the backend type and the
// DSN, e.g.
//
// {
// "mysql": "paymentd@tcp(localhost:3306)/fritzpay"
// }
type DatabaseConfig map[string]string
// Ne... |
package configurator
import (
"encoding/json"
"errors"
"net/url"
"strconv"
"strings"
"sync/atomic"
"time"
"github.com/magneticio/vamp-kubist-istio-adapter/adapter/models"
"github.com/magneticio/vamp-kubist-istio-adapter/adapter/vampclientprovider"
"github.com/magneticio/vampkubistcli/logging"
clientmodels ... |
package importer
import (
"github.com/miniclip/gonsul/internal/entities"
"github.com/miniclip/gonsul/internal/util"
"strings"
"github.com/cbroglie/mustache"
"github.com/olekukonko/tablewriter"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
"os"
"path"
)
// createOperationMatrix... |
// Copyright 2016 Mirantis
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writi... |
package rel
import (
"context"
"reflect"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/arr-ai/arrai/pkg/arraictx"
)
func TestSetCall(t *testing.T) {
t.Parallel()
foo := func(at int, v Value) Tuple {
return NewTuple(NewAttr("@", NewNumber(float64(at))), N... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.