text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func NewCreateDeploymentTargetSpacesCreated() *CreateDeploymentTargetSpacesCreated {
return &CreateDeploymentTargetSpacesCreated{}
} | [
0.4944208562374115,
-0.7250283360481262,
0.03222494199872017,
-0.14473628997802734,
0.43360474705696106,
1.0474624633789062,
0.287504643201828,
-0.44773152470588684,
-0.1905977874994278,
-0.9440836906433105,
0.3551701605319977,
-0.09797612577676773,
0.8786414861679077,
0.8357359766960144,
... |
func NewCreateDeploymentTargetSpacesBadRequest() *CreateDeploymentTargetSpacesBadRequest {
return &CreateDeploymentTargetSpacesBadRequest{}
} | [
-0.5678752660751343,
-0.35055556893348694,
0.4734949767589569,
0.15567408502101898,
0.36125627160072327,
1.0327768325805664,
0.30641472339630127,
-0.0717606469988823,
-0.09819667041301727,
-0.41492313146591187,
0.6982759833335876,
1.1860613822937012,
0.5831996202468872,
1.1850193738937378,... |
func NewHandler(k Keeper) sdk.Handler {
return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) {
ctx = ctx.WithEventManager(sdk.NewEventManager())
switch msg := msg.(type) {
case MsgCreateAtomicSwap:
return handleMsgCreateAtomicSwap(ctx, k, msg)
case MsgClaimAtomicSwap:
return handleMsgClaimAtomi... | [
-0.2979944944381714,
0.26652848720550537,
0.5002527832984924,
1.0067776441574097,
-0.6363621354103088,
0.3692888021469116,
0.31381702423095703,
-0.45538070797920227,
0.49086979031562805,
-0.6084781885147095,
0.8070668578147888,
-0.24938037991523743,
-0.0712248906493187,
0.6693205237388611,... |
func handleMsgCreateAtomicSwap(ctx sdk.Context, k Keeper, msg MsgCreateAtomicSwap) (*sdk.Result, error) {
err := k.CreateAtomicSwap(ctx, msg.RandomNumberHash, msg.Timestamp, msg.HeightSpan,
msg.From, msg.To, msg.SenderOtherChain, msg.RecipientOtherChain, msg.Amount, true)
if err != nil {
return nil, err
}
ctx.... | [
0.1309986412525177,
0.43310225009918213,
0.5708052515983582,
-0.669133722782135,
-0.07781890779733658,
0.039675407111644745,
-0.098109170794487,
-0.6433939933776855,
-0.24871154129505157,
-0.0023282619658857584,
-0.05157734081149101,
-0.39819028973579407,
0.09889397770166397,
0.42426639795... |
func handleMsgClaimAtomicSwap(ctx sdk.Context, k Keeper, msg MsgClaimAtomicSwap) (*sdk.Result, error) {
err := k.ClaimAtomicSwap(ctx, msg.From, msg.SwapID, msg.RandomNumber)
if err != nil {
return nil, err
}
ctx.EventManager().EmitEvent(
sdk.NewEvent(
sdk.EventTypeMessage,
sdk.NewAttribute(sdk.Attribute... | [
0.6430594325065613,
0.06544681638479233,
0.6286985874176025,
-0.4965335428714752,
-0.2521219551563263,
0.2625311613082886,
-0.114247165620327,
-0.09510987251996994,
0.619049072265625,
-0.5260838270187378,
0.39359453320503235,
0.0045766448602080345,
-0.1088457703590393,
0.5982219576835632,
... |
func handleMsgRefundAtomicSwap(ctx sdk.Context, k Keeper, msg MsgRefundAtomicSwap) (*sdk.Result, error) {
err := k.RefundAtomicSwap(ctx, msg.From, msg.SwapID)
if err != nil {
return nil, err
}
ctx.EventManager().EmitEvent(
sdk.NewEvent(
sdk.EventTypeMessage,
sdk.NewAttribute(sdk.AttributeKeyModule, Attr... | [
0.10507871955633163,
0.34664881229400635,
0.43543723225593567,
-0.4995606541633606,
-0.17725960910320282,
-0.3366495370864868,
0.4698035717010498,
-0.4722454845905304,
0.21353363990783691,
-0.5196892619132996,
0.6380659937858582,
0.2498762458562851,
-0.38421207666397095,
0.9191784262657166... |
func ExampleOperationsClient_List() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armaddons.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to... | [
0.44442108273506165,
-0.22982440888881683,
0.710160493850708,
-0.03720937296748161,
-0.004755660891532898,
-0.1037110686302185,
0.05307168513536453,
-0.0932103767991066,
0.7396395802497864,
0.5188907980918884,
-0.8580093383789062,
0.27951404452323914,
-0.05956239998340607,
-0.4485656917095... |
func New(token string, client *http.Client, t apiType) *Bot {
apiBaseURL := icqAPIBaseURL
if t == APITypeAgent {
apiBaseURL = agentAPIBaseURL
}
return &Bot{
state: botStateStopped,
token: token,
apiBaseURL: apiBaseURL,
client: client,
pollDuration: time.Minute,
}
} | [
-0.44134795665740967,
-0.5705679059028625,
0.25294938683509827,
-0.44423726201057434,
-0.6545805335044861,
0.3382799029350281,
-0.894877552986145,
0.027139706537127495,
0.11907213181257248,
0.3082021176815033,
-0.42068132758140564,
-0.007802069187164307,
0.07057283073663712,
-0.04705611243... |
func (b *Bot) GetSelf(ctx context.Context) (*GetSelfResponse, error) {
r, err := http.NewRequest(http.MethodGet, b.apiBaseURL+"/self/get", nil)
if err != nil {
return nil, err
}
q := r.URL.Query()
r.URL.RawQuery = q.Encode()
httpResp, err := b.doRequest(ctx, r)
if err != nil {
return nil, err
}
resp := ... | [
-0.5000864267349243,
0.015191334299743176,
0.6862599849700928,
0.2987733483314514,
-0.034032586961984634,
-0.578708291053772,
0.14749471843242645,
-0.5391789078712463,
0.24026484787464142,
-0.33182424306869507,
-0.8739959001541138,
1.181237816810608,
-0.7740726470947266,
0.2115357071161270... |
func (b *Bot) SetNewMessageHandler(fn newMessageHandlerFunc) {
b.handlers.newMessageHandler = fn
} | [
-0.26956117153167725,
-0.7380756735801697,
0.14024074375629425,
-0.09951934963464737,
-0.3586440980434418,
0.633525550365448,
0.22730492055416107,
-0.06608093529939651,
-0.24145111441612244,
-0.3344343602657318,
-0.5085223317146301,
0.218527689576149,
-0.26188746094703674,
1.82316148281097... |
func (b *Bot) SetEditMessageHandler(fn editMessageHandlerFunc) {
b.handlers.editMessageHandler = fn
} | [
-0.8078567385673523,
-0.6024073362350464,
0.08644358813762665,
-0.24702754616737366,
0.5124446749687195,
0.7128969430923462,
0.9299067854881287,
-0.021828290075063705,
-0.3836979568004608,
-0.19208185374736786,
-0.679196298122406,
-0.06129519268870354,
-0.289139062166214,
0.931595742702484... |
func (b *Bot) SetDeleteMessageHandler(fn deleteMessageHandlerFunc) {
b.handlers.deleteMessageHandler = fn
} | [
-0.18085163831710815,
-0.5985366106033325,
0.19146156311035156,
0.24198998510837555,
0.2457524538040161,
0.7931376099586487,
0.3211793005466461,
0.003837633179500699,
0.36788538098335266,
-0.4001798927783966,
-0.21809497475624084,
-0.06181423366069794,
-0.43086913228034973,
1.6526463031768... |
func (b *Bot) SetPinMessageHandler(fn pinMessageHandlerFunc) {
b.handlers.pinMessageHandler = fn
} | [
-0.2900189161300659,
-0.6307755708694458,
0.06754471361637115,
-0.07442382723093033,
-0.12301024794578552,
1.159829020500183,
0.19673027098178864,
0.317961186170578,
-0.06884829699993134,
-0.012965500354766846,
-0.6252098679542542,
0.11401854455471039,
-0.7433604598045349,
0.74124211072921... |
func (b *Bot) SetUnpinMessageHandler(fn unpinMessageHandlerFunc) {
b.handlers.unpinMessageHandler = fn
} | [
-0.19467443227767944,
-0.749981701374054,
0.20523656904697418,
-0.5632784366607666,
-0.19943982362747192,
0.8150611519813538,
0.5502780675888062,
0.9479036331176758,
-0.7216549515724182,
-0.27402162551879883,
-0.07119856029748917,
0.0013815297279506922,
-0.8278826475143433,
0.6366182565689... |
func (b *Bot) SetNewChatMemberHandler(fn newChatMembersHandlerFunc) {
b.handlers.newChatMemberHandler = fn
} | [
0.16368871927261353,
-1.3877168893814087,
0.015491422265768051,
0.14899463951587677,
-0.5076086521148682,
1.1698200702667236,
0.04465604946017265,
-0.18826855719089508,
-0.9969778656959534,
-0.8332288265228271,
-1.5414921045303345,
-0.13745588064193726,
-0.4484842121601105,
0.7393084168434... |
func (b *Bot) SetLeftChatMemberHandler(fn leftChatMembersHandlerFunc) {
b.handlers.leftChatMembersHandler = fn
} | [
0.2126782238483429,
-1.5005097389221191,
0.06950508803129196,
-0.4103720486164093,
-0.1477641612291336,
1.1963067054748535,
-0.7221119403839111,
-0.1974637508392334,
-0.7951821088790894,
-0.6522055268287659,
-1.321542739868164,
-0.27665483951568604,
-0.9611847996711731,
1.3655272722244263,... |
func Asset(name string) ([]byte, error) {
cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[cannonicalName]; ok {
a, err := f()
if err != nil {
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
}
return a.bytes, nil
}
return nil, fmt.Errorf("Asset %s not foun... | [
-0.7961483001708984,
-1.2313168048858643,
0.633165180683136,
-0.6093899011611938,
-1.546921730041504,
-0.11101024597883224,
0.12971386313438416,
-1.3390334844589233,
-1.1358720064163208,
0.4855233430862427,
0.3090141713619232,
0.32495471835136414,
-0.6009681224822998,
-0.44264674186706543,... |
func MustAsset(name string) []byte {
a, err := Asset(name)
if err != nil {
panic("asset: Asset(" + name + "): " + err.Error())
}
return a
} | [
-0.012778956443071365,
0.11985661834478378,
0.4091298282146454,
-0.5268413424491882,
-0.8276715278625488,
0.4719155430793762,
-0.8186293840408325,
-1.5736604928970337,
0.16388541460037231,
0.6357062458992004,
-0.5354578495025635,
0.35693347454071045,
0.0057142809964716434,
-0.0248885955661... |
func AssetInfo(name string) (os.FileInfo, error) {
cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[cannonicalName]; ok {
a, err := f()
if err != nil {
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
}
return a.info, nil
}
return nil, fmt.Errorf("Asset... | [
0.371969997882843,
-1.1052993535995483,
0.5630446076393127,
-0.922572672367096,
-1.356387734413147,
0.0033556853886693716,
0.6777529716491699,
-0.8006685972213745,
-1.2748286724090576,
0.3115358352661133,
0.2636086046695709,
0.26388120651245117,
0.0635773167014122,
-0.3988074064254761,
0... |
func AssetNames() []string {
names := make([]string, 0, len(_bindata))
for name := range _bindata {
names = append(names, name)
}
return names
} | [
-0.7293784618377686,
-0.8460342288017273,
0.7321816682815552,
-0.39323121309280396,
-0.48951536417007446,
0.7661203145980835,
-0.5028699636459351,
-0.8655748963356018,
-0.4145073890686035,
0.8099913597106934,
0.16903363168239594,
1.163049578666687,
-0.028152840211987495,
0.0342608317732811... |
func RestoreAsset(dir, name string) error {
data, err := Asset(name)
if err != nil {
return err
}
info, err := AssetInfo(name)
if err != nil {
return err
}
err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
if err != nil {
return err
}
err = ioutil.WriteFile(_filePath(dir, name), d... | [
0.3437124192714691,
-0.3622540235519409,
0.6770355701446533,
-1.2592030763626099,
-0.006139514967799187,
-0.04453148692846298,
-0.0072639440186321735,
-0.43950510025024414,
-0.20619122684001923,
-0.2510169744491577,
0.1784360408782959,
0.13568510115146637,
-0.23627112805843353,
-0.56985116... |
func RestoreAssets(dir, name string) error {
children, err := AssetDir(name)
// File
if err != nil {
return RestoreAsset(dir, name)
}
// Dir
for _, child := range children {
err = RestoreAssets(dir, filepath.Join(name, child))
if err != nil {
return err
}
}
return nil
} | [
0.42261892557144165,
0.30020031332969666,
0.5813396573066711,
-0.20641657710075378,
-0.23828908801078796,
-0.24414615333080292,
0.5739709138870239,
-0.029911456629633904,
0.06188219040632248,
-0.43923482298851013,
0.5113736987113953,
0.3275970220565796,
-0.6125145554542542,
0.0351656526327... |
func (mp MapProvider) Provide() (map[string]string, error) {
return mp.Map, nil
} | [
-0.7550382614135742,
-0.8619934320449829,
0.028578298166394234,
0.1081685945391655,
-0.7239243984222412,
0.9024094343185425,
-0.19840975105762482,
-0.6335110068321228,
0.9890211224555969,
-0.05396562069654465,
0.7646857500076294,
0.2003660798072815,
-0.1649189591407776,
0.37018877267837524... |
func doLintName(name string, initialisms *names.Initials) (should string) {
// Fast path for simple cases: "_" and all lowercase.
if name == "_" {
return name
}
allLower := true
for _, r := range name {
if !unicode.IsLower(r) {
allLower = false
break
}
}
if allLower {
return name
}
// Split came... | [
-0.029413651674985886,
-0.4285559356212616,
0.8391581177711487,
-0.9276914596557617,
-0.5814158320426941,
-0.5999999046325684,
-0.01555480994284153,
-0.3589329719543457,
0.12725624442100525,
0.9097968339920044,
0.15756109356880188,
0.30958396196365356,
-0.6265751123428345,
0.22120365500450... |
func (c *Collector) getMinialConfigsFromOSEnv() bool {
c.Debug, _ = strconv.ParseBool(os.Getenv("NFC_DEBUG"))
c.Listen.Address = os.Getenv("NFC_LISTEN_ADDRESS")
c.Listen.Port, _ = strconv.Atoi(os.Getenv("NFC_LISTEN_PORT"))
c.IPReputation.IPSumPath = os.Getenv("NFC_IP_REPTATION_IPSUM")
c.LogFile = os.Getenv("N... | [
0.09100735932588577,
-0.2195664644241333,
0.9233864545822144,
0.018844101577997208,
-0.052680276334285736,
0.17505958676338196,
-0.7640891075134277,
-0.24984999001026154,
-0.163870707154274,
-0.24125836789608002,
-0.41525721549987793,
-0.23728999495506287,
-0.7419946193695068,
0.5680973529... |
func Addr() string {
return defaultCfg.Addr
} | [
0.2643565237522125,
-0.1354610174894333,
0.0675196498632431,
1.1290203332901,
-0.28187498450279236,
0.9818111062049866,
0.5444241762161255,
0.4983329176902771,
0.2871008813381195,
-0.2609560787677765,
0.628875732421875,
-0.0025500899646431208,
-0.06725700199604034,
0.5741737484931946,
0.... |
func Interval() int {
return defaultCfg.Interval
} | [
0.030570151284337044,
0.48141106963157654,
0.17353121936321259,
1.1692556142807007,
0.22019578516483307,
1.1967772245407104,
0.8102394342422485,
1.2154172658920288,
-1.2511930465698242,
-0.22473643720149994,
-0.8486009836196899,
-0.302996963262558,
-1.1544363498687744,
0.5424667000770569,
... |
func WithInterval(interval int) Option {
return func(c *config) {
c.Interval = interval
}
} | [
0.06621819734573364,
-0.43430545926094055,
0.3447989523410797,
-0.14238423109054565,
-0.7064934372901917,
1.2216646671295166,
0.44120892882347107,
-0.06880582123994827,
-0.1500231772661209,
-0.40921711921691895,
-0.64410400390625,
-0.06568336486816406,
-1.462342381477356,
-0.76660692691802... |
func WithMaxPoints(n int) Option {
return func(c *config) {
c.MaxPoints = n
}
} | [
0.5949054956436157,
0.4388779103755951,
0.4110676348209381,
0.7079230546951294,
-0.46650949120521545,
0.10583118349313736,
-0.6440990567207336,
0.17503294348716736,
1.000654935836792,
0.655297040939331,
-0.6756178736686707,
-0.6023529171943665,
0.6994845867156982,
0.18715135753154755,
0.... |
func WithTemplate(t string) Option {
return func(c *config) {
c.Template = t
}
} | [
-0.030772261321544647,
0.4894064664840698,
0.40864041447639465,
-0.5619125366210938,
-0.17793762683868408,
-0.6553859710693359,
-0.35052862763404846,
0.09532885998487473,
-0.20392026007175446,
0.2212500423192978,
-0.9334091544151306,
-1.419764757156372,
0.4063624143600464,
-0.0698663219809... |
func WithAddr(addr string) Option {
return func(c *config) {
c.Addr = addr
}
} | [
0.44808530807495117,
-0.5271353125572205,
0.5525187253952026,
-0.4142459034919739,
-0.8878849744796753,
0.523240864276886,
0.24588124454021454,
-0.37359336018562317,
0.8619174361228943,
-0.49677330255508423,
0.5871164798736572,
-0.22020840644836426,
0.9587403535842896,
0.47411611676216125,... |
func WithTimeFormat(s string) Option {
return func(c *config) {
c.TimeFormat = s
}
} | [
0.629619836807251,
-0.38203445076942444,
0.35122400522232056,
-0.7448421716690063,
-1.0399301052093506,
-0.7429484128952026,
-0.02276723086833954,
-0.8136938214302063,
0.7522638440132141,
-0.001605100929737091,
-0.9415944814682007,
-0.7337913513183594,
0.1374521702528,
1.0808663368225098,
... |
func WithTheme(theme Theme) Option {
return func(c *config) {
c.Theme = theme
}
} | [
0.33118999004364014,
0.5704165697097778,
0.32872357964515686,
0.1939155012369156,
0.315248042345047,
-0.28681159019470215,
0.23563772439956665,
-0.2938905358314514,
0.050946079194545746,
0.3218074142932892,
0.047316230833530426,
-0.7346400022506714,
0.14723844826221466,
-0.0957291796803474... |
func main() {
var count int64
var maxDistance int64
for {
n, _ := fmt.Scan(&count, &maxDistance)
if n == 0 {
break
}
lines := make([]int64, count)
var i int64
for i = 0; i < count; i++ {
fmt.Scanf("%d", &lines[i])
}
solutionCount := do(lines, maxDistance)
fmt.Println(solut... | [
0.7144945859909058,
0.4284113049507141,
0.7405884265899658,
1.0026386976242065,
0.2872767448425293,
-0.457899272441864,
0.7470470070838928,
0.2661639451980591,
-0.436260461807251,
-0.35796886682510376,
-0.21421582996845245,
-0.5400064587593079,
0.7706053256988525,
0.562272846698761,
-0.4... |
func do(ds []int64, maxDistance int64) int64 {
var count int64 = 0
var i int64 = 0
var j int64 = 2
for i = 0; i < int64(len(ds)); i++ {
for j < int64(len(ds)) && ds[j] - ds[i] <= maxDistance {
j++
}
if j - 1 - i >= 2 {
count += (j - i - 1) * (j - i - 2) ... | [
-0.3505949079990387,
0.9202043414115906,
0.8665034174919128,
0.26207080483436584,
-1.0353963375091553,
-0.5450114607810974,
0.2201792150735855,
0.4485311806201935,
0.365054726600647,
0.775009036064148,
-0.8567620515823364,
0.3853108286857605,
0.43905481696128845,
0.045722849667072296,
-0... |
func (ki *keyInterface) publisherGenUFS(keyName string) ufs.ModifiedFunc {
return func(nd ipld.Node) error {
return localPublish(ki.ctx, ki.core, keyName, corepath.IpfsPath(nd.Cid()))
}
} | [
-0.7285475134849548,
0.30208784341812134,
0.3838139772415161,
-0.35987845063209534,
-0.4808284640312195,
-0.2806033492088318,
0.5786674618721008,
0.5990363359451294,
-0.9746025800704956,
-0.4137992560863495,
0.4299035966396332,
-0.32975709438323975,
-0.431057333946228,
0.4355252981185913,
... |
func (ki *keyInterface) publisherGenMFS(keyName string) gomfs.PubFunc {
return func(ctx context.Context, cid cid.Cid) error {
return localPublish(ctx, ki.core, keyName, corepath.IpfsPath(cid))
}
} | [
-0.41251665353775024,
-0.4703470766544342,
0.4212600290775299,
-0.022335611283779144,
-0.9669144153594971,
-0.6944897770881653,
0.40192848443984985,
0.7780798077583313,
-0.386883020401001,
-0.09542705118656158,
0.11626282334327698,
-1.0466135740280151,
-1.2011544704437256,
0.42851051688194... |
func (ki *keyInterface) Rename(oldName, newName string) error {
keyName, remainder := splitPath(oldName)
if remainder == "" { // rename on key itself
callCtx, cancel := interfaceutils.CallContext(ki.ctx)
defer cancel()
_, _, err := ki.core.Key().Rename(callCtx, keyName, newName[1:])
if err != nil {
return ... | [
-0.43288853764533997,
-0.06144532561302185,
0.8225365281105042,
0.7824205160140991,
-0.36620038747787476,
-0.4027177095413208,
0.09657531976699829,
-0.2010791003704071,
-0.722417414188385,
0.7415468692779541,
0.5976852178573608,
-0.093517005443573,
-0.8513152599334717,
0.18525907397270203,... |
func New() *Filter {
return &Filter{
include: []Matcher{},
exclude: []Matcher{},
limit: 0,
}
} | [
-0.09135407954454422,
-0.9668843150138855,
0.14288851618766785,
0.23695121705532074,
-0.6346997022628784,
-0.24815241992473602,
-0.3162350654602051,
0.5746623873710632,
-0.26691707968711853,
-0.9497782588005066,
-0.3921586871147156,
0.7709426879882812,
0.1615978330373764,
0.072601474821567... |
func (f *Filter) Filter(resources []resource.Resource) ([]resource.Resource, error) {
var err error
filtered := append([]resource.Resource{}, resources...)
ordermap := map[string]int{}
for i, res := range resources {
ordermap[res.ID()] = i
}
// excludes
for _, matcher := range f.exclude {
filtered, err = e... | [
-0.22218607366085052,
-0.45746374130249023,
0.7326014637947083,
-0.05752796307206154,
-0.9058164358139038,
-0.036502692848443985,
0.551754355430603,
0.03742082417011261,
-0.016699323430657387,
0.08635172247886658,
0.43137696385383606,
0.19387172162532806,
-0.007121626753360033,
0.118725530... |
func (f *Filter) AddInclude(s Matcher) {
f.include = append(f.include, s)
} | [
-0.05294886976480484,
-0.058300282806158066,
0.8158227801322937,
0.8004470467567444,
-1.1494020223617554,
0.18013352155685425,
-0.3176981210708618,
0.9958327412605286,
0.24019043147563934,
-0.3409847617149353,
-0.11909055709838867,
0.3779122233390808,
-0.5605758428573608,
0.773821294307708... |
func (f *Filter) AddExclude(s Matcher) {
f.exclude = append(f.exclude, s)
} | [
-0.41565370559692383,
0.4954070448875427,
0.6335977911949158,
0.6872698068618774,
-0.9554976224899292,
0.22521476447582245,
-0.5579978823661804,
0.26677751541137695,
0.19908571243286133,
-0.6220237612724304,
-0.02523312345147133,
-0.075294129550457,
-0.4677715301513672,
0.6684008836746216,... |
func Parse(s string) ([]*Table, error) {
node, err := html.Parse(strings.NewReader(s))
if err != nil {
return nil, err
}
tables := []*Table{}
parse(node, &tables)
for kk, t := range tables {
tables[kk] = addMissingColumns(t)
}
return tables, nil
} | [
-0.21408692002296448,
0.373798668384552,
0.5148336291313171,
0.7111526727676392,
-0.5316869020462036,
-0.020575392991304398,
0.2741781175136566,
0.0666552260518074,
-0.74814373254776,
-0.027708547189831734,
-0.4219878613948822,
-0.2732657492160797,
-0.044415757060050964,
0.2394595295190811... |
func NewPushKeyAPI(mods *modulestypes.Modules) *PushKeyAPI {
return &PushKeyAPI{mods: mods}
} | [
-0.9470194578170776,
-0.5383948087692261,
-0.011818647384643555,
0.9925594329833984,
-0.9109665751457214,
0.05329776555299759,
-1.0712344646453857,
-0.19485528767108917,
0.1526307463645935,
1.4307917356491089,
-0.6938344836235046,
0.4688816964626312,
-1.1626381874084473,
1.0675309896469116... |
func (a *PushKeyAPI) find(params interface{}) (resp *rpc.Response) {
o := objx.New(params)
keyID := o.Get("id").Str()
blockHeight := cast.ToUint64(o.Get("height").Inter())
key := a.mods.PushKey.Find(keyID, blockHeight)
return rpc.Success(key)
} | [
-1.0059118270874023,
0.44875583052635193,
0.5177816152572632,
0.5184586644172668,
-0.12875059247016907,
-0.37167370319366455,
-0.4063466489315033,
-1.441994309425354,
-1.1625242233276367,
1.372367262840271,
-0.3401542603969574,
0.4373728930950165,
-1.7897471189498901,
1.446141242980957,
... |
func (a *PushKeyAPI) getOwner(params interface{}) (resp *rpc.Response) {
o := objx.New(params)
keyID := o.Get("id").Str()
blockHeight := cast.ToUint64(o.Get("height").Inter())
account := a.mods.PushKey.GetAccountOfOwner(keyID, blockHeight)
return rpc.Success(account)
} | [
-0.7656056880950928,
0.31598374247550964,
0.8362192511558533,
2.0131404399871826,
-0.026847584173083305,
-0.8217409253120422,
0.8780992031097412,
-1.0335361957550049,
-0.1010904461145401,
0.34619075059890747,
0.12130866944789886,
0.8404058814048767,
-1.159942388534546,
0.1618853211402893,
... |
func (a *PushKeyAPI) register(params interface{}) (resp *rpc.Response) {
return rpc.Success(a.mods.PushKey.Register(cast.ToStringMap(params)))
} | [
-2.2383997440338135,
0.5572248101234436,
0.31427404284477234,
0.24387036263942719,
0.6539379358291626,
-0.3604392111301422,
-0.9073754549026489,
-0.5549999475479126,
-0.44347959756851196,
0.6277868151664734,
-0.543190598487854,
0.35378140211105347,
-1.3351798057556152,
1.066038966178894,
... |
func (a *PushKeyAPI) unregister(params interface{}) (resp *rpc.Response) {
return rpc.Success(a.mods.PushKey.Unregister(cast.ToStringMap(params)))
} | [
-1.7965760231018066,
0.7941336035728455,
0.3066725432872772,
0.20261415839195251,
0.28007298707962036,
-0.7878174781799316,
-0.15882927179336548,
0.47092485427856445,
-0.6153277158737183,
0.5288436412811279,
-0.26314079761505127,
0.16983188688755035,
-1.3520421981811523,
1.189751148223877,... |
func (a *PushKeyAPI) getByAddress(params interface{}) (resp *rpc.Response) {
return rpc.Success(util.Map{
"addresses": a.mods.PushKey.GetByAddress(cast.ToString(params)),
})
} | [
-1.0937093496322632,
0.6372294425964355,
0.4520285129547119,
0.3396422564983368,
0.36658331751823425,
-0.9500585198402405,
-0.40960967540740967,
-0.2788330018520355,
0.2171575278043747,
1.0658103227615356,
-0.33364635705947876,
1.6812106370925903,
-0.6872349381446838,
0.431286484003067,
... |
func (a *PushKeyAPI) update(params interface{}) (resp *rpc.Response) {
return rpc.Success(a.mods.PushKey.Update(cast.ToStringMap(params)))
} | [
-2.020805835723877,
-0.2773899734020233,
0.29872268438339233,
0.15677689015865326,
-0.25366443395614624,
0.16085276007652283,
-0.8137363791465759,
-0.6926087737083435,
-0.08754722028970718,
1.418381929397583,
-0.2732967436313629,
0.43369394540786743,
-1.8011219501495361,
0.8561890721321106... |
func (a *PushKeyAPI) APIs() rpc.APISet {
return []rpc.MethodInfo{
{
Name: "find",
Namespace: constants.NamespacePushKey,
Func: a.find,
Desc: "Find a push key",
},
{
Name: "getOwner",
Namespace: constants.NamespacePushKey,
Func: a.getOwner,
Desc: "Get the acco... | [
-0.7870357632637024,
0.17856237292289734,
0.5043182373046875,
-0.5261929631233215,
-0.7511180639266968,
-0.49856629967689514,
-0.8839468955993652,
-0.796238124370575,
0.34226858615875244,
0.39517948031425476,
0.11368347704410553,
0.2697884440422058,
-0.793704628944397,
0.5840474367141724,
... |
func add(carton Builder, file string, f func()) {
name := carton.Provider()
if name == "" {
panic(fmt.Sprintln("Carton Err:", ErrNoName))
}
if _, ok := inventory[name]; ok {
panic(fmt.Sprintf("Carton Err: %s had been added!", name))
}
inventory[name] = carton
// run in goroutine to improve user experience... | [
0.07277939468622208,
-0.8435458540916443,
0.7387158274650574,
0.2438906729221344,
0.0935993567109108,
0.31052398681640625,
-0.2118154913187027,
0.5654918551445007,
-0.46951475739479065,
0.20750190317630768,
-0.45702022314071655,
0.7547568082809448,
0.2787657380104065,
-0.4168974459171295,
... |
func Update(name string, m func(Modifier)) {
carton, ok := inventory[name]
if !ok {
log.Warning("carton %s is not found for updating", name)
return
}
if m != nil {
_, file, _, _ := runtime.Caller(1)
updateNum++
// run in goroutine to improve user experience
go func() {
updateCh <- func() {
car... | [
-0.6094950437545776,
-1.2703667879104614,
0.573982298374176,
0.026754967868328094,
-0.4073295295238495,
-0.06035064905881882,
-0.28452277183532715,
-0.035505734384059906,
-0.7890918254852295,
0.44026491045951843,
-0.941798746585846,
0.26134052872657776,
-0.18153224885463715,
-0.08108204603... |
func Find(name string) (h Builder, isVirtual bool, isNative bool, err error) {
if strings.HasSuffix(name, "-native") {
isNative = true
name = strings.TrimSuffix(name, "-native")
}
// TODO: handle if exist in both inventory
if carton, ok := inventory[name]; ok {
return carton, false, isNative, nil
}
if vi... | [
-0.13836003839969635,
-0.8720048666000366,
0.7765769362449646,
0.661917507648468,
-0.4193516969680786,
0.4769115149974823,
-0.3304612338542938,
-0.4809451699256897,
-0.669404149055481,
1.0583206415176392,
0.2205093801021576,
-0.17788401246070862,
-0.3948100805282593,
0.31071269512176514,
... |
func BuildInventory(ctx context.Context) error {
buildInventory()
return detectLoopDep(ctx)
} | [
-0.9806869029998779,
-0.9623202085494995,
0.17475077509880066,
0.9422863125801086,
0.4767591953277588,
0.7129755020141602,
0.9241375923156738,
-0.36715686321258545,
0.49536773562431335,
-0.49320510029792786,
-0.2575160562992096,
0.24431897699832916,
0.03949643671512604,
-0.3613923192024231... |
func detectLoopDep(ctx context.Context) error {
var (
wg sync.WaitGroup
once sync.Once
err error
)
ctx, cancel := context.WithCancel(ctx)
recv := func() chan string {
ch := make(chan string)
go func() {
for carton := range inventory {
ch <- carton
}
close(ch)
}()
return ch
}()
d... | [
0.092739537358284,
-0.5081122517585754,
1.0054634809494019,
0.17083778977394104,
0.22432778775691986,
0.025643600150942802,
0.10529409348964691,
-0.8449424505233765,
-0.10134831070899963,
-0.8418644666671753,
-0.3967779576778412,
0.11193499714136124,
-0.28986963629722595,
0.742468714714050... |
func (a *Address) reset() {
a.Host = a.Host[:0]
for i := range a.IP {
a.IP[i] = 0
}
a.Type = AddressIPv4
} | [
-1.275022029876709,
-0.3622686266899109,
0.4042420983314514,
-0.143271341919899,
0.4044744074344635,
-0.3245396614074707,
0.46519896388053894,
-0.3702014088630676,
-0.2026483565568924,
0.578823447227478,
-0.1505965292453766,
1.0687352418899536,
-0.14899316430091858,
-0.9005942940711975,
... |
func (a Address) Equal(b Address) bool {
if a.Type != b.Type {
return false
}
switch a.Type {
case AddressFQDN:
return bytes.Equal(a.Host, b.Host)
default:
return a.IP.Equal(b.IP)
}
} | [
-0.7981451153755188,
-0.06758702546358109,
0.606865406036377,
0.11636202782392502,
0.3593866527080536,
-0.04406778886914253,
-0.17736205458641052,
-0.5621150732040405,
0.40769168734550476,
0.29978686571121216,
-0.4221157133579254,
1.2071905136108398,
-0.7321914434432983,
-0.354986429214477... |
func (c *Candidate) Reset() {
c.ConnectionAddress.reset()
c.RelatedAddress.reset()
c.RelatedPort = 0
c.NetworkCost = 0
c.Generation = 0
c.Transport = ct.ProtocolUnknown
c.TransportValue = c.TransportValue[:0]
c.Attributes = c.Attributes[:0]
} | [
-0.523800253868103,
-0.8538715243339539,
0.14416451752185822,
-0.488086998462677,
0.40087082982063293,
0.5121830701828003,
0.45256349444389343,
0.4910701513290405,
-0.884164571762085,
-0.058791570365428925,
-0.3694632053375244,
1.1506038904190063,
-0.4678807258605957,
-0.3717031180858612,
... |
func (c *Candidate) Equal(b *Candidate) bool {
if !c.ConnectionAddress.Equal(b.ConnectionAddress) {
return false
}
if c.Port != b.Port {
return false
}
if c.Transport != b.Transport {
return false
}
if !bytes.Equal(c.TransportValue, b.TransportValue) {
return false
}
if c.Foundation != b.Foundation {
... | [
-0.9291624426841736,
-1.0720689296722412,
0.5770035982131958,
-0.3439173996448517,
0.44939565658569336,
0.9151132106781006,
-0.30902886390686035,
0.46860238909721375,
-0.9772456288337708,
0.5613997578620911,
-1.042437195777893,
0.5083420872688293,
-0.9002930521965027,
0.11981374025344849,
... |
func (a Attributes) Value(k []byte) []byte {
for _, attribute := range a {
if bytes.Equal(attribute.Key, k) {
return attribute.Value
}
}
return nil
} | [
0.17478179931640625,
-0.48135098814964294,
0.3818151354789734,
0.32481998205184937,
-0.2466692179441452,
-0.13543787598609924,
-0.14689461886882782,
0.11442729085683823,
0.1114947721362114,
1.2471067905426025,
0.06898133456707001,
0.09547030180692673,
-0.21086518466472626,
0.26052245497703... |
func (a Attributes) Equal(b Attributes) bool {
if len(a) != len(b) {
return false
}
for _, attr := range a {
v := b.Value(attr.Key)
if !bytes.Equal(v, attr.Value) {
return false
}
}
for _, attr := range b {
v := a.Value(attr.Key)
if !bytes.Equal(v, attr.Value) {
return false
}
}
return true
} | [
-0.704624593257904,
-0.11969328671693802,
0.7132388949394226,
-0.5255612134933472,
0.3457429111003876,
0.3656412661075592,
-0.5946138501167297,
0.19592829048633575,
-0.9845221042633057,
0.9219961762428284,
-0.846937358379364,
0.35749348998069763,
-0.32763099670410156,
0.19739849865436554,
... |
func b2s(b []byte) string {
return *(*string)(unsafe.Pointer(&b)) // #nosec
} | [
0.2570231258869171,
-1.1183931827545166,
0.22639168798923492,
-0.3237820863723755,
-0.854638934135437,
-1.0168181657791138,
-0.4626285433769226,
-1.4315118789672852,
0.37696322798728943,
0.5542817115783691,
-0.29191383719444275,
1.1807047128677368,
-0.16857849061489105,
-0.5905445218086243... |
func (p *candidateParser) parse() error {
if len(p.buf) < minBufLen {
return fmt.Errorf("buffer too small (%d < %d)", len(p.buf), minBufLen)
}
// special cases for raw value support:
if p.buf[0] == 'a' {
p.buf = bytes.TrimPrefix(p.buf, []byte("a="))
}
if p.buf[0] == 'c' {
p.buf = bytes.TrimPrefix(p.buf, []b... | [
-0.07391097396612167,
-0.982094407081604,
0.7504419684410095,
-0.4809609353542328,
-1.151536226272583,
-0.06621038913726807,
-0.02955056168138981,
0.708915114402771,
-0.574309766292572,
0.6192573308944702,
-0.6435519456863403,
0.010755937546491623,
-0.7808249592781067,
0.48462092876434326,... |
func ParseAttribute(v []byte, c *Candidate) error {
p := candidateParser{
buf: v,
c: c,
}
err := p.parse()
return err
} | [
0.30810466408729553,
-1.0169918537139893,
0.1674293875694275,
-0.7018537521362305,
-0.32194676995277405,
0.17849686741828918,
-0.008691065944731236,
1.0261509418487549,
-0.2807982861995697,
0.5703116655349731,
-0.01814361661672592,
0.3072977662086487,
-0.7362204194068909,
-0.03263058513402... |
func addAdditonalYelpDetails(coffeeShop *models.CoffeeShop, yelpBusiness *yelp.Business) {
coffeeShop.Photos = yelpBusiness.Photos
coffeeShop.Location = yelpBusiness.Location
coffeeShop.Price = yelpBusiness.Price
coffeeShop.Phone = yelpBusiness.Phone
coffeeShop.Hours = yelpBusiness.Hours
} | [
0.30846071243286133,
-0.8014966249465942,
0.4739534854888916,
0.9731303453445435,
-0.4879213571548462,
0.7163284420967102,
-0.6785755157470703,
-0.02915167063474655,
0.6413253545761108,
-0.34871524572372437,
-0.5057201385498047,
0.6954509615898132,
0.4103533923625946,
0.8168298602104187,
... |
func (sf *SecretFileServer) Put(serviceAccount string, keycert util.KeyCertBundle) error {
_, priv, cert, root := keycert.GetAllPem()
dir := path.Join(sf.rootDir, serviceAccount)
if _, err := os.Stat(dir); os.IsNotExist(err) {
if err := os.Mkdir(dir, 0700); err != nil {
return fmt.Errorf("failed to create direc... | [
0.3922310173511505,
0.5149044990539551,
0.7405164837837219,
-0.18600770831108093,
-0.16031257808208466,
0.8528591990470886,
1.4713051319122314,
0.2993985116481781,
-0.7407899498939514,
-0.10279074311256409,
-0.6216303110122681,
0.4075948894023895,
-1.300779938697815,
0.0695805549621582,
... |
func collectSwiftAcountInfo(client swift.Connection) error {
info, hdr, err := client.Account()
if err != nil {
log.Printf("Can't get info from Swift: %s \n", err.Error())
return err
}
currentSwiftAcountUsed = float64(info.BytesUsed)
//fmt.Printf("Bytes used: %.0f\n", currentSwiftAcountUsed)
currentSwiftQ... | [
0.41777777671813965,
-0.9058405756950378,
0.7502355575561523,
-0.6821773648262024,
0.06279970705509186,
-0.31546550989151,
0.1505310982465744,
0.02697967365384102,
-0.7991735935211182,
0.5365313291549683,
0.23965226113796234,
0.9560161232948303,
0.39421525597572327,
1.204732894897461,
1.... |
func checkInputVars() {
var err error
_, err = url.ParseRequestURI(swiftAuthUrl)
if err != nil {
log.Fatalf("Wrong or empty URL for Swift Endpoint: %s \n", err.Error())
}
if swiftUserName == "" {
logFatalfwithUsage("Empty username for Swift login!\n")
}
if swiftPassword == "" {
logFatalfwithUsage("Empt... | [
-0.7744259238243103,
-0.1748286783695221,
0.5710185170173645,
-0.10548333823680878,
0.758368194103241,
0.7222946286201477,
-0.16071124374866486,
-0.16102337837219238,
-0.8755876421928406,
-0.014359676279127598,
0.7375350594520569,
0.8227319121360779,
-0.9592869281768799,
0.4970214962959289... |
func parseInputVars() {
flag.StringVar(&addr, "listen-address", ":8080", "The address to listen on for HTTP requests.")
flag.StringVar(&swiftAuthUrl, "swift-auth-url", "https://10.200.52.80:5000/v2.0", "The URL for Swift connection")
flag.StringVar(&swiftUserName, "swift-user-name", "", "The username for swift login... | [
0.23214857280254364,
-0.6081006526947021,
0.8725716471672058,
-0.3412037789821625,
0.37074214220046997,
0.850513219833374,
0.23651619255542755,
-0.19739851355552673,
-1.3775466680526733,
-0.3474844694137573,
-0.0870397761464119,
0.6393588781356812,
-0.4994864761829376,
0.764338493347168,
... |
func logFatalfwithUsage(format string, v ...interface{}) {
log.Printf(format, v...)
flag.Usage()
os.Exit(1)
} | [
0.4427836835384369,
-0.42445147037506104,
0.44932258129119873,
0.5773259997367859,
0.5817438364028931,
0.11913692951202393,
-0.43366092443466187,
-0.035302598029375076,
-0.5038011074066162,
0.07542926073074341,
0.2256251722574234,
0.37955567240715027,
0.5119903683662415,
1.1336053609848022... |
func (fa *AuditLog) Ready() error {
return fa.ReadyRet
} | [
0.30586180090904236,
-0.18822547793388367,
0.40376147627830505,
-0.4937748610973358,
-0.2957235276699066,
-0.10912357270717621,
0.19551219046115875,
-0.001908019999973476,
0.8023144006729126,
-0.3078516721725464,
-0.17709997296333313,
1.1685020923614502,
0.46087953448295593,
-0.25187358260... |
func (fa *AuditLog) RegisterHandlers(api *operations.NuvolosoAPI) {
fa.RegisterHandlersAPI = api
fa.Annotations = make([]*Args, 0, 1)
fa.Events = make([]*Args, 0, 1)
fa.Posts = make([]*Args, 0, 1)
} | [
0.0033854315988719463,
0.13713645935058594,
0.20797081291675568,
0.0013913820730522275,
0.9471729397773743,
-0.35856691002845764,
0.12012198567390442,
-0.3316754996776581,
-0.4640284776687622,
-0.49519485235214233,
-0.5706616640090942,
0.3145918548107147,
-0.17722190916538239,
0.5834749937... |
func (fa *AuditLog) Annotation(ctx context.Context, ai auth.Subject, parent int32, action centrald.AuditAction, oid models.ObjID, name models.ObjName, err bool, msg string) {
args := &Args{AI: ai, Parent: parent, Action: action, ObjID: oid, Name: name, Err: err, Message: msg}
fa.Annotations = append(fa.Annotations, a... | [
0.18971490859985352,
-0.26823511719703674,
0.5615954399108887,
-0.2594168484210968,
0.1383267641067505,
0.22539524734020233,
0.723588764667511,
-0.13550569117069244,
0.8607978820800781,
0.6589055061340332,
-0.19923637807369232,
0.6089494824409485,
0.5113165378570557,
0.8225065469741821,
... |
func (fa *AuditLog) Event(ctx context.Context, ai auth.Subject, action centrald.AuditAction, oid models.ObjID, name models.ObjName, refID models.ObjIDMutable, err bool, msg string) {
args := &Args{AI: ai, Action: action, ObjID: oid, Name: name, RefID: refID, Err: err, Message: msg}
fa.Events = append(fa.Events, args)... | [
0.44428110122680664,
-0.2940010726451874,
0.5888020396232605,
-0.4379437267780304,
0.47202473878860474,
0.9037068486213684,
0.5479812026023865,
-0.0406930036842823,
0.9180511832237244,
0.36153537034988403,
0.09443828463554382,
1.3388720750808716,
0.6463571786880493,
1.1071174144744873,
0... |
func (fa *AuditLog) Post(ctx context.Context, ai auth.Subject, action centrald.AuditAction, oid models.ObjID, name models.ObjName, refID models.ObjIDMutable, err bool, msg string) {
args := &Args{AI: ai, Action: action, ObjID: oid, Name: name, RefID: refID, Err: err, Message: msg}
fa.Posts = append(fa.Posts, args)
} | [
0.06987699866294861,
-0.29297128319740295,
0.5998381972312927,
0.03180566802620888,
-0.05486578866839409,
0.625217080116272,
0.029621785506606102,
-0.6873670220375061,
0.44139283895492554,
-0.2268328070640564,
0.3412795662879944,
0.6508153080940247,
-0.2070736438035965,
0.9859329462051392,... |
func (fa *AuditLog) Expire(ctx context.Context, baseTime time.Time) error {
fa.ExpireCtx = ctx
return fa.ExpireRet
} | [
0.2608603835105896,
-0.4007459282875061,
0.3337903618812561,
-0.05236302316188812,
-0.20219992101192474,
0.06229996308684349,
-0.6654765605926514,
-0.6247738599777222,
0.6039198637008667,
-0.21539443731307983,
0.2273636758327484,
-0.0930442363023758,
-0.18541093170642853,
-0.18253172934055... |
func (c *Client) Mutate(m interface{}, variables map[string]interface{}) error {
ctx := context.Background()
return c.client(ctx).Mutate(ctx, m, variables)
} | [
-0.343001127243042,
0.08209066838026047,
0.3381820619106293,
0.35611578822135925,
0.3931240439414978,
-0.24022792279720306,
-0.8450785279273987,
-0.7879695296287537,
-0.3217661678791046,
0.5408881306648254,
0.0961906835436821,
0.8006469011306763,
-1.3619664907455444,
0.375383585691452,
-... |
func (c *Client) Query(q interface{}, variables map[string]interface{}) error {
ctx := context.Background()
return c.client(ctx).Query(ctx, q, variables)
} | [
0.18161752820014954,
0.0958019569516182,
0.3244963586330414,
-0.11544089764356613,
-0.13938932120800018,
0.16187210381031036,
-1.1093111038208008,
-0.5508649945259094,
-0.18573163449764252,
0.12795259058475494,
0.5358096361160278,
1.0003348588943481,
-1.2614483833312988,
0.406249076128006,... |
func NewServer() *negroni.Negroni {
formatter := render.New(render.Options{
IndentJSON: true,
})
n := negroni.Classic()
mx := mux.NewRouter()
initConfig()
initRoutes(mx, formatter)
n.UseHandler(mx)
return n
} | [
-0.8684925436973572,
-0.8981990218162537,
0.5522888898849487,
0.7753547430038452,
-0.7831920385360718,
0.035594817250967026,
-0.34953197836875916,
0.7071143388748169,
-0.2523600161075592,
-0.8576726317405701,
-0.847192108631134,
0.5211341977119446,
-0.12330953031778336,
0.6164876222610474,... |
func imageHandler(formatter *render.Render) http.HandlerFunc {
return func(w http.ResponseWriter, req *http.Request) {
setupResponse(&w, req)
params := mux.Vars(req)
var imageId string = params["id"]
fmt.Println( "Image ID: ", imageId )
session, err := mgo.Dial(mongodb_server)
if err != nil {
var ... | [
-0.730962872505188,
-0.5434951186180115,
0.8926578164100647,
-0.06939397752285004,
-0.13676948845386505,
-0.1319287121295929,
-0.23513862490653992,
0.23395909368991852,
0.02313544787466526,
0.5588029026985168,
0.36650794744491577,
-0.014613904058933258,
-0.4810486435890198,
0.9815188646316... |
func imagePostHandler(formatter *render.Render) http.HandlerFunc {
return func(w http.ResponseWriter, req *http.Request) {
setupResponse(&w, req)
if (*req).Method == "OPTIONS" {
return
}
var image Image
image.Id = uuid.NewV4().String()
image.Description = req.FormValue("description")
image.UserId = re... | [
-0.8802850842475891,
-0.03840354084968567,
1.097618818283081,
0.31646832823753357,
0.16040866076946259,
0.0713525041937828,
-0.009363585151731968,
-0.12880945205688477,
-0.6253572702407837,
0.19658175110816956,
-0.06275767832994461,
-0.16785210371017456,
-0.10228743404150009,
0.58680152893... |
func userImagesHandler(formatter *render.Render) http.HandlerFunc {
return func(w http.ResponseWriter, req *http.Request) {
enableCors(&w)
params := mux.Vars(req)
var userId string = params["userId"]
fmt.Println( "UserId: ", userId )
session, err := mgo.Dial(mongodb_server)
if err != nil {
var err... | [
-0.45189979672431946,
-0.18014684319496155,
0.7981077432632446,
0.1112162172794342,
-0.4152234196662903,
-0.10661182552576065,
0.46281465888023376,
-0.1749209761619568,
-0.2217477560043335,
0.6564339399337769,
-0.09888831526041031,
-0.2870524525642395,
-0.047718435525894165,
1.256608486175... |
func allImagesHandler(formatter *render.Render) http.HandlerFunc {
return func(w http.ResponseWriter, req *http.Request) {
enableCors(&w)
session, err := mgo.Dial(mongodb_server)
if err != nil {
var errorResponse ErrorResponse
errorResponse.Message = "Server Error"
formatter.JSON(w, http.StatusInt... | [
-0.30639877915382385,
-0.5485451817512512,
1.0039103031158447,
-0.020930346101522446,
-0.10475198924541473,
-0.35359305143356323,
-0.10264455527067184,
0.41848400235176086,
-0.4027882218360901,
0.5008552670478821,
-0.0163551215082407,
-0.5614627599716187,
-0.3946128487586975,
1.54963409900... |
func AllMessages() []api.Message {
return []api.Message{
(*OneAddDelAdjacency)(nil),
(*OneAddDelAdjacencyReply)(nil),
(*OneAddDelL2ArpEntry)(nil),
(*OneAddDelL2ArpEntryReply)(nil),
(*OneAddDelLocalEid)(nil),
(*OneAddDelLocalEidReply)(nil),
(*OneAddDelLocator)(nil),
(*OneAddDelLocatorReply)(nil),
(*On... | [
-0.6688153147697449,
-0.3982023000717163,
0.7945094704627991,
-0.00429069809615612,
0.8415431976318359,
0.3285493850708008,
0.1227678433060646,
-0.5179328322410583,
1.3965078592300415,
-0.7001669406890869,
-0.0635155439376831,
-0.28400304913520813,
-0.5578057765960693,
1.1082186698913574,
... |
func NewForConfig(c *rest.Config) (*BindV1alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &BindV1alpha1Client{client}, nil
} | [
0.4796164333820343,
-0.9457923173904419,
0.36680033802986145,
0.1739473193883896,
-0.8658256530761719,
-0.047045186161994934,
0.6027560830116272,
0.5500741004943848,
-0.02569727599620819,
0.07600203901529312,
-0.0005028168670833111,
0.3738466799259186,
-0.29886147379875183,
0.6725061535835... |
func NewForConfigOrDie(c *rest.Config) *BindV1alpha1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
} | [
0.2605825364589691,
-0.8755385279655457,
0.10168571770191193,
0.02494080737233162,
-1.0095268487930298,
0.4086771309375763,
0.21965651214122772,
-0.18209819495677948,
-0.7276240587234497,
0.20854006707668304,
1.0955227613449097,
0.065374955534935,
-0.7423602342605591,
0.5765970349311829,
... |
func New(c rest.Interface) *BindV1alpha1Client {
return &BindV1alpha1Client{c}
} | [
-0.2148851901292801,
-1.7211940288543701,
0.3520885109901428,
0.28131991624832153,
-1.011478304862976,
0.968173086643219,
0.741356611251831,
0.12579871714115143,
-0.200430765748024,
0.4713384211063385,
0.3439037501811981,
0.540191113948822,
-0.11416959017515182,
0.455947607755661,
0.9372... |
func (c *BindV1alpha1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}
return c.restClient
} | [
0.4653787314891815,
-0.8189079165458679,
0.5400837659835815,
0.8429902195930481,
-0.29400235414505005,
0.6073243618011475,
0.7838647365570068,
0.2512686550617218,
0.7630243301391602,
-0.784507155418396,
0.0703490823507309,
0.9249362349510193,
-1.1911475658416748,
-0.22773127257823944,
0.... |
func CreateChunkFile(ops []*batch.Operation) *ChunkFile {
var deltas []string
deltas = append(deltas, getDeltas(batch.OperationTypeCreate, ops)...)
deltas = append(deltas, getDeltas(batch.OperationTypeRecover, ops)...)
deltas = append(deltas, getDeltas(batch.OperationTypeUpdate, ops)...)
return &ChunkFile{Deltas... | [
0.7141003608703613,
0.05797531455755234,
0.5490049123764038,
0.5208077430725098,
0.3864055275917053,
0.7052927613258362,
0.7447333335876465,
-0.31058892607688904,
-1.0093190670013428,
-0.008968804962933064,
-0.006813087034970522,
-0.2718043029308319,
0.32969897985458374,
0.2238052487373352... |
func ParseChunkFile(content []byte) (*ChunkFile, error) {
cf, err := getChunkFile(content)
if err != nil {
return nil, err
}
// TODO: Verify chunk file - issue-296
return cf, nil
} | [
1.0073565244674683,
-0.2504742443561554,
0.22705577313899994,
-0.09192575514316559,
0.1818479746580124,
0.23391473293304443,
1.3103816509246826,
-0.3399794399738312,
-0.6761493682861328,
0.06528875976800919,
-0.42757436633110046,
0.04167325422167778,
-0.43941283226013184,
0.130578130483627... |
func unmarshalChunkFile(bytes []byte) (*ChunkFile, error) {
file := &ChunkFile{}
err := json.Unmarshal(bytes, file)
if err != nil {
return nil, err
}
return file, nil
} | [
0.4877066910266876,
0.06513207405805588,
0.7773484587669373,
-1.1012300252914429,
-0.3253794014453888,
0.28295525908470154,
0.5139471292495728,
0.351112961769104,
-0.9568590521812439,
0.7913493514060974,
-0.31912755966186523,
0.18175837397575378,
-0.1738450527191162,
-0.443868488073349,
... |
func initJaeger(service string) (opentracing.Tracer, io.Closer) {
cfg := &config.Configuration{
Sampler: &config.SamplerConfig{
Type: jaeger.SamplerTypeConst,
Param: 1,
},
Reporter: &config.ReporterConfig{
LogSpans: true,
CollectorEndpoint: "http://jaeger:14268/api/traces",
},
}
tracer,... | [
0.029836434870958328,
-0.21394933760166168,
0.8537508249282837,
-0.47836947441101074,
-1.2659732103347778,
0.04585544392466545,
0.4501782953739166,
-0.3262787163257599,
0.31366467475891113,
-0.03432335704565048,
-0.4169863164424896,
0.2940995991230011,
-0.7386570572853088,
1.90772426128387... |
func ValidatePattern(patternElement interface{}, path string, supportedAnchors []commonAnchors.IsAnchor) (string, error) {
switch typedPatternElement := patternElement.(type) {
case map[string]interface{}:
return validateMap(typedPatternElement, path, supportedAnchors)
case []interface{}:
return validateArray(ty... | [
-0.41208717226982117,
-0.056940339505672455,
0.5007495284080505,
0.4912296235561371,
0.1860610991716385,
0.5038284659385681,
0.815734326839447,
-0.11202093213796616,
0.6847464442253113,
-0.08197527378797531,
0.8607129454612732,
0.5038168430328369,
-0.06033598631620407,
0.2209111452102661,
... |
func (a *Lisp_address) lisp_print_address(with_iid bool) string {
if (a.address_string == "") { a.address_string = a.address.String() }
if (with_iid) {
iid := a.instance_id
if (iid == 0xffffff) { iid = -1 }
return(fmt.Sprintf("[%d]%s", iid, a.address_string))
}
return(a.address_string)
} | [
-0.5762530565261841,
-1.2939183712005615,
0.6764507293701172,
-1.256300449371338,
-0.45053043961524963,
-0.150428906083107,
-0.3558465540409088,
-0.2728617191314697,
1.032893419265747,
0.5570675134658813,
1.0479450225830078,
1.1166622638702393,
-1.062223196029663,
-0.28834983706474304,
1... |
func (a *Lisp_address) lisp_store_address(iid int, addr string) bool {
var address string
//
// Is this address string an address or a prefix?
//
if (strings.Contains(addr, "/")) {
split := strings.Split(addr, "/")
address = split[0]
a.mask_len, _ = strconv.Atoi(split[1])
} else {
address = addr
a.mask... | [
-0.4445321261882782,
-0.7859775424003601,
0.6706773042678833,
-1.03084135055542,
-0.6965030431747437,
-0.24949859082698822,
0.3401065766811371,
-0.2354021817445755,
1.3479444980621338,
0.022818673402071,
-0.25984856486320496,
0.34289923310279846,
-0.635724663734436,
-0.600203812122345,
0... |
func (a *Lisp_address) lisp_is_ipv4() bool {
return((len(a.address) == 4))
} | [
-0.7869241833686829,
-0.28406721353530884,
0.21895639598369598,
-0.37328967452049255,
0.03688749670982361,
0.08540789783000946,
-0.444589227437973,
-0.04893742874264717,
1.2515546083450317,
0.5031298398971558,
-0.27340492606163025,
0.1546233892440796,
-0.4939984679222107,
-0.14330580830574... |
func (a *Lisp_address) lisp_is_ipv6() bool {
return((len(a.address) == 16))
} | [
-0.3406118154525757,
0.06349698454141617,
0.34884878993034363,
0.00011019330122508109,
0.6512974500656128,
-0.10144102573394775,
-0.45605701208114624,
0.6907616257667542,
1.8739856481552124,
0.6946693658828735,
-0.5582869648933411,
0.1899660974740982,
0.05272693559527397,
-0.50028818845748... |
func (a *Lisp_address) lisp_is_multicast() bool {
if (a.lisp_is_ipv4()) {
return(int(a.address[0]) >= 224 && int(a.address[0]) < 240)
}
if (a.lisp_is_ipv6()) {
return(a.address[0] == 0xff)
}
return(false)
} | [
-1.1617289781570435,
-0.23371434211730957,
0.5745235681533813,
-0.2188693732023239,
-0.6663615703582764,
-0.843259334564209,
-0.3129531145095825,
-0.12816265225410461,
2.1295523643493652,
0.5275856256484985,
-0.21489675343036652,
0.6694021224975586,
-0.4472268223762512,
0.10792610794305801... |
func (a *Lisp_address) lisp_make_address(iid int, addr []byte) {
a.instance_id = iid
a.address = addr
a.mask_len = len(a.address) * 8
a.mask_address = net.CIDRMask(a.mask_len, len(a.address) * 8)
} | [
-0.2488216757774353,
-0.7375013828277588,
0.40502461791038513,
-1.2651759386062622,
-0.06674892455339432,
0.1612967848777771,
0.165498286485672,
0.10593654960393906,
1.3298169374465942,
0.2992354929447174,
-0.012843847274780273,
0.5948808789253235,
0.0017748447135090828,
-1.044380903244018... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.