text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func polyTreeToLayerParts(tree *clipper.PolyTree) []data.LayerPart {
var layerParts []data.LayerPart
var polysForNextRound []*clipper.PolyNode
for _, c := range tree.Childs() {
polysForNextRound = append(polysForNextRound, c)
}
for {
if polysForNextRound == nil {
break
}
thisRound := polysForNextRound... | [
0.17297042906284332,
-1.0779004096984863,
0.6518415212631226,
-0.5848681330680847,
-0.7147906422615051,
0.8398959636688232,
-0.2853465676307678,
-0.69770348072052,
0.6728484034538269,
0.3441067039966583,
-0.8321367502212524,
-0.07578127831220627,
0.10322196781635284,
0.5607243776321411,
... |
func New() *KubeCross {
return &KubeCross{&defaultImpl{}}
} | [
0.5139567852020264,
-0.9549716711044312,
0.2807832360267639,
1.126904010772705,
-0.6224832534790039,
-0.22902771830558777,
-0.718085765838623,
-0.5297054648399353,
-0.1949886977672577,
0.1374826729297638,
-0.8196301460266113,
-0.10668474435806274,
-0.4329795837402344,
0.1504938304424286,
... |
func (k *KubeCross) Latest() (string, error) {
return k.ForBranch(git.DefaultBranch)
} | [
0.7654293775558472,
-0.17387962341308594,
0.33020979166030884,
0.5341753959655762,
0.7746993899345398,
0.005670179147273302,
-0.8466172814369202,
-0.727849006652832,
-1.034877061843872,
0.39507004618644714,
0.359497606754303,
-0.4551639258861542,
-0.443914532661438,
0.12545467913150787,
... |
func (k *KubeCross) ForBranch(branch string) (string, error) {
logrus.Infof("Trying to retrieve kube-cross version for branch %s", branch)
const (
baseURL = "https://raw.githubusercontent.com/kubernetes/kubernetes"
versionPath = "build/build-image/cross/VERSION"
)
url := fmt.Sprintf("%s/%s/%s", baseURL, b... | [
0.519832968711853,
-0.14394840598106384,
0.4511801600456238,
0.3466646373271942,
-0.20698478817939758,
0.022194277495145798,
-0.5181188583374023,
-0.6976991891860962,
0.004281826317310333,
0.2951139509677887,
0.10368131846189499,
0.23497238755226135,
-0.6817799806594849,
0.8543385863304138... |
func NewCommitIterator(vr types.ValueReader, commit types.Value) *CommitIterator {
cr, err := types.NewRef(commit, vr.Format())
d.PanicIfError(err)
return &CommitIterator{vr: vr, branches: branchList{branch{addr: cr.TargetHash(), height: cr.Height(), commit: commit}}}
} | [
0.14664101600646973,
-0.9265518188476562,
0.24613627791404724,
-0.09295786917209625,
-1.4079302549362183,
-0.5919696092605591,
-0.6199355125427246,
-0.505813479423523,
-0.29941537976264954,
1.5648200511932373,
0.6089755296707153,
0.2047065645456314,
-0.9896998405456543,
0.05320687592029571... |
func (iter *CommitIterator) Next(ctx context.Context) (LogNode, bool) {
if iter.branches.IsEmpty() {
return LogNode{}, false
}
// Float of branches present when printing this commit
startingColCount := len(iter.branches)
branchIndexes := iter.branches.HighestBranchIndexes()
col := branchIndexes[0]
br := iter... | [
0.06977244466543198,
0.4000392556190491,
0.6530556082725525,
-0.4388659596443176,
-0.4245342016220093,
-0.3362443149089813,
-0.013547136448323727,
-0.1709357500076294,
-0.16573823988437653,
0.34815797209739685,
0.645114541053772,
0.26074427366256714,
-0.37522757053375244,
-0.19567178189754... |
func (n LogNode) Expanding() bool {
return n.startingColCount < n.endingColCount
} | [
-0.5978550314903259,
1.243556022644043,
0.5733024477958679,
-0.6207751631736755,
-0.006388625130057335,
0.39344701170921326,
-0.4928625822067261,
-0.470401406288147,
-0.5006497502326965,
-0.5582373738288879,
0.12038916349411011,
-0.1736331284046173,
0.09573442488908768,
0.12967245280742645... |
func (n LogNode) Shrinking() bool {
return len(n.foldedCols) > 1
} | [
-0.9564964175224304,
1.7339894771575928,
0.46140414476394653,
-0.5634382963180542,
-0.5198367238044739,
0.11231746524572372,
-0.6185272932052612,
-0.05729259178042412,
-0.02971643954515457,
-0.40592095255851746,
-0.3865458071231842,
-0.2114417850971222,
-0.2494073212146759,
0.4113897979259... |
func (n LogNode) Shrunk() bool {
return n.startingColCount > n.endingColCount
} | [
-0.5739808678627014,
1.5457239151000977,
0.375465452671051,
-0.6675151586532593,
0.7511429190635681,
0.5408515930175781,
0.4630952477455139,
-0.25404176115989685,
-0.980390191078186,
-0.5581849217414856,
-0.28340229392051697,
0.5793227553367615,
-0.051745329052209854,
-0.37675997614860535,... |
func (bl branchList) HighestBranchIndexes() []int {
maxHeight := uint64(0)
var br branch
cols := []int{}
for i, b := range bl {
if b.height > maxHeight {
maxHeight = b.height
br = b
cols = []int{i}
} else if b.height == maxHeight && b.addr == br.addr {
cols = append(cols, i)
}
}
return cols
} | [
-0.16294920444488525,
-0.3463716506958008,
0.7914655804634094,
0.9600104093551636,
-0.25457048416137695,
-0.28234460949897766,
0.282525897026062,
0.21161825954914093,
-0.4966350197792053,
0.07282669097185135,
-1.099835991859436,
0.4185218811035156,
-0.7234718203544617,
0.5349161624908447,
... |
func (m *createsoftwaresourcedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) {
if data == nil || string(data) == "null" {
return nil, nil
}
var err error
switch m.SoftwareSourceType {
case "CUSTOM":
mm := CreateCustomSoftwareSourceDetails{}
err = json.Unmarshal(data, &mm)
return mm, e... | [
-0.12922324240207672,
0.4389954209327698,
0.3492477536201477,
-1.4126801490783691,
-0.528485894203186,
-0.326088011264801,
-0.37906670570373535,
-0.09961707890033722,
0.561542272567749,
0.5609062314033508,
-1.1836432218551636,
-0.6090433597564697,
-0.5647748112678528,
0.29545143246650696,
... |
func (m createsoftwaresourcedetails) ValidateEnumValue() (bool, error) {
errMessage := []string{}
if len(errMessage) > 0 {
return true, fmt.Errorf(strings.Join(errMessage, "\n"))
}
return false, nil
} | [
-0.6073721647262573,
0.3909524977207184,
0.6426823735237122,
-0.28826355934143066,
-0.4210868775844574,
0.5679249167442322,
0.8409208655357361,
-0.09821858257055283,
-0.3060891628265381,
0.31368952989578247,
-0.21451430022716522,
-0.28965529799461365,
-0.3531787395477295,
2.024224042892456... |
func PrepareTfArgs(cmd string, bucket string) []string {
arguments := []string{cmd}
if cmd == "output" {
arguments = append(arguments, "-json")
}
if cmd == "init" || cmd == "plan" || cmd == "apply" || cmd == "destroy" {
arguments = append(arguments, "-input=false")
arguments = append(arguments, "--var-file=... | [
-0.34834563732147217,
0.25166887044906616,
0.7350510954856873,
-0.3424455225467682,
0.24099348485469818,
-0.8030819892883301,
-0.7206893563270569,
-0.32621899247169495,
-0.7161043286323547,
0.8289523720741272,
0.22644099593162537,
-0.10012049227952957,
0.4127325713634491,
0.917268097400665... |
func Terraform(wd, cmd string, bucket string) (*string, error) {
args := PrepareTfArgs(cmd, bucket)
env := []string{"TF_IS_IN_AUTOMATION=1", "TF_INPUT=0"}
if cmd == "output" {
// TODO: (rem) deal with non-empty stderr?
out, _, err := util.RunSilently(wd, env, "terraform", args...)
return out, err
}
return u... | [
0.3188462257385254,
0.29344096779823303,
0.5891466736793518,
-0.27405819296836853,
-0.039925988763570786,
-0.33467018604278564,
0.5539458394050598,
-0.5262254476547241,
-0.9387370347976685,
-0.03734242171049118,
0.640324056148529,
0.28438296914100647,
-0.07617313414812088,
0.49373331665992... |
func InitIfNeeded(logger *zap.SugaredLogger, tfDir, bucket, attackTag string) error {
logger.Debug("Terraform.InitIfNeeded() start")
logger.Info("Ensuring there is a simulator keypair")
_, err := ssh.EnsureKey()
if err != nil {
return errors.Wrap(err, "Error ensuring SSH key")
}
logger.Info("Detecting your pu... | [
0.2961595356464386,
-0.6661878228187561,
0.7911091446876526,
-0.3858349919319153,
0.8968188166618347,
-0.15693269670009613,
0.13858133554458618,
-0.2644461989402771,
-1.0644923448562622,
-0.18069209158420563,
-0.5492611527442932,
0.15257011353969574,
0.2790241837501526,
0.5805202126502991,... |
func Create(logger *zap.SugaredLogger, tfDir, bucket, attackTag string) error {
err := InitIfNeeded(logger, tfDir, bucket, attackTag)
if err != nil {
return err
}
logger.Info("Running terraform plan")
_, err = Terraform(tfDir, "plan", bucket)
if err != nil {
return err
}
logger.Info("Running terraform ap... | [
0.6576763987541199,
0.032828330993652344,
0.41084980964660645,
0.17780308425426483,
0.8575223684310913,
0.274373322725296,
0.11201192438602448,
-0.37050098180770874,
-0.826774537563324,
-0.17576155066490173,
-0.05036553367972374,
-0.45265957713127136,
0.5207387804985046,
0.6849085688591003... |
func Status(logger *zap.SugaredLogger, tfDir, bucket, attackTag string) (*TerraformOutput, error) {
err := InitIfNeeded(logger, tfDir, bucket, attackTag)
if err != nil {
return nil, errors.Wrap(err, "Error initialising")
}
logger.Info("Running terraform output")
out, err := Terraform(tfDir, "output", bucket)
i... | [
0.458532452583313,
-1.253474473953247,
0.254148930311203,
-0.38345658779144287,
-0.2485509067773819,
-0.8796954154968262,
0.4401231110095978,
-0.017521139234304428,
-0.7500978708267212,
0.04609506204724312,
0.15461400151252747,
-0.5916917324066162,
0.06699299812316895,
0.2971430718898773,
... |
func Destroy(logger *zap.SugaredLogger, tfDir, bucket, attackTag string) error {
err := InitIfNeeded(logger, tfDir, bucket, attackTag)
if err != nil {
return errors.Wrap(err, "Error initialising")
}
logger.Info("Running terrraform destroy")
_, err = Terraform(tfDir, "destroy", bucket)
return err
} | [
0.3500481843948364,
-0.5265836715698242,
0.48099973797798157,
-0.6442334055900574,
0.8805199861526489,
-0.09586935490369797,
0.349846750497818,
0.07337214797735214,
-0.3190435767173767,
0.2601706087589264,
-0.0009829130722209811,
-0.20103617012500763,
0.039407879114151,
0.4355437457561493,... |
func (phase *CompletePhase) DefaultRequeue() ctrl.Result {
return Requeue()
} | [
-0.09173376858234406,
-0.6023215055465698,
0.4079835116863251,
0.3595813512802124,
0.9926753640174866,
-0.10851620137691498,
-0.16241677105426788,
0.1975107192993164,
-0.2014225870370865,
-0.23245656490325928,
-0.2870091199874878,
-1.179232120513916,
-1.1010832786560059,
0.998566746711731,... |
func (phase *CompletePhase) Execute(
r common.ComponentReconciler,
) (proceedToNextPhase bool, err error) {
r.GetComponent().SetReadyStatus(true)
r.GetLogger().V(0).Info("successfully reconciled")
return true, nil
} | [
-0.1773204505443573,
0.09115888923406601,
0.9906513690948486,
-0.7213190793991089,
0.47494566440582275,
0.42255765199661255,
-0.6755213737487793,
0.7274616956710815,
0.07625949382781982,
0.6687449216842651,
-0.8220921158790588,
-1.7891360521316528,
-1.1302227973937988,
-0.4201471507549286,... |
func ConvertDateSearchByGroupType(form *QueryForm) (error, string) {
switch form.GroupType {
case GROUP_TYPE_MONTH:
// convert YYYY/MM to YYYY/MM/DD
if strings.TrimSpace(form.MonthFrom) == "" {
form.DateFrom = ""
} else {
monthFromTime, err := time.Parse(Common.DATE_FORMAT_YM_SLASH, form.MonthFrom)
if... | [
-0.17832505702972412,
-0.03288626670837402,
1.058178186416626,
-0.5609009265899658,
0.36755993962287903,
-0.09194302558898926,
0.827747642993927,
-0.7326308488845825,
-0.036008141934871674,
0.025637127459049225,
0.39705967903137207,
0.08463362604379654,
-0.4438568949699402,
0.9900027513504... |
func calculateHash(block Block) []byte {
bVersion := util.Uinttobyte(block.Version)
bNonce := util.Uinttobyte(block.Nonce)
bDifficulty := util.Uinttobyte(block.Difficulty)
record := []byte{}
record = append(record, bVersion[:]...)
record = append(record, block.PrevHash[:]...)
record = append(record, bNonce[:]..... | [
0.5958799719810486,
-0.38227981328964233,
0.9463686347007751,
0.26491549611091614,
-0.013475059531629086,
-0.08703368157148361,
0.42820531129837036,
0.678221583366394,
-0.34090927243232727,
0.24316829442977905,
-1.1896123886108398,
-0.04496116563677788,
-0.9802337884902954,
0.8044669032096... |
func NewTxRecord(serializedTx []byte, received time.Time) (*TxRecord, error) {
rec := &TxRecord{
Received: received,
SerializedTx: serializedTx,
}
err := rec.MsgTx.Deserialize(bytes.NewReader(serializedTx))
if err != nil {
str := "failed to deserialize transaction"
return nil, storeError(ErrInput, str, ... | [
1.1067708730697632,
0.11773055046796799,
0.4208044111728668,
-0.7057495713233948,
-1.0772221088409424,
-0.15805558860301971,
-0.9969296455383301,
0.0013368474319577217,
-0.11938737332820892,
0.4845201075077057,
-0.5776523351669312,
-0.14295977354049683,
-0.5773454308509827,
-0.438804656267... |
func NewTxRecordFromMsgTx(msgTx *wire.MsgTx, received time.Time) (*TxRecord, error) {
buf := bytes.NewBuffer(make([]byte, 0, msgTx.SerializeSize()))
err := msgTx.Serialize(buf)
if err != nil {
str := "failed to serialize transaction"
return nil, storeError(ErrInput, str, err)
}
rec := &TxRecord{
MsgTx: ... | [
1.359204888343811,
0.12522411346435547,
0.3005909323692322,
-1.245529294013977,
-1.1875666379928589,
-0.11491385102272034,
-1.1336658000946045,
-0.6531774997711182,
-0.29856324195861816,
0.22995778918266296,
-0.36809876561164856,
0.26145777106285095,
-0.09725933521986008,
0.111135162413120... |
func Open(ns walletdb.ReadBucket, chainParams *chaincfg.Params) (*Store, error) {
// Open the store.
err := openStore(ns)
if err != nil {
return nil, err
}
s := &Store{chainParams, clock.NewDefaultClock(), nil} // TODO: set callbacks
return s, nil
} | [
-0.16068996489048004,
0.2446657419204712,
0.01609913632273674,
0.17014983296394348,
-0.6042240858078003,
0.029592348262667656,
0.21569080650806427,
0.414974570274353,
0.43014949560165405,
-0.4577769935131073,
0.08778074383735657,
-0.09659965336322784,
-0.9684973955154419,
-0.04386712983250... |
func Create(ns walletdb.ReadWriteBucket) error {
return createStore(ns)
} | [
0.5678407549858093,
0.5048359036445618,
0.14471930265426636,
0.03442421555519104,
0.30116337537765503,
0.06017056480050087,
-0.7652425765991211,
-1.1745414733886719,
0.3192075788974762,
-0.6012228727340698,
0.12022221088409424,
-1.3139801025390625,
-0.6916743516921997,
1.0456966161727905,
... |
func (s *Store) updateMinedBalance(ns walletdb.ReadWriteBucket, rec *TxRecord,
block *BlockMeta) error {
// Fetch the mined balance in case we need to update it.
minedBalance, err := fetchMinedBalance(ns)
if err != nil {
return err
}
// Add a debit record for each unspent credit spent by this transaction.
//... | [
-0.015593024902045727,
-0.4257517158985138,
0.6802613735198975,
-0.6811366677284241,
-0.2962375581264496,
-0.518171489238739,
0.20501497387886047,
-0.3361254334449768,
0.07343839854001999,
0.3971496820449829,
-0.3833189010620117,
-0.7392261624336243,
-0.8916670680046082,
1.0407578945159912... |
func (s *Store) deleteUnminedTx(ns walletdb.ReadWriteBucket, rec *TxRecord) error {
for _, input := range rec.MsgTx.TxIn {
prevOut := input.PreviousOutPoint
k := canonicalOutPoint(&prevOut.Hash, prevOut.Index)
if err := deleteRawUnminedInput(ns, k, rec.Hash); err != nil {
return err
}
}
for i := range rec... | [
0.4171370267868042,
-0.32849597930908203,
0.5820468664169312,
-0.2863895297050476,
-0.6021857261657715,
0.35475558042526245,
0.47832736372947693,
0.1574234664440155,
-0.2119840830564499,
0.26303911209106445,
-0.4559025168418884,
-0.015080279670655727,
-0.43349385261535645,
0.65543627738952... |
func (s *Store) InsertTx(ns walletdb.ReadWriteBucket, rec *TxRecord,
block *BlockMeta) error {
_, err := s.InsertTxCheckIfExists(ns, rec, block)
return err
} | [
-0.19529487192630768,
0.8552628755569458,
0.5976924896240234,
-0.5803840160369873,
0.6465115547180176,
0.3764731287956238,
-0.06989002227783203,
0.11551659554243088,
-0.3765804171562195,
0.8342204689979553,
-0.8160946369171143,
-0.8226768374443054,
-1.154911756515503,
-0.07672272622585297,... |
func (s *Store) InsertTxCheckIfExists(ns walletdb.ReadWriteBucket,
rec *TxRecord, block *BlockMeta) (bool, error) {
var err error
if block == nil {
if err = s.insertMemPoolTx(ns, rec); err == ErrDuplicateTx {
return true, nil
}
return false, err
}
if err = s.insertMinedTx(ns, rec, block); err == ErrDupli... | [
-0.22764672338962555,
0.41949954628944397,
1.0095641613006592,
-0.41551440954208374,
0.9205459356307983,
0.30760523676872253,
-0.0050264997407794,
0.20344065129756927,
-0.5015053153038025,
0.9151383638381958,
-0.9775097966194153,
-0.8390840291976929,
-1.0457830429077148,
0.4794827997684479... |
func (s *Store) RemoveUnminedTx(ns walletdb.ReadWriteBucket, rec *TxRecord) error {
// As we already have a tx record, we can directly call the
// removeConflict method. This will do the job of recursively removing
// this unmined transaction, and any transactions that depend on it.
return s.removeConflict(ns, rec)... | [
0.21798895299434662,
-0.311881422996521,
0.3474489748477936,
-0.21704702079296112,
-0.8636552691459656,
-0.1109117940068245,
-0.2183784693479538,
0.499531090259552,
-0.011022374965250492,
0.029335787519812584,
-0.9619171619415283,
-0.944166898727417,
-0.8965448141098022,
0.5014123320579529... |
func (s *Store) insertMinedTx(ns walletdb.ReadWriteBucket, rec *TxRecord,
block *BlockMeta) error {
// If a transaction record for this hash and block already exists, we
// can exit early.
if _, v := existsTxRecord(ns, &rec.Hash, &block.Block); v != nil {
return ErrDuplicateTx
}
// If a block record does not ... | [
0.5338958501815796,
-0.08056415617465973,
0.8804588913917542,
-0.3474240303039551,
0.051675017923116684,
-0.5104866027832031,
-0.0820881724357605,
-0.45846614241600037,
-0.007187866140156984,
-0.1392735242843628,
-0.8836923241615295,
-0.8981252312660217,
-0.5399877429008484,
0.795102477073... |
func (s *Store) AddCredit(ns walletdb.ReadWriteBucket, rec *TxRecord, block *BlockMeta, index uint32, change bool) error {
if int(index) >= len(rec.MsgTx.TxOut) {
str := "transaction output does not exist"
return storeError(ErrInput, str, nil)
}
isNew, err := s.addCredit(ns, rec, block, index, change)
if err =... | [
0.5654296278953552,
0.09000446647405624,
0.9257495999336243,
0.11490418016910553,
-0.49958348274230957,
-0.18941867351531982,
0.25121793150901794,
0.10326669365167618,
-0.07634736597537994,
0.4599760174751282,
0.9419224858283997,
-0.0711827352643013,
-0.5709126591682434,
0.6078525185585022... |
func (s *Store) addCredit(ns walletdb.ReadWriteBucket, rec *TxRecord, block *BlockMeta, index uint32, change bool) (bool, error) {
if block == nil {
// If the outpoint that we should mark as credit already exists
// within the store, either as unconfirmed or confirmed, then we
// have nothing left to do and can ... | [
0.3435406982898712,
0.030524196103215218,
1.0724492073059082,
-0.3184034824371338,
-0.3442283570766449,
0.18061476945877075,
0.26130059361457825,
-0.2060193121433258,
-0.004716262221336365,
0.8533563613891602,
0.45740264654159546,
-0.29513999819755554,
-0.39871105551719666,
0.1818651258945... |
func (s *Store) Rollback(ns walletdb.ReadWriteBucket, height int32) error {
return s.rollback(ns, height)
} | [
0.4999570846557617,
0.37715670466423035,
0.3401617705821991,
-0.12375497817993164,
0.08296635001897812,
0.31933292746543884,
0.3814821243286133,
-0.34203267097473145,
0.3063306510448456,
0.42265570163726807,
-0.17123569548130035,
-0.15147410333156586,
-0.5354400277137756,
-0.59174364805221... |
func (s *Store) UnspentOutputs(ns walletdb.ReadBucket) ([]Credit, error) {
var unspent []Credit
var op wire.OutPoint
var block Block
err := ns.NestedReadBucket(bucketUnspent).ForEach(func(k, v []byte) error {
err := readCanonicalOutPoint(k, &op)
if err != nil {
return err
}
// Skip the output if it's l... | [
0.117951400578022,
-0.3299419581890106,
0.7758156657218933,
-0.23531727492809296,
-0.5661330819129944,
-0.7167476415634155,
0.3292539417743683,
-0.5090073347091675,
-0.035719405859708786,
0.39433082938194275,
0.45827993750572205,
-0.612664520740509,
-0.13894981145858765,
0.0333069637417793... |
func (s *Store) Balance(ns walletdb.ReadBucket, minConf int32, syncHeight int32) (btcutil.Amount, error) {
bal, err := fetchMinedBalance(ns)
if err != nil {
return 0, err
}
// Subtract the balance for each credit that is spent by an unmined
// transaction.
var op wire.OutPoint
var block Block
err = ns.Nested... | [
0.32256004214286804,
-0.3487764894962311,
0.7878926992416382,
0.08758195489645004,
0.04365590587258339,
-1.0591368675231934,
0.6359148621559143,
-0.6780051589012146,
-0.29256904125213623,
0.023407641798257828,
0.45520707964897156,
-0.45875662565231323,
-0.6978192925453186,
0.88968807458877... |
func (s *Store) PutTxLabel(ns walletdb.ReadWriteBucket, txid chainhash.Hash,
label string) error {
if len(label) == 0 {
return ErrEmptyLabel
}
if len(label) > TxLabelLimit {
return ErrLabelTooLong
}
labelBucket, err := ns.CreateBucketIfNotExists(bucketTxLabels)
if err != nil {
return err
}
return Put... | [
-0.31531766057014465,
0.4620262086391449,
0.5424469709396362,
-1.047468662261963,
0.3109630048274994,
0.6784777045249939,
-0.6475149989128113,
-0.4240952134132385,
0.039272554218769073,
1.2287440299987793,
-0.28383517265319824,
-0.7210376858711243,
-0.7118645906448364,
-0.9064651727676392,... |
func PutTxLabel(labelBucket walletdb.ReadWriteBucket, txid chainhash.Hash,
label string) error {
// We expect the label length to be limited on creation, so we can
// store the label's length as a uint16.
labelLen := uint16(len(label))
var buf bytes.Buffer
var b [2]byte
binary.BigEndian.PutUint16(b[:], labelL... | [
0.0211186446249485,
0.3483501076698303,
0.39534270763397217,
-1.5382766723632812,
0.44056040048599243,
0.2804475724697113,
-1.1567047834396362,
-0.4990312457084656,
-0.13670627772808075,
1.1099152565002441,
-0.8603971600532532,
-0.44881588220596313,
-0.8481383919715881,
-1.05460786819458,
... |
func FetchTxLabel(ns walletdb.ReadBucket, txid chainhash.Hash) (string, error) {
labelBucket := ns.NestedReadBucket(bucketTxLabels)
if labelBucket == nil {
return "", ErrNoLabelBucket
}
v := labelBucket.Get(txid[:])
if v == nil {
return "", ErrTxLabelNotFound
}
return DeserializeLabel(v)
} | [
0.5389292240142822,
-0.8642803430557251,
0.39106619358062744,
-0.8733165264129639,
-0.5933765769004822,
0.6383694410324097,
-1.6270906925201416,
-0.9231058359146118,
0.287275105714798,
1.1710104942321777,
0.17270351946353912,
-0.01239208597689867,
0.023517603054642677,
-0.12111344933509827... |
func DeserializeLabel(v []byte) (string, error) {
// If the label is empty, return an error.
length := binary.BigEndian.Uint16(v[0:2])
if length == 0 {
return "", ErrEmptyLabel
}
// Read the remainder of the bytes into a label string.
label := string(v[2:])
return label, nil
} | [
0.4942646026611328,
-0.309091180562973,
0.5393660068511963,
-0.6748479604721069,
-0.1472945362329483,
0.21889115869998932,
-0.4320738911628723,
-0.09598081558942795,
0.7305154204368591,
0.20260310173034668,
-0.5142110586166382,
-0.09700135886669159,
-0.6142295598983765,
-1.388413429260254,... |
func isKnownOutput(ns walletdb.ReadWriteBucket, op wire.OutPoint) bool {
k := canonicalOutPoint(&op.Hash, op.Index)
if existsRawUnminedCredit(ns, k) != nil {
return true
}
if existsRawUnspent(ns, k) != nil {
return true
}
return false
} | [
-0.3798411190509796,
-0.49244096875190735,
0.6553508043289185,
0.18258975446224213,
-0.14641623198986053,
-0.6009142398834229,
0.28787246346473694,
-0.011377454735338688,
0.21617521345615387,
0.1917809247970581,
-0.0903187096118927,
-0.3929447829723358,
-0.05194802209734917,
-0.04356165975... |
func (s *Store) LockOutput(ns walletdb.ReadWriteBucket, id LockID,
op wire.OutPoint, duration time.Duration) (time.Time, error) {
// Make sure the output is known.
if !isKnownOutput(ns, op) {
return time.Time{}, ErrUnknownOutput
}
// Make sure the output hasn't already been locked to some other ID.
lockedID, ... | [
-0.2810976207256317,
-0.4032035171985626,
0.5074898600578308,
0.08201932907104492,
-0.44906049966812134,
-0.8623722791671753,
0.38785722851753235,
-0.7549497485160828,
0.21348124742507935,
0.37476950883865356,
-0.0676436647772789,
0.21577538549900055,
-0.3363800048828125,
-0.62373948097229... |
func (s *Store) UnlockOutput(ns walletdb.ReadWriteBucket, id LockID,
op wire.OutPoint) error {
// Make sure the output is known.
if !isKnownOutput(ns, op) {
return ErrUnknownOutput
}
// If the output has already been unlocked, we can return now.
lockedID, _, isLocked := isLockedOutput(ns, op, s.clock.Now())
... | [
-0.09014355391263962,
-0.5798408389091492,
0.4386909306049347,
0.4433705508708954,
-0.5153977870941162,
-1.4342671632766724,
0.6842982769012451,
-0.7519673705101013,
0.13227595388889313,
-0.12748387455940247,
0.24882735311985016,
-0.19125016033649445,
-0.7394413948059082,
-0.73305612802505... |
func (s *Store) DeleteExpiredLockedOutputs(ns walletdb.ReadWriteBucket) error {
// Collect all expired output locks first to remove them later on. This
// is necessary as deleting while iterating would invalidate the
// iterator.
var expiredOutputs []wire.OutPoint
err := forEachLockedOutput(
ns, func(op wire.Out... | [
0.3242484927177429,
-0.7880893349647522,
0.6165997385978699,
0.2777651846408844,
-0.6758249402046204,
-0.4394044280052185,
0.359761506319046,
-0.6584524512290955,
0.18331068754196167,
0.09452276676893234,
0.15916037559509277,
-0.6033310294151306,
-0.4521797299385071,
0.4983336329460144,
... |
func (s *Store) ListLockedOutputs(ns walletdb.ReadBucket) ([]*LockedOutput,
error) {
var outputs []*LockedOutput
err := forEachLockedOutput(
ns, func(op wire.OutPoint, id LockID, expiration time.Time) {
// Skip expired leases. They will be cleaned up with the
// next call to DeleteExpiredLockedOutputs.
i... | [
0.022284526377916336,
-1.1615070104599,
0.3340165913105011,
-0.0732651874423027,
-0.2982657551765442,
-0.5084909200668335,
0.22699974477291107,
-0.6871967315673828,
0.6504771709442139,
0.07827825844287872,
0.2793950140476227,
0.045269232243299484,
-0.47369951009750366,
0.6552737951278687,
... |
func differenceStringSlice(sliceA []string, sliceB []string) []string {
var diff []string
for _, a := range sliceA {
found := false
for _, b := range sliceB {
if a == b {
found = true
break
}
}
if !found {
diff = append(diff, a)
}
}
return diff
} | [
-0.14545688033103943,
-1.0247187614440918,
0.6676842570304871,
-0.14882193505764008,
0.5401791334152222,
-0.21933245658874512,
-0.6441750526428223,
-0.6486629843711853,
-0.1596718728542328,
0.8383325934410095,
0.9590871334075928,
0.843388020992279,
-0.32214149832725525,
0.23358815908432007... |
func removeDuplicates(in []string) (out []string) {
m := map[string]bool{}
for _, v := range in {
if _, found := m[v]; !found {
out = append(out, v)
m[v] = true
}
}
return
} | [
-0.393738329410553,
-0.7952959537506104,
0.6364576816558838,
-0.3625315725803375,
-0.5947779417037964,
-0.2407676726579666,
-0.18240268528461456,
0.7305117845535278,
0.35336917638778687,
0.45835399627685547,
-0.6604088544845581,
0.04241438955068588,
-0.9105179905891418,
0.43704691529273987... |
func (o *MicrosoftGraphWindowsMinimumOperatingSystem) GetV80() bool {
if o == nil || o.V80 == nil {
var ret bool
return ret
}
return *o.V80
} | [
0.22444625198841095,
0.1878274381160736,
0.30461016297340393,
-0.17053693532943726,
-0.48757946491241455,
0.5882189869880676,
-0.4072705805301666,
-0.19362476468086243,
0.665042519569397,
0.3783150315284729,
0.21072322130203247,
-0.21666012704372406,
-0.6985862851142883,
0.4138891696929931... |
func (o *MicrosoftGraphWindowsMinimumOperatingSystem) GetV80Ok() (bool, bool) {
if o == nil || o.V80 == nil {
var ret bool
return ret, false
}
return *o.V80, true
} | [
-0.04271681234240532,
0.30215734243392944,
0.38761621713638306,
0.15811172127723694,
-0.5368251800537109,
0.24390585720539093,
0.19865782558918,
-0.06017253175377846,
0.13002824783325195,
1.2321867942810059,
-0.3403060734272003,
-0.11816317588090897,
0.14314116537570953,
0.9529823064804077... |
func (o *MicrosoftGraphWindowsMinimumOperatingSystem) HasV80() bool {
if o != nil && o.V80 != nil {
return true
}
return false
} | [
0.47138309478759766,
0.2979581356048584,
0.15921133756637573,
-0.3027665317058563,
-0.14551664888858795,
-0.01856127381324768,
-0.6420091986656189,
0.3890528082847595,
0.238494873046875,
-0.16744837164878845,
0.23219168186187744,
-0.37973958253860474,
-0.1661366969347,
0.7212787866592407,
... |
func (o *MicrosoftGraphWindowsMinimumOperatingSystem) SetV80(v bool) {
o.V80 = &v
} | [
-0.5208936929702759,
0.5633231401443481,
-0.04446918144822121,
0.04197405278682709,
-1.1969966888427734,
0.4395253658294678,
-0.7111241221427917,
-0.8264206051826477,
-0.020546605810523033,
0.981896698474884,
0.10529076308012009,
0.7627959251403809,
-0.16285933554172516,
0.0736729353666305... |
func (o *MicrosoftGraphWindowsMinimumOperatingSystem) GetV81() bool {
if o == nil || o.V81 == nil {
var ret bool
return ret
}
return *o.V81
} | [
-0.5484750866889954,
0.697765588760376,
0.3135988414287567,
0.1354542374610901,
0.03929327055811882,
0.26597535610198975,
-0.01627250760793686,
-0.07717791944742203,
1.004541039466858,
0.6960188746452332,
0.31161296367645264,
0.17063641548156738,
-1.1310487985610962,
-0.29303503036499023,
... |
func (o *MicrosoftGraphWindowsMinimumOperatingSystem) GetV81Ok() (bool, bool) {
if o == nil || o.V81 == nil {
var ret bool
return ret, false
}
return *o.V81, true
} | [
-0.4089753329753876,
0.7039200067520142,
0.506953239440918,
0.3234606683254242,
-0.0799635723233223,
0.2102416753768921,
0.14552274346351624,
0.03333060070872307,
0.4398764669895172,
1.3149195909500122,
-0.3756628632545471,
0.10999647527933121,
-0.6749311685562134,
0.31085991859436035,
-... |
func (o *MicrosoftGraphWindowsMinimumOperatingSystem) HasV81() bool {
if o != nil && o.V81 != nil {
return true
}
return false
} | [
-0.3131507933139801,
0.6914632320404053,
0.21992123126983643,
-0.3275316059589386,
0.49589452147483826,
-0.4380834698677063,
-0.4340032637119293,
0.34119367599487305,
0.5022192001342773,
0.360668420791626,
0.011088903062045574,
0.13566315174102783,
-0.8474776148796082,
-0.11261800676584244... |
func (o *MicrosoftGraphWindowsMinimumOperatingSystem) SetV81(v bool) {
o.V81 = &v
} | [
-0.947642982006073,
0.9044873714447021,
0.007119369693100452,
0.1659192442893982,
-0.6170555353164673,
0.1042770966887474,
-0.36875712871551514,
-0.6965392827987671,
0.31989964842796326,
1.0478769540786743,
0.2959742844104767,
1.1013808250427246,
-0.8407381176948547,
-0.7135782837867737,
... |
func (o *MicrosoftGraphWindowsMinimumOperatingSystem) GetV100() bool {
if o == nil || o.V100 == nil {
var ret bool
return ret
}
return *o.V100
} | [
0.2760865092277527,
0.13345105946063995,
0.310257226228714,
0.559069812297821,
-0.20830626785755157,
-0.29252880811691284,
-0.1480577141046524,
-0.32309412956237793,
0.03640265017747879,
0.7378523349761963,
-0.04362098127603531,
-0.6603179574012756,
-0.24376800656318665,
-0.475263118743896... |
func (o *MicrosoftGraphWindowsMinimumOperatingSystem) GetV100Ok() (bool, bool) {
if o == nil || o.V100 == nil {
var ret bool
return ret, false
}
return *o.V100, true
} | [
0.23951488733291626,
0.14906460046768188,
0.5241191983222961,
0.7402990460395813,
0.024714825674891472,
-0.25025850534439087,
0.36338773369789124,
0.19485387206077576,
-0.4721445143222809,
1.6558548212051392,
-0.5565855503082275,
-0.21649084985256195,
0.3174908459186554,
0.6034561991691589... |
func (o *MicrosoftGraphWindowsMinimumOperatingSystem) HasV100() bool {
if o != nil && o.V100 != nil {
return true
}
return false
} | [
0.47455593943595886,
0.1956101655960083,
0.15888267755508423,
0.1447669118642807,
0.3581119477748871,
-0.9856605529785156,
-0.43347519636154175,
0.2771328091621399,
-0.4699338376522064,
0.43665629625320435,
-0.25348159670829773,
-0.8636782169342041,
0.2078648805618286,
-0.34783825278282166... |
func (o *MicrosoftGraphWindowsMinimumOperatingSystem) SetV100(v bool) {
o.V100 = &v
} | [
-0.13067038357257843,
0.2744240164756775,
0.013244853354990482,
0.3993633985519409,
-0.9115027189254761,
-0.31195229291915894,
-0.5919893980026245,
-0.7505589723587036,
-0.3360718786716461,
1.270585060119629,
-0.15094484388828278,
0.15256108343601227,
0.3725031018257141,
-0.954493105411529... |
func (o MicrosoftGraphWindowsMinimumOperatingSystem) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.V80 != nil {
toSerialize["v8_0"] = o.V80
}
if o.V81 != nil {
toSerialize["v8_1"] = o.V81
}
if o.V100 != nil {
toSerialize["v10_0"] = o.V100
}
return json.Marshal(toSerialize)
} | [
-0.5834829211235046,
-0.5306516885757446,
0.421943336725235,
-0.8047279715538025,
-0.5468366146087646,
-0.651763379573822,
0.10741323977708817,
-0.6073106527328491,
0.6564687490463257,
0.17392359673976898,
-0.6657179594039917,
0.2575947642326355,
-0.74617600440979,
-0.22125382721424103,
... |
func (u *UIDTrackingExpectations) GetUIDs(controllerKey string) sets.String {
if uid, exists, err := u.uidStore.GetByKey(controllerKey); err == nil && exists {
return uid.(*UIDSet).String
}
return nil
} | [
0.2530433237552643,
0.9957212805747986,
0.3491302728652954,
-0.21342861652374268,
0.11736723780632019,
-0.3987012803554535,
0.627748966217041,
-0.3629663586616516,
1.328130841255188,
-0.30639317631721497,
0.9081073999404907,
-0.0009630988352000713,
-0.2978566288948059,
0.571200966835022,
... |
func (u *UIDTrackingExpectations) SetExpectations(controllerKey string, adds int, deletedKeys []string) error {
u.uidStoreLock.Lock()
defer u.uidStoreLock.Unlock()
if existing := u.GetUIDs(controllerKey); existing != nil && existing.Len() != 0 {
glog.Errorf("Clobbering existing delete keys: %+v", existing)
}
ex... | [
-0.39474770426750183,
0.7893075942993164,
0.4287812113761902,
-0.6130275130271912,
0.33272480964660645,
0.33171138167381287,
0.5194926857948303,
-0.03787475824356079,
0.5347099900245667,
0.1740659773349762,
-0.22095653414726257,
0.11991064250469208,
-0.5496423840522766,
0.3456787168979645,... |
func (u *UIDTrackingExpectations) ExpectCreations(controllerKey string, adds int) error {
return u.SetExpectations(controllerKey, adds, []string{})
} | [
-0.03430189564824104,
1.4828698635101318,
0.28680023550987244,
-0.3526310920715332,
0.4333835542201996,
0.8311588764190674,
0.9710021018981934,
-0.3944786489009857,
0.16577638685703278,
-0.7248467206954956,
0.045421354472637177,
-0.509638786315918,
-0.07786484062671661,
0.9960371255874634,... |
func (u *UIDTrackingExpectations) ExpectDeletions(controllerKey string, deletedKeys []string) error {
return u.SetExpectations(controllerKey, 0, deletedKeys)
} | [
0.3298480808734894,
0.9575369954109192,
0.1784435659646988,
-0.25770944356918335,
0.2009802609682083,
0.3117845356464386,
0.48466044664382935,
0.3164135217666626,
0.8303734660148621,
-0.16179293394088745,
0.4000304937362671,
0.4307718575000763,
-0.3512398600578308,
0.5152044892311096,
0.... |
func (u *UIDTrackingExpectations) DeletionObserved(controllerKey, deleteKey string) {
u.uidStoreLock.Lock()
defer u.uidStoreLock.Unlock()
uids := u.GetUIDs(controllerKey)
if uids != nil && uids.Has(deleteKey) {
glog.V(4).Infof("Controller %v received delete for pod %v", controllerKey, deleteKey)
u.Expectations... | [
0.5105688571929932,
0.2794657349586487,
0.3485260605812073,
-0.2181919664144516,
0.10725405067205429,
0.23042286932468414,
0.2480900138616562,
0.07440142333507538,
0.7024311423301697,
0.4878111779689789,
0.4741433262825012,
0.429315984249115,
-0.02307114750146866,
0.7495636343955994,
0.7... |
func (u *UIDTrackingExpectations) DeleteExpectations(rcKey string) {
u.uidStoreLock.Lock()
defer u.uidStoreLock.Unlock()
u.ExpectationsInterface.DeleteExpectations(rcKey)
if uidExp, exists, err := u.uidStore.GetByKey(rcKey); err == nil && exists {
if err := u.uidStore.Delete(uidExp); err != nil {
glog.V(2).In... | [
0.06534551084041595,
0.4038417935371399,
0.22693942487239838,
-0.2105744481086731,
0.09035065025091171,
0.45731836557388306,
1.8299015760421753,
0.22825837135314941,
0.7509249448776245,
0.07794563472270966,
0.15770383179187775,
-0.751917839050293,
-1.2281149625778198,
1.1467809677124023,
... |
func NewUIDTrackingExpectations(ce ExpectationsInterface) *UIDTrackingExpectations {
return &UIDTrackingExpectations{ExpectationsInterface: ce, uidStore: cache.NewStore(UIDSetKeyFunc)}
} | [
-1.0215017795562744,
0.5295419692993164,
0.15213726460933685,
0.18601399660110474,
-0.6691158413887024,
0.8586366772651672,
1.1100538969039917,
0.514548122882843,
0.6949780583381653,
-0.37294790148735046,
-0.10087457299232483,
-0.7765671014785767,
-0.7286089062690735,
-0.04440738260746002,... |
func init() {
bus := core.Bus
bus.Subscribe("main:loadconfig", func(data string) {
fmt.Println("user:Subscribe(main:loadconfig)",data)
})
} | [
0.6831040382385254,
0.3208540380001068,
0.46017172932624817,
0.5604027509689331,
-0.4616609811782837,
0.1984022557735443,
-0.6258704662322998,
0.6839333176612854,
-0.7603753209114075,
-0.12990371882915497,
-1.0380131006240845,
1.0495840311050415,
-0.8244971632957458,
0.973965048789978,
1... |
func TestStringsIndex(t *testing.T) {
tcs := []struct {
word string
substr string
exp int
}{
{word: "Gophers are amazing!", substr: "are", exp: 8},
{word: "Testing in Go is fun.", substr: "fun", exp: 17},
{word: "The answer is 42.", substr: "is", exp: 11},
}
for i := range tcs {
tc := tcs[i]
t... | [
0.24028056859970093,
0.029439330101013184,
0.29351097345352173,
-0.8574405312538147,
0.034887563437223434,
0.35429689288139343,
0.5520660281181335,
-0.12434668838977814,
-0.27627235651016235,
-0.1645512729883194,
-0.0374540276825428,
0.5174552798271179,
-0.6873018145561218,
-0.624011218547... |
func isDaemonSetMarkedForTermination(ds *appsv1.DaemonSet) bool {
return ds.DeletionTimestamp != nil
} | [
-0.4775511920452118,
0.06214939057826996,
0.12666672468185425,
-0.525916576385498,
0.7082117795944214,
-0.30726829171180725,
-0.5407487154006958,
0.13315647840499878,
0.6749194264411926,
-0.09728129953145981,
0.3810586929321289,
-0.24985343217849731,
0.7027097940444946,
0.5863587856292725,... |
func annotateDaemonSet(ctx context.Context, c *kubernetes.Clientset, ds *appsv1.DaemonSet) error {
ds.Annotations["lunarway.com/observed-artifact-id"] = ds.Annotations["lunarway.com/artifact-id"]
_, err := c.AppsV1().DaemonSets(ds.Namespace).Update(ctx, ds, metav1.UpdateOptions{})
if err != nil {
return err
}
re... | [
0.13775940239429474,
-0.8067550659179688,
0.28059932589530945,
-1.4530547857284546,
-0.41177594661712646,
-0.015015765093266964,
0.03446533903479576,
-0.5103779435157776,
0.6488386988639832,
0.24111349880695343,
0.2041417956352234,
1.3612135648727417,
0.9664158821105957,
0.3020690977573395... |
func NewEmptyEntry() *Entry {
return &Entry{make(Fields)}
} | [
0.02404922805726528,
-0.2527371942996979,
-0.16101039946079254,
0.03535374626517296,
-0.46687132120132446,
0.215830460190773,
-0.45892101526260376,
-0.4946042001247406,
-0.5450288653373718,
-0.6798508763313293,
-0.9625265002250671,
0.44179272651672363,
-0.12990260124206543,
0.2917175292968... |
func NewEntry(fields Fields) *Entry {
return &Entry{fields}
} | [
0.7222923040390015,
-0.04707057401537895,
-0.31284788250923157,
0.38032472133636475,
0.11421944200992584,
0.31773263216018677,
-0.33448317646980286,
-0.18784074485301971,
-0.3413887917995453,
0.06546389311552048,
-0.5186600685119629,
0.43660295009613037,
-0.05556006729602814,
0.00377122033... |
func (entry *Entry) Fields() Fields {
return entry.fields
} | [
0.024595845490694046,
0.24513950943946838,
-0.11109526455402374,
-1.020470142364502,
0.4401337802410126,
0.7469373345375061,
-0.38433146476745605,
-0.01427239365875721,
0.6343080997467041,
-0.9036372303962708,
-0.6780915856361389,
0.04606785252690315,
-0.06965350359678268,
-0.2622246742248... |
func (entry *Entry) Field(name string) (value string, err error) {
value, ok := entry.fields[name]
if !ok {
err = fmt.Errorf("field '%v' does not found in record %+v", name, *entry)
}
return
} | [
0.41173630952835083,
0.05642019212245941,
0.36146992444992065,
-0.4373185634613037,
-0.5073572993278503,
0.28236010670661926,
-0.2925959825515747,
-0.4235382080078125,
-0.05057356506586075,
0.6070340275764465,
0.419045090675354,
-0.15417103469371796,
0.010223972611129284,
0.492676347494125... |
func (entry *Entry) FloatField(name string) (value float64, err error) {
tmp, err := entry.Field(name)
if err == nil {
value, err = strconv.ParseFloat(tmp, 64)
}
return
} | [
0.06339656561613083,
0.5002610087394714,
0.40389466285705566,
-0.6166448593139648,
-0.14930319786071777,
-0.04551203176379204,
-0.380168616771698,
-0.38811877369880676,
-0.27308204770088196,
0.5790426135063171,
-0.9749481081962585,
-0.37541526556015015,
-1.139540433883667,
0.5162353515625,... |
func (entry *Entry) IntField64(name string) (value int64, err error) {
tmp, err := entry.Field(name)
if err == nil {
value, err = strconv.ParseInt(tmp, 0, 64)
}
return
} | [
-1.1644343137741089,
0.0738954171538353,
0.3494076430797577,
-0.39890798926353455,
-0.2867448329925537,
-0.46795201301574707,
-0.44679591059684753,
-0.02058468386530876,
-0.19854995608329773,
0.58168625831604,
-0.8014556765556335,
-0.5825905203819275,
-0.9812228679656982,
0.031957890838384... |
func (entry *Entry) IntField(name string) (value int, err error) {
tmp, err := entry.Field(name)
if err == nil {
value, err = strconv.Atoi(tmp)
}
return
} | [
-0.10288930684328079,
-0.24398058652877808,
0.5195452570915222,
-1.4528485536575317,
-0.45731839537620544,
0.030922120437026024,
-0.09580271691083908,
0.04652785882353783,
-0.4667641222476959,
0.706828236579895,
-0.9897668957710266,
-0.5179319977760315,
-0.9898132681846619,
-0.061867989599... |
func (entry *Entry) SetField(name string, value string) {
entry.fields[name] = value
} | [
-0.18516817688941956,
0.34116482734680176,
0.20907989144325256,
-0.8118788003921509,
-0.19454990327358246,
1.1856204271316528,
-0.9636701941490173,
0.1188959926366806,
-0.20785795152187347,
0.11930423974990845,
-1.0032751560211182,
0.004069983959197998,
0.11659985780715942,
0.4031972587108... |
func (entry *Entry) SetFloatField(name string, value float64) {
entry.SetField(name, strconv.FormatFloat(value, 'f', 2, 64))
} | [
0.17955955862998962,
0.2987222671508789,
0.46529579162597656,
-0.36097264289855957,
-0.022546736523509026,
0.37210771441459656,
-0.07767084240913391,
-0.48468121886253357,
-0.28240400552749634,
0.20020851492881775,
-1.2026041746139526,
-0.18072855472564697,
-0.04350770637392998,
0.93003243... |
func (entry *Entry) SetUintField(name string, value uint64) {
entry.SetField(name, strconv.FormatUint(uint64(value), 10))
} | [
0.05001743882894516,
0.14151249825954437,
0.4468488097190857,
-1.0787911415100098,
0.02240385115146637,
0.24640485644340515,
-0.33034342527389526,
0.6374101042747498,
0.4793825149536133,
-0.25229111313819885,
-1.301804542541504,
-0.22640138864517212,
0.8600064516067505,
0.7880628108978271,... |
func (entry *Entry) Merge(merge *Entry) {
for name, value := range merge.fields {
entry.SetField(name, value)
}
} | [
-1.0288589000701904,
0.7579480409622192,
0.49631813168525696,
0.13207174837589264,
0.42067044973373413,
0.3155076801776886,
-0.9476659893989563,
0.5838820338249207,
-0.16350145637989044,
-0.8075084686279297,
-1.41909658908844,
-0.24296946823596954,
-0.5031646490097046,
0.9850749969482422,
... |
func (entry *Entry) FieldsHash(fields []string) string {
var key []string
for _, name := range fields {
value, err := entry.Field(name)
if err != nil {
value = "NULL"
}
key = append(key, fmt.Sprintf("'%v'=%v", name, value))
}
return strings.Join(key, ";")
} | [
0.8663142323493958,
0.04555392637848854,
0.492765873670578,
-0.6260172724723816,
0.3180440664291382,
0.6106653213500977,
-0.9634023308753967,
-0.04952702298760414,
-0.030656788498163223,
0.3316488564014435,
-0.3224004805088043,
-0.11737941205501556,
-0.0027538067661225796,
-0.5025179982185... |
func (entry *Entry) Partial(fields []string) *Entry {
partial := NewEmptyEntry()
for _, name := range fields {
value, _ := entry.Field(name)
partial.SetField(name, value)
}
return partial
} | [
-0.13185515999794006,
-0.3942805230617523,
0.23948688805103302,
-1.0914318561553955,
0.059143032878637314,
0.4960263967514038,
-0.2919711470603943,
-0.6055216193199158,
-0.48351937532424927,
-0.4092846214771271,
-0.5191767811775208,
-0.15236206352710724,
-0.3092903196811676,
-0.30633056163... |
func NewSectionsRepositoryImpl(dbConn *gorm.DB) SectionsRepository {
return &SectionsRepositoryImpl{dbConn: dbConn}
} | [
-0.10470409691333771,
-0.23635996878147125,
0.16320854425430298,
-0.7691934704780579,
-1.0959155559539795,
-0.509358286857605,
0.025280099362134933,
-0.2963326871395111,
0.5562167167663574,
0.4039938151836395,
-0.013584510423243046,
-1.9264569282531738,
0.13166701793670654,
0.8133401870727... |
func (secRepo SectionsRepositoryImpl) CreateSection(ctx context.Context,
sectionReq models.Sections) (interface{}, error) {
//databse connection
conn := secRepo.dbConn
createOn := time.Now().In(time.UTC)
//record create Time
sectionReq.CreatedAt = createOn
//record update time change
sectionReq.UpdatedAt = c... | [
-0.48079854249954224,
-0.40698856115341187,
0.822668731212616,
0.12984205782413483,
0.052311915904283524,
0.7224142551422119,
-0.0888601616024971,
-0.32011961936950684,
-0.4110441207885742,
0.6413576006889343,
0.47898951172828674,
-1.1062781810760498,
-0.389850378036499,
1.2307543754577637... |
func (secRepo SectionsRepositoryImpl) GetSections(ctx context.Context,
courseID uint32, sectionID uint32) (*models.Sections, error) {
//databse connection
conn := secRepo.dbConn
section := models.Sections{}
if err := conn.Where("id=?", sectionID).Find(§ion).Error; err != nil {
log.Logger(ctx).Error(err)
... | [
0.31591203808784485,
0.26470887660980225,
0.43713927268981934,
0.03307776898145676,
0.9785365462303162,
-0.17805129289627075,
0.12280933558940887,
-0.9219411611557007,
-0.2771736979484558,
0.6820819973945618,
0.6008607745170593,
-0.008406528271734715,
-0.224618598818779,
0.6681954860687256... |
func (secRepo SectionsRepositoryImpl) GetAllSections(ctx context.Context,
page uint32) (*[]models.Sections, error) {
//databse connection
conn := secRepo.dbConn
sections := []models.Sections{}
if err := conn.Limit(SectionRecordRetriveLimit).
Offset(SectionRecordRetriveLimit * page).
Find(§ions).Error; er... | [
0.22965632379055023,
0.033591218292713165,
0.8098686933517456,
0.2349645346403122,
0.26427018642425537,
0.4832209050655365,
-0.36834636330604553,
0.0696418508887291,
0.35373592376708984,
0.14879274368286133,
0.29937028884887695,
-0.3268381655216217,
-0.6927134394645691,
1.2701921463012695,... |
func (m PhysicsMotor) String() string {
return rbxfile.ValueCFrame(m).String()
} | [
0.6022717356681824,
-1.0387905836105347,
-0.019486170262098312,
0.2657206654548645,
0.22425036132335663,
1.2440217733383179,
-0.013302327133715153,
-1.4111043214797974,
-0.9004278182983398,
-0.39242562651634216,
0.818067193031311,
0.06800856441259384,
-0.8090843558311462,
0.249479055404663... |
func (b *extendedReader) readVector3Simple() (rbxfile.ValueVector3, error) {
var err error
val := rbxfile.ValueVector3{}
val.X, err = b.readFloat32BE()
if err != nil {
return val, err
}
val.Y, err = b.readFloat32BE()
if err != nil {
return val, err
}
val.Z, err = b.readFloat32BE()
return val, err
} | [
-0.2654602527618408,
0.015262582339346409,
0.8948763012886047,
-0.05981624498963356,
-0.23676778376102448,
0.9122925996780396,
-0.6686006784439087,
-0.24794326722621918,
0.49461907148361206,
0.12183231860399246,
0.014251531101763248,
-0.12993890047073364,
-0.6379615664482117,
0.10876178741... |
func (b *extendedReader) readVector3() (rbxfile.ValueVector3, error) {
val := rbxfile.ValueVector3{}
/*isInteger, err := b.readBool()
if err != nil {
return rbxfile.ValueVector3{}, err
}
if !isInteger {
return b.readVector3Simple()
}
x, err := b.bits(11)
if err != nil {
return val, err
}
xShort := uint1... | [
-0.02147851139307022,
-0.2697608172893524,
0.8836977481842041,
-0.08397665619850159,
-0.2224125862121582,
0.6664566397666931,
-0.10240340232849121,
-0.13283832371234894,
0.9063698053359985,
0.6346088647842407,
0.13990552723407745,
0.44504666328430176,
-0.5183500647544861,
-0.20574954152107... |
func (b *extendedReader) readPFloat() (rbxfile.ValueFloat, error) {
val, err := b.readFloat32BE()
return rbxfile.ValueFloat(val), err
} | [
0.9018442034721375,
0.7304133772850037,
0.7546509504318237,
0.3532756268978119,
-0.6093848943710327,
0.5007607340812683,
-0.7395220994949341,
-0.7627798914909363,
-1.168192744255066,
-1.1577340364456177,
0.6738761067390442,
-0.35490790009498596,
-0.8660765886306763,
0.8912351727485657,
-... |
func (b *extendedReader) readPDouble() (rbxfile.ValueDouble, error) {
val, err := b.readFloat64BE()
return rbxfile.ValueDouble(val), err
} | [
-0.2847101390361786,
0.38257986307144165,
1.0327013731002808,
0.8882280588150024,
-0.1513797491788864,
0.9503817558288574,
-0.9091469049453735,
-0.6424438953399658,
-1.1857625246047974,
-0.2354779690504074,
0.9096532464027405,
-0.3037034571170807,
-0.2616405189037323,
0.24183635413646698,
... |
func (b *extendedReader) readSystemAddress() (datamodel.ValueSystemAddress, error) {
val, err := b.readVarint64()
if err != nil {
return datamodel.ValueSystemAddress(0), err
}
thisAddress := datamodel.ValueSystemAddress(val)
return thisAddress, err
} | [
-0.6303902864456177,
-0.6093606352806091,
0.742753267288208,
0.6269201636314392,
-0.4774956703186035,
-0.8986786603927612,
-0.08157484233379364,
0.033721357583999634,
0.964969277381897,
0.06322973966598511,
-0.1125035509467125,
1.2580441236495972,
-0.4780190587043762,
0.4233097434043884,
... |
func (b *extendedReader) readNewEnumValue(enumID uint16, context *CommunicationContext) (datamodel.ValueToken, error) {
val, err := b.readUintUTF8()
token := datamodel.ValueToken{Value: val, ID: enumID}
return token, err
} | [
-1.0807609558105469,
-0.041722510010004044,
0.5058711767196655,
-0.3104591369628906,
-0.5328880548477173,
0.03720216453075409,
-0.43557921051979065,
0.15169581770896912,
0.3109338581562042,
-0.0863887220621109,
-0.1383991688489914,
1.0977942943572998,
0.2987375557422638,
0.2723464369773865... |
func (b *extendedReader) readNewTypeAndValue(reader PacketReader, deferred deferredStrings) (rbxfile.Value, error) {
var val rbxfile.Value
thisType, err := b.readUint8()
if err != nil {
return val, err
}
var enumID uint16
if thisType == PropertyTypeEnum {
enumID, err = b.readUint16BE()
if err != nil {
r... | [
-0.9751687049865723,
-1.0905747413635254,
0.8001063466072083,
-0.17593823373317719,
-0.6218380331993103,
0.5674181580543518,
-0.8252868056297302,
-0.502860963344574,
-0.23774178326129913,
-0.00414972472935915,
0.653205394744873,
0.6002362966537476,
-0.2395247519016266,
0.8678199648857117,
... |
func (RawEvent) Fields() []ent.Field {
return []ent.Field{
field.UUID("id", uuid.UUID{}).Default(uuid.New),
field.UUID("tracking_id", uuid.UUID{}),
field.String("user_id"),
field.Bool("anonymous"),
field.String("group_id").Optional(),
field.String("session_id").Optional(),
field.String("device_id").Optio... | [
-0.40706419944763184,
0.18515317142009735,
0.5990537405014038,
-0.810046911239624,
0.16202591359615326,
0.5115458965301514,
-0.8060569167137146,
0.2947445511817932,
0.39210331439971924,
0.04259754344820976,
-0.4487574100494385,
-0.1795887053012848,
0.0734030231833458,
-0.09559734910726547,... |
func (RawEvent) Edges() []ent.Edge {
return nil
} | [
-0.3111112713813782,
-0.23826949298381805,
0.5711164474487305,
-0.34825077652931213,
0.6076937913894653,
0.04043871909379959,
-0.7834116816520691,
0.9305200576782227,
0.7416605949401855,
-0.9083547592163086,
-0.4034006893634796,
0.3461924195289612,
0.16567599773406982,
0.2228803187608719,
... |
func Start(container string) error {
cmd := exec.Command("docker", "start", container)
return runWithLogging(cmd)
} | [
0.026293858885765076,
0.07949365675449371,
0.4810253977775574,
1.1131147146224976,
-0.007028698921203613,
-0.11989786475896835,
0.477740079164505,
-0.00756024569272995,
0.11387262493371964,
0.1893032044172287,
-0.5137295722961426,
1.3128317594528198,
0.5682039260864258,
0.4965879023075104,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.