text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (o *NodeUpdate) GetBootStateOk() (*BootStateType, bool) {
if o == nil {
return nil, false
}
return &o.BootState, true
} | [
0.02965514175593853,
0.22368435561656952,
0.8384224772453308,
1.4679696559906006,
-0.7029212713241577,
-0.2685484290122986,
0.6060796976089478,
-0.07450009882450104,
-0.41258785128593445,
0.161395862698555,
-1.3131755590438843,
-0.6995415687561035,
0.2525525689125061,
0.6041891574859619,
... |
func (o *NodeUpdate) SetBootState(v BootStateType) {
o.BootState = v
} | [
-0.24178901314735413,
-0.06589006632566452,
-0.042220588773489,
0.9468518495559692,
-1.0382286310195923,
-0.30419349670410156,
-0.3561778664588928,
-0.587613582611084,
0.5944017767906189,
0.16489942371845245,
-0.9078169465065002,
0.5920042991638184,
-0.46438467502593994,
0.9263988137245178... |
func (o *NodeUpdate) GetInterfaces() []InterfaceType {
if o == nil {
var ret []InterfaceType
return ret
}
return o.Interfaces
} | [
-0.5000958442687988,
0.35958147048950195,
0.02158050425350666,
0.7274764180183411,
0.9612035155296326,
0.18090540170669556,
0.9533559679985046,
-0.09036461263895035,
1.1569209098815918,
-0.7443097233772278,
-0.05698293074965477,
-0.41983526945114136,
-1.4054007530212402,
0.8159266710281372... |
func (o *NodeUpdate) GetInterfacesOk() (*[]InterfaceType, bool) {
if o == nil {
return nil, false
}
return &o.Interfaces, true
} | [
-0.7759994864463806,
1.438010334968567,
0.48136448860168457,
0.5543959140777588,
0.3749125003814697,
-0.3017532229423523,
1.181577205657959,
0.3177310824394226,
0.43780088424682617,
0.40662476420402527,
-1.403598666191101,
-0.7006570100784302,
-0.5680738687515259,
-0.3134770095348358,
-0... |
func (o *NodeUpdate) SetInterfaces(v []InterfaceType) {
o.Interfaces = v
} | [
-1.3838095664978027,
0.6327835321426392,
-0.26508891582489014,
0.15545658767223358,
0.3229827880859375,
0.30744826793670654,
0.41401898860931396,
-0.5937314033508301,
0.23632670938968658,
0.05845596641302109,
-0.5711159110069275,
-0.4102660119533539,
-1.335853099822998,
1.10456120967865,
... |
func (o *NodeUpdate) GetHostname() string {
if o == nil {
var ret string
return ret
}
return o.Hostname
} | [
0.3184313476085663,
-0.09327831119298935,
0.11499045044183731,
0.7263063192367554,
-0.26145657896995544,
0.07341578602790833,
0.6679747104644775,
0.6350122094154358,
-0.1304769068956375,
-0.5414147973060608,
0.22177211940288544,
-1.2134281396865845,
-0.6640369892120361,
-0.081403449177742,... |
func (o *NodeUpdate) GetHostnameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Hostname, true
} | [
0.133611798286438,
-0.05489248037338257,
0.6994936466217041,
0.4795449674129486,
-0.6571032404899597,
0.22671331465244293,
0.6176227331161499,
1.0810344219207764,
-1.2221133708953857,
0.7613741755485535,
-1.0599218606948853,
-1.1368088722229004,
0.5229896903038025,
0.49186331033706665,
0... |
func (o *NodeUpdate) SetHostname(v string) {
o.Hostname = v
} | [
0.050651438534259796,
-0.0661858543753624,
-0.025424351915717125,
0.5916092395782471,
-1.0896275043487549,
-0.3339555859565735,
-0.23596398532390594,
0.5607725381851196,
-0.4623333811759949,
0.6916272044181824,
-0.577308714389801,
-0.33764538168907166,
-0.23297612369060516,
-0.403594970703... |
func (o *NodeUpdate) GetNodeId() int32 {
if o == nil {
var ret int32
return ret
}
return o.NodeId
} | [
0.5354494452476501,
0.11945614963769913,
0.5512539744377136,
0.05316692590713501,
0.32991456985473633,
1.3296178579330444,
0.8601284027099609,
0.27594780921936035,
0.9741794466972351,
-0.12994177639484406,
0.17055156826972961,
-0.3846519887447357,
-0.4436521530151367,
0.6048066020011902,
... |
func (o *NodeUpdate) GetNodeIdOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.NodeId, true
} | [
-0.3323782980442047,
0.30816856026649475,
0.6262137293815613,
0.3153250217437744,
0.5553205609321594,
0.6256027817726135,
0.7125633358955383,
0.3970046639442444,
0.11271064728498459,
0.3165731430053711,
-1.2315647602081299,
-0.6542592644691467,
0.15123291313648224,
0.7440282702445984,
-0... |
func (o *NodeUpdate) SetNodeId(v int32) {
o.NodeId = v
} | [
-0.019500797614455223,
0.3149898946285248,
0.19980134069919586,
-0.6861428022384644,
-0.44646698236465454,
1.3807874917984009,
0.17610949277877808,
-0.03754089027643204,
0.410979300737381,
0.8833684325218201,
-0.28553006052970886,
0.15045586228370667,
-0.2759305238723755,
0.934402048587799... |
func (o *NodeUpdate) GetSiteId() int32 {
if o == nil {
var ret int32
return ret
}
return o.SiteId
} | [
0.7229527235031128,
0.08460623770952225,
0.31240978837013245,
0.6912062168121338,
0.4083503782749176,
1.086888074874878,
1.0057977437973022,
0.2872536778450012,
1.2356244325637817,
-0.22832053899765015,
0.15720275044441223,
-0.7403475642204285,
-1.0372146368026733,
0.15919890999794006,
0... |
func (o *NodeUpdate) GetSiteIdOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.SiteId, true
} | [
-0.30557072162628174,
0.44131264090538025,
0.5145484209060669,
0.855617344379425,
0.6763498187065125,
0.602260172367096,
1.3073559999465942,
0.555863618850708,
0.9108297824859619,
0.09529265016317368,
-1.3412907123565674,
-0.6692224144935608,
-0.2524588704109192,
0.2761625647544861,
-0.8... |
func (o *NodeUpdate) SetSiteId(v int32) {
o.SiteId = v
} | [
0.2061752825975418,
0.21606814861297607,
-0.05118713155388832,
-0.43480369448661804,
-0.8616364598274231,
0.988601803779602,
0.3586585819721222,
-0.392972856760025,
0.8062403798103333,
1.09903085231781,
-0.5885342359542847,
-0.1257937103509903,
-0.7128438949584961,
0.3127383589744568,
-0... |
func (o *NodeUpdate) GetAttributes() []map[string]interface{} {
if o == nil || o.Attributes == nil {
var ret []map[string]interface{}
return ret
}
return *o.Attributes
} | [
-0.030631838366389275,
0.2516769468784332,
0.3036019206047058,
0.46547824144363403,
0.5896027088165283,
-0.9309728145599365,
0.35674983263015747,
0.22055362164974213,
0.9157841205596924,
-0.40818601846694946,
0.08460652828216553,
-1.3124988079071045,
-0.8679793477058411,
0.8097517490386963... |
func (o *NodeUpdate) GetAttributesOk() (*[]map[string]interface{}, bool) {
if o == nil || o.Attributes == nil {
return nil, false
}
return o.Attributes, true
} | [
0.3795712888240814,
0.018080253154039383,
-0.1047612875699997,
0.077275350689888,
-0.26922890543937683,
-0.1285042017698288,
0.8814901113510132,
-0.2443659007549286,
-0.1399179995059967,
0.8758435249328613,
-0.36805659532546997,
-0.6972384452819824,
0.1415870189666748,
0.4746587872505188,
... |
func (o *NodeUpdate) HasAttributes() bool {
if o != nil && o.Attributes != nil {
return true
}
return false
} | [
0.5085306167602539,
0.5772899389266968,
-0.04929971694946289,
-0.3723351061344147,
0.447654664516449,
-0.1826612651348114,
-0.15524913370609283,
0.8547945618629456,
0.29572051763534546,
-0.7684587836265564,
-0.08808276057243347,
-1.1309006214141846,
-0.7815110683441162,
0.04235551878809929... |
func (o *NodeUpdate) GetAdministrativeState() AdministrativeStateType {
if o == nil {
var ret AdministrativeStateType
return ret
}
return o.AdministrativeState
} | [
1.2138314247131348,
-0.04803742468357086,
-0.23698756098747253,
-0.28455179929733276,
-0.7584600448608398,
0.4151179790496826,
-0.27276507019996643,
-0.7781915664672852,
0.1307353675365448,
-0.1191500872373581,
-0.5048667192459106,
0.2586376368999481,
-0.20825397968292236,
-0.5467737913131... |
func (o *NodeUpdate) GetAdministrativeStateOk() (*AdministrativeStateType, bool) {
if o == nil {
return nil, false
}
return &o.AdministrativeState, true
} | [
0.4126749634742737,
-0.011223630979657173,
0.26261308789253235,
-0.07844708859920502,
-1.1826294660568237,
0.7103028297424316,
-0.39597421884536743,
-0.13645309209823608,
-0.1465260535478592,
1.1500834226608276,
-0.797361433506012,
-0.4486367702484131,
1.164402723312378,
0.0938014909625053... |
func (o *NodeUpdate) SetAdministrativeState(v AdministrativeStateType) {
o.AdministrativeState = v
} | [
0.8110125064849854,
-0.2283054143190384,
-0.346915602684021,
-1.0429677963256836,
-1.251276969909668,
0.3274834156036377,
-0.40059465169906616,
-1.0574331283569336,
-0.09592016041278839,
0.9843007326126099,
-0.4368784427642822,
0.5541781187057495,
0.31861600279808044,
0.17042547464370728,
... |
func (o *NodeUpdate) GetDnsServers() []string {
if o == nil {
var ret []string
return ret
}
return o.DnsServers
} | [
-0.8935084342956543,
1.1015210151672363,
-0.010485808365046978,
0.6336845755577087,
0.4379516839981079,
-0.10888182371854782,
-0.34923380613327026,
-0.897264301776886,
1.423089623451233,
-0.6271016001701355,
-1.6409204006195068,
-0.24309466779232025,
-0.5441939830780029,
0.3102139532566070... |
func (o *NodeUpdate) GetDnsServersOk() (*[]string, bool) {
if o == nil {
return nil, false
}
return &o.DnsServers, true
} | [
-1.2943743467330933,
0.9547749161720276,
-0.08392564952373505,
0.12926174700260162,
-0.435436874628067,
-0.565052330493927,
0.4115959703922272,
-0.9676215052604675,
0.9028518199920654,
1.1297448873519897,
-1.894765853881836,
-0.7823531627655029,
0.4208582937717438,
0.12575340270996094,
-... |
func (o *NodeUpdate) SetDnsServers(v []string) {
o.DnsServers = v
} | [
-1.424078106880188,
0.46891117095947266,
-0.16604292392730713,
-0.3423795998096466,
-0.013733423314988613,
-0.18076395988464355,
-0.417073518037796,
-1.264522910118103,
0.9362413287162781,
0.15987852215766907,
-1.8087137937545776,
-0.1330706626176834,
-0.4160550534725189,
0.485164076089859... |
func extractFile(r *http.Request, name string) (multipart.File, string, int64, error) {
files, found := r.MultipartForm.File[name]
if !found || len(files) < 1 {
return nil, "", 0, fmt.Errorf("'%s' not found", name)
}
file := files[0]
f, err := file.Open()
if err != nil {
return nil, "", 0, errors.New("could ... | [
-0.10735608637332916,
-0.015948675572872162,
0.8323977589607239,
-0.1980171948671341,
-0.1324882209300995,
-0.9213494658470154,
0.23547406494617462,
0.041608456522226334,
-0.6333039402961731,
0.6399655938148499,
-0.2541716992855072,
-1.2368322610855103,
-0.3892992436885834,
0.3833981156349... |
func doIt(rootpath string, isRecursive bool, outputType string) {
// buildFileTree first builds a structure of FileInfo elements
fileInfo := readFileInfo(rootpath)
rootnode := convertFileInfoToFormatted(fileInfo)
output, _ := buildDirTree(rootpath, &rootnode, isRecursive)
// Now output the results
switch output... | [
-0.27566829323768616,
-0.32742542028427124,
0.657360315322876,
0.25333496928215027,
0.41777053475379944,
-0.13782478868961334,
0.6445184946060181,
-0.5988685488700867,
-0.4824845790863037,
-0.6015840768814087,
1.2176865339279175,
-0.22839152812957764,
0.026434611529111862,
1.13249421119689... |
func resourceVolterraNetworkInterface() *schema.Resource {
return &schema.Resource{
Create: resourceVolterraNetworkInterfaceCreate,
Read: resourceVolterraNetworkInterfaceRead,
Update: resourceVolterraNetworkInterfaceUpdate,
Delete: resourceVolterraNetworkInterfaceDelete,
Schema: map[string]*schema.Schema{... | [
0.14425206184387207,
0.15796180069446564,
0.8032123446464539,
-0.8805686235427856,
0.07448650151491165,
-0.23935066163539886,
0.3013036549091339,
-0.445543497800827,
0.19410935044288635,
0.41186684370040894,
-0.031827233731746674,
-0.2746135890483856,
-0.397797554731369,
-0.051376629620790... |
func resourceVolterraNetworkInterfaceCreate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*APIClient)
createMeta := &ves_io_schema.ObjectCreateMetaType{}
createSpec := &ves_io_schema_network_interface.CreateSpecType{}
createReq := &ves_io_schema_network_interface.CreateRequest{
Metadata: crea... | [
-0.22609353065490723,
0.31232038140296936,
0.8226655125617981,
-0.45166435837745667,
0.4349859654903412,
0.45853614807128906,
0.1801498979330063,
-0.715071439743042,
-0.16174085438251495,
0.8629727959632874,
-0.04741346836090088,
-0.28414008021354675,
-0.4285278618335724,
0.273590862751007... |
func resourceVolterraNetworkInterfaceUpdate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*APIClient)
updateMeta := &ves_io_schema.ObjectReplaceMetaType{}
updateSpec := &ves_io_schema_network_interface.ReplaceSpecType{}
updateReq := &ves_io_schema_network_interface.ReplaceRequest{
Metadata: u... | [
-0.10452336817979813,
-0.46290335059165955,
0.7857630848884583,
-0.6330389380455017,
-0.3042779266834259,
0.09800992906093597,
-0.04042401909828186,
-0.2006514072418213,
0.0619979128241539,
0.9563582539558411,
0.2119298279285431,
0.12026938050985336,
-0.860095739364624,
0.01061933953315019... |
func fileList(folder string, fileChannel chan string) error {
return filepath.Walk(folder, func(path string, info os.FileInfo, err error) error {
if err != nil || info.IsDir() {
return err
}
fileChannel <- path
return nil
})
} | [
0.06179327890276909,
-0.945125937461853,
0.731772243976593,
-0.31649699807167053,
0.5354471206665039,
-0.055717870593070984,
0.16633106768131256,
0.6051509380340576,
-0.4747563600540161,
0.267987996339798,
-0.025482390075922012,
0.2325676679611206,
-0.1834152340888977,
1.6125556230545044,
... |
func putFile(sess *session.Session, bucket, filePath string) (*s3.PutObjectOutput, error) {
file, err := os.OpenFile(filePath, os.O_RDONLY, 0644)
if err != nil {
return nil, err
}
defer file.Close()
params := &s3.PutObjectInput{
Bucket: aws.String(bucket),
Key: aws.String(filePath),
Body: file,
}
re... | [
0.31484246253967285,
-0.45760077238082886,
0.47001615166664124,
-0.3970642685890198,
-0.6026158928871155,
0.599247932434082,
0.5135512351989746,
-0.2848793566226959,
-0.36265280842781067,
0.5496339201927185,
-0.2853299677371979,
-0.053218401968479156,
-0.6910459995269775,
-1.09492981433868... |
func (c *Container) statInsideMount(containerPath string) (*copier.StatForItem, string, string, error) {
resolvedRoot := "/"
resolvedPath := c.pathAbs(containerPath)
var statInfo *copier.StatForItem
err := c.joinMountAndExec(
func() error {
var statErr error
statInfo, statErr = secureStat(resolvedRoot, res... | [
0.41139939427375793,
-0.3025996685028076,
0.6065937876701355,
0.4876212477684021,
0.015793485566973686,
-0.20052358508110046,
0.47693008184432983,
-0.9591472744941711,
0.20337730646133423,
-1.0076533555984497,
-0.5596175193786621,
-0.3675607740879059,
0.08059124648571014,
-0.16503123939037... |
func (c *Container) statInContainer(mountPoint string, containerPath string) (*copier.StatForItem, string, string, error) {
if c.state.State == define.ContainerStateRunning {
// If the container is running, we need to join it's mount namespace
// and stat there.
return c.statInsideMount(containerPath)
}
// If ... | [
0.7891885042190552,
-0.4078316390514374,
0.5686007142066956,
0.8665549159049988,
0.5528116822242737,
-0.258016437292099,
0.1402798593044281,
-1.0379096269607544,
0.1778125762939453,
-0.4360603988170624,
0.3237192630767822,
0.1893519014120102,
-0.32207801938056946,
0.5954748392105103,
0.0... |
func (m *MatcherFunc) Match(r *Request) bool {
return m.Func(r)
} | [
-0.7485840916633606,
0.13903719186782837,
0.23279976844787598,
0.4475090503692627,
-0.5392849445343018,
0.19678477942943573,
0.4444272518157959,
0.16796544194221497,
-0.20070110261440277,
-0.43821507692337036,
0.3945641815662384,
-0.6575567126274109,
-0.17155465483665466,
0.413366436958313... |
func (t TypeMatcher) Match(r *Request) bool {
return r.Header.Type == Type(t)
} | [
-1.3620703220367432,
-0.4542151093482971,
0.5081405639648438,
0.5833775997161865,
-0.1910313218832016,
0.4666682481765747,
-0.692084550857544,
-0.6578634977340698,
-0.32455581426620483,
0.4367550015449524,
-0.024403922259807587,
-0.46995019912719727,
-0.8762310743331909,
0.4903665781021118... |
func MultiMatcher(m ...Matcher) Matcher {
fn := func(r *Request) bool {
for _, matcher := range m {
if !matcher.Match(r) {
return false
}
}
return true
}
return &MatcherFunc{fn}
} | [
-1.069266438484192,
-0.10301928222179413,
0.6669679880142212,
1.0455999374389648,
-0.7268322110176086,
0.07912260293960571,
-0.5802112221717834,
0.11415780335664749,
0.07663267850875854,
-1.0875903367996216,
-0.39580512046813965,
-1.5302566289901733,
-0.48871102929115295,
1.125699400901794... |
func NewServeMux() *ServeMux {
return &ServeMux{handlers: make(map[Matcher]*muxEntry)}
} | [
-0.7016155123710632,
-0.41332224011421204,
0.2733502984046936,
0.3969915211200714,
-0.6606075763702393,
0.040654923766851425,
-0.5874062180519104,
0.8161991834640503,
-0.07989168167114258,
-0.3621339201927185,
-0.884934663772583,
0.32284894585609436,
-0.3042309284210205,
0.2547862827777862... |
func (mux *ServeMux) handle(e *muxEntry) {
mux.mu.Lock()
defer mux.mu.Unlock()
if e.matcher == nil {
panic("openflow: nil matcher")
}
if e.handler == nil {
panic("openflow: nil handler")
}
if _, dup := mux.handlers[e.matcher]; dup {
text := "openflow: multiple registrations for %v"
panic(fmt.Errorf(te... | [
-0.2098110318183899,
0.9626059532165527,
0.6310569047927856,
0.21725806593894958,
0.8742885589599609,
0.1162543073296547,
0.20551608502864838,
0.37221625447273254,
0.5184946060180664,
-0.5366573929786682,
-0.34246981143951416,
0.05499078333377838,
-0.5654879808425903,
0.35529884696006775,
... |
func (mux *ServeMux) Handle(m Matcher, h Handler) {
mux.handle(&muxEntry{m, h, false})
} | [
0.2036190927028656,
-0.10778432339429855,
0.5054128766059875,
0.31349530816078186,
-0.11262089014053345,
0.6034648418426514,
-0.07139722257852554,
0.5857424736022949,
-0.42754676938056946,
-0.9117063283920288,
0.06232961267232895,
0.29670456051826477,
-0.9771824479103088,
0.338940799236297... |
func (mux *ServeMux) HandleOnce(m Matcher, h Handler) {
mux.handle(&muxEntry{m, h, true})
} | [
-0.08214515447616577,
0.5556371808052063,
0.4466985762119293,
0.8632866144180298,
0.5003079771995544,
0.13922621309757233,
-0.20814001560211182,
0.46133145689964294,
-0.1560399830341339,
-0.5723437666893005,
0.11428246647119522,
-0.2595875561237335,
-1.3690152168273926,
0.6776347756385803,... |
func (mux *ServeMux) HandleFunc(m Matcher, h HandlerFunc) {
mux.Handle(m, h)
} | [
0.5138778686523438,
-0.0327504463493824,
0.34853336215019226,
0.4229085445404053,
-0.5122125148773193,
0.10757232457399368,
0.597332775592804,
1.1648541688919067,
-0.7295873165130615,
-0.8028761148452759,
0.33337756991386414,
0.15578126907348633,
1.0545188188552856,
0.05283914878964424,
... |
func (mux *ServeMux) Handler(r *Request) Handler {
var matcher Matcher
var entry *muxEntry
// Acquire a read lock to ensure that list would not
// be modified during the search of registered handler.
mux.mu.RLock()
var matched bool
// Try to match the processing request to any of the registered
// filters.
f... | [
0.2619272768497467,
-0.09675025939941406,
0.5228630304336548,
0.3418833911418915,
-0.13875450193881989,
-0.0838254764676094,
1.1330201625823975,
-0.12584926187992096,
0.5190555453300476,
-0.3216738700866699,
0.676124632358551,
0.08021534979343414,
-1.0550551414489746,
0.5384640693664551,
... |
func (mux *ServeMux) Serve(rw ResponseWriter, r *Request) {
h := mux.Handler(r)
h.Serve(rw, r)
} | [
-0.3246561884880066,
-0.2345057725906372,
0.329110711812973,
0.549706757068634,
-0.4578351676464081,
0.6167296767234802,
-0.1931760162115097,
-0.08518492430448532,
-0.8209108114242554,
-0.7063540816307068,
-0.3901255130767822,
-0.10662631690502167,
-0.401807963848114,
0.6934390068054199,
... |
func (mux *TypeMux) Handle(t Type, h Handler) {
mux.mux.Handle(TypeMatcher(t), h)
} | [
-0.7334977388381958,
-0.1184021458029747,
0.6875723004341125,
0.4609926640987396,
0.10459732264280319,
0.8276711106300354,
-0.19015873968601227,
-0.11062479019165039,
-0.7370341420173645,
-0.3934508264064789,
-0.208581805229187,
0.45961129665374756,
-0.74943608045578,
0.2713273763656616,
... |
func (mux *TypeMux) HandleOnce(t Type, h Handler) {
mux.mux.HandleOnce(TypeMatcher(t), h)
} | [
-1.0167202949523926,
0.7134643197059631,
0.5609493851661682,
0.9514185190200806,
0.5132082104682922,
0.2721940875053406,
0.09689808636903763,
-0.25079345703125,
-0.5845934748649597,
-0.1069020926952362,
-0.03242955356836319,
-0.1867855191230774,
-1.2945793867111206,
0.8183513283729553,
0... |
func (mux *TypeMux) HandleFunc(t Type, f HandlerFunc) {
mux.Handle(t, f)
} | [
0.20392553508281708,
0.01821069046854973,
0.399122029542923,
0.13060405850410461,
-0.0342550054192543,
0.2233557254076004,
0.3170533776283264,
0.3924778699874878,
-1.0953179597854614,
-0.1826603263616562,
0.5072155594825745,
0.5823187828063965,
1.3925180435180664,
-0.5733137130737305,
0.... |
func (mux *TypeMux) Handler(r *Request) Handler {
return mux.mux.Handler(r)
} | [
-0.6237170696258545,
-0.5129138231277466,
0.19058386981487274,
0.3419979512691498,
-0.6916905045509338,
0.752643883228302,
-0.13601887226104736,
-0.2773212194442749,
0.7083248496055603,
-0.836021900177002,
0.2569847106933594,
0.2944561839103699,
0.1681673526763916,
-0.35915452241897583,
... |
func (mux *TypeMux) Serve(rw ResponseWriter, r *Request) {
mux.mux.Serve(rw, r)
} | [
-0.577165424823761,
-0.5369032025337219,
0.3536352217197418,
0.25073811411857605,
-0.2644757032394409,
0.25919657945632935,
0.04801870137453079,
-0.6073809862136841,
-0.6269785761833191,
-0.07795272767543793,
-0.15301288664340973,
0.2724483907222748,
-0.7221615314483643,
0.4679314196109772... |
func Handle(t Type, handler Handler) {
DefaultMux.Handle(t, handler)
} | [
-0.11687060445547104,
0.6944934129714966,
0.4545411467552185,
0.9199246764183044,
0.48749804496765137,
0.6235761642456055,
-0.26781097054481506,
0.07532157003879547,
-0.5909279584884644,
-0.8881177306175232,
-0.4195636212825775,
0.26744842529296875,
-0.7498195767402649,
0.49658387899398804... |
func HandleOnce(t Type, handler Handler) {
DefaultMux.HandleOnce(t, handler)
} | [
-0.5047475695610046,
1.1583021879196167,
0.4273684322834015,
1.297892451286316,
0.6473454236984253,
0.04432971030473709,
-0.09724518656730652,
0.03102797456085682,
-0.6249582171440125,
-0.249989315867424,
-0.27459222078323364,
-0.03978218138217926,
-1.1217793226242065,
1.0438904762268066,
... |
func HandleFunc(t Type, f func(ResponseWriter, *Request)) {
DefaultMux.HandleFunc(t, f)
} | [
-0.01714388094842434,
0.8402368426322937,
0.4182371497154236,
0.9716649055480957,
0.5175856351852417,
-0.3463715612888336,
0.2590378224849701,
0.520551860332489,
-0.5830317139625549,
-0.6396492123603821,
0.8405131101608276,
-0.5213614106178284,
0.9344521760940552,
-0.5162133574485779,
-0... |
func dropLeft(nums1, nums2 []int, K int) int {
size1 := len(nums1)
size2 := len(nums2)
var longNums, shortNums []int
var shortSize int
if size1 < size2 {
longNums = nums2
shortNums = nums1
shortSize = size1
}else {
longNums = nums1
shortNums = nums2
shortSize = size2
}
if shortSize < 1 {
return lo... | [
0.5386937856674194,
-0.3157946467399597,
0.868057131767273,
-0.2278364598751068,
-0.62813800573349,
0.5252135396003723,
0.0886363759636879,
-0.21127906441688538,
0.360877126455307,
0.23880161345005035,
-0.5299457907676697,
0.8972389698028564,
-0.19057433307170868,
0.671581506729126,
-0.2... |
func toDigits(str string) (digits []byte) {
for _, r := range str {
// Check if rune is a digit
if !isDigit(r) {
// Rune is not a digit, continue
continue
}
// We know that the rune is always a single-byte rune because we only accept digits
digits = append(digits, byte(r))
}
return
} | [
-0.1949141025543213,
0.008675003424286842,
0.5034599304199219,
0.04521435499191284,
0.3558902144432068,
-0.01926244981586933,
0.8079385757446289,
0.4903692603111267,
0.6059024333953857,
0.19422167539596558,
-0.5321504473686218,
0.6950801014900208,
-0.943153977394104,
1.1481380462646484,
... |
func HashKey(key int) int {
/*
tiedot should be compiled/run on x86-64 systems.
If you decide to compile tiedot on 32-bit systems, the following integer-smear algorithm will cause compilation failure
due to 32-bit interger overflow; therefore you must modify the algorithm.
Do not remove the integer-smear proce... | [
-0.4683566093444824,
0.8244419097900391,
0.7012611627578735,
0.3387955129146576,
-0.5202663540840149,
0.5570970773696899,
0.9182460308074951,
0.2936820387840271,
-0.12070160359144211,
1.0422624349594116,
-0.05535145848989487,
0.04727298021316528,
-0.7977842688560486,
1.1531739234924316,
... |
func OpenHashTable(path string) (ht *HashTable, err error) {
ht = &HashTable{Lock: new(sync.RWMutex)}
if ht.DataFile, err = OpenDataFile(path, HT_FILE_GROWTH); err != nil {
return
}
ht.calculateNumBuckets()
return
} | [
0.014148651622235775,
0.4803069531917572,
0.8088258504867554,
0.15967629849910736,
-0.45835480093955994,
0.6395440101623535,
1.2491921186447144,
-0.3312222957611084,
-0.840477705001831,
-0.5371650457382202,
-0.18750369548797607,
-0.5987346172332764,
0.22644826769828796,
-0.1459656506776809... |
func (ht *HashTable) calculateNumBuckets() {
ht.numBuckets = ht.Size / BUCKET_SIZE
largestBucketNum := INITIAL_BUCKETS - 1
for i := 0; i < INITIAL_BUCKETS; i++ {
lastBucket := ht.lastBucket(i)
if lastBucket > largestBucketNum && lastBucket < ht.numBuckets {
largestBucketNum = lastBucket
}
}
ht.numBuckets ... | [
0.11709050089120865,
0.15854009985923767,
0.7620077133178711,
0.38850322365760803,
0.5216965079307556,
-0.7987261414527893,
1.3726006746292114,
-0.30560731887817383,
-0.801930844783783,
-0.6528445482254028,
-0.9026764035224915,
-0.69559246301651,
0.22042414546012878,
0.843863308429718,
0... |
func (ht *HashTable) nextBucket(bucket int) int {
if bucket >= ht.numBuckets {
return 0
}
bucketAddr := bucket * BUCKET_SIZE
nextUint, err := binary.Varint(ht.Buf[bucketAddr : bucketAddr+10])
next := int(nextUint)
if next == 0 {
return 0
} else if err < 0 || next <= bucket || next >= ht.numBuckets || next < ... | [
-0.4369681179523468,
0.4016933739185333,
0.8200449347496033,
0.007270498666912317,
-0.5440003871917725,
-0.20297035574913025,
1.0965279340744019,
-0.026529453694820404,
-0.41389068961143494,
-1.2068910598754883,
0.17610956728458405,
0.01510657463222742,
-0.3161943554878235,
0.1127208769321... |
func (ht *HashTable) lastBucket(bucket int) int {
for curr := bucket; ; {
next := ht.nextBucket(curr)
if next == 0 {
return curr
}
curr = next
}
} | [
-0.5065683722496033,
-0.05639321729540825,
0.8279537558555603,
-0.4961547255516052,
0.08623043447732925,
-0.48012101650238037,
0.8923592567443848,
-0.5408581495285034,
-0.6098358035087585,
-0.8105589151382446,
0.1574363261461258,
-0.8441098928451538,
-0.8981295228004456,
0.3773839175701141... |
func (ht *HashTable) growBucket(bucket int) {
ht.EnsureSize(BUCKET_SIZE)
lastBucketAddr := ht.lastBucket(bucket) * BUCKET_SIZE
binary.PutVarint(ht.Buf[lastBucketAddr:lastBucketAddr+10], int64(ht.numBuckets))
ht.Used += BUCKET_SIZE
ht.numBuckets++
} | [
0.031553659588098526,
1.2011398077011108,
0.9404086470603943,
-0.5601553320884705,
1.2714488506317139,
-0.21656274795532227,
0.8123941421508789,
-0.7439895272254944,
-0.2622508704662323,
-1.5480411052703857,
-0.8419029712677002,
-0.2746904194355011,
0.4815136790275574,
0.5267533659934998,
... |
func (ht *HashTable) Clear() (err error) {
if err = ht.DataFile.Clear(); err != nil {
return
}
ht.calculateNumBuckets()
return
} | [
0.019983559846878052,
0.6696396470069885,
0.41162997484207153,
0.05925190821290016,
0.013058486394584179,
1.3022732734680176,
0.41719943284988403,
-0.7082785367965698,
-1.5865339040756226,
-0.2124430537223816,
-0.08182620257139206,
-0.21070744097232819,
1.1463786363601685,
0.32395842671394... |
func (ht *HashTable) Sync() (err error) {
if err = ht.DataFile.Sync(); err != nil {
return
}
return nil
} | [
0.6225766539573669,
0.1214546337723732,
0.354451984167099,
0.4136092960834503,
-0.0876292809844017,
0.5214992165565491,
-0.06096751242876053,
-0.98619145154953,
-1.8857964277267456,
0.6048444509506226,
-0.38722366094589233,
0.3841880261898041,
0.7614822387695312,
0.4156129062175751,
-0.0... |
func (ht *HashTable) Put(key, val int) {
for bucket, entry := HashKey(key), 0; ; {
entryAddr := bucket*BUCKET_SIZE + BUCKET_HEADER + entry*ENTRY_SIZE
if ht.Buf[entryAddr] != 1 {
ht.Buf[entryAddr] = 1
binary.PutVarint(ht.Buf[entryAddr+1:entryAddr+11], int64(key))
binary.PutVarint(ht.Buf[entryAddr+11:entryA... | [
-0.3144955337047577,
1.0167782306671143,
0.6755218505859375,
-0.4151873290538788,
-0.15167799592018127,
0.3939642906188965,
1.0757452249526978,
-0.43140730261802673,
-1.004716157913208,
0.04742474853992462,
-0.6286993622779846,
-0.4946307837963104,
-0.26872706413269043,
0.29069069027900696... |
func (ht *HashTable) Get(key, limit int) (vals []int) {
if limit == 0 {
vals = make([]int, 0, 10)
} else {
vals = make([]int, 0, limit)
}
for count, entry, bucket := 0, 0, HashKey(key); ; {
entryAddr := bucket*BUCKET_SIZE + BUCKET_HEADER + entry*ENTRY_SIZE
entryKey, _ := binary.Varint(ht.Buf[entryAddr+1 : e... | [
-0.6632723212242126,
0.12033960223197937,
1.004923701286316,
-0.07451430708169937,
-0.0280909426510334,
-0.6304917931556702,
0.1980743110179901,
0.18239200115203857,
-0.9257284998893738,
0.011525601148605347,
-0.007785818073898554,
0.2688729465007782,
-0.28905153274536133,
0.09013033658266... |
func (ht *HashTable) Remove(key, val int) {
for entry, bucket := 0, HashKey(key); ; {
entryAddr := bucket*BUCKET_SIZE + BUCKET_HEADER + entry*ENTRY_SIZE
entryKey, _ := binary.Varint(ht.Buf[entryAddr+1 : entryAddr+11])
entryVal, _ := binary.Varint(ht.Buf[entryAddr+11 : entryAddr+21])
if ht.Buf[entryAddr] == 1 {... | [
-0.34059974551200867,
0.10416652262210846,
0.7450510859489441,
0.1409420669078827,
-1.0679110288619995,
-0.04506639018654823,
0.6944867968559265,
0.21555772423744202,
-0.5617617964744568,
0.11820568144321442,
-0.31520652770996094,
-0.528175950050354,
-0.5696879029273987,
0.7224379777908325... |
func GetPartitionRange(partNum, totalParts int) (start int, end int) {
perPart := INITIAL_BUCKETS / totalParts
leftOver := INITIAL_BUCKETS % totalParts
start = partNum * perPart
if leftOver > 0 {
if partNum == 0 {
end += 1
} else if partNum < leftOver {
start += partNum
end += 1
} else {
start += ... | [
-0.24615034461021423,
-0.5257940888404846,
0.6489124894142151,
0.008430715650320053,
0.28046855330467224,
-0.15508967638015747,
0.6602581143379211,
-0.08045178651809692,
-0.6342368125915527,
-0.2770903706550598,
-0.2647055387496948,
-0.318556010723114,
-0.6363739371299744,
-0.3731569945812... |
func (ht *HashTable) collectEntries(head int) (keys, vals []int) {
keys = make([]int, 0, PER_BUCKET)
vals = make([]int, 0, PER_BUCKET)
var entry, bucket int = 0, head
for {
entryAddr := bucket*BUCKET_SIZE + BUCKET_HEADER + entry*ENTRY_SIZE
entryKey, _ := binary.Varint(ht.Buf[entryAddr+1 : entryAddr+11])
entry... | [
-0.38740867376327515,
-0.4806530475616455,
0.7510417103767395,
-0.04556507617235184,
-0.5427501797676086,
-0.5224412679672241,
0.9167864918708801,
-0.3627212941646576,
-0.6092466711997986,
0.04580821841955185,
-0.04607133939862251,
-0.19996371865272522,
0.5079177021980286,
1.56257069110870... |
func (ht *HashTable) GetPartition(partNum, partSize int) (keys, vals []int) {
rangeStart, rangeEnd := GetPartitionRange(partNum, partSize)
prealloc := (rangeEnd - rangeStart) * PER_BUCKET
keys = make([]int, 0, prealloc)
vals = make([]int, 0, prealloc)
for head := rangeStart; head < rangeEnd; head++ {
k, v := ht.... | [
-0.556826114654541,
0.042721495032310486,
0.6911432147026062,
-0.21958832442760468,
-0.29795920848846436,
-0.9583078026771545,
0.6392836570739746,
-0.23676107823848724,
-0.7014440298080444,
0.1272374391555786,
-0.4436827301979065,
-0.18057090044021606,
-0.24884039163589478,
0.0253055915236... |
func ReallySimpleSort(A []int) []int {
k := 0
for i := range A {
if A[i] == 1 {
k++
}
}
for i := range A {
switch i < k {
case true:
A[i] = 1
case false:
A[i] = 2
}
}
return A
} | [
-1.0605008602142334,
0.3320827782154083,
0.5738505125045776,
-0.07932063192129135,
-1.0887624025344849,
-0.34249231219291687,
0.7247930765151978,
0.2685835659503937,
0.7832152247428894,
0.16614896059036255,
-0.6787932515144348,
-0.0749034732580185,
-0.16078506410121918,
0.5106609463691711,... |
func Age(s float64, p Planet) float64 {
orbitalPeriod := map[Planet]float64{
"Mercury": 0.2408467,
"Venus": 0.61519726,
"Earth": 1.0,
"Mars": 1.8808158,
"Jupiter": 11.862615,
"Saturn": 29.447498,
"Uranus": 84.016846,
"Neptune": 164.79132,
}
return (s / 31557600) / orbitalPeriod[p]
} | [
-0.7849411368370056,
-0.3695286810398102,
0.9005928039550781,
-1.0247935056686401,
-0.4179759621620178,
1.082980990409851,
-0.6953680515289307,
0.021091148257255554,
-0.35011348128318787,
0.4437921643257141,
0.4901469647884369,
0.5471771359443665,
-0.29740267992019653,
0.7523820400238037,
... |
func RegisterCodec(cdc *codec.Codec) {
cdc.RegisterConcrete(MsgRequestRand{}, "irishub/rand/MsgRequestRand", nil)
cdc.RegisterConcrete(&Rand{}, "irishub/rand/Rand", nil)
cdc.RegisterConcrete(&Request{}, "irishub/rand/Request", nil)
} | [
-0.3107988238334656,
0.7419096231460571,
0.5829008221626282,
-0.6793855428695679,
1.1134415864944458,
0.452298641204834,
0.5627617239952087,
-0.36075517535209656,
0.5731663703918457,
-1.4736181497573853,
-0.13206453621387482,
1.1065094470977783,
0.29352128505706787,
1.2362662553787231,
-... |
func (c *Client) OAuthClientCreate(name string, redirectUri string) (*OAuthClient, error) {
params := struct {
Name string `json:"name"`
RedirectUri string `json:"redirect_uri"`
}{
Name: name,
RedirectUri: redirectUri,
}
var oauthClientRes OAuthClient
return &oauthClientRes, c.Post(&oauthClie... | [
-0.5289989709854126,
-0.588800311088562,
0.5157991051673889,
-0.17184504866600037,
-0.2093212604522705,
0.14513470232486725,
0.16283322870731354,
-0.7539352774620056,
0.3289487361907959,
-0.366942822933197,
-0.20400257408618927,
0.5705292820930481,
-0.30383676290512085,
-0.6248349547386169... |
func (c *Client) OAuthClientDelete(oauthClientIdentity string) error {
return c.Delete("/oauth/clients/" + oauthClientIdentity)
} | [
0.28457164764404297,
-1.142622947692871,
0.2767009735107422,
0.029817895963788033,
0.30749568343162537,
0.267330527305603,
0.5602465867996216,
-0.5297366976737976,
0.6581315994262695,
0.3733743727207184,
0.42632168531417847,
0.5326133370399475,
-0.1421976536512375,
-0.34539029002189636,
... |
func (c *Client) OAuthClientInfo(oauthClientIdentity string) (*OAuthClient, error) {
var oauthClient OAuthClient
return &oauthClient, c.Get(&oauthClient, "/oauth/clients/"+oauthClientIdentity)
} | [
-0.14774289727210999,
-1.0379581451416016,
0.38803616166114807,
-0.6089299321174622,
-0.08753014355897903,
-0.43857091665267944,
-0.05133931711316109,
-0.6482092142105103,
0.211593359708786,
0.0159367136657238,
-0.005505468230694532,
1.1898527145385742,
0.09556005150079727,
-0.503554522991... |
func (c *Client) OAuthClientList(lr *ListRange) ([]OAuthClient, error) {
req, err := c.NewRequest("GET", "/oauth/clients", nil, nil)
if err != nil {
return nil, err
}
if lr != nil {
lr.SetHeader(req)
}
var oauthClientsRes []OAuthClient
return oauthClientsRes, c.DoReq(req, &oauthClientsRes)
} | [
-1.1873412132263184,
-0.8965697884559631,
0.08853030949831009,
0.005359528586268425,
0.5629482865333557,
-0.2816075384616852,
-0.23140984773635864,
-0.243633434176445,
0.3652370572090149,
0.45861998200416565,
0.22385089099407196,
0.8477157354354858,
-0.5989038944244385,
0.5132699012756348,... |
func (c *Client) OAuthClientUpdate(oauthClientIdentity string, options *OAuthClientUpdateOpts) (*OAuthClient, error) {
var oauthClientRes OAuthClient
return &oauthClientRes, c.Patch(&oauthClientRes, "/oauth/clients/"+oauthClientIdentity, options)
} | [
-0.16990706324577332,
-1.7619397640228271,
0.3732927739620209,
-0.45661279559135437,
-0.027018792927265167,
0.19716931879520416,
0.03707977756857872,
-0.3545939326286316,
1.1771020889282227,
0.3216218948364258,
0.3414677381515503,
0.4217233657836914,
-0.6458438038825989,
-0.992572367191314... |
func Bool(i interface{}) bool {
if i == nil {
return false
}
if v, ok := i.(bool); ok {
return v
}
if s := String(i); s != "" && s != "0" && s != "false" && s != "off" {
return true
}
return false
} | [
-0.44267624616622925,
0.1504574865102768,
0.44969016313552856,
-0.13623715937137604,
-0.9846466183662415,
0.28333601355552673,
0.45284852385520935,
0.48828840255737305,
0.2548733949661255,
0.25469714403152466,
-0.15917523205280304,
-0.13434141874313354,
-0.06066922843456268,
-0.45102763175... |
func fillMap(c *capitalMap) {
c.set("Netherlands", "Amsterdam")
c.set("Denmark", "Copenhagen")
time.Sleep(2 * time.Millisecond)
c.set("Sweden", "Stockholm")
c.set("Norway", "Oslo")
time.Sleep(2 * time.Millisecond)
c.set("Finland", "Helsinki")
} | [
-0.3946670591831207,
0.42798125743865967,
0.5292086005210876,
-0.6353048086166382,
-0.32357949018478394,
0.9870128631591797,
0.29715654253959656,
-0.18373659253120422,
0.6844070553779602,
0.23978549242019653,
-0.484840452671051,
-0.24112333357334137,
-0.14148184657096863,
0.631384074687957... |
func GroupedService(group string) *kube.Service {
return Service(group, Headless(), Selector(map[string]string{"group": group}))
} | [
-0.28759223222732544,
-0.062265362590551376,
0.009891684167087078,
-0.040130965411663055,
-0.14901483058929443,
-0.0027733652386814356,
0.29125434160232544,
-1.7161076068878174,
-0.4406512975692749,
-0.28115472197532654,
0.4031845033168793,
1.0584717988967896,
-0.7973945140838623,
0.027109... |
func handleStopNotifyChainChanges(wsc *wsClient, icmd interface{}) (interface{}, error) {
wsc.server.ntfnMgr.UnregisterChainChanges(wsc)
return nil, nil
} | [
-0.4894723892211914,
0.10671570897102356,
0.21431469917297363,
-0.7364457845687866,
0.4169904589653015,
-0.6148121356964111,
0.43415799736976624,
-0.5799596309661865,
-0.9495003819465637,
0.31006813049316406,
-0.6034659743309021,
0.17019575834274292,
-0.9000175595283508,
0.3288418650627136... |
func TestEval(t *testing.T) {
any := `.+`
testCases := []struct {
name string
query string
wantErr string
want []values.Value
}{
{
name: "string interpolation",
query: `
str = "str"
ing = "ing"
"str + ing = ${str+ing}"`,
want: []values.Value{
values.NewString("str + ing = s... | [
0.12468792498111725,
0.1550188660621643,
0.8266666531562805,
-0.5029679536819458,
-0.2442946583032608,
0.6012024283409119,
0.1860295981168747,
-0.7129600644111633,
-0.02617839351296425,
-0.20746612548828125,
-0.7323970198631287,
0.058314189314842224,
-0.0171712227165699,
-0.243786334991455... |
func TestInterpreter_MultipleEval(t *testing.T) {
type scriptWithSideEffects struct {
script string
sideEffects []interpreter.SideEffect
}
testCases := []struct {
name string
lines []scriptWithSideEffects
}{
{
name: "1 expression statement",
lines: []scriptWithSideEffects{
{
script: ... | [
-0.046585600823163986,
0.14433841407299042,
0.8599114418029785,
-0.6994897127151489,
-0.2824001610279083,
-0.2570462226867676,
0.08855079114437103,
0.3689142167568207,
-0.005775308236479759,
-0.5427447557449341,
-0.6519945859909058,
-0.2898131310939789,
-0.07856150716543198,
0.273464649915... |
func NewCaesar() Cipher {
return Vigenere{key: "d"}
} | [
-1.0128324031829834,
-0.7348132133483887,
0.12944428622722626,
0.6060330867767334,
-2.111257553100586,
-0.13532517850399017,
-0.7015658617019653,
-0.3764060437679291,
-0.013826470822095871,
-0.24965018033981323,
-0.9136483073234558,
-0.3761533498764038,
0.07735731452703476,
1.2655677795410... |
func NewShift(distance int) Cipher {
// Corner case when of 0, 26, -26
if distance <= -26 || distance >= 26 {
return nil
}
return NewVigenere(string(mapChar('a', int32(distance))))
} | [
-0.21402885019779205,
-1.0986043214797974,
0.553645670413971,
0.15224406123161316,
-1.3757314682006836,
0.07683610916137695,
-0.5242307186126709,
-1.0980654954910278,
0.9190497994422913,
0.4171459376811981,
-0.46311405301094055,
0.61814945936203,
-0.3841409981250763,
0.06311046332120895,
... |
func NewVigenere(k string) Cipher {
if regexp.MustCompile(`[^a-z]`).MatchString(k) || regexp.MustCompile(`^a*$`).MatchString(k) {
return nil
}
return Vigenere{key: k}
} | [
-0.40249642729759216,
-0.6906992197036743,
0.23051422834396362,
0.4293995797634125,
-1.4640917778015137,
-0.4611860513687134,
-1.1236528158187866,
0.2566286325454712,
0.13514363765716553,
0.7182050347328186,
-0.3738178610801697,
-0.30005142092704773,
-0.9199987649917603,
0.6104429364204407... |
func stripString(s string) (o string) {
o = RegularExp.ReplaceAllString(s, "")
log.Printf(" String: %s", o)
o = strings.ToLower(o)
return
} | [
1.0672202110290527,
-0.9160581827163696,
0.33302706480026245,
-1.0538815259933472,
0.052601877599954605,
0.05820606276392937,
0.5678144693374634,
0.29942336678504944,
0.8602061867713928,
-0.4173557460308075,
-0.39103397727012634,
0.10245852917432785,
-0.23190844058990479,
-0.89636874198913... |
func (e Vigenere) Encode(s string) (o string) {
var sb strings.Builder
o = ""
s = stripString(s)
if s == "" || len(s) <= 0 {
return
}
log.Printf(" Encode: %s", s)
// Iterate throught the runes
for i, m := range s {
newChar := mapChar(m, int32(e.key[i%len(e.key)]-'a'))
fmt.Fprintf(&sb, "%c", newChar)
... | [
0.2991572916507721,
0.23852567374706268,
0.49586883187294006,
0.02914479374885559,
-0.4692316949367523,
-0.3420484960079193,
0.4977872371673584,
0.5753675103187561,
0.2031983733177185,
0.5277897715568542,
0.7291406989097595,
0.5468840599060059,
-0.2918130159378052,
-0.037732724100351334,
... |
func (e Vigenere) Decode(s string) (o string) {
var sb strings.Builder
o = ""
log.Printf(" Decode: %s", s)
if s == "" || len(s) <= 0 {
return
}
for i, m := range s {
newChar := mapChar(m, -int32(e.key[i%len(e.key)]-'a'))
fmt.Fprintf(&sb, "%c", newChar)
}
o = sb.String()
log.Printf(" Decoded: %s", o)... | [
-0.19919981062412262,
-0.26113376021385193,
0.6026797294616699,
0.1329686939716339,
-0.5655953884124756,
-0.6185572147369385,
0.283653199672699,
0.739799439907074,
0.23494334518909454,
0.30028292536735535,
0.15511932969093323,
0.21640370786190033,
-0.4961206614971161,
0.0022812148090451956... |
func square(img *image.Paletted, p squareParams) {
for x := p.from.x; x < p.to.x; x++ {
for y := p.from.y; y < p.to.y; y++ {
img.Set(x, y, p.c)
}
}
} | [
-0.7876535058021545,
-0.7483609914779663,
0.4780718982219696,
-0.43685492873191833,
0.647331178188324,
0.5363277792930603,
-0.2373904287815094,
-0.3590447008609772,
-0.09252031147480011,
0.12319774925708771,
-0.5872197151184082,
0.6586547493934631,
0.30035027861595154,
0.14764639735221863,... |
func createUlam(positions []position) *gif.GIF {
var (
images []*image.Paletted // images for the gif
delays []int // delays to transition to the next gif
lines []lineParams // parameters for each line creation call
squares []squareParams // parameters for each squares - de... | [
-0.07810890674591064,
-0.1147882342338562,
0.9242132902145386,
-0.5522711873054504,
0.07991345226764679,
-0.26564404368400574,
0.4469354748725891,
0.2997119426727295,
0.6903656721115112,
-0.2117006629705429,
-0.09512238204479218,
-0.33178338408470154,
0.5212301015853882,
0.2278697192668914... |
func ConnectDB() (*gorm.DB, error) {
err := godotenv.Load()
if err != nil {
fmt.Printf("[DB Load Env] %s\n", err)
fmt.Printf("Attempting to load online environment...\n")
}
host := os.Getenv("PG_HOST")
username := os.Getenv("PG_USER")
pass := os.Getenv("PG_PASSWORD")
dbname := os.Getenv("PG_DBNAME")
port, ... | [
-0.16037124395370483,
-0.6265817880630493,
1.1227701902389526,
0.5724987387657166,
0.035019565373659134,
1.1776458024978638,
0.20717774331569672,
-0.09034638106822968,
-1.20041024684906,
0.3029990494251251,
1.1440693140029907,
0.5136159658432007,
-1.0385092496871948,
0.7887353301048279,
... |
func DeriveCount(metric_in, m1Prefix string) (metric_out string) {
if IsMetric20(metric_in) {
parts := strings.Split(metric_in, ".")
for i, part := range parts {
if strings.HasPrefix(part, "unit=") || strings.HasPrefix(part, "unit_is_") {
parts[i] = part + "ps"
}
}
metric_out = strings.Join(parts, ".... | [
0.14873789250850677,
0.0029280472081154585,
0.7503238916397095,
-0.3642476797103882,
0.915739893913269,
0.047187820076942444,
0.4839256703853607,
0.30789270997047424,
-0.3375382125377655,
0.43085476756095886,
1.1011111736297607,
0.3895648419857025,
-0.06394389271736145,
-0.2990890145301819... |
func Gauge(metric_in, m1Prefix string) (metric_out string) {
if IsMetric20(metric_in) {
return metric_in
}
return m1Prefix + metric_in
} | [
-0.4093029797077179,
0.13593126833438873,
0.328877717256546,
-0.2699284255504608,
-0.6593946218490601,
0.5045003294944763,
-0.16232842206954956,
0.3348614573478699,
-0.620183527469635,
0.7456249594688416,
1.5521048307418823,
0.5558024048805237,
0.07979609817266464,
0.32225915789604187,
0... |
func simpleStat(metric_in, m1Prefix, stat1, stat2, percentile, timespec string) (metric_out string) {
if percentile != "" {
percentile = "_" + percentile
}
if timespec != "" {
timespec = "__" + timespec
}
v := GetVersion(metric_in)
if v == M20 {
return metric_in + ".stat=" + stat2 + percentile + timespec
}... | [
0.4031193256378174,
-0.7071750164031982,
0.623126745223999,
-1.4611518383026123,
-0.4416061341762543,
0.5619248747825623,
0.011276320554316044,
-0.6623913645744324,
-0.6080063581466675,
-0.34151458740234375,
1.2034623622894287,
0.4306926131248474,
0.4192976951599121,
-0.5948536992073059,
... |
func CountPckt(metric_in, m1Prefix string) (metric_out string) {
v := GetVersion(metric_in)
if v == M20 {
parts := strings.Split(metric_in, ".")
for i, part := range parts {
if strings.HasPrefix(part, "unit=") {
parts[i] = "unit=Pckt"
parts = append(parts, "orig_unit="+part[5:])
}
if strings.HasP... | [
0.38188040256500244,
-0.8332350254058838,
0.974266767501831,
-0.6981630921363831,
-0.04830059036612511,
-0.12637722492218018,
0.8989466428756714,
-0.08825559169054031,
-0.4999523460865021,
0.031344618648290634,
0.6780719757080078,
0.6435215473175049,
0.24209150671958923,
-0.023144820705056... |
func CountMetric(metric_in, m1Prefix string) (metric_out string) {
v := GetVersion(metric_in)
if v == M20 {
parts := strings.Split(metric_in, ".")
for i, part := range parts {
if strings.HasPrefix(part, "unit=") {
parts[i] = "unit=Metric"
parts = append(parts, "orig_unit="+part[5:])
}
if strings.... | [
0.34750768542289734,
-0.6251325011253357,
0.8436869382858276,
-0.3088701665401459,
0.2330358773469925,
0.33460748195648193,
0.7784578800201416,
-0.13279229402542114,
-0.8214839100837708,
0.7900733351707458,
1.1094183921813965,
1.0841444730758667,
0.0872175469994545,
-0.761012613773346,
0... |
func Count(metric_in, m1Prefix string) (metric_out string) {
v := GetVersion(metric_in)
if v == M20 {
parts := strings.Split(metric_in, ".")
ttSeen := false
for i, part := range parts {
if strings.HasPrefix(part, "target_type=") {
ttSeen = true
parts[i] = "target_type=count"
}
}
if !ttSeen {
... | [
0.4032120406627655,
-0.9585962891578674,
0.9233593344688416,
-0.2038358896970749,
0.21024475991725922,
0.2336970716714859,
0.7450858354568481,
-0.12075432389974594,
-0.8071051239967346,
1.102144718170166,
0.9201579093933105,
0.9248334765434265,
0.3826777935028076,
0.09712423384189606,
0.... |
func Counter(metric_in, m1Prefix string) (metric_out string) {
v := GetVersion(metric_in)
if v == M20 {
parts := strings.Split(metric_in, ".")
ttSeen := false
for i, part := range parts {
if strings.HasPrefix(part, "target_type=") {
ttSeen = true
parts[i] = "target_type=counter"
}
}
if !ttSeen... | [
0.28867048025131226,
-1.1755552291870117,
0.9141887426376343,
-0.25026533007621765,
-0.12276452034711838,
0.7640336155891418,
0.5907328128814697,
-0.1678934246301651,
-0.05051629617810249,
0.7163974642753601,
1.1473615169525146,
1.075503945350647,
0.24143944680690765,
0.06650441139936447,
... |
func Create(r render.Render, params martini.Params, db database.Datastore, data Account) {
// Create a bcrypt hash from the password as we don't want to store
// plain-text passwords in the database
pwdHash, bcryptError := bcrypt.GenerateFromPassword([]byte(data.Password), 0)
if bcryptError != nil {
responses.Er... | [
0.09801357239484787,
0.8755656480789185,
0.5856653451919556,
0.1088411882519722,
0.10827268660068512,
0.14457254111766815,
-0.2566307485103607,
0.6348482370376587,
-0.08814343810081482,
0.048707783222198486,
-0.3784354627132416,
-0.7065058350563049,
-0.6479269862174988,
0.02382891252636909... |
func GetAllAwards(data interface{}) error {
fmt.Println(data)
fmt.Println("mango")
db := common.GetDB()
err := db.Find(data).Error
return err
} | [
0.881743848323822,
0.4173126816749573,
0.7292860150337219,
0.33454325795173645,
-0.9509281516075134,
0.6756684184074402,
-0.7342758178710938,
0.404278039932251,
0.1283074915409088,
-0.21545107662677765,
1.2633830308914185,
1.0540063381195068,
-0.1493155062198639,
1.2339421510696411,
0.10... |
func GetAwardByID(data, id interface{}) error {
db := common.GetDB()
err := db.Where("id = ?", id).First(data).Error
return err
} | [
0.9471848607063293,
-0.40708765387535095,
0.7641398906707764,
0.09908494353294373,
0.1564725935459137,
-0.006159368436783552,
-0.5663171410560608,
0.4228600859642029,
-0.03908722475171089,
1.0523349046707153,
0.16798555850982666,
1.2416410446166992,
0.05797505006194115,
0.7801814079284668,... |
func (a *MaintenanceWindowApiService) GetAllMaintenanceWindowConfigs(ctx _context.Context) ApiGetAllMaintenanceWindowConfigsRequest {
return ApiGetAllMaintenanceWindowConfigsRequest{
ApiService: a,
ctx: ctx,
}
} | [
-0.2245098352432251,
-0.1845906376838684,
0.7420753240585327,
1.2514115571975708,
-0.962282657623291,
0.38636067509651184,
-0.7704078555107117,
-0.2822897136211395,
0.21290838718414307,
-0.32077550888061523,
-0.19292083382606506,
0.9409388303756714,
-1.5653141736984253,
1.5748523473739624,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.