text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (d *PostgresDatabase) Get(user string) (u model.User, err error) {
opMetric.WithLabelValues("get-user").Inc()
ostart := time.Now()
defer opDuration.WithLabelValues("get-user").Observe(time.Since(ostart).Seconds())
usr := model.User{}
rows, err := d.db.Query(querySelectUser, user)
if err != nil {
opErrMe... | [
-0.4879169762134552,
0.0945722907781601,
0.8453229665756226,
0.7751796245574951,
-0.1325387805700302,
-0.0778995230793953,
0.7195591926574707,
-0.5975930690765381,
-0.16860556602478027,
0.2541853189468384,
0.40024682879447937,
0.7589155435562134,
-0.19609296321868896,
0.02848907560110092,
... |
func (d *PostgresDatabase) Close() error {
return d.db.Close()
} | [
-0.8797736763954163,
1.0936081409454346,
0.2740194499492645,
0.35746848583221436,
-0.35449081659317017,
0.7398554086685181,
-0.11289416998624802,
-0.5309985876083374,
-0.7306130528450012,
-0.5811218023300171,
0.5965362191200256,
0.4463735818862915,
-1.3853325843811035,
1.0275273323059082,
... |
func NewEth(th *eth.Ethereum) *EthModule {
mm := new(EthModule)
m := new(Eth)
// Here we load default config and leave it to caller
// to read a config file to overwrite
mm.Config = DefaultConfig
m.config = mm.Config
if th != nil {
m.ethereum = th
}
m.started = false
mm.eth = m
return mm
} | [
-0.045357149094343185,
-0.6084804534912109,
0.3756289780139923,
-0.14705638587474823,
0.7454892992973328,
1.022284746170044,
0.33848485350608826,
-0.35081008076667786,
0.6359483599662781,
0.4127799868583679,
0.20280975103378296,
-0.05359392613172531,
-0.10354545712471008,
0.955010175704956... |
func (mod *EthModule) Init() error {
m := mod.eth
// if didn't call NewEth
if m.config == nil {
m.config = DefaultConfig
}
//ethdoug.Adversary = mod.Config.Adversary
// if no ethereum instance
if m.ethereum == nil {
m.ethConfig()
m.newEthereum()
}
// public interface
pipe := xeth.New(m.ethereum)
// ... | [
0.010733899660408497,
-0.037301186472177505,
0.909184455871582,
-0.8516395092010498,
0.9855921268463135,
0.7621771693229675,
-0.06893672794103622,
0.16558393836021423,
-0.4988449811935425,
0.327598512172699,
-0.3327063024044037,
0.6677410006523132,
-0.13902607560157776,
1.359788417816162,
... |
func (mod *EthModule) Start() error {
m := mod.eth
m.ethereum.Start(true) // peer seed
m.started = true
if m.config.Mining {
StartMining(m.ethereum)
}
return nil
} | [
0.04890008270740509,
-0.0977780893445015,
0.40778273344039917,
0.054102566093206406,
1.381988763809204,
0.8117097616195679,
0.4527128040790558,
0.7442214488983154,
0.13617797195911407,
0.5697293281555176,
-0.5525612235069275,
0.5989232659339905,
-0.21135655045509338,
1.0625675916671753,
... |
func (mod *EthModule) Name() string {
return "eth"
} | [
-0.6227532625198364,
-0.22265905141830444,
0.6258803009986877,
-0.24367757141590118,
0.15536589920520782,
1.2792500257492065,
-0.31754690408706665,
-0.2751549482345581,
0.2537634074687958,
1.5764940977096558,
-0.6187182664871216,
-0.21024750173091888,
0.05685867741703987,
0.849706947803497... |
func (mod *EthModule) WorldState() *types.WorldState {
return mod.eth.WorldState()
} | [
0.12088178098201752,
-0.08112281560897827,
0.561662495136261,
-0.2861241102218628,
-0.28351685404777527,
0.4581690728664398,
0.08197950571775436,
-0.45730340480804443,
0.33353838324546814,
1.0085387229919434,
-0.0125044584274292,
-0.06247907131910324,
-1.0998612642288208,
0.700546503067016... |
func (mod *EthModule) ActiveAddress() string {
return mod.eth.ActiveAddress()
} | [
0.5211361050605774,
-2.1092493534088135,
0.4935566484928131,
0.0455767884850502,
0.5805028676986694,
0.5561181306838989,
0.1547512263059616,
0.6842434406280518,
1.1922149658203125,
-0.01187443733215332,
-0.01969502680003643,
0.7842966914176941,
-0.9564273953437805,
-0.5310361385345459,
0... |
func (mod *EthModule) EthState() *state.State {
return mod.eth.pipe.World().State()
} | [
0.2571961581707001,
-0.40341636538505554,
0.6635792851448059,
-0.3173336088657379,
-0.2909131646156311,
1.0950738191604614,
0.3382453918457031,
0.42597100138664246,
0.1886136829853058,
0.11631844192743301,
0.08772990852594376,
-0.011258085258305073,
-0.3811768591403961,
0.6677484512329102,... |
func (eth *Eth) Msg(addr string, data []string) (string, error) {
packed := PackTxDataArgs(data...)
keys := eth.fetchKeyPair()
//addr = ethutil.StripHex(addr)
byte_addr := ethutil.Hex2Bytes(addr)
hash, err := eth.pipe.Transact(keys, byte_addr, ethutil.NewValue(ethutil.Big("350")), ethutil.NewValue(ethutil.Big("200... | [
-0.013107911683619022,
1.146422266960144,
1.0554172992706299,
-0.533378541469574,
-0.9298808574676514,
0.24326559901237488,
-0.7390863299369812,
0.6241587400436401,
-0.016352245584130287,
1.1184183359146118,
-0.023403475061058998,
0.05918218940496445,
0.39448532462120056,
0.257950186729431... |
func (eth *Eth) Subscribe(name, event, target string) chan types.Event {
/*
th_ch := make(chan ethreact.Event, 1)
if target != "" {
addr := string(ethutil.Hex2Bytes(target))
eth.reactor.Subscribe("object:"+addr, th_ch)
} else {
eth.reactor.Subscribe(event, th_ch)
}
ch := make(chan events.Event)
e... | [
0.48429253697395325,
-0.5165789127349854,
0.9112314581871033,
-0.4433852434158325,
-0.011054441332817078,
-0.6622459292411804,
-0.6505581736564636,
0.050509098917245865,
0.39615610241889954,
0.12234144657850266,
0.05460694804787636,
0.39124077558517456,
0.0969267413020134,
-0.4647035896778... |
func (m *Eth) AutoCommit(toggle bool) {
if toggle {
m.StartMining()
} else {
m.StopMining()
}
} | [
0.6103801727294922,
-0.28634321689605713,
0.5985983610153198,
0.365774005651474,
0.3228054642677307,
-0.07735026627779007,
0.5202580094337463,
0.9879064559936523,
-0.9809828400611877,
0.6706269979476929,
0.5294948816299438,
0.11293306201696396,
-1.1281678676605225,
0.03278340399265289,
-... |
func (eth *Eth) ActiveAddress() string {
keypair := eth.keyManager.KeyPair()
addr := ethutil.Bytes2Hex(keypair.Address())
return addr
} | [
-0.21279047429561615,
-1.863224744796753,
0.685648500919342,
-0.29582616686820984,
-0.310452401638031,
0.1267782300710678,
-0.37055253982543945,
0.9984650015830994,
0.8369673490524292,
0.24796578288078308,
-0.02332543581724167,
0.7623234391212463,
-0.8554624915122986,
-0.7923394441604614,
... |
func (eth *Eth) Address(n int) (string, error) {
ring := eth.keyManager.KeyRing()
if n >= ring.Len() {
return "", fmt.Errorf("cursor %d out of range (0..%d)", n, ring.Len())
}
pair := ring.GetKeyPair(n)
addr := ethutil.Bytes2Hex(pair.Address())
return addr, nil
} | [
-1.2749886512756348,
-0.3285743296146393,
0.8948750495910645,
-0.24609965085983276,
-0.7046589255332947,
0.5253744125366211,
-0.0010795117123052478,
-0.2419458031654358,
0.7027248740196228,
0.909713864326477,
0.1443752646446228,
-0.4360245168209076,
-0.35354000329971313,
0.7870469093322754... |
func (eth *Eth) SetAddressN(n int) error {
return eth.keyManager.SetCursor(n)
} | [
-1.2984305620193481,
-0.25527533888816833,
0.3209577202796936,
0.1846499741077423,
-0.45698368549346924,
-0.6726970076560974,
0.1746336817741394,
0.07342029362916946,
0.7226884365081787,
0.1584758311510086,
-1.2847093343734741,
0.3567158877849579,
0.22363393008708954,
0.7254311442375183,
... |
func (eth *Eth) NewAddress(set bool) string {
newpair := crypto.GenerateNewKeyPair()
addr := ethutil.Bytes2Hex(newpair.Address())
ring := eth.keyManager.KeyRing()
ring.AddKeyPair(newpair)
if set {
eth.SetAddressN(ring.Len() - 1)
}
return addr
} | [
-0.8233181834220886,
-0.021440740674734116,
0.6780766844749451,
-0.40921318531036377,
-0.4486480951309204,
0.4438225328922272,
-0.9624603390693665,
-0.006702736485749483,
0.5945972800254822,
0.7285547852516174,
0.2499695122241974,
0.44771426916122437,
-0.8615420460700989,
0.114271290600299... |
func (eth *Eth) AddressCount() int {
return eth.keyManager.KeyRing().Len()
} | [
-0.11000373214483261,
0.10593579709529877,
0.6081246137619019,
-0.6064428091049194,
-0.035135574638843536,
0.2346922606229782,
-0.14762011170387268,
0.31121814250946045,
0.2480047196149826,
0.8560758233070374,
-0.3249233663082123,
0.560464084148407,
-0.38152840733528137,
0.3284185826778412... |
func (m *Eth) newEthereum() {
db := NewDatabase(m.config.DbName)
keyManager := NewKeyManager(m.config.KeyStore, m.config.RootDir, db)
err := keyManager.Init(m.config.KeySession, m.config.KeyCursor, false)
if err != nil {
log.Fatal(err)
}
m.keyManager = keyManager
clientIdentity := NewClientIdentity(m.config.... | [
-0.508039653301239,
-0.6093404293060303,
0.7934263944625854,
-0.13412734866142273,
0.8262065649032593,
0.3428499400615692,
0.19309179484844208,
0.5832287073135376,
-0.03576730191707611,
-0.08383656293153763,
-0.6627976298332214,
0.5130655169487,
-0.22831381857395172,
0.7415885925292969,
... |
func (eth *Eth) fetchPriv() string {
keypair := eth.keyManager.KeyPair()
priv := ethutil.Bytes2Hex(keypair.PrivateKey)
return priv
} | [
0.23017318546772003,
0.017947828397154808,
0.6487917304039001,
0.0009310389286838472,
-1.0704259872436523,
0.6084269881248474,
-1.610658049583435,
-0.6056363582611084,
0.24911104142665863,
0.1383231282234192,
-0.06720509380102158,
0.49817657470703125,
-0.341147780418396,
0.349471777677536,... |
func (eth *Eth) FetchPriv() string {
return eth.fetchPriv()
} | [
0.6998531818389893,
0.3193534016609192,
0.3820132613182068,
0.26931124925613403,
-1.2863024473190308,
0.15074770152568817,
-1.0132404565811157,
-1.0691125392913818,
0.30593952536582947,
-0.36221885681152344,
0.6015051603317261,
0.061209626495838165,
-0.35852867364883423,
-0.266326367855072... |
func CompileLLL(filename string, literal bool) string {
/*
code, err := ethutil.CompileLLL(filename, literal)
if err != nil {
fmt.Println("error compiling lll!", err)
return ""
}*/
return "0x" //+ ethutil.Bytes2Hex(code)
} | [
0.20536045730113983,
-0.7847970128059387,
0.8024442791938782,
0.32334208488464355,
-0.8307386040687561,
1.1735321283340454,
-0.2531825304031372,
1.3971434831619263,
0.04480302333831787,
0.6455161571502686,
0.07855372875928879,
0.09005658328533173,
0.12484396994113922,
0.01666254736483097,
... |
func homeDir() string {
usr, _ := user.Current()
return usr.HomeDir
} | [
0.4266802966594696,
-1.061375379562378,
0.44142255187034607,
1.4937807321548462,
-1.2999495267868042,
0.8122320771217346,
0.5314913988113403,
0.10891348123550415,
0.13280977308750153,
-0.7699798941612244,
0.8834359645843506,
0.5752496719360352,
-0.3532131314277649,
0.6530506610870361,
0.... |
func BigNumStrToHex(s string) string {
bignum := ethutil.Big(s)
bignum_bytes := ethutil.BigToBytes(bignum, 16)
return ethutil.Bytes2Hex(bignum_bytes)
} | [
0.30492791533470154,
0.21072669327259064,
0.44289126992225647,
-0.5662143230438232,
-0.04979493468999863,
0.13715946674346924,
-0.42781564593315125,
1.0706332921981812,
0.228964701294899,
0.007038409821689129,
-0.06813612580299377,
0.141514852643013,
0.08118569850921631,
-0.887872695922851... |
func SHA3(tohash string) string {
h := crypto.Sha3([]byte(tohash))
return ethutil.Bytes2Hex(h)
} | [
-0.17560867965221405,
0.6491754055023193,
0.3982149660587311,
-0.10441624373197556,
-0.5830255746841431,
1.2481863498687744,
-1.3218588829040527,
0.6026555895805359,
0.4317217767238617,
0.9031712412834167,
-0.1412394791841507,
0.25719955563545227,
0.1970163732767105,
-1.4084835052490234,
... |
func PackTxDataArgs(args ...string) string {
//fmt.Println("pack data:", args)
ret := *new([]byte)
for _, s := range args {
if s[:2] == "0x" {
t := s[2:]
if len(t)%2 == 1 {
t = "0" + t
}
x := ethutil.Hex2Bytes(t)
//fmt.Println(x)
l := len(x)
ret = append(ret, ethutil.LeftPadBytes(x, 32*((l... | [
-0.5384654402732849,
0.3947514593601227,
0.96527099609375,
-0.13093097507953644,
0.06739494204521179,
1.0241246223449707,
-0.8721365332603455,
0.19266213476657867,
-0.14404062926769257,
-0.019628658890724182,
-0.2700803875923157,
-0.4096250832080841,
-0.34022465348243713,
0.987265765666961... |
func convertBlock(block *ethtypes.Block) *types.Block {
if block == nil {
return nil
}
b := &types.Block{}
b.Coinbase = hex.EncodeToString(block.Coinbase)
b.Difficulty = block.Difficulty.String()
b.GasLimit = block.GasLimit.String()
b.GasUsed = block.GasUsed.String()
b.Hash = hex.EncodeToString(block.Hash())
... | [
-0.6443386673927307,
0.12497134506702423,
0.7970339059829712,
-0.44022589921951294,
0.11289750039577484,
-0.9336435794830322,
-0.5425713062286377,
-0.4273780286312103,
0.6629498600959778,
0.13799183070659637,
-0.5979969501495361,
0.009646834805607796,
0.006747507490217686,
0.30158457159996... |
func convertTx(ethTx *ethtypes.Transaction) *types.Transaction {
tx := &types.Transaction{}
tx.ContractCreation = ethTx.CreatesContract()
tx.Gas = ethTx.Gas.String()
tx.GasCost = ethTx.GasPrice.String()
tx.Hash = hex.EncodeToString(ethTx.Hash())
tx.Nonce = fmt.Sprintf("%d", ethTx.Nonce)
tx.Recipient = hex.Encode... | [
-0.21799784898757935,
-0.07808376848697662,
0.728199303150177,
-0.713773250579834,
-0.19173191487789154,
0.2689335346221924,
-1.60756516456604,
-0.45036882162094116,
0.49516168236732483,
-0.05969487875699997,
-0.9328186511993408,
-0.34364476799964905,
0.23222775757312775,
0.013021785765886... |
func abs(n int) int {
y := n >> 31
return (n ^ y) - y
} | [
-1.4424206018447876,
0.26142895221710205,
0.31211116909980774,
0.13201060891151428,
-0.7202624082565308,
1.1381553411483765,
-0.5823039412498474,
-1.1462165117263794,
-0.3041682541370392,
-0.22365722060203552,
0.3109748661518097,
0.7860984802246094,
0.5046574473381042,
0.42605483531951904,... |
func AnySatisfies(pred StringPredicate, slice []string) bool {
for _, sliceString := range slice {
if pred(sliceString) {
return true
}
}
return false
} | [
0.20154178142547607,
-0.8962246775627136,
0.44350528717041016,
-0.4314456880092621,
-0.8422414064407349,
-0.3504962921142578,
-1.553837776184082,
0.9687811732292175,
-0.9110886454582214,
-0.3864157795906067,
-0.2850343883037567,
0.45578882098197937,
0.03142450377345085,
0.6765109896659851,... |
func StrIn(str string, slice []string) bool {
pred := func(strx string) bool { return (strx == str) }
return AnySatisfies(pred, slice)
} | [
-0.24284088611602783,
-0.788416862487793,
0.31339031457901,
0.039560090750455856,
-1.3993476629257202,
0.1691860854625702,
-0.662775456905365,
-0.46658816933631897,
-0.6926007270812988,
-0.6692467927932739,
0.06879410147666931,
0.7865674495697021,
-0.07010849565267563,
0.007968399673700333... |
func RemovePathChars(str string) string {
toReturn := str
disallowed := []string{
"/", "?", "<", ">", `\`, ":", "*", "|", `"`, "^", "%", " ",
}
for _, char := range disallowed {
toReturn = strings.Replace(toReturn, char, "-", -1)
}
return toReturn
} | [
-0.5620880722999573,
-1.21793532371521,
0.6719608902931213,
0.7818613052368164,
-1.4127213954925537,
0.8790950179100037,
0.5882405042648315,
0.3631427586078644,
-0.5323368310928345,
0.035310909152030945,
-0.4433024525642395,
-0.4284634292125702,
-1.4094481468200684,
-0.49721384048461914,
... |
func FileContains(path string, subslice []byte) bool {
data, err := ioutil.ReadFile(path)
if err != nil {
sh.CouldntReadError(path, err)
}
return bytes.Contains(data, subslice)
} | [
0.9311900734901428,
-0.2542988359928131,
0.5848641395568848,
0.03699472174048424,
-0.16506816446781158,
0.7371487021446228,
-0.8891081213951111,
-0.04618997499346733,
-1.2287719249725342,
-0.1716945618391037,
0.4969590902328491,
0.23080550134181976,
0.6362136602401733,
-0.10361998528242111... |
func FileToBytes(path string) []byte {
data, err := ioutil.ReadFile(path)
if err != nil {
log.WithFields(log.Fields{
"path": path,
}).Fatal(err.Error())
}
return data
} | [
0.38303112983703613,
0.0942825898528099,
0.563852071762085,
-0.4969899356365204,
0.4557752311229706,
0.4968123733997345,
-0.42863062024116516,
-0.8702839612960815,
-0.845390796661377,
0.16706803441047668,
-0.7466703057289124,
-0.10884341597557068,
0.2580004334449768,
0.23805557191371918,
... |
func FileToLines(path string) [][]byte {
return bytes.Split(FileToBytes(path), []byte("\n"))
} | [
0.08861356228590012,
-0.011501672677695751,
0.6032218933105469,
-0.536051332950592,
0.18035607039928436,
-0.23402126133441925,
-0.755415678024292,
-0.3773091435432434,
-0.2660292685031891,
0.2999372184276581,
-0.5737349987030029,
-0.26057279109954834,
0.5886498093605042,
0.4995421469211578... |
func ExecuteWithOutput(cmd *exec.Cmd) (outStr string, err error) {
// connect to stdout and stderr for filtering purposes
errPipe, err := cmd.StderrPipe()
if err != nil {
log.WithFields(log.Fields{
"cmd": cmd.Args,
}).Fatal("Couldn't connect to command's stderr")
}
outPipe, err := cmd.StdoutPipe()
if err !... | [
0.20765799283981323,
-0.9928176403045654,
0.998761773109436,
-0.18425731360912323,
-0.7214073538780212,
-0.535895824432373,
-0.22221243381500244,
-0.6134701371192932,
-0.4561401307582855,
0.8332397937774658,
0.5509945154190063,
-0.3457741141319275,
-0.05163728445768356,
0.06667868047952652... |
func getBranch(urlstr string, branch string, dst string) {
log.Debugf("Getting branch %s", branch)
if sh.DirExists(dst) {
log.Infof("Folder exists, skipping cloning %s", dst)
log.Infof("Checking out %s", branch)
if oldPwd := sh.Pwd(); !(oldPwd == dst) {
sh.Cd(dst)
sh.SetE(exec.Command("git", "checkout", b... | [
0.2623533606529236,
0.8687725067138672,
0.6714486479759216,
1.3510079383850098,
0.20708267390727997,
0.23479114472866058,
0.08380861580371857,
0.6790637373924255,
0.00021096639102324843,
-0.1783408373594284,
0.5734718441963196,
1.502457857131958,
-0.015323786996304989,
0.6906678676605225,
... |
func runTerraform(path string) {
oldPwd := sh.Pwd()
sh.Cd(path)
log.Debug("Checking to see if terraform can be executed properly")
sh.SetE(exec.Command("terraform", "--version"))
cmds := []*exec.Cmd{
exec.Command("terraform", "get"),
exec.Command("terraform", "plan"),
exec.Command("terraform", "apply"),
}
... | [
0.1078682541847229,
-0.5199427604675293,
0.6616114974021912,
0.08040725439786911,
0.7564916610717773,
0.25185251235961914,
0.4256879687309265,
-0.2703295350074768,
-0.5770872831344604,
0.1811911165714264,
0.026648329570889473,
-0.16122716665267944,
-0.06560665369033813,
0.21781842410564423... |
func waitForHosts(path string) {
oldPwd := sh.Pwd()
sh.Cd(path)
log.Debug("Ensuring ansible-playbook can be executed properly")
sh.SetE(exec.Command("ansible-playbook", "--version"))
pathToPlaybook := "./playbooks/wait-for-hosts.yml"
ansibleCommand := []string{
"-i", "plugins/inventory/terraform.py",
"-e", "a... | [
0.06356819719076157,
-0.013198873028159142,
0.5633411407470703,
-0.4598599374294281,
0.3716287314891815,
0.5913559198379517,
0.5619809627532959,
0.1144438162446022,
-1.2120991945266724,
-0.5503743886947632,
-0.1496002972126007,
-0.10582219809293747,
0.22600886225700378,
0.3495561480522156,... |
func runAnsible(path string, opts []string) {
oldPwd := sh.Pwd()
sh.Cd(path)
log.Debug("Ensuring ansible-playbook can be executed properly")
sh.SetE(exec.Command("ansible-playbook", "--version"))
ansibleCommand := []string{
"-i", "plugins/inventory/terraform.py",
"-e", "ansible_python_interpreter=" + strings.T... | [
-0.1748351752758026,
-0.9263501167297363,
0.9388785362243652,
0.14631429314613342,
0.024016540497541428,
0.32531797885894775,
0.6276721358299255,
-0.2945956587791443,
-0.5304713845252991,
1.0883797407150269,
-0.2274809628725052,
0.28820985555648804,
-0.43111366033554077,
0.3053691983222961... |
func deployToCloud(platform string, branch string) {
getBranch(repoURL, branch, repoDir)
oldPwd := sh.Pwd()
sh.Cd(repoDir)
copyNecessaryFiles(platform)
runTerraform(repoDir)
waitForHosts(repoDir)
runAnsible(repoDir, []string{})
sh.Cd(oldPwd)
log.Debug("Done deploying!")
} | [
0.19468601047992706,
0.4053201377391815,
0.5744898915290833,
0.2068934589624405,
0.31041213870048523,
0.3909972608089447,
0.31699225306510925,
-0.06484156101942062,
-1.2633169889450073,
0.7854761481285095,
0.07412762939929962,
-0.4931430220603943,
-0.09665753692388535,
0.6257761716842651,
... |
func deployToVagrant(branch string) {
getBranch(repoURL, branch, repoDir)
oldPwd := sh.Pwd()
sh.Cd(repoDir)
log.Info("Bringing Vagrant box up, please wait.")
sh.SetE(exec.Command("vagrant", "up"))
sh.Cd(oldPwd)
} | [
-0.20524434745311737,
-0.4205215871334076,
0.6721514463424683,
-0.05087584629654884,
0.024800190702080727,
0.5772975087165833,
-0.30004963278770447,
0.4048301577568054,
-0.23285268247127533,
0.7523097395896912,
0.22382496297359467,
0.6236258745193481,
-0.13325124979019165,
0.09948449581861... |
func promptDestroy(filter string) {
log.Debug("Beginning destruction prompt process")
oldPwd := sh.Pwd()
// find all active deployments
sh.Cd("deployments/")
deploymentInfos, err := ioutil.ReadDir(".")
sh.CouldntReadError(deploymentDir, err)
toList := []string{}
deployments := []string{}
for _, deploymentInfo... | [
-0.6292473077774048,
-0.5678168535232544,
0.756084144115448,
-0.1317310482263565,
0.22113275527954102,
0.4072088599205017,
0.6104883551597595,
0.6457327008247375,
0.27702412009239197,
0.12408474087715149,
0.5623978972434998,
0.3948546051979065,
0.027760591357946396,
-0.07576263695955276,
... |
func terraformDestroy(path string) {
oldPwd := sh.Pwd()
sh.Cd(path)
log.Info("Destroying terraformed resources...")
if !sh.FileExists("terraform.tfstate") {
log.WithFields(log.Fields{
"pwd": sh.Pwd(),
}).Warn("No terraform.tfstate file to use in destruction!")
}
cmd := exec.Command("terraform", "destroy", ... | [
0.2370966672897339,
0.3538045585155487,
0.455247163772583,
-0.6402294039726257,
1.2542585134506226,
-0.07685089111328125,
0.5314264297485352,
0.1394016593694687,
-0.6941255927085876,
0.5067084431648254,
0.12141094356775284,
-0.732778012752533,
0.056757066398859024,
0.7608228325843811,
0.... |
func destroyDeployment(toRemove string) {
log.Debug("Destroying deployment %s", toRemove)
oldPwd := sh.Pwd()
toRemoveRepo := path.Join(toRemove, sh.Basename(repoURL))
sh.Cd(toRemoveRepo)
log.Debugf("Actually destroying resources now")
cloudRe := regexp.MustCompile(`(gce|aws|digitalocean|openstack|softlayer)`)
i... | [
-0.40776708722114563,
-0.11729023605585098,
0.6150352358818054,
-0.11885888874530792,
0.6586610078811646,
-0.04427744820713997,
0.4492778778076172,
0.26804476976394653,
-0.0789669007062912,
0.4874162971973419,
0.6733601093292236,
-1.00212562084198,
0.1767970323562622,
0.839637279510498,
... |
func setVerbosity(verbosity string) {
log.Debugf("Validating user-input verbosity level: %s", verbosity)
lvls := []string{"debug", "info", "warn", "fatal", "panic"}
if !StrIn(verbosity, lvls) {
log.WithFields(log.Fields{
"specified": verbosity,
}).Fatal("Invalid verbosity option passed")
}
log.Debugf("Setti... | [
0.17673999071121216,
-0.6933941841125488,
0.6212188601493835,
0.6072251796722412,
0.21854926645755768,
0.2510671019554138,
-0.5507683753967285,
-0.6826459765434265,
-0.050716642290353775,
-0.22159020602703094,
-0.24011890590190887,
0.8790609240531921,
0.008947654627263546,
0.81501722335815... |
func getApp() (app *cli.App) {
// global app variables (name, version, etc)
app = cli.NewApp()
app.Name = "mi-deploy"
app.Usage = "Deploy MI to various public clouds"
app.Version = "0.0.1-dev"
app.Author = "Langston Barrett"
app.Email = "langston@aster.is"
lvls := []string{"debug", "info", "warn", "fatal", "pan... | [
1.2511216402053833,
0.03210112079977989,
0.8563194870948792,
0.8817064762115479,
0.22822144627571106,
0.5964787602424622,
-0.14774399995803833,
-0.22225718200206757,
-0.3913717567920685,
0.48063817620277405,
-0.27709847688674927,
0.5986449122428894,
-0.03882136568427086,
0.2827947437763214... |
func Chain(handler http.HandlerFunc, middlewares ...Middleware) http.HandlerFunc {
ctx, cancel := context.WithCancel(context.Background())
ctx = context.WithValue(ctx, responseWrittenKey, false)
wrapped := handler
for _, middleware := range middlewares {
// This is a bit of a black box. What we are doing is makin... | [
-0.12321291863918304,
-0.7465997934341431,
0.618980884552002,
0.7226389646530151,
-0.3745473623275757,
0.290305495262146,
0.4444049000740051,
-0.3316992521286011,
0.1650678813457489,
0.35514935851097107,
0.07904301583766937,
0.30046480894088745,
-0.2970713675022125,
0.4493025839328766,
-... |
func ObjectToYamlString(object interface{}) (string, error) {
var yamled []byte
var err error
yamled, err = yaml.Marshal(object)
if err != nil {
return err.Error(), err
}
return string(yamled), nil
} | [
-0.5070741772651672,
-0.9442206025123596,
0.5092694759368896,
-0.8542468547821045,
-0.6974247097969055,
0.3337366580963135,
-0.2152305692434311,
-1.0889256000518799,
0.7680760025978088,
0.8147433400154114,
-0.2077733725309372,
0.8802587985992432,
0.9754084348678589,
-0.29676055908203125,
... |
func (daq *DrugAllergyQuery) Where(ps ...predicate.DrugAllergy) *DrugAllergyQuery {
daq.predicates = append(daq.predicates, ps...)
return daq
} | [
0.24592438340187073,
-0.1826743185520172,
0.30517828464508057,
-0.7011677026748657,
-0.1548456996679306,
0.36478152871131897,
-0.0178485456854105,
0.02298578806221485,
-0.6260223388671875,
-0.5297558307647705,
0.8820215463638306,
0.8033335208892822,
0.544169545173645,
0.1763250082731247,
... |
func (daq *DrugAllergyQuery) Limit(limit int) *DrugAllergyQuery {
daq.limit = &limit
return daq
} | [
0.0214080773293972,
0.38396307826042175,
0.2937260866165161,
-0.509858250617981,
0.05377143993973732,
0.33254873752593994,
0.584238588809967,
0.5028454661369324,
0.5495296120643616,
-0.7876659035682678,
0.823875367641449,
0.40823882818222046,
0.27682653069496155,
-0.3169998228549957,
-0.... |
func (daq *DrugAllergyQuery) Offset(offset int) *DrugAllergyQuery {
daq.offset = &offset
return daq
} | [
0.21390056610107422,
-0.12933751940727234,
0.15078093111515045,
-0.7795096039772034,
-0.8491774201393127,
1.4550994634628296,
0.8255232572555542,
0.8995504379272461,
0.3336186707019806,
-0.6003193259239197,
0.6564156413078308,
0.39966586232185364,
0.7538548111915588,
0.19352294504642487,
... |
func (daq *DrugAllergyQuery) Order(o ...OrderFunc) *DrugAllergyQuery {
daq.order = append(daq.order, o...)
return daq
} | [
-0.25923025608062744,
0.25803467631340027,
0.25997525453567505,
0.6016812920570374,
0.7608034014701843,
0.0809081494808197,
-0.13320857286453247,
-0.16207382082939148,
-0.3411630094051361,
-0.40051084756851196,
0.10965091735124588,
0.1501741111278534,
1.2907555103302002,
0.3592647612094879... |
func (daq *DrugAllergyQuery) QueryPatient() *PatientInfoQuery {
query := &PatientInfoQuery{config: daq.config}
query.path = func(ctx context.Context) (fromU *sql.Selector, err error) {
if err := daq.prepareQuery(ctx); err != nil {
return nil, err
}
step := sqlgraph.NewStep(
sqlgraph.From(drugallergy.Table... | [
0.32220399379730225,
-0.2507402300834656,
0.4862453043460846,
-0.7449933290481567,
-0.6191820502281189,
-0.04900849238038063,
0.11831356585025787,
-0.04952394589781761,
-0.21028432250022888,
-0.8864063620567322,
1.1839418411254883,
-0.011653009802103043,
0.3626767098903656,
-0.271173536777... |
func (daq *DrugAllergyQuery) QueryMedicine() *MedicineQuery {
query := &MedicineQuery{config: daq.config}
query.path = func(ctx context.Context) (fromU *sql.Selector, err error) {
if err := daq.prepareQuery(ctx); err != nil {
return nil, err
}
step := sqlgraph.NewStep(
sqlgraph.From(drugallergy.Table, dru... | [
0.24377389252185822,
-0.2680882215499878,
0.5203980803489685,
-0.6256716847419739,
-0.3781372308731079,
-0.495034784078598,
-0.2230713963508606,
0.05030110478401184,
-0.065461665391922,
0.10597635805606842,
1.4498515129089355,
-0.16952118277549744,
0.15458624064922333,
-0.25449490547180176... |
func (daq *DrugAllergyQuery) QueryPharmacist() *PharmacistQuery {
query := &PharmacistQuery{config: daq.config}
query.path = func(ctx context.Context) (fromU *sql.Selector, err error) {
if err := daq.prepareQuery(ctx); err != nil {
return nil, err
}
step := sqlgraph.NewStep(
sqlgraph.From(drugallergy.Tabl... | [
0.41556471586227417,
-0.6119678616523743,
0.4471855163574219,
-0.9335696697235107,
-0.6262297034263611,
-0.39461031556129456,
-0.07228615880012512,
-0.21323294937610626,
0.28525251150131226,
-0.30267393589019775,
0.7869689464569092,
0.7106798887252808,
0.2589360475540161,
-0.70333641767501... |
func (daq *DrugAllergyQuery) FirstX(ctx context.Context) *DrugAllergy {
da, err := daq.First(ctx)
if err != nil && !IsNotFound(err) {
panic(err)
}
return da
} | [
0.9722782373428345,
0.47371646761894226,
0.21824181079864502,
-0.20638884603977203,
0.2671913206577301,
-0.2787620425224304,
-0.6742016077041626,
-0.320487380027771,
0.4910421371459961,
-0.6395827531814575,
1.2126156091690063,
0.1700548529624939,
0.2915075421333313,
0.1830543577671051,
-... |
func (daq *DrugAllergyQuery) FirstXID(ctx context.Context) int {
id, err := daq.FirstID(ctx)
if err != nil && !IsNotFound(err) {
panic(err)
}
return id
} | [
1.4596227407455444,
-0.04663163423538208,
0.3382395803928375,
-0.32838189601898193,
0.5298479795455933,
-0.0444660559296608,
-0.38150131702423096,
0.2604738771915436,
0.08708661794662476,
-0.6153196096420288,
1.1003708839416504,
0.2470550835132599,
-0.1839914470911026,
0.8444535732269287,
... |
func (daq *DrugAllergyQuery) Only(ctx context.Context) (*DrugAllergy, error) {
das, err := daq.Limit(2).All(ctx)
if err != nil {
return nil, err
}
switch len(das) {
case 1:
return das[0], nil
case 0:
return nil, &NotFoundError{drugallergy.Label}
default:
return nil, &NotSingularError{drugallergy.Label}
... | [
-0.11943145096302032,
0.03329257667064667,
0.4948556423187256,
0.10943842679262161,
0.41876429319381714,
0.0019700906705111265,
-0.41692212224006653,
0.18215852975845337,
0.0069000814110040665,
-0.17690390348434448,
1.2364695072174072,
0.956538200378418,
0.3717890977859497,
0.1348191946744... |
func (daq *DrugAllergyQuery) OnlyX(ctx context.Context) *DrugAllergy {
da, err := daq.Only(ctx)
if err != nil {
panic(err)
}
return da
} | [
0.1675044596195221,
0.7246895432472229,
0.25967177748680115,
0.2355039119720459,
-0.47322264313697815,
0.33388784527778625,
-0.44701114296913147,
0.1655006855726242,
0.8348967432975769,
-0.2515440285205841,
1.050757884979248,
0.6941215991973877,
0.08623084425926208,
0.1103280559182167,
0... |
func (daq *DrugAllergyQuery) OnlyID(ctx context.Context) (id int, err error) {
var ids []int
if ids, err = daq.Limit(2).IDs(ctx); err != nil {
return
}
switch len(ids) {
case 1:
id = ids[0]
case 0:
err = &NotFoundError{drugallergy.Label}
default:
err = &NotSingularError{drugallergy.Label}
}
return
} | [
-0.03462609648704529,
-0.5437896251678467,
0.5504593253135681,
-0.0222348403185606,
0.5723878741264343,
0.32868093252182007,
0.16211913526058197,
0.5925901532173157,
1.0072861909866333,
0.13009214401245117,
1.418807864189148,
0.9051827192306519,
-0.45127958059310913,
0.2445005625486374,
... |
func (daq *DrugAllergyQuery) OnlyIDX(ctx context.Context) int {
id, err := daq.OnlyID(ctx)
if err != nil {
panic(err)
}
return id
} | [
-0.1521407961845398,
0.2632185220718384,
0.20711585879325867,
-0.2503916621208191,
-0.2611432671546936,
0.3925057351589203,
-0.059268273413181305,
0.6242923736572266,
0.7911096811294556,
-0.5210725665092468,
0.7702587842941284,
0.7784812450408936,
-0.6363726854324341,
0.028493588790297508,... |
func (daq *DrugAllergyQuery) All(ctx context.Context) ([]*DrugAllergy, error) {
if err := daq.prepareQuery(ctx); err != nil {
return nil, err
}
return daq.sqlAll(ctx)
} | [
0.4349448084831238,
-0.568842351436615,
0.35256338119506836,
0.11222539842128754,
0.6434907913208008,
0.2597256898880005,
-0.3142928183078766,
0.2658185660839081,
-0.7139671444892883,
0.09206949919462204,
0.9825615286827087,
0.9664590954780579,
0.37779590487480164,
0.6194384098052979,
-0... |
func (daq *DrugAllergyQuery) AllX(ctx context.Context) []*DrugAllergy {
das, err := daq.All(ctx)
if err != nil {
panic(err)
}
return das
} | [
0.3553530275821686,
0.5198851227760315,
0.29567259550094604,
0.4543081521987915,
-0.3191147446632385,
0.3851553201675415,
-1.2171659469604492,
0.23501616716384888,
0.6953966617584229,
-0.16725033521652222,
1.1228959560394287,
0.8479145169258118,
0.5603955984115601,
0.03917117789387703,
-... |
func (daq *DrugAllergyQuery) IDs(ctx context.Context) ([]int, error) {
var ids []int
if err := daq.Select(drugallergy.FieldID).Scan(ctx, &ids); err != nil {
return nil, err
}
return ids, nil
} | [
-0.6145864129066467,
0.33517250418663025,
0.16161637008190155,
-0.8050599694252014,
0.6164916157722473,
-0.6296048760414124,
-0.1821802705526352,
-0.4269508123397827,
-0.0255231074988842,
-0.009312856942415237,
0.5495429039001465,
0.4001219570636749,
-0.1318764090538025,
-0.592053353786468... |
func (daq *DrugAllergyQuery) IDsX(ctx context.Context) []int {
ids, err := daq.IDs(ctx)
if err != nil {
panic(err)
}
return ids
} | [
-0.5703732371330261,
0.7075111865997314,
0.18311212956905365,
-0.17107415199279785,
0.2410866916179657,
-0.2815425395965576,
-0.8236836194992065,
0.03007640689611435,
0.4692525267601013,
0.24541711807250977,
0.14846274256706238,
0.3463744521141052,
0.020919324830174446,
-0.8559393882751465... |
func (daq *DrugAllergyQuery) Count(ctx context.Context) (int, error) {
if err := daq.prepareQuery(ctx); err != nil {
return 0, err
}
return daq.sqlCount(ctx)
} | [
0.3735213577747345,
0.04914264380931854,
0.5483349561691284,
-0.3973176181316376,
0.12569360435009003,
-0.4042890667915344,
0.44936075806617737,
-0.15757082402706146,
-0.9089586138725281,
0.29291486740112305,
0.8219876289367676,
-0.036277905106544495,
0.5259734988212585,
0.7171353101730347... |
func (daq *DrugAllergyQuery) CountX(ctx context.Context) int {
count, err := daq.Count(ctx)
if err != nil {
panic(err)
}
return count
} | [
0.2063380777835846,
0.506181538105011,
0.4047016501426697,
-0.15001420676708221,
0.0034015951678156853,
0.6794753074645996,
-0.254993736743927,
0.09666720032691956,
-0.15501797199249268,
0.17484991252422333,
0.3955192267894745,
0.34101736545562744,
0.6360308527946472,
0.0021322083193808794... |
func (daq *DrugAllergyQuery) Exist(ctx context.Context) (bool, error) {
if err := daq.prepareQuery(ctx); err != nil {
return false, err
}
return daq.sqlExist(ctx)
} | [
-0.17181816697120667,
-0.08914973586797714,
0.605484127998352,
-0.48654061555862427,
0.6375315189361572,
0.21351730823516846,
-0.017304077744483948,
-0.14481928944587708,
-0.8921375870704651,
1.1999603509902954,
1.2196487188339233,
-0.6495718359947205,
-0.03263930603861809,
0.7394612431526... |
func (daq *DrugAllergyQuery) ExistX(ctx context.Context) bool {
exist, err := daq.Exist(ctx)
if err != nil {
panic(err)
}
return exist
} | [
-0.2591671645641327,
0.47920405864715576,
0.6419828534126282,
-0.4241322875022888,
0.3716122508049011,
1.1187167167663574,
-0.593585193157196,
0.017570704221725464,
-0.26871785521507263,
1.1335933208465576,
0.4742134213447571,
-0.04100299999117851,
0.02743731625378132,
0.0174489114433527,
... |
func (daq *DrugAllergyQuery) Clone() *DrugAllergyQuery {
return &DrugAllergyQuery{
config: daq.config,
limit: daq.limit,
offset: daq.offset,
order: append([]OrderFunc{}, daq.order...),
unique: append([]string{}, daq.unique...),
predicates: append([]predicate.DrugAllergy{}, daq.predica... | [
0.2924272418022156,
-0.5028178095817566,
0.6000873446464539,
-0.0627535730600357,
-0.8893828392028809,
0.24435605108737946,
0.10279840975999832,
-0.47378936409950256,
-0.2509995996952057,
0.25486382842063904,
0.8958417773246765,
0.7228677868843079,
0.37731876969337463,
-0.3089870810508728,... |
func (daq *DrugAllergyQuery) WithPatient(opts ...func(*PatientInfoQuery)) *DrugAllergyQuery {
query := &PatientInfoQuery{config: daq.config}
for _, opt := range opts {
opt(query)
}
daq.withPatient = query
return daq
} | [
-0.12776800990104675,
0.09910126030445099,
0.34288695454597473,
-0.7228622436523438,
-0.546794056892395,
0.22610527276992798,
-0.22682717442512512,
-0.5274253487586975,
-0.46646881103515625,
-1.0286933183670044,
1.2491663694381714,
-0.4654729664325714,
0.3796020448207855,
-0.31806924939155... |
func (daq *DrugAllergyQuery) WithMedicine(opts ...func(*MedicineQuery)) *DrugAllergyQuery {
query := &MedicineQuery{config: daq.config}
for _, opt := range opts {
opt(query)
}
daq.withMedicine = query
return daq
} | [
0.23660197854042053,
-0.09898591786623001,
0.4417707622051239,
-0.5040349960327148,
-0.4929790794849396,
-0.36776697635650635,
-0.6947022676467896,
-0.08861832320690155,
-0.060457900166511536,
-0.04693220555782318,
1.6489671468734741,
-0.3704559803009033,
0.20820209383964539,
0.01568433642... |
func (daq *DrugAllergyQuery) WithPharmacist(opts ...func(*PharmacistQuery)) *DrugAllergyQuery {
query := &PharmacistQuery{config: daq.config}
for _, opt := range opts {
opt(query)
}
daq.withPharmacist = query
return daq
} | [
0.662057101726532,
-0.6336414217948914,
0.4508240520954132,
-0.966377854347229,
-0.8384582996368408,
0.03361661359667778,
-0.6609485745429993,
-0.15406984090805054,
0.36068397760391235,
-0.73392653465271,
0.7405698299407959,
0.49380043148994446,
0.2818376123905182,
-0.09974842518568039,
... |
func (dagb *DrugAllergyGroupBy) Aggregate(fns ...AggregateFunc) *DrugAllergyGroupBy {
dagb.fns = append(dagb.fns, fns...)
return dagb
} | [
-0.5473272204399109,
0.8971556425094604,
0.40090274810791016,
0.0643705278635025,
1.1333144903182983,
-0.6515533328056335,
0.2898734509944916,
-0.1460724174976349,
-0.6926390528678894,
-1.050983190536499,
0.16828817129135132,
0.6656545400619507,
0.11340635269880295,
0.2701317369937897,
-... |
func (dagb *DrugAllergyGroupBy) Scan(ctx context.Context, v interface{}) error {
query, err := dagb.path(ctx)
if err != nil {
return err
}
dagb.sql = query
return dagb.sqlScan(ctx, v)
} | [
-0.8209176659584045,
0.36722472310066223,
0.19343633949756622,
0.3627089262008667,
-0.46654653549194336,
-0.43910226225852966,
0.70196133852005,
-0.5354288816452026,
-0.7132525444030762,
-0.32734981179237366,
0.8429010510444641,
0.6728225350379944,
0.1995173692703247,
-0.03970080241560936,... |
func (dagb *DrugAllergyGroupBy) ScanX(ctx context.Context, v interface{}) {
if err := dagb.Scan(ctx, v); err != nil {
panic(err)
}
} | [
-0.9436336159706116,
0.960132896900177,
0.2397051304578781,
0.7430841326713562,
-0.9121986031532288,
0.13849322497844696,
-0.4082503020763397,
-0.8192027807235718,
0.3868004381656647,
0.04638442024588585,
0.04837585240602493,
1.02047860622406,
-0.002980600344017148,
0.05481429770588875,
... |
func (dagb *DrugAllergyGroupBy) Strings(ctx context.Context) ([]string, error) {
if len(dagb.fields) > 1 {
return nil, errors.New("ent: DrugAllergyGroupBy.Strings is not achievable when grouping more than 1 field")
}
var v []string
if err := dagb.Scan(ctx, &v); err != nil {
return nil, err
}
return v, nil
} | [
-0.6695993542671204,
0.18089064955711365,
0.1528761386871338,
-0.6235108375549316,
0.4554348886013031,
0.02790786698460579,
0.4088471531867981,
-1.2405284643173218,
-0.4841057062149048,
0.16998516023159027,
0.8513412475585938,
0.7341796159744263,
-0.7081519365310669,
0.017887044697999954,
... |
func (dagb *DrugAllergyGroupBy) StringsX(ctx context.Context) []string {
v, err := dagb.Strings(ctx)
if err != nil {
panic(err)
}
return v
} | [
-0.3303505480289459,
0.130931556224823,
0.3529852628707886,
0.11192210018634796,
-0.2712203860282898,
0.5390743613243103,
-0.5924814939498901,
-1.2984492778778076,
0.05273902043700218,
0.6977208852767944,
0.8493139743804932,
1.2738134860992432,
-0.3955293595790863,
-0.2955068051815033,
0... |
func (dagb *DrugAllergyGroupBy) String(ctx context.Context) (_ string, err error) {
var v []string
if v, err = dagb.Strings(ctx); err != nil {
return
}
switch len(v) {
case 1:
return v[0], nil
case 0:
err = &NotFoundError{drugallergy.Label}
default:
err = fmt.Errorf("ent: DrugAllergyGroupBy.Strings retur... | [
-0.08278083801269531,
-0.505196213722229,
0.14413268864154816,
-0.6200428605079651,
0.3612704873085022,
-0.19896762073040009,
0.9912821054458618,
-1.16519033908844,
-0.622804582118988,
0.47358086705207825,
1.042380452156067,
0.447692334651947,
-0.18740509450435638,
-0.531467854976654,
0.... |
func (dagb *DrugAllergyGroupBy) StringX(ctx context.Context) string {
v, err := dagb.String(ctx)
if err != nil {
panic(err)
}
return v
} | [
-0.27155575156211853,
0.07769775390625,
0.28656941652297974,
0.13372834026813507,
-0.6977869868278503,
0.6855420470237732,
-0.2744961380958557,
-1.1725777387619019,
-0.19794966280460358,
0.6157232522964478,
0.7328060269355774,
1.1180288791656494,
-0.1917857825756073,
-0.7797530293464661,
... |
func (dagb *DrugAllergyGroupBy) Ints(ctx context.Context) ([]int, error) {
if len(dagb.fields) > 1 {
return nil, errors.New("ent: DrugAllergyGroupBy.Ints is not achievable when grouping more than 1 field")
}
var v []int
if err := dagb.Scan(ctx, &v); err != nil {
return nil, err
}
return v, nil
} | [
-0.8890269994735718,
0.5514028668403625,
0.3735258877277374,
-0.4530562460422516,
0.0922587662935257,
-0.6936482787132263,
0.32293012738227844,
-0.692598819732666,
-0.6431150436401367,
-0.02202269434928894,
0.7142526507377625,
0.9601733088493347,
-0.4619700610637665,
-0.28279662132263184,
... |
func (dagb *DrugAllergyGroupBy) IntsX(ctx context.Context) []int {
v, err := dagb.Ints(ctx)
if err != nil {
panic(err)
}
return v
} | [
-0.5929431319236755,
0.8631635308265686,
0.21168284118175507,
0.20421743392944336,
-0.1473466455936432,
-0.26441407203674316,
-0.3764115273952484,
-0.42755797505378723,
-0.12504421174526215,
0.22777695953845978,
0.23951776325702667,
0.6204453706741333,
-0.43973487615585327,
-0.607137918472... |
func (dagb *DrugAllergyGroupBy) Int(ctx context.Context) (_ int, err error) {
var v []int
if v, err = dagb.Ints(ctx); err != nil {
return
}
switch len(v) {
case 1:
return v[0], nil
case 0:
err = &NotFoundError{drugallergy.Label}
default:
err = fmt.Errorf("ent: DrugAllergyGroupBy.Ints returned %d results ... | [
-0.27830809354782104,
0.17493458092212677,
0.3524021804332733,
-1.0511939525604248,
0.3147159516811371,
-0.33731794357299805,
0.6033982634544373,
-0.6028056144714355,
-1.262760043144226,
0.2006009966135025,
1.0483115911483765,
0.24273771047592163,
0.12296389788389206,
-0.1335153579711914,
... |
func (dagb *DrugAllergyGroupBy) IntX(ctx context.Context) int {
v, err := dagb.Int(ctx)
if err != nil {
panic(err)
}
return v
} | [
-0.08739236742258072,
0.7689253091812134,
0.2731887400150299,
-0.21331098675727844,
-0.3666801452636719,
0.17724895477294922,
-0.0002415643830318004,
-0.38410770893096924,
-0.4724440574645996,
-0.0753612145781517,
0.6424275040626526,
0.7454930543899536,
-0.21287629008293152,
-0.62390375137... |
func (dagb *DrugAllergyGroupBy) Float64s(ctx context.Context) ([]float64, error) {
if len(dagb.fields) > 1 {
return nil, errors.New("ent: DrugAllergyGroupBy.Float64s is not achievable when grouping more than 1 field")
}
var v []float64
if err := dagb.Scan(ctx, &v); err != nil {
return nil, err
}
return v, nil... | [
-0.7338958978652954,
0.6269981861114502,
0.30802595615386963,
-0.0033784108236432076,
0.4758187234401703,
-1.0513596534729004,
-0.052089203149080276,
-0.8283622860908508,
-0.34507298469543457,
0.024534456431865692,
0.5094371438026428,
0.7153206467628479,
-0.3082844913005829,
0.550573587417... |
func (dagb *DrugAllergyGroupBy) Float64sX(ctx context.Context) []float64 {
v, err := dagb.Float64s(ctx)
if err != nil {
panic(err)
}
return v
} | [
-0.32194408774375916,
0.5370613932609558,
0.05023399740457535,
0.753777265548706,
0.13026434183120728,
-0.6935452222824097,
-0.8990305662155151,
-0.4149249196052551,
-0.056064724922180176,
0.09401433169841766,
0.12495790421962738,
0.20242823660373688,
-0.09708169847726822,
0.16783456504344... |
func (dagb *DrugAllergyGroupBy) Float64(ctx context.Context) (_ float64, err error) {
var v []float64
if v, err = dagb.Float64s(ctx); err != nil {
return
}
switch len(v) {
case 1:
return v[0], nil
case 0:
err = &NotFoundError{drugallergy.Label}
default:
err = fmt.Errorf("ent: DrugAllergyGroupBy.Float64s ... | [
-0.6170145273208618,
0.20156189799308777,
0.30373528599739075,
0.31724247336387634,
1.1529521942138672,
-0.8891274929046631,
0.5318458676338196,
-0.5326223969459534,
-0.512609601020813,
-0.09239168465137482,
1.111869215965271,
-0.11847618967294693,
-0.1615322083234787,
0.5396885275840759,
... |
func (dagb *DrugAllergyGroupBy) Float64X(ctx context.Context) float64 {
v, err := dagb.Float64(ctx)
if err != nil {
panic(err)
}
return v
} | [
-0.2840327322483063,
0.6344325542449951,
0.11374649405479431,
0.4557701051235199,
-0.12667161226272583,
-0.28988125920295715,
-0.23116683959960938,
-0.5996847152709961,
-0.3083554208278656,
-0.3536006212234497,
0.3831876218318939,
-0.0022014714777469635,
0.07931286841630936,
0.322818070650... |
func (dagb *DrugAllergyGroupBy) Bools(ctx context.Context) ([]bool, error) {
if len(dagb.fields) > 1 {
return nil, errors.New("ent: DrugAllergyGroupBy.Bools is not achievable when grouping more than 1 field")
}
var v []bool
if err := dagb.Scan(ctx, &v); err != nil {
return nil, err
}
return v, nil
} | [
-0.8578632473945618,
0.7445682883262634,
0.4138489067554474,
-0.5752735733985901,
0.6271875500679016,
-0.049277402460575104,
-0.04908975586295128,
-0.36320096254348755,
-0.842595100402832,
0.06998977810144424,
0.8540601134300232,
0.6877366304397583,
0.16571101546287537,
-0.3084506690502167... |
func (dagb *DrugAllergyGroupBy) BoolsX(ctx context.Context) []bool {
v, err := dagb.Bools(ctx)
if err != nil {
panic(err)
}
return v
} | [
-0.1928691565990448,
0.45166629552841187,
0.4012267589569092,
0.31551533937454224,
-0.34121644496917725,
0.1815320998430252,
-0.7839502692222595,
-0.3965401351451874,
-0.47137272357940674,
0.49798113107681274,
0.15478502213954926,
0.6741689443588257,
0.4075871407985687,
-0.4406904280185699... |
func (dagb *DrugAllergyGroupBy) Bool(ctx context.Context) (_ bool, err error) {
var v []bool
if v, err = dagb.Bools(ctx); err != nil {
return
}
switch len(v) {
case 1:
return v[0], nil
case 0:
err = &NotFoundError{drugallergy.Label}
default:
err = fmt.Errorf("ent: DrugAllergyGroupBy.Bools returned %d res... | [
-0.2839011549949646,
0.15485744178295135,
0.4087071716785431,
-0.24215038120746613,
0.878004789352417,
0.13615643978118896,
0.7013492584228516,
0.23741982877254486,
-0.7137170433998108,
0.39877939224243164,
0.812910795211792,
0.23941504955291748,
0.41173824667930603,
-0.4525933265686035,
... |
func (dagb *DrugAllergyGroupBy) BoolX(ctx context.Context) bool {
v, err := dagb.Bool(ctx)
if err != nil {
panic(err)
}
return v
} | [
0.09483427554368973,
0.4440400004386902,
0.42537274956703186,
-0.14973267912864685,
-0.2783205211162567,
0.89087975025177,
-0.3322422206401825,
-0.11999846249818802,
-0.41666537523269653,
0.3503730595111847,
0.09464871138334274,
0.5034589171409607,
0.28991544246673584,
-0.7298356890678406,... |
func (das *DrugAllergySelect) Scan(ctx context.Context, v interface{}) error {
query, err := das.path(ctx)
if err != nil {
return err
}
das.sql = query
return das.sqlScan(ctx, v)
} | [
-0.8199101090431213,
0.3287542760372162,
0.16715240478515625,
0.11288029700517654,
-0.13640432059764862,
-0.08282667398452759,
0.527239978313446,
-0.26580098271369934,
-0.10807843506336212,
-0.5824379920959473,
0.9140573143959045,
0.8064596652984619,
0.8486813902854919,
-0.3620408475399017... |
func (das *DrugAllergySelect) ScanX(ctx context.Context, v interface{}) {
if err := das.Scan(ctx, v); err != nil {
panic(err)
}
} | [
-0.9814333319664001,
0.7990225553512573,
0.18323014676570892,
0.5340862274169922,
-0.4902881383895874,
0.44868800044059753,
-0.5987489819526672,
-0.716638445854187,
1.0059895515441895,
-0.011499362997710705,
0.13728368282318115,
1.1166727542877197,
0.4118708372116089,
-0.16488438844680786,... |
func (das *DrugAllergySelect) Strings(ctx context.Context) ([]string, error) {
if len(das.fields) > 1 {
return nil, errors.New("ent: DrugAllergySelect.Strings is not achievable when selecting more than 1 field")
}
var v []string
if err := das.Scan(ctx, &v); err != nil {
return nil, err
}
return v, nil
} | [
-0.8708513379096985,
0.20318502187728882,
0.10336699336767197,
-0.6600744128227234,
0.8504570722579956,
0.1824670284986496,
0.15106259286403656,
-1.215571403503418,
0.13173674046993256,
0.19704335927963257,
0.7628055810928345,
0.6987565159797668,
-0.3515363931655884,
-0.1817653626203537,
... |
func (das *DrugAllergySelect) StringsX(ctx context.Context) []string {
v, err := das.Strings(ctx)
if err != nil {
panic(err)
}
return v
} | [
-0.37706074118614197,
-0.04236919432878494,
0.281070351600647,
-0.007019837852567434,
0.014987478032708168,
0.711581826210022,
-0.8082304000854492,
-1.452209711074829,
0.6964129209518433,
0.8349251747131348,
0.8056186437606812,
1.3814101219177246,
-0.12523923814296722,
-0.43512117862701416... |
func (das *DrugAllergySelect) String(ctx context.Context) (_ string, err error) {
var v []string
if v, err = das.Strings(ctx); err != nil {
return
}
switch len(v) {
case 1:
return v[0], nil
case 0:
err = &NotFoundError{drugallergy.Label}
default:
err = fmt.Errorf("ent: DrugAllergySelect.Strings returned ... | [
-0.39401018619537354,
-0.5702865123748779,
0.08706294000148773,
-0.7830462455749512,
0.767266571521759,
-0.12203174084424973,
0.7538127303123474,
-1.188490390777588,
0.027222156524658203,
0.4254644215106964,
0.9503997564315796,
0.6858773231506348,
0.1038101464509964,
-0.818530261516571,
... |
func (das *DrugAllergySelect) StringX(ctx context.Context) string {
v, err := das.String(ctx)
if err != nil {
panic(err)
}
return v
} | [
-0.43715551495552063,
-0.1533776819705963,
0.23143182694911957,
-0.053387075662612915,
-0.3743126094341278,
0.8449753522872925,
-0.5197935104370117,
-1.195057988166809,
0.6880536675453186,
0.6630477905273438,
0.8006461262702942,
1.3579565286636353,
0.21250230073928833,
-1.0112104415893555,... |
func (das *DrugAllergySelect) Ints(ctx context.Context) ([]int, error) {
if len(das.fields) > 1 {
return nil, errors.New("ent: DrugAllergySelect.Ints is not achievable when selecting more than 1 field")
}
var v []int
if err := das.Scan(ctx, &v); err != nil {
return nil, err
}
return v, nil
} | [
-1.052141785621643,
0.3219359219074249,
0.3017689287662506,
-0.5231481194496155,
0.4141445457935333,
-0.5436782836914062,
-0.14591269195079803,
-0.8398926258087158,
-0.07005670666694641,
0.07413439452648163,
0.5704978704452515,
0.9941769242286682,
-0.21633513271808624,
-0.6060004234313965,... |
func (das *DrugAllergySelect) IntsX(ctx context.Context) []int {
v, err := das.Ints(ctx)
if err != nil {
panic(err)
}
return v
} | [
-0.7220672965049744,
0.6076050996780396,
0.18231479823589325,
-0.05373923480510712,
-0.06391705572605133,
-0.061026591807603836,
-0.8142704367637634,
-0.49645933508872986,
0.38250958919525146,
0.4352812170982361,
0.1987038105726242,
0.7598057985305786,
-0.11844293028116226,
-0.974185168743... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.