text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (p *RecordAPI) Info(domain string, recordID int64) (r Record, err error) {
params := url.Values{}
params.Set("login_token", p.loginToken)
params.Set("format", "json")
params.Set("domain", domain)
params.Set("record_id", strconv.FormatInt(recordID, 10))
res, err := simpleHTTP(p.client, "POST", "https://dnsa... | [
-0.6116209030151367,
0.3581796884536743,
0.7063191533088684,
-0.5920753479003906,
-0.1128140240907669,
-0.265740305185318,
-0.7943198084831238,
-0.7573511004447937,
-0.8103486895561218,
0.41952717304229736,
-0.7147225737571716,
1.1026102304458618,
-0.5950322151184082,
-0.020930398255586624... |
func (p *RecordAPI) Status(domain string, recordID int64, enable Enable) (err error) {
params := url.Values{}
params.Set("login_token", p.loginToken)
params.Set("format", "json")
params.Set("domain", domain)
params.Set("record_id", strconv.FormatInt(recordID, 10))
params.Set("status", enable.String())
res, err... | [
-0.5874568819999695,
0.15645822882652283,
0.6744791865348816,
-0.14357371628284454,
-0.4624637961387634,
0.24498607218265533,
-0.7092249393463135,
0.335274338722229,
-0.1095842570066452,
0.6310458779335022,
-0.8927563428878784,
1.2186322212219238,
-1.146302342414856,
0.40055346488952637,
... |
func Html(url string) ([]byte, error) {
rsp, err := http.Get(url)
if err != nil {
return nil, fmt.Errorf("could not make request: %w", err)
}
defer rsp.Body.Close()
body, err := ioutil.ReadAll(rsp.Body)
if err != nil {
return nil, fmt.Errorf("could not read response body: %w", err)
}
return body, nil
} | [
-0.578079104423523,
-0.0033674424048513174,
0.5384684801101685,
0.03038298338651657,
-0.7389427423477173,
0.6357017755508423,
-0.5900002121925354,
0.1471683531999588,
-0.07412843406200409,
0.04225020855665207,
0.15202106535434723,
0.6181103587150574,
-0.08563470095396042,
-0.24562600255012... |
func calcTries(a int, b int, c int, d int, e int, f int) uint64 {
var (
a1 = uint64(a)
b1 = uint64(b)
c1 = uint64(c)
d1 = uint64(d)
e1 = uint64(e)
f1 = uint64(f)
)
var result uint64
result += a1 * uint64(math.Pow(61, 5))
result += b1 * uint64(math.Pow(61, 4))
result += c1 * uint64(math.Pow(61, 3))
r... | [
0.19305498898029327,
1.2761400938034058,
0.5643541216850281,
-0.870663583278656,
-0.2673869729042053,
-0.6889034509658813,
0.6502823233604431,
0.012920685112476349,
0.011532889679074287,
0.0009620492928661406,
-0.04175667464733124,
-0.7274977564811707,
-0.17087537050247192,
0.1757940202951... |
func NewProcess() *Process {
p := &Process{
Port: DefaultPort,
BinDir: DefaultBinDir,
SbinDir: DefaultSbinDir,
DataDir: DefaultDataDir,
Password: DefaultPassword,
OpTimeout: DefaultOpTimeout,
ReplTimeout: DefaultReplTimeout,
Logger: log15.New("app", "mariadb"),
events: ... | [
1.127906322479248,
-0.36083993315696716,
0.3574735224246979,
0.48927003145217896,
-0.4618719220161438,
0.19768255949020386,
0.12123171985149384,
-0.03506443277001381,
-0.08804440498352051,
0.13697662949562073,
0.01314766239374876,
0.27993375062942505,
-0.21312114596366882,
0.00878174789249... |
func (p *Process) Backup() (io.ReadCloser, error) {
r := &backupReadCloser{}
cmd := exec.Command(
filepath.Join(p.BinDir, "innobackupex"),
"--defaults-file="+p.ConfigPath(),
"--host=127.0.0.1",
"--port="+p.Port,
"--user=flynn",
"--password="+p.Password,
"--socket=",
"--stream=xbstream",
".",
)
cm... | [
0.18053893744945526,
-0.42415735125541687,
1.033913493156433,
-0.2249859869480133,
-0.6520763635635376,
-0.23796458542346954,
0.15772345662117004,
-0.26159945130348206,
0.050823673605918884,
-0.37244415283203125,
1.1735482215881348,
0.560874879360199,
-0.7542514801025391,
-0.18664628267288... |
func (p *Process) Restore(r io.Reader) (*BackupInfo, error) {
if err := p.writeConfig(configData{}); err != nil {
return nil, err
}
if err := p.unpackXbstream(r); err != nil {
return nil, err
}
backupInfo, err := p.extractBackupInfo()
if err != nil {
return nil, err
}
if err := p.restoreApplyLog(); err !=... | [
0.6220278143882751,
-0.8283161520957947,
0.759232223033905,
-0.6181531548500061,
-0.3707295060157776,
-0.42357727885246277,
-0.3152296245098114,
-0.2736903429031372,
0.1405789852142334,
-0.3696117699146271,
-0.31911927461624146,
-0.5833673477172852,
-0.9800305366516113,
-0.331468790769577,... |
func (p *Process) initPrimaryDB() error {
logger := p.Logger.New("fn", "initPrimaryDB")
logger.Info("initializing primary database")
dsn := &DSN{
Host: "127.0.0.1:" + p.Port,
User: "root",
Timeout: p.OpTimeout,
}
db, err := sql.Open("mysql", dsn.String())
if err != nil {
logger.Error("error acquir... | [
-0.24797272682189941,
0.11277177184820175,
1.0099507570266724,
0.7002630829811096,
0.000314160919515416,
-0.6970738172531128,
0.3779451847076416,
1.135922908782959,
0.5419668555259705,
-0.07565359771251678,
-0.5350036025047302,
0.553816020488739,
-1.0207140445709229,
1.032741904258728,
1... |
func (p *Process) DSN() *DSN {
return &DSN{
Host: "127.0.0.1:" + p.Port,
User: "flynn",
Password: p.Password,
Timeout: p.OpTimeout,
}
} | [
-0.08175036311149597,
-0.8982732892036438,
0.3774118721485138,
0.7857809066772461,
-0.15912991762161255,
-1.2986876964569092,
-0.5712316632270813,
0.7923409938812256,
0.1399819701910019,
-0.9482839703559875,
-0.6926754117012024,
0.8624303340911865,
0.08451632410287857,
-0.226594477891922,
... |
func (p *Process) nodeXLogPosition(dsn *DSN) (xlog.Position, error) {
db, err := sql.Open("mysql", dsn.String())
if err != nil {
return p.XLog().Zero(), err
}
defer db.Close()
var gtid string
if err := db.QueryRow(`SELECT @@gtid_current_pos`).Scan(>id); err != nil {
return p.XLog().Zero(), err
}
return x... | [
-0.552133321762085,
-0.10219656676054001,
0.7413428425788879,
-1.4320452213287354,
-0.8383364677429199,
-0.39387762546539307,
-0.7123544216156006,
-0.16756509244441986,
-0.7434231638908386,
0.5608989000320435,
-0.045589201152324677,
-1.0964117050170898,
-0.5851020812988281,
-0.123250871896... |
func (p *Process) installDB() error {
logger := p.Logger.New("fn", "installDB", "data_dir", p.DataDir)
logger.Debug("starting installDB")
// Ignore errors, since the db could be already initialized
p.runCmd(exec.Command(
filepath.Join(p.BinDir, "mysql_install_db"),
"--defaults-extra-file="+p.ConfigPath(),
))
... | [
0.2851722538471222,
-0.26187458634376526,
0.6559913158416748,
0.24447132647037506,
1.0729047060012817,
0.31872543692588806,
0.9162277579307556,
0.9087952375411987,
-0.2938590347766876,
-0.2872675061225891,
0.07861357927322388,
0.4123488962650299,
-0.9752544164657593,
1.1846071481704712,
... |
func (r *backupReadCloser) Close() error {
defer r.stdout.Close()
if err := r.cmd.Wait(); err != nil {
return err
}
// Verify that innobackupex prints "completed OK!" at the end of STDERR.
if !strings.HasSuffix(strings.TrimSpace(r.stderr.String()), "completed OK!") {
r.stderr.WriteTo(os.Stderr)
return erro... | [
0.4681812524795532,
-0.130087748169899,
1.0079212188720703,
-0.06372275203466415,
-0.500981867313385,
0.3421107828617096,
0.13160045444965363,
-0.6205770969390869,
-0.5171143412590027,
-0.5811797976493835,
1.1805599927902222,
-0.25353771448135376,
-0.9816375374794006,
0.32116633653640747,
... |
func (r *backupReadCloser) Read(p []byte) (n int, err error) {
return r.stdout.Read(p)
} | [
0.07356800138950348,
-0.22780825197696686,
0.730858564376831,
0.46438977122306824,
-0.43662694096565247,
0.26876404881477356,
0.32690802216529846,
-0.6460104584693909,
-0.059568747878074646,
-0.6082844734191895,
0.5439738035202026,
0.15250521898269653,
-1.2261908054351807,
0.47230368852615... |
func (t *trieNode) Lookup(path string) HandlerFuncs {
for _, i := range t.childs {
if strings.HasPrefix(path, i.path) {
return HandlerFuncsCombine(t.vals, i.Lookup(path[len(i.path):]))
}
}
return t.vals
} | [
-0.7157770395278931,
-0.1030164435505867,
0.5596910715103149,
-0.25108540058135986,
0.008885672315955162,
-0.526836633682251,
0.7816470265388489,
0.26814356446266174,
0.004664971027523279,
0.1484648883342743,
-0.3635212779045105,
-0.6141738295555115,
0.043425966054201126,
-0.64357513189315... |
func (emailconf *EmailConf) SendFileViaEmail(filePath string, logger log.Logger) error {
if emailconf.Smarthost == "" || emailconf.From == "" || emailconf.To == "" {
level.Debug(logger).Log("msg", "skiping email send. No smarthost, from or to defined")
return nil
}
if errFileExists := common.FileExists(filePath... | [
-0.34557077288627625,
-0.04112139716744423,
0.8370057940483093,
0.49355971813201904,
0.2568770945072174,
0.6740235686302185,
0.5468605756759644,
0.34617868065834045,
-0.6749260425567627,
0.6159642338752747,
-0.13562685251235962,
0.3486200273036957,
-0.17008718848228455,
0.632365882396698,
... |
func (opts EnableOpts) ToCDNContainerEnableMap() (map[string]string, error) {
h, err := gophercloud.BuildHeaders(opts)
if err != nil {
return nil, err
}
return h, nil
} | [
-0.38869887590408325,
-0.1757219284772873,
0.47704029083251953,
-0.47289177775382996,
0.31130337715148926,
0.16300807893276215,
0.10540411621332169,
0.9619941115379333,
-0.09743644297122955,
0.9052057862281799,
-0.1129935085773468,
-0.553434431552887,
-0.8815399408340454,
-0.36521714925765... |
func Enable(c *gophercloud.ServiceClient, containerName string, opts EnableOptsBuilder) EnableResult {
var res EnableResult
h := c.AuthenticatedHeaders()
if opts != nil {
headers, err := opts.ToCDNContainerEnableMap()
if err != nil {
res.Err = err
return res
}
for k, v := range headers {
h[k] = v
... | [
-0.9155989289283752,
0.7813003659248352,
0.881671130657196,
-0.04085693135857582,
0.13234975934028625,
-0.022280260920524597,
0.11616767942905426,
0.5924680233001709,
0.09710811078548431,
0.4125562906265259,
-0.5924477577209473,
0.011801847256720066,
-1.1300517320632935,
-0.517007350921630... |
func Get(c *gophercloud.ServiceClient, containerName string) GetResult {
var res GetResult
resp, err := perigee.Request("HEAD", getURL(c, containerName), perigee.Options{
MoreHeaders: c.AuthenticatedHeaders(),
OkCodes: []int{200, 204},
})
res.Header = resp.HttpResponse.Header
res.Err = err
return res
} | [
-0.854936957359314,
0.45563405752182007,
0.6862068772315979,
-0.32773369550704956,
0.818419337272644,
-1.0343165397644043,
-0.676405668258667,
-0.9334086179733276,
-0.14539630711078644,
0.20111915469169617,
0.3790571689605713,
1.1586050987243652,
-0.9472668766975403,
-0.6472526788711548,
... |
func (opts UpdateOpts) ToContainerUpdateMap() (map[string]string, error) {
h, err := gophercloud.BuildHeaders(opts)
if err != nil {
return nil, err
}
h["X-Cdn-Enabled"] = strconv.FormatBool(opts.CDNEnabled)
h["X-Log-Retention"] = strconv.FormatBool(opts.LogRetention)
if opts.XCDNEnabled != nil {
h["X-Cdn-Ena... | [
-0.5233350992202759,
-0.5997344255447388,
0.7952242493629456,
-0.840071976184845,
0.1670536994934082,
0.045481592416763306,
-0.29213249683380127,
-0.17370536923408508,
0.3923097550868988,
0.9223662614822388,
-0.010195638053119183,
0.7038233280181885,
-0.20667500793933868,
-0.28349032998085... |
func Update(c *gophercloud.ServiceClient, containerName string, opts UpdateOptsBuilder) UpdateResult {
var res UpdateResult
h := c.AuthenticatedHeaders()
if opts != nil {
headers, err := opts.ToContainerUpdateMap()
if err != nil {
res.Err = err
return res
}
for k, v := range headers {
h[k] = v
}... | [
-1.2618893384933472,
-0.013064311817288399,
0.7074016332626343,
0.11383458971977234,
0.10588569194078445,
-0.5031088590621948,
-0.26445820927619934,
-0.7916648983955383,
0.4063665270805359,
0.5902214050292969,
0.1005995124578476,
0.2542445659637451,
-1.171674132347107,
-0.2190341055393219,... |
func AssertNodePoolsRequired(obj NodePools) error {
return nil
} | [
-1.2230597734451294,
-0.08668176829814911,
0.3113199770450592,
0.10006865113973618,
-0.3097185492515564,
1.203893780708313,
1.0205352306365967,
-1.3132485151290894,
0.5515828132629395,
-0.061481211334466934,
-0.6927555799484253,
0.573533833026886,
-0.6354668140411377,
1.1018009185791016,
... |
func (h *HealthStatus) HasFailingDeps() bool {
return len(h.FailingDeps) > 0
} | [
-0.44031596183776855,
0.2733522355556488,
0.4699671268463135,
-0.3790236711502075,
0.5433474779129028,
0.28025439381599426,
-1.1423263549804688,
0.02415601722896099,
-0.21067316830158234,
-0.8897765278816223,
-0.7907817959785461,
-0.8252901434898376,
0.16153639554977417,
1.847808837890625,... |
func (h *HealthStatus) UpgradeWarning(level HealthStatusCode) {
if h.WarningLevel < level {
h.WarningLevel = level
}
} | [
-0.6400645971298218,
0.5099503993988037,
0.6480851173400879,
0.616665780544281,
0.4579894542694092,
-0.017723485827445984,
-1.114009976387024,
-0.3073228597640991,
-0.3399508595466614,
0.544946551322937,
-0.2880106270313263,
0.3013022541999817,
0.50399249792099,
0.3025647699832916,
0.136... |
func (h *HealthStatus) IsWarning() bool {
return h.WarningLevel == StatusWarning
} | [
-0.12371207773685455,
0.24514050781726837,
0.4107156991958618,
1.3641246557235718,
0.22005021572113037,
-0.17817237973213196,
-1.1756340265274048,
-0.38484683632850647,
0.17229290306568146,
0.2594258785247803,
-0.36384403705596924,
0.6191087365150452,
0.05212674289941788,
0.270720213651657... |
func (h *HealthStatus) ShouldDisplay() bool {
var threshold HealthStatusCode
if h.DisplayLevel == nil {
threshold = defaultDisplayLevel
} else {
threshold = *h.DisplayLevel
}
return h.WarningLevel >= threshold
} | [
0.7493778467178345,
0.09093035012483597,
0.8573265671730042,
0.7560524344444275,
-0.21002401411533356,
0.5380847454071045,
-0.7108793258666992,
-0.3280974328517914,
-0.21584241092205048,
-0.1412171572446823,
0.34987950325012207,
0.3770304024219513,
-0.029812468215823174,
0.7562255263328552... |
func (h *HealthStatus) Messages() []string {
var messages []string
if statusCode := h.TaskStatus.StatusCode(); statusCode != 0 {
messages = append(messages, fmt.Sprintf("Check returned %d", statusCode))
}
if h.TaskStatus.HasChanges() {
messages = append(messages, "Check indicates changes are required")
}
if d... | [
-1.305209994316101,
-0.11537910252809525,
0.33179330825805664,
-0.5157485008239746,
0.5220806002616882,
0.4481761157512665,
-0.4347720444202423,
-0.5768455266952515,
-0.4861976206302643,
0.10979284346103668,
0.5731061697006226,
0.04672914743423462,
0.14231999218463898,
1.2811050415039062,
... |
func (h *HealthStatus) Changes() map[string]Diff {
return h.Diffs()
} | [
-0.9624618291854858,
-0.9931107759475708,
0.313349187374115,
-0.8711695671081543,
0.05274006351828575,
0.7342715859413147,
-0.8716888427734375,
0.12194569408893585,
-0.3219326436519623,
-0.45844587683677673,
-1.0220597982406616,
0.6292271614074707,
1.286629319190979,
1.5938432216644287,
... |
func (h *HealthStatus) HasChanges() bool {
return h.TaskStatus.HasChanges()
} | [
0.21887224912643433,
0.4823559522628784,
0.545289158821106,
-0.3099041283130646,
0.1365041583776474,
0.08696666359901428,
-0.43803685903549194,
0.5085495710372925,
-0.49673992395401,
-0.4245486259460449,
-0.6680387258529663,
0.11476858705282211,
0.5794108510017395,
1.7004984617233276,
-1... |
func SetOrgRoutes(router *mux.Router) *mux.Router {
orgRouter := mux.NewRouter()
orgRouter.HandleFunc("/api/v1/orgs/add", controllers.AddOrg).Methods("POST")
orgRouter.HandleFunc("/api/v1/admin/orgs/", controllers.GetOrgs).Methods("GET")
orgRouter.HandleFunc("/api/v1/orgs/users/{userId}", controllers.GetOrgByUser).... | [
-0.4490809142589569,
0.2770898938179016,
0.8114255666732788,
0.46852824091911316,
-0.2467692345380783,
0.03569100797176361,
0.11074913293123245,
-0.0010438732570037246,
-0.09330995380878448,
0.19808408617973328,
-0.22540129721164703,
0.7051169276237488,
-0.18476949632167816,
0.417637526988... |
func GetComic(id int) (Comic, error) {
var c Comic
f, err := os.Open(getFileNameForComic(id))
if err != nil {
url := getUrlForComic(id)
c, err = getComicFromUrl(url)
}
json.NewDecoder(bufio.NewReader(f)).Decode(&c)
return c, err
} | [
0.18108059465885162,
-0.7461001873016357,
0.7461985945701599,
-0.06401936709880829,
0.03804391995072365,
-0.8529584407806396,
-0.4391499161720276,
-0.6809908151626587,
-0.5982447862625122,
-0.6815065145492554,
-0.05723880976438522,
0.05504651740193367,
0.7026523947715759,
-0.40102976560592... |
func GetVolumes(mountHost bool, mountSecret bool, instanceName string) []corev1.Volume {
var hostPathDirectoryTypeForPtr = corev1.HostPathDirectory
volumes := []corev1.Volume{
{
Name: "osd-monitored-logs-local",
VolumeSource: corev1.VolumeSource{
ConfigMap: &corev1.ConfigMapVolumeSource{
LocalObject... | [
0.24813993275165558,
0.08551464229822159,
0.6668491959571838,
0.20081256330013275,
0.8448688983917236,
-0.3118908405303955,
-0.8510757684707642,
0.7682077288627625,
-0.07203458994626999,
-0.1097639724612236,
0.1350022256374359,
0.36014509201049805,
-0.06869865208864212,
0.585515558719635,
... |
func (lnf LocalNamespacesFilter) Name() string {
return "LocalNamespacesFilter"
} | [
0.24262858927249908,
-0.9434166550636292,
0.16253550350666046,
0.228409543633461,
-1.1898646354675293,
0.31179818511009216,
-0.18038243055343628,
-0.611992597579956,
0.011155189014971256,
0.40855246782302856,
-0.7101799249649048,
0.18445131182670593,
0.42629721760749817,
1.2781977653503418... |
func (lnf LocalNamespacesFilter) Filter(obj *unstructured.Unstructured) (bool, string, error) {
id := object.UnstructuredToObjMetadata(obj)
if id.GroupKind == namespaceGK &&
lnf.LocalNamespaces.Has(id.Name) {
reason := fmt.Sprintf("namespace still in use (namespace: %q)", id.Name)
return true, reason, nil
}
r... | [
-0.1298665553331375,
-0.17043912410736084,
0.37288177013397217,
-0.7487937211990356,
-1.3129421472549438,
0.06196359172463417,
-0.39977043867111206,
-1.4071804285049438,
0.3595351278781891,
0.29340800642967224,
-0.5581874251365662,
0.16612495481967926,
-0.24954776465892792,
1.3381904363632... |
func (r *TaobaoPromotionCouponSendAPIRequest) SetOuidData(_ouidData []OuidData) error {
r._ouidData = _ouidData
r.Set("ouid_data", _ouidData)
return nil
} | [
-1.37751042842865,
-0.237348735332489,
0.16186964511871338,
-0.6856353282928467,
0.34413713216781616,
0.7670804858207703,
0.2624590992927551,
0.23461273312568665,
0.4233172535896301,
-0.3142230212688446,
-0.9300898909568787,
0.5606766939163208,
0.1274643987417221,
-0.497252881526947,
-0.... |
func (r *TaobaoPromotionCouponSendAPIRequest) SetBuyerIds(_buyerIds []string) error {
r._buyerIds = _buyerIds
r.Set("buyer_ids", _buyerIds)
return nil
} | [
-1.491718053817749,
-0.009272054769098759,
-0.42345327138900757,
0.5674237012863159,
-0.057212453335523605,
-0.11749046295881271,
-0.1907150149345398,
0.7291432023048401,
-0.6043797135353088,
0.5686598420143127,
-1.0202783346176147,
0.5235668420791626,
-0.5114997625350952,
0.50655221939086... |
func NewUlid() string {
now := time.Now()
return ulid.MustNew(ulid.Timestamp(now), ulid.Monotonic(rand.New(rand.NewSource(now.UnixNano())), 0)).String()
} | [
0.2582434117794037,
-1.0927256345748901,
0.6148765087127686,
-0.6158798933029175,
-0.5162917375564575,
1.3015809059143066,
-0.6372388601303101,
0.6866610050201416,
0.9899604916572571,
-0.17146436870098114,
0.15250536799430847,
0.5022730827331543,
0.439728319644928,
0.0008984804153442383,
... |
func (tx *TransactionData) isConfirmed() bool {
return tx.Height > 0
} | [
0.5483222007751465,
0.45461153984069824,
0.5309563875198364,
0.5530940294265747,
0.14173243939876556,
-0.2660331130027771,
-0.7733981609344482,
0.14933571219444275,
-0.25795984268188477,
0.11240902543067932,
-0.3792654871940613,
0.24716179072856903,
0.2596651315689087,
0.45180076360702515,... |
func NewOrderedTransactions(txs []*TransactionData) OrderedTransactions {
sort.Sort(sort.Reverse(byHeight(txs)))
balance := big.NewInt(0)
for i := len(txs) - 1; i >= 0; i-- {
tx := txs[i]
switch tx.Type {
case TxTypeReceive:
balance.Add(balance, tx.Amount.BigInt())
case TxTypeSend:
balance.Sub(balance... | [
0.04953216761350632,
-0.45504260063171387,
0.8762699365615845,
-0.663372278213501,
-0.24403102695941925,
-0.5127231478691101,
0.4193160831928253,
-0.8241924047470093,
0.42067840695381165,
0.42053574323654175,
0.08975250273942947,
-0.1581917256116867,
-0.3067648410797119,
0.5887585878372192... |
func (c *TimeseriesEntry) MarshalJSON() ([]byte, error) {
value, err := c.Value.Int64()
if err != nil {
return nil, err
}
return json.Marshal(struct {
Time int64 `json:"time"`
Value int64 `json:"value"`
}{
Time: c.Time.Unix(),
Value: value,
})
} | [
-0.18257871270179749,
0.3004719614982605,
0.21032224595546722,
-0.40376994013786316,
-0.0495009571313858,
-0.27485761046409607,
-0.25057554244995117,
-0.15250881016254425,
0.1539665162563324,
0.7301973104476929,
-0.19650214910507202,
0.7865132689476013,
0.8505260348320007,
0.92733144760131... |
func (txs OrderedTransactions) EarliestTime() (time.Time, error) {
if len(txs) > 0 {
tx := txs[len(txs)-1]
if tx.Timestamp != nil {
return *tx.Timestamp, nil
}
if tx.isConfirmed() {
return time.Time{}, errp.WithStack(errors.ErrNotAvailable)
}
}
return time.Time{}, nil
} | [
0.4068194031715393,
0.32754918932914734,
0.5705511569976807,
0.2556290924549103,
0.31576356291770935,
-0.8146699070930481,
-0.9516192674636841,
0.03376454859972,
0.7861538529396057,
0.6571933627128601,
0.13117019832134247,
-0.6872046589851379,
-0.20608924329280853,
0.9058773517608643,
-0... |
func (txs OrderedTransactions) Timeseries(
start, end time.Time, interval time.Duration) ([]TimeseriesEntry, error) {
for _, tx := range txs {
if tx.isConfirmed() && tx.Timestamp == nil {
return nil, errp.WithStack(errors.ErrNotAvailable)
}
}
currentTime := start
if currentTime.IsZero() {
return nil, nil
... | [
-0.24472445249557495,
0.6793820261955261,
0.48907509446144104,
0.16929998993873596,
-0.09096650034189224,
-0.9127165079116821,
-0.3654126822948456,
-0.7741993069648743,
-0.44563770294189453,
0.7458714246749878,
0.30695703625679016,
0.4494190514087677,
0.11271794885396957,
-0.02084250934422... |
func tarHeaderTemplate() tar.Header {
// Attempt to lookup the current user. Ignore errors because the default
// zero values are reasonable.
var (
uid int
gid int
uname string
gname string
)
if currentUser, err := user.Current(); err == nil {
uid, _ = strconv.Atoi(currentUser.Uid)
gid, _ = strconv... | [
-0.42195865511894226,
-0.6934441328048706,
0.3782755136489868,
-0.7615601420402527,
-0.9612197875976562,
0.035710081458091736,
-0.6015108823776245,
-0.49487176537513733,
-0.6818206310272217,
0.0838344469666481,
0.0327129065990448,
-0.2675149440765381,
-0.009537916630506516,
-0.809700489044... |
func NewTestDB(url, db string, timeout time.Duration) *TestDB {
return &TestDB{
url: url,
db: db,
timeout: timeout,
}
} | [
0.28690552711486816,
0.015060427598655224,
0.2054547667503357,
0.587689995765686,
-0.9217275381088257,
0.20260760188102722,
-0.7315322756767273,
0.05193885415792465,
0.44627314805984497,
0.3506016433238983,
0.25919803977012634,
0.32356348633766174,
-1.586340069770813,
-0.07061809301376343,... |
func (t *TestDB) OverrideWithEnvVars() {
if t.client != nil {
return
}
if urlOverride := os.Getenv(ENV_VAR_TEST_MONGO_URL); urlOverride != "" {
t.url = urlOverride
}
if dbOverride := os.Getenv(ENV_VAR_TEST_MONGO_DB); dbOverride != "" {
t.db = dbOverride
}
} | [
-0.1852440983057022,
0.31812015175819397,
0.5821284651756287,
-0.0529673732817173,
0.9582681655883789,
0.39130279421806335,
-0.5711672902107239,
-0.7556687593460083,
-0.17102044820785522,
0.03729405626654625,
-0.16326434910297394,
0.10737910866737366,
-1.2907841205596924,
0.959085404872894... |
func (t *TestDB) Connect() error {
// SetServerSelectionTimeout is different and more important than SetConnectTimeout.
// Internally, the mongo driver is polling and updating the topology,
// i.e. the list of replicas/nodes in the cluster. SetServerSelectionTimeout
// applies to selecting a node from the topology,... | [
-0.1655963510274887,
0.20246590673923492,
0.6993743181228638,
0.3273957669734955,
0.20744161307811737,
-0.12183593958616257,
0.5041941404342651,
-0.051080867648124695,
-0.4082128703594208,
0.8892607092857361,
0.0023101463448256254,
-0.02013709582388401,
-0.7429850697517395,
0.0522983931005... |
func (t *TestDB) CreateRandomCollection(indexes []mongo.IndexModel) (*mongo.Collection, error) {
if t.client == nil {
return nil, fmt.Errorf("must call Connect first")
}
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
collection := "test_" + randSeq(8)
coll := t.client.... | [
-0.7620764374732971,
0.3959343731403351,
0.707410454750061,
0.5385755896568298,
0.4823529124259949,
0.1649187058210373,
0.5829622745513916,
-0.9108286499977112,
0.7341316342353821,
0.11468791961669922,
-0.23825785517692566,
-0.8252334594726562,
-1.111668586730957,
0.7402936220169067,
-0.... |
func (t *TestDB) Close() {
t.client.Disconnect(context.Background())
} | [
0.09263625741004944,
-0.004540187306702137,
0.24409933388233185,
0.15120628476142883,
0.1445610225200653,
1.126215934753418,
0.706521213054657,
-0.6880702972412109,
-0.69911789894104,
-0.013037401251494884,
0.6947569847106934,
-0.35227736830711365,
-2.433957815170288,
0.7250335216522217,
... |
func (i ImageShack) ImageByte(url string) ([]byte, error) {
resp, err := i.Get(url)
if err != nil {
return nil, err
}
readed, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, err
}
// close body response
defer func() {
err = resp.Body.Close()
if err != nil {
log.Fatal(err)
}
}()
ret... | [
-1.240228533744812,
-0.35464197397232056,
0.8875153660774231,
-0.4679597020149231,
0.35111549496650696,
-0.20153559744358063,
-0.5613023042678833,
-0.47571608424186707,
0.48907381296157837,
0.7797462344169617,
-0.11756911128759384,
0.2914555072784424,
-1.299399495124817,
0.0511376485228538... |
func Unmarshal(data []byte) (interface{}, error) {
d := NewDecoder(bytes.NewReader(data))
return d.Decode()
} | [
-0.14870350062847137,
0.22499223053455353,
0.3897118866443634,
-0.8722649812698364,
-0.9267017841339111,
-0.21047791838645935,
-0.703811764717102,
0.9172951579093933,
0.6277961730957031,
-1.0005608797073364,
-0.3647267818450928,
0.06219033896923065,
-0.43313056230545044,
-0.552651047706604... |
func NewDecoder(r io.Reader) *Decoder {
return &Decoder{
d: json.NewDecoder(r),
}
} | [
-0.06489012390375137,
-1.4488544464111328,
0.2168605476617813,
-0.842748761177063,
-1.894722580909729,
-0.43085914850234985,
-0.967243492603302,
-0.456754595041275,
0.2892821133136749,
-0.8269813656806946,
0.043390896171331406,
-0.21627868711948395,
0.7914934754371643,
0.8355219960212708,
... |
func (d *Decoder) UseNumber() {
d.d.UseNumber()
} | [
-0.7382695078849792,
0.7651828527450562,
0.5639587640762329,
0.04585351049900055,
-0.35995978116989136,
-1.0954816341400146,
1.1412205696105957,
0.6535617709159851,
0.06765031069517136,
-1.4436849355697632,
0.3121238350868225,
-0.23359787464141846,
0.3225589692592621,
1.2832353115081787,
... |
func (d *Decoder) Decode() (interface{}, error) {
tok, err := d.token()
if err != nil {
return nil, err
}
return d.decode(tok)
} | [
-0.36272993683815,
-0.009587963111698627,
0.40211668610572815,
0.5078273415565491,
-0.7100017070770264,
-1.4350104331970215,
-1.1488679647445679,
-0.05262024328112602,
-0.08890772610902786,
-0.6922388076782227,
-0.19623017311096191,
-0.10733228176832199,
-0.38808688521385193,
0.31130379438... |
func (col COLUMN) AlterCol() (str string) {
str = "alter table " + col.TABLE_NAME + " modify " + col.COLUMN_NAME + " " + col.DATA_TYPE
switch col.DATA_TYPE {
case "VARCHAR2", "CHAR", "VARCHAR", "NVARCHAR2":
str = str + "(" + col.DATA_LENGTH + ")"
}
if col.NULLABLE == "N" {
str = str + " not null "
}
if col... | [
0.32085180282592773,
-0.7181180119514465,
0.7797014713287354,
-0.23295097053050995,
-0.10685966163873672,
0.09835237264633179,
-0.17080332338809967,
0.35198989510536194,
-0.9416956901550293,
-0.13008394837379456,
-0.02925000712275505,
0.8240363597869873,
-0.010677068494260311,
0.3143703937... |
func struct_range() {
// stuc1 := stru{name: "abc", age: 12}
// for i, v := range stuc1 {
// fmt.Println(i, v)
// }
fmt.Println("----------------")
} | [
-0.8098957538604736,
-0.8409900665283203,
0.5614088177680969,
-0.2478846162557602,
-0.2123202234506607,
0.26814326643943787,
1.0566471815109253,
-0.6085090041160583,
-0.3084540069103241,
-0.2984137237071991,
-0.2425442636013031,
0.4778667688369751,
-0.14788316190242767,
-0.1885654777288437... |
func NewCsvParser() *CsvParser {
return &CsvParser{}
} | [
0.24996249377727509,
-1.5239839553833008,
-0.19666346907615662,
0.5305725336074829,
-1.7095816135406494,
-0.1496639996767044,
-1.312127709388733,
-0.11972688138484955,
0.9065327048301697,
-0.45114243030548096,
-0.7800437808036804,
-0.4720489978790283,
-0.48976820707321167,
0.03833262249827... |
func (parser *CsvParser) AcceptedFormat() string {
return "text/csv; charset=utf-8"
} | [
0.9579054713249207,
-0.7726417183876038,
0.2277759462594986,
-0.9902374148368835,
-1.5196802616119385,
0.5429679155349731,
-0.7481408715248108,
0.725351870059967,
-0.08277368545532227,
-0.9156802892684937,
0.720845639705658,
-0.05714819207787514,
0.44128188490867615,
0.9182793498039246,
... |
func ScrapeArticle(url string, client *http.Client) (*ArticleResponse, error) {
req, err := http.NewRequest(http.MethodGet, MercuryURL+url, nil)
if err != nil {
return nil, err
}
req.Header.Add("x-api-key", MercuryToken)
resp, err := client.Do(req)
if err != nil {
return nil, err
}
bodyBytes, err := iouti... | [
-0.7722629308700562,
-0.6164237260818481,
0.6954199075698853,
-0.7885703444480896,
-0.014827790670096874,
-0.5091546773910522,
-0.232578307390213,
-0.13268272578716278,
-0.44501370191574097,
0.6756136417388916,
-0.9868128299713135,
0.3741917312145233,
-1.07211434841156,
-0.817172646522522,... |
func ScrapeYouTube(rawUrl string, client *http.Client) (*YoutubeResponse, error) {
parsedUrl, err := netUrl.Parse(rawUrl)
if err != nil {
return nil, err
}
videoID := parsedUrl.Query().Get("v")
if videoID == "" {
return nil, errors.New("Missing video ID")
}
resp, err := client.Get("https://www.googleapis.co... | [
-0.8197553157806396,
-0.6261634826660156,
0.7583803534507751,
-0.2058982104063034,
0.4221264719963074,
-0.8786947131156921,
-0.25370487570762634,
-0.1886054426431656,
0.08104508370161057,
0.22334717214107513,
-0.9668337106704712,
0.6047031283378601,
-0.3578316867351532,
0.3006505072116852,... |
func (_m *MockJournal) Append(payload ...Payload) (Index, error) {
ret := _m.Called(payload)
var r0 Index
if rf, ok := ret.Get(0).(func(...Payload) Index); ok {
r0 = rf(payload...)
} else {
r0 = ret.Get(0).(Index)
}
var r1 error
if rf, ok := ret.Get(1).(func(...Payload) error); ok {
r1 = rf(payload...)
... | [
-0.8017324805259705,
0.3260982036590576,
0.6425990462303162,
-0.2979617118835449,
-0.5218545198440552,
-0.4654292166233063,
0.05082717165350914,
-0.1286209523677826,
-0.31988832354545593,
-0.6074694991111755,
0.14504604041576385,
0.12817738950252533,
0.2127317190170288,
0.5126938223838806,... |
func (_m *MockJournal) Notify(_a0 Notifiee, _a1 Index) {
_m.Called(_a0, _a1)
} | [
-0.46874356269836426,
0.034471988677978516,
0.08650039881467819,
-0.7399568557739258,
0.533328115940094,
-0.0897412970662117,
0.6426154971122742,
1.0024224519729614,
-0.6054746508598328,
0.9560136795043945,
-0.3822217881679535,
0.42106738686561584,
0.9713001251220703,
0.7357093691825867,
... |
func (_m *MockJournal) Restore(entry ...Entry) (Index, error) {
ret := _m.Called(entry)
var r0 Index
if rf, ok := ret.Get(0).(func(...Entry) Index); ok {
r0 = rf(entry...)
} else {
r0 = ret.Get(0).(Index)
}
var r1 error
if rf, ok := ret.Get(1).(func(...Entry) error); ok {
r1 = rf(entry...)
} else {
r1... | [
-0.5208324790000916,
-0.40677446126937866,
0.47674816846847534,
0.11692572385072708,
0.597029447555542,
-0.7205106019973755,
0.6830410957336426,
0.2477748990058899,
0.21933504939079285,
-0.2141382396221161,
0.09261921793222427,
0.5031024813652039,
-0.4693875312805176,
-0.3659631311893463,
... |
func (_m *MockEntry) GetIndex() Index {
ret := _m.Called()
var r0 Index
if rf, ok := ret.Get(0).(func() Index); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(Index)
}
return r0
} | [
-0.3291235566139221,
0.6303180456161499,
0.37549981474876404,
0.5901854038238525,
1.3461329936981201,
-0.6665248274803162,
1.2316097021102905,
1.1039786338806152,
0.34491708874702454,
-0.2549603283405304,
-0.49459952116012573,
1.0726420879364014,
-0.3347800672054291,
-0.11564944684505463,
... |
func (_m *MockEntry) GetParentIndex() Index {
ret := _m.Called()
var r0 Index
if rf, ok := ret.Get(0).(func() Index); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(Index)
}
return r0
} | [
0.11062265187501907,
0.19333559274673462,
0.4927821457386017,
0.5396421551704407,
0.7753989696502686,
-0.28454262018203735,
1.284948706626892,
0.05156916379928589,
-0.19602863490581512,
-0.4034152925014496,
-0.6381993293762207,
0.8153640031814575,
-0.7831547856330872,
0.16353394091129303,
... |
func (_m *MockEntry) GetPayload() Payload {
ret := _m.Called()
var r0 Payload
if rf, ok := ret.Get(0).(func() Payload); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(Payload)
}
}
return r0
} | [
0.1891961544752121,
0.4298257529735565,
0.7194666862487793,
0.38269713521003723,
0.6910591721534729,
-0.6213802099227905,
0.785975456237793,
0.07461152225732803,
0.10340005904436111,
-0.5201858878135681,
0.2861432135105133,
0.21401989459991455,
-0.07796075195074081,
0.5023225545883179,
0... |
func (_m *MockNotifiee) ProcessJournalEntry(_a0 Entry) {
_m.Called(_a0)
} | [
0.46834903955459595,
-0.35117626190185547,
-0.09805576503276825,
-0.9348852634429932,
-0.06306129693984985,
-0.17821699380874634,
1.2409167289733887,
0.5151276588439941,
0.35512104630470276,
0.8176891207695007,
0.6792133450508118,
1.1534082889556885,
0.7175278663635254,
0.7363417744636536,... |
func NewRateReporter(name string, counter *int64, shutdown *bool, logger func(name string, rate float64), ratePeriodMs int) (*RateReporter, error) {
if counter == nil {
return nil, fmt.Errorf("counter should not be nil")
}
if shutdown == nil {
return nil, fmt.Errorf("shutdown should not be nil")
}
if logger =... | [
0.1675279438495636,
0.3653405010700226,
0.46835458278656006,
-0.336723268032074,
-0.4374115467071533,
-0.41589269042015076,
-0.8657184839248657,
-0.18068605661392212,
-0.2725909948348999,
0.5282829403877258,
0.2110310047864914,
-0.14007902145385742,
-1.7049038410186768,
0.9194899797439575,... |
func (r *RateReporter) Run() {
lastCount := *r.Counter
for range time.NewTicker(r.RatePeriod).C {
currentCount := *r.Counter
rate := r.calculateRatePerSecond(currentCount, lastCount)
lastCount = currentCount
r.Logger(r.Name, rate)
if *r.Shutdown {
break
}
}
} | [
-0.38173916935920715,
-0.08537866175174713,
0.4779098927974701,
-0.46484991908073425,
0.1657813936471939,
0.24924297630786896,
0.40908777713775635,
-0.21985754370689392,
-0.7002611756324768,
-0.043761223554611206,
0.11460620164871216,
-0.7229001522064209,
-1.4859884977340698,
0.82750248908... |
func (r *RateLimiter) Check(checkTime time.Time, currentCount int64) time.Duration {
elapsedTime := checkTime.Sub(r.StartTime)
if elapsedTime > time.Second {
//reset as second is over
r.LastIntervalCount = currentCount
r.StartTime = checkTime
return 0
}
messageDiff := currentCount - r.LastIntervalCount
if ... | [
0.5809199810028076,
0.19427843391895294,
0.6322445869445801,
0.20977932214736938,
-0.318698525428772,
0.38010695576667786,
0.27040794491767883,
-0.40987738966941833,
-0.8614779114723206,
0.5649390816688538,
0.739655077457428,
0.7504227161407471,
-1.6329982280731201,
0.7271149754524231,
0... |
func NewAccountsServer(options ...Option) (*AccountsServer, error) {
s := &AccountsServer{}
for _, option := range options {
if err := option(s); err != nil {
return nil, err
}
}
return s, nil
} | [
-1.186943531036377,
-0.6823216676712036,
0.17920224368572235,
0.3824378550052643,
-0.18486669659614563,
-0.2652193605899811,
0.026390060782432556,
-0.5374414920806885,
-0.027665281668305397,
-0.02942814864218235,
-0.4543267786502838,
-0.3662136495113373,
-1.0500482320785522,
0.655387222766... |
func (s *AccountsServer) Serve(ctx context.Context, grpcAddr string, creds credentials.TransportCredentials) {
entry := logrus.NewEntry(s.logger)
grpc_logrus.ReplaceGrpcLogger(entry)
grpcServer := grpc.NewServer(
grpc.Creds(creds),
grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(
grpc_ctxtags.UnaryServ... | [
-0.41228264570236206,
-0.08223357051610947,
0.7036389708518982,
-0.5402474999427795,
0.6546590328216553,
0.08960932493209839,
0.6338605284690857,
-0.1372148096561432,
-0.28780898451805115,
0.35942038893699646,
0.010496357455849648,
0.9018760919570923,
-0.1871422678232193,
-0.58371973037719... |
func (p *PlaylistItem) YoutubeID() string {
if p.APIPlaylistItem == nil || p.APIPlaylistItem.Snippet == nil {
log.Fatalln("APIPlaylistItem snippet is nil, cannot get youtube id")
}
return p.APIPlaylistItem.Snippet.ResourceId.VideoId
} | [
0.5317013263702393,
-1.1268740892410278,
0.36449259519577026,
0.17810092866420746,
0.7816179394721985,
0.6387324333190918,
0.06725461781024933,
0.4983779191970825,
1.4251033067703247,
0.7117749452590942,
-0.5224558711051941,
0.8046165704727173,
-1.1308612823486328,
0.5154143571853638,
0.... |
func GenerateHash(stringToHash string, length int) string {
// Create an MD5 hash and return however many characters the caller wants (note that the max is 32 for MD5)
return fmt.Sprintf(fmt.Sprintf("%%.%ds", length), fmt.Sprintf("%x", md5.Sum([]byte(stringToHash))))
} | [
0.5829634666442871,
0.31453484296798706,
0.599868655204773,
-0.40017470717430115,
-0.9255752563476562,
0.753021240234375,
-0.22659651935100555,
0.13614478707313538,
0.03826209902763367,
-0.014441519044339657,
-0.3558696210384369,
0.35477325320243835,
-0.3098158836364746,
-1.332436323165893... |
func DefaultHandler(w http.ResponseWriter, _ *http.Request) {
log.Print("In DefaultHandler")
w.Header().Set("Content-Type", "text/html; charset=utf-8")
w.WriteHeader(http.StatusNotFound)
w.Write( []byte ("This is the tech_test service"))
} | [
0.342682808637619,
-0.04987158253788948,
0.2683098018169403,
0.33548974990844727,
0.4015003740787506,
0.8787059187889099,
0.3753395080566406,
0.15611149370670319,
-0.1972658783197403,
-0.7736003398895264,
0.6558212041854858,
-0.2876194715499878,
-0.9367383122444153,
0.3731161057949066,
-... |
func (ds *Mongostore) Insert(collection string, val interface{}) error {
col := ds.session.DB(ds.dbspec.Dbname).C(collection)
err := col.Insert(val)
return err
} | [
-0.4007773995399475,
0.9964269399642944,
0.28168895840644836,
0.272832453250885,
-0.16087007522583008,
0.8648576140403748,
-0.15816918015480042,
-0.09117511659860611,
-0.6074084043502808,
0.28213179111480713,
-0.6808733344078064,
-0.28734976053237915,
-1.1091877222061157,
0.108560957014560... |
func GetDatastore (spec DStoreSpec) (ds Datastore, err error ) {
mongoDBDialInfo := &mgo.DialInfo{
Addrs: []string{spec.Hostaddr},
Timeout: 60 * time.Second,
Database: spec.Dbname,
Username: spec.Dbuser,
Password: spec.Dbpwd,
}
// Create a session which maintains a pool of socket connections
// to ... | [
0.3873516023159027,
0.6389079689979553,
0.4732924699783325,
-0.5344100594520569,
-0.09742746502161026,
-0.13152283430099487,
-0.30713677406311035,
0.1999637484550476,
0.26889243721961975,
-0.45265933871269226,
-0.5077488422393799,
0.4239796996116638,
-0.4891502261161804,
-0.045409359037876... |
func WithTransferCallback(callback base.TransferCallback) Option {
return func(node base.Node) {
node.SetTransferCallback(callback)
}
} | [
1.075813889503479,
-0.18388056755065918,
0.705659806728363,
-0.25627896189689636,
-0.07019679248332977,
0.12273440510034561,
0.5992652773857117,
-0.7948690056800842,
1.148696780204773,
0.49672791361808777,
-0.7482083439826965,
-0.936894953250885,
0.7546415328979492,
0.7882933020591736,
-... |
func (fu *FlowUpdate) Where(ps ...predicate.Flow) *FlowUpdate {
fu.predicates = append(fu.predicates, ps...)
return fu
} | [
0.20820701122283936,
-0.9704327583312988,
0.3149071931838989,
0.2012128233909607,
-0.4973756670951843,
0.6261539459228516,
-0.15177810192108154,
0.1658223569393158,
-0.38498449325561523,
-0.9611918330192566,
0.43353497982025146,
0.6091439127922058,
-0.6653465628623962,
-0.5439849495887756,... |
func (fu *FlowUpdate) SetState(u uuid.UUID) *FlowUpdate {
fu.mutation.SetState(u)
return fu
} | [
-1.2275761365890503,
0.3711802661418915,
0.298164963722229,
1.3544503450393677,
-0.4237755537033081,
0.18981817364692688,
0.7693219780921936,
1.1294265985488892,
0.6070654392242432,
-0.8957057595252991,
-1.1979387998580933,
0.043986398726701736,
-0.6802864074707031,
-0.16401013731956482,
... |
func (fu *FlowUpdate) SetStateTable(s string) *FlowUpdate {
fu.mutation.SetStateTable(s)
return fu
} | [
-0.4634817838668823,
-0.3978384733200073,
0.3639887571334839,
0.906626284122467,
-0.8671603798866272,
-0.3942844867706299,
0.9788782596588135,
-0.38777878880500793,
0.6038679480552673,
0.24456119537353516,
-0.8252180814743042,
-0.4959035813808441,
-0.4618191421031952,
0.18644417822360992,
... |
func (fu *FlowUpdate) SetInitialState(u uuid.UUID) *FlowUpdate {
fu.mutation.SetInitialState(u)
return fu
} | [
-0.29481279850006104,
-0.6827784776687622,
0.08128892630338669,
1.00807523727417,
-0.664451539516449,
0.2410040646791458,
0.7611371874809265,
1.3454155921936035,
0.8597453832626343,
-0.3536815345287323,
-0.5322895050048828,
0.21689558029174805,
-0.49975118041038513,
-0.2996096909046173,
... |
func (fu *FlowUpdate) SetTerminationState(u uuid.UUID) *FlowUpdate {
fu.mutation.SetTerminationState(u)
return fu
} | [
-0.6429179906845093,
-0.5726674795150757,
0.16414566338062286,
0.5089179277420044,
-0.5308926105499268,
-0.03808367997407913,
0.5892003178596497,
1.1058120727539062,
0.6272122859954834,
0.15925000607967377,
-0.9029660820960999,
-0.8735935091972351,
0.09251800924539566,
-0.4113272726535797,... |
func (fu *FlowUpdate) SetPastState(u uuid.UUID) *FlowUpdate {
fu.mutation.SetPastState(u)
return fu
} | [
-0.7842565774917603,
-0.16205310821533203,
0.20098136365413666,
0.580129861831665,
-0.7138033509254456,
0.4422195553779602,
0.8773542642593384,
0.6720939874649048,
0.651903510093689,
0.08842992037534714,
-1.0512789487838745,
-0.43304499983787537,
-0.35381361842155457,
-0.16361761093139648,... |
func (fu *FlowUpdate) ClearPastState() *FlowUpdate {
fu.mutation.ClearPastState()
return fu
} | [
-0.3104858696460724,
-0.1139451414346695,
0.22102896869182587,
0.45932263135910034,
-1.1499171257019043,
0.6063281297683716,
0.16431133449077606,
-0.2576732933521271,
0.6954116821289062,
0.6171547770500183,
0.14321142435073853,
0.16917391121387482,
-0.24376127123832703,
-0.3308257162570953... |
func (fu *FlowUpdate) SetSurveyID(id uuid.UUID) *FlowUpdate {
fu.mutation.SetSurveyID(id)
return fu
} | [
-0.6393128633499146,
-0.8417361378669739,
-0.07064452022314072,
1.110579013824463,
-1.0048547983169556,
1.0144683122634888,
-0.25651130080223083,
0.6231240630149841,
0.9499112963676453,
0.7028757333755493,
-1.160307765007019,
-0.11382374912500381,
-0.20401103794574738,
0.7653037309646606,
... |
func (fu *FlowUpdate) SetNillableSurveyID(id *uuid.UUID) *FlowUpdate {
if id != nil {
fu = fu.SetSurveyID(*id)
}
return fu
} | [
-0.13333727419376373,
-0.16809234023094177,
0.030104096978902817,
0.16005948185920715,
-1.39288330078125,
0.5644860863685608,
-0.847052812576294,
-0.3040086030960083,
1.0388705730438232,
0.10322586447000504,
-0.22832629084587097,
0.13941428065299988,
-0.7667359709739685,
0.8659643530845642... |
func (fu *FlowUpdate) SetSurvey(s *Survey) *FlowUpdate {
return fu.SetSurveyID(s.ID)
} | [
-0.03641962632536888,
-0.5273374319076538,
0.22340288758277893,
1.4217982292175293,
-0.967350423336029,
-0.15398910641670227,
-0.05991864949464798,
0.08052480965852737,
0.963665783405304,
-1.258456826210022,
-0.8784985542297363,
0.23608539998531342,
-0.472065806388855,
0.21831046044826508,... |
func (fu *FlowUpdate) AddQuestionIDs(ids ...uuid.UUID) *FlowUpdate {
fu.mutation.AddQuestionIDs(ids...)
return fu
} | [
-1.0331790447235107,
-0.8789972066879272,
0.10619953274726868,
1.2731032371520996,
-0.22013533115386963,
0.6946184039115906,
-0.11968652904033661,
-0.04264732822775841,
0.22633859515190125,
0.1814763993024826,
0.1290406882762909,
-0.5121353268623352,
-0.579647421836853,
-0.1134593486785888... |
func (fu *FlowUpdate) AddQuestions(q ...*Question) *FlowUpdate {
ids := make([]uuid.UUID, len(q))
for i := range q {
ids[i] = q[i].ID
}
return fu.AddQuestionIDs(ids...)
} | [
-0.858720064163208,
-0.40365344285964966,
0.34365615248680115,
0.75129234790802,
0.3353409171104431,
0.7071291208267212,
-0.303099125623703,
-0.5992656946182251,
0.34977322816848755,
-0.6809288859367371,
0.8477458953857422,
-1.029653787612915,
-0.6149841547012329,
0.3599846363067627,
-2.... |
func (fu *FlowUpdate) ClearSurvey() *FlowUpdate {
fu.mutation.ClearSurvey()
return fu
} | [
-0.345795601606369,
-0.22660064697265625,
0.19432897865772247,
1.704917073249817,
-1.2810707092285156,
0.5060134530067444,
-0.6926605105400085,
-0.20985843241214752,
0.7984734773635864,
-0.4420022666454315,
-0.29035264253616333,
-0.00628002779558301,
-0.410240113735199,
-0.8893588781356812... |
func (fu *FlowUpdate) RemoveQuestionIDs(ids ...uuid.UUID) *FlowUpdate {
fu.mutation.RemoveQuestionIDs(ids...)
return fu
} | [
-0.8636974692344666,
-1.2133266925811768,
0.03138769045472145,
1.1275553703308105,
-1.1678041219711304,
0.3767828941345215,
0.04883195459842682,
0.508495032787323,
0.12500183284282684,
0.5272719264030457,
-0.3100886046886444,
-0.632093608379364,
-1.3042534589767456,
-0.35023412108421326,
... |
func (fu *FlowUpdate) RemoveQuestions(q ...*Question) *FlowUpdate {
ids := make([]uuid.UUID, len(q))
for i := range q {
ids[i] = q[i].ID
}
return fu.RemoveQuestionIDs(ids...)
} | [
-0.7682705521583557,
-0.6118654608726501,
0.2902776896953583,
0.6687840223312378,
-0.3784704804420471,
0.22919778525829315,
0.18814024329185486,
-0.24205394089221954,
0.2081318199634552,
-0.11135725677013397,
0.1384388506412506,
-1.236104130744934,
-0.9971599578857422,
0.1627988964319229,
... |
func (fu *FlowUpdate) Save(ctx context.Context) (int, error) {
if v, ok := fu.mutation.StateTable(); ok {
if err := flow.StateTableValidator(v); err != nil {
return 0, fmt.Errorf("ent: validator failed for field \"stateTable\": %v", err)
}
}
var (
err error
affected int
)
if len(fu.hooks) == 0 {
... | [
-1.2074792385101318,
0.24389827251434326,
0.8912868499755859,
0.492750883102417,
0.12541846930980682,
-0.8332360982894897,
1.136385440826416,
-0.447752445936203,
-0.24827904999256134,
0.1478334665298462,
-0.3776659667491913,
-0.4862341582775116,
-0.6278378367424011,
0.21975378692150116,
... |
func (fu *FlowUpdate) SaveX(ctx context.Context) int {
affected, err := fu.Save(ctx)
if err != nil {
panic(err)
}
return affected
} | [
-0.6220322847366333,
0.7204484343528748,
0.6868466138839722,
0.6678887605667114,
-0.42617496848106384,
0.41679954528808594,
-0.09860025346279144,
0.7991717457771301,
1.0695534944534302,
-0.2046741396188736,
-1.2891311645507812,
-0.30430296063423157,
-0.9610899090766907,
-0.3671007454395294... |
func (fu *FlowUpdate) Exec(ctx context.Context) error {
_, err := fu.Save(ctx)
return err
} | [
-0.20814990997314453,
-0.20587438344955444,
0.6249645948410034,
0.7651568651199341,
0.44978901743888855,
0.9149165153503418,
-0.14315570890903473,
0.09042162448167801,
0.15551793575286865,
0.01679433323442936,
-0.27083128690719604,
-0.2091357260942459,
-0.5891997814178467,
-0.7008386254310... |
func (fu *FlowUpdate) ExecX(ctx context.Context) {
if err := fu.Exec(ctx); err != nil {
panic(err)
}
} | [
0.5534974932670593,
0.2554726302623749,
0.6062444448471069,
0.8122167587280273,
0.02803666517138481,
1.0123746395111084,
-0.5318095684051514,
0.2388041466474533,
0.7368264198303223,
-0.5204681158065796,
0.0633075162768364,
0.460799902677536,
-0.06927238404750824,
-0.3994729518890381,
0.6... |
func (fuo *FlowUpdateOne) SetState(u uuid.UUID) *FlowUpdateOne {
fuo.mutation.SetState(u)
return fuo
} | [
-1.0749961137771606,
0.597449541091919,
0.329393595457077,
1.4951591491699219,
-0.2854820191860199,
0.29028263688087463,
1.0024229288101196,
1.357777714729309,
0.5415629148483276,
-0.8213900923728943,
-1.2938385009765625,
0.16286250948905945,
-0.7295501828193665,
0.023658448830246925,
-1... |
func (fuo *FlowUpdateOne) SetStateTable(s string) *FlowUpdateOne {
fuo.mutation.SetStateTable(s)
return fuo
} | [
-0.4295448958873749,
-0.22361956536769867,
0.35459643602371216,
1.0319623947143555,
-0.8505393862724304,
-0.2903454601764679,
1.0432020425796509,
-0.11690408736467361,
0.6496189832687378,
0.26751646399497986,
-1.0011420249938965,
-0.405007004737854,
-0.468973308801651,
0.17590267956256866,... |
func (fuo *FlowUpdateOne) SetInitialState(u uuid.UUID) *FlowUpdateOne {
fuo.mutation.SetInitialState(u)
return fuo
} | [
-0.22188733518123627,
-0.5671062469482422,
0.11211130768060684,
1.1866732835769653,
-0.555753231048584,
0.39315083622932434,
0.7828774452209473,
1.5177013874053955,
0.8336377739906311,
-0.29496240615844727,
-0.6077831387519836,
0.26850807666778564,
-0.5621477961540222,
-0.2494032382965088,... |
func (fuo *FlowUpdateOne) SetTerminationState(u uuid.UUID) *FlowUpdateOne {
fuo.mutation.SetTerminationState(u)
return fuo
} | [
-0.5972541570663452,
-0.4735087454319,
0.24017657339572906,
0.6871441602706909,
-0.46631157398223877,
0.0999298244714737,
0.6687958240509033,
1.2760812044143677,
0.7021933794021606,
0.31401437520980835,
-1.0179938077926636,
-0.8816468715667725,
0.1246432214975357,
-0.3966823220252991,
-1... |
func (fuo *FlowUpdateOne) SetPastState(u uuid.UUID) *FlowUpdateOne {
fuo.mutation.SetPastState(u)
return fuo
} | [
-0.719081461429596,
-0.12431823462247849,
0.23265431821346283,
0.7382875680923462,
-0.6051865220069885,
0.5146401524543762,
0.945533275604248,
0.8782922029495239,
0.6264126300811768,
0.24340401589870453,
-1.1512314081192017,
-0.32772746682167053,
-0.33511167764663696,
-0.17681023478507996,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.