text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func AssetDigest(name string) ([sha256.Size]byte, error) {
canonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[canonicalName]; ok {
a, err := f()
if err != nil {
return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s can't read by error: %v", name, err)
}
return a.digest, nil
}
ret... | [
-0.3591914772987366,
-0.6181963086128235,
0.7434927821159363,
-1.1689051389694214,
-1.152544617652893,
-0.5196005702018738,
-0.2411303073167801,
-1.0479568243026733,
-0.5882827043533325,
0.310821533203125,
0.08598455786705017,
-0.05696683004498482,
-0.296350359916687,
0.04578978568315506,
... |
func Digests() (map[string][sha256.Size]byte, error) {
mp := make(map[string][sha256.Size]byte, len(_bindata))
for name := range _bindata {
a, err := _bindata[name]()
if err != nil {
return nil, err
}
mp[name] = a.digest
}
return mp, nil
} | [
-0.8371758460998535,
-0.8630334734916687,
0.8149356245994568,
-0.20492912828922272,
-0.4950232207775116,
-0.7048240303993225,
-0.32209330797195435,
-0.4336596429347992,
-0.07046830654144287,
-0.36870822310447693,
-0.4737861156463623,
0.22748501598834991,
0.2845746874809265,
0.8567589521408... |
func AssetNames() []string {
names := make([]string, 0, len(_bindata))
for name := range _bindata {
names = append(names, name)
}
return names
} | [
-0.7293784618377686,
-0.8460342288017273,
0.7321816682815552,
-0.39323121309280396,
-0.48951536417007446,
0.7661203145980835,
-0.5028699636459351,
-0.8655748963356018,
-0.4145073890686035,
0.8099913597106934,
0.16903363168239594,
1.163049578666687,
-0.028152840211987495,
0.0342608317732811... |
func RestoreAsset(dir, name string) error {
data, err := Asset(name)
if err != nil {
return err
}
info, err := AssetInfo(name)
if err != nil {
return err
}
err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
if err != nil {
return err
}
err = ioutil.WriteFile(_filePath(dir, name), d... | [
-0.04950583726167679,
-0.19623512029647827,
0.6907734274864197,
-1.3569048643112183,
-0.2967042326927185,
-0.3611973226070404,
0.07744784653186798,
-0.471956729888916,
-0.31164032220840454,
-0.08379734307527542,
-0.002142141805961728,
0.06316494196653366,
-0.342814564704895,
-0.61630117893... |
func RestoreAssets(dir, name string) error {
children, err := AssetDir(name)
// File
if err != nil {
return RestoreAsset(dir, name)
}
// Dir
for _, child := range children {
err = RestoreAssets(dir, filepath.Join(name, child))
if err != nil {
return err
}
}
return nil
} | [
0.42261892557144165,
0.30020031332969666,
0.5813396573066711,
-0.20641657710075378,
-0.23828908801078796,
-0.24414615333080292,
0.5739709138870239,
-0.029911456629633904,
0.06188219040632248,
-0.43923482298851013,
0.5113736987113953,
0.3275970220565796,
-0.6125145554542542,
0.0351656526327... |
func cephOSDPoolExists(ClusterName string, poolName string, userName string) bool {
_, err := shared.RunCommand(
"ceph",
"--name", fmt.Sprintf("client.%s", userName),
"--cluster", ClusterName,
"osd",
"pool",
"get",
poolName,
"size")
if err != nil {
return false
}
return true
} | [
-0.6034428477287292,
-0.35426923632621765,
0.5719776153564453,
0.13678476214408875,
0.37600430846214294,
0.6558778882026672,
-0.3485260307788849,
0.1393972635269165,
-0.5188560485839844,
0.3375648558139801,
-0.5028611421585083,
0.15827098488807678,
-0.1360446810722351,
-0.3239888846874237,... |
func cephOSDPoolDestroy(clusterName string, poolName string, userName string) error {
_, err := shared.RunCommand("ceph",
"--name", fmt.Sprintf("client.%s", userName),
"--cluster", clusterName,
"osd",
"pool",
"delete",
poolName,
poolName,
"--yes-i-really-really-mean-it")
if err != nil {
return err
... | [
-0.26770320534706116,
-0.3219074606895447,
0.18730083107948303,
0.2848624885082245,
0.012702889740467072,
0.46868473291397095,
0.12498549371957779,
0.012360772117972374,
-0.32337087392807007,
0.12718075513839722,
-0.012761346995830536,
0.42633116245269775,
-0.7904975414276123,
-0.068177439... |
func cephRBDVolumeCreate(clusterName string, poolName string, volumeName string,
volumeType string, size string, userName string, dataPoolName string) error {
cmd := []string{
"--id", userName,
"--image-feature", "layering,",
"--cluster", clusterName,
"--pool", poolName,
}
if dataPoolName != "" {
cmd = a... | [
0.1726834774017334,
-0.479777991771698,
0.7450189590454102,
0.2985675036907196,
0.6166753768920898,
0.5234272480010986,
-0.2908674478530884,
-0.6539207696914673,
-1.2427548170089722,
-0.07423955202102661,
-0.2758065462112427,
0.8912101984024048,
-0.923538863658905,
0.5560631155967712,
0.... |
func cephRBDVolumeExists(clusterName string, poolName string, volumeName string,
volumeType string, userName string) bool {
_, err := shared.RunCommand(
"rbd",
"--id", userName,
"--cluster", clusterName,
"--pool", poolName,
"image-meta",
"list",
fmt.Sprintf("%s_%s", volumeType, volumeName))
if err != n... | [
-0.7357909083366394,
-1.3503109216690063,
0.7998310327529907,
-0.09398337453603745,
1.0076433420181274,
0.5818383693695068,
-1.0203100442886353,
-0.306328147649765,
-1.1890017986297607,
0.3891947567462921,
-0.11762785166501999,
0.6877647042274475,
-1.0568026304244995,
0.612119197845459,
... |
func cephRBDSnapshotExists(clusterName string, poolName string,
volumeName string, volumeType string, snapshotName string,
userName string) bool {
_, err := shared.RunCommand(
"rbd",
"--id", userName,
"--cluster", clusterName,
"--pool", poolName,
"info",
fmt.Sprintf("%s_%s@%s", volumeType, volumeName, sn... | [
-0.7597141861915588,
-0.7841633558273315,
0.6859935522079468,
0.03175007551908493,
-0.0533454492688179,
0.4808327853679657,
-1.126497507095337,
-0.4093480706214905,
-0.6802650094032288,
-0.40438568592071533,
0.08433537185192108,
0.10886891931295395,
-0.9164384603500366,
-0.0269915238022804... |
func cephRBDVolumeDelete(clusterName string, poolName string, volumeName string,
volumeType string, userName string) error {
_, err := shared.RunCommand(
"rbd",
"--id", userName,
"--cluster", clusterName,
"--pool", poolName,
"rm",
fmt.Sprintf("%s_%s", volumeType, volumeName))
if err != nil {
return err... | [
0.3662218749523163,
-1.1459753513336182,
0.7823063731193542,
0.13527558743953705,
0.519264817237854,
0.34710046648979187,
-0.30659517645835876,
-0.652032732963562,
-0.9195588231086731,
0.21719518303871155,
0.026094721630215645,
0.8458933234214783,
-2.0179431438446045,
0.11745800822973251,
... |
func cephRBDVolumeMap(clusterName string, poolName string, volumeName string,
volumeType string, userName string) (string, error) {
devPath, err := shared.RunCommand(
"rbd",
"--id", userName,
"--cluster", clusterName,
"--pool", poolName,
"map",
fmt.Sprintf("%s_%s", volumeType, volumeName))
if err != nil ... | [
-0.5917667746543884,
-1.340888500213623,
0.7736824750900269,
0.23717673122882843,
0.0040143802762031555,
0.6432474255561829,
0.11489789187908173,
-1.0540547370910645,
0.22052745521068573,
0.12654133141040802,
0.45309990644454956,
0.45627501606941223,
-1.1981137990951538,
0.0017766109667718... |
func cephRBDVolumeUnmap(clusterName string, poolName string, volumeName string,
volumeType string, userName string, unmapUntilEINVAL bool) error {
unmapImageName := fmt.Sprintf("%s_%s", volumeType, volumeName)
busyCount := 0
again:
_, err := shared.RunCommand(
"rbd",
"--id", userName,
"--cluster", clusterNa... | [
-0.7541565299034119,
-0.8141023516654968,
1.1086503267288208,
-0.30456429719924927,
-0.39691826701164246,
0.04770850017666817,
0.5272420048713684,
-0.3015049695968628,
-0.3336959779262543,
0.3242112994194031,
0.40326040983200073,
0.21796360611915588,
-1.1798243522644043,
-0.148251906037330... |
func cephRBDVolumeSnapshotUnmap(clusterName string, poolName string,
volumeName string, volumeType string, snapshotName string,
userName string, unmapUntilEINVAL bool) error {
unmapSnapshotName := fmt.Sprintf("%s_%s@%s", volumeType, volumeName,
snapshotName)
again:
_, err := shared.RunCommand(
"rbd",
"--id",... | [
-0.7186325788497925,
-0.733924925327301,
0.8439393043518066,
-0.1364818811416626,
-1.2216943502426147,
0.17973020672798157,
0.17822585999965668,
0.18920396268367767,
-0.3895142674446106,
-0.094378761947155,
0.3564114570617676,
-0.215379998087883,
-0.9610709547996521,
-0.4110540747642517,
... |
func cephRBDSnapshotCreate(clusterName string, poolName string,
volumeName string, volumeType string, snapshotName string,
userName string) error {
_, err := shared.RunCommand(
"rbd",
"--id", userName,
"--cluster", clusterName,
"--pool", poolName,
"snap",
"create",
"--snap", snapshotName,
fmt.Sprintf... | [
-0.422038197517395,
-0.16496361792087555,
0.467192143201828,
0.04240919649600983,
-0.16983194649219513,
0.908976674079895,
-0.6914647817611694,
-0.7616419196128845,
-0.4691638648509979,
-0.5583232641220093,
0.08224938809871674,
0.15416467189788818,
-0.646001398563385,
-0.14206665754318237,... |
func cephRBDSnapshotsPurge(clusterName string, poolName string,
volumeName string, volumeType string, userName string) error {
_, err := shared.RunCommand(
"rbd",
"--id", userName,
"--cluster", clusterName,
"--pool", poolName,
"snap",
"purge",
fmt.Sprintf("%s_%s", volumeType, volumeName))
if err != nil... | [
-0.38641297817230225,
-0.23713932931423187,
0.615631103515625,
0.09690036624670029,
0.19623510539531708,
0.12696826457977295,
-0.43868619203567505,
-1.1187820434570312,
0.13963133096694946,
-0.005386068485677242,
0.10031120479106903,
1.0423659086227417,
-0.81202232837677,
0.246388807892799... |
func cephRBDSnapshotProtect(clusterName string, poolName string,
volumeName string, volumeType string, snapshotName string,
userName string) error {
_, err := shared.RunCommand(
"rbd",
"--id", userName,
"--cluster", clusterName,
"--pool", poolName,
"snap",
"protect",
"--snap", snapshotName,
fmt.Sprin... | [
-0.24205435812473297,
-0.413016676902771,
0.8156967759132385,
0.16743320226669312,
-0.5942987203598022,
-0.27951690554618835,
-0.41260576248168945,
-0.9117018580436707,
0.2839937210083008,
-0.08839074522256851,
-0.15595851838588715,
-0.21933402121067047,
-0.9491229057312012,
-0.13699217140... |
func cephRBDSnapshotUnprotect(clusterName string, poolName string,
volumeName string, volumeType string, snapshotName string,
userName string) error {
_, err := shared.RunCommand(
"rbd",
"--id", userName,
"--cluster", clusterName,
"--pool", poolName,
"snap",
"unprotect",
"--snap", snapshotName,
fmt.S... | [
-0.5654180645942688,
-0.24758821725845337,
0.6053641438484192,
-0.4284347891807556,
-0.8420875072479248,
-0.5148341655731201,
0.04390614107251167,
-0.4128093123435974,
-0.2958401143550873,
-0.05472630634903908,
0.02314348705112934,
-0.21949385106563568,
-1.206460952758789,
-0.4109196960926... |
func cephRBDCloneCreate(sourceClusterName string, sourcePoolName string,
sourceVolumeName string, sourceVolumeType string,
sourceSnapshotName string, targetPoolName string,
targetVolumeName string, targetVolumeType string,
userName string, targetDataPoolName string) error {
cmd := []string{
"--id", userName,
"... | [
-0.20070220530033112,
-0.6158427000045776,
0.9761453866958618,
0.3110813796520233,
0.32439637184143066,
0.892616868019104,
-0.1711714267730713,
-0.8003036379814148,
-0.6156157851219177,
0.09656882286071777,
-0.08816970884799957,
0.9108176231384277,
-0.848915159702301,
-0.03515925630927086,... |
func cephRBDSnapshotListClones(clusterName string, poolName string,
volumeName string, volumeType string,
snapshotName string, userName string) ([]string, error) {
msg, err := shared.RunCommand(
"rbd",
"--id", userName,
"--cluster", clusterName,
"--pool", poolName,
"children",
"--image", fmt.Sprintf("%s_... | [
-0.41884341835975647,
-0.7905744314193726,
0.6443469524383545,
0.48265159130096436,
-0.8559213280677795,
0.25715914368629456,
-1.1917555332183838,
-0.6250409483909607,
0.594963788986206,
0.40574923157691956,
-0.3243507742881775,
0.4484739303588867,
-1.1290158033370972,
0.7578340172767639,
... |
func cephRBDVolumeMarkDeleted(clusterName string, poolName string,
volumeType string, oldVolumeName string, newVolumeName string,
userName string, suffix string) error {
deletedName := fmt.Sprintf("%s/zombie_%s_%s", poolName, volumeType,
newVolumeName)
if suffix != "" {
deletedName = fmt.Sprintf("%s_%s", delete... | [
0.4657713770866394,
-1.893355131149292,
0.8667524456977844,
0.08202575892210007,
0.5877774357795715,
-0.1606491208076477,
0.3966410756111145,
0.08099725842475891,
0.0648977980017662,
-0.14540186524391174,
0.0756731852889061,
1.4198760986328125,
-0.5830227732658386,
0.3775522708892822,
0.... |
func cephRBDVolumeUnmarkDeleted(clusterName string, poolName string,
volumeName string, volumeType string, userName string, oldSuffix string,
newSuffix string) error {
oldName := fmt.Sprintf("%s/zombie_%s_%s", poolName, volumeType, volumeName)
if oldSuffix != "" {
oldName = fmt.Sprintf("%s_%s", oldName, oldSuffix... | [
-0.34225860238075256,
-1.9064069986343384,
0.9823204278945923,
-0.4989451467990875,
0.42072686553001404,
-0.06640596687793732,
0.8172085285186768,
0.08249961584806442,
-0.25129395723342896,
-0.06340665370225906,
-0.13749539852142334,
1.3291620016098022,
-0.5409489870071411,
-0.219478979706... |
func cephRBDVolumeRename(clusterName string, poolName string, volumeType string,
oldVolumeName string, newVolumeName string, userName string) error {
_, err := shared.RunCommand(
"rbd",
"--id", userName,
"--cluster", clusterName,
"mv",
fmt.Sprintf("%s/%s_%s", poolName, volumeType, oldVolumeName),
fmt.Spri... | [
-0.723782479763031,
-1.494787573814392,
0.9429213404655457,
-0.29624518752098083,
0.18664605915546417,
-0.13411648571491241,
-0.4063968062400818,
-0.5662623643875122,
-1.0556074380874634,
0.8844727277755737,
-0.11294856667518616,
0.9574242234230042,
-0.9879858493804932,
0.28100350499153137... |
func cephRBDVolumeSnapshotRename(clusterName string, poolName string,
volumeName string, volumeType string, oldSnapshotName string,
newSnapshotName string, userName string) error {
_, err := shared.RunCommand(
"rbd",
"--id", userName,
"--cluster", clusterName,
"snap",
"rename",
fmt.Sprintf("%s/%s_%s@%s",... | [
-0.925059974193573,
-1.2335196733474731,
0.943085253238678,
-0.009282027371227741,
-0.7913989424705505,
-0.004075218923389912,
-0.7717536687850952,
-0.42811575531959534,
-0.6626516580581665,
0.35484015941619873,
0.07637384533882141,
0.5340284109115601,
0.10365075618028641,
-0.2065358012914... |
func cephRBDSnapshotDelete(clusterName string, poolName string,
volumeName string, volumeType string, snapshotName string,
userName string) error {
_, err := shared.RunCommand(
"rbd",
"--id", userName,
"--cluster", clusterName,
"--pool", poolName,
"snap",
"rm",
fmt.Sprintf("%s_%s@%s", volumeType, volum... | [
-0.06851700693368912,
-0.5316630005836487,
0.5932374596595764,
0.13723911345005035,
-0.7898956537246704,
0.31940680742263794,
-0.5156428217887878,
-0.282956600189209,
0.02569500543177128,
-0.20741914212703705,
0.2759439945220947,
0.36509251594543457,
-1.0656906366348267,
-0.229347288608551... |
func cephRBDVolumeCopy(clusterName string, oldVolumeName string,
newVolumeName string, userName string) error {
_, err := shared.RunCommand(
"rbd",
"--id", userName,
"--cluster", clusterName,
"cp",
oldVolumeName,
newVolumeName)
if err != nil {
return err
}
return nil
} | [
-0.1351364701986313,
-1.5992778539657593,
0.7720707058906555,
0.6445062756538391,
-0.11008133739233017,
0.672402560710907,
-0.5182739496231079,
-0.43672528862953186,
-0.7615801095962524,
1.0599346160888672,
0.1796431988477707,
1.120971441268921,
-1.1489181518554688,
-0.2940681278705597,
... |
func cephRBDVolumeListSnapshots(clusterName string, poolName string,
volumeName string, volumeType string,
userName string) ([]string, error) {
msg, err := shared.RunCommand(
"rbd",
"--id", userName,
"--format", "json",
"--cluster", clusterName,
"--pool", poolName,
"snap",
"ls", fmt.Sprintf("%s_%s", vo... | [
-0.6609920859336853,
-1.4820741415023804,
0.7394177317619324,
-0.29210391640663147,
-0.6715232133865356,
0.025640280917286873,
-1.0427441596984863,
-0.9050015807151794,
0.2140778750181198,
0.6124746203422546,
-0.04460545629262924,
0.37178024649620056,
-0.5745660066604614,
0.457556366920471... |
func cephRBDVolumeRestore(clusterName string, poolName string, volumeName string,
volumeType string, snapshotName string, userName string) error {
_, err := shared.RunCommand(
"rbd",
"--id", userName,
"--cluster", clusterName,
"--pool", poolName,
"snap",
"rollback",
"--snap", snapshotName,
fmt.Sprintf... | [
-0.47407296299934387,
-0.2423960268497467,
0.5370607972145081,
-0.4816814363002777,
0.09349602460861206,
-0.03345675766468048,
-0.5373033881187439,
-0.3374064564704895,
-0.4102376699447632,
-0.24224892258644104,
-0.22749455273151398,
0.44644632935523987,
-1.6049844026565552,
-0.79450976848... |
func (s *storageCeph) getRBDSize() (string, error) {
size, ok := s.volume.Config["size"]
if !ok {
size = s.pool.Config["volume.size"]
}
sz, err := units.ParseByteSizeString(size)
if err != nil {
return "", err
}
// Safety net: Set to default value.
if sz == 0 {
sz, _ = units.ParseByteSizeString("10GB")
... | [
0.4563063681125641,
0.06798194348812103,
0.8419992923736572,
-0.22463934123516083,
0.42330992221832275,
0.21642746031284332,
-0.278523325920105,
-0.17585016787052155,
-0.1372271180152893,
-0.20671623945236206,
0.056073643267154694,
0.3716513216495514,
-1.4862165451049805,
0.788420736789703... |
func (s *storageCeph) getRBDFilesystem() string {
if s.volume.Config["block.filesystem"] != "" {
return s.volume.Config["block.filesystem"]
}
if s.pool.Config["volume.block.filesystem"] != "" {
return s.pool.Config["volume.block.filesystem"]
}
return "ext4"
} | [
0.5349598526954651,
-0.7636166214942932,
0.8135694861412048,
0.3852730989456177,
0.8894258141517639,
-0.14379088580608368,
0.15511558949947357,
-1.0211153030395508,
-0.5585195422172546,
-0.9621025323867798,
0.19970978796482086,
0.4829917848110199,
-1.183426856994629,
0.9133933186531067,
... |
func (s *storageCeph) getRBDMountOptions() string {
if s.volume.Config["block.mount_options"] != "" {
return s.volume.Config["block.mount_options"]
}
if s.pool.Config["volume.block.mount_options"] != "" {
return s.pool.Config["volume.block.mount_options"]
}
if s.getRBDFilesystem() == "btrfs" {
return "user... | [
1.1867597103118896,
-0.7108232975006104,
0.8460596799850464,
0.708669126033783,
0.8411843180656433,
-0.2178919017314911,
-0.6617456078529358,
-0.71888267993927,
-0.19416296482086182,
0.06277921050786972,
0.034890852868556976,
1.0829209089279175,
-0.9539514780044556,
1.4441567659378052,
0... |
func (s *storageCeph) copyWithoutSnapshotsFull(target instance.Instance, source instance.Instance) error {
logger.Debugf(`Creating non-sparse copy of RBD storage volume for container "%s" to "%s" without snapshots`, source.Name(), target.Name())
sourceIsSnapshot := source.IsSnapshot()
sourceContainerName := project... | [
-0.457864373922348,
-0.5679861307144165,
0.6381081342697144,
-0.3556172847747803,
-0.4658235013484955,
0.11025024950504303,
0.204079270362854,
-0.5304419994354248,
0.3043776750564575,
-0.050256870687007904,
-0.258950799703598,
0.21418707072734833,
0.37975260615348816,
0.39399826526641846,
... |
func (s *storageCeph) copyWithoutSnapshotsSparse(target instance.Instance, source instance.Instance) error {
logger.Debugf(`Creating sparse copy of RBD storage volume for container "%s" to "%s" without snapshots`, source.Name(),
target.Name())
sourceIsSnapshot := source.IsSnapshot()
sourceContainerName := project... | [
-0.05988693982362747,
-0.32582059502601624,
0.7839512228965759,
-0.09738429635763168,
-0.5346432328224182,
0.11950235813856125,
-0.22669415175914764,
-0.6178173422813416,
0.7306942939758301,
-0.3400087356567383,
0.14498619735240936,
-0.11723244935274124,
-0.32485565543174744,
0.18022656440... |
func (s *storageCeph) copyWithSnapshots(sourceVolumeName string,
targetVolumeName string, sourceParentSnapshot string) error {
logger.Debugf(`Creating non-sparse copy of RBD storage volume "%s to "%s"`, sourceVolumeName, targetVolumeName)
args := []string{
"export-diff",
"--id", s.UserName,
"--cluster", s.Clu... | [
0.16910262405872345,
-0.6129242777824402,
0.8433972001075745,
0.3271178603172302,
-0.10030117630958557,
0.49890977144241333,
0.11225070059299469,
-1.04383385181427,
0.5804905891418457,
-0.0772886797785759,
-0.03715278208255768,
0.8024251461029053,
-0.17969650030136108,
0.7090267539024353,
... |
func cephContainerDelete(clusterName string, poolName string, volumeName string,
volumeType string, userName string) int {
logEntry := fmt.Sprintf("%s/%s_%s", poolName, volumeType, volumeName)
snaps, err := cephRBDVolumeListSnapshots(clusterName, poolName,
volumeName, volumeType, userName)
if err == nil {
var ... | [
-0.5375604629516602,
-0.9762434363365173,
1.0436090230941772,
0.3083820044994354,
0.3443849980831146,
-0.6145346164703369,
1.267449140548706,
-0.4999748766422272,
-0.05395849794149399,
-0.10067629814147949,
0.1229640394449234,
-0.004790132865309715,
-0.8507512211799622,
0.5790693163871765,... |
func cephContainerSnapshotDelete(clusterName string, poolName string,
volumeName string, volumeType string, snapshotName string,
userName string) int {
logImageEntry := fmt.Sprintf("%s/%s_%s", poolName, volumeType, volumeName)
logSnapshotEntry := fmt.Sprintf("%s/%s_%s@%s", poolName, volumeType,
volumeName, snapsh... | [
-0.0747719332575798,
-0.7367802858352661,
1.0172691345214844,
0.1863715946674347,
-0.24330241978168488,
-0.6468690633773804,
0.6445575952529907,
-0.48815280199050903,
0.18120770156383514,
0.005246370565146208,
0.05562646687030792,
-0.39721769094467163,
-0.6868945360183716,
-0.1008059233427... |
func parseParent(parent string) (string, string, string, string, error) {
idx := strings.Index(parent, "/")
if idx == -1 {
return "", "", "", "", fmt.Errorf("Unexpected parsing error")
}
slider := parent[(idx + 1):]
poolName := parent[:idx]
volumeType := slider
idx = strings.Index(slider, "zombie_")
if idx =... | [
-0.6369057297706604,
-0.968792200088501,
0.9023724794387817,
-1.166421890258789,
-0.644077479839325,
-0.7118569016456604,
0.32812368869781494,
-1.3216444253921509,
-1.075408935546875,
0.12419503182172775,
-0.6704716086387634,
-0.5634080767631531,
-0.037491705268621445,
0.11153393238782883,... |
func parseClone(clone string) (string, string, string, error) {
idx := strings.Index(clone, "/")
if idx == -1 {
return "", "", "", fmt.Errorf("Unexpected parsing error")
}
slider := clone[(idx + 1):]
poolName := clone[:idx]
volumeType := slider
idx = strings.Index(slider, "zombie_")
if idx == 0 {
idx += le... | [
-0.9438761472702026,
-0.9935075044631958,
1.0303597450256348,
-0.22466836869716644,
-0.21912667155265808,
-0.6196446418762207,
0.31761667132377625,
-1.0989965200424194,
-1.0290559530258179,
1.1880065202713013,
-0.6316795349121094,
-0.1290866881608963,
-0.19522209465503693,
-0.3553211688995... |
func getRBDMappedDevPath(clusterName string, poolName string, volumeType string,
volumeName string, doMap bool, userName string) (string, int) {
files, err := ioutil.ReadDir("/sys/devices/rbd")
if err != nil {
if os.IsNotExist(err) {
if doMap {
goto mapImage
}
return "", 0
}
return "", -1
}
f... | [
-0.8694572448730469,
-1.0826088190078735,
1.2833977937698364,
-0.0045325662940740585,
-0.017600279301404953,
0.3009132444858551,
0.6289981007575989,
-0.7711182236671448,
-0.11969780921936035,
0.1841193586587906,
0.03911907225847244,
0.2760688364505768,
-0.0953207015991211,
1.09721732139587... |
func (s *storageCeph) cephRBDVolumeDumpToFile(sourceVolumeName string, file string) error {
logger.Debugf(`Dumping RBD storage volume "%s" to "%s"`, sourceVolumeName, file)
args := []string{
"export",
"--id", s.UserName,
"--cluster", s.ClusterName,
sourceVolumeName,
file,
}
rbdSendCmd := exec.Command("r... | [
-0.2073698490858078,
-0.5806224346160889,
0.5866246223449707,
-0.20471589267253876,
0.6482245922088623,
0.5217034816741943,
0.3595157265663147,
-0.4460606575012207,
-0.4059271812438965,
0.5675775408744812,
-0.2789124846458435,
0.8578750491142273,
-0.6359317302703857,
0.4347309470176697,
... |
func (s *storageCeph) cephRBDVolumeBackupCreate(tmpPath string, backup backup.Backup, source instance.Instance) error {
sourceIsSnapshot := source.IsSnapshot()
sourceContainerName := source.Name()
sourceContainerOnlyName := project.Prefix(source.Project(), sourceContainerName)
sourceSnapshotOnlyName := ""
// Prep... | [
-0.11851391196250916,
-0.0682385042309761,
0.8778436779975891,
0.1899014413356781,
0.02680286020040512,
0.011507117189466953,
0.3360007405281067,
-0.6885075569152832,
0.07726050168275833,
0.002342252293601632,
-0.11957881599664688,
-0.6239427328109741,
-0.16324996948242188,
-0.047833345830... |
func (s *storageCeph) cephRBDGenerateUUID(volumeName string, volumeType string) error {
// Map the RBD volume
RBDDevPath, err := cephRBDVolumeMap(s.ClusterName, s.OSDPoolName, volumeName, volumeType, s.UserName)
if err != nil {
return err
}
defer cephRBDVolumeUnmap(s.ClusterName, s.OSDPoolName, volumeName, volum... | [
-0.9963611960411072,
-0.7666919827461243,
0.7233091592788696,
-0.42705345153808594,
0.5545415282249451,
0.32558131217956543,
0.05709076300263405,
0.7356123328208923,
-0.8837348818778992,
0.23607593774795532,
-0.04277460277080536,
0.19171078503131866,
-1.1085985898971558,
0.5033552646636963... |
func NewRawBlock() *RawBlock {
return &RawBlock{}
} | [
-0.3440435826778412,
0.32868143916130066,
0.33341431617736816,
0.1302207112312317,
-1.9068342447280884,
-0.10483881831169128,
-0.4455426037311554,
-0.7739787697792053,
0.05306239426136017,
-1.259830117225647,
-1.115995168685913,
0.6338897347450256,
0.41017836332321167,
0.30633991956710815,... |
func NewRawInline(content []byte) *RawInline {
return &RawInline{
Content: content,
}
} | [
-0.29072847962379456,
-0.9487211108207703,
0.058037545531988144,
-0.32586342096328735,
-1.6590230464935303,
-0.4027804732322693,
-0.6093034148216248,
0.219429150223732,
0.08899249881505966,
-0.566819429397583,
-2.0927631855010986,
0.06144058331847191,
-0.5985537767410278,
-0.27105069160461... |
func (u *userInput) OK() error {
// check the white space
u.Email = strings.TrimSpace(u.Email)
u.Username = strings.TrimSpace(u.Username)
// validate the regex
if !user.RXEmail.MatchString(u.Email) {
return user.ErrInvalidEmail
}
if !user.RXUsername.MatchString(u.Username) {
return user.ErrInvalidUsername
... | [
0.32797375321388245,
0.0778701975941658,
0.4551810622215271,
-0.015342788770794868,
-0.8405442833900452,
0.7215035557746887,
0.6586083769798279,
0.18341980874538422,
0.0973786860704422,
0.23964521288871765,
-0.004096080549061298,
0.8062187433242798,
-0.3633345067501068,
-0.8490968942642212... |
func decode(v user.Validator) error {
return v.OK()
} | [
0.1770973652601242,
-0.0342785008251667,
0.18534411489963531,
1.13825261592865,
-0.5671669840812683,
0.3419291079044342,
-0.21415925025939941,
0.454973042011261,
0.3310850262641907,
-0.6026684641838074,
-0.10868316888809204,
0.28000178933143616,
-0.5467883944511414,
-0.0675802156329155,
... |
func (s *UserService) CreateUser(ctx context.Context, email, username string) error {
// first check the email and usernmae
u := &userInput{
Email: email,
Username: username,
}
if err := decode(u); err != nil {
return err
}
// make the query and save the users
query := "INSERT INTO users (email, userna... | [
-0.536190927028656,
0.6221980452537537,
0.532080888748169,
0.032146502286195755,
0.7421532273292542,
0.0862177237868309,
0.47109559178352356,
0.4137340188026428,
-0.2506382167339325,
0.37464970350265503,
-0.017845146358013153,
-0.4993550181388855,
-1.264260172843933,
0.17505031824111938,
... |
func Adjustment(i, j int) int {
if i > j {
return -1
} else if i < j {
return 1
}
return 0
} | [
-0.8586139678955078,
0.03934328258037567,
0.4788016080856323,
0.1385039985179901,
-0.8010869026184082,
0.1521204262971878,
0.671993613243103,
0.10803784430027008,
-0.2810998260974884,
0.47525328397750854,
0.1728283166885376,
0.6101170778274536,
-0.4722231924533844,
0.46753379702568054,
0... |
func (f *Filesystem) MkDir(path string) error {
f.Mutex.Lock()
defer f.Mutex.Unlock()
if err := f.DirExists(path); err == nil {
return ErrAlreadyExists
}
parent := filepath.Dir(path)
if parent != "." && parent != "/" {
parents := strings.Split(parent, "/")
for i, _ := range parents {
path := strings.J... | [
-0.29025641083717346,
0.5218738317489624,
0.6363980174064636,
-0.07254718989133835,
-0.047896143049001694,
0.4208464026451111,
0.33695361018180847,
-0.3688947558403015,
0.6339110732078552,
-0.6238424181938171,
0.16309824585914612,
-0.5476996302604675,
0.26038452982902527,
1.129055976867675... |
func (f *Filesystem) RmDir(path string) error {
f.Mutex.Lock()
defer f.Mutex.Unlock()
if err := f.DirExists(path); err != nil {
return ErrNotFound
}
for name, _ := range f.Files {
if strings.HasPrefix(name, filepath.Clean(path)) {
delete(f.Files, name)
}
}
for i, directory := range f.Directories {
... | [
-0.4569482207298279,
-0.040409233421087265,
0.45725005865097046,
-0.013792132027447224,
-0.6640557050704956,
0.06920725107192993,
0.16910302639007568,
-0.18781262636184692,
0.6656127572059631,
-0.27464520931243896,
0.22063609957695007,
-0.6000158786773682,
-0.14937640726566315,
1.367788076... |
func (f *File) ModeString() string {
if f.Type == "directory" {
return DirMode.String()
}
return FileMode.String()
} | [
-0.522643506526947,
0.2271754890680313,
0.4890731871128082,
-0.5640169978141785,
-0.3354353904724121,
0.7004045844078064,
-0.5663155913352966,
-0.41255345940589905,
-0.1433120220899582,
-0.14138612151145935,
0.9484363198280334,
-0.3793739378452301,
0.25600191950798035,
1.085937261581421,
... |
func (user *User) GetAnotherProfile(r *http.Request) ([]Post, User, error) {
//userQR := DB.QueryRow("SELECT * FROM users WHERE id = ?", user.Temp)
u := User{}
postsU := []Post{}
//err = userQR.Scan(&u.ID, &u.FullName, &u.Email, &u.Password, &u.IsAdmin, &u.Age, &u.Sex, &u.CreatedTime, &u.City, &u.Image)
err = DB... | [
0.3066687285900116,
-0.43084490299224854,
0.8674424290657043,
0.7689463496208191,
-0.13395820558071136,
-0.2161201387643814,
0.004038902930915356,
-0.353624552488327,
-0.5168914794921875,
0.03335914760828018,
-0.8122367262840271,
-0.15392765402793884,
-0.19812428951263428,
1.28716158866882... |
func (u *User) DeleteAccount(w http.ResponseWriter, r *http.Request) {
_, err = DB.Exec("DELETE FROM session WHERE user_id=?", u.ID)
if err != nil {
log.Println(err)
}
_, err = DB.Exec("DELETE FROM voteState WHERE user_id=?", u.ID)
if err != nil {
log.Println(err)
}
_, err = DB.Exec("DELETE FROM commen... | [
-0.21600815653800964,
-0.5152171850204468,
0.5336355566978455,
1.0551939010620117,
0.546934187412262,
-0.1972324550151825,
1.38650381565094,
-0.07912363111972809,
1.0506547689437866,
0.3049328029155731,
0.6586311459541321,
0.2945593297481537,
0.13477414846420288,
0.683617353439331,
0.241... |
func NewFixedLeader(hs *hotstuff.HotStuff, leaderID hotstuff.ReplicaID) *FixedLeader {
return &FixedLeader{
HotStuff: hs,
leader: leaderID,
}
} | [
0.2662738859653473,
-0.9900355339050293,
0.18960833549499512,
0.574812114238739,
-0.5832334160804749,
0.15122291445732117,
-1.0268417596817017,
0.5244361758232117,
0.6174189448356628,
-0.39933741092681885,
-1.2523082494735718,
1.1305240392684937,
-0.5515957474708557,
0.9684511423110962,
... |
func (p FixedLeader) Run(ctx context.Context) {
notify := p.GetNotifier()
if p.GetID() == p.leader {
go p.Propose()
}
var n hotstuff.Notification
var ok bool
for {
select {
case n, ok = <-notify:
if !ok {
return
}
case <-ctx.Done():
return
}
switch n.Event {
case hotstuff.QCFinish:
i... | [
0.09755903482437134,
-0.024181969463825226,
0.5898677706718445,
0.41520464420318604,
0.32538801431655884,
0.3678743243217468,
-0.24392253160476685,
-0.2214176207780838,
0.15004509687423706,
0.1898908019065857,
-0.8414022922515869,
-0.041672900319099426,
-0.9297353029251099,
0.6464681625366... |
func NewRoundRobin(hs *hotstuff.HotStuff, termLength int, schedule []hotstuff.ReplicaID, timeout time.Duration) *RoundRobin {
return &RoundRobin{
HotStuff: hs,
termLength: termLength,
schedule: schedule,
timeout: timeout,
resetTimer: make(chan struct{}),
}
} | [
-0.013218685053288937,
-0.7048566341400146,
0.6446723341941833,
-0.30563268065452576,
-0.6833146810531616,
0.21327710151672363,
-0.45850229263305664,
-0.5573207139968872,
-0.0690065249800682,
0.26894354820251465,
-0.5806955099105835,
1.531972885131836,
-0.47355973720550537,
0.4990098178386... |
func (p *RoundRobin) getLeader(vHeight int) hotstuff.ReplicaID {
term := int(math.Ceil(float64(vHeight)/float64(p.termLength)) - 1)
return p.schedule[term%len(p.schedule)]
} | [
0.17213591933250427,
-0.1738191694021225,
0.4709267020225525,
0.23724961280822754,
-0.6929544806480408,
-0.251655250787735,
-0.5348103046417236,
-0.8181746006011963,
0.6940871477127075,
0.4922523498535156,
0.1719212383031845,
0.9625819325447083,
-1.4511443376541138,
-0.3891136944293976,
... |
func (p *RoundRobin) Run(ctx context.Context) {
notify := p.GetNotifier()
// initial beat
if p.getLeader(1) == p.GetID() {
go p.Propose()
}
// get initial notification
n := <-notify
// make sure that we only beat once per view, and don't beat if bLeaf.Height < vHeight
// as that would cause a panic
lastBe... | [
0.09214671701192856,
-0.20208393037319183,
0.8998731970787048,
0.4431149959564209,
0.19846102595329285,
0.006963467691093683,
0.7233129143714905,
-0.32263824343681335,
0.09743501245975494,
-0.011106740683317184,
-0.3966144919395447,
0.3146372139453888,
-0.8184341192245483,
0.61556243896484... |
func (p *RoundRobin) startNewViewTimeout(stopContext context.Context) {
for {
select {
case <-p.resetTimer:
case <-stopContext.Done():
return
case <-time.After(p.timeout):
// add a dummy block to the tree representing this round which failed
logger.Println("NewViewTimeout triggered")
p.SetLeaf(hots... | [
0.3623656928539276,
-0.4365702271461487,
0.4685201346874237,
-0.01857708767056465,
-0.16815266013145447,
-0.23311933875083923,
0.028222128748893738,
-0.3685416877269745,
0.29598554968833923,
0.032679952681064606,
0.09117453545331955,
0.7865235805511475,
-0.30492088198661804,
0.741285920143... |
func MakeEndpointNodeID(hostID, address, port string) string {
return lookupID(hostID, address, port, func() string {
return MakeAddressNodeID(hostID, address) + ScopeDelim + port
})
} | [
0.08592529594898224,
-0.05340207740664482,
0.5647335052490234,
-1.0107322931289673,
-0.45123472809791565,
0.5875741839408875,
-0.2605535089969635,
0.6068068742752075,
0.6381125450134277,
1.2905021905899048,
0.4042849540710449,
1.157783031463623,
-0.2565988302230835,
-1.0577272176742554,
... |
func MakeAddressNodeID(hostID, address string) string {
var scope string
// Loopback addresses and addresses explicitly marked as
// local get scoped by hostID
addressIP := net.ParseIP(address)
if addressIP != nil && LocalNetworks.Contains(addressIP) {
scope = hostID
} else if isLoopback(address) {
scope = h... | [
-0.0018249463755637407,
-0.2925136387348175,
0.6622843146324158,
-0.7011159062385559,
-0.8752647042274475,
0.2890399992465973,
0.17974860966205597,
0.5130376219749451,
1.081326961517334,
0.9932129383087158,
0.6964665651321411,
1.5061097145080566,
0.18924632668495178,
0.07807430624961853,
... |
func MakeScopedEndpointNodeID(hostID, address, port string) string {
return hostID + ScopeDelim + address + ScopeDelim + port
} | [
0.024044059216976166,
-0.037391774356365204,
0.44359058141708374,
-0.694385826587677,
-0.3668161928653717,
1.1287750005722046,
-0.30262449383735657,
0.5381836295127869,
0.09698021411895752,
1.0729643106460571,
0.2516831159591675,
1.2112934589385986,
-0.4737594425678253,
-0.7949588894844055... |
func MakeScopedAddressNodeID(hostID, address string) string {
return hostID + ScopeDelim + address
} | [
-0.13184522092342377,
-0.15636081993579865,
0.5036272406578064,
-0.6902211904525757,
-0.8934388756752014,
0.7854225039482117,
-0.16083358228206635,
0.5250682234764099,
1.2314895391464233,
1.0182913541793823,
0.37152278423309326,
2.213015079498291,
0.1740097552537918,
-0.4060191512107849,
... |
func MakeProcessNodeID(hostID, pid string) string {
return hostID + ScopeDelim + pid
} | [
0.3698030412197113,
-0.7895944118499756,
0.41609644889831543,
-0.9581455588340759,
-0.4779597222805023,
0.7618032097816467,
-0.2668096423149109,
0.591714084148407,
0.12161865830421448,
0.8475154638290405,
0.3094046711921692,
1.594138741493225,
-0.01033876184374094,
-1.0068697929382324,
0... |
func makeSingleComponentID(tag string) func(string) string {
return func(id string) string {
return id + ScopeDelim + "<" + tag + ">"
}
} | [
0.18544328212738037,
-1.118902564048767,
0.4618695378303528,
-1.0820279121398926,
-0.9228858947753906,
0.6925329566001892,
0.5319439172744751,
0.30461356043815613,
1.6395314931869507,
-0.2849961519241333,
-0.691207230091095,
0.14526145160198212,
0.5684540271759033,
0.1600402295589447,
0.... |
func parseSingleComponentID(tag string) func(string) (string, bool) {
return func(id string) (string, bool) {
fields := strings.SplitN(id, ScopeDelim, 2)
if len(fields) != 2 || fields[1] != "<"+tag+">" {
return "", false
}
return fields[0], true
}
} | [
-0.06649813801050186,
-0.8133097887039185,
0.660699725151062,
-0.6632806658744812,
-0.31522345542907715,
-0.3950234651565552,
0.4340369999408722,
0.3687576353549957,
0.7441146373748779,
0.28202584385871887,
-0.9076350331306458,
-0.36375370621681213,
0.10966680198907852,
0.881259560585022,
... |
func MakeOverlayNodeID(peerName string) string {
return "#" + peerName
} | [
0.24720880389213562,
-0.18276065587997437,
0.45409509539604187,
-1.4792635440826416,
-1.5894184112548828,
1.406640648841858,
0.41370636224746704,
0.3507158160209656,
0.4247986376285553,
-0.2589350640773773,
0.6380811333656311,
0.4853745698928833,
-0.3134983479976654,
-0.25280654430389404,
... |
func ParseNodeID(nodeID string) (hostID string, remainder string, ok bool) {
fields := strings.SplitN(nodeID, ScopeDelim, 2)
if len(fields) != 2 {
return "", "", false
}
return fields[0], fields[1], true
} | [
-0.37061217427253723,
0.17225892841815948,
0.7012981176376343,
-0.3637997806072235,
-0.5480633974075317,
0.02640029415488243,
-0.33582308888435364,
-0.05498610809445381,
-0.3374629318714142,
1.240129828453064,
-0.8636861443519592,
0.16615071892738342,
-1.0843470096588135,
0.037114847451448... |
func ParseEndpointNodeID(endpointNodeID string) (hostID, address, port string, ok bool) {
fields := strings.SplitN(endpointNodeID, ScopeDelim, 3)
if len(fields) != 3 {
return "", "", "", false
}
return fields[0], fields[1], fields[2], true
} | [
-0.4463399052619934,
-0.048671819269657135,
0.671117901802063,
-0.633700430393219,
0.14771410822868347,
0.36367180943489075,
-0.3786987364292145,
-0.02825072407722473,
-0.6514081358909607,
1.2838233709335327,
-0.6981826424598694,
0.23386777937412262,
-0.8125629425048828,
-0.814496874809265... |
func ParseAddressNodeID(addressNodeID string) (hostID, address string, ok bool) {
fields := strings.SplitN(addressNodeID, ScopeDelim, 2)
if len(fields) != 2 {
return "", "", false
}
return fields[0], fields[1], true
} | [
-0.4161372184753418,
-0.33508312702178955,
0.7392028570175171,
-0.5428118705749512,
-0.5648288726806641,
-0.024958226829767227,
-0.2665492296218872,
0.12144237756729126,
0.08443660289049149,
1.2598645687103271,
-0.49313610792160034,
0.7375446557998657,
-0.20058727264404297,
-0.542246580123... |
func ExtractHostID(m Node) string {
hostNodeID, _ := m.Latest.Lookup(HostNodeID)
hostID, _, _ := ParseNodeID(hostNodeID)
return hostID
} | [
0.7744119763374329,
-0.5291963815689087,
0.5052425265312195,
-0.2419375479221344,
-0.09128575772047043,
0.0703071802854538,
0.12768664956092834,
0.4246949851512909,
-0.2162018120288849,
1.0416160821914673,
0.07355944067239761,
-0.043529145419597626,
-0.1735047847032547,
-0.0879371091723442... |
func (s *Server) starDebugServer() {
glog.GLog.Infof("start debug server on %v", s.conf.DebugServer)
if err := http.ListenAndServe(s.conf.DebugServer, nil); err != nil {
glog.GLog.Fatalln(err)
}
} | [
-0.652077317237854,
-0.8128300309181213,
0.23951679468154907,
-0.22999581694602966,
0.25962305068969727,
0.8141643404960632,
-0.20527708530426025,
0.8664987087249756,
-0.3071497678756714,
-0.6226865649223328,
-0.8466178178787231,
1.20740807056427,
-0.8401013612747192,
0.9799977540969849,
... |
func NewEMRInstanceGroupConfig(properties EMRInstanceGroupConfigProperties, deps ...interface{}) EMRInstanceGroupConfig {
return EMRInstanceGroupConfig{
Type: "AWS::EMR::InstanceGroupConfig",
Properties: properties,
DependsOn: deps,
}
} | [
-0.5908384919166565,
-0.4981555640697479,
0.005130581092089415,
-0.7160732746124268,
-1.2602031230926514,
0.1245003193616867,
-0.23713833093643188,
0.9271309971809387,
-0.6000683903694153,
0.966469943523407,
-0.6024888753890991,
0.4041391611099243,
-0.57666015625,
0.6864234805107117,
0.0... |
func GetOverallMetrics(ctx context.Context, cli *client.Client, all bool) (OverallMetrics, error) {
metrics := OverallMetrics{}
// Get list of containers
containers, err := cli.ContainerList(ctx, types.ContainerListOptions{All: all})
if err != nil {
return metrics, err
}
metrcisChan := make(chan PerContainerM... | [
-0.276088684797287,
0.525037407875061,
0.9137027859687805,
0.08208473026752472,
0.09779302775859833,
0.17827992141246796,
0.7379947304725647,
-0.3956948518753052,
-0.31293821334838867,
0.25106602907180786,
0.01770446076989174,
0.4030802547931671,
-0.48881348967552185,
0.987880527973175,
... |
func (Blob) Fields() []ent.Field {
return []ent.Field{
field.Text("network_id"),
field.Text("type"),
field.Text("key"),
field.Bytes("value").
Optional(),
field.Uint64("version").
Default(0),
}
} | [
0.12873528897762299,
-0.0861494392156601,
0.27321019768714905,
-1.0728511810302734,
1.1996188163757324,
0.9950934052467346,
-1.270756483078003,
-0.441253662109375,
0.05171068012714386,
0.4035869836807251,
-1.1385341882705688,
-1.0083011388778687,
-0.7062205076217651,
-0.20626458525657654,
... |
func GetArgs() (cmd, port, timeout string) {
args := os.Args
if len(os.Args[1:]) != 6 {
UsageError()
}
if args[1] != "-script" && args[3] != "-port" && args[5] != "-timeout" {
UsageError()
}
return args[2], args[4], args[6]
} | [
0.04816550761461258,
0.49073106050491333,
0.6842553615570068,
0.4336083233356476,
0.5997717976570129,
-0.13202112913131714,
-0.6600776314735413,
-1.092279314994812,
-0.9395458698272705,
1.0630253553390503,
0.4651557207107544,
0.4364081025123596,
-0.957930326461792,
0.5764990448951721,
0.... |
func CheckCmdOutput(s []string) {
for i := range s {
if len(s) != 4 {
log.Fatal(`ERROR: Custom script ouput does not follow the required format and cannot be exported. Exiting!!
For the output of custom script to be exported, output should be in the following format!
Ex: ./your-custom-script.sh
hostname, i... | [
1.0660256147384644,
-0.4734153747558594,
0.5389894247055054,
0.336322546005249,
-0.48780179023742676,
-0.17521841824054718,
0.5274844765663147,
-0.3701120913028717,
-0.5310795307159424,
0.5811054110527039,
0.5088776350021362,
0.3287488520145416,
-0.43126344680786133,
0.2292776107788086,
... |
func StringToInteger(s string) (r int) {
r, err := strconv.Atoi(s)
if err != nil {
log.Fatal("ERROR: Invalid data type! Please use an integer instead of a string. Exiting!\n\n")
}
return r
} | [
-0.23142220079898834,
-1.1173995733261108,
0.32776573300361633,
-0.6957361698150635,
-0.6718566417694092,
0.20014509558677673,
0.6886128187179565,
-0.3654955327510834,
-0.6066965460777283,
0.2256310135126114,
-0.5257532596588135,
0.9713677167892456,
-0.7712840437889099,
-0.1339477002620697... |
func StringToSeconds(s string) (r time.Duration) {
_sec := StringToInteger(s)
sec := time.Duration(_sec * 1000 * 1000 * 1000)
return sec
} | [
0.35963577032089233,
-1.0458446741104126,
0.2207455188035965,
-0.6637585759162903,
-1.1654492616653442,
-0.5576912760734558,
0.4521658718585968,
-0.8317646980285645,
0.05155841261148453,
0.46204400062561035,
-0.889216959476471,
0.33172422647476196,
0.17818056046962738,
-0.09574208408594131... |
func CheckEmptyMap(m map[int]map[string]string) {
mapLength := len(m)
if mapLength == 0 {
log.Fatal("ERROR: Custom script provided an empty output and cannot be exported. Exiting!\n\n")
}
} | [
0.4187527298927307,
-0.7532989978790283,
0.4251687228679657,
0.362541139125824,
-0.33301207423210144,
-0.09918048232793808,
0.42316707968711853,
-0.20194709300994873,
0.2597863972187042,
0.542773962020874,
0.299932599067688,
0.5987415313720703,
-0.43115711212158203,
1.2590149641036987,
0... |
func StringToFloat64(s string) float64 {
f, err := strconv.ParseFloat(s, 64)
if err != nil {
os.Exit(1)
}
return f
} | [
0.144997239112854,
-0.6398334503173828,
0.12474611401557922,
0.43215876817703247,
-0.029001932591199875,
-0.34327590465545654,
0.486887663602829,
-0.40084704756736755,
-0.3487037420272827,
-0.16867372393608093,
-0.17861388623714447,
0.1658610850572586,
-0.2992422878742218,
-0.1495549380779... |
func (a AlbumMethods) standardQuery(artist, album string, autocorrect bool) map[string]string {
return map[string]string{
"artist": artist,
"album": album,
"autocorrect": boolToString(autocorrect),
}
} | [
0.37677791714668274,
-0.49858877062797546,
0.22362327575683594,
0.18342947959899902,
-1.051012396812439,
0.36027249693870544,
-0.1895667016506195,
0.4376957416534424,
-0.1004657968878746,
-0.09135004132986069,
-0.2963588535785675,
0.10638722032308578,
-0.33982419967651367,
-0.6219306588172... |
func (a *AlbumMethods) GetBuyLinks(artist, album string, autocorrect bool, country string) (*BuyLinks, error) {
query := a.standardQuery(artist, album, autocorrect)
query["country"] = country
return a.getBuyLinks(query)
} | [
-0.6095070838928223,
0.11214955896139145,
0.40547600388526917,
0.9566401839256287,
0.4344916343688965,
-0.5609474778175354,
0.48691526055336,
-0.2594047486782074,
-0.6464765667915344,
-0.06859961897134781,
-0.8738932609558105,
1.3940277099609375,
-0.6660328507423401,
-0.5829857587814331,
... |
func (a *AlbumMethods) GeyBuyLinksByMBID(mbid string, country string) {
} | [
-0.07994683086872101,
-0.5331609845161438,
0.3767349123954773,
0.7705332040786743,
1.003078818321228,
0.3500303030014038,
0.5599426627159119,
-0.1961367428302765,
-0.1537514477968216,
0.24469353258609772,
-0.4124038815498352,
0.6584360003471375,
-1.475581407546997,
0.3841889202594757,
-0... |
func (a *AlbumMethods) GetInfo(artist, album string, autocorrect bool, username string, lang string) (*AlbumInfo, error) {
query := a.standardQuery(artist, album, autocorrect)
query["username"] = username
query["lang"] = lang
return a.getInfo(query)
} | [
0.16230586171150208,
-0.13361933827400208,
0.18290022015571594,
0.9647460579872131,
-0.28012019395828247,
0.1590895652770996,
0.6096452474594116,
-0.6566125154495239,
-0.858704149723053,
-0.18631212413311005,
-1.0075254440307617,
0.4918341040611267,
-0.4913924038410187,
-0.3164252936840057... |
func (a *AlbumMethods) GetInfoByMBID(mbid, username, lang string) (*AlbumInfo, error) {
query := map[string]string{
"mbid": mbid,
"username": username,
"lang": lang,
}
return a.getInfo(query)
} | [
0.42207247018814087,
-0.6252598166465759,
0.16414183378219604,
0.8933240175247192,
-0.6606239080429077,
0.24632763862609863,
-0.030351564288139343,
-1.3143178224563599,
-0.7843741178512573,
0.5159236788749695,
-1.1106798648834229,
0.677992582321167,
-0.882452130317688,
0.42447859048843384,... |
func (a *AlbumMethods) GetShouts(artist, album string, autocorrect bool, page int) ([]Shout, error) {
query := map[string]string{
"artist": artist,
"album": album,
"autocorrect": boolToString(autocorrect),
"page": string(page),
}
return a.getShouts(query)
} | [
-0.047441765666007996,
-0.02439306303858757,
0.39723825454711914,
0.7037645578384399,
0.47453033924102783,
0.1744510978460312,
0.19904017448425293,
-0.6408409476280212,
0.0657687708735466,
-0.1621166467666626,
0.06955302506685257,
0.4387337565422058,
-0.40715646743774414,
0.132022008299827... |
func (a *AlbumMethods) GetShoutsByMBID(mbid string, page int) ([]Shout, error) {
query := map[string]string{
"mbid": mbid,
"page": string(page),
}
return a.getShouts(query)
} | [
0.6163436770439148,
-0.31742063164711,
0.43438300490379333,
0.6430936455726624,
-0.047601789236068726,
0.18150584399700165,
0.375701904296875,
-0.9661287069320679,
0.1738908588886261,
0.5594708919525146,
0.06616303324699402,
0.5067138671875,
-1.4168086051940918,
0.921299934387207,
-0.153... |
func (a *AlbumMethods) GetTopTags(artist, album string, autocorrect bool) ([]Tag, error) {
query := a.standardQuery(artist, album, autocorrect)
return a.getTopTags(query)
} | [
-0.5144746899604797,
0.4528443217277527,
0.46208441257476807,
1.07876455783844,
0.0814923644065857,
-0.436275839805603,
-0.025387238711118698,
-0.7169229984283447,
-0.3588857650756836,
0.04216374456882477,
-0.3519060015678406,
0.6135318279266357,
-0.8024747371673584,
-0.013354592025279999,... |
func (a *AlbumMethods) GetTopTagsByMBID(mbid string) ([]Tag, error) {
query := map[string]string{
"mbid": mbid,
}
return a.getTopTags(query)
} | [
-0.2834007740020752,
0.007114944979548454,
0.4094589352607727,
0.9057568311691284,
-0.22621124982833862,
-0.5105446577072144,
-0.27727100253105164,
-0.7154826521873474,
-0.07765896618366241,
0.7866855263710022,
-0.9942485690116882,
0.6221886873245239,
-0.9882134795188904,
1.105987191200256... |
func (a *AlbumMethods) Search(album string, page, limit int) (*AlbumSearchResults, error) {
wrapper := struct {
Results *AlbumSearchResults `xml:"results"`
}{}
query := map[string]string{
"method": a.method("search"),
"album": album,
"page": string(page),
"limit": string(limit),
}
err := a.Client.Exe... | [
-0.9393845200538635,
0.21851855516433716,
0.6134521961212158,
0.45906391739845276,
0.2415419965982437,
0.12897899746894836,
-0.014374247752130032,
-1.1841535568237305,
-0.050763294100761414,
-0.12072272598743439,
-0.2078603059053421,
-0.2731053829193115,
-0.7904731631278992,
-0.56416833400... |
func retrievePodSRVs(serviceName string) []*net.SRV {
_, srvs, err := net.LookupSRV("", "", serviceName)
if err != nil {
log.Fatal(err)
}
return srvs
} | [
-1.1905142068862915,
0.38739240169525146,
0.40633076429367065,
-0.46576032042503357,
0.7395472526550293,
-0.8864375352859497,
-1.0465304851531982,
-1.0148320198059082,
0.22482606768608093,
-1.2821489572525024,
-0.4308921694755554,
-0.27869993448257446,
-1.1174397468566895,
-0.1840187013149... |
func getPodData(url string) string {
resp, err := http.Get("http://" + url + ":8080")
if err != nil {
log.Fatalln(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatalln(err)
}
return string(body)
} | [
-1.0307409763336182,
0.02545054256916046,
0.9370639324188232,
-0.6855130195617676,
0.02662656456232071,
0.6261951327323914,
-1.1467057466506958,
-0.6636865735054016,
-0.34276890754699707,
0.044691890478134155,
0.08279436826705933,
0.6808565855026245,
-0.16999569535255432,
-0.47932901978492... |
func main() {
srvs := retrievePodSRVs("TYPE_YOUR_HEADLESS_SERVICE_NAME_HERE")
name, err := os.Hostname()
if err != nil {
log.Fatal(err)
}
for _, srv := range srvs {
// If service is local, just respond directly
if strings.Contains(srv.Target, string(name)) {
// print pod's hostname
fmt.Println("You've ... | [
-0.5140419602394104,
-0.5941709280014038,
0.7316810488700867,
0.5806013941764832,
0.6068438291549683,
0.12815774977207184,
-0.11805188655853271,
-0.8302688002586365,
-0.405455619096756,
-1.0568630695343018,
0.6100845336914062,
0.6710482239723206,
-0.4490397870540619,
-0.5826034545898438,
... |
func NewRunner(out, errOut io.Writer, ansibleDir string, runDir string) (Runner, error) {
// Ansible depends on python 2.7 being installed and on the path as "python".
// Validate that it is available
if _, err := exec.LookPath("python"); err != nil {
return nil, fmt.Errorf("Could not find 'python' in the PATH. En... | [
0.05006233602762222,
-0.8300945162773132,
0.3143562376499176,
0.4190356433391571,
-1.0096336603164673,
-0.24713075160980225,
-0.041358791291713715,
0.08138317614793777,
-0.4372148811817169,
0.31944912672042847,
-0.11890745162963867,
0.6840200424194336,
0.08732686191797256,
0.15830115973949... |
func (r *runner) WaitPlaybook() error {
if r.waitPlaybook == nil {
return fmt.Errorf("wait called, but playbook not started")
}
execErr := r.waitPlaybook()
// Process exited, we can clean up named pipe
removeErr := os.Remove(r.namedPipe)
if removeErr != nil && execErr != nil {
return fmt.Errorf("an error occu... | [
-0.03291195258498192,
-0.8674442768096924,
0.6653655767440796,
-0.14978113770484924,
0.28075170516967773,
0.3640744388103485,
0.0844249576330185,
0.20803026854991913,
-0.6126967668533325,
0.5361810922622681,
-0.716076135635376,
-0.16921745240688324,
-0.7799718976020813,
0.4446447789669037,... |
func (r *runner) StartPlaybook(playbookFile string, inv Inventory, cc ClusterCatalog) (<-chan Event, error) {
return r.startPlaybook(playbookFile, inv, cc) // Don't set the --limit arg
} | [
-0.34241753816604614,
-0.2643657922744751,
0.5208765864372253,
1.3227165937423706,
0.31468525528907776,
0.7213187217712402,
0.8421127200126648,
0.3572365939617157,
-0.5008482933044434,
0.40722987055778503,
-0.19490312039852142,
0.6787475943565369,
-0.709480881690979,
0.03406485170125961,
... |
func (r *runner) StartPlaybookOnNode(playbookFile string, inv Inventory, cc ClusterCatalog, nodes ...string) (<-chan Event, error) {
// set the --limit arg to the node we want to target
return r.startPlaybook(playbookFile, inv, cc, nodes...)
} | [
-0.5021317601203918,
-0.7514277100563049,
0.45015794038772583,
0.5734537243843079,
0.49150142073631287,
0.7545777559280396,
0.32293736934661865,
0.7793437838554382,
-0.6768310070037842,
0.6023411154747009,
0.03015432320535183,
1.3830050230026245,
-0.4949162006378174,
-0.09040669351816177,
... |
func createTempNamedPipe() (string, error) {
start := time.Now()
np := filepath.Join(os.TempDir(), fmt.Sprintf("ansible-pipe-%d-%s", rand.Int(), start.Format("2006-01-02-15-04-05.99999")))
if err := syscall.Mkfifo(np, 0644); err != nil {
return "", fmt.Errorf("error creating named pipe %q: %v", np, err)
}
return... | [
-0.02372041530907154,
-0.8124344348907471,
0.7684028148651123,
-0.9320394396781921,
-0.5869192481040955,
0.5167906880378723,
0.09245138615369797,
0.009926843456923962,
-0.46125727891921997,
0.8327154517173767,
-0.944826066493988,
-0.3375470042228699,
-0.21910883486270905,
0.104647308588027... |
func (s *Shader) setUniform(name string, value int32) {
location:=gl.GetUniformLocation(s.idPrograma, gl.Str(name + "\x00"))
if location != -1 { // Si existe ese nombre de variable
gl.Uniform1i(location, value)
}
} | [
-0.4263487160205841,
-0.032896239310503006,
0.5580106377601624,
-0.21311786770820618,
-0.46850594878196716,
0.3380039632320404,
0.1627916693687439,
-0.21484027802944183,
-0.1037420853972435,
0.4456782639026642,
-0.7961223125457764,
0.9997808337211609,
-0.3077819049358368,
0.454537779092788... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.