text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (i *Item) GetValue(field string) string {
if i == nil || len(i.Fields) == 0 {
return ""
}
sectionFilter := false
sectionLabel := ""
fieldLabel := field
if strings.Contains(field, ".") {
parts := strings.Split(field, ".")
// Test to make sure the . isn't the last character
if len(parts) == 2 {
se... | [
-0.42100390791893005,
-0.2829727828502655,
0.8746442794799805,
0.21699963510036469,
0.20026668906211853,
-0.11633864045143127,
0.07116915285587311,
-0.6191397905349731,
-0.08264858275651932,
0.5729504823684692,
0.22762253880500793,
-0.13141797482967377,
-0.16510695219039917,
0.041675403714... |
func Flatten(nested map[string]interface{}) (flatmap map[string]interface{}, err error) {
return flatten("", nested)
} | [
-0.3035147488117218,
-0.2680787444114685,
0.37109363079071045,
0.06497817486524582,
-0.28219616413116455,
-0.3415272831916809,
-0.001958791632205248,
0.38035526871681213,
0.42680561542510986,
-1.0389645099639893,
-0.7615063786506653,
0.860482931137085,
-0.744168221950531,
0.064489610493183... |
func Unflatten(flat map[string]interface{}) (nested map[string]interface{}, err error) {
nested = make(map[string]interface{})
for k, v := range flat {
temp := uf(k, v).(map[string]interface{})
err = mergo.Merge(&nested, temp)
if err != nil {
return
}
}
walk(reflect.ValueOf(nested))
return
} | [
-0.8597239255905151,
-0.0005544486921280622,
0.729476809501648,
-0.727104663848877,
-0.3325568735599518,
0.09060867875814438,
0.8403060436248779,
0.71820068359375,
-0.8983979821205139,
-0.9288169145584106,
-0.4988778531551361,
0.06405672430992126,
-0.3098759949207306,
0.42545920610427856,
... |
func New(configPathRel string) *Config {
dir, err := os.Getwd()
if err != nil {
panic(err)
}
c := &Config{}
c.workinkDir = dir
configPathAbs := path.Join(dir, configPathRel)
file, err := ioutil.ReadFile(configPathAbs)
if err != nil {
panic(fmt.Errorf("Config not found in path: %s", configPathAbs))
}
e... | [
0.18693603575229645,
-0.8136952519416809,
0.3937036991119385,
-0.3753315508365631,
-0.9722482562065125,
0.1215289980173111,
0.449928343296051,
-0.15898174047470093,
-1.2313978672027588,
0.1630207747220993,
0.31999704241752625,
-0.06862026453018188,
0.44756433367729187,
0.04920293018221855,... |
func (c *Config) GetAbsPath(relPath string) string {
return path.Join(c.workinkDir, relPath)
} | [
0.6094082593917847,
-0.48737025260925293,
0.3598879277706146,
-0.3571666479110718,
-0.6449724435806274,
0.8917695879936218,
0.24051988124847412,
-0.9475477337837219,
-0.007514649536460638,
0.14196737110614777,
0.48043736815452576,
0.18430690467357635,
-0.46279042959213257,
0.00544857373461... |
func main() {
fmt.Println("This is main")
//This is a commet
/*
This is a multi line comment
See, another line
*/
//Parsing arguments
args := os.Args[1:] //Read all arguments except the program name
//Also a foreach style loop
for a := range args {
fmt.Printf("Arg: %s \n", args[a])
}
//... | [
0.5437564253807068,
-0.43864956498146057,
1.0745558738708496,
-0.11224907636642456,
0.3174531161785126,
0.6980524063110352,
0.32926520705223083,
0.8261190056800842,
-0.6594869494438171,
0.7621382474899292,
0.10762432962656021,
-0.04944511875510216,
-0.06383953243494034,
0.4285906255245209,... |
func CreateTestContext(c qhttp.Controller, r *http.Request) (context *qhttp.Context) {
w := httptest.NewRecorder()
router := qhttp.CreateRouter(c)
context = qhttp.CreateContext(w, r, router)
return context
} | [
0.6190320253372192,
-0.35317981243133545,
0.6724402904510498,
-0.6187859177589417,
0.02707967907190323,
0.31942471861839294,
-0.10506574809551239,
-1.1494231224060059,
1.0238661766052246,
-0.16939321160316467,
0.10340433567762375,
-0.10685878247022629,
-0.8637560606002808,
0.59234035015106... |
func (c *Database) parsePostgreSQLHostPort(info string) (host, port string) {
host, port = "127.0.0.1", "5432"
if strings.Contains(info, ":") && !strings.HasSuffix(info, "]") {
idx := strings.LastIndex(info, ":")
host = info[:idx]
port = info[idx+1:]
} else if len(info) > 0 {
host = info
}
return host, por... | [
0.18335025012493134,
-0.8567857146263123,
0.73899906873703,
-0.024217721074819565,
-0.3417964577674866,
-0.0009936189744621515,
0.16854728758335114,
0.29754871129989624,
-1.056335210800171,
0.4844125807285309,
-0.4228924512863159,
-0.3347558081150055,
-0.3485077917575836,
-0.79038763046264... |
func NewForm(ctx *pulumi.Context,
name string, args *FormArgs, opts ...pulumi.ResourceOption) (*Form, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DataType == nil {
return nil, errors.New("invalid value for required argument 'DataType'")
}
if args.Field... | [
0.5223321914672852,
0.48130351305007935,
0.4650748372077942,
-0.06370803713798523,
-0.08501311391592026,
0.4269120693206787,
-0.11689241230487823,
-0.09304589778184891,
0.15794283151626587,
-0.10338538140058517,
-0.1835136115550995,
-0.039511799812316895,
0.055510248988866806,
0.7163064479... |
func GetForm(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *FormState, opts ...pulumi.ResourceOption) (*Form, error) {
var resource Form
err := ctx.ReadResource("aws-native:amplifyuibuilder:Form", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
} | [
0.6893073320388794,
0.2167557179927826,
0.1623658537864685,
-0.23398882150650024,
0.2781965434551239,
0.13418048620224,
-0.5131227374076843,
-0.49784055352211,
0.8576730489730835,
-0.9778609275817871,
0.12623944878578186,
0.46683359146118164,
0.5274430513381958,
-0.5766506791114807,
0.03... |
func check(e error) {
if e != nil {
panic(e)
}
} | [
0.6003202199935913,
0.7204112410545349,
0.12300366908311844,
1.3328334093093872,
0.5551187992095947,
0.4441490173339844,
-0.30669090151786804,
0.25188595056533813,
0.4584443271160126,
0.4319080114364624,
0.3091404139995575,
0.3319379687309265,
0.7596425414085388,
1.4626328945159912,
0.38... |
func convertDate(date *string) {
const shortForm = "02-Jan-2006"
t, _ := time.Parse(shortForm, *date)
timeString := t.String()
*date = strings.Split(timeString, " ")[0]
} | [
-0.009139672853052616,
-0.45498329401016235,
0.793094277381897,
0.25362178683280945,
0.1862020492553711,
-0.0071194046176970005,
-1.0933926105499268,
0.06477534025907516,
0.31966161727905273,
0.39036795496940613,
-0.6527292728424072,
0.5281437039375305,
0.4251273274421692,
0.43147522211074... |
func cp(src, dst string) error {
s, err := os.Open(src)
if err != nil {
fmt.Println("Can't open %s\n", src)
return err
}
// no need to check errors on read only file, we already got everything
// we need from the filesystem, so nothing can go wrong now.
defer s.Close()
d, err := os.Create(dst)
if err != nil... | [
-0.1296170949935913,
0.09402492642402649,
0.8982659578323364,
-0.47683048248291016,
-0.6869168877601624,
0.8370227813720703,
0.47176453471183777,
0.25301268696784973,
-0.5193944573402405,
0.12503203749656677,
1.2112431526184082,
0.16432851552963257,
0.4796670079231262,
-0.38384202122688293... |
func (self *FCSFile) readTextSegment(f *os.File) {
//Offsets based on FCS specs
self.version = self.readBytes(f, 6, 0)
tmp := self.readBytes(f, 8, 10)
self.txtStart, _ = strconv.Atoi(tmp)
tmp = self.readBytes(f, 8, 18)
self.txtEnd, _ = strconv.Atoi(tmp)
//Size of the TEXT segment in the FCS file
txtSize := se... | [
-0.40776070952415466,
-0.6490144729614258,
0.5909560918807983,
-1.2198572158813477,
-0.8808131814002991,
-0.23983600735664368,
-0.008447837084531784,
0.34883958101272583,
-1.3493802547454834,
0.37335214018821716,
-0.20012648403644562,
-0.4240085780620575,
0.0862499326467514,
0.284007161855... |
func (self *FCSFile) cleanString(s *string, key bool) {
if key == true {
*s = strings.Replace(*s, "$", "", -1)
*s = strings.Replace(*s, " ", "_", -1)
}
*s = strings.TrimSpace(*s) //Trims whitespace
} | [
-0.8135942220687866,
-0.3894837498664856,
0.46356043219566345,
-0.4449639916419983,
-0.9967688322067261,
0.06696093082427979,
-0.31296664476394653,
0.4450502097606659,
-0.9069104194641113,
0.9058066010475159,
0.3431663513183594,
-0.24775142967700958,
0.43137842416763306,
0.1118944063782692... |
func (self *FCSFile) readBytes(f *os.File, byteSize int64, offset int64) string {
readBytes := make([]byte, byteSize)
f.ReadAt(readBytes, offset)
byteValue := strings.TrimSpace(string(readBytes)) //Bytes into string conversion
return byteValue
} | [
-0.010173429735004902,
-0.39051225781440735,
0.4573415517807007,
-1.2710849046707153,
-0.1987236589193344,
0.21856902539730072,
-0.7278804183006287,
0.2798598110675812,
-0.9039829969406128,
-0.1509033739566803,
0.3989392817020416,
0.14163336157798767,
0.059331219643354416,
-0.4781431853771... |
func (self *FCSInfo) cleanName(s *string, isFile bool) {
if isFile == true {
*s = strings.Replace(*s, "/", "-", -1)
*s = strings.Replace(*s, "\\", "-", -1)
}
} | [
-0.10815528780221939,
-0.7697451710700989,
0.5521448254585266,
0.49846750497817993,
-0.7737602591514587,
0.0782405436038971,
0.3413584530353546,
0.6852236390113831,
-0.6277288794517517,
0.36349740624427795,
0.16214367747306824,
-0.5651134252548218,
0.23105569183826447,
0.1762201488018036,
... |
func (self *Path) SetPath(src string, des string) {
self.srcPath = src
self.desPath = des
} | [
-0.14938390254974365,
-0.1341998130083084,
0.039307285100221634,
-0.3063982129096985,
-0.4419071078300476,
0.7730216979980469,
-0.7437676191329956,
0.13696281611919403,
-0.5133563280105591,
-0.5366219878196716,
-0.005865480285137892,
0.1492772102355957,
0.23859235644340515,
-0.094169564545... |
func (self *Path) GlobIt() []string {
os.Chdir(self.srcPath)
f, err := filepath.Glob("*.fcs")
check(err)
return f
} | [
0.26326829195022583,
-0.036472614854574203,
0.5728000998497009,
-0.04568447545170784,
0.37164604663848877,
0.770037829875946,
0.1253325343132019,
-1.9190492630004883,
-0.5222228765487671,
0.3287419080734253,
0.29061850905418396,
0.600479781627655,
-0.3903825879096985,
0.387824684381485,
... |
func (self *Path) RenameMove(fcsInfo *FCSInfo) {
os.MkdirAll(self.desPath+fcsInfo.filePath, 0777)
cwd, _ := os.Getwd()
err := cp(filepath.Join(cwd, fcsInfo.oldFN), filepath.Join(self.desPath, fcsInfo.filePath, fcsInfo.newFN))
if err == nil {
fmt.Println(fcsInfo.oldFN + " ------> " + fcsInfo.newFN)
}
} | [
-0.06298121064901352,
-1.0232748985290527,
0.824817419052124,
0.20132945477962494,
0.1263284534215927,
-0.2248552441596985,
0.6279332041740417,
0.09774013608694077,
-0.2617894113063812,
-0.2105109840631485,
-0.36157646775245667,
0.5846511125564575,
0.5513876676559448,
-0.2802586257457733,
... |
func main() {
//Command line praser init
var src = flag.String("src", "", "Location of BDData Directory")
var des = flag.String("des", "", "Location where recoverd files will be stored")
flag.Parse()
if *src == "" || *des == "" {
fmt.Println("Usage: recovery -src <BDData Dir> -des <Recovery Dir> ")
}
//Creat... | [
-0.10882089287042618,
-0.10373130440711975,
0.7792478799819946,
0.15334740281105042,
0.35848331451416016,
0.08579060435295105,
0.611950159072876,
0.7152730822563171,
-1.0111589431762695,
-0.5576062798500061,
-0.31933310627937317,
-0.4271206855773926,
0.6059087514877319,
-0.3931759893894195... |
func (m *StateInfo) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCountry(formats); err != nil {
// prop
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
} | [
-0.19983913004398346,
-0.10623609274625778,
0.01877327635884285,
0.05244334787130356,
0.16079887747764587,
0.5563637614250183,
0.7142828702926636,
-0.4911347031593323,
-0.29166558384895325,
-0.07167864590883255,
0.21597467362880707,
-0.616102933883667,
-0.8700645565986633,
0.40655934810638... |
func ConvertNameToKey(name string) string {
return strings.Replace(strings.ToLower(name), "_", "-", -1)
} | [
-1.2996245622634888,
-1.180530309677124,
0.8449152112007141,
-1.4027771949768066,
-1.0233979225158691,
-0.2752532958984375,
-1.4888904094696045,
-0.5183003544807434,
-0.7201067209243774,
1.3513314723968506,
-0.7707406878471375,
0.19076798856258392,
0.654543936252594,
0.6661919355392456,
... |
func (b *Backend) Do(r *http.Request) (*http.Response, error) {
if err := b.limiter.Wait(false); err != nil {
return nil, err
}
return b.client.Do(r)
} | [
0.7470384836196899,
0.8038508296012878,
0.7152063846588135,
-0.006836026906967163,
0.5692616105079651,
0.6265214085578918,
-0.6547701358795166,
-1.341503381729126,
-0.6505809426307678,
0.6487139463424683,
0.47820720076560974,
0.21164120733737946,
-1.1126635074615479,
-0.007139556109905243,... |
func Async(a bool) CollectorOption {
return func(collector *Collector) {
collector.async = a
}
} | [
0.8366409540176392,
0.2631300091743469,
0.3467233180999756,
0.2078370749950409,
0.1960749328136444,
-0.08482697606086731,
0.5010438561439514,
0.25106868147850037,
0.4204474985599518,
0.30804160237312317,
0.18305604159832,
-0.34271204471588135,
0.8348899483680725,
-0.5719910860061646,
-0.... |
func Handler(w http.ResponseWriter, r *http.Request){
w.Header().Add("Content-Type", "text/css")
w.Write(libBytes)
} | [
0.33170923590660095,
-0.00779049564152956,
0.5569940209388733,
-0.749732494354248,
0.2538680136203766,
0.7711397409439087,
-0.21875646710395813,
0.04402169957756996,
-0.5335352420806885,
-0.4664779305458069,
-0.28383955359458923,
-0.6891359686851501,
0.7382802963256836,
0.08197531849145889... |
func (c *Client) UpdateRepositoryDescription(ctx context.Context, params *UpdateRepositoryDescriptionInput, optFns ...func(*Options)) (*UpdateRepositoryDescriptionOutput, error) {
if params == nil {
params = &UpdateRepositoryDescriptionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateRepositoryDes... | [
-0.8588964343070984,
-0.15361818671226501,
0.8224309086799622,
-0.2816629409790039,
-0.04090886190533638,
-0.5070929527282715,
0.11640927195549011,
0.25512319803237915,
0.48187336325645447,
0.34636974334716797,
-0.21400852501392365,
1.541147232055664,
-0.46446070075035095,
-0.4802421927452... |
func (c *Lang) cleanLang(code string) error {
s := c.langFileName("tmp_dir", code)
err := ioutil.WriteFile(s, []byte("[]"), 0600)
if err != nil {
return err
}
defer os.Remove(s)
return i18n.LoadTranslationFile(s)
} | [
0.32069286704063416,
0.5678008794784546,
0.4493176341056824,
-0.4735555648803711,
-0.5602690577507019,
0.19989310204982758,
0.8210920095443726,
0.5603333115577698,
-0.2266102433204651,
0.8590036630630493,
-1.1499627828598022,
-0.3919081389904022,
0.2648251950740814,
0.23334988951683044,
... |
func (c *Lang) applyFile(code string) (error, string) {
_, header, err := c.GetFile("file")
if err != nil {
return err, T("lang_nofile")
}
a := strings.Split(header.Filename, ".")
if l := len(a); l < 2 || strings.ToLower(a[l-1]) != "json" {
return errors.New("client validation by file type hacked"), T("lang_... | [
-0.26636818051338196,
0.35798904299736023,
0.9398043155670166,
-0.9004458785057068,
-0.1810474395751953,
-0.3376689851284027,
0.47561293840408325,
0.5005662441253662,
-0.6925980448722839,
0.40668007731437683,
-0.5455256104469299,
-0.7003352046012878,
0.14631220698356628,
1.1575888395309448... |
func (l *ListItem) AddElem(elem Element) {
l.contents = append(l.contents, elem)
} | [
-0.7702571153640747,
-0.11119348555803299,
0.2535565197467804,
0.557568371295929,
-0.1361687034368515,
1.116648554801941,
-1.2747063636779785,
-0.0690026506781578,
0.9011263251304626,
-1.5110654830932617,
-0.13810092210769653,
-0.1116098091006279,
0.4032326936721802,
0.7661439180374146,
... |
func (l *ListItem) SetElem(n int, elem Element) {
leng := len(l.contents)
if n > leng-1 {
l.AddElem(elem)
} else {
l.contents[n] = elem
}
} | [
-0.788968563079834,
0.4504778981208801,
0.2669835090637207,
0.5667170882225037,
0.12792839109897614,
0.5955591797828674,
-1.0340455770492554,
-0.5533470511436462,
0.6097924709320068,
-1.1416630744934082,
-0.6922391653060913,
-0.28296205401420593,
0.22872884571552277,
1.0733994245529175,
... |
func (l *ListItem) GetElemNum() int {
return len(l.contents)
} | [
-0.6260221600532532,
-0.5421444177627563,
0.5914121270179749,
0.60345059633255,
0.39725372195243835,
-0.4778674840927124,
0.26349756121635437,
0.7504584193229675,
1.128317952156067,
-2.0854806900024414,
-1.5240209102630615,
-0.161969393491745,
0.7345196604728699,
0.2582363188266754,
0.46... |
func (l *ListItem) GetElem(index int) Element {
//if index will exceed bounds of array
if index >= len(l.contents) {
//counter starts at bottom, looks for "Text" to stop, or stops at end
for index = 0; index < len(l.contents) && l.contents[index].GetType() != "span"; index++ {
}
}
//returns requested Element,... | [
-0.6318055987358093,
0.08624913543462753,
0.8910029530525208,
-0.21436618268489838,
0.40900886058807373,
0.5492562651634216,
-0.007367065642029047,
-1.241242527961731,
1.246282935142517,
-1.0854073762893677,
0.7702121138572693,
0.4880092442035675,
-0.278942346572876,
0.2813247740268707,
... |
func Init(home string, options []string, uidMaps, gidMaps []idtools.IDMap) (graphdriver.Driver, error) {
logrus.Debugf("secureoverlay2: Init called w. home: %s, options:%s, uidMaps: %v, gidMaps: %v", home, options, uidMaps, gidMaps)
ctx = context.WithValue(context.TODO(), "", "")
opts, err := parseOptions(options)
... | [
0.4772096872329712,
-0.46528860926628113,
0.7449743151664734,
0.7926316857337952,
-0.38194042444229126,
-0.6324753165245056,
0.6344284415245056,
-0.4950675964355469,
0.39811721444129944,
-0.8067115545272827,
0.7157760858535767,
0.38523873686790466,
-0.12910579144954681,
0.23758845031261444... |
func (d *Driver) Status() [][2]string {
logrus.Debug("secureoverlay2: Status called")
return [][2]string{
{"Backing Filesystem", backingFs},
{"Supports d_type", strconv.FormatBool(d.supportsDType)},
{"Native Overlay Diff", strconv.FormatBool(!useNaiveDiff(d.home))},
}
} | [
-1.063767433166504,
-0.9853231310844421,
0.2766399085521698,
-0.16819946467876434,
0.06945227831602097,
0.07641002535820007,
-0.39460912346839905,
0.10532175004482269,
0.2497013360261917,
0.11585339903831482,
-0.4095272719860077,
-0.07501418888568878,
0.2302311211824417,
1.4295029640197754... |
func (d *Driver) GetMetadata(id string) (map[string]string, error) {
logrus.Debugf("secureoverlay2: GetMetadata called w. id: %s", id)
dir := d.dir(id)
if _, err := os.Stat(dir); err != nil {
return nil, err
}
metadata := map[string]string{
"WorkDir": path.Join(dir, "work"),
"MergedDir": path.Join(dir, "m... | [
-0.6331130266189575,
-0.29852068424224854,
0.7542763948440552,
0.013437303714454174,
-0.1438765674829483,
0.07584620267152786,
0.5827955007553101,
-0.4759064018726349,
1.1157574653625488,
0.13327385485172272,
-0.28611165285110474,
0.5606886148452759,
0.36054369807243347,
0.8768551349639893... |
func (d *Driver) Cleanup() error {
logrus.Debug("secureoverlay2: Cleanup called")
return mount.RecursiveUnmount(d.home)
} | [
0.7153202891349792,
-0.39271828532218933,
0.21231187880039215,
0.8467347025871277,
0.062114305794239044,
-0.616640567779541,
0.8403560519218445,
-0.08944109827280045,
1.4167182445526123,
-0.9083878397941589,
0.4478439390659332,
-0.2049608826637268,
-0.11374977976083755,
0.959388256072998,
... |
func (d *Driver) CreateReadWrite(id, parent string, opts *graphdriver.CreateOpts) error {
logrus.Debugf("secureoverlay2: CreateReadWrite called w. id: %s, parent: %s, opts: %v", id, parent, opts)
return d.Create(id, parent, opts)
} | [
0.05000261217355728,
-0.11028531193733215,
0.3704373240470886,
0.5664186477661133,
0.4927990436553955,
-0.04380911961197853,
0.1683875173330307,
-0.5639500617980957,
0.3122744560241699,
0.014232010580599308,
0.4555884301662445,
-0.6894042491912842,
-0.0012625489616766572,
0.202774390578269... |
func (d *Driver) Create(id, parent string, opts *graphdriver.CreateOpts) (retErr error) {
logrus.Debugf("secureoverlay2: Create called w. id: %s, parent: %s, opts: %s", id, parent, opts)
imgCryptOpts := &secureImgCryptOptions{}
imgCryptOpts.init(d.options.defaultSecOpts)
driver := &Driver{}
err := errors.New("")
... | [
-0.28879407048225403,
0.7010670304298401,
0.9271511435508728,
1.0525405406951904,
-0.03170476481318474,
-0.2801686227321625,
0.6818612217903137,
-0.9048503041267395,
0.2825044095516205,
-0.13197530806064606,
0.330677330493927,
-0.7065969705581665,
0.3371139466762543,
0.19318246841430664,
... |
func (d *Driver) parseImgCryptOpt(imgCryptOpt map[string]string, opts *secureImgCryptOptions, driver *Driver) error {
logrus.Debugf("secureoverlay2: parseImgCryptOpt called w. imgCryptOpt: %s", imgCryptOpt)
// Read size to set the disk project quota per container
for key, val := range imgCryptOpt {
lcKey := string... | [
-0.39388176798820496,
-0.3504023849964142,
0.8449863195419312,
0.031605131924152374,
-0.09345477819442749,
-0.5005311369895935,
-0.022069260478019714,
-0.832382321357727,
-0.0349167063832283,
1.0926308631896973,
0.12673521041870117,
-0.2173752635717392,
-0.5419197082519531,
-0.048548944294... |
func (d *Driver) getDiffChain(id string) ([]string, error) {
logrus.Debugf("secureoverlay2: getDiffChain called w. id: %s", id)
var chain []string
lowers, err := ioutil.ReadFile(path.Join(d.dir(id), lowerFile))
if err == nil {
for _, s := range strings.Split(string(lowers), ":") {
lp, err := os.Readlink(path.... | [
-0.8832820057868958,
-0.9192411303520203,
0.8469852805137634,
0.37111663818359375,
0.7664628624916077,
0.013921549543738365,
0.1873062252998352,
-0.7583015561103821,
0.34809577465057373,
-0.5408673882484436,
-0.7303590774536133,
0.7545899748802185,
-0.7928065657615662,
1.2681703567504883,
... |
func (d *Driver) mountAllLowers(id string) error {
logrus.Debugf("secureoverlay2: mountAllLowers called w. id: %s", id)
// get graph id of all lower layers
lowers, err := d.getDiffChain(id)
if err != nil {
return err
}
logrus.Debugf("secureoverlay2: mountAllLowers for id %s do umount lowers: %s", id, lowers)
... | [
0.29233604669570923,
-0.5674549341201782,
0.647567868232727,
-0.048992596566677094,
0.32829976081848145,
-0.43808406591415405,
-0.4523979723453522,
-1.4164865016937256,
0.8348857760429382,
-0.519424557685852,
-0.13322454690933228,
0.6470552682876587,
-1.0452814102172852,
1.1801514625549316... |
func (d *Driver) umountAllLowers(id string) error {
logrus.Debugf("secureoverlay2: umountAllLowers called w. id: %s", id)
// get graph id of all lower layers
lowers, err := d.getDiffChain(id)
if err != nil {
return err
}
logrus.Debugf("secureoverlay2: umountAllLowers for id: %s do unmount lowers: %s", id, low... | [
0.22622603178024292,
-0.323751837015152,
0.8868662118911743,
-0.5308327674865723,
-0.023634955286979675,
-0.5911795496940613,
0.19091928005218506,
-1.0779955387115479,
0.5561070442199707,
0.016054341569542885,
-0.1939055472612381,
0.4832248389720917,
-1.1248161792755127,
0.8818170428276062... |
func (d *Driver) mountLayersFor(id string) (err error) {
logrus.Debugf("secureoverlay2: mountLayersFor called w. id: %s", id)
//Adding mutex lock to make sure the layers are mounted in right sequence when there are simulatneous requests from multiple instances
mountMtx.Lock()
defer mountMtx.Unlock()
// paths
sour... | [
-0.31251928210258484,
-0.3977198898792267,
0.6248282790184021,
0.030785642564296722,
0.22777283191680908,
-0.6195923686027527,
0.537397027015686,
-1.1848406791687012,
0.6883372068405151,
-0.03891603648662567,
0.1893175095319748,
-0.01237555593252182,
0.029256103560328484,
1.093549132347107... |
func (d *Driver) Remove(id string) error {
logrus.Debugf("secureoverlay2: Remove called w. id: %s", id)
d.locker.Lock(id)
defer d.locker.Unlock(id)
dir := d.dir(id)
lid, err := ioutil.ReadFile(path.Join(dir, "link"))
if err == nil {
if err := os.RemoveAll(path.Join(d.home, linkDir, string(lid))); err != nil {
... | [
-0.49755117297172546,
-0.3120911419391632,
0.5422669053077698,
0.04287859797477722,
-0.04063541814684868,
-0.4136025309562683,
0.765551745891571,
0.6202518939971924,
0.9053278565406799,
-0.6679191589355469,
-0.06985174864530563,
-0.2643110156059265,
-0.8692945837974548,
0.5639094114303589,... |
func (d *Driver) Get(id string, mountLabel string) (_ containerfs.ContainerFS, err error) {
var (
dir, diffDir, mergedDir, workDir, mountOptionsFmt string
lowers []byte
s secureImgCryptOptions
)
logrus.Debugf("secureove... | [
-0.33342671394348145,
-0.5920556783676147,
0.7768883109092712,
0.08752141892910004,
-0.027717089280486107,
-1.4129323959350586,
0.6332517266273499,
-0.7637522220611572,
0.6688820123672485,
-1.07112717628479,
0.7187919020652771,
-0.12200698256492615,
-0.13690601289272308,
0.6502504944801331... |
func (d *Driver) Put(id string) error {
logrus.Debugf("secureoverlay2: Put called w. id: %s", id)
// driver level locking
d.locker.Lock(id)
defer d.locker.Unlock(id)
// various directory variables
dir := d.dir(id)
mountpoint := path.Join(dir, "merged")
// reference counting so we do not try to remount
// No... | [
0.3108057677745819,
-0.5274580121040344,
0.8454098105430603,
0.06463776528835297,
-0.09042224287986755,
-0.0634588822722435,
1.3396402597427368,
-1.0050575733184814,
0.5205022692680359,
-0.5877001285552979,
0.1786109358072281,
-0.0032566681038588285,
-0.77644282579422,
0.6624624729156494,
... |
func (d *Driver) Exists(id string) bool {
logrus.Debugf("secureoverlay2: Exists called w. id: %s", id)
// TODO: below is implementation from overlay2 but doesn't really mesh with the function description (also from overlay2)
// as this should be true as soon as layer is created using Create, regardless of mount (... | [
-0.966514527797699,
-0.5931757092475891,
0.5918390154838562,
-0.20126378536224365,
0.5503715872764587,
0.26250800490379333,
-0.08228749781847,
-0.6773391366004944,
0.7448387742042542,
-1.2697564363479614,
-0.17389130592346191,
-0.08357252925634384,
0.300566703081131,
0.8455101251602173,
... |
func (d *Driver) isParent(id, parent string) bool {
// TODO (maybe): this function is called a lot and does lots of sub-routine calls and I/O.
// One might want to cache parent but should first be confirmed via profiling that really noticable performance cost
logrus.Debugf("secureoverlay2: isParent called w. id: %s... | [
-0.29033705592155457,
-0.4113335609436035,
0.6543511152267456,
0.04268034175038338,
-0.3473949730396271,
-0.8744459748268127,
0.09954250603914261,
-0.8070272207260132,
1.1505085229873657,
-0.23021318018436432,
0.32851478457450867,
0.5679664015769958,
-0.7158718109130859,
0.2570348083972931... |
func (d *Driver) ApplyDiff(id string, parent string, diff io.Reader) (size int64, err error) {
logrus.Debugf("secureoverlay2: ApplyDiff called w. id: %s, parent: %s", id, parent)
if parent != "" && !d.isParent(id, parent) {
return -1, fmt.Errorf("secureoverlay2: ApplyDiff for non-parent diffs is not supported for ... | [
-0.49692267179489136,
-0.3017456531524658,
0.9124699234962463,
-0.061659954488277435,
-0.7187941670417786,
-0.22539302706718445,
0.6893502473831177,
0.2067623883485794,
0.20366209745407104,
-1.0744298696517944,
-0.10674649477005005,
-0.14831064641475677,
-0.007445742376148701,
1.4838035106... |
func (d *Driver) DiffSize(id, parent string) (size int64, err error) {
logrus.Debugf("secureoverlay2: DiffSize called w. id: %s, parent: %s", id, parent)
// read security meta data to see whether we are already initialized
s, err := d.getSecurityMetaDataForID(id, parent)
switch {
case err == nil:
// good ...
c... | [
-0.6173848509788513,
0.039037805050611496,
0.7501598596572876,
-0.3765191435813904,
-0.25451603531837463,
-0.4530009925365448,
0.936616837978363,
-0.5959578156471252,
0.6741458177566528,
-0.7431027293205261,
-0.004257585853338242,
-0.09465523064136505,
-0.46305450797080994,
1.5255961418151... |
func (d *Driver) DiffGetter(id string) (graphdriver.FileGetCloser, error) {
logrus.Debugf("secureoverlay2: DiffGetter called w. id: %s", id)
diffPath := d.getDiffPath(id)
// check for security meta-data
s, err := d.getSecurityMetaDataForID(id, "")
switch {
case err == nil:
if s.RequiresConfidentiality {
di... | [
-0.7794714570045471,
-0.989068329334259,
0.5874532461166382,
0.47131118178367615,
-0.6902265548706055,
0.019638115540146828,
0.6387119293212891,
-0.39004576206207275,
0.26731064915657043,
-0.3448735177516937,
0.3875085115432739,
-0.06326279044151306,
-0.12167241424322128,
1.139036893844604... |
func (d *Driver) Diff(id, parent string) (io.ReadCloser, error) {
logrus.Debugf("secureoverlay2: Diff called w. id: %s, parent: %s", id, parent)
// 1.) read security meta data
s, err := d.getSecurityMetaDataForID(id, parent)
if err != nil {
// we might not find it as it's for a parent which is not immediate pare... | [
-0.4325929284095764,
-0.48451176285743713,
0.6410548686981201,
0.39899030327796936,
-0.2959231734275818,
-0.15667128562927246,
0.9234933257102966,
-1.0055735111236572,
0.3413335680961609,
-0.5514257550239563,
-0.004050797317177057,
0.15449246764183044,
0.2658196985721588,
1.276069402694702... |
func (d *Driver) Changes(id, parent string) ([]archive.Change, error) {
logrus.Debugf("secureoverlay2: Changes called w. id: %s, parent: %s", id, parent)
if useNaiveDiff(d.home) || !d.isParent(id, parent) {
return d.naiveDiff.Changes(id, parent)
}
// Overlay doesn't have snapshots, so we need to get changes from... | [
-0.9367654919624329,
-0.4290785491466522,
0.5406642556190491,
0.028567487373948097,
-0.024969208985567093,
-0.48212313652038574,
-0.2645409405231476,
-0.8025737404823303,
0.6987442970275879,
-0.678527295589447,
-0.3246441185474396,
0.1001887321472168,
0.6756470203399658,
1.0693893432617188... |
func (d *Driver) getSecurityMetaDataForID(id, parent string) (secureImgCryptOptions, error) {
logrus.Debugf("secureoverlay2: getSecurityMetaDataForID called w. id: %s, parent: %s", id, parent)
dir := d.getSecureDiffPath(id, parent, false)
metaFile := path.Join(dir, constMetaDataFileName)
s := secureImgCryptOption... | [
-0.31963732838630676,
-0.37441426515579224,
0.4878599941730499,
0.0513492152094841,
-0.09462607651948929,
0.39814671874046326,
-0.08147871494293213,
-1.1473335027694702,
-0.0841737762093544,
0.2671680152416229,
-0.639943540096283,
0.6029127240180969,
0.2462739795446396,
0.24075737595558167... |
func (d *Driver) putSecurityMetaDataForID(id, parent string, s secureImgCryptOptions) error {
logrus.Debugf("secureoverlay2: putSecurityMetaDataForID called w. id: %s, parent: %s, data %s", id, parent, s)
dir := d.getSecureDiffPath(id, parent, false)
metaFile := path.Join(dir, constMetaDataFileName)
err := s.save... | [
-0.2579168975353241,
-0.5622530579566956,
0.509605884552002,
-0.37531447410583496,
0.294888973236084,
0.9978371858596802,
0.24442587792873383,
-0.42406392097473145,
-0.3218693137168884,
0.46607276797294617,
-1.0083764791488647,
0.5771202445030212,
0.10163958370685577,
-0.11667120456695557,... |
func getKeyFromKeyCache(keyHandle string) (string, string, error) {
ctxkey := ctx.Value(keyHandle)
if ctxkey == nil || ctxkey == "" {
conn, err := net.Dial("unix", RPCSocketFilePath)
if err != nil {
return "", "", fmt.Errorf("secureoverlay2: Failed to dial workload-agent wlagent.sock")
}
client := rpc.New... | [
-0.1779290735721588,
-0.8354451060295105,
0.5912280082702637,
-0.4024145007133484,
-0.853192150592804,
0.044028788805007935,
-0.30311959981918335,
-0.801253616809845,
0.2891830801963806,
0.7759761810302734,
0.21823936700820923,
0.31082454323768616,
-0.46283867955207825,
0.49974626302719116... |
func getKey(keyFilePath, keyHandle string) (string, string, error) {
var rKey string
var rKeyInfo string
var rErr error
if keyHandle == "" || encryptContainerImage {
encryptContainerImage = true
logrus.Debugf("secureoverlay2: getting key for encryption: %s ", keyHandle)
if keyFilePath != "" {
unwrappedKey... | [
-0.08653353154659271,
-0.22177785634994507,
0.6267868280410767,
0.3800354301929474,
-0.6614885330200195,
-0.12256798893213272,
0.05331248790025711,
-0.21801160275936127,
-0.2879815995693207,
0.7020641565322876,
0.3488432466983795,
-0.00501817325130105,
-0.4353984296321869,
0.54750245809555... |
func getKmsKeyFromKeyCache(keyHandle string) (string, string, error) {
counter := 0
goto GetKey
GetKey:
//search for the key in keyring
data, _, err := getKeyFromKeyCache(keyHandle)
if err != nil {
logrus.Debugf("secureoverlay2: Error: Not able to get the key from keyring - %s, counter = %d", err.Error(), counte... | [
0.056877847760915756,
-0.22596219182014465,
0.3361590504646301,
-0.04823175445199013,
-1.0431265830993652,
-0.18063294887542725,
-0.973704993724823,
-0.5358606576919556,
-0.24224846065044403,
0.34058475494384766,
-0.5546787977218628,
-0.008660494349896908,
-0.16362257301807404,
0.182484090... |
func (d *Driver) securityTransform(id, parent string, s secureImgCryptOptions, clearDiffTar io.ReadCloser, clearDiffSize int64) error {
logrus.Debugf("secureoverlay2: securityTransform called w. id: %s/parent: %s, secopts: %v, clearDiffSize: %d", id, parent, s, clearDiffSize)
var (
key string
kmstranskey ... | [
-0.3718051314353943,
-0.5813421607017517,
0.6549676060676575,
0.6314864158630371,
-0.22746245563030243,
-0.11079082638025284,
0.4036533236503601,
-0.6997671723365784,
0.6465319395065308,
-0.25498688220977783,
-0.69368577003479,
-0.2479771226644516,
-0.5467848777770996,
0.3690623939037323,
... |
func (d Driver) getSecureDiffPath(id, parent string, canBeRemote bool) string {
var diffDirName string
if parent == "" || d.isParent(id, parent) {
diffDirName = "diff"
} else {
diffDirName = fmt.Sprintf("%s-%s", "diff", parent)
}
localSecureDiffPath := path.Join(d.dir(id), constSecureBaseDirName, diffDirName... | [
-0.04238346964120865,
-0.7729962468147278,
0.8530811071395874,
0.3374614417552948,
-0.11937499791383743,
0.7059710025787354,
0.6508381366729736,
-0.35693421959877014,
0.4323172867298126,
-0.5510719418525696,
-0.4702983796596527,
0.37771520018577576,
-0.5906888246536255,
1.0929003953933716,... |
func (d Driver) createSecureDiffDir(id, parent string) error {
var diffDirName string
if parent == "" || d.isParent(id, parent) {
diffDirName = "diff"
} else {
diffDirName = fmt.Sprintf("%s-%s", "diff", parent)
}
localSecureDiffPath := path.Join(d.dir(id), constSecureBaseDirName, diffDirName)
rootUID, root... | [
0.05444605275988579,
-0.5833752751350403,
0.6850177645683289,
0.00942970346659422,
-0.02682025544345379,
0.43901383876800537,
0.5494606494903564,
-0.3733014166355133,
0.6821042895317078,
-0.6766019463539124,
-0.6677124500274658,
0.19961386919021606,
-0.11694656312465668,
1.1937477588653564... |
func (d Driver) getSecureCryptMntPath(id string) string {
return path.Join(d.dir(id), constSecureBaseDirName, constSecureCryptMntDirName)
} | [
-0.06753463298082352,
-0.5860657095909119,
0.43346741795539856,
0.8718454837799072,
-0.2090894877910614,
-0.11253625899553299,
0.8237255811691284,
-0.3084854483604431,
0.13604049384593964,
0.409648060798645,
-0.8819983005523682,
0.7543184161186218,
-0.6303597688674927,
0.1545439511537552,
... |
func RAMInBytes(size string) (int64, error) {
return parseSize(size, binaryMap)
} | [
-0.3947925567626953,
-0.6219604015350342,
0.3843499422073364,
-0.19527782499790192,
-1.5022214651107788,
-0.5546540021896362,
0.42523449659347534,
0.6242801547050476,
0.7785473465919495,
-0.31565117835998535,
-1.5884244441986084,
-0.3042390048503876,
-1.7240524291992188,
-0.192500084638595... |
func parseSize(sizeStr string, uMap unitMap) (int64, error) {
matches := sizeRegex.FindStringSubmatch(sizeStr)
if len(matches) != 4 {
return -1, fmt.Errorf("invalid size: '%s'", sizeStr)
}
size, err := strconv.ParseFloat(matches[1], 64)
if err != nil {
return -1, err
}
unitPrefix := strings.ToLower(matches... | [
-0.3559800684452057,
-0.05288708955049515,
0.5816358327865601,
-0.014794937334954739,
-0.5009655952453613,
-0.7282788157463074,
0.568290650844574,
0.5160342454910278,
0.49482402205467224,
-0.509477972984314,
0.47645318508148193,
-0.19461435079574585,
-0.6119970083236694,
-0.402742892503738... |
func RegisterWire(cdc *wire.Codec) {
cdc.RegisterConcrete(MsgSetName{}, "nameservice/SetName", nil)
cdc.RegisterConcrete(MsgBuyName{}, "nameservice/BuyName", nil)
} | [
-0.34477898478507996,
0.8244901299476624,
0.42491045594215393,
-0.6830533146858215,
1.1347390413284302,
-0.10041957348585129,
-0.9473103880882263,
-1.3031048774719238,
-0.6342815160751343,
-0.14023548364639282,
-0.8728241920471191,
0.6929048895835876,
-0.40114471316337585,
1.69795560836792... |
func GetAllPostsofaUserEndpoint(response http.ResponseWriter, request *http.Request) {
lock.Lock()
defer lock.Unlock()
var slicePost []Post
response.Header().Add("content-type", "application/json")
params := mux.Vars(request)
id, _ := (params["id"])
var post Post
collection := client.Database("Instagram").Col... | [
-0.19331657886505127,
-0.4844658076763153,
0.9419832229614258,
1.046181559562683,
-0.15676668286323547,
-0.10099076479673386,
-0.18917012214660645,
-0.318682998418808,
-0.4751756489276886,
0.8917626142501831,
-0.953368604183197,
0.6357933282852173,
0.017557987943291664,
0.8075928688049316,... |
func NewController(ctx context.Context, options *Options, resourceBaseURL string, objectType types.ObjectType, objectBlueprint func() types.Object, supportsCascadeDelete bool) *BaseController {
poolSize := options.OperationSettings.DefaultPoolSize
for _, pool := range options.OperationSettings.Pools {
if pool.Resou... | [
-0.1107846200466156,
0.2666894793510437,
0.6010036468505859,
0.30473315715789795,
-0.2945905923843384,
-0.29927319288253784,
0.39288705587387085,
-0.9303300976753235,
0.541499674320221,
0.2026170939207077,
0.5512205958366394,
0.1445607990026474,
-0.07739811390638351,
0.21286752820014954,
... |
func NewAsyncController(ctx context.Context, options *Options, resourceBaseURL string, objectType types.ObjectType, isAsyncDefault bool, objectBlueprint func() types.Object, supportsCascadeDelete bool) *BaseController {
controller := NewController(ctx, options, resourceBaseURL, objectType, objectBlueprint, supportsCas... | [
0.21289993822574615,
-0.4737573564052582,
0.355976402759552,
0.25403881072998047,
-0.5019135475158691,
-0.6887534260749817,
0.521786093711853,
-0.6752264499664307,
0.3704116940498352,
0.583176851272583,
-0.3958785831928253,
0.11277627944946289,
0.08956629037857056,
0.5593847036361694,
0.... |
func (c *BaseController) Routes() []web.Route {
return []web.Route{
{
Endpoint: web.Endpoint{
Method: http.MethodPost,
Path: c.resourceBaseURL,
},
Handler: c.CreateObject,
},
{
Endpoint: web.Endpoint{
Method: http.MethodGet,
Path: fmt.Sprintf("%s/{%s}", c.resourceBaseURL, web.Path... | [
-0.3208635747432709,
-0.8770949244499207,
0.6847202181816101,
-0.01673911139369011,
0.6830907464027405,
0.07889797538518906,
0.5120909810066223,
-0.9294678568840027,
0.3337027132511139,
-0.7079916596412659,
0.1030682921409607,
-0.45032650232315063,
0.1271069049835205,
0.22652868926525116,
... |
func (c *BaseController) CreateObject(r *web.Request) (*web.Response, error) {
if err := util.ValidateJSONContentType(r.Header.Get("Content-Type")); err != nil {
return nil, err
}
ctx := r.Context()
log.C(ctx).Debugf("Creating new %s", c.objectType)
result := c.objectBlueprint()
if err := util.BytesToObject(r... | [
-0.706281304359436,
-0.3967938721179962,
1.0035762786865234,
-0.18051613867282867,
0.15955038368701935,
0.1996205449104309,
0.6786297559738159,
-0.9345638155937195,
-0.031082112342119217,
0.7803225517272949,
-0.5234919786453247,
-1.0951651334762573,
-0.20418858528137207,
0.1204375252127647... |
func (c *BaseController) DeleteObjects(r *web.Request) (*web.Response, error) {
ctx := r.Context()
log.C(ctx).Debugf("Deleting %ss...", c.objectType)
isAsync := r.URL.Query().Get(web.QueryParamAsync)
if isAsync == "true" {
return nil, &util.HTTPError{
ErrorType: "BadRequest",
Description: "Only one resou... | [
-1.6485739946365356,
0.13772214949131012,
0.7489746809005737,
-0.0618944987654686,
0.8899189829826355,
-0.5835098028182983,
0.5094721913337708,
-0.9404449462890625,
0.3627181053161621,
0.7708610892295837,
-0.009738014079630375,
-0.24705466628074646,
-0.3078728914260864,
0.6959161162376404,... |
func (c *BaseController) DeleteSingleObject(r *web.Request) (*web.Response, error) {
resourceID := r.PathParams[web.PathParamResourceID]
ctx := r.Context()
log.C(ctx).Debugf("Deleting %s with id %s", c.objectType, resourceID)
byID := query.ByField(query.EqualsOperator, "id", resourceID)
ctx, err := query.AddCrite... | [
-0.3531426787376404,
-0.22993655502796173,
0.9843956828117371,
0.268307089805603,
-0.0720200389623642,
0.22404606640338898,
0.985315203666687,
-0.5171230435371399,
1.1484816074371338,
0.3440018892288208,
-0.22691641747951508,
-0.03590651601552963,
0.07733570784330368,
0.6035356521606445,
... |
func (c *BaseController) GetSingleObject(r *web.Request) (*web.Response, error) {
objectID := r.PathParams[web.PathParamResourceID]
ctx := r.Context()
log.C(ctx).Debugf("Getting %s with id %s", c.objectType, objectID)
byID := query.ByField(query.EqualsOperator, "id", objectID)
criteria := query.CriteriaForContext... | [
-0.6203375458717346,
-0.5336521863937378,
0.9565537571907043,
0.015716610476374626,
0.03027670830488205,
-0.02530907653272152,
0.8072273135185242,
-0.7001622319221497,
0.9092186689376831,
0.4462873339653015,
-0.32616177201271057,
0.11769973486661911,
-0.3347184956073761,
0.1593547761440277... |
func (c *BaseController) GetOperation(r *web.Request) (*web.Response, error) {
return GetResourceOperation(r, c.repository, c.objectType)
} | [
-0.7262680530548096,
0.12833775579929352,
0.5873548984527588,
0.59091717004776,
0.8311210870742798,
-0.6401603817939758,
1.0067322254180908,
-0.9385823607444763,
0.7830389142036438,
0.63033127784729,
0.2485315054655075,
-0.9711344242095947,
-0.2513202130794525,
0.05924611538648605,
0.689... |
func (c *BaseController) ListObjects(r *web.Request) (*web.Response, error) {
ctx := r.Context()
criteria := query.CriteriaForContext(ctx)
count, err := c.repository.Count(ctx, c.objectType, criteria...)
if err != nil {
return nil, util.HandleStorageError(err, c.objectType.String())
}
maxItems := r.URL.Query(... | [
-1.1021727323532104,
-0.14475035667419434,
0.8736802339553833,
-0.7484606504440308,
0.6593901515007019,
-0.6774948239326477,
-0.172883078455925,
-0.9329046607017517,
0.5541587471961975,
0.47131404280662537,
0.07907774299383163,
-0.24952735006809235,
0.11895589530467987,
0.01090478617697954... |
func (c *BaseController) PatchObject(r *web.Request) (*web.Response, error) {
if err := util.ValidateJSONContentType(r.Header.Get("Content-Type")); err != nil {
return nil, err
}
objectID := r.PathParams[web.PathParamResourceID]
ctx := r.Context()
log.C(ctx).Debugf("Updating %s with id %s", c.objectType, object... | [
-0.8216930627822876,
-1.5066720247268677,
0.8833600878715515,
-1.0956650972366333,
-0.12786537408828735,
1.215703010559082,
0.2527660131454468,
-0.6335500478744507,
-0.13985495269298553,
0.8389037847518921,
-0.40493616461753845,
0.07125469297170639,
-0.04251464083790779,
0.2640153169631958... |
func (m *Mock) Volumes() client.VolumesService {
return m.VolumesMock
} | [
-0.2748059034347534,
-0.2868628203868866,
-0.0056332675740122795,
-0.43176430463790894,
0.45051366090774536,
-0.655521810054779,
-0.019100502133369446,
-0.09990044683218002,
0.6572434306144714,
-1.090308666229248,
0.5849072337150574,
-0.36952075362205505,
-0.7475075125694275,
0.32741922140... |
func (f *FactoryFake) New(address string) (client.Interface, error) {
c, _ := f.Clients[address]
return c, nil
} | [
-0.3380967974662781,
-0.3284974694252014,
0.06682044267654419,
-0.45232200622558594,
-0.6478005647659302,
-0.5917782187461853,
0.8410843014717102,
-0.5290806889533997,
-0.532970666885376,
-0.162405326962471,
-0.278513103723526,
1.1077709197998047,
0.2753863036632538,
0.053571078926324844,
... |
func NewMock() *Mock {
return &Mock{VolumesMock: &VolumesServiceMock{}}
} | [
0.20571336150169373,
-0.4707527458667755,
0.21758288145065308,
0.6682199835777283,
0.6167182922363281,
0.12297312170267105,
0.04589294642210007,
0.03390924260020256,
0.45783132314682007,
-0.6658960580825806,
1.1246823072433472,
-0.010955399833619595,
-0.26697978377342224,
-0.43262434005737... |
func (v *VolumesServiceMock) List(podUID string) (list *api.VolumeList, err error) {
args := v.Called(podUID)
x := args.Get(0)
if x != nil {
list = x.(*api.VolumeList)
}
err = args.Error(1)
return
} | [
-0.8883136510848999,
-0.6264249086380005,
0.2511143386363983,
0.8448055982589722,
1.1436837911605835,
-0.3788185119628906,
-0.12342435121536255,
-0.1096876859664917,
0.7262426614761353,
-0.04565180093050003,
-1.083060383796692,
-0.17963537573814392,
-0.6903720498085022,
0.3433610796928406,... |
func (v *VolumesServiceMock) Get(podUID string, name string) (vol *api.Volume, err error) {
args := v.Called(podUID, name)
x := args.Get(0)
if x != nil {
vol = x.(*api.Volume)
}
err = args.Error(1)
return
} | [
-0.8953866362571716,
-0.19032900035381317,
0.4724898040294647,
0.07399960607290268,
0.9216213822364807,
-0.5398325324058533,
-0.5206333994865417,
-0.6113126277923584,
-0.49166786670684814,
-0.7529080510139465,
-0.08579298108816147,
0.9511789083480835,
-0.8473296165466309,
-0.78282248973846... |
func (v *VolumesServiceMock) Freeze(podUID string, name string) (vol *api.Volume, err error) {
args := v.Called(podUID, name)
x := args.Get(0)
if x != nil {
vol = x.(*api.Volume)
}
err = args.Error(1)
return
} | [
-1.4545047283172607,
-0.21354402601718903,
0.3831658959388733,
0.6764417290687561,
0.8383866548538208,
0.09129446744918823,
-0.20564350485801697,
-0.7285279631614685,
-0.2946232557296753,
-0.14154067635536194,
-0.5378109812736511,
0.14015841484069824,
-1.1029516458511353,
-0.29521030187606... |
func (v *VolumesServiceMock) Thaw(podUID string, name string) (vol *api.Volume, err error) {
args := v.Called(podUID, name)
x := args.Get(0)
if x != nil {
vol = x.(*api.Volume)
}
err = args.Error(1)
return
} | [
-0.5083616971969604,
-0.2451695203781128,
0.5213913321495056,
-0.21765172481536865,
0.5295974612236023,
0.399026483297348,
0.26377204060554504,
-0.9842331409454346,
-0.5368614196777344,
-0.36199215054512024,
-0.8272117972373962,
0.4849165976047516,
-0.25527194142341614,
-0.1509142965078354... |
func (pppc *PseudoPolygonPointCollector) AddEdge(e *quadedge.Edge) error {
if e == nil {
return errors.String("edge is nil")
}
if err := pppc.AddPoint(*e.Orig()); err != nil {
return err
}
return pppc.AddPoint(*e.Dest())
} | [
-0.5621227622032166,
-0.2496543526649475,
0.6653711795806885,
0.6659725308418274,
0.19797983765602112,
0.3783440887928009,
-0.23136624693870544,
0.5873498320579529,
0.36077964305877686,
0.1985224336385727,
0.4716201722621918,
-0.6249116659164429,
-0.47048380970954895,
0.0693032518029213,
... |
func (pppc *PseudoPolygonPointCollector) AddPoint(pt geom.Point) error {
if pppc.seen == nil {
pppc.seen = make(map[geom.Point]bool)
}
if len(pppc.upperPoints) == 0 {
pppc.upperPoints = append(pppc.upperPoints, pppc.Start)
pppc.seen[pppc.Start] = true
}
if len(pppc.lowerPoints) == 0 {
pppc.lowerPoints = ... | [
-0.152143657207489,
-0.5726610422134399,
0.8685081601142883,
-0.14245271682739258,
-0.015240686014294624,
1.051487684249878,
0.1820690780878067,
-0.25561782717704773,
0.4320131838321686,
-0.18298906087875366,
0.3072277903556824,
0.30756038427352905,
-0.49485400319099426,
-0.392870187759399... |
func (pppc *PseudoPolygonPointCollector) SharedLine() geom.Line {
return geom.Line{
[2]float64(pppc.Start),
[2]float64(pppc.End),
}
} | [
0.26803091168403625,
-0.5859339833259583,
0.28164681792259216,
0.47954902052879333,
0.441643089056015,
0.9805535078048706,
0.0613849051296711,
0.18464021384716034,
0.3670523762702942,
-0.8515031933784485,
-0.299787700176239,
-0.14913278818130493,
-0.2693827748298645,
-0.36317178606987,
0... |
func (pppc *PseudoPolygonPointCollector) Edges(upper bool) ([]geom.Line, error) {
var pts []geom.Point
if upper {
pts = make([]geom.Point, len(pppc.upperPoints))
copy(pts, pppc.upperPoints)
} else {
pts = make([]geom.Point, len(pppc.lowerPoints))
copy(pts, pppc.lowerPoints)
}
if debug {
lbl := "lower"
... | [
-0.4212409257888794,
-0.4263426661491394,
0.6038610935211182,
-0.09518150240182877,
0.6506690382957458,
0.3737695813179016,
-0.7065403461456299,
0.46207159757614136,
0.9101966619491577,
0.08337852358818054,
0.8890318870544434,
0.16583654284477234,
-0.38771069049835205,
-0.5827962756156921,... |
func BuildDefaultAPIServer(options configapi.MasterConfig) (*apiserveroptions.APIServer, genericapiserver.StorageFactory, error) {
if options.KubernetesMasterConfig == nil {
return nil, nil, fmt.Errorf("no kubernetesMasterConfig defined, unable to load settings")
}
_, portString, err := net.SplitHostPort(options.S... | [
-0.8823773860931396,
-0.48712196946144104,
0.7631253600120544,
-0.2898748219013214,
0.0573960579931736,
-0.23821298778057098,
0.014540527947247028,
0.6999731063842773,
0.2720600366592407,
0.07641500979661942,
-0.5727096796035767,
-0.4280340075492859,
-1.2684154510498047,
0.4846960604190826... |
func getAPIResourceConfig(options configapi.MasterConfig) genericapiserver.APIResourceConfigSource {
resourceConfig := genericapiserver.NewResourceConfig()
for group := range configapi.KnownKubeAPIGroups {
for _, version := range configapi.GetEnabledAPIVersionsForGroup(*options.KubernetesMasterConfig, group) {
... | [
-1.1320693492889404,
-0.6621144413948059,
0.33086130023002625,
-0.9569401741027832,
-0.8808488845825195,
-0.15128032863140106,
-0.18147315084934235,
1.32394540309906,
-0.0434083566069603,
1.0247447490692139,
-0.9276222586631775,
-0.0659228265285492,
-0.894943356513977,
0.5538268089294434,
... |
func (f *CLIAuthCodeFlow) GetToken(ctx context.Context) (*oauth2.Token, error) {
f.Config.RedirectURL = "urn:ietf:wg:oauth:2.0:oob"
state, err := generateOAuthState()
if err != nil {
return nil, err
}
authCodeURL := f.Config.AuthCodeURL(state)
log.Printf("Open %s for authorization", authCodeURL)
fmt.Print("Ent... | [
-0.7520842552185059,
0.5234051942825317,
0.8144893050193787,
0.391123503446579,
0.35365769267082214,
-0.22387860715389252,
0.6854257583618164,
0.4739905297756195,
0.9323439002037048,
-0.24269814789295197,
0.3568049669265747,
1.323438286781311,
0.4620867371559143,
0.12023301422595978,
1.9... |
func assert(t testing.TB, condition bool, message string, v ...interface{}) {
if !condition {
_, file, line, _ := runtime.Caller(1)
fmt.Printf("\033[31m%s:%d: "+message+"\033[39m\n\n", append([]interface{}{filepath.Base(file), line}, v...)...)
t.FailNow()
}
} | [
0.33952516317367554,
-0.3327994644641876,
0.5819308161735535,
-0.008460860699415207,
0.7895955443382263,
0.9625473618507385,
0.2563691735267639,
-0.1478046029806137,
-1.1283499002456665,
-0.2596268951892853,
0.6595792174339294,
0.8073214292526245,
-1.2468600273132324,
1.6198973655700684,
... |
func assertOK(t testing.TB, err error) {
if err != nil {
_, file, line, _ := runtime.Caller(1)
fmt.Printf("\033[31m%s:%d: unexpected error: %s\033[39m\n\n", filepath.Base(file), line, err.Error())
t.FailNow()
}
} | [
0.6525658369064331,
-0.47174176573753357,
0.3285151720046997,
0.22337622940540314,
0.35138586163520813,
0.8302189707756042,
0.6801166534423828,
-0.18684211373329163,
-0.2192724198102951,
0.42809057235717773,
0.12827834486961365,
0.6303881406784058,
-0.009499195963144302,
1.3989014625549316... |
func assertEquals(t testing.TB, expected, actual interface{}) {
if !reflect.DeepEqual(expected, actual) {
_, file, line, _ := runtime.Caller(1)
fmt.Printf("\033[31m%s:%d:\n\n\texpected: %#v\n\n\tactual: %#v\033[39m\n\n", filepath.Base(file), line, expected, actual)
t.FailNow()
}
} | [
-0.3304516673088074,
-0.5836634635925293,
0.5310536026954651,
-0.42819464206695557,
1.0666760206222534,
0.8057724833488464,
0.030569816008210182,
-0.8686087727546692,
-0.9386206269264221,
-0.013232659548521042,
0.09540803730487823,
0.9757868051528931,
-0.6598513722419739,
0.592341959476471... |
func NewLogoutUser(ctx *middleware.Context, handler LogoutUserHandler) *LogoutUser {
return &LogoutUser{Context: ctx, Handler: handler}
} | [
-0.3448876142501831,
-0.717070460319519,
0.11828415095806122,
0.27266600728034973,
-1.9032301902770996,
-0.1288774013519287,
-0.6662357449531555,
-0.016962839290499687,
0.08554460108280182,
-0.723724901676178,
-0.6931300759315491,
0.4867632985115051,
-0.2074255645275116,
-0.399569034576416... |
func (cte *ConcurrencyTestEngine) TestGenAndSQ(c *C) {
fmt.Printf("Call to function TestGenAndSQ\n")
// Set up the pipeline.
channel := gen(2, 3)
out := sq(channel)
// Consume the output.
fmt.Println(<-out) // 4
fmt.Println(<-out) // 9
} | [
0.25180166959762573,
-0.1874266266822815,
0.5342661738395691,
-0.40635430812835693,
0.45733559131622314,
-0.17484350502490997,
0.902661144733429,
-0.1195501759648323,
-1.1224377155303955,
-1.027024269104004,
-0.2574653625488281,
0.40899714827537537,
-0.009921159595251083,
0.418421477079391... |
func (cte *ConcurrencyTestEngine) TestGenSQSQRange(c *C) {
fmt.Printf("Call to function TestGenSQSQRange\n")
// Set up the pipeline and consume the output.
for n := range sq(sq(gen(2, 3))) {
fmt.Println(n) // 16 then 81
}
} | [
-0.030921556055545807,
0.24529799818992615,
0.28196609020233154,
0.06885060667991638,
0.3353017270565033,
0.10990556329488754,
0.6649273633956909,
0.007413689978420734,
-1.0527675151824951,
-1.2132967710494995,
-0.6292247176170349,
0.4275827407836914,
0.12412592023611069,
-0.00423562945798... |
func (cte *ConcurrencyTestEngine) TestFanInFanOut(c *C) {
fmt.Printf("Call to function TestFanInFanOut\n")
in := gen(2, 3)
// Distribute the sq work across two goroutines that both read from in.
c1 := sq(in)
c2 := sq(in)
// Consume the merged output from c1 and c2.
for n := range merge(c1, c2) {
fmt.Println(... | [
0.06048460677266121,
0.5480953454971313,
0.5253815650939941,
0.450998991727829,
0.18580295145511627,
-0.09045523405075073,
0.8450608253479004,
0.12146759778261185,
-0.7410964965820312,
-1.1348694562911987,
-0.6257233023643494,
-0.022472180426120758,
-0.8193570375442505,
0.01817889139056205... |
func deviceSetUp(ctx context.Context, user, pass, p12Path string, key *rsa.PublicKey) (err error) {
const uiSetupTimeout = 90 * time.Second
testing.ContextLog(ctx, "Restarting ui job")
sctx, cancel := context.WithTimeout(ctx, uiSetupTimeout)
defer cancel()
if err = upstart.StopJob(sctx, "ui"); err != nil {
ret... | [
-0.3102828562259674,
0.5917541980743408,
0.9394993782043457,
0.8669884204864502,
-0.01298741064965725,
0.09589564055204391,
1.0224056243896484,
-0.46562498807907104,
0.5603243708610535,
0.0042843203991651535,
0.46881017088890076,
-0.00447933841496706,
-0.21635375916957855,
-0.3181137740612... |
func createOwnerKey(ctx context.Context, user, p12Path string, pubkey *rsa.PublicKey) error {
testing.ContextLog(ctx, "Creating owner.key file")
// Convert pubkey to PKIX DER form first, so that in case of error
// happens, it won't be pushed to NSS.
der, err := x509.MarshalPKIXPublicKey(pubkey)
if err != nil {
... | [
0.7379769086837769,
0.4050905406475067,
0.605335533618927,
0.6093511581420898,
0.47291693091392517,
0.47191619873046875,
0.08490367978811264,
-0.6756911873817444,
-0.22171558439731598,
0.24345600605010986,
0.41456255316734314,
-0.16317418217658997,
0.549115002155304,
0.4570053815841675,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.