text
stringlengths
11
6.3k
embedding
listlengths
768
768
func flattenStoredInfoTypeLargeCustomDictionaryBigQueryFieldTable(c *Client, i interface{}, res *StoredInfoType) *StoredInfoTypeLargeCustomDictionaryBigQueryFieldTable { m, ok := i.(map[string]interface{}) if !ok { return nil } r := &StoredInfoTypeLargeCustomDictionaryBigQueryFieldTable{} if dcl.IsEmptyValueIn...
[ -0.3452037274837494, 0.7271832823753357, 0.2785608768463135, -0.7567541003227234, -0.2557528018951416, 0.2594395577907562, 0.1905510276556015, 0.18655674159526825, 0.044781394302845, -0.5273939967155457, -0.3019512891769409, 0.3656708598136902, -0.5007480382919312, -0.5511752367019653, 0...
func expandStoredInfoTypeLargeCustomDictionaryBigQueryFieldFieldMap(c *Client, f map[string]StoredInfoTypeLargeCustomDictionaryBigQueryFieldField, res *StoredInfoType) (map[string]interface{}, error) { if f == nil { return nil, nil } items := make(map[string]interface{}) for k, item := range f { i, err := expa...
[ -0.8635197877883911, 0.7531293630599976, 0.31047558784484863, -0.6233499646186829, 0.6503614187240601, 0.04024304449558258, 0.6001929640769958, 0.6084668040275574, 0.32587161660194397, -0.21188636124134064, -0.5293601155281067, -0.03612798824906349, -0.6439233422279358, -0.2617679238319397...
func expandStoredInfoTypeLargeCustomDictionaryBigQueryFieldFieldSlice(c *Client, f []StoredInfoTypeLargeCustomDictionaryBigQueryFieldField, res *StoredInfoType) ([]map[string]interface{}, error) { if f == nil { return nil, nil } items := []map[string]interface{}{} for _, item := range f { i, err := expandStore...
[ -1.2929308414459229, 0.4647428095340729, 0.2656906247138977, -0.34366467595100403, 0.46031054854393005, -0.25004759430885315, -0.11209533363580704, 0.7563397884368896, -0.34901463985443115, 0.13505376875400543, -0.3887122869491577, -0.07918398082256317, -0.5350829362869263, -0.027433406561...
func flattenStoredInfoTypeLargeCustomDictionaryBigQueryFieldFieldMap(c *Client, i interface{}, res *StoredInfoType) map[string]StoredInfoTypeLargeCustomDictionaryBigQueryFieldField { a, ok := i.(map[string]interface{}) if !ok { return map[string]StoredInfoTypeLargeCustomDictionaryBigQueryFieldField{} } if len(a)...
[ -0.9099864363670349, 0.3883562386035919, 0.4023839235305786, -0.783298134803772, 0.7248658537864685, 0.25580066442489624, 0.3327769935131073, 0.16479113698005676, 0.3447580933570862, -0.37942808866500854, -0.6689531207084656, -0.19503730535507202, -0.8001243472099304, -0.6134446263313293, ...
func flattenStoredInfoTypeLargeCustomDictionaryBigQueryFieldFieldSlice(c *Client, i interface{}, res *StoredInfoType) []StoredInfoTypeLargeCustomDictionaryBigQueryFieldField { a, ok := i.([]interface{}) if !ok { return []StoredInfoTypeLargeCustomDictionaryBigQueryFieldField{} } if len(a) == 0 { return []Stored...
[ -1.2930078506469727, 0.20290632545948029, 0.3565801680088043, -0.25567230582237244, 0.5737747550010681, 0.12903369963169098, -0.2839277386665344, 0.13839498162269592, -0.008583232760429382, -0.024873360991477966, -0.5727584362030029, -0.12034469842910767, -0.849766194820404, -0.47517395019...
func expandStoredInfoTypeLargeCustomDictionaryBigQueryFieldField(c *Client, f *StoredInfoTypeLargeCustomDictionaryBigQueryFieldField, res *StoredInfoType) (map[string]interface{}, error) { if dcl.IsEmptyValueIndirect(f) { return nil, nil } m := make(map[string]interface{}) if v := f.Name; !dcl.IsEmptyValueIndire...
[ -0.695712685585022, 0.7407012581825256, 0.3184092044830322, -1.1285743713378906, -0.270128071308136, 0.6737726926803589, 0.07824873924255371, 0.50789475440979, 0.1913308948278427, -0.36611366271972656, -0.24621346592903137, 0.31141775846481323, -0.28447479009628296, -0.203425332903862, 0...
func flattenStoredInfoTypeLargeCustomDictionaryBigQueryFieldField(c *Client, i interface{}, res *StoredInfoType) *StoredInfoTypeLargeCustomDictionaryBigQueryFieldField { m, ok := i.(map[string]interface{}) if !ok { return nil } r := &StoredInfoTypeLargeCustomDictionaryBigQueryFieldField{} if dcl.IsEmptyValueIn...
[ -0.620518147945404, 0.684827983379364, 0.17272739112377167, -0.9156874418258667, 0.029577545821666718, 0.7231169939041138, 0.21083733439445496, 0.08382587879896164, 0.24341405928134918, -0.379447340965271, -0.37395480275154114, -0.005900860298424959, -0.8393042683601379, -0.866760015487670...
func expandStoredInfoTypeDictionaryMap(c *Client, f map[string]StoredInfoTypeDictionary, res *StoredInfoType) (map[string]interface{}, error) { if f == nil { return nil, nil } items := make(map[string]interface{}) for k, item := range f { i, err := expandStoredInfoTypeDictionary(c, &item, res) if err != nil ...
[ -1.3336104154586792, 0.23914094269275665, 0.47231584787368774, -0.14851413667201996, 0.5740693807601929, 0.09128401428461075, 0.3507600724697113, 0.062235452234745026, 0.35986652970314026, -0.021578382700681686, -0.023403411731123924, -0.7172837853431702, -0.2653626501560211, 0.11959040910...
func expandStoredInfoTypeDictionarySlice(c *Client, f []StoredInfoTypeDictionary, res *StoredInfoType) ([]map[string]interface{}, error) { if f == nil { return nil, nil } items := []map[string]interface{}{} for _, item := range f { i, err := expandStoredInfoTypeDictionary(c, &item, res) if err != nil { re...
[ -1.3746705055236816, 0.47287285327911377, 0.40128597617149353, -0.02719300612807274, 0.6945895552635193, -0.25590193271636963, -0.2873637080192566, 0.08703260868787766, -0.1721610277891159, 0.26824477314949036, 0.42178311944007874, -0.2781311869621277, -0.0820198729634285, 0.28900563716888...
func flattenStoredInfoTypeDictionaryMap(c *Client, i interface{}, res *StoredInfoType) map[string]StoredInfoTypeDictionary { a, ok := i.(map[string]interface{}) if !ok { return map[string]StoredInfoTypeDictionary{} } if len(a) == 0 { return map[string]StoredInfoTypeDictionary{} } items := make(map[string]St...
[ -1.3937392234802246, -0.0351761169731617, 0.5060851573944092, -0.3423689007759094, 0.6999576687812805, 0.24047860503196716, 0.48535239696502686, -0.1479678601026535, 0.4692513346672058, 0.08949731290340424, -0.5896481871604919, -0.6822277903556824, -0.7391242384910583, 0.08089251071214676,...
func flattenStoredInfoTypeDictionarySlice(c *Client, i interface{}, res *StoredInfoType) []StoredInfoTypeDictionary { a, ok := i.([]interface{}) if !ok { return []StoredInfoTypeDictionary{} } if len(a) == 0 { return []StoredInfoTypeDictionary{} } items := make([]StoredInfoTypeDictionary, 0, len(a)) for _, ...
[ -1.3296362161636353, 0.5594505667686462, 0.41848406195640564, -0.047955963760614395, 0.6974208950996399, -0.16438163816928864, -0.29192212224006653, -0.3986715078353882, 0.06853479892015457, 0.3928372263908386, -0.12625281512737274, -0.3085108995437622, -0.5946123600006104, 0.2325115501880...
func expandStoredInfoTypeDictionary(c *Client, f *StoredInfoTypeDictionary, res *StoredInfoType) (map[string]interface{}, error) { if dcl.IsEmptyValueIndirect(f) { return nil, nil } m := make(map[string]interface{}) if v, err := expandStoredInfoTypeDictionaryWordList(c, f.WordList, res); err != nil { return ni...
[ -0.5393455624580383, 0.28368812799453735, 0.6309270858764648, -0.5122514963150024, -0.25792554020881653, 0.2821626663208008, 0.4772354066371918, -0.48050761222839355, 0.5407074093818665, -0.07363347709178925, 0.19295760989189148, 0.08045796304941177, -0.12532468140125275, 0.325891047716140...
func flattenStoredInfoTypeDictionary(c *Client, i interface{}, res *StoredInfoType) *StoredInfoTypeDictionary { m, ok := i.(map[string]interface{}) if !ok { return nil } r := &StoredInfoTypeDictionary{} if dcl.IsEmptyValueIndirect(i) { return EmptyStoredInfoTypeDictionary } r.WordList = flattenStoredInfoTy...
[ -0.8920109868049622, 0.4155518114566803, 0.21355801820755005, -0.6373205184936523, 0.2286413311958313, 0.13216526806354523, 0.5928224325180054, -0.532325029373169, 0.43719303607940674, -0.20637916028499603, -0.8385254144668579, 0.07018277794122696, -1.0860421657562256, -0.05719137191772461...
func expandStoredInfoTypeDictionaryWordListMap(c *Client, f map[string]StoredInfoTypeDictionaryWordList, res *StoredInfoType) (map[string]interface{}, error) { if f == nil { return nil, nil } items := make(map[string]interface{}) for k, item := range f { i, err := expandStoredInfoTypeDictionaryWordList(c, &ite...
[ -1.2776628732681274, 0.18613195419311523, 0.41999101638793945, -0.46067675948143005, 0.17456026375293732, -0.10563698410987854, -0.013067181222140789, 0.18718387186527252, 0.6994954943656921, 0.47016000747680664, -0.22800259292125702, -0.40353792905807495, -0.4288630187511444, 0.5154042243...
func expandStoredInfoTypeDictionaryWordListSlice(c *Client, f []StoredInfoTypeDictionaryWordList, res *StoredInfoType) ([]map[string]interface{}, error) { if f == nil { return nil, nil } items := []map[string]interface{}{} for _, item := range f { i, err := expandStoredInfoTypeDictionaryWordList(c, &item, res)...
[ -1.4037950038909912, 0.26128923892974854, 0.263261616230011, -0.1919139325618744, 0.1853661686182022, -0.4233396649360657, -0.3792271018028259, 0.1876828968524933, 0.0954788401722908, 0.7595780491828918, 0.3072105348110199, -0.46124130487442017, -0.3406332731246948, 0.696874737739563, 0....
func flattenStoredInfoTypeDictionaryWordListMap(c *Client, i interface{}, res *StoredInfoType) map[string]StoredInfoTypeDictionaryWordList { a, ok := i.(map[string]interface{}) if !ok { return map[string]StoredInfoTypeDictionaryWordList{} } if len(a) == 0 { return map[string]StoredInfoTypeDictionaryWordList{} ...
[ -1.393417239189148, -0.2576783001422882, 0.5024478435516357, -0.6452674865722656, 0.4681243896484375, 0.2830747663974762, 0.3567368984222412, -0.1562064290046692, 0.9082255959510803, 0.39263349771499634, -0.40110787749290466, -0.4180716276168823, -0.8258443474769592, 0.3669702410697937, ...
func flattenStoredInfoTypeDictionaryWordListSlice(c *Client, i interface{}, res *StoredInfoType) []StoredInfoTypeDictionaryWordList { a, ok := i.([]interface{}) if !ok { return []StoredInfoTypeDictionaryWordList{} } if len(a) == 0 { return []StoredInfoTypeDictionaryWordList{} } items := make([]StoredInfoTyp...
[ -1.6405302286148071, -0.027882935479283333, 0.31618767976760864, -0.16687731444835663, 0.46070748567581177, 0.0027126355562359095, -0.13270790874958038, -0.3061887323856354, 0.442754328250885, 0.7417502403259277, -0.007613440975546837, -0.47888079285621643, -0.7598252296447754, 0.491752266...
func expandStoredInfoTypeDictionaryWordList(c *Client, f *StoredInfoTypeDictionaryWordList, res *StoredInfoType) (map[string]interface{}, error) { if dcl.IsEmptyValueIndirect(f) { return nil, nil } m := make(map[string]interface{}) if v := f.Words; v != nil { m["words"] = v } return m, nil }
[ -0.9769742488861084, 0.3484625816345215, 0.35062599182128906, -0.8925106525421143, 0.15427088737487793, -0.3212347626686096, -0.031093768775463104, 0.1791812777519226, 0.7931484580039978, 0.45257312059402466, 0.05778684839606285, -0.09749282151460648, 0.0613076314330101, 0.5002090930938721...
func flattenStoredInfoTypeDictionaryWordList(c *Client, i interface{}, res *StoredInfoType) *StoredInfoTypeDictionaryWordList { m, ok := i.(map[string]interface{}) if !ok { return nil } r := &StoredInfoTypeDictionaryWordList{} if dcl.IsEmptyValueIndirect(i) { return EmptyStoredInfoTypeDictionaryWordList } ...
[ -1.120671033859253, 0.22155320644378662, 0.19250884652137756, -0.7806630730628967, 0.6613308191299438, 0.00802706554532051, 0.18357588350772858, -0.14943501353263855, 0.772589921951294, 0.5358311533927917, -0.2043481171131134, -0.16503959894180298, -0.8664040565490723, -0.07598542422056198...
func expandStoredInfoTypeDictionaryCloudStoragePathMap(c *Client, f map[string]StoredInfoTypeDictionaryCloudStoragePath, res *StoredInfoType) (map[string]interface{}, error) { if f == nil { return nil, nil } items := make(map[string]interface{}) for k, item := range f { i, err := expandStoredInfoTypeDictionary...
[ -0.7222711443901062, 0.2524113655090332, 0.5043782591819763, 0.636338472366333, 1.0890541076660156, 0.21461200714111328, 0.7497458457946777, -0.0023559280671179295, 0.0376165471971035, 0.07858790457248688, 0.035111818462610245, -1.2617073059082031, -0.4179791808128357, 0.042049746960401535...
func expandStoredInfoTypeDictionaryCloudStoragePathSlice(c *Client, f []StoredInfoTypeDictionaryCloudStoragePath, res *StoredInfoType) ([]map[string]interface{}, error) { if f == nil { return nil, nil } items := []map[string]interface{}{} for _, item := range f { i, err := expandStoredInfoTypeDictionaryCloudSt...
[ -1.2152694463729858, 0.6503952741622925, 0.4447004199028015, 0.9477106928825378, 1.162652611732483, -0.10857047140598297, -0.19516032934188843, 0.3538837432861328, -0.4025830626487732, 0.5217635035514832, 0.7661153078079224, -0.728507399559021, 0.05463133752346039, 0.0063768732361495495, ...
func flattenStoredInfoTypeDictionaryCloudStoragePathMap(c *Client, i interface{}, res *StoredInfoType) map[string]StoredInfoTypeDictionaryCloudStoragePath { a, ok := i.(map[string]interface{}) if !ok { return map[string]StoredInfoTypeDictionaryCloudStoragePath{} } if len(a) == 0 { return map[string]StoredInfoT...
[ -0.91636061668396, -0.11067570745944977, 0.48017945885658264, 0.4398286044597626, 1.186090350151062, 0.6330133676528931, 0.7187822461128235, -0.3393622934818268, 0.20142711699008942, 0.07323112338781357, -0.14005178213119507, -1.1272226572036743, -0.40845081210136414, 0.029546095058321953,...
func flattenStoredInfoTypeDictionaryCloudStoragePathSlice(c *Client, i interface{}, res *StoredInfoType) []StoredInfoTypeDictionaryCloudStoragePath { a, ok := i.([]interface{}) if !ok { return []StoredInfoTypeDictionaryCloudStoragePath{} } if len(a) == 0 { return []StoredInfoTypeDictionaryCloudStoragePath{} }...
[ -1.267858624458313, 0.35322824120521545, 0.46322187781333923, 0.9677637815475464, 1.2303258180618286, 0.26256611943244934, -0.18278823792934418, -0.1906888633966446, -0.14720013737678528, 0.5051286220550537, 0.48427248001098633, -0.6492108106613159, -0.35557642579078674, -0.110535770654678...
func expandStoredInfoTypeDictionaryCloudStoragePath(c *Client, f *StoredInfoTypeDictionaryCloudStoragePath, res *StoredInfoType) (map[string]interface{}, error) { if dcl.IsEmptyValueIndirect(f) { return nil, nil } m := make(map[string]interface{}) if v := f.Path; !dcl.IsEmptyValueIndirect(v) { m["path"] = v }...
[ -0.5368065237998962, 0.3739618957042694, 0.4584116041660309, 0.05477471277117729, 0.4419395327568054, 0.591056764125824, 0.11929028481245041, -0.21218010783195496, 0.2579815685749054, -0.24371935427188873, 0.5641270875930786, -0.4869324564933777, 0.11127421259880066, 0.06821689754724503, ...
func flattenStoredInfoTypeDictionaryCloudStoragePath(c *Client, i interface{}, res *StoredInfoType) *StoredInfoTypeDictionaryCloudStoragePath { m, ok := i.(map[string]interface{}) if !ok { return nil } r := &StoredInfoTypeDictionaryCloudStoragePath{} if dcl.IsEmptyValueIndirect(i) { return EmptyStoredInfoTyp...
[ -0.8859508633613586, 0.34166091680526733, 0.17954066395759583, 0.07213399559259415, 0.5720101594924927, 0.8485222458839417, 0.3455756902694702, -0.8161693215370178, 0.19856350123882294, 0.06250598281621933, 0.21379651129245758, -0.8360771536827087, -0.7281597256660461, -0.33029550313949585...
func expandStoredInfoTypeRegexMap(c *Client, f map[string]StoredInfoTypeRegex, res *StoredInfoType) (map[string]interface{}, error) { if f == nil { return nil, nil } items := make(map[string]interface{}) for k, item := range f { i, err := expandStoredInfoTypeRegex(c, &item, res) if err != nil { return nil...
[ -1.015867829322815, 0.20757639408111572, 0.5812576413154602, 0.19571833312511444, 0.986420750617981, -0.44440406560897827, 0.74781334400177, 0.6920230984687805, 0.43946465849876404, -0.48353812098503113, -0.1690695732831955, -0.29974451661109924, -0.7115068435668945, -0.37462085485458374, ...
func expandStoredInfoTypeRegexSlice(c *Client, f []StoredInfoTypeRegex, res *StoredInfoType) ([]map[string]interface{}, error) { if f == nil { return nil, nil } items := []map[string]interface{}{} for _, item := range f { i, err := expandStoredInfoTypeRegex(c, &item, res) if err != nil { return nil, err ...
[ -1.0910348892211914, 0.3404138386249542, 0.45165252685546875, 0.3787514269351959, 0.9808865785598755, -0.7692530155181885, 0.25661054253578186, 0.282324880361557, 0.13508816063404083, -0.26012685894966125, 0.33042553067207336, 0.04897819086909294, -0.37640947103500366, -0.1236727237701416,...
func flattenStoredInfoTypeRegexMap(c *Client, i interface{}, res *StoredInfoType) map[string]StoredInfoTypeRegex { a, ok := i.(map[string]interface{}) if !ok { return map[string]StoredInfoTypeRegex{} } if len(a) == 0 { return map[string]StoredInfoTypeRegex{} } items := make(map[string]StoredInfoTypeRegex) ...
[ -0.9831141233444214, -0.12496868520975113, 0.5708855390548706, 0.16018934547901154, 1.1671868562698364, -0.17931637167930603, 0.8573272228240967, 0.47361865639686584, 0.425180047750473, -0.4589897096157074, -0.6084745526313782, -0.13070712983608246, -0.975242555141449, -0.5030130743980408,...
func flattenStoredInfoTypeRegexSlice(c *Client, i interface{}, res *StoredInfoType) []StoredInfoTypeRegex { a, ok := i.([]interface{}) if !ok { return []StoredInfoTypeRegex{} } if len(a) == 0 { return []StoredInfoTypeRegex{} } items := make([]StoredInfoTypeRegex, 0, len(a)) for _, item := range a { items...
[ -1.0812408924102783, 0.1416434943675995, 0.4147322475910187, 0.6293004155158997, 1.3276102542877197, -0.3769223988056183, 0.20602954924106598, -0.10082356631755829, 0.18883012235164642, -0.30884426832199097, -0.008310920558869839, 0.17081598937511444, -0.8302301168441772, -0.35149297118186...
func expandStoredInfoTypeRegex(c *Client, f *StoredInfoTypeRegex, res *StoredInfoType) (map[string]interface{}, error) { if dcl.IsEmptyValueIndirect(f) { return nil, nil } m := make(map[string]interface{}) if v := f.Pattern; !dcl.IsEmptyValueIndirect(v) { m["pattern"] = v } if v := f.GroupIndexes; v != nil {...
[ -1.0997700691223145, 0.3282816708087921, 0.6612527370452881, -0.3793971836566925, 0.5703270435333252, 0.06538901478052139, 0.8828727602958679, 0.20260360836982727, 0.6503365635871887, -0.805901825428009, 0.010595458559691906, 0.9836676120758057, -0.08954519033432007, -0.7729128003120422, ...
func flattenStoredInfoTypeRegex(c *Client, i interface{}, res *StoredInfoType) *StoredInfoTypeRegex { m, ok := i.(map[string]interface{}) if !ok { return nil } r := &StoredInfoTypeRegex{} if dcl.IsEmptyValueIndirect(i) { return EmptyStoredInfoTypeRegex } r.Pattern = dcl.FlattenString(m["pattern"]) r.Group...
[ -1.1031798124313354, 0.09226209670305252, 0.240634486079216, -0.28919172286987305, 0.7292271852493286, 0.2564330995082855, 0.7880485653877258, 0.050346482545137405, 0.6362014412879944, -0.6760027408599854, -0.5070028901100159, 0.9169266223907471, -0.9985474944114685, -1.163986086845398, ...
func (r *StoredInfoType) matcher(c *Client) func([]byte) bool { return func(b []byte) bool { cr, err := unmarshalStoredInfoType(b, c, r) if err != nil { c.Config.Logger.Warning("failed to unmarshal provided resource in matcher.") return false } nr := r.urlNormalized() ncr := cr.urlNormalized() c.Conf...
[ -0.2330482304096222, -0.851311206817627, 0.7531827092170715, -0.29698535799980164, 0.08863314986228943, 0.3775961399078369, 0.4498152434825897, -0.19082479178905487, 0.04336922615766525, -0.5865796804428101, -0.6033930778503418, -0.4740546941757202, -0.3794262409210205, 0.7321691513061523,...
func fetch(page string) (string, error) { resp, err := http.Get(page) if err != nil { return "", err } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { return "", err } return string(body), nil }
[ 0.3411813974380493, -0.6395290493965149, 0.4883286654949188, -0.6447151303291321, -0.9092651009559631, 0.259380042552948, -1.6096575260162354, -0.83378005027771, 0.3471083343029022, 1.0201725959777832, 0.015188793651759624, 0.47492992877960205, 0.21477705240249634, 0.9902816414833069, 0....
func sitesParser(query string, pages []string) ([]string, error) { resultPages := []string{} wg := sync.WaitGroup{} errCh := make(chan error) for _, page := range pages { wg.Add(1) go func(page, query string) { pageContent, err := fetch(page) if err != nil { wg.Done() errCh <- err return ...
[ -0.08093225955963135, -0.42540034651756287, 0.6010403633117676, -0.30544513463974, -0.30824732780456543, -0.06206788122653961, -0.2821992039680481, -0.8627423048019409, 0.6774866580963135, 0.2197394222021103, 0.3280717730522156, -0.36345595121383667, -0.7820648550987244, 0.659794807434082,...
func (c *TRandomLong) NextLong(min int64, max int64) int64 { if max-min <= 0 { return min } return min + rand.Int63n(max-min) }
[ -0.28854769468307495, 0.2034168243408203, 0.3753666281700134, 0.16627711057662964, -1.6033087968826294, 0.7802925705909729, -1.204101324081421, 0.11675933003425598, 0.9529016017913818, -0.5848333239555359, -0.8638824224472046, 0.3113754391670227, 0.1660083830356598, -0.4016112685203552, ...
func (c *TRandomLong) UpdateLong(value int64, interval int64) int64 { if interval <= 0 { interval = int64(math.Trunc(0.1 * float64(value))) } minValue := value - interval maxValue := value + interval return c.NextLong(minValue, maxValue) }
[ -0.2189602553844452, 0.23657584190368652, 0.6530215740203857, 0.23641254007816315, -1.536156177520752, -0.024765364825725555, -0.31809306144714355, 0.15123961865901947, 0.22157135605812073, 0.3190579116344452, -0.4673897325992584, 0.26573446393013, -0.20956990122795105, -0.3676778674125671...
func (c *TRandomLong) Sequence(min int64, max int64) []int64 { if min < 0 { min = 0 } if max < min { max = min } count := c.NextLong(min, max) result := make([]int64, count, count) for i := range result { result[i] = int64(i) } return result }
[ -1.750768780708313, 0.2929653525352478, 0.28165534138679504, 0.3793520927429199, -0.2272108793258667, -0.911444365978241, -0.5012894868850708, 0.21270155906677246, -0.21911360323429108, 0.12429545819759369, -1.3283652067184448, 0.6177222728729248, 0.30759313702583313, 0.12704207003116608, ...
func (c *Config) Register() string { return c.Get("register") }
[ -0.5026015043258667, 1.4240598678588867, 0.15904483199119568, 0.8925031423568726, 0.3929305076599121, -0.38548144698143005, -0.09562677145004272, 0.379848837852478, -1.157918930053711, -0.09049637615680695, -0.6926207542419434, -0.09711277484893799, -0.18155717849731445, 0.2805942296981811...
func (c *Config) LogDir() string { rel := filepath.Join(c.Base, c.Get("log_dir", logDir)) abs, err := filepath.Abs(rel) if nil != err { panic(err) } return abs }
[ 0.14477501809597015, -0.6072582602500916, 0.546095073223114, 0.6268863081932068, -0.15940187871456146, 0.257192999124527, -0.18928901851177216, -0.03511355072259903, -0.37798741459846497, -0.20882004499435425, 0.6516469717025757, 0.40059131383895874, -0.07301542162895203, 0.482802897691726...
func (c *Config) Host() string { host, err := os.Hostname() if nil == err { return c.Get("host", host) } return c.Get("host", "localhost") }
[ 0.0522444024682045, -0.7922096252441406, 0.4688965380191803, 0.8936888575553894, -0.08058729022741318, -0.02931523509323597, -0.4129782021045685, 0.8843554854393005, -0.7641217112541199, 0.9239711761474609, 0.02949160523712635, -0.6345988512039185, -0.10608070343732834, -0.1303690522909164...
func (c *Config) Port() int { port, err := strconv.Atoi(c.Get("port", strconv.Itoa(default_port))) if nil != err { panic(err) } return port }
[ -0.0933278352022171, 0.8545305728912354, 0.5511414408683777, 0.4550369381904602, 1.0874519348144531, -0.05593118816614151, 0.5792335271835327, 0.2425624132156372, -1.0687674283981323, 0.5460156202316284, -0.1906813234090805, -0.4258487820625305, -1.0396406650543213, -0.09159297496080399, ...
func (c *Config) Role() int { role := c.Get("role", "follower") switch role { case "follower": return FOLLOWER case "leader": return LEADER default: log.Panic("Invalid role: %s.", role) } return LEADER }
[ -0.10484064370393753, 0.8312761783599854, 0.5347089767456055, 0.3500176966190338, 0.45741310715675354, -0.13504977524280548, 0.5064778923988342, -0.48811766505241394, 0.014756216667592525, 0.13128162920475006, 0.542807400226593, -0.09211260825395584, -0.9101462364196777, 0.5277494192123413...
func NewAddCommand() *cobra.Command { return NewCmd("add"). WithDescription("Add goployer manifest file"). SetFlags(). RunWithArgs(funcAdd) }
[ 0.21407726407051086, -0.7214910984039307, 0.524603545665741, -0.06540500372648239, -0.07554905861616135, 0.3788648247718811, -0.12847036123275757, 0.6400694847106934, -0.019091421738266945, -0.8194072842597961, 0.8095254302024841, 0.7279137372970581, 0.026002483442425728, 1.291521072387695...
func funcAdd(ctx context.Context, _ io.Writer, args []string, _ string) error { return runWithoutExecutor(ctx, func() error { if err := runner.AddManifest(args); err != nil { return err } return nil }) }
[ -0.33292320370674133, -0.49044468998908997, 0.6094250679016113, -0.3047504425048828, 0.21745456755161285, -0.04835136979818344, 0.15921920537948608, 0.1152004823088646, 0.671083927154541, 0.202951118350029, 0.9032429456710815, 0.7728671431541443, 0.001187269575893879, 0.9048317074775696, ...
func (car *Car) kmh() float64 { return float64 (car.gas_pedal) *(car.top_speed_kmh/usixteenbitmax) }
[ 0.676577091217041, 0.29685625433921814, 0.4062540829181671, 1.1186494827270508, -0.8192561864852905, 0.9570056200027466, -0.7571278214454651, 0.3851117491722107, -0.7090131640434265, -0.17259126901626587, 0.010493633337318897, -0.31531012058258057, -0.36284971237182617, -0.3277783095836639...
func (r *Route) Name() string { return "route" }
[ -0.42437121272087097, -0.43493789434432983, 0.5558092594146729, 0.1958019882440567, -0.546132504940033, 0.35179799795150757, -0.40615132451057434, -0.07136708498001099, -0.18588195741176605, 0.7264922261238098, -0.924795925617218, -0.06582231819629669, 0.3006179630756378, 0.841849386692047...
func (r *Route) Check(ctx context.Context, reg qv1.QuayRegistry) (qv1.Condition, error) { var zero qv1.Condition if !qv1.ComponentIsManaged(reg.Spec.Components, qv1.ComponentRoute) { return qv1.Condition{ Type: qv1.ComponentRouteReady, Status: metav1.ConditionTrue, Reason: qv1.Co...
[ -0.047873370349407196, 0.04824933409690857, 0.9076299667358398, -0.4071463644504547, 0.2331654131412506, -0.024535121396183968, 0.34191370010375977, 0.2852897047996521, -0.0821167528629303, 0.8465254306793213, 0.6056399941444397, 0.39934757351875305, -0.7070928812026978, 1.126559853553772,...
func (r *Route) ingressAdmittedCondition( conds []routev1.RouteIngressCondition, ) routev1.RouteIngressCondition { var zero routev1.RouteIngressCondition for _, cond := range conds { if cond.Type != routev1.RouteAdmitted { continue } return cond } return zero }
[ -0.027425963431596756, -0.9555081725120544, 0.5330489277839661, 0.07463615387678146, -0.5034807324409485, 0.5576335787773132, 0.29123151302337646, 0.16821736097335815, 0.27712926268577576, 0.4937795102596283, 1.53834867477417, 1.3010724782943726, -1.5965014696121216, 0.8380495309829712, ...
func NewParticle(chromosome, speed []float64, smin, smax float64, fitness *base.Fitness) *Particle { return &Particle{ Float64Individual: *base.NewFloat64Individual(chromosome, fitness), speed: speed, smin: smin, smax: smax, } }
[ 0.1997850388288498, -0.28771087527275085, 0.36434322595596313, 1.0932656526565552, -0.7080317735671997, 0.9542236328125, -0.4271780252456665, 0.13900256156921387, -0.34306153655052185, -0.4050118327140808, 0.3828386664390564, 0.8042901754379272, -0.6239515542984009, 0.12054746598005295, ...
func (part *Particle) Clone() interface{} { f64Ind := part.Float64Individual.Clone().(*base.Float64Individual) cSpeed := make([]float64, len(part.speed)) copy(cSpeed, part.speed) return &Particle{ Float64Individual: *f64Ind, speed: cSpeed, pbest: part.pbest, smin: part.s...
[ 0.3234630525112152, -1.058220624923706, 0.7883661389350891, 0.8688287734985352, -0.7578867077827454, 1.142477035522461, -0.5056008100509644, -0.5039179921150208, -0.2710498869419098, -0.12939821183681488, -0.19686056673526764, 0.49279293417930603, -0.7925883531570435, -0.8098138570785522, ...
func (part *Particle) SetSpeed(speed []float64) { if len(speed) != len(part.speed) { panic(fmt.Sprintf("This speed's length is not equals to part.speed's: %v,%v", len(speed), len(part.speed))) } for i, v := range speed { if v < part.smin { part.speed[i] = part.smin } else if v > part.smax { part.speed[i]...
[ 0.3926056921482086, -0.2122105211019516, 0.4371328353881836, 1.0713087320327759, 0.13235116004943848, 0.6242107152938843, -0.7051501274108887, -0.1463758945465088, 0.1959097981452942, 0.41712722182273865, -1.0277973413467407, 0.22447827458381653, -1.1348415613174438, 0.7864867448806763, ...
func (part *Particle) SetPBest(other *Particle) { part.pbest = other }
[ 0.6140691041946411, -1.0180988311767578, 0.5313078761100769, 0.22498877346515656, 0.24316821992397308, 0.9486888647079468, -1.505686640739441, -0.7592284083366394, -0.6570184230804443, -0.2705173194408417, -1.3064624071121216, 0.8832605481147766, -0.05698947608470917, 0.18512967228889465, ...
func exists(path string) (bool) { _, err := os.Stat(path) if err == nil { return true } if os.IsNotExist(err) {return false} return true }
[ -0.7294560074806213, -0.23433975875377655, 0.6143167018890381, -0.7735627293586731, 0.6401327848434448, 1.200408935546875, -0.5391162633895874, -0.05233848839998245, -0.1895851343870163, -0.6437674760818481, -0.23312684893608093, -0.38531577587127686, 0.08913177251815796, 0.334182947874069...
func NewMetrics() *Metrics { m := &Metrics{} m.Reset() return m }
[ -0.12732550501823425, -0.0959242433309555, 0.0035502822138369083, 0.35929423570632935, -0.39251890778541565, 0.03844543918967247, 0.47807565331459045, -1.1182548999786377, -0.18592716753482819, -0.7396856546401978, 0.7108837366104126, 0.9239548444747925, -1.0421627759933472, -0.15095697343...
func (m *Metrics) Counter(key string) metrics.Counter { m.Lock() defer m.Unlock() counter, ok := m.counters[key] if !ok { counter = metrics.Counter(key) m.counters[key] = counter } return counter }
[ 0.5041443705558777, -0.447550892829895, 0.33518585562705994, -0.010837231762707233, -0.6473905444145203, 0.3241327106952667, 0.27713632583618164, -0.8991155028343201, 0.42412832379341125, -0.2701210081577301, 0.9536476135253906, -0.2712230682373047, -0.6191637516021729, 0.3980981111526489,...
func (m *Metrics) Guage(key string) metrics.Gauge { m.Lock() defer m.Unlock() gauge, ok := m.gauges[key] if !ok { gauge = metrics.Gauge(key) m.gauges[key] = gauge } return gauge }
[ -0.25484904646873474, 0.5688375234603882, 0.5641675591468811, -0.6336339712142944, -0.3319218158721924, -0.057194292545318604, -0.418844997882843, -0.4875125586986542, -0.238381490111351, 1.401985764503479, 0.7794862389564514, -0.11950508505105972, -1.3218839168548584, 0.6973115801811218, ...
func (m *Metrics) Histogram(key string) *metrics.Histogram { m.Lock() defer m.Unlock() hist, ok := m.histograms[key] if !ok { hist = metrics.NewHistogram(key, 0, 1e8, 5) m.histograms[key] = hist } return hist }
[ 0.8112940192222595, 0.7735411524772644, 0.29794344305992126, 0.13463479280471802, 0.5007691979408264, -0.27143484354019165, 0.49399858713150024, -0.12015599757432938, 0.5755521059036255, 0.046222832053899765, 0.052632834762334824, -0.052803315222263336, -0.9209986329078674, -0.049563195556...
func (m *Metrics) Snapshot() Report { c, g := metrics.Snapshot() return Report{Gauges: g, Counters: c} }
[ 1.2256947755813599, 0.6767656207084656, 0.31762832403182983, -0.6583408713340759, -0.31432610750198364, -0.21614764630794525, 0.9219065308570862, -0.05756748840212822, -0.026920495554804802, -1.6781152486801147, 0.5422308444976807, -0.12292402237653732, -0.21045733988285065, -1.01611340045...
func (m *Metrics) Reset() { metrics.Reset() m.Lock() m.gauges = make(map[string]metrics.Gauge) m.counters = make(map[string]metrics.Counter) m.histograms = make(map[string]*metrics.Histogram) m.Unlock() }
[ -0.17967435717582703, 0.41013750433921814, 0.16025933623313904, 0.12214620411396027, 0.2581452429294586, 0.4146713614463806, 1.0328975915908813, -0.8048095107078552, -0.8576403260231018, -0.30332648754119873, 0.09438889473676682, 0.8938869833946228, -0.2623225152492523, -0.6451159119606018...
func newCommune(n int) *commune { return &commune{ch: make(chan string, n)} }
[ 0.18003086745738983, -0.4986405670642853, 0.32424798607826233, 0.006392615381628275, -0.2106562703847885, -0.40298381447792053, -0.36795657873153687, -0.9854452610015869, -0.25943702459335327, -0.687961757183075, -0.9128686189651489, -0.03502890095114708, -0.7657439708709717, 0.03244326636...
func (st *StressTest) SetCommune(name string) chan<- string { com := newCommune(10) st.communes[name] = com return com.ch }
[ 0.06773903220891953, 0.10515500605106354, 0.48446300625801086, -0.7195809483528137, 0.5848252773284912, 0.08696961402893066, 0.4893845021724701, -0.810311496257782, -0.4151519238948822, 0.37952175736427307, -0.8366622924804688, 0.15259619057178497, -1.2026981115341187, -0.150654599070549, ...
func (st *StressTest) GetPoint(name, precision string) models.Point { p := st.communes[name].point(precision) // Function needs to return a point. Panic if it doesn't if p == nil { log.Fatal("Commune not returning point") } return p }
[ 0.7032383680343628, -0.36261260509490967, 0.3006244897842407, 0.3778056800365448, 0.5924795866012573, 0.5425122380256653, -0.5034292340278625, -0.21185101568698883, -0.11347141861915588, -0.1376960128545761, 0.7192355990409851, -0.22131942212581635, -1.1380832195281982, -1.1617270708084106...
func vypisMapu(mapa [6][6]uint8) { // Preiteruje celym 2d polom a vypise co sa nachadza na danom mieste for i := 0; i < 6; i++ { for j := 0; j < 6; j++ { fmt.Print(mapa[i][j], " ") } fmt.Print("\n") } fmt.Print("\n") }
[ -0.8222675323486328, -0.8961117267608643, 0.6670079827308655, 0.2939991056919098, -0.5437111258506775, 0.08802808076143265, 0.3261910080909729, -0.3266359865665436, 0.09526986628770828, 0.41594573855400085, 0.17428618669509888, 0.11541467905044556, -0.38367190957069397, 0.42487195134162903...
func vytvorPrazdnuMapu() [6][6]uint8 { mapa := [6][6]uint8{ {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, } return mapa }
[ -1.2690461874008179, -1.5398058891296387, 0.8246944546699524, -0.020720187574625015, -0.11562559753656387, 0.03881298005580902, 0.8087876439094543, -0.5158371329307556, 0.7832563519477844, -0.29740193486213684, -0.6895041465759277, 0.29390615224838257, -0.8410706520080566, 0.30174893140792...
func hash(stav Stav) uint64{ str := "" for i := 0; i < len(stav.Auta); i++ { str += stav.Auta[i].Farba str += strconv.Itoa(int(stav.Auta[i].X)) str += strconv.Itoa(int(stav.Auta[i].Y)) str += strconv.FormatBool(stav.Auta[i].Smer) str += strconv.Itoa(int(stav.Auta[i].Dlzka)) } h := fnv.New64a() h.Write(...
[ -0.21630701422691345, 0.13095280528068542, 0.7635448575019836, 0.3008752167224884, -1.1196184158325195, 0.47039994597435, 0.3711017668247223, 0.1815839558839798, -0.5707263350486755, 0.12336316704750061, -0.5020008683204651, 1.350592851638794, 0.5626950860023499, -0.05054651200771332, 0....
func posunAuto(auto *Auto, krok int8, stav Stav) (error){ //Ak je auto horizontalne, kontroluje moznost pohybu len vpravo/vlavo if auto.Smer == true { //Kontroluje hranice mapy if int8(auto.Dlzka) + int8(auto.X) + krok > 6 || int8(auto.X) + krok < 0 { return errors.New("state impossible") } else { //Ak je...
[ -0.573854923248291, -1.0145699977874756, 0.8387945294380188, 0.02723563089966774, -0.6848059892654419, 0.4143293499946594, 0.3624064326286316, -0.3061142861843109, -0.4712715148925781, 0.25402361154556274, -1.0718199014663696, -0.19459515810012817, 0.47370463609695435, -0.5191078782081604,...
func vytvorStavZAut(auta []Auto, hlbka int, kroky []int, indexAuta int, posun int) (stav Stav){ stav= Stav{ Auta: auta, Hlbka: hlbka, Mapa: vytvorMapuZAut(auta), } cpy := make([]int, len(kroky)) copy(cpy, kroky) //vytvori sa novy krok, ktory sa prida k uz existujucemu zoznamu krokov. // 1 - hore; 2 - vpra...
[ -0.5244213342666626, -0.5933594703674316, 0.5206452012062073, 0.515331506729126, -0.607542097568512, -0.2899667024612427, 0.9883298873901367, -0.5667564868927002, -0.6008202433586121, 0.26108625531196594, -0.5002101063728333, 0.14044471085071564, 0.11991110444068909, -0.25938165187835693, ...
func najdiDeti(stav Stav)([]Stav){ cars := stav.Auta children := []Stav{} //Posuva vsetky auta do vsetkych stran (pokial to je mozne) for i := 0; i < len(cars); i++ { for j := 1; j <= 4; j++ { cpy := make([]Auto, len(cars)) copy(cpy, cars) err:= posunAuto(&cpy[i], int8(j), stav) //Ak err=nil, znamena...
[ -0.7094850540161133, -0.37662291526794434, 0.6795239448547363, 0.3095126152038574, -0.6712431311607361, 0.2536327540874481, 0.4165787994861603, -1.1704312562942505, -0.7280747890472412, 0.7840884327888489, -0.8918483257293701, 0.05438247323036194, -0.06789302080869675, 0.24560759961605072,...
func is_state_final(state Stav, finAuto string) bool{ for i := 0; i < len(state.Auta); i++ { if state.Auta[i].Farba == finAuto{ if state.Auta[i].X + state.Auta[i].Dlzka == 6 { return true } else { return false } } } return false }
[ -0.4963579773902893, -0.77349853515625, 0.5814530849456787, 0.5043548345565796, -0.7245447635650635, -0.6269892454147339, 0.05356809124350548, -0.1075417622923851, -0.35250788927078247, 0.22209911048412323, -0.7377885580062866, 0.20334729552268982, 0.38595256209373474, 0.12570202350616455,...
func dls(zacStav Stav, hlbka int, finAuto string, poc *int)(*Stav) { zacStav.Hlbka = 0 zacStav.Mapa = vytvorMapuZAut(zacStav.Auta) //hash mapa, kde sa uchovavaju navstivene stavy hshMapa := make(map[uint64]int) //stavy, ktore su na okraji (este neprehladane) okraj := make([]Stav, 0) okraj = append(okraj, zacStav...
[ -0.22660404443740845, -0.6749178171157837, 0.778369665145874, -0.02191503532230854, -0.5432372093200684, -0.3221302628517151, -0.055670902132987976, -0.6723858714103699, -0.5356768369674683, -0.0944223403930664, -0.6519423127174377, 0.23808692395687103, 0.09232231974601746, 0.0787980034947...
func najdiRiesenie(pociatocnyStav Stav, finalneAuto string) *Stav { pocitadlo := 0 for i := 0; i < 50; i+=1 { najdene := dls(pociatocnyStav, i, finalneAuto, &pocitadlo) if najdene != nil { fmt.Println("Prehladalo sa ", pocitadlo, " stavov..") return najdene } } fmt.Println("Prehladalo sa ", pocitadlo, ...
[ -0.4322301149368286, -0.23704251646995544, 0.3707940876483917, -0.23789511620998383, -0.7769613265991211, -0.25840282440185547, 0.41961154341697693, -0.4654194712638855, -0.8926070332527161, 0.16367274522781372, -0.3584616482257843, 0.28078579902648926, -0.04850039631128311, 0.497230470180...
func (c *FakeDeploymentLogs) Get(name string, opt api.DeploymentLogOptions) *restclient.Request { action := ktestclient.GenericActionImpl{} action.Verb = "get" action.Namespace = c.Namespace action.Resource = "deploymentconfigs" action.Subresource = "log" action.Value = opt _, _ = c.Fake.Invokes(action, &api.De...
[ -0.39140138030052185, 0.1070869192481041, 0.5291711091995239, -0.6748338341712952, -0.3319951295852661, -0.23171691596508026, -0.941535472869873, -0.30251944065093994, 0.051130812615156174, 1.1247875690460205, 0.008119623176753521, 1.16582190990448, -0.20060235261917114, 0.1097068414092063...
func getI18nFile(locale, dir string) (filePath string) { contents, _ := ioutil.ReadDir(dir) for _, fileInfo := range contents { if !fileInfo.IsDir() { name := fileInfo.Name() if strings.HasSuffix(name, locale+".all.json") { filePath = filepath.Join(dir, fileInfo.Name()) break } } else { file...
[ 0.26032471656799316, -0.5450444221496582, 0.9233498573303223, 0.3520740568637848, 0.14460042119026184, -0.10597342997789383, 0.3502410352230072, 0.35065287351608276, -1.179353952407837, 0.6522800326347351, -0.06581909954547882, -0.21266821026802063, -0.025867007672786713, 0.321393191814422...
func (device *Device) deviceState() deviceState { return deviceState(device.state.state.Load()) }
[ -0.3110385239124298, -0.35168617963790894, 0.35625532269477844, 0.2981777787208557, -0.9368375539779663, -0.4951612055301666, 0.5152065753936768, -0.4134353995323181, 0.9540871977806091, -0.39888182282447815, 0.1179279237985611, -0.08531918376684189, 0.05265875533223152, -0.078525282442569...
func (device *Device) isClosed() bool { return device.deviceState() == deviceStateClosed }
[ -0.6391068696975708, -0.012401553802192211, 0.3287283182144165, 1.222840428352356, -0.349689245223999, 0.5040567517280579, 0.08562202751636505, -0.2413148432970047, 1.3541051149368286, -0.7816669344902039, -0.02537921443581581, 0.4698554277420044, -0.06223134696483612, 0.052701182663440704...
func (device *Device) isUp() bool { return device.deviceState() == deviceStateUp }
[ -1.4414688348770142, 0.07211875170469284, 0.5105394721031189, 1.3798948526382446, -0.23137234151363373, 0.25191789865493774, 0.2511421740055084, 0.27588558197021484, 1.6080082654953003, 0.19385531544685364, -0.45504531264305115, 0.38922637701034546, -0.055216170847415924, -0.61709684133529...
func (device *Device) changeState(want deviceState) (err error) { device.state.Lock() defer device.state.Unlock() old := device.deviceState() if old == deviceStateClosed { // once closed, always closed device.log.Verbosef("Interface closed, ignored requested state %s", want) return nil } switch want { case...
[ -1.2990654706954956, 0.713699460029602, 0.8468340635299683, 0.49470779299736023, -0.12633396685123444, 0.1473630964756012, 0.6958218216896057, -0.42688193917274475, 0.565604567527771, -0.8396891951560974, 0.46619027853012085, 0.24902772903442383, -0.9564700126647949, -0.0038598752580583096...
func (device *Device) upLocked() error { if err := device.BindUpdate(); err != nil { device.log.Errorf("Unable to update bind: %v", err) return err } // The IPC set operation waits for peers to be created before calling Start() on them, // so if there's a concurrent IPC set request happening, we should wait fo...
[ -0.8172245025634766, -0.1586715579032898, 0.7867313623428345, 0.2551729381084442, 0.31287917494773865, -0.3225785791873932, 1.1216148138046265, -0.5803682804107666, -0.05724030360579491, -0.018816346302628517, -0.18994805216789246, 0.411321222782135, -0.4145437180995941, -0.329331994056701...
func (device *Device) downLocked() error { err := device.BindClose() if err != nil { device.log.Errorf("Bind close failed: %v", err) } device.peers.RLock() for _, peer := range device.peers.keyMap { peer.Stop() } device.peers.RUnlock() return err }
[ -0.835322916507721, -0.6100353598594666, 0.8953514099121094, -0.10267121344804764, 0.5274866819381714, 0.4976256489753723, 1.4252140522003174, -0.04024971276521683, 0.005464380141347647, -0.45758315920829773, 0.43245041370391846, 0.4373181462287903, -1.012488603591919, 0.3835749924182892, ...
func (device *Device) BatchSize() int { size := device.net.bind.BatchSize() dSize := device.tun.device.BatchSize() if size < dSize { size = dSize } return size }
[ 0.3189164698123932, 0.9331072568893433, 0.5457250475883484, 1.0136277675628662, -0.6855977177619934, -0.19739609956741333, 0.3736049234867096, 0.14224202930927277, 0.1947120577096939, -1.2519919872283936, -0.367873877286911, 0.42244642972946167, -0.27419543266296387, 0.5392369627952576, ...
func closeBindLocked(device *Device) error { var err error netc := &device.net if netc.netlinkCancel != nil { netc.netlinkCancel.Cancel() } if netc.bind != nil { err = netc.bind.Close() } netc.stopping.Wait() return err }
[ 0.39268067479133606, -0.2815036475658417, 0.8501073718070984, 0.10948872566223145, -0.3898349106311798, 1.0682525634765625, 0.7502256035804749, -0.12127849459648132, 0.23012791574001312, -0.7834811806678772, 0.0290592759847641, -0.42819157242774963, -0.595607578754425, 1.3325244188308716, ...
func NewDeath(signals ...os.Signal) (death *Death) { death = &Death{timeout: 10 * time.Second, sigChannel: make(chan os.Signal, 1), callChannel: make(chan struct{}, 1), wg: &sync.WaitGroup{}, log: DefaultLogger()} signal.Notify(death.sigChannel, signals...) death.wg.Add(1) go death.listenF...
[ 0.5972487330436707, -0.43133389949798584, 0.5711871981620789, 0.6287589073181152, -0.0994744822382927, 0.30560752749443054, -0.6907750964164734, -0.809477686882019, 0.14952999353408813, -0.20515409111976624, -0.23971885442733765, 0.10398946702480316, 0.5441249012947083, 0.6885527968406677,...
func (d *Death) SetTimeout(t time.Duration) *Death { d.timeout = t return d }
[ -0.16183362901210785, 0.6147758364677429, 0.28516194224357605, 0.6242454051971436, 0.2772700786590576, 1.238708257675171, -0.24723203480243683, 0.8333547711372375, 0.046462640166282654, 0.6060162782669067, -0.16523490846157074, 0.00898069143295288, 1.5047221183776855, 0.6990938782691956, ...
func (d *Death) SetLogger(l Logger) *Death { d.log = l return d }
[ -1.5639114379882812, 0.6113760471343994, 0.27107465267181396, 0.15679286420345306, -0.2203570157289505, 0.5650774240493774, -0.45243048667907715, 0.9337362051010132, 0.5749124884605408, -0.6544490456581116, -0.633743166923523, -0.7304902076721191, 1.0653272867202759, 2.1936380863189697, ...
func (d *Death) WaitForDeath(closable ...io.Closer) (err error) { d.wg.Wait() d.log.Info("Shutdown started...") count := len(closable) d.log.Debug("Closing ", count, " objects") if count > 0 { return d.closeInMass(closable...) } return nil }
[ -0.5444918274879456, -0.40810373425483704, 0.5315991044044495, 0.10298704355955124, 0.3671039640903473, 0.2571033239364624, 0.1427135318517685, -1.2752575874328613, -0.22804374992847443, -0.1992209404706955, 0.28326699137687683, -0.7607380747795105, 0.2086261659860611, 0.8181511163711548, ...
func (d *Death) WaitForDeathWithFunc(f func()) { d.wg.Wait() d.log.Info("Shutdown started...") f() }
[ 0.4397546350955963, 0.021436508744955063, 0.48253390192985535, -0.44907012581825256, -0.01511448435485363, -0.01719231903553009, 0.33547401428222656, -0.12844233214855194, -0.48315733671188354, -0.036812279373407364, 0.1189928725361824, -0.36505866050720215, 2.5221378803253174, 0.399646371...
func getPkgPath(c io.Closer) (name string, pkgPath string) { t := reflect.TypeOf(c) if t.Kind() == reflect.Ptr { t = t.Elem() } return t.Name(), t.PkgPath() }
[ -0.23437578976154327, -0.4536501169204712, 0.6299011707305908, 0.20887713134288788, -0.902825653553009, 0.21157360076904297, 0.40794166922569275, -0.9749900102615356, -0.039254117757081985, 0.709966242313385, -0.36488857865333557, -0.3981591463088989, -0.16280797123908997, 1.31711304187774...
func (d *Death) closeInMass(closable ...io.Closer) (err error) { count := len(closable) sentToClose := make(map[int]closer) //call close async doneClosers := make(chan closer, count) for i, c := range closable { name, pkgPath := getPkgPath(c) closer := closer{Index: i, C: c, Name: name, PKGPath: pkgPath} go...
[ -0.9471321105957031, -0.5215507745742798, 0.9225094318389893, -0.15687617659568787, -0.3915574252605438, 0.24343565106391907, 0.455166220664978, -1.3724544048309326, -0.4038098454475403, 0.4902766942977905, 0.33342885971069336, 0.12771235406398773, -0.4763915538787842, 0.8068016767501831, ...
func (d *Death) closeObjects(closer closer, done chan<- closer) { err := closer.C.Close() if err != nil { d.log.Error(err) closer.Err = err } done <- closer }
[ -1.3039907217025757, -0.5726166367530823, 0.8271040320396423, -0.562311589717865, -0.3860202729701996, 0.9577910900115967, 0.5004265904426575, -1.314152717590332, -0.5989426374435425, -0.0011191406520083547, -0.2673880159854889, -0.08403413742780685, -0.038385193794965744, 0.58418995141983...
func (d *Death) FallOnSword() { select { case d.callChannel <- struct{}{}: default: } }
[ -0.23608160018920898, 0.5029120445251465, 0.3785918056964874, 0.43135306239128113, 0.785588800907135, 0.8115479946136475, -0.4389018416404724, -0.9930244088172913, -0.20870840549468994, 0.3822828233242035, 0.21274001896381378, 0.5369951128959656, -0.5745177268981934, 1.2959951162338257, ...
func (d *Death) listenForSignal() { defer d.wg.Done() for { select { case <-d.sigChannel: return case <-d.callChannel: return } } }
[ 0.2392076551914215, -0.4587858021259308, 0.399788498878479, -0.3193141520023346, 0.5195387601852417, -0.1159101203083992, -0.6137492060661316, -0.9903777837753296, 0.11778364330530167, -0.659566342830658, 0.4203386604785919, -0.29086166620254517, 0.6473129391670227, 1.1549535989761353, 0...
func generateErrString(failedClosers []closer) (errString string) { for i, fc := range failedClosers { if i == 0 { errString = fmt.Sprintf("%s/%s: %s", fc.PKGPath, fc.Name, fc.Err) continue } errString = fmt.Sprintf("%s, %s/%s: %s", errString, fc.PKGPath, fc.Name, fc.Err) } return errString }
[ -1.4104278087615967, -0.9068034887313843, 0.4549018144607544, -0.42756497859954834, -0.41703540086746216, 0.8690491318702698, -0.33852916955947876, -0.8844025135040283, -0.4417213797569275, 0.03630560263991356, 0.2155984342098236, -0.3754468262195587, -0.37817201018333435, 0.45557144284248...
func NewOCSPClient(config OCSPClientConfig) *OCSPClient { if config.HTTPClient == nil { config.HTTPClient = http.DefaultClient } if config.RetryPolicy == nil { config.RetryPolicy = DefaultBackoff.Copy() } if config.NewFutureEventAt == nil { config.NewFutureEventAt = futureevent.DefaultFactory } return &OCS...
[ 0.46541497111320496, -0.7031787633895874, 0.19805145263671875, -0.25589627027511597, -0.690890371799469, 0.0017386790132150054, -0.8895211815834045, -0.811548113822937, 0.6037247776985168, 0.14259712398052216, -0.052151862531900406, 0.042590636759996414, -0.3017157316207886, -0.48934811353...
func (c OCSPClient) Fetch(chain *certchain.RawChain, now func() time.Time) (ocspResp *certchain.OCSPResponse, nextRun futureevent.Event, err error) { retryWait := c.RetryPolicy.Duration() if c.AllowTestCert && chain.OCSPServer == "" { // The OCSP response never changes for this RawChain. Augmentor // calls Fetch...
[ 0.8243080973625183, -0.7604708075523376, 0.6005436182022095, -0.49913638830184937, -0.04422641545534134, -0.5747410655021667, -0.7347363233566284, -1.2018694877624512, 0.9975380897521973, -0.33195456862449646, -0.16264353692531586, 0.6630358099937439, 0.5650157332420349, 0.2901090085506439...
func (rc *RediCrypt) Get(ctx context.Context, name string) ([]byte, error) { key := redisKeyForName(name) rc.log("getting cert for key " + key) data := "" done := make(chan error) go func() { var err error data, err = redis.String(rc.Conn.Do("GET", key)) if err == redis.ErrNil { done <- autocert.ErrCac...
[ -0.6379081606864929, 0.19467763602733612, 0.8780360817909241, -0.058597587049007416, -0.44685283303260803, -0.9100365042686462, -1.5214860439300537, -0.5035181641578674, -0.25728917121887207, 0.96660315990448, -0.4119955003261566, 0.29274970293045044, -0.8936722874641418, -0.18774713575839...
func (rc *RediCrypt) Put(ctx context.Context, name string, data []byte) error { key := redisKeyForName(name) rc.log("writing cert for key " + key) encodedData := base64.StdEncoding.EncodeToString(data) done := make(chan error) go func() { select { case <-ctx.Done(): // Don't overwrite the file if the cont...
[ 0.008545074611902237, 0.5845558047294617, 0.5906252264976501, -0.18988168239593506, -0.2696060240268707, -0.14013247191905975, -0.4085896611213684, -0.18657776713371277, -0.6573903560638428, 0.7134756445884705, -0.4654008746147156, -0.12401022017002106, -1.1416090726852417, -0.564683675765...
func (rc *RediCrypt) Delete(ctx context.Context, name string) error { key := redisKeyForName(name) rc.log("removing cert for key " + key) done := make(chan error) go func() { _, err := rc.Conn.Do("DELETE", key) done <- err }() select { case <-ctx.Done(): return ctx.Err() case err := <-done: if err !=...
[ 0.3009675145149231, 0.8826046586036682, 0.7344852685928345, 0.3773011267185211, -0.32506459951400757, -0.48410657048225403, -0.6511653065681458, -0.5019524693489075, 0.1425793468952179, 1.4897233247756958, -0.37561002373695374, -0.6470117568969727, -1.4817315340042114, 0.1619717925786972, ...
func (rc *RediCrypt) log(input string) { if input == "" { return } output := fmt.Sprintf("redicrypt: %s", input) if rc == nil || rc.Logger == nil { fmt.Println(output) return } rc.Logger.Write([]byte(output)) }
[ -0.07820502668619156, 1.4624838829040527, 0.5126281976699829, 0.039188168942928314, -0.163047194480896, -0.09061881899833679, 0.9380785822868347, 0.09840857982635498, 0.5815402865409851, -0.08005455881357193, -0.9553767442703247, -0.02494087815284729, -0.8771573901176453, 0.723349273204803...
func RunJSONSerializationTestForProfilesEndpoint(subject ProfilesEndpoint) string { // Serialize to JSON bin, err := json.Marshal(subject) if err != nil { return err.Error() } // Deserialize back into memory var actual ProfilesEndpoint err = json.Unmarshal(bin, &actual) if err != nil { return err.Error() ...
[ -0.38930046558380127, -0.6920977830886841, 0.5411296486854553, -0.45283570885658264, -0.32048842310905457, 0.24126599729061127, 0.651418924331665, -1.5446820259094238, 0.4271974563598633, 0.34076204895973206, 0.3010786771774292, -0.028724804520606995, -0.8318859934806824, -0.21595226228237...
func ProfilesEndpointGenerator() gopter.Gen { if profilesEndpointGenerator != nil { return profilesEndpointGenerator } generators := make(map[string]gopter.Gen) AddRelatedPropertyGeneratorsForProfilesEndpoint(generators) profilesEndpointGenerator = gen.Struct(reflect.TypeOf(ProfilesEndpoint{}), generators) re...
[ -0.6805053353309631, -0.04651154577732086, 0.3826548755168915, 0.8211156725883484, -0.31561100482940674, 0.5136427879333496, -0.09353882074356079, -0.13506698608398438, 0.28481346368789673, 0.0999746024608612, 0.05755743756890297, -0.7082587480545044, -0.6706321835517883, 0.129998847842216...