text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (p PuppetParse) ReadModules(r io.Reader) ([]*Module, error) {
reader := bufio.NewReader(r)
var modules []*Module
var currentModule *Module
for {
line, err := reader.ReadString('\n')
if err == io.EOF {
break
} else if err != nil {
return nil, err
}
// start New Module
if strings.Contains(line,... | [
-0.3332955241203308,
-0.940679132938385,
0.6004538536071777,
-0.7482966780662537,
0.049905698746442795,
0.7762789726257324,
-0.1731964349746704,
-0.42461028695106506,
-0.2151365727186203,
0.9299641847610474,
0.5528871417045593,
0.6455632448196411,
-0.8929167985916138,
0.33586129546165466,
... |
func (p PuppetParse) parseValueText(s string) (string, error) {
result, err := p.parseQuotedText(s)
if err != nil {
result, err = p.parseAndValidateKeywordText(s)
}
return result, err
} | [
-0.36052241921424866,
-0.05898313224315643,
0.437724769115448,
-0.00022768491180613637,
-1.2642172574996948,
-0.4693404734134674,
-0.6320511102676392,
-0.08842437714338303,
0.7793254256248474,
0.587397575378418,
-0.07022018730640411,
0.12348028272390366,
-0.807552695274353,
0.1328260898590... |
func (p PuppetParse) parseQuotedText(s string) (string, error) {
start := strings.Index(s, "'")
end := strings.LastIndex(s, "'")
if start == -1 || end == -1 || start == end-1 {
return "", errors.New(fmt.Sprintf("Invalid TestPuppetfile, Could not parse text from line: %s", s))
}
return s[start+1 : end], nil
} | [
0.3341253101825714,
-0.4141145646572113,
0.38450950384140015,
-0.2538205087184906,
-0.9939053058624268,
-0.2907451391220093,
0.3378465175628662,
-0.24633173644542694,
0.2474621832370758,
0.4949897229671478,
-0.273879736661911,
0.3056510090827942,
-1.2206182479858398,
-0.7959831953048706,
... |
func (p PuppetParse) parseAndValidateKeywordText(s string) (string, error) {
keyword := ""
start := strings.Index(s, ":")
end := strings.LastIndex(s, " =>")
if start == -1 {
return "", errors.New(fmt.Sprintf("Invalid TestPuppetfile, Could not parse colon text from line: %s", s))
} else if end == -1 {
keyword =... | [
0.6829172968864441,
-1.1025696992874146,
0.5364293456077576,
0.10462483763694763,
-1.694103717803955,
0.6690071225166321,
-0.5070465207099915,
0.6520642638206482,
0.3203152120113373,
0.8749678730964661,
0.21336857974529266,
-0.11422599852085114,
-1.0262542963027954,
-0.151054248213768,
-... |
func NewManagementTemplateStepTenantSummary()(*ManagementTemplateStepTenantSummary) {
m := &ManagementTemplateStepTenantSummary{
Entity: *ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.NewEntity(),
}
return m
} | [
-0.5704517364501953,
-0.055792611092329025,
0.1960810124874115,
0.32201531529426575,
-0.734617292881012,
0.5491278171539307,
0.10418861359357834,
0.2749485373497009,
-0.6504300832748413,
0.9217934012413025,
-0.42084068059921265,
-0.127116858959198,
0.2231837511062622,
0.5526852011680603,
... |
func CreateManagementTemplateStepTenantSummaryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewManagementTemplateStepTenantSummary(), nil
} | [
0.27367955446243286,
0.36157944798469543,
0.28793999552726746,
0.024012835696339607,
-0.8354482650756836,
0.3901080787181854,
0.009528306312859058,
0.46172890067100525,
0.19837313890457153,
-0.0671975165605545,
0.3517847955226898,
-0.302570104598999,
0.5932652354240417,
0.7799110412597656,... |
func (m *ManagementTemplateStepTenantSummary) GetAssignedTenantsCount()(*int32) {
val, err := m.GetBackingStore().Get("assignedTenantsCount")
if err != nil {
panic(err)
}
if val != nil {
return val.(*int32)
}
return nil
} | [
-0.26090484857559204,
-0.10546617209911346,
0.0016188818262889981,
0.2097635418176651,
0.19967378675937653,
0.4651526212692261,
0.9463886022567749,
0.008914047852158546,
-0.7258844375610352,
-0.49895185232162476,
-0.1782340407371521,
0.3266611397266388,
0.21367041766643524,
0.9614772796630... |
func (m *ManagementTemplateStepTenantSummary) GetCompliantTenantsCount()(*int32) {
val, err := m.GetBackingStore().Get("compliantTenantsCount")
if err != nil {
panic(err)
}
if val != nil {
return val.(*int32)
}
return nil
} | [
0.2564074397087097,
0.33443549275398254,
0.074781134724617,
0.188006192445755,
-0.3594665229320526,
0.7160021662712097,
0.5903363823890686,
0.9535499215126038,
-0.7101966142654419,
-0.19290965795516968,
-0.20759448409080505,
-0.17835940420627594,
-0.44731149077415466,
0.04526296257972717,
... |
func (m *ManagementTemplateStepTenantSummary) GetCreatedByUserId()(*string) {
val, err := m.GetBackingStore().Get("createdByUserId")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
} | [
1.1232033967971802,
0.16848312318325043,
-0.08724049478769302,
1.183814287185669,
-0.21713489294052124,
1.2251255512237549,
0.7330217361450195,
-0.21008136868476868,
-0.6059330105781555,
-0.30838820338249207,
0.24904513359069824,
0.6663668155670166,
0.09641216695308685,
0.43730616569519043... |
func (m *ManagementTemplateStepTenantSummary) GetCreatedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {
val, err := m.GetBackingStore().Get("createdDateTime")
if err != nil {
panic(err)
}
if val != nil {
return val.(*i336074805fc853987abe6f7fe3ad97a6... | [
0.5156938433647156,
0.6863711476325989,
0.6051186323165894,
0.7154163718223572,
0.3048466444015503,
0.4474935829639435,
-0.23490287363529205,
0.49278944730758667,
-0.5514336228370667,
-0.845429003238678,
0.09083744138479233,
-0.6906864047050476,
-0.10534999519586563,
0.6678339242935181,
... |
func (m *ManagementTemplateStepTenantSummary) GetDismissedTenantsCount()(*int32) {
val, err := m.GetBackingStore().Get("dismissedTenantsCount")
if err != nil {
panic(err)
}
if val != nil {
return val.(*int32)
}
return nil
} | [
0.44869518280029297,
0.7666373252868652,
0.030515167862176895,
0.18119943141937256,
-0.06719604879617691,
0.709480881690979,
0.5098404884338379,
0.32271701097488403,
-0.4147520363330841,
-1.3469980955123901,
-0.4532276690006256,
0.445076584815979,
0.20984198153018951,
0.7972838282585144,
... |
func (m *ManagementTemplateStepTenantSummary) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := m.Entity.GetFieldDeserializers()
res["assignedTenantsCount"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be145220... | [
0.2154524326324463,
0.41158828139305115,
0.6745155453681946,
-0.8233078122138977,
-0.2610796391963959,
-0.22501389682292938,
0.4502105414867401,
0.04585836082696915,
-1.2269898653030396,
-0.6808271408081055,
-0.6485323309898376,
-0.024509305134415627,
-0.6394014358520508,
0.574348509311676... |
func (m *ManagementTemplateStepTenantSummary) GetIneligibleTenantsCount()(*int32) {
val, err := m.GetBackingStore().Get("ineligibleTenantsCount")
if err != nil {
panic(err)
}
if val != nil {
return val.(*int32)
}
return nil
} | [
0.01386809628456831,
0.22371292114257812,
0.1252768188714981,
-0.20586884021759033,
-0.33418548107147217,
0.613818883895874,
0.11120259761810303,
0.7409029006958008,
-0.7487905621528625,
-0.2350742220878601,
-0.3895335793495178,
0.4020382761955261,
-1.17572021484375,
-0.048585809767246246,... |
func (m *ManagementTemplateStepTenantSummary) GetLastActionByUserId()(*string) {
val, err := m.GetBackingStore().Get("lastActionByUserId")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
} | [
0.7137112617492676,
-0.19616034626960754,
0.4204346835613251,
1.134151816368103,
-0.15697751939296722,
0.2912573218345642,
0.8093448877334595,
-0.8300745487213135,
0.4985039532184601,
0.08832836151123047,
0.3921017646789551,
0.34117841720581055,
-0.2143036127090454,
0.6984536647796631,
-... |
func (m *ManagementTemplateStepTenantSummary) GetLastActionDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {
val, err := m.GetBackingStore().Get("lastActionDateTime")
if err != nil {
panic(err)
}
if val != nil {
return val.(*i336074805fc853987abe6f7fe3... | [
0.2052146941423416,
0.2916565537452698,
0.7098621726036072,
-0.49076080322265625,
0.27048155665397644,
-0.16594572365283966,
0.33638179302215576,
0.30978694558143616,
0.45687752962112427,
0.03395479544997215,
0.2974117398262024,
-0.6512144207954407,
-0.12085676938295364,
0.2364800125360489... |
func (m *ManagementTemplateStepTenantSummary) GetManagementTemplateCollectionDisplayName()(*string) {
val, err := m.GetBackingStore().Get("managementTemplateCollectionDisplayName")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
} | [
0.36646372079849243,
-0.042419467121362686,
0.5458399653434753,
0.7058292627334595,
-0.45914795994758606,
0.4168381989002228,
0.3095735013484955,
-0.5558837652206421,
-0.23698122799396515,
0.20063666999340057,
0.04495489224791527,
-0.21549126505851746,
0.07395141571760178,
0.29394021630287... |
func (m *ManagementTemplateStepTenantSummary) GetManagementTemplateCollectionId()(*string) {
val, err := m.GetBackingStore().Get("managementTemplateCollectionId")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
} | [
0.37036100029945374,
0.3752751648426056,
0.21574681997299194,
0.7252516150474548,
-0.11579843610525131,
0.8233678340911865,
0.2184412032365799,
-0.37619930505752563,
0.49958565831184387,
0.07014235109090805,
0.09735580533742905,
0.2973615527153015,
0.06846736371517181,
0.7428281307220459,
... |
func (m *ManagementTemplateStepTenantSummary) GetManagementTemplateDisplayName()(*string) {
val, err := m.GetBackingStore().Get("managementTemplateDisplayName")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
} | [
0.4058998227119446,
-0.03037724643945694,
0.3350764513015747,
0.6406565308570862,
-0.8502333164215088,
0.4782143533229828,
0.018285535275936127,
-0.21363843977451324,
-0.0015232801670208573,
0.5369963645935059,
0.28628045320510864,
-0.46389228105545044,
-0.1631498485803604,
-0.209768638014... |
func (m *ManagementTemplateStepTenantSummary) GetManagementTemplateId()(*string) {
val, err := m.GetBackingStore().Get("managementTemplateId")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
} | [
0.7095468044281006,
0.3833794593811035,
-0.1710251420736313,
0.9380074143409729,
-0.24614712595939636,
0.7619185447692871,
-0.37238356471061707,
0.1636933982372284,
0.7211570739746094,
0.5141143202781677,
0.2893208861351013,
-0.22353655099868774,
-0.2244492918252945,
0.31417837738990784,
... |
func (m *ManagementTemplateStepTenantSummary) GetManagementTemplateStepDisplayName()(*string) {
val, err := m.GetBackingStore().Get("managementTemplateStepDisplayName")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
} | [
0.16223639249801636,
-0.12819650769233704,
0.30102869868278503,
0.6454307436943054,
-0.6204448938369751,
0.5208896994590759,
0.28532886505126953,
-0.34892141819000244,
-0.17896699905395508,
0.287826269865036,
0.16698862612247467,
-0.5761958956718445,
0.1457149237394333,
0.12874218821525574... |
func (m *ManagementTemplateStepTenantSummary) GetManagementTemplateStepId()(*string) {
val, err := m.GetBackingStore().Get("managementTemplateStepId")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
} | [
0.42728278040885925,
0.37230852246284485,
0.08812317997217178,
0.6893182396888733,
-0.13607832789421082,
0.7652052044868469,
-0.2519245743751526,
-0.23611687123775482,
0.4080709218978882,
0.1011248454451561,
-0.04247717931866646,
-0.23023732006549835,
-0.027516452595591545,
0.2937071919441... |
func (m *ManagementTemplateStepTenantSummary) GetNotCompliantTenantsCount()(*int32) {
val, err := m.GetBackingStore().Get("notCompliantTenantsCount")
if err != nil {
panic(err)
}
if val != nil {
return val.(*int32)
}
return nil
} | [
-0.2879600524902344,
0.3159795105457306,
-0.11513566225767136,
0.07115764915943146,
-0.07385531812906265,
0.7562130093574524,
0.2612893879413605,
0.5982918739318848,
-1.0624480247497559,
-0.12496643513441086,
0.0047075278125703335,
-0.27812832593917847,
-0.6971994638442993,
0.3045265674591... |
func (m *ManagementTemplateStepTenantSummary) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
err := m.Entity.Serialize(writer)
if err != nil {
return err
}
{
err = writer.WriteInt32Value("assignedTenantsCount", m.GetAssign... | [
0.10053873062133789,
-0.09985869377851486,
0.7364532947540283,
0.034752700477838516,
-0.13697044551372528,
0.02088926173746586,
0.8348164558410645,
-0.14484328031539917,
-0.6448915600776672,
0.06016092002391815,
-0.40545883774757385,
0.00329962489195168,
-0.08751425892114639,
0.88705688714... |
func (m *ManagementTemplateStepTenantSummary) SetAssignedTenantsCount(value *int32)() {
err := m.GetBackingStore().Set("assignedTenantsCount", value)
if err != nil {
panic(err)
}
} | [
-0.590143620967865,
-0.20400194823741913,
0.046501390635967255,
0.055632997304201126,
0.10201520472764969,
0.45923489332199097,
0.8776254653930664,
-0.397656112909317,
-1.0625125169754028,
-0.13770750164985657,
-0.4081181585788727,
-0.32569268345832825,
0.6755894422531128,
1.41553795337677... |
func (m *ManagementTemplateStepTenantSummary) SetCompliantTenantsCount(value *int32)() {
err := m.GetBackingStore().Set("compliantTenantsCount", value)
if err != nil {
panic(err)
}
} | [
-0.02971455082297325,
0.3109242022037506,
0.08062608540058136,
-0.04442137852311134,
-0.7045795917510986,
0.8226735591888428,
0.4890105426311493,
0.6994701623916626,
-0.9806245565414429,
-0.061954300850629807,
-0.48957353830337524,
-0.8254044055938721,
-0.1532367318868637,
0.49680432677268... |
func (m *ManagementTemplateStepTenantSummary) SetCreatedByUserId(value *string)() {
err := m.GetBackingStore().Set("createdByUserId", value)
if err != nil {
panic(err)
}
} | [
0.7757911086082458,
0.10027240216732025,
-0.27891266345977783,
0.9855780005455017,
-0.08178514242172241,
1.3416579961776733,
1.135486364364624,
-0.11125514656305313,
-1.1564468145370483,
-0.022326743230223656,
-0.17361770570278168,
0.2540932297706604,
0.18734459578990936,
0.671448111534118... |
func (m *ManagementTemplateStepTenantSummary) SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {
err := m.GetBackingStore().Set("createdDateTime", value)
if err != nil {
panic(err)
}
} | [
-0.012523801065981388,
0.6607195734977722,
0.1562618762254715,
0.6503078937530518,
-0.00326084578409791,
1.003312110900879,
0.18951785564422607,
0.3308144211769104,
-0.874426007270813,
-0.42253920435905457,
-0.46109771728515625,
-1.1578898429870605,
0.2133462131023407,
1.0376304388046265,
... |
func (m *ManagementTemplateStepTenantSummary) SetDismissedTenantsCount(value *int32)() {
err := m.GetBackingStore().Set("dismissedTenantsCount", value)
if err != nil {
panic(err)
}
} | [
0.008340605534613132,
0.7112869620323181,
0.062232520431280136,
0.012377528473734856,
-0.3258896768093109,
0.8738662004470825,
0.6518474221229553,
-0.02375216968357563,
-0.559752881526947,
-1.1359624862670898,
-0.7007990479469299,
-0.23108451068401337,
0.6551974415779114,
1.039617776870727... |
func (m *ManagementTemplateStepTenantSummary) SetIneligibleTenantsCount(value *int32)() {
err := m.GetBackingStore().Set("ineligibleTenantsCount", value)
if err != nil {
panic(err)
}
} | [
-0.3557489514350891,
0.16175565123558044,
0.19604401290416718,
-0.48730218410491943,
-0.5675885677337646,
0.606005072593689,
-0.017894528806209564,
0.43878889083862305,
-0.8897897601127625,
-0.035871051251888275,
-0.6668862104415894,
-0.1379258632659912,
-0.901360273361206,
0.3021709322929... |
func (m *ManagementTemplateStepTenantSummary) SetLastActionByUserId(value *string)() {
err := m.GetBackingStore().Set("lastActionByUserId", value)
if err != nil {
panic(err)
}
} | [
0.38815656304359436,
-0.39877116680145264,
0.18700048327445984,
1.033281922340393,
-0.09743645042181015,
0.20647750794887543,
1.0219486951828003,
-0.584453821182251,
0.2234990894794464,
0.3965342342853546,
0.1346742808818817,
0.04877696558833122,
-0.12290392071008682,
0.8057278394699097,
... |
func (m *ManagementTemplateStepTenantSummary) SetLastActionDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {
err := m.GetBackingStore().Set("lastActionDateTime", value)
if err != nil {
panic(err)
}
} | [
-0.2041219025850296,
-0.09543302655220032,
0.35185083746910095,
-0.3407762348651886,
0.09590768069028854,
-0.05454796925187111,
0.6459907293319702,
0.18177950382232666,
0.5782283544540405,
0.20970295369625092,
-0.1819784790277481,
-1.0421240329742432,
0.24052968621253967,
0.353508949279785... |
func (m *ManagementTemplateStepTenantSummary) SetManagementTemplateCollectionDisplayName(value *string)() {
err := m.GetBackingStore().Set("managementTemplateCollectionDisplayName", value)
if err != nil {
panic(err)
}
} | [
0.10043974965810776,
-0.17706134915351868,
0.2898864150047302,
0.6104609370231628,
-0.49760594964027405,
0.442211389541626,
0.34419092535972595,
-0.4612366259098053,
-0.68662428855896,
0.38570544123649597,
-0.3908524811267853,
-0.4704796075820923,
0.3036839962005615,
0.3963538706302643,
... |
func (m *ManagementTemplateStepTenantSummary) SetManagementTemplateCollectionId(value *string)() {
err := m.GetBackingStore().Set("managementTemplateCollectionId", value)
if err != nil {
panic(err)
}
} | [
-0.13165800273418427,
0.15438111126422882,
0.18765920400619507,
0.5447984337806702,
-0.18697234988212585,
0.7825005650520325,
0.30052852630615234,
-0.3213936388492584,
-0.15085969865322113,
0.4327954351902008,
-0.1505933552980423,
0.029409894719719887,
0.26127633452415466,
0.89742124080657... |
func (m *ManagementTemplateStepTenantSummary) SetManagementTemplateDisplayName(value *string)() {
err := m.GetBackingStore().Set("managementTemplateDisplayName", value)
if err != nil {
panic(err)
}
} | [
0.1349489688873291,
-0.2541956901550293,
0.20446151494979858,
0.5086944699287415,
-1.0990378856658936,
0.4945206940174103,
0.21487684547901154,
-0.2514575719833374,
-0.30464935302734375,
0.7304257750511169,
-0.14061681926250458,
-0.8835790157318115,
0.02976326085627079,
-0.1695096045732498... |
func (m *ManagementTemplateStepTenantSummary) SetManagementTemplateId(value *string)() {
err := m.GetBackingStore().Set("managementTemplateId", value)
if err != nil {
panic(err)
}
} | [
0.3667859733104706,
0.10165216028690338,
-0.13990792632102966,
0.5331180095672607,
-0.4994436204433441,
0.7654897570610046,
-0.26978591084480286,
0.08537308126688004,
0.21036505699157715,
0.9678768515586853,
-0.16195841133594513,
-0.823012113571167,
-0.1250227987766266,
0.5111917853355408,... |
func (m *ManagementTemplateStepTenantSummary) SetManagementTemplateStepDisplayName(value *string)() {
err := m.GetBackingStore().Set("managementTemplateStepDisplayName", value)
if err != nil {
panic(err)
}
} | [
-0.1636425405740738,
-0.3175475001335144,
0.1431855708360672,
0.4912755489349365,
-0.8625898361206055,
0.6011239290237427,
0.5068594217300415,
-0.5523099303245544,
-0.5506076812744141,
0.4227695167064667,
-0.2677856981754303,
-0.8131491541862488,
0.5479922294616699,
0.3135630488395691,
-... |
func (m *ManagementTemplateStepTenantSummary) SetManagementTemplateStepId(value *string)() {
err := m.GetBackingStore().Set("managementTemplateStepId", value)
if err != nil {
panic(err)
}
} | [
0.05205309018492699,
0.05102642625570297,
0.0887485221028328,
0.4340604245662689,
-0.3474952280521393,
0.8420273065567017,
-0.11734329909086227,
-0.37126266956329346,
-0.027677444741129875,
0.3680429458618164,
-0.30628031492233276,
-0.5542951822280884,
0.23851899802684784,
0.55582964420318... |
func (m *ManagementTemplateStepTenantSummary) SetNotCompliantTenantsCount(value *int32)() {
err := m.GetBackingStore().Set("notCompliantTenantsCount", value)
if err != nil {
panic(err)
}
} | [
-0.6212061047554016,
0.30594602227211,
-0.09115292131900787,
-0.18775372207164764,
-0.20427127182483673,
0.7826359868049622,
0.24466519057750702,
0.23849233984947205,
-1.283051609992981,
0.12689091265201569,
-0.2719555199146271,
-0.7842483520507812,
-0.5409021973609924,
0.6693916320800781,... |
func (d *DefaultLabelStrategy) LabelNames(p *protocol.Protocol) []string {
res := []string{"name", "proto", "ip_version", "import_filter", "export_filter"}
if d.descriptionLabels && p.Description != "" {
res = append(res, labelKeysFromDescription(p.Description)...)
}
return res
} | [
-1.1042832136154175,
0.018261414021253586,
0.3208226263523102,
-0.6324875950813293,
0.17568637430667877,
0.4225117564201355,
-1.3619250059127808,
-0.3301919400691986,
-0.15503829717636108,
1.0643929243087769,
0.019752325490117073,
0.30433493852615356,
-0.28095000982284546,
0.46977287530899... |
func (d *DefaultLabelStrategy) LabelValues(p *protocol.Protocol) []string {
res := []string{p.Name, protoString(p), p.IPVersion, p.ImportFilter, p.ExportFilter}
if d.descriptionLabels && p.Description != "" {
res = append(res, labelValuesFromDescription(p.Description)...)
}
return res
} | [
-0.4469146132469177,
-0.13267119228839874,
0.34850093722343445,
-0.5616783499717712,
0.49821409583091736,
0.6805860996246338,
-1.5201504230499268,
0.2489500641822815,
-0.4105309844017029,
0.3076409697532654,
0.5199441313743591,
0.13340622186660767,
-0.5591169595718384,
1.3282289505004883,
... |
func New() *Manifest {
return &Manifest{
StartURL: "/",
Display: "standalone",
Language: "en",
ShortName: "Untitled",
}
} | [
0.2977103590965271,
-1.5207538604736328,
0.12847790122032166,
0.12169231474399567,
-1.5631929636001587,
0.09484168887138367,
-0.7117996215820312,
0.8608690500259399,
0.07536321133375168,
-1.0243289470672607,
-0.31899338960647583,
0.7866439819335938,
1.075065016746521,
0.6429667472839355,
... |
func FromFile(fileName string) (*Manifest, error) {
// Open the file
file, err := os.Open(fileName)
if err != nil {
return nil, err
}
defer file.Close()
// Decode JSON
webManifest := New()
decoder := jsoniter.NewDecoder(file)
err = decoder.Decode(webManifest)
if err != nil {
return nil, err
}
retur... | [
0.3516373336315155,
-0.9550962448120117,
0.4828959107398987,
-0.40459877252578735,
-1.6170458793640137,
0.19889871776103973,
-0.4837445616722107,
0.5557889938354492,
-0.005067930556833744,
-0.22819110751152039,
-0.41396236419677734,
0.23393820226192474,
-0.10117948055267334,
0.006484694778... |
func NewMongoDB(config *Config) *MongoDB {
m := MongoDB{config: *config}
var err error
tries := 0
for tries < 10 {
time.Sleep(time.Duration(tries) * time.Second) // increasing some time between tries
err = m.connect()
if err == nil {
break
}
log.Println(err)
tries++
log.Println( "retrying database ... | [
-0.0934491902589798,
0.05127347633242607,
0.6268583536148071,
0.6404667496681213,
0.3115474283695221,
0.5029520392417908,
-0.6222031116485596,
-0.33976423740386963,
-0.059667155146598816,
0.6771167516708374,
0.1692606508731842,
0.03557034209370613,
-1.3182135820388794,
0.4783456027507782,
... |
func TestMongoDBConnection(config *Config) error {
m := MongoDB{config: *config}
var err error
err = m.connect()
defer m.Close()
if err != nil {
log.Println(err)
}
return err
} | [
0.24172431230545044,
0.06339596956968307,
0.4455093741416931,
0.6471979022026062,
0.37288030982017517,
0.45437777042388916,
0.5651658177375793,
0.45175594091415405,
0.05120382085442543,
-0.10700399428606033,
-0.05563880130648613,
-0.07916571944952011,
-1.5518501996994019,
0.526021361351013... |
func (m *MongoDB) connect() error {
var url string
if m.config.GetUser() != "" {
url = m.config.GetUser()
}
if m.config.GetPassword() != "" {
url += ":" + m.config.GetPassword()
}
if m.config.GetUser() != "" || m.config.GetPassword() != "" {
url += "@"
}
url += m.config.GetHost() + ":" + strconv.Itoa(m.co... | [
-0.8826532363891602,
-0.23463600873947144,
0.8114697933197021,
0.9852707982063293,
-0.31153231859207153,
0.6411631107330322,
-0.6552601456642151,
-0.1699822098016739,
-0.4498778283596039,
0.841951310634613,
-0.08148153871297836,
-0.1623881459236145,
-0.5728799700737,
0.6881372928619385,
... |
func (m *MongoDB) C(name string) *mgo.Collection {
return m.db.C(name)
} | [
0.18387016654014587,
-0.33459633588790894,
0.4445021450519562,
-0.312347948551178,
-0.5833548903465271,
0.623013436794281,
0.2147635817527771,
-0.6373351812362671,
-0.4663770794868469,
-0.05155333876609802,
-0.2884746491909027,
-0.1401553750038147,
0.39970800280570984,
0.5091685652732849,
... |
func (m *MongoDB) GetCollection(name string) *mgo.Collection {
return m.db.C(name)
} | [
0.4967736601829529,
0.08788491040468216,
0.3641930818557739,
0.1646544337272644,
0.24615566432476044,
-0.3349741995334625,
-0.1784793734550476,
-0.6196059584617615,
-0.15239718556404114,
0.154638409614563,
-0.23974758386611938,
0.06330166757106781,
-0.046519555151462555,
0.9193626642227173... |
func (m *MongoDB) Copy() *MongoDB {
db := mgo.Database{Session: m.db.Session.Copy(), Name: m.db.Name }
return &MongoDB{config: m.config, db: &db}
} | [
-0.3777008652687073,
-0.4946650564670563,
0.37066468596458435,
0.7960078716278076,
-1.5257115364074707,
1.4754548072814941,
-0.21105723083019257,
-0.6690307855606079,
0.8196051716804504,
1.3901381492614746,
0.08976469188928604,
0.23221631348133087,
-1.1633996963500977,
0.31521156430244446,... |
func (m *MongoDB) Close() {
m.db.Session.Close()
} | [
-0.2611842155456543,
-0.26560357213020325,
0.20619656145572662,
0.6198782920837402,
0.19143597781658173,
0.5811293125152588,
-0.20664265751838684,
-0.9196509122848511,
0.5324538350105286,
0.04442538321018219,
0.5303259491920471,
0.15163865685462952,
-1.5015863180160522,
1.189196228981018,
... |
func CPP14LexerInit() {
staticData := &CPP14LexerLexerStaticData
staticData.once.Do(cpp14lexerLexerInit)
} | [
1.408840298652649,
-0.8435409665107727,
0.36409470438957214,
-0.8905641436576843,
0.010353608056902885,
-0.40031322836875916,
-0.5836750268936157,
1.144505262374878,
-0.6280869245529175,
-0.7975177764892578,
-0.7097242474555969,
-0.1830863058567047,
0.09445912390947342,
0.1657380610704422,... |
func NewCPP14Lexer(input antlr.CharStream) *CPP14Lexer {
CPP14LexerInit()
l := new(CPP14Lexer)
l.BaseLexer = antlr.NewBaseLexer(input)
staticData := &CPP14LexerLexerStaticData
l.Interpreter = antlr.NewLexerATNSimulator(l, staticData.atn, staticData.decisionToDFA, staticData.PredictionContextCache)
l.channelNames ... | [
0.7119919657707214,
-1.3913122415542603,
0.15394915640354156,
-0.7392849922180176,
-1.0666276216506958,
-0.4176815152168274,
-0.7826225161552429,
0.1997736692428589,
-0.28479987382888794,
-0.262469083070755,
-0.17848917841911316,
0.4853835999965668,
0.26458755135536194,
1.0499986410140991,... |
func NewContainer() *Container {
return &Container{
Accessories: make([]*Accessory, 0),
idCount: 1,
}
} | [
0.01855720952153206,
-0.37706923484802246,
0.32094764709472656,
0.5063009858131409,
-0.5528640747070312,
-0.6615515947341919,
1.0878775119781494,
-0.7149893641471863,
0.5958887338638306,
-1.1114305257797241,
-0.07858544588088989,
0.4618978202342987,
0.7148508429527283,
0.9033827781677246,
... |
func (m *Container) AddAccessory(a *Accessory) {
a.SetID(m.idCount)
m.idCount++
m.Accessories = append(m.Accessories, a)
} | [
-1.1345969438552856,
-0.1273026317358017,
0.7010624408721924,
0.014928626827895641,
0.19910882413387299,
-0.7859371304512024,
0.642390251159668,
-0.3092437982559204,
0.9774630665779114,
-0.769934356212616,
0.1082385778427124,
0.4832714796066284,
0.5067151784896851,
1.0786982774734497,
0.... |
func (m *Container) RemoveAccessory(a *Accessory) {
for i, accessory := range m.Accessories {
if accessory == a {
m.Accessories = append(m.Accessories[:i], m.Accessories[i+1:]...)
}
}
} | [
-0.9495179653167725,
-0.4081566631793976,
0.6474674344062805,
-0.35807594656944275,
-0.9134020209312439,
-1.5240358114242554,
1.1030131578445435,
0.16847653687000275,
0.8674420714378357,
0.903996467590332,
0.3483734726905823,
0.6960275173187256,
0.4786647856235504,
0.4941295385360718,
0.... |
func (m *Container) Equal(other interface{}) bool {
if container, ok := other.(*Container); ok == true {
if len(m.Accessories) != len(container.Accessories) {
return false
}
for i, a := range m.Accessories {
if a.Equal(container.Accessories[i]) == false {
return false
}
}
return true
}
retur... | [
-0.6253721714019775,
0.14785657823085785,
0.8619621396064758,
0.6858952641487122,
0.35051020979881287,
-0.46644672751426697,
0.6988321542739868,
-1.2067070007324219,
0.09871736913919449,
0.6118854880332947,
-0.2433556765317917,
0.38916879892349243,
0.059044986963272095,
1.028600811958313,
... |
func (m *Container) AccessoryType() AccessoryType {
if as := m.Accessories; len(as) > 0 {
if len(as) > 1 {
return TypeBridge
}
return as[0].Type
}
return TypeOther
} | [
0.7241942286491394,
0.5607206225395203,
0.7222638130187988,
1.3645349740982056,
1.2550597190856934,
-0.5975340008735657,
0.8644251227378845,
-1.168708324432373,
1.3793306350708008,
0.3321601152420044,
1.1053777933120728,
0.4491272568702698,
-0.3209163546562195,
1.0164437294006348,
0.7623... |
func (o *seleccionar) Tabla(tabla string) *seleccionar {
if o.senSQLExiste {
return o
}
o.tabla = tabla
return o
} | [
0.4508625268936157,
-0.07522588223218918,
0.2804257571697235,
0.8881339430809021,
0.1366761177778244,
-0.3822281062602997,
0.5800151228904724,
-0.9550379514694214,
1.35666024684906,
-0.3798567056655884,
0.10463590919971466,
0.07967864722013474,
0.388359397649765,
-0.8443973064422607,
-0.... |
func (o *seleccionar) Campos(campos ...string) *seleccionar {
o.campos = campos
return o
} | [
-0.43503955006599426,
-0.4135735034942627,
0.0021644849330186844,
0.22942307591438293,
0.819850504398346,
0.49531981348991394,
0.19205725193023682,
-0.25785109400749207,
0.6470814347267151,
-1.25977623462677,
-0.4773886203765869,
-0.642956018447876,
0.05378035828471184,
-0.3749777376651764... |
func (o *seleccionar) SQL() (string, error) {
return o.generarSQL()
} | [
-0.07144389301538467,
-0.6432217359542847,
0.2803913950920105,
1.520341396331787,
-0.7308878898620605,
-0.31949323415756226,
-1.0807832479476929,
-0.794973611831665,
0.6458610892295837,
-0.4756920039653778,
0.34647050499916077,
0.6220024824142456,
0.529322624206543,
-0.6346637010574341,
... |
func (o *seleccionar) Ejecutar() (int, error) {
var sentencia, err = o.generarSQL()
if err != nil {
return 0, err
}
// validar que el objeto de resultado, sea un puntero de slice de estructura
if ok := reflect.TypeOf(o.objeto).Kind() == reflect.Ptr && reflect.TypeOf(o.objeto).Elem().Kind() == reflect.Sli... | [
-0.9166445732116699,
-0.4055272042751312,
0.9969118237495422,
-0.16829881072044373,
-0.19271692633628845,
-0.16858738660812378,
0.5412366390228271,
-0.26369917392730713,
-0.2899075746536255,
0.8572061657905579,
-0.0241633839905262,
0.15154609084129333,
-0.6056209802627563,
0.56558632850646... |
func (e OpcuaNodeIdServicesVariableShelved) PLC4XEnumName() string {
switch e {
case OpcuaNodeIdServicesVariableShelved_ShelvedStateMachineType_UnshelvedToTimedShelved_TransitionNumber:
return "ShelvedStateMachineType_UnshelvedToTimedShelved_TransitionNumber"
case OpcuaNodeIdServicesVariableShelved_ShelvedStateMac... | [
0.49241140484809875,
-0.22210560739040375,
0.797837495803833,
-1.4238715171813965,
-0.34179696440696716,
0.11590675264596939,
-0.3365871012210846,
-0.1693255603313446,
0.18445175886154175,
0.24940899014472961,
-0.6562937498092651,
0.21849441528320312,
0.2241646945476532,
0.451177179813385,... |
func GetOrCreate(client routeclient.RoutesGetter, required *routev1.Route) (*routev1.Route, bool, error) {
isNew := false
route, err := client.Routes(required.Namespace).Get(required.Name, metav1.GetOptions{})
if apierrors.IsNotFound(err) {
isNew = true
route, err = client.Routes(required.Namespace).Create(requi... | [
-0.5771906971931458,
0.37242069840431213,
0.6813009977340698,
-0.5709223747253418,
0.883589506149292,
0.22367361187934875,
-1.2325938940048218,
-0.4268597364425659,
-0.2267393171787262,
0.02103530429303646,
0.4605184495449066,
0.333506315946579,
-0.4153105616569519,
0.150160014629364,
0.... |
func Validate(route *routev1.Route) (*routev1.Route, bool) {
changed := false
if toServiceSame := equality.Semantic.DeepEqual(route.Spec.To, toService()); !toServiceSame {
changed = true
route.Spec.To = toService()
}
if portSame := equality.Semantic.DeepEqual(route.Spec.Port, port()); !portSame {
changed = ... | [
-0.9805314540863037,
0.033702507615089417,
0.649476945400238,
-0.9046875834465027,
-0.014353289268910885,
0.46733707189559937,
-0.15403249859809875,
0.0637219250202179,
-0.0632084310054779,
0.2526995539665222,
0.025183964520692825,
0.6339960098266602,
0.30935463309288025,
0.802756607532501... |
func IsAdmitted(route *routev1.Route) bool {
for _, ingress := range route.Status.Ingress {
if isIngressAdmitted(ingress) {
return true
}
}
return false
} | [
-0.5388181209564209,
-0.49973198771476746,
0.4584839344024658,
-0.1060757115483284,
0.7216958999633789,
0.14014208316802979,
-0.5980044603347778,
0.7303565144538879,
0.8122607469558716,
0.7649354934692383,
0.4573163688182831,
0.9932044744491577,
-0.7400087714195251,
1.0704981088638306,
-... |
func (suite *applyTestSuite) SetupTest() {
suite.col1 = series.NewSeries("col1", 12, 34, 54, 65, 90)
suite.col2 = series.NewSeries("col2", 54.31, 1.23, 45.6, 23.12, 23.2)
suite.col3 = series.NewSeries("col3", 14, 124.23, 32, 64.65, 34)
suite.df = NewDataFrame(suite.col1, suite.col2, suite.col3)
suite.err = errors.... | [
-0.11975353956222534,
0.598318874835968,
0.7658331394195557,
0.5909500122070312,
0.3981124460697174,
-0.2203642725944519,
1.0802873373031616,
-0.13075363636016846,
-0.46263107657432556,
-0.6004896759986877,
0.5082209706306458,
-0.042007606476545334,
-0.27268534898757935,
0.2486820518970489... |
func (plugin *flexProvisioner) NewDriverCall(execPath, command string) *DriverCall {
return plugin.NewDriverCallWithTimeout(execPath, command, 0)
} | [
-0.2216748297214508,
-0.645479679107666,
0.6074169874191284,
0.7523312568664551,
-0.23234958946704865,
-0.18414878845214844,
-0.3877416253089905,
0.054770372807979584,
0.13033823668956757,
0.6601221561431885,
0.29744845628738403,
0.39195486903190613,
-0.4086044430732727,
0.3927843570709228... |
func (plugin *flexProvisioner) NewDriverCallWithTimeout(execPath, command string, timeout time.Duration) *DriverCall {
return &DriverCall{
Execpath: execPath,
Command: command,
Timeout: timeout,
plugin: plugin,
args: []string{command},
}
} | [
0.201704204082489,
-1.0027810335159302,
0.6446143388748169,
0.35401901602745056,
-0.5703660249710083,
-0.05320592597126961,
-1.232695460319519,
0.1799662560224533,
0.2772313952445984,
0.7048900723457336,
0.18651916086673737,
0.19980627298355103,
-0.46983057260513306,
0.2471342533826828,
... |
func (dc *DriverCall) Append(arg string) {
dc.args = append(dc.args, arg)
} | [
-0.5273385643959045,
0.7022229433059692,
0.22643600404262543,
-0.8929733037948608,
0.20609956979751587,
0.4118933081626892,
-0.8978497982025146,
0.3839513063430786,
0.44882333278656006,
-0.021657904610037804,
-0.12186229974031448,
0.4418547451496124,
-0.41423189640045166,
1.490084886550903... |
func (dc *DriverCall) AppendSpec(options interface{}) error {
jsonBytes, err := json.Marshal(options)
if err != nil {
return fmt.Errorf("Failed to marshal spec, error: %s", err.Error())
}
dc.Append(string(jsonBytes))
return nil
} | [
-0.022613899782299995,
0.6981812715530396,
0.6302854418754578,
-0.6327438354492188,
0.16188712418079376,
0.11270219832658768,
-1.3621211051940918,
-0.16271452605724335,
0.38459646701812744,
0.38680070638656616,
0.007850931026041508,
0.1949036866426468,
0.004803376272320747,
0.6644777059555... |
func (dc *DriverCall) Run() (*DriverStatus, error) {
cmd := dc.plugin.runner.Command(dc.Execpath, dc.args...)
timeout := false
if dc.Timeout > 0 {
timer := time.AfterFunc(dc.Timeout, func() {
timeout = true
cmd.Stop()
})
defer timer.Stop()
}
output, execErr := cmd.CombinedOutput()
if execErr != nil ... | [
-0.6548329591751099,
-0.6083427667617798,
0.9671845436096191,
0.18424580991268158,
0.38664186000823975,
-0.7870806455612183,
-0.12169846147298813,
0.21746420860290527,
-0.2793804109096527,
-0.19952552020549774,
-0.47268146276474,
-0.7068040370941162,
-0.7683119773864746,
0.5980032682418823... |
func handleCmdResponse(cmd string, output []byte) (*DriverStatus, error) {
status := &DriverStatus{
Volume: v1.PersistentVolume{
ObjectMeta: metav1.ObjectMeta{
Annotations: map[string]string{},
Labels: map[string]string{},
}}}
if err := json.Unmarshal(output, status); err != nil {
glog.Errorf("... | [
-0.057489484548568726,
-1.1710463762283325,
0.8168713450431824,
-0.4917546510696411,
-0.5072615146636963,
-0.7504134178161621,
-0.07443655282258987,
0.17967939376831055,
0.21652014553546906,
-0.12276287376880646,
0.0682772547006607,
-1.502526879310608,
-0.8165585994720459,
-0.0528277605772... |
func NewBlobEntry(dataHint, data []byte) BlobEntry {
return BlobEntry{
Digest: hex.EncodeToString(util.Digest(data)),
DataHint: base64.StdEncoding.EncodeToString(dataHint),
Data: base64.StdEncoding.EncodeToString(data),
}
} | [
1.3322341442108154,
-1.0659197568893433,
0.3802088797092438,
-0.40575289726257324,
0.024182545021176338,
0.030114086344838142,
-1.781525731086731,
-0.2514137923717499,
0.18376174569129944,
0.48323625326156616,
-0.6004633903503418,
1.0374332666397095,
-0.4955376088619232,
0.3399022221565246... |
func Blobify(be BlobEntry) ([]byte, error) {
var b bytes.Buffer
zw := gzip.NewWriter(&b)
enc := gob.NewEncoder(zw)
err := enc.Encode(be)
if err != nil {
zw.Close()
return nil, err
}
err = zw.Close() // we must flush gzip buffers
if err != nil {
return nil, err
}
return b.Bytes(), nil
} | [
1.0286377668380737,
-0.33750051259994507,
0.7439870238304138,
0.5568633675575256,
0.6134052872657776,
-0.20429107546806335,
-1.0048160552978516,
-0.6606137752532959,
-0.2746201157569885,
1.1740442514419556,
-1.1445900201797485,
0.8029963374137878,
-1.2398720979690552,
-0.009346411563456059... |
func Deblob(blob []byte) (*BlobEntry, error) {
zr, err := gzip.NewReader(bytes.NewReader(blob))
if err != nil {
return nil, err
}
r := gob.NewDecoder(zr)
var be BlobEntry
err = r.Decode(&be)
if err != nil {
zr.Close()
return nil, err
}
err = zr.Close()
if err != nil {
return nil, err
}
return &be, n... | [
1.028244972229004,
-0.2850402891635895,
0.6071617603302002,
0.024427874013781548,
0.07729937881231308,
-0.10880210250616074,
-0.627100944519043,
-0.01523707527667284,
0.6240940093994141,
0.6348627805709839,
-0.7002331614494324,
0.20432226359844208,
-1.0016361474990845,
-0.33203125,
0.473... |
func NewSkipList() *SkipList {
return &SkipList{
Node: Node{next: make([]*Element, maxLevel)},
prevNodesCache: make([]*Node, maxLevel),
maxLevel: maxLevel,
randSource: rand.New(rand.NewSource(time.Now().UnixNano())),
probability: probability,
probTable: probabilityTable(probabil... | [
-1.0676822662353516,
-0.23422077298164368,
0.27209022641181946,
0.18561643362045288,
-1.0003174543380737,
0.24227488040924072,
-0.02082584612071514,
0.6393042206764221,
-0.23081667721271515,
0.8164671659469604,
-0.8518054485321045,
-0.2584398090839386,
0.23668910562992096,
0.28143370151519... |
func NewSurfstoreRPCClient(hostPort, baseDir string, blockSize int) RPCClient {
return RPCClient{
ServerAddr: hostPort,
BaseDir: baseDir,
BlockSize: blockSize,
}
} | [
0.4134177565574646,
-0.03651108592748642,
0.16328164935112,
-0.7179492115974426,
-0.49899324774742126,
-0.18273413181304932,
0.5013108253479004,
-0.5843244791030884,
-0.2524210214614868,
-1.0307762622833252,
-0.049028199166059494,
0.1691160947084427,
-1.1130284070968628,
0.0383384935557842... |
func (c *Solution) validateThatEventBelongsToAnAggregate(event Event, boundedContextName string, stream Stream) {
hasAggregateID := false
for _, property := range event.Event.Properties {
if strings.ToLower(property.Name) == strings.ToLower(stream.Name+"Id") {
hasAggregateID = true
break
}
}
if !hasAggreg... | [
0.8453013896942139,
-0.963455080986023,
0.8719300627708435,
-0.3869878351688385,
0.636821448802948,
-0.058818601071834564,
0.028390347957611084,
-0.6631796956062317,
-0.789821982383728,
0.4058128893375397,
0.6891607046127319,
0.17989401519298553,
-0.15832869708538055,
0.947598934173584,
... |
func NewImageRequest(id string, incomingRequest *http.Request, foomoMediaClientInfoCookie *http.Cookie) *ImageRequest {
r := new(ImageRequest)
r.Id = id
r.DoneChannel = make(chan *ImageRequestResult)
r.IncomingRequest = incomingRequest
r.FoomoMediaClientInfoCookie = foomoMediaClientInfoCookie
return r
} | [
-1.2167353630065918,
-0.8472982048988342,
0.3947869837284088,
-0.5997430086135864,
-0.8935813903808594,
-0.7169086337089539,
-1.1019457578659058,
-0.5722713470458984,
-0.12740778923034668,
0.10874205827713013,
-0.24944891035556793,
1.1136791706085205,
-0.6334826350212097,
1.083214879035949... |
func (c *Cache) Get(request *http.Request, breakPoints []int64) (info *ImageInfo, err error) {
cookie := getFoomoMediaClientInfoCookie(request.Cookies(), breakPoints)
key := cookie.String() + ":" + request.URL.Path
c.directory.RLock()
info, ok := c.directory.m[key]
c.directory.RUnlock()
if ok && time.Now().Unix()... | [
-1.00906240940094,
-0.27060821652412415,
0.7231762409210205,
-0.011750935576856136,
0.31385812163352966,
-0.9138402342796326,
-0.4846307337284088,
-0.8426693081855774,
-0.2042476385831833,
0.018548453226685524,
0.0733666941523552,
0.43955355882644653,
0.09438662230968475,
0.677486419677734... |
func NewSimpleMessageHandler(f func(Context, *Channel, *Message) error) EventSink {
return SimpleMessageHandler{
msgSH: f,
}
} | [
0.01714794710278511,
0.10156905651092529,
0.1373358964920044,
-0.3784010708332062,
-0.4116803705692291,
-0.5862884521484375,
0.04351063817739487,
0.22789466381072998,
0.3336891233921051,
-0.683872401714325,
-0.4323899745941162,
-0.15697163343429565,
-0.8741366863250732,
0.887858510017395,
... |
func Gzip() *Compress {
return GzipWithLevel(gzip.DefaultCompression)
} | [
1.5274018049240112,
0.4110778868198395,
0.16411060094833374,
1.2956830263137817,
-0.0006982046761550009,
-0.3533041775226593,
-0.03616882115602493,
-1.1685649156570435,
-0.3282358944416046,
-0.07180111110210419,
-0.6192286014556885,
-0.4765359163284302,
-0.6286416053771973,
0.0451499596238... |
func MealTypesGet(response http.ResponseWriter, request *http.Request) {
mt, err := repo.MealTypesFindAll(context.TODO())
if err != nil {
httpError := util.NewStatus(http.StatusNotFound, err.Error())
util.Response(response, struct{}{}, httpError)
return
}
util.Response(response, mt, util.NewStatus(http.Statu... | [
-0.6870803833007812,
0.23315447568893433,
0.8475034236907959,
-0.01058648806065321,
-0.23496432602405548,
-0.24499377608299255,
-1.0843784809112549,
-0.12137134373188019,
-0.4060265123844147,
0.6556071043014526,
-0.25154945254325867,
0.5096288323402405,
-0.08699369430541992,
1.151563167572... |
func MealTypeGet(response http.ResponseWriter, request *http.Request) {
params := mux.Vars(request)
mealID, _ := params["meal_id"]
mt, err := repo.MealTypesFindOneByMealID(context.TODO(), mealID)
if err != nil {
util.Response(response, struct{}{}, util.NewStatus(http.StatusNotFound, err.Error()))
return
}
ut... | [
-0.2809786796569824,
-0.021297195926308632,
0.8851838707923889,
0.15889541804790497,
-0.06989516317844391,
-0.12290231883525848,
-0.9073572754859924,
-0.45013001561164856,
0.07193891704082489,
0.1038210317492485,
-0.015163127332925797,
0.8667832016944885,
-0.18636426329612732,
0.9376984834... |
func MealTypePutByMealID(response http.ResponseWriter, request *http.Request) {
params := mux.Vars(request)
mealID, _ := params["meal_id"]
var mealType model.MealType
err := json.NewDecoder(request.Body).Decode(&mealType)
if err != nil {
util.Response(response, struct{}{}, util.NewStatus(http.StatusBadRequest,... | [
-0.31469491124153137,
-0.1464044451713562,
1.103494644165039,
0.29181167483329773,
-0.8860683441162109,
0.4442509710788727,
-0.25468719005584717,
-0.6151794791221619,
0.3560042679309845,
0.6603804230690002,
-0.622501790523529,
0.7278302907943726,
-0.547610342502594,
0.8804424405097961,
0... |
func MealTypeDeleteByMealID(response http.ResponseWriter, request *http.Request) {
params := mux.Vars(request)
mealID, _ := params["meal_id"]
mt, err := repo.MealTypesDeleteOneByMealID(context.TODO(), mealID)
if err != nil {
httpError := util.NewStatus(http.StatusNotFound, err.Error())
util.Response(response, ... | [
0.2170834094285965,
-0.19464386999607086,
0.7512813210487366,
0.3318268656730652,
-0.37807634472846985,
0.0931253582239151,
-0.3586856722831726,
-0.21982072293758392,
0.6577558517456055,
0.57415372133255,
-0.2494013011455536,
0.37264642119407654,
-0.5784481167793274,
1.6241211891174316,
... |
func New(opt ...session.Option) echo.MiddlewareFunc {
return NewWithConfig(DefaultConfig, opt...)
} | [
0.2908203601837158,
-0.6287885308265686,
0.37653833627700806,
1.4817310571670532,
-0.7171157002449036,
-0.852779746055603,
-0.07533802092075348,
-0.5561476945877075,
0.13758230209350586,
0.06101195886731148,
-0.6494845151901245,
-0.027922991663217545,
0.19769662618637085,
0.365163594484329... |
func NewWithConfig(config Config, opt ...session.Option) echo.MiddlewareFunc {
if config.Skipper == nil {
config.Skipper = DefaultConfig.Skipper
}
manageKey = config.ManageKey
if manageKey == "" {
manageKey = DefaultConfig.ManageKey
}
storeKey = config.StoreKey
if storeKey == "" {
storeKey = DefaultConfi... | [
0.20094791054725647,
-0.6092700362205505,
0.5507326722145081,
0.6652804613113403,
-1.0388003587722778,
-0.48797446489334106,
0.011721715331077576,
-0.5004312992095947,
0.7132796049118042,
0.6364288926124573,
-0.8145365715026855,
-0.08771908283233643,
-0.03447452932596207,
0.561459302902221... |
func FromContext(ctx echo.Context) session.Store {
return ctx.Get(storeKey).(session.Store)
} | [
-0.13454772531986237,
-0.2992868423461914,
0.2215249240398407,
0.4214113652706146,
-1.5647050142288208,
-0.012967446818947792,
-0.713578999042511,
-1.220213532447815,
2.2442336082458496,
0.13643287122249603,
-0.14157584309577942,
0.3073273003101349,
-0.47547775506973267,
-0.786767780780792... |
func Refresh(ctx echo.Context) (session.Store, error) {
return ctx.Get(manageKey).(*session.Manager).Refresh(nil, ctx.Response(), ctx.Request())
} | [
0.01066320389509201,
-0.1511799395084381,
0.3462015688419342,
0.8169764280319214,
-0.8425878882408142,
0.07807459682226181,
-0.8274549841880798,
-1.6393789052963257,
1.2290345430374146,
-0.6370931267738342,
0.24593013525009155,
0.5410503149032593,
-0.3133152425289154,
0.023833023384213448,... |
func NewSaiyan(name string, power int) *Saiyan {
return &Saiyan{
Name: name,
Power: power,
}
} | [
-0.9890177249908447,
-1.1674784421920776,
0.5357376933097839,
0.6799690127372742,
-1.6089774370193481,
-0.640193521976471,
-0.24909548461437225,
0.08170505613088608,
-1.3244030475616455,
-0.19142451882362366,
0.3744111657142639,
0.17795057594776154,
-0.4800550639629364,
0.23203058540821075... |
func NewSaiyanV(name string, power int) Saiyan {
return Saiyan{
Name: name,
Power: power,
}
} | [
-0.6804832220077515,
-1.3073451519012451,
0.5383763313293457,
0.6316686272621155,
-2.0416531562805176,
-0.4359058737754822,
-0.16839928925037384,
0.11897934973239899,
-1.3745769262313843,
0.05400842800736427,
0.181434765458107,
0.5588757395744324,
0.41869425773620605,
-0.10143411159515381,... |
func TimeZoneCurrentTime(w http.ResponseWriter, r *http.Request) {
// Verify Slack Request with Signing Secret, and Timeout check
if ok := verifySlackSignature(r, []byte(slackSigningSecret)); ok == false {
w.WriteHeader(http.StatusInternalServerError)
log.Println("failed on VerifyRequest()")
return
}
// Par... | [
-0.7286022901535034,
-0.6334318518638611,
0.7812754511833191,
0.006511340383440256,
-0.16983968019485474,
-0.37966376543045044,
0.6025093197822571,
-0.7498016357421875,
-0.5269069075584412,
1.520840048789978,
-0.2735446095466614,
-0.7362837195396423,
-0.23380126059055328,
0.889959037303924... |
func TimeZoneCurrentTimeNewYork(w http.ResponseWriter, r *http.Request) {
// Verify Slack Request with Signing Secret, and Timeout check
if ok := verifySlackSignature(r, []byte(slackSigningSecret)); ok == false {
w.WriteHeader(http.StatusInternalServerError)
log.Println("failed on VerifyRequest()")
return
}
... | [
-0.9169608354568481,
0.09264294803142548,
0.5853381752967834,
0.2382977157831192,
0.05595356971025467,
-0.1957354098558426,
0.611419677734375,
-0.7218303680419922,
-0.3574815094470978,
0.9679657816886902,
-0.7126720547676086,
-0.2852889895439148,
-0.04096343368291855,
0.7350572943687439,
... |
func TimeZoneCurrentTimeSeoul(w http.ResponseWriter, r *http.Request) {
// Verify Slack Request with Signing Secret, and Timeout check
if ok := verifySlackSignature(r, []byte(slackSigningSecret)); ok == false {
w.WriteHeader(http.StatusInternalServerError)
log.Println("failed on VerifyRequest()")
return
}
r... | [
-1.0297205448150635,
0.07983069866895676,
0.5736835598945618,
-0.5904911756515503,
-0.05055446922779083,
-0.36175021529197693,
0.6749712824821472,
-0.5549901723861694,
-0.1514226347208023,
1.548171043395996,
-0.492275208234787,
-0.09657761454582214,
-0.10657387226819992,
0.4077253043651581... |
func checkMAC(message, receivedMAC string, slackSigningSecret []byte) bool {
mac := hmac.New(sha256.New, slackSigningSecret)
if _, err := mac.Write([]byte(message)); err != nil {
log.Printf("mac.Write(%v) failed\n", message)
return false
}
calculatedMAC := "v0=" + hex.EncodeToString(mac.Sum(nil))
return hmac.E... | [
0.3721190094947815,
-0.19163285195827484,
0.5689935684204102,
0.17016002535820007,
0.22649946808815002,
0.01990516483783722,
-0.008205754682421684,
0.12659594416618347,
-0.19052137434482574,
0.016968442127108574,
-0.16556166112422943,
0.39267095923423767,
-0.9276176691055298,
0.75748443603... |
func verifySlackSignature(r *http.Request, slackSigningSecret []byte) bool {
if r.Body == nil {
return false
}
// do not consume req.body
bodyBytes, _ := ioutil.ReadAll(r.Body)
r.Body = ioutil.NopCloser(bytes.NewBuffer(bodyBytes))
// prepare message for signing
timestamp := r.Header.Get(hTimestamp)
slackSig... | [
0.09584178030490875,
0.31720536947250366,
0.6096890568733215,
0.21568062901496887,
-0.13295963406562805,
0.20892563462257385,
-0.23428337275981903,
-0.2907525897026062,
-0.012685874477028847,
0.39689743518829346,
-0.8797520995140076,
0.3094313144683838,
-0.8608308434486389,
0.9015088677406... |
func NewCache(blockSize, maxBlocks int, size int64, reader io.ReaderAt) *Cache {
return &Cache{
maxBlocks: maxBlocks,
blocks: make(map[int64]*cacheBlock),
lru: list.New(),
blockSize: blockSize,
size: size,
reader: reader,
}
} | [
0.29797154664993286,
-0.5940253734588623,
0.3975297510623932,
0.13179196417331696,
-1.4148733615875244,
-0.874662458896637,
-0.5946075916290283,
0.02752832882106304,
-0.0421120710670948,
0.46891099214553833,
0.44362640380859375,
-0.2621449828147888,
-0.49035245180130005,
-0.509935021400451... |
func (c *Cache) ReadAt(p []byte, offset int64) (n int, err error) {
for ao := c.blockAlign(offset); n < len(p); ao += int64(c.blockSize) {
blk := c.getBlock(ao, false)
if blk == nil {
// Clip the block size if necessary to c.size (EOF).
// This prevents caching of growing files,
// but simplifies EOF hand... | [
-0.6420025825500488,
0.2051377296447754,
0.8907126188278198,
-0.5762349367141724,
-0.6901033520698547,
-0.2273106426000595,
-0.3847236633300781,
-0.7420694828033447,
-0.6923092007637024,
0.27427130937576294,
-0.007654564455151558,
0.050971414893865585,
0.31550419330596924,
-0.2017050534486... |
func (c *Cache) evictOld() {
if len(c.blocks) < c.maxBlocks {
return
}
oldblk := c.lru.Remove(c.lru.Back()).(*cacheBlock)
delete(c.blocks, oldblk.offset)
} | [
1.3264213800430298,
1.0050641298294067,
0.7386124134063721,
-0.5630117058753967,
-0.6367574334144592,
0.07226340472698212,
-0.007603539619594812,
0.21519537270069122,
-0.08333317190408707,
1.3793561458587646,
-1.0888391733169556,
0.8714519143104553,
-0.20973850786685944,
0.54109787940979,
... |
func (c *Cache) addBlock(blk *cacheBlock) *cacheBlock {
c.mu.Lock()
defer c.mu.Unlock()
if cblk := c.getBlock(blk.offset, true); cblk != nil {
return cblk
}
c.blocks[blk.offset] = blk
blk.lru = c.lru.PushFront(blk)
c.evictOld()
return blk
} | [
-0.07644295692443848,
0.8079565167427063,
0.9545197486877441,
0.26254940032958984,
-0.26405543088912964,
0.34681838750839233,
-0.7205268144607544,
0.1940145194530487,
0.7346165180206299,
-0.5578665137290955,
-0.14661909639835358,
0.6028883457183838,
-0.5435835123062134,
0.20356400310993195... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.