text stringlengths 3.08k 10.4k |
|---|
// Copyright 2018 The Kubeflow 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... |
package main
import (
"context"
"fmt"
"os"
"path/filepath"
"strconv"
"github.com/Netflix/titus-executor/logger"
)
const (
ephemeralStorageDeviceFolder = "/dev/ephemeral/"
mountPathInContainer = "/ephemeral"
reservedVGSpaceGB = 40
)
func ephemeralStorageIsAvailable() bool {
// This is th... |
package main
import (
"fmt"
"io/ioutil"
"log"
"net"
"net/http"
"os"
"testing"
"time"
"github.com/facebookgo/freeport"
"github.com/haproxytech/haproxy-consul-connect/consul"
haproxy "github.com/haproxytech/haproxy-consul-connect/haproxy"
"github.com/haproxytech/haproxy-consul-connect/lib"
"github.com/hash... |
// Code generated by https://github.com/gagliardetto/codebox. DO NOT EDIT.
package main
import (
"os"
"syscall"
)
func TaintStepTest_OsExpand_B0I0O0(sourceCQL interface{}) interface{} {
fromString656 := sourceCQL.(string)
intoString414 := os.Expand(fromString656, nil)
return intoString414
}
func TaintStepTest_... |
package routefix
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License 2.0.
import (
"context"
securityv1 "github.com/openshift/api/security/v1"
configclient "github.com/openshift/client-go/config/clientset/versioned"
securityclient "github.com/openshift/client-go/security/clientset/versio... |
/**
* range.go - emit a list of integers separated by spaces starting from
* first command line parameter to last command line parameter.
*
* @author <NAME>, <<EMAIL>>
* copyright (c) 2014 all rights reserved.
* Released under the Simplified BSD License
* See: http://opensource.org/licenses/bsd-license.php
*/
p... |
package platformclientv2
import (
"github.com/leekchan/timeutil"
"encoding/json"
"strconv"
"strings"
)
// Klaxoninteractionstatsrulestopicinteractionstatrule
type Klaxoninteractionstatsrulestopicinteractionstatrule struct {
// Id
Id *string `json:"id,omitempty"`
// Name
Name *string `json:"name,omitempty"`
... |
package percentile
import (
"fmt"
"time"
"k8s.io/klog/v2"
"github.com/gocrane/crane/pkg/common"
"github.com/gocrane/crane/pkg/prediction"
"github.com/gocrane/crane/pkg/prediction/config"
)
var _ prediction.Interface = &percentilePrediction{}
type percentilePrediction struct {
prediction.GenericPrediction
a... |
/*
Copyright (C) 2019 Synopsys, Inc.
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
"... |
// Copyright 2021 Cloudflare, Inc. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.
package tls
import (
circlPki "circl/pki"
circlSign "circl/sign"
"circl/sign/eddilithium3"
"time"
)
const (
// Constants for ECH status events.
echStatus... |
package server
import (
"encoding/json"
"fmt"
"path"
"github.com/docker/distribution"
"github.com/docker/distribution/context"
"github.com/docker/distribution/digest"
"github.com/docker/distribution/manifest/schema1"
"github.com/docker/distribution/reference"
"github.com/docker/libtrust"
imageapi "github.c... |
// Copyright (c) 2020 Tailscale Inc & 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 main
import (
"context"
"crypto/tls"
"encoding/json"
"errors"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"net/http/httptrace... |
// Copyright 2014 Team 254. All Rights Reserved.
// Author: <EMAIL> (<NAME>)
package main
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestSetupSchedule(t *testing.T) {
clearDb()
defer clearDb()
var err error
db, err = OpenDatabase(testDbPath)
assert.Nil(t, err)
defer db.Close()
eventSetti... |
package debian
import (
"strings"
"time"
"github.com/aquasecurity/trivy-db/pkg/vulnsrc/debian"
debianoval "github.com/aquasecurity/trivy-db/pkg/vulnsrc/debian-oval"
ospkgutils "github.com/aquasecurity/trivy/pkg/detector/ospkg/utils"
ftypes "github.com/aquasecurity/fanal/types"
dbTypes "github.com/aquasecurity... |
package trees
import (
"errors"
)
// BinarySearchTree defines a binary search tree
type BinarySearchTree struct {
BinaryTree
size int
}
func (b *BinarySearchTree) insert(node *BinaryTreeNode, key, value interface{}) bool {
if b.Comparator(node.Key, key) > 0 {
if node.Left == nil {
node.Left = &BinaryTreeNod... |
// Copyright (c) TFG Co. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge... |
// Copyright 2017 Google, Inc. All rights reserved.
//
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file in the root of the source
// tree.
//
package layers
import (
"encoding/binary"
"fmt"
"external/google/gopacket"
)
const gtpMinimumSizeInBytes int = 8
// G... |
package httpclient
import (
"os"
"path"
"strings"
"text/template"
"github.com/wildberries-ru/go-transport-generator/pkg/api"
)
const builderTpl = `// Package {{.PkgName}} ...
// CODE GENERATED AUTOMATICALLY
// DO NOT EDIT
package {{.PkgName}}
{{$methods := .HTTPMethods}}
import (
"context"
"encoding/json"
"n... |
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writi... |
/*
Copyright © 2021 blacktop
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, distribute, sublicen... |
package hybriddata
// Copyright (c) Microsoft and contributors. 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
//
// ... |
/*
Copyright 2016 The Fission 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, sof... |
// Copyright 2018 Istio 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 i... |
package inmemory
import (
"fmt"
"sort"
"strconv"
"strings"
"github.com/ICST-Technion/EZRecruit/datatypes"
"github.com/ICST-Technion/EZRecruit/pkg/db/helpers"
"github.com/ICST-Technion/EZRecruit/queries"
)
// NewInMemoryDB returns a new instance of InMemoryDB.
func NewInMemoryDB() *DB {
jobListingsMap := make... |
package buildkite
import (
"encoding/json"
"fmt"
"io/ioutil"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/peterhellberg/link"
)
// Define a Terraform data source for organizations.
func dataSourceOrganizations() *schema.Resour... |
package service
import (
"context"
"errors"
"fmt"
"net/http"
"os"
"runtime"
"time"
"github.com/google/uuid"
"github.com/quay/clair/config"
"github.com/quay/zlog"
"golang.org/x/sync/errgroup"
"github.com/quay/clair/v4/indexer"
"github.com/quay/clair/v4/matcher"
"github.com/quay/clair/v4/notifier"
"gith... |
/*
Sniperkit-Bot
- Status: analyzed
*/
// Copyright 2015-present, Cyrill @ <EMAIL>umacher.fm and the CoreStore contributors
//
// 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... |
package codegen
import (
"fmt"
"go/build"
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/pkg/errors"
"github.com/vektah/gqlparser/ast"
"gopkg.in/yaml.v2"
)
var cfgFilenames = []string{".gqlgen.yml", "gqlgen.yml", "gqlgen.yaml"}
// DefaultConfig creates a copy of the default config
func DefaultConfi... |
/*
* MinIO Client (C) 2020 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 required by applicable law or agr... |
/*
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this fi... |
package main
import (
"encoding/json"
"errors"
"flag"
"fmt"
"io"
"strconv"
"strings"
"github.com/aws/aws-sdk-go/service/ecs"
)
type CLI struct {
outStream, errStream io.Writer
Command string
WithAll bool
WithError bool
ClusterName string
ServiceName ... |
package aura
import (
"fmt"
"time"
"github.com/rcrowley/go-metrics"
)
// Histogram measures the statistical distribution of values in a stream of data.
// In addition to minimum, maximum, mean, etc.
// it also measures median, 75th, 90th, 95th, 98th, 99th, and 99.9th percentiles.
type Histogram interface {
Colle... |
package serviceaccess
import (
"fmt"
"strings"
"github.com/cloudfoundry/cli/cf/actors"
"github.com/cloudfoundry/cli/cf/api/authentication"
"github.com/cloudfoundry/cli/cf/command_registry"
"github.com/cloudfoundry/cli/cf/configuration/core_config"
. "github.com/cloudfoundry/cli/cf/i18n"
"github.com/cloudfound... |
package edgemax
import (
"encoding/json"
"fmt"
"log"
"net/http"
"net/http/cookiejar"
"net/url"
"strings"
"sync"
"time"
"github.com/gorilla/websocket"
)
// A Client is a client for a Ubiquiti EdgeMAX device.
//
// Client.Login must be called and return a nil error before any additional
// actions can be per... |
// ==========================================================================
// 生成人:JasonLaw
// ==========================================================================
package BaseSysUserModel
import (
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/os/gtime"
)
// Entity is the golang structure for table baseS... |
package v1alpha1
import (
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// Dist... |
package couchbase
import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"math/rand"
"net/http"
"net/url"
"time"
)
// ViewRow represents a single result from a view.
//
// Doc is present only if include_docs was set on the request.
type ViewRow struct {
ID string
Key interface{}
Value interface{}
Doc ... |
// Copyright © 2019 <NAME> <<EMAIL>>
//
// This source code is governed by the MIT license, which can be found in the LICENSE file.
package server
import (
"errors"
"strings"
"sync"
"time"
)
type channel struct {
name string
members []channelMember
// messages receives messages to be broadcast over the ch... |
package wallet
import (
"crypto/elliptic"
"encoding/binary"
"encoding/hex"
"encoding/json"
"errors"
"os"
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
"github.com/nspcc-dev/neo-go/pkg/encoding/address"
"github.com/nspcc-dev/neo-go/pkg/smartcontract"
"github.com/nspcc-dev/neo-go/pkg/wallet"
)
type (
wallet... |
// Copyright 2020 dfuse Platform 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 agre... |
package route
import (
"encoding/binary"
"fmt"
"strconv"
"strings"
"github.com/btcsuite/btcd/btcec"
sphinx "github.com/lightningnetwork/lightning-onion"
"github.com/lightningnetwork/lnd/lnwire"
)
// ErrNoRouteHopsProvided is returned when a caller attempts to construct a new
// sphinx packet, but provides an ... |
package certsigner
import (
"context"
"crypto/x509"
"fmt"
authorization "k8s.io/api/authorization/v1beta1"
capi "k8s.io/api/certificates/v1beta1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
clientset "k8s.io/client-go/kubernetes"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k... |
package consul
import (
"fmt"
"sync"
"time"
"github.com/Comcast/webpa-common/logging"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/kit/sd"
gokitconsul "github.com/go-kit/kit/sd/consul"
"github.com/hashicorp/consul/api"
)
// passFormat returns a closure that produces the o... |
package blockcache
import (
"errors"
"fmt"
"sync"
"testing"
"github.com/ltcsuite/ltcd/chaincfg/chainhash"
"github.com/ltcsuite/ltcd/ltcutil"
"github.com/ltcsuite/ltcd/wire"
"github.com/ltcsuite/neutrino/cache"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
type mockChainBacken... |
package promptx
import (
"github.com/aggronmagi/promptx/internal/debug"
runewidth "github.com/mattn/go-runewidth"
)
const (
// strMultiChoice = " ❯"
strMultiChoiceCur = " >"
strMultiChoiceNot = " "
strMultiChoiceSpacer = " "
strMultiChoiceOpen = "⬡ "
strMultiChoiceSelect = "⬢ "
)
// BlocksSele... |
/*
Copyright 2019 yametech 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, softwa... |
package verifier
import (
"archive/tar"
"bytes"
"crypto/sha256"
"encoding/hex"
"fmt"
"io"
"os"
"regexp"
"github.com/google/go-containerregistry/pkg/v1"
)
/*
utilities for verifying docker export tar files
it makes several very important assumptions
- the registry manifest *also* is in the tar file, name... |
package awsssm
import (
"errors"
"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/ssm"
)
var (
//ErrParameterNotFound error for when the requested Parameter Store parameter can't be found
ErrParameterNotFound = er... |
package main
import (
"container/heap"
"fmt"
)
type Region struct {
regionType int
erosionLevel int
geologicIndex int
}
const (
Rocky = 0
Wet = 1
Narrow = 2
)
type Cave map[complex128]Region
var Neighbors = []complex128{-1i, -1, 1, 1i}
func main() {
part1 := Day22Part1(8112, complex(13, 743))
pa... |
package main
/* Part A:
Hat tip to @lizthegrey for pointing me in the right direction
Given a "spiral pattern" (see below) what is the Manhattan Distance from cell 1 to the specified cell (368078)?
Data from cell 1 is 0 steps, 12 is 3 steps, 23 is 2, 1024 is 31 steps. ex.
(Y= 2) 17 16 15 14 13
(Y= 1) 18 5 ... |
package lwwset
import (
"errors"
"time"
)
// package lwwset implements the LWWSet (Last Writer Wins Set) CRDT data type along with the functionality
// to append, remove, list & lookup values in a LWWSet. It also provides the functionality to merge multiple
// LWWSets together and a utility function to clear a LWWS... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package chime
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/private/protocol"
)
type PutEventsConfigurationInput struct {
_ struct{} `type:"structure"`
//... |
package astilectron
import (
"encoding/json"
"errors"
)
// Target IDs
const (
targetIDApp = "app"
targetIDDock = "dock"
)
// Event represents an event
type Event struct {
// This is the base of the event
Name string `json:"name"`
TargetID string `json:"targetID,omitempty"`
// This is a list of all poss... |
// Code generated by go-swagger; DO NOT EDIT.
package cluster
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/... |
package handlers
import (
"bytes"
"encoding/json"
"errors"
"html"
"io/ioutil"
"net/http"
"regexp"
"strings"
"github.com/unswpcsoc/pcsocgo/commands"
"github.com/bwmarrin/discordgo"
"github.com/microcosm-cc/bluemonday"
)
var (
ErrNoInput = errors.New("No Course code entered")
ErrInvalidFormat = err... |
/*
Copyright 2019 The MayaData 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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, s... |
// Copyright (c) 2021 Terminus, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed... |
package main
import (
"flag"
"fmt"
"os"
"sort"
"strings"
"github.com/gyturi1/szozat/pkg/filter"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
)
type params struct {
isAll bool
isDownlaod bool
guesses filter.Markers
greens filter.Markers
grays filter.Markers
oranges filter.Mark... |
package page
import (
"fmt"
"os"
"runtime"
"gioui.org/io/clipboard"
"gioui.org/layout"
"gioui.org/widget"
"github.com/nxadm/tail"
"github.com/planetdecred/godcr/app"
"github.com/planetdecred/godcr/ui/decredmaterial"
"github.com/planetdecred/godcr/ui/load"
"github.com/planetdecred/godcr/ui/page/components"... |
package ir
var ENGLISH_STOP_WORDS = []string{
"a",
"about",
"above",
"after",
"again",
"against",
"all",
"am",
"an",
"and",
"any",
"are",
"aren",
"as",
"at",
"be",
"because",
"been",
"before",
"being",
"below",
"between",
"both",
"but",
"by",
"can",
"cannot",
"could",
"couldn",
"d",
"did",
"didn",
"do",
"does",
"doesn... |
package main
import (
"fmt"
"log"
"os"
"sync"
_ "github.com/mattn/go-sqlite3"
"github.com/biogo/biogo/feat"
"github.com/jmoiron/sqlx"
"github.com/mnsmar/htsdb"
"gopkg.in/alecthomas/kingpin.v2"
)
const prog = "htsdb-pos-overlap"
const version = "0.2"
const descr = `Measure the 5'/3' read positions and the n... |
// Copyright (c) 2017 <NAME>
package cmd
import (
"fmt"
"os"
"github.com/adampointer/image-builder/lib"
log "github.com/Sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
var (
cfgFile string
)
// RootCmd represents the base command when called without any subcommands
var RootCmd = &cobra... |
// Copyright 2016 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 main
import (
"errors"
"fmt"
"math/big"
"time"
"github.com/icon-project/goloop/common"
"github.com/icon-project/goloop/common/codec"
"github.com/icon-project/goloop/common/db"
"github.com/icon-project/goloop/common/ipc"
"github.com/icon-project/goloop/common/log"
"github.com/icon-project/goloop/modu... |
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"github.com/gotd/td/bin"
"github.com/gotd/td/tdjson"
"github.com/gotd/td/tdp"
"github.com/gotd/td/tgerr"
)
// No-op definition for keeping imports.
var (
_ = bin.Buffer{}
_... |
package check
import (
"context"
"fmt"
"io"
"os"
"strings"
"github.com/rclone/rclone/cmd"
"github.com/rclone/rclone/fs"
"github.com/rclone/rclone/fs/config/flags"
"github.com/rclone/rclone/fs/hash"
"github.com/rclone/rclone/fs/operations"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)
// Globals
var... |
// Copyright (c) 2017 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... |
// This module implements functions which manipulate errors and provide stack
// trace information.
//
// NOTE: This package intentionally mirrors the standard "errors" module.
// All dropbox code should use this.
package errors
import (
"bytes"
"fmt"
"runtime"
"strings"
)
// This interface exposes additional inf... |
package helix
import (
"net/http"
"regexp"
)
// WebhookSubscription ...
type WebhookSubscription struct {
Topic string `json:"topic"`
Callback string `json:"callback"`
ExpiresAt Time `json:"expires_at"`
}
// ManyWebhookSubscriptions ...
type ManyWebhookSubscriptions struct {
Total int ... |
// Code generated by smithy-go-codegen DO NOT EDIT.
package glue
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/glue/types"
smithy "github.com/awslabs/smithy-go"
"github.com/awslabs/smithy-go/middl... |
// Copyright 2018-2020 CERN
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this filePath except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
// Copyright 2019 The LUCI Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed... |
/*
Copyright 2018 OpenEBS 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, softwar... |
// This code would not have been possible without the two following projects:
//
// * AcTools (and Content Manager)
// - https://github.com/gro-ove/actools - Licensed under the Microsoft Public License (Ms-PL)
//
// * <NAME>'s QuickBMS, specifically the "Assetto Corsa ACD" script.
// - https://aluigi.altervista.org... |
// *** 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 ecs
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// The ECS container definition data source allows acce... |
// Copyright 2018 The conprof 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... |
package roza
import (
"database/sql"
"encoding/hex"
"encoding/json"
"fmt"
"strings"
"time"
"github.com/emirpasic/gods/maps/treemap"
"github.com/pkg/errors"
"github.com/volatiletech/sqlboiler/v4/queries"
)
type IdxFile struct {
Name string
SHA1 string
Size int64
LastModified time.... |
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writi... |
package statsd
import (
"context"
"fmt"
"math/rand"
"runtime"
"sync"
"testing"
"time"
"github.com/atlassian/gostatsd/types"
)
type testAggregator struct {
agrNumber int
af *testAggregatorFactory
types.MetricMap
}
func (a *testAggregator) Receive(m *types.Metric, t time.Time) {
a.af.Mutex.Lock()
... |
package main
import (
"context"
"crypto/aes"
"crypto/cipher"
"crypto/sha1"
"fmt"
"github.com/codenotary/immudb/pkg/api/schema"
"golang.org/x/crypto/pbkdf2"
"google.golang.org/grpc/metadata"
immuclient "github.com/codenotary/immudb/pkg/client"
"log"
)
// encryption AES example: https://github.com/moisoto/cry... |
package listkeys
import (
"bufio"
"bytes"
"crypto/rsa"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"fmt"
"github.com/open-horizon/rsapss-tool/generatekeys"
"github.com/open-horizon/rsapss-tool/sign"
"github.com/open-horizon/rsapss-tool/utility"
"io/ioutil"
"math/big"
"os"
"path"
"path/filepath"
"re... |
package parser
import (
"fmt"
"mutant/ast"
"mutant/lexer"
"mutant/token"
)
const (
_ int = iota
LOWEST
EQUALS
LESSGREATER
SUM
PRODUCT
PREFIX
CALL
INDEX
)
var precedences = map[token.TokenType]int{
token.EQUALITY: EQUALS,
token.INEQUALITY: EQUALS,
token.LT: LESSGREATER,
token.GT: LE... |
package sequence
import (
"bytes"
"errors"
//"encoding/json"
)
type Seq struct {
free []byte // 0, x_0, x_1, x_2, ..., x_n-1, N
free2 [][]byte
value []byte
value2 [256]byte
}
type seqJSON = struct {
Curr string `json:"curr"`
Free []string `json:"free,omitempty"`
}
const (
... |
package dstore
import (
"context"
"fmt"
"io"
"net/url"
"os"
"path"
"path/filepath"
"strings"
"go.uber.org/zap"
)
//
// Local Storage Store
//
type LocalStore struct {
baseURL *url.URL
basePath string
*commonStore
}
func NewLocalStore(baseURL *url.URL, extension, compressionType string, overwrite bool)... |
package networkconfig
import (
"context"
"log"
"time"
"github.com/pkg/errors"
networkoperatorv1 "github.com/openshift/cluster-network-operator/pkg/apis/networkoperator/v1"
"github.com/openshift/cluster-network-operator/pkg/apply"
"github.com/openshift/cluster-network-operator/pkg/network"
apierrors "k8s.io/... |
package hsm
import (
"net"
//"strconv"
"bufio"
//"bytes"
"encoding/binary"
"encoding/hex"
_net "go/net"
"io"
"log"
"os"
_ "strconv"
"strings"
"time"
)
// ThalesHsm represents a software Thales HSM
type ThalesHsm struct {
ip string
port int
encodingType EncodingType
headerLength int
... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package ec2
import (
"context"
"time"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type DescribeFleetHistoryInput struct {
_ struct{} `type:"structure"`
// Checks whether you have the required permiss... |
package count
import (
"bufio"
"bytes"
"context"
"errors"
"fmt"
"io"
"io/ioutil"
"strings"
"sync"
"testing"
"testing/quick"
)
func TestCounter_count(t *testing.T) {
for _, tc := range []struct {
name string
subString string
poolSize int
ctx context.Context
reader io.Reader
sour... |
package compiler
import (
"bufio"
"fmt"
"io"
"os"
"path/filepath"
"github.com/stackoverflow/novah-go/compiler/ast"
"github.com/stackoverflow/novah-go/compiler/lexer"
"github.com/stackoverflow/novah-go/compiler/parser"
tc "github.com/stackoverflow/novah-go/compiler/typechecker"
"github.com/stackoverflow/nova... |
// Proof of Concepts of CB-Spider.
// The CB-Spider is sub-Framework of the Cloud-Barista Multi-Cloud Project.
// The CB-Spider Mission is to connect all the clouds with a single interface.
//
// * Cloud-Barista: https://github.com/cloud-barista
//
// This is a Cloud Driver Example for PoC Test.
//
// by <EMAIL>, ... |
package api
import (
"net/http"
"time"
centerServermodel "fgame/fgame/gm/gamegm/gm/center/model"
centerserver "fgame/fgame/gm/gamegm/gm/center/server/service"
ntmodel "fgame/fgame/gm/gamegm/gm/manage/notice/model"
ntservice "fgame/fgame/gm/gamegm/gm/manage/notice/service"
plservice "fgame/fgame/gm/gamegm/gm/pl... |
// Copyright 2020 The Monogon Project Authors.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2... |
package plugin
import (
context "context"
"errors"
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
"sync"
"github.com/hashicorp/go-plugin"
"github.com/morikuni/failure"
grpc "google.golang.org/grpc"
"google.golang.org/grpc/status"
)
const (
pluginDir = ".onstatic"
pluginMapName = "EntryPoint"
pluginNameArg... |
package gbfs
import (
"encoding/json"
"errors"
"io/ioutil"
"net/http"
"os"
"path/filepath"
"sort"
"strings"
"sync"
"time"
)
var (
ErrMissingSystemID = errors.New("missing system id")
ErrMissingRootDir = errors.New("missing root directory")
ErrMissingBaseURL = errors.New("missing base url... |
package utils
import (
"encoding/json"
"fmt"
"sort"
"strconv"
"strings"
"sync"
"testing"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/require"
"k8s.io/apimachinery/pkg/api/errors"
corev1 "github.com/libopenstorage/operator/pkg/apis/core/v1"
testutil "github.com/libopenstorage/operator/pkg/ut... |
package mapenv
import (
"encoding/json"
"fmt"
"math"
"os"
"reflect"
"strconv"
"strings"
"time"
)
const (
mapEnvTagName string = "mpe"
)
var zeroValue reflect.Value
// Decode decode current environmental variables into an output structure.
// Output must be a pointer to a struct.
func Decode(v interface{}) ... |
package errors
import (
"fmt"
"sort"
)
// Fatal will panic if given a non-nil error. If the given error is an *Error, the output format of
// the panic will be slightly different, so as to include as much relevant information as possible
// in an easy format for operators to digest. If a regular error is given, it ... |
package generator
import (
"fmt"
. "github.com/billcoding/gocode-generator/config"
. "github.com/billcoding/gocode-generator/model"
"github.com/billcoding/gocode-generator/tpl"
. "github.com/billcoding/gocode-generator/util"
"log"
"os"
"path/filepath"
"strconv"
"strings"
"time"
)
var entityGeneratorLogger ... |
package dashboard
import (
"context"
"errors"
"io"
"strings"
"time"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/mount"
"github.com/docker/docker/client"
"github.com/docker/docker/pkg/stdcopy"
"github.com/sirupsen/logrus"
)
const ... |
// Copyright 2018 <NAME>, Inc. All rights reserved.
// Licensed under the Apache License, version 2.0:
// http://www.apache.org/licenses/LICENSE-2.0
package main
import (
"fmt"
"github.com/attic-labs/kingpin"
"github.com/attic-labs/noms/cmd/util"
"github.com/attic-labs/noms/go/d"
"github.com/attic-labs/noms/go... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.