text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func ReplaceUserAgent(s string) string {
return userAgentPattern.ReplaceAllString(s, "- scenarigo/v1.0.0")
} | [
0.10378390550613403,
-0.9421802759170532,
0.2977277934551239,
0.38679239153862,
-0.9485718607902527,
-0.025944842025637627,
0.7767924666404724,
1.6601988077163696,
0.8444700837135315,
0.05533519387245178,
-1.2987817525863647,
0.4074647128582001,
-0.2105012983083725,
-0.5454686880111694,
... |
func ReplaceDateHeader(s string) string {
found := dateHeaderPattern.FindAllStringSubmatch(s, -1)
for _, subs := range found {
subs := subs
if len(subs) > 1 {
s = strings.ReplaceAll(s, subs[1], "Mon, 01 Jan 0001 00:00:00 GMT")
}
}
return s
} | [
-0.11686313152313232,
-0.6524650454521179,
0.7899715304374695,
0.3323359489440918,
-0.06643933802843094,
-0.12732452154159546,
-0.7128230929374695,
0.39223313331604004,
0.2772943377494812,
0.7356688380241394,
-0.10013074427843094,
0.742413341999054,
-0.5193434357643127,
0.42930200695991516... |
func (r *AlibabaEleFengniaoChainstoreRangesAPIRequest) SetAppId(_appId string) error {
r._appId = _appId
r.Set("app_id", _appId)
return nil
} | [
0.17130517959594727,
-0.5930744409561157,
0.06819358468055725,
1.0354644060134888,
0.07879143208265305,
1.4210526943206787,
-0.10534206032752991,
0.20029006898403168,
1.2874964475631714,
0.18569320440292358,
0.09324005246162415,
-0.062147658318281174,
0.15838298201560974,
1.070534586906433... |
func ConvertStringDollarsToPennies(amount string) (int64, error) {
// check if amount can convert to a valid float
_, err := strconv.ParseFloat(amount, 64)
if err != nil {
return 0, err
}
// split the value on "."
groups := strings.Split(amount, ".")
// if there is no . result will still be
// captured here... | [
-0.36674386262893677,
-0.1916513442993164,
0.8471301794052124,
-0.8261206746101379,
-0.7283326387405396,
-0.8305290341377258,
0.16986636817455292,
-0.04188735410571098,
0.25879907608032227,
0.26015061140060425,
0.011680363677442074,
0.2662314772605896,
-0.23988623917102814,
-0.108646921813... |
func NewWindowsKioskProfile()(*WindowsKioskProfile) {
m := &WindowsKioskProfile{
}
m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance();
m.SetAdditionalData(make(map[string]any))
return m
} | [
1.2044482231140137,
-0.37411054968833923,
0.04190507158637047,
0.1451617330312729,
-0.596147894859314,
-0.7790335416793823,
0.5064234137535095,
-0.752399206161499,
-0.5383955836296082,
-0.17688792943954468,
-0.8036148548126221,
-0.2548409700393677,
-1.1052813529968262,
0.4193902611732483,
... |
func CreateWindowsKioskProfileFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewWindowsKioskProfile(), nil
} | [
1.3856642246246338,
-0.03135203942656517,
0.20672881603240967,
0.45181259512901306,
-1.0124280452728271,
-0.19432784616947174,
0.7089774012565613,
-0.24199743568897247,
-0.2283012866973877,
-0.13482482731342316,
-0.34453123807907104,
-0.10122077912092209,
-0.21920908987522125,
0.8977465629... |
func (m *WindowsKioskProfile) GetAdditionalData()(map[string]any) {
val , err := m.backingStore.Get("additionalData")
if err != nil {
panic(err)
}
if val == nil {
var value = make(map[string]any);
m.SetAdditionalData(value);
}
return val.(map[string]any)
} | [
0.6135554909706116,
-0.04234474524855614,
0.09461023658514023,
0.2225283533334732,
-1.054931402206421,
0.43792715668678284,
-0.4488006830215454,
-0.2720675766468048,
0.6347261071205139,
-0.5730897784233093,
-0.2012576013803482,
0.5966629981994629,
-0.44579803943634033,
0.6522148251533508,
... |
func (m *WindowsKioskProfile) GetAppConfiguration()(WindowsKioskAppConfigurationable) {
val, err := m.GetBackingStore().Get("appConfiguration")
if err != nil {
panic(err)
}
if val != nil {
return val.(WindowsKioskAppConfigurationable)
}
return nil
} | [
1.1235337257385254,
0.10503101348876953,
0.3718530237674713,
1.833485722541809,
-0.4844653308391571,
0.19197921454906464,
0.18496514856815338,
0.14068734645843506,
0.44465190172195435,
0.8167633414268494,
0.13029536604881287,
-0.5121961236000061,
-0.08743272721767426,
0.3847866654396057,
... |
func (m *WindowsKioskProfile) GetBackingStore()(ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) {
return m.backingStore
} | [
0.7136175036430359,
-0.013789762742817402,
0.3098389804363251,
0.05800538882613182,
-0.25207453966140747,
0.19240379333496094,
0.7566694021224976,
-0.4542425870895386,
0.13877394795417786,
-0.6310797333717346,
0.5075360536575317,
-0.18305809795856476,
-1.9830652475357056,
-0.47278127074241... |
func (m *WindowsKioskProfile) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error))
res["appConfiguration"] = func (n i878a80d... | [
0.4400131106376648,
0.26903101801872253,
0.7120171189308167,
-0.5308268070220947,
-0.21817953884601593,
-0.4324069321155548,
0.48927539587020874,
-0.13275597989559174,
-0.7808831334114075,
-0.30927574634552,
-0.8364368677139282,
-0.005206695757806301,
-0.9573744535446167,
0.411676824092865... |
func (m *WindowsKioskProfile) GetProfileId()(*string) {
val, err := m.GetBackingStore().Get("profileId")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
} | [
1.7272742986679077,
0.18372325599193573,
0.19361262023448944,
1.4156490564346313,
0.4330514967441559,
1.0264902114868164,
0.012027625925838947,
-0.2887762486934662,
0.780758798122406,
0.5316358208656311,
0.5278316140174866,
-0.04346897825598717,
-1.0857917070388794,
0.25250712037086487,
... |
func (m *WindowsKioskProfile) GetUserAccountsConfiguration()([]WindowsKioskUserable) {
val, err := m.GetBackingStore().Get("userAccountsConfiguration")
if err != nil {
panic(err)
}
if val != nil {
return val.([]WindowsKioskUserable)
}
return nil
} | [
0.104929119348526,
0.04755662381649017,
0.42743200063705444,
0.9025044441223145,
-0.36378031969070435,
-0.9047252535820007,
0.5768033266067505,
-0.1601918488740921,
0.4335992634296417,
0.6162699460983276,
-0.6057972311973572,
-0.4061284363269806,
-0.26803869009017944,
-0.10524026304483414,... |
func (m *WindowsKioskProfile) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
{
err := writer.WriteObjectValue("appConfiguration", m.GetAppConfiguration())
if err != nil {
return err
}
}
{
err := wri... | [
0.6129868030548096,
0.09503627568483353,
0.6415203213691711,
0.21363431215286255,
0.04337845370173454,
-0.4331003427505493,
1.0254205465316772,
-0.2571529746055603,
-0.30658158659935,
0.42984887957572937,
-0.5559247732162476,
-0.13559508323669434,
-0.7519677877426147,
0.33391299843788147,
... |
func (m *WindowsKioskProfile) SetAdditionalData(value map[string]any)() {
err := m.GetBackingStore().Set("additionalData", value)
if err != nil {
panic(err)
}
} | [
0.7305919528007507,
0.39583107829093933,
-0.1802537888288498,
0.3490832448005676,
-0.7895344495773315,
1.1289974451065063,
0.13516078889369965,
-0.5038223266601562,
0.308250367641449,
-0.42267635464668274,
-0.33585605025291443,
0.28729355335235596,
-0.4341390132904053,
0.8169578313827515,
... |
func (m *WindowsKioskProfile) SetAppConfiguration(value WindowsKioskAppConfigurationable)() {
err := m.GetBackingStore().Set("appConfiguration", value)
if err != nil {
panic(err)
}
} | [
0.6090430617332458,
0.05707225203514099,
0.2387724071741104,
1.745792269706726,
-0.713335394859314,
0.4720517098903656,
0.1267106980085373,
0.16288287937641144,
0.11586901545524597,
0.7726717591285706,
-0.4044875502586365,
-1.0256637334823608,
0.4577995538711548,
0.6787644624710083,
-0.2... |
func (m *WindowsKioskProfile) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {
m.backingStore = value
} | [
0.48949986696243286,
0.36345019936561584,
0.14607319235801697,
0.004357391968369484,
-0.3100716471672058,
0.3842719793319702,
0.8734258413314819,
-0.6525262594223022,
-0.49575215578079224,
-0.2959601879119873,
-0.10987033694982529,
-0.8677911758422852,
-1.1606011390686035,
0.30201652646064... |
func (m *WindowsKioskProfile) SetProfileId(value *string)() {
err := m.GetBackingStore().Set("profileId", value)
if err != nil {
panic(err)
}
} | [
1.1731163263320923,
0.36300069093704224,
0.05733956769108772,
1.4704142808914185,
0.3339226245880127,
1.364481806755066,
0.0011189267970621586,
0.04804528132081032,
0.21574215590953827,
0.9175053238868713,
-0.11786606162786484,
-0.6085447669029236,
-1.0295326709747314,
0.874539852142334,
... |
func (m *WindowsKioskProfile) SetUserAccountsConfiguration(value []WindowsKioskUserable)() {
err := m.GetBackingStore().Set("userAccountsConfiguration", value)
if err != nil {
panic(err)
}
} | [
-0.04709231108427048,
-0.30491217970848083,
0.09525839239358902,
0.29589563608169556,
-0.39514631032943726,
-0.5679066777229309,
0.8806100487709045,
0.020715825259685516,
0.23914587497711182,
0.7810388207435608,
-1.1409028768539429,
-1.0170797109603882,
0.21989992260932922,
-0.033638607710... |
func BindCommandHandler(e *echo.Echo) {
h := &commandHandler{}
e.POST("/v1/slack/command", h.withNoContent)
} | [
0.19067589938640594,
-0.5991334915161133,
0.5365636944770813,
0.5408927202224731,
0.8223930597305298,
0.9624487161636353,
-0.0241224505007267,
-0.29229307174682617,
-0.4291829466819763,
-1.0803552865982056,
0.055073779076337814,
0.8354942202568054,
-0.028037991374731064,
1.1577478647232056... |
func (p *PhidgetCurrentInput) Create() {
C.PhidgetCurrentInput_create(&p.handle)
p.rawHandle(unsafe.Pointer(p.handle))
} | [
0.2279224395751953,
-0.5440028309822083,
0.11292456090450287,
-0.12821292877197266,
0.475163996219635,
1.4901949167251587,
1.120033621788025,
-0.09285669028759003,
-0.572773814201355,
-0.5020058155059814,
0.5295972228050232,
-0.6541991829872131,
-0.8747797012329102,
-0.08969349414110184,
... |
func (p *PhidgetCurrentInput) GetValue() (float64, error) {
var r C.double
cerr := C.PhidgetCurrentInput_getCurrent(p.handle, &r)
if cerr != C.EPHIDGET_OK {
return 0, p.phidgetError(cerr)
}
return float64(r), nil
} | [
-0.05811917409300804,
0.2941953241825104,
0.5154993534088135,
0.4347881078720093,
0.9313921928405762,
0.64609694480896,
1.0110851526260376,
-0.47080591320991516,
-0.12133709341287613,
0.08549582213163376,
0.701994776725769,
-0.02206346206367016,
-0.9287105798721313,
0.8240746855735779,
0... |
func (p *PhidgetCurrentInput) SetOnCurrentChangeHandler(f func(float64)) error {
//make a c function pointer to a go function pointer and pass it through the phidget context
var passthrough Passthrough
passthrough.f = f
pt := gopointer.Save(passthrough)
cerr := C.PhidgetCurrentInput_setOnCurrentChangeHandler(p.han... | [
0.1544833779335022,
-0.1789155900478363,
0.4492723047733307,
-0.19721288979053497,
-0.4193296730518341,
0.7669398188591003,
0.9675285816192627,
0.21342667937278748,
-0.15168847143650055,
0.11694937944412231,
-0.1501270830631256,
0.15917469561100006,
-0.09174144268035889,
0.7317730784416199... |
func (p *PhidgetCurrentInput) Close() error {
if err := p.phidget.Close(); err != nil {
return err
}
return p.phidgetError(C.PhidgetCurrentInput_delete(&p.handle))
} | [
-0.2976538836956024,
-0.7209124565124512,
0.5000590085983276,
-0.46239733695983887,
-0.397421658039093,
1.5614196062088013,
1.3390406370162964,
-0.021812399849295616,
-0.1863367259502411,
-0.05265685170888901,
1.0360527038574219,
-0.06798657029867172,
-1.677201747894287,
0.2467081546783447... |
func (p Pin) Configure(config PinConfig) {
if config.Mode == PinOutput { // set output bit
if p < 8 {
avr.DDRD.SetBits(1 << uint8(p))
} else if p < 14 {
avr.DDRB.SetBits(1 << uint8(p-8))
} else {
avr.DDRC.SetBits(1 << uint8(p-14))
}
} else { // configure input: clear output bit
if p < 8 {
avr.DD... | [
-0.38695794343948364,
0.5327040553092957,
0.6635916829109192,
-0.17637018859386444,
0.2998482584953308,
0.5385816693305969,
0.7552182078361511,
-0.9149108529090881,
0.33555707335472107,
0.33024168014526367,
0.15237203240394592,
-0.021583763882517815,
-0.08351496607065201,
0.363997966051101... |
func (p Pin) Get() bool {
if p < 8 {
val := avr.PIND.Get() & (1 << uint8(p))
return (val > 0)
} else if p < 14 {
val := avr.PINB.Get() & (1 << uint8(p-8))
return (val > 0)
} else {
val := avr.PINC.Get() & (1 << uint8(p-14))
return (val > 0)
}
} | [
-0.7144703269004822,
0.20639361441135406,
0.6696203947067261,
-0.24030502140522003,
0.5505215525627136,
0.8871336579322815,
-0.39701589941978455,
-0.9190768003463745,
0.031922899186611176,
0.21696560084819794,
0.43864706158638,
0.7351402640342712,
-1.0646169185638428,
-0.28911569714546204,... |
func InitPWM() {
// use waveform generation
avr.TCCR0A.SetBits(avr.TCCR0A_WGM00)
// set timer 0 prescale factor to 64
avr.TCCR0B.SetBits(avr.TCCR0B_CS01 | avr.TCCR0B_CS00)
// set timer 1 prescale factor to 64
avr.TCCR1B.SetBits(avr.TCCR1B_CS11)
// put timer 1 in 8-bit phase correct pwm mode
avr.TCCR1A.SetBit... | [
0.12874910235404968,
-0.0780683308839798,
0.8900089859962463,
-0.05137694999575615,
0.32700151205062866,
0.2216312438249588,
0.7366140484809875,
-0.009970832616090775,
0.00884727481752634,
0.2743857204914093,
-0.05723182111978531,
-0.05206232890486717,
0.1674119383096695,
1.726575613021850... |
func (pwm PWM) Configure() {
if pwm.Pin < 8 {
avr.DDRD.SetBits(1 << uint8(pwm.Pin))
} else {
avr.DDRB.SetBits(1 << uint8(pwm.Pin-8))
}
} | [
-0.4953618049621582,
0.7942490577697754,
0.6165168285369873,
0.2735438942909241,
0.9835307002067566,
0.3387393355369568,
0.5127713084220886,
-0.790764331817627,
0.341916024684906,
-0.6552558541297913,
0.7679730653762817,
0.04471689835190773,
-0.2493172436952591,
1.11647629737854,
0.30640... |
func (pwm PWM) Set(value uint16) {
value8 := uint8(value >> 8)
switch pwm.Pin {
case 3:
// connect pwm to pin on timer 2, channel B
avr.TCCR2A.SetBits(avr.TCCR2A_COM2B1)
avr.OCR2B.Set(value8) // set pwm duty
case 5:
// connect pwm to pin on timer 0, channel B
avr.TCCR0A.SetBits(avr.TCCR0A_COM0B1)
avr.OC... | [
-0.3750549256801605,
-0.19708935916423798,
0.8096800446510315,
-0.530407726764679,
0.43101662397384644,
0.7389742732048035,
0.44447991251945496,
-1.2885695695877075,
0.23379364609718323,
0.17636364698410034,
0.27592891454696655,
0.2241971641778946,
-0.14295431971549988,
0.9717568159103394,... |
func (i2c I2C) Configure(config I2CConfig) {
// Default I2C bus speed is 100 kHz.
if config.Frequency == 0 {
config.Frequency = TWI_FREQ_100KHZ
}
// Activate internal pullups for twi.
avr.PORTC.SetBits((avr.DIDR0_ADC4D | avr.DIDR0_ADC5D))
// Initialize twi prescaler and bit rate.
avr.TWSR.SetBits((avr.TWSR_T... | [
-0.2940404713153839,
0.5962393283843994,
0.5914371013641357,
-0.4283207356929779,
0.030061006546020508,
-0.38710734248161316,
0.8485933542251587,
-0.2897520661354065,
-0.5592501759529114,
0.18378281593322754,
-0.23088635504245758,
-0.6618623733520508,
0.34697914123535156,
1.220661044120788... |
func (i2c I2C) Tx(addr uint16, w, r []byte) error {
if len(w) != 0 {
i2c.start(uint8(addr), true) // start transmission for writing
for _, b := range w {
i2c.writeByte(b)
}
}
if len(r) != 0 {
i2c.start(uint8(addr), false) // re-start transmission for reading
for i := range r { // read each ch... | [
-0.10554490983486176,
0.00120809196960181,
0.7680917978286743,
-0.7778054475784302,
-0.16426536440849304,
-0.8667375445365906,
0.06259526312351227,
-0.24631905555725098,
0.15741218626499176,
0.7887731790542603,
0.015496092848479748,
0.12630893290042877,
-0.1657388061285019,
-1.279967784881... |
func (i2c I2C) start(address uint8, write bool) {
// Clear TWI interrupt flag, put start condition on SDA, and enable TWI.
avr.TWCR.Set((avr.TWCR_TWINT | avr.TWCR_TWSTA | avr.TWCR_TWEN))
// Wait till start condition is transmitted.
for !avr.TWCR.HasBits(avr.TWCR_TWINT) {
}
// Write 7-bit shifted peripheral addr... | [
-0.4148760437965393,
-0.06705723702907562,
0.5438328385353088,
-0.4878747761249542,
-0.5908207297325134,
0.11686600744724274,
1.324974536895752,
0.2107689529657364,
0.5476768612861633,
0.7345689535140991,
0.4331333041191101,
0.7605467438697815,
0.14902348816394806,
-0.2903338670730591,
0... |
func (i2c I2C) stop() {
// Send stop condition.
avr.TWCR.Set(avr.TWCR_TWEN | avr.TWCR_TWINT | avr.TWCR_TWSTO)
// Wait for stop condition to be executed on bus.
for !avr.TWCR.HasBits(avr.TWCR_TWSTO) {
}
} | [
-1.1697547435760498,
-0.23397357761859894,
0.1957479566335678,
-0.5388093590736389,
-0.15392738580703735,
0.2848535478115082,
1.2899084091186523,
-0.6181612014770508,
-1.4427653551101685,
0.2909002900123596,
-0.3685274124145508,
0.666392982006073,
0.09209295362234116,
-0.01504011545330286,... |
func (i2c I2C) writeByte(data byte) {
// Write data to register.
avr.TWDR.Set(data)
// Clear TWI interrupt flag and enable TWI.
avr.TWCR.Set(avr.TWCR_TWEN | avr.TWCR_TWINT)
// Wait till data is transmitted.
for !avr.TWCR.HasBits(avr.TWCR_TWINT) {
}
} | [
-0.3331497609615326,
0.47197604179382324,
0.4537423849105835,
-0.5587397813796997,
0.835448682308197,
0.26479530334472656,
1.3529694080352783,
-0.3694623112678528,
0.20502839982509613,
0.0624295249581337,
-0.21570344269275665,
0.2468625009059906,
-0.8658612370491028,
0.6368863582611084,
... |
func (i2c I2C) readByte() byte {
// Clear TWI interrupt flag and enable TWI.
avr.TWCR.Set(avr.TWCR_TWEN | avr.TWCR_TWINT | avr.TWCR_TWEA)
// Wait till read request is transmitted.
for !avr.TWCR.HasBits(avr.TWCR_TWINT) {
}
return byte(avr.TWDR.Get())
} | [
-0.10418901592493057,
0.035366132855415344,
0.5483452677726746,
-0.3102904260158539,
-0.22152014076709747,
0.21740542352199554,
0.8755654692649841,
-1.0824596881866455,
-0.159486323595047,
-0.25712138414382935,
1.2763495445251465,
0.43806466460227966,
-0.9587447643280029,
-0.24374495446681... |
func (uart UART) Configure(config UARTConfig) {
if config.BaudRate == 0 {
config.BaudRate = 9600
}
// Register the UART interrupt.
interrupt.New(avr.IRQ_USART_RX, func(intr interrupt.Interrupt) {
// Read register to clear it.
data := avr.UDR0.Get()
// Ensure no error.
if !avr.UCSR0A.HasBits(avr.UCSR0A_F... | [
-0.022895105183124542,
0.28887224197387695,
0.7304308414459229,
-0.5694071054458618,
0.5856516361236572,
-0.022281045094132423,
0.08445542305707932,
0.23448728024959564,
0.5455282330513,
-0.6836936473846436,
-0.06306111067533493,
-0.6708642840385437,
0.06305398046970367,
0.2622977197170257... |
func (uart UART) WriteByte(c byte) error {
// Wait until UART buffer is not busy.
for !avr.UCSR0A.HasBits(avr.UCSR0A_UDRE0) {
}
avr.UDR0.Set(c) // send char
return nil
} | [
-0.47941097617149353,
0.441003680229187,
0.5740149617195129,
-0.1231776550412178,
1.236345887184143,
0.7534289956092834,
1.6239246129989624,
-0.5577461123466492,
0.9683217406272888,
-0.6775113344192505,
-0.5086972117424011,
-0.09452071040868759,
-0.8221809267997742,
0.5875652432441711,
1... |
func createResponse(r *http.Request, message string) (*slashResponse, bool) {
ctx := appengine.NewContext(r)
client := urlfetch.Client(ctx)
respMessage := ""
v := url.Values{}
v.Set("restaurant_id", "23")
resp, err := client.PostForm("https://www.kanresta.fi/app/lunchlist/view/", v)
if err != nil {
log.Error... | [
-0.20425526797771454,
0.7662833333015442,
0.7402476072311401,
-0.5315779447555542,
0.8997989892959595,
-0.42650294303894043,
0.10117517411708832,
0.1446678340435028,
-0.051101744174957275,
0.2809421718120575,
0.3836827278137207,
-0.7120299339294434,
-0.8163229823112488,
0.8381776213645935,... |
func ExistFile(path string) bool {
stat, err := os.Stat(path)
return err == nil && stat.Mode().IsRegular()
} | [
0.16312026977539062,
0.2881547808647156,
0.8256884217262268,
-0.1023506447672844,
0.6613037586212158,
1.82576322555542,
0.5996455550193787,
0.8739280104637146,
-0.80950528383255,
0.6939097046852112,
0.4295499324798584,
-0.4829663038253784,
-0.28431829810142517,
0.37355124950408936,
-1.04... |
func ExistDir(path string) bool {
stat, err := os.Stat(path)
return err == nil && stat.IsDir()
} | [
-0.23107188940048218,
0.17958736419677734,
0.6789979338645935,
-0.0669412612915039,
-0.025565989315509796,
1.531207799911499,
0.06313318759202957,
0.5259419083595276,
-0.11247782409191132,
-0.2981116473674774,
0.5138844847679138,
-0.19578100740909576,
-0.0862281396985054,
1.432732224464416... |
func IsURL(path string) bool {
u, err := url.Parse(path)
if err != nil {
return false
}
return u.Host != "" && u.Scheme != ""
} | [
-0.0024677470792084932,
-0.09846886247396469,
0.46914002299308777,
0.4647579491138458,
-0.27435481548309326,
0.6760311722755432,
-0.2951194941997528,
0.75425785779953,
0.922594428062439,
0.26389703154563904,
-0.5771396160125732,
0.7014510631561279,
-0.6399489045143127,
-0.3127368092536926,... |
func NewSidecarInjector(c client.Client) *sidecarInjector {
return &sidecarInjector{
injectSecurityContext: viper.GetBool(consts.ConfigInjectSecurityContext),
client: c,
}
} | [
-0.1695536971092224,
0.30446386337280273,
0.08873744308948517,
-0.3260655701160431,
-0.9683530926704407,
-0.0758981928229332,
-0.8082215189933777,
-0.10215574502944946,
-0.12730365991592407,
0.42851847410202026,
-0.9164305925369263,
-0.2537650167942047,
-1.771875023841858,
-0.2514312267303... |
func runEquationAsync(equationOutput ChanBig, count int) {
// These are our factor constants for b,c,d,e in the equation;
// Reference factors.go:
factors := NewFactors()
/////////////////////////////////////
//1. Make channels for our functions:
divisorA:=makeChanBig(8)
divisorB:=make(chan int64, 4)
divisorC... | [
-0.20422694087028503,
0.2563161551952362,
0.920863687992096,
0.2883341908454895,
0.5250864028930664,
-1.3830406665802002,
0.8397884964942932,
-0.43530595302581787,
-0.13595780730247498,
-0.1484498828649521,
-0.09538314491510391,
-0.27449050545692444,
0.3167685866355896,
0.08956952393054962... |
func equation1(output ChanBig, a ChanBig, b ChanBig, c ChanBig, d ChanBig, e ChanBig, count int) {
for i:=0; i<count; i++ {
output <- doEquation(<-a, <-b, <-c, <-d, <-e)
}
fmt.Println("Equations complete ", count)
close(output)
} | [
-0.7565439343452454,
-0.7332392334938049,
0.5715318322181702,
0.10714876651763916,
0.4898582100868225,
0.5622565746307373,
1.4863466024398804,
-0.29872381687164307,
-1.0578533411026,
0.5839666724205017,
-0.14764000475406647,
-0.1728586107492447,
0.1284361630678177,
0.27200570702552795,
0... |
func equation2(output ChanBig, a ChanBig, b ChanBig, c ChanBig, d ChanBig, e ChanBig, count int) {
type EquationInput struct {
a *big.Rat
b *big.Rat
c *big.Rat
d *big.Rat
e *big.Rat
}
// 1 Setup. Lately it seems like running a large farm is a
// a bad idea that just wastes memory, as equations calculate... | [
0.02504568360745907,
-0.39930129051208496,
0.8619059920310974,
-0.15061044692993164,
0.21772652864456177,
-0.08192907273769379,
1.2246485948562622,
-0.9151485562324524,
-1.186427116394043,
0.12463334947824478,
-0.1836097091436386,
0.3684985339641571,
-0.022688275203108788,
0.35395494103431... |
func doEquation(a *big.Rat, b *big.Rat, c *big.Rat, d *big.Rat, e *big.Rat) *big.Rat {
return bigMultiply(
a,
bigSubtract(
bigSubtract(
bigSubtract(b, c), d,
),
e,
),
)
} | [
-0.3510032296180725,
0.4284425973892212,
0.572005569934845,
-1.3483023643493652,
1.2525898218154907,
-0.11751902103424072,
0.8599564433097839,
0.19549418985843658,
-0.31227901577949524,
0.7274997234344482,
-0.11414541304111481,
-0.04263118654489517,
0.467862993478775,
-0.31891492009162903,... |
func makePowers(output ChanBig, base int64, count int) {
multiple:=makeBig(base)
res:=makeBig(1)
output <- res
for i:=1; i<count; i++ {
res=makeBig(0).Mul(res, multiple)
output <- res
}
fmt.Println("Powers complete")
close(output)
} | [
-0.3890943229198456,
0.07656470686197281,
0.47501426935195923,
0.10546339303255081,
0.1009836420416832,
-0.6052436232566833,
0.30395230650901794,
-0.10790528357028961,
-1.0538123846054077,
-0.2601175904273987,
-0.26653602719306946,
-0.33439797163009644,
-0.17177993059158325,
0.141720101237... |
func makeMultiples(d1, d2, d3, d4 chan int64, base int64, count int) {
// 0 as a divisor might sound bad, but chanDivides() always adds a value to
// the raw divisor we send:
var res int64=0
d1 <- res
d2 <- res
d3 <- res
d4 <- res
for i:=1; i<count; i++ {
res+=base
d1 <- res
d2 <- res
d3 <- res
d4 <- ... | [
-0.885825514793396,
0.8705558180809021,
0.6536715030670166,
-0.6214514970779419,
0.03913572430610657,
-0.2369282841682434,
0.2611042857170105,
-0.7300212979316711,
-0.7158264517784119,
-0.4597937762737274,
-0.4569810926914215,
-0.5784687399864197,
-0.7109550833702087,
-0.16308064758777618,... |
func UnmountPartition(cmd CommandS) {
pmounted := Mounted{}
flgfound := false
index := 0
fmt.Println("\n===== DESMONTAR PARTICION =======================================")
for _, param := range cmd.Params {
idp := param.Value
for i, mp := range sliceMP {
idm := "vd" + string(mp.Letter) + strconv.FormatInt(m... | [
0.9808260202407837,
-1.0685979127883911,
0.9187842607498169,
-0.3315161168575287,
0.09221332520246506,
-0.36375921964645386,
0.14967218041419983,
0.409451961517334,
-0.1075592041015625,
0.5160340666770935,
0.46678972244262695,
0.19779573380947113,
-1.1866096258163452,
0.6638944745063782,
... |
func MakeRep(cmd CommandS) {
id := ""
path := ""
name := ""
ruta := ""
cm := Mounted{}
for _, param := range cmd.Params {
switch strings.ToLower(param.Name) {
case "id": // id de la partición (debe estar montada)
id = delQuotationMark(param.Value)
case "path": // indica la ruta del reporte
path = delQ... | [
0.7353990077972412,
-0.1255592256784439,
0.9900068044662476,
-0.7034139633178711,
0.48047584295272827,
-0.01892375387251377,
-0.0640445202589035,
0.34529396891593933,
-1.2157069444656372,
-0.03680574521422386,
0.34464752674102783,
0.2065538763999939,
-1.215091347694397,
-0.2215905487537384... |
func (fs *FileAddrStorage) SetAddresses(addrs []NetAddr) error {
bytes, err := json.Marshal(addrs)
if err != nil {
return trace.Wrap(err)
}
err = ioutil.WriteFile(fs.filePath, bytes, 0666)
if err != nil {
log.Error(err)
return trace.ConvertSystemError(err)
}
return nil
} | [
-0.88322913646698,
-0.22307607531547546,
0.31153392791748047,
-0.44482922554016113,
0.25117233395576477,
0.09067954123020172,
0.23015578091144562,
-0.12587405741214752,
0.43747678399086,
0.34038111567497253,
-0.6526632308959961,
0.0699649453163147,
0.002217463683336973,
0.6621038317680359,... |
func (fs *FileAddrStorage) GetAddresses() ([]NetAddr, error) {
bytes, err := ioutil.ReadFile(fs.filePath)
if err != nil {
return nil, trace.ConvertSystemError(err)
}
var addrs []NetAddr
if len(bytes) > 0 {
err = json.Unmarshal(bytes, &addrs)
if err != nil {
return nil, trace.Wrap(err)
}
}
return addrs... | [
-0.6790494322776794,
-0.243844673037529,
0.6251420378684998,
-0.14635074138641357,
0.36782875657081604,
-0.27622291445732117,
-0.15159808099269867,
-0.2975257933139801,
0.19861331582069397,
0.14820608496665955,
0.09007520228624344,
0.06432125717401505,
-0.4814145565032959,
0.43656909465789... |
func NewFileAddrStorage(filePath string) *FileAddrStorage {
return &FileAddrStorage{
filePath: filePath,
}
} | [
0.2232762724161148,
-0.7349395155906677,
-0.018815025687217712,
-0.7396102547645569,
-0.8834879398345947,
0.1396142840385437,
-0.12053831666707993,
-1.0056872367858887,
0.7678466439247131,
0.020582228899002075,
0.10984745621681213,
-0.49651679396629333,
0.670087993144989,
0.704051554203033... |
func RegisterGroup(group *model.Group) {
channelID, response := instance.createGroupChannel(group)
mutex.Lock()
channelCache[group.ID] = channelGroup{
channelID: channelID,
createResponse: response,
}
mutex.Unlock()
} | [
-0.728900134563446,
1.2723534107208252,
0.07843209058046341,
-0.3721924424171448,
1.1375459432601929,
-0.36676183342933655,
0.11461018770933151,
-0.9395166635513306,
0.29068291187286377,
-0.6658018827438354,
-0.5884354710578918,
0.27737876772880554,
-0.7677289843559265,
1.111077070236206,
... |
func HandleJoinGroup(group *model.Group, socketID uuid.UUID) {
mutex.RLock()
channel := channelCache[group.ID]
mutex.RUnlock()
socket.SendQueueMessageSocketID(channel.createResponse, socketID)
instance.joinChannel(socketID, channel.channelID)
} | [
0.25033238530158997,
0.7034873366355896,
0.49580734968185425,
-0.4018051326274872,
0.08154286444187164,
-0.2853558361530304,
0.2600269019603729,
-1.1732182502746582,
-0.0019627551082521677,
0.6034087538719177,
0.06060422956943512,
0.17112256586551666,
-1.1176317930221558,
0.700846314430236... |
func HandleQuitGroup(group *model.Group, socketID uuid.UUID) {
mutex.RLock()
channelID := channelCache[group.ID].channelID
mutex.RUnlock()
if channelID != uuid.Nil {
instance.quitChannel(socketID, channelID)
}
} | [
-0.15400581061840057,
0.28561514616012573,
0.20254212617874146,
-0.8868728876113892,
-0.12718810141086578,
-0.2777446508407593,
0.13531430065631866,
-1.2343318462371826,
-0.08905154466629028,
0.707095742225647,
0.287742555141449,
0.4983104467391968,
-0.858414351940155,
1.0515165328979492,
... |
func UnRegisterGroup(group *model.Group, connections []uuid.UUID) {
mutex.RLock()
channelID := channelCache[group.ID].channelID
mutex.RUnlock()
if channelID != uuid.Nil {
for i := range connections {
instance.quitChannel(connections[i], channelID)
}
instance.deleteGroupChannel(group)
mutex.Lock()
del... | [
-0.7877014875411987,
0.905247688293457,
0.17983220517635345,
-0.8156259059906006,
0.4906751215457916,
-0.8672718405723572,
0.37309908866882324,
0.1827995330095291,
-0.6795329451560974,
0.5152407884597778,
0.5255054831504822,
0.1852991282939911,
-1.186073660850525,
0.8924391865730286,
0.0... |
func BroadcastAll(message socket.RawMessage) {
instance.mutex.RLock()
instance.broadcast(uuid.Nil, message)
instance.mutex.RUnlock()
} | [
-0.2357068657875061,
0.5881650447845459,
0.7427359819412231,
0.6053659915924072,
0.1392357051372528,
-0.13612981140613556,
0.3134596645832062,
0.4365600347518921,
0.622951328754425,
0.23363307118415833,
0.1390351802110672,
1.5383875370025635,
-0.9650093913078308,
1.1413086652755737,
-1.3... |
func calcRating(cvss float64) string {
switch {
case cvss >= 7:
return "high"
case cvss >= 4:
return "medium"
default:
return "low"
}
} | [
-0.4701330363750458,
0.3960176408290863,
0.36474844813346863,
-0.4876977801322937,
-0.9292404651641846,
0.03525529056787491,
-0.6402658224105835,
-0.4011334776878357,
0.053654663264751434,
0.9634032845497131,
0.10973290354013443,
-0.689715564250946,
0.2118454873561859,
0.059049978852272034... |
func (a *App) UpdateProject(w http.ResponseWriter, req *http.Request) {
db := context.Get(req, "db").(*mgo.Database)
if db == nil {
a.R.JSON(w, http.StatusInternalServerError, &Response{Status: "Error", Message: "Unable to connect to database"})
return
}
vars := mux.Vars(req)
pid, ok := vars["pid"]
if !ok {
... | [
-0.6646421551704407,
0.30557337403297424,
0.8465918898582458,
0.8164703249931335,
-0.23513759672641754,
0.550020158290863,
0.17503315210342407,
-0.19226877391338348,
-0.32907533645629883,
1.4426281452178955,
0.26722484827041626,
0.3103984594345093,
-0.3979996144771576,
0.25990039110183716,... |
func (a *App) ShowProject(w http.ResponseWriter, req *http.Request) {
db := context.Get(req, "db").(*mgo.Database)
if db == nil {
a.R.JSON(w, http.StatusInternalServerError, &Response{Status: "Error", Message: "Unable to access database"})
return
}
vars := mux.Vars(req)
pid := vars["pid"]
pid, ok := vars["pid... | [
-0.4943225085735321,
0.6040468811988831,
0.8490995764732361,
-0.15269896388053894,
0.06687258183956146,
-0.1719556301832199,
0.5182629823684692,
0.37424904108047485,
-0.1680411398410797,
0.45351293683052063,
0.953248918056488,
0.38597211241722107,
-0.02265750616788864,
1.416419267654419,
... |
func (a *App) IndexProject(w http.ResponseWriter, req *http.Request) {
db := context.Get(req, "db").(*mgo.Database)
if db == nil {
a.R.JSON(w, http.StatusInternalServerError, &Response{Status: "Error", Message: "Unable to access database"})
return
}
user := context.Get(req, "user").(*User)
if user == nil {
... | [
-0.3120802342891693,
0.36140525341033936,
0.2579179108142853,
0.3546208143234253,
-0.11877176910638809,
0.16196461021900177,
0.37692177295684814,
0.15515553951263428,
-0.25347039103507996,
0.8726853132247925,
0.9401391744613647,
0.47650378942489624,
-0.5797321200370789,
-0.5484862923622131... |
func (replayer *replayer) closeConnection(ctx context.Context) {
// Call Shutdown RCP on the replayer
if replayer.rpcClient != nil {
// Use a clean context, since ctx is most likely already cancelled.
sdCtx := attachAuthToken(context.Background(), replayer.deviceConnectionInfo.authToken)
_, err := replayer.rpcC... | [
-0.334311842918396,
-0.7865421772003174,
0.5971689224243164,
-0.2599281370639801,
0.10781444609165192,
-0.1498790830373764,
0.6844737529754639,
-0.5449376702308655,
0.40431955456733704,
0.3353571891784668,
1.029067873954773,
0.12379137426614761,
-0.2700188159942627,
-0.08884069323539734,
... |
func (replayer *replayer) ping(ctx context.Context) error {
if replayer.rpcClient == nil {
return log.Errf(ctx, nil, "cannot ping without gapir connection")
}
ctx = attachAuthToken(ctx, replayer.deviceConnectionInfo.authToken)
r, err := replayer.rpcClient.Ping(ctx, &replaysrv.PingRequest{})
if err != nil {
re... | [
-0.035163313150405884,
-0.020539479330182076,
0.5439366102218628,
-0.11828857660293579,
0.8082738518714905,
0.33007845282554626,
0.3486914336681366,
-0.3957654535770416,
0.5202978253364563,
0.5543831586837769,
0.7956706881523132,
0.9792885780334473,
-0.5458999276161194,
-0.2529094517230987... |
func (replayer *replayer) startReplayCommunicationHandler(ctx context.Context) error {
connected := make(chan error)
cctx := keys.Clone(context.Background(), ctx)
crash.Go(func() {
// This shouldn't be sitting on this context
cctx := status.PutTask(cctx, nil)
cctx = status.StartBackground(cctx, "Handle Replay ... | [
0.6632575392723083,
-0.3065471351146698,
0.6753551363945007,
-0.22770360112190247,
-0.37812915444374084,
0.3257116377353668,
0.5667978525161743,
-0.7968453168869019,
-0.05803957208991051,
0.41863489151000977,
-0.09336772561073303,
0.34006544947624207,
-0.6775273084640503,
-0.10720369219779... |
func (replayer *replayer) handleReplayCommunication(
ctx context.Context,
connected chan error) error {
ctx = log.Enter(ctx, "HandleReplayCommunication")
if replayer.conn == nil || replayer.rpcClient == nil {
return log.Errf(ctx, nil, "Gapir not connected")
}
// One Connection is only supposed to be used to han... | [
0.3545835316181183,
-0.9775604605674744,
0.914259672164917,
-0.38204798102378845,
0.1917821615934372,
-0.4968186616897583,
0.5205333232879639,
-1.439963459968567,
0.581168532371521,
-0.05731895565986633,
0.33628493547439575,
0.079627126455307,
-0.6647281646728516,
-0.10943392664194107,
1... |
func (replayer *replayer) sendFenceReady(ctx context.Context, id uint32) error {
fenceReadyReq := replaysrv.ReplayRequest{
Req: &replaysrv.ReplayRequest_FenceReady{
FenceReady: &replaysrv.FenceReady{
Id: id,
},
},
}
err := replayer.rpcStream.Send(&fenceReadyReq)
if err != nil {
return log.Errf(ctx, ... | [
-0.427537739276886,
-0.08616628497838974,
0.6196635365486145,
-0.621867299079895,
0.5522271394729614,
-0.7483518123626709,
-0.5565482974052429,
-1.578393816947937,
0.2207406610250473,
0.533064067363739,
-1.7312051057815552,
1.782334566116333,
0.03688680753111839,
0.5968206524848938,
-1.0... |
func (replayer *replayer) handleResourceRequest(ctx context.Context, req *gapir.ResourceRequest) error {
ctx = status.Start(ctx, "Resources Request (count: %d)", len(req.GetIds()))
defer status.Finish(ctx)
ctx = log.Enter(ctx, "handleResourceRequest")
// Process the request
if req == nil {
return log.Err(ctx, ... | [
-0.6855848431587219,
-0.1237434446811676,
0.9056664109230042,
-0.6514414548873901,
0.5677098035812378,
-0.5255262851715088,
0.4718341529369354,
-0.08078771829605103,
0.18404515087604523,
0.40451592206954956,
0.035099949687719345,
-0.13604429364204407,
-0.4098697602748871,
0.293592333793640... |
func (replayer *replayer) handleCrashDump(ctx context.Context, dump *gapir.CrashDump) error {
if dump == nil {
return log.Err(ctx, nil, "Nil crash dump")
}
filepath := dump.GetFilepath()
crashData := dump.GetCrashData()
OS := replayer.device.Instance().GetConfiguration().GetOS()
// TODO(baldwinn860): get the ac... | [
0.3510916829109192,
-0.1645020842552185,
0.8318646550178528,
-0.4669174551963806,
0.3880654573440552,
-0.2842879593372345,
0.7131498456001282,
-0.3595554530620575,
0.30067965388298035,
-0.4991954565048218,
-0.24661557376384735,
-0.46002843976020813,
-0.6539664268493652,
0.19534631073474884... |
func (replayer *replayer) handlePayloadRequest(ctx context.Context, payloadID string) error {
ctx = status.Start(ctx, "Payload Request")
defer status.Finish(ctx)
pid, err := id.Parse(payloadID)
if err != nil {
return log.Errf(ctx, err, "Parsing payload ID")
}
boxed, err := database.Resolve(ctx, pid)
if err !=... | [
-0.4362168312072754,
-0.1469135731458664,
1.0950111150741577,
-0.9246872067451477,
0.21593812108039856,
-0.27801257371902466,
-0.23050616681575775,
-1.1438592672348022,
0.6263220310211182,
0.3369884490966797,
0.5819761753082275,
0.34976840019226074,
-0.2663247287273407,
0.18799537420272827... |
func attachAuthToken(ctx context.Context, authToken auth.Token) context.Context {
if len(authToken) != 0 {
return metadata.NewOutgoingContext(ctx,
metadata.Pairs(gapirAuthTokenMetaDataName, string(authToken)))
}
return ctx
} | [
-0.1281532198190689,
-0.48714905977249146,
0.6350860595703125,
-0.865881085395813,
0.17912092804908752,
1.1025456190109253,
0.27922680974006653,
-0.25653722882270813,
0.8957780599594116,
-0.6922680735588074,
0.29101115465164185,
1.1903280019760132,
0.6607787609100342,
-0.08050986379384995,... |
func (p *AggregateOp) Apply(ctx api.StreamContext, data interface{}, fv *xsql.FunctionValuer, _ *xsql.AggregateFunctionValuer) interface{} {
log := ctx.GetLogger()
log.Debugf("aggregate plan receive %v", data)
grouped := data
if p.Dimensions != nil {
switch input := data.(type) {
case error:
return input
c... | [
-0.6444804072380066,
0.9844984412193298,
1.0260406732559204,
-0.4951789081096649,
-1.032689094543457,
-0.46690839529037476,
0.4906221032142639,
-0.2725857198238373,
-0.5038221478462219,
0.6959301829338074,
0.6098305583000183,
-0.013636000454425812,
-0.23014700412750244,
0.21846544742584229... |
func fiat_p384_addcarryx_u64(x uint64, y uint64, carry fiat_p384_uint1) (uint64, fiat_p384_uint1) {
var sum uint64
var carryOut uint64
sum, carryOut = bits.Add64(x, y, uint64(carry))
return sum, fiat_p384_uint1(carryOut)
} | [
-0.3121805489063263,
0.5929666757583618,
0.7784300446510315,
0.8537825345993042,
0.188991516828537,
-0.0682220384478569,
-0.6547242403030396,
-1.0850870609283447,
-0.4842483699321747,
-0.43028324842453003,
-0.2165306955575943,
-0.42762279510498047,
-0.3694460391998291,
0.5322561264038086,
... |
func fiat_p384_subborrowx_u64(x uint64, y uint64, carry fiat_p384_uint1) (uint64, fiat_p384_uint1) {
var sum uint64
var carryOut uint64
sum, carryOut = bits.Sub64(x, y, uint64(carry))
return sum, fiat_p384_uint1(carryOut)
} | [
-0.16241854429244995,
0.8261092305183411,
0.5937982797622681,
1.2775155305862427,
-0.40301328897476196,
-0.24663285911083221,
-0.44774970412254333,
-0.6806614398956299,
-0.42564865946769714,
-0.18420523405075073,
-0.570337176322937,
-0.36938050389289856,
-0.774504542350769,
0.0851213261485... |
func fiat_p384_cmovznz_u64(out1 *uint64, arg1 fiat_p384_uint1, arg2 uint64, arg3 uint64) {
var x1 uint64 = (uint64(arg1) * 0xffffffffffffffff)
var x2 uint64 = ((x1 & arg3) | ((^x1) & arg2))
*out1 = x2
} | [
-0.6947176456451416,
0.38576042652130127,
0.37297526001930237,
1.3305251598358154,
-0.3047182559967041,
-0.37372779846191406,
0.6305223703384399,
0.1628311425447464,
-0.5442419648170471,
-0.10359662771224976,
-0.321527361869812,
-0.11955899000167847,
-0.6275138258934021,
0.7334728240966797... |
func fiat_p384_selectznz(out1 *[6]uint64, arg1 fiat_p384_uint1, arg2 *[6]uint64, arg3 *[6]uint64) {
var x1 uint64
fiat_p384_cmovznz_u64(&x1, arg1, (arg2[0]), (arg3[0]))
var x2 uint64
fiat_p384_cmovznz_u64(&x2, arg1, (arg2[1]), (arg3[1]))
var x3 uint64
fiat_p384_cmovznz_u64(&x3, arg1, (arg2[2]), (arg3[2]))
... | [
-0.42729684710502625,
-0.32004764676094055,
0.41275161504745483,
0.5843588709831238,
-0.0319925956428051,
-0.9595807194709778,
0.970492959022522,
-0.490556538105011,
-0.18698231875896454,
0.49603375792503357,
-0.8518791794776917,
-0.03957619518041611,
-0.8615261316299438,
0.273426145315170... |
func (m *TransitGatewayLocation) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateLocation(formats); err != nil {
res = append(res, err)
}
if err := m.validateLocationType(formats); err != nil {
res = append(res, err)
}
if err := m.validateLocationURL(formats); err != nil {
r... | [
-0.6499149203300476,
-0.28464943170547485,
0.07703784108161926,
-1.2901477813720703,
-0.2548070549964905,
-0.17102645337581635,
0.8271014094352722,
-0.3410773277282715,
-0.8513961434364319,
0.8630655407905579,
0.24522651731967926,
-0.5504612922668457,
-0.6905967593193054,
0.627404928207397... |
func (m *TransitGatewayLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
} | [
-0.25073280930519104,
-0.14183077216148376,
0.14586223661899567,
-1.5619421005249023,
-0.4747737944126129,
0.5623396635055542,
0.360965371131897,
0.014465436339378357,
0.11181455105543137,
0.8268842697143555,
0.15492840111255646,
-0.07501275837421417,
-0.9036130905151367,
0.189703598618507... |
func New() *Deque {
result := new(Deque)
result.blocks = [][]interface{}{make([]interface{}, blockSize)}
result.right = result.blocks[0]
result.left = result.blocks[0]
return result
} | [
-0.4884473383426666,
-0.4341451823711395,
0.6022238731384277,
-0.37069666385650635,
-0.4310891926288605,
-1.409318447113037,
0.056526340544223785,
-0.769217848777771,
-0.7055144906044006,
0.1222333014011383,
-1.2530752420425415,
0.019226260483264923,
-0.10663382709026337,
1.136951565742492... |
func (d *Deque) PushRight(data interface{}) {
d.right[d.rightOff] = data
d.rightOff++
if d.rightOff == blockSize {
d.rightOff = 0
d.rightIdx = (d.rightIdx + 1) % len(d.blocks)
// If we wrapped over to the left, insert a new block and update indices
if d.rightIdx == d.leftIdx {
buffer := make([][]interfac... | [
-0.30475619435310364,
0.8528914451599121,
0.8503110408782959,
-0.6050788760185242,
-0.928352415561676,
0.11124575883150101,
-0.31902655959129333,
-0.8654322624206543,
0.12009241431951523,
0.6646608114242554,
-0.38477975130081177,
0.4501989185810089,
-0.7807382941246033,
1.1313135623931885,... |
func (d *Deque) PopRight() (res interface{}) {
d.rightOff--
if d.rightOff < 0 {
d.rightOff = blockSize - 1
d.rightIdx = (d.rightIdx - 1 + len(d.blocks)) % len(d.blocks)
d.right = d.blocks[d.rightIdx]
}
res, d.right[d.rightOff] = d.right[d.rightOff], nil
return
} | [
-0.12875495851039886,
0.5538946390151978,
0.6627976894378662,
-0.7005730271339417,
-0.8283447027206421,
-0.4702323079109192,
-0.5025660395622253,
-0.8655316829681396,
-0.3647548258304596,
0.91928631067276,
-0.8017379641532898,
-0.3545825183391571,
-0.6626584529876709,
0.549262523651123,
... |
func (d *Deque) Right() interface{} {
if d.rightOff > 0 {
return d.right[d.rightOff-1]
} else {
return d.blocks[(d.rightIdx-1+len(d.blocks))%len(d.blocks)][blockSize-1]
}
} | [
-0.14348077774047852,
0.6504929661750793,
0.7513496279716492,
0.30875006318092346,
-0.985889196395874,
-0.16298972070217133,
-0.9230419993400574,
-1.204315423965454,
-0.3204951584339142,
-0.046694859862327576,
0.06546444445848465,
0.6261495351791382,
-0.31234997510910034,
0.765827834606170... |
func (d *Deque) PushLeft(data interface{}) {
d.leftOff--
if d.leftOff < 0 {
d.leftOff = blockSize - 1
d.leftIdx = (d.leftIdx - 1 + len(d.blocks)) % len(d.blocks)
// If we wrapped over to the right, insert a new block and update indices
if d.leftIdx == d.rightIdx {
d.leftIdx++
buffer := make([][]interfa... | [
0.2746075689792633,
0.5575807690620422,
0.6944509148597717,
-1.0444120168685913,
-0.5051947832107544,
0.42971640825271606,
-0.39206311106681824,
-0.845638632774353,
0.6267005801200867,
0.7727595567703247,
-0.5833590030670166,
0.4535866379737854,
-0.6521488428115845,
1.2718305587768555,
0... |
func (d *Deque) PopLeft() (res interface{}) {
res, d.left[d.leftOff] = d.left[d.leftOff], nil
d.leftOff++
if d.leftOff == blockSize {
d.leftOff = 0
d.leftIdx = (d.leftIdx + 1) % len(d.blocks)
d.left = d.blocks[d.leftIdx]
}
return
} | [
0.3736228346824646,
0.3046407401561737,
0.3659827709197998,
-1.4500226974487305,
-0.22214330732822418,
-0.1334262192249298,
-0.5037668943405151,
-0.6764310598373413,
0.6330264210700989,
1.1690813302993774,
-1.3336377143859863,
-0.6204760074615479,
-0.47276175022125244,
0.7604355812072754,
... |
func (d *Deque) Left() interface{} {
return d.left[d.leftOff]
} | [
-0.0715286135673523,
-0.2795252501964569,
0.21077729761600494,
-0.5978114604949951,
-0.3199765980243683,
0.7756334543228149,
-1.0922132730484009,
-1.081521987915039,
0.519396960735321,
-0.10110248625278473,
-0.9608432054519653,
0.14369916915893555,
-0.0349917933344841,
1.0915685892105103,
... |
func (d *Deque) Empty() bool {
return d.leftIdx == d.rightIdx && d.leftOff == d.rightOff
} | [
-1.6331104040145874,
-0.3956933915615082,
0.35344138741493225,
-1.5680636167526245,
-0.19276989996433258,
0.9300035834312439,
-0.8686771392822266,
-0.687952995300293,
-0.6853294372558594,
0.8206567168235779,
-1.0688823461532593,
0.24562911689281464,
-0.17498193681240082,
0.1911550313234329... |
func (d *Deque) Size() int {
if d.rightIdx > d.leftIdx {
return (d.rightIdx-d.leftIdx)*blockSize - d.leftOff + d.rightOff
} else if d.rightIdx < d.leftIdx {
return (len(d.blocks)-d.leftIdx+d.rightIdx)*blockSize - d.leftOff + d.rightOff
} else {
return d.rightOff - d.leftOff
}
} | [
-0.5877687335014343,
0.4609072208404541,
0.6646074056625366,
-1.7481541633605957,
-0.8429887890815735,
0.20827847719192505,
0.460997998714447,
-0.7275839447975159,
-0.07459110021591187,
0.0777067244052887,
-1.0700647830963135,
0.4472806453704834,
-0.556755006313324,
0.7703683972358704,
1... |
func (d *Deque) Reset() {
*d = *New()
} | [
-0.9583816528320312,
0.06958047300577164,
-0.06611529737710953,
-0.8971180319786072,
0.8304181098937988,
-0.48784419894218445,
0.19510863721370697,
-0.6553764343261719,
-1.0180851221084595,
-0.6488144993782043,
-0.8007676005363464,
1.5268081426620483,
0.321892648935318,
0.30924099683761597... |
func Constructor1(k int) MyCircularDeque1 {
head := Node{
Val: -1,
Next: nil,
Pre: nil,
}
tail := Node{
Val: -1,
Next: nil,
Pre: nil,
}
head.Next = &tail
tail.Pre = &head
return MyCircularDeque1{
head: &head,
tail: &tail,
len: 0,
cap: k,
}
} | [
-0.6627006530761719,
0.029031669721007347,
0.6092253923416138,
-0.1189877986907959,
-1.177181363105774,
-0.10507176071405411,
0.23809482157230377,
1.0102301836013794,
0.10708247125148773,
0.32128772139549255,
-0.7976014614105225,
0.2910681366920471,
0.06160793825984001,
0.8622721433639526,... |
func (this *MyCircularDeque1) InsertFront(value int) bool {
if this.IsFull() {
return false
}
temp := this.head.Next
tempNode := Node{
Val: value,
Next: temp,
Pre: this.head,
}
this.head.Next = &tempNode
temp.Pre = &tempNode
this.len++
return true
} | [
-1.1214674711227417,
1.489235281944275,
0.6560702919960022,
-1.5687065124511719,
-0.5167684555053711,
0.0954606831073761,
0.7678070068359375,
0.1823972463607788,
0.34089013934135437,
-0.39714449644088745,
-1.17239511013031,
-0.2870764136314392,
-1.205263614654541,
0.6558672189712524,
-0.... |
func (this *MyCircularDeque1) InsertLast(value int) bool {
if this.IsFull() {
return false
}
temp := this.tail.Pre
tempNode := Node{
Val: value,
Next: this.tail,
Pre: temp,
}
this.tail.Pre = &tempNode
temp.Next = &tempNode
this.len++
return true
} | [
-0.9755129218101501,
1.3126153945922852,
0.8949418067932129,
-1.66065514087677,
-0.324592262506485,
0.2813805639743805,
0.7360215187072754,
0.36508965492248535,
0.14126893877983093,
0.328846275806427,
-0.9779417514801025,
-1.2495173215866089,
-1.8235080242156982,
-0.025791695341467857,
-... |
func (this *MyCircularDeque1) DeleteFront() bool {
if this.IsEmpty() {
return false
}
deleteTemp := this.head.Next
this.head.Next = deleteTemp.Next
deleteTemp.Next.Pre = this.head
deleteTemp.Next, deleteTemp.Pre = nil, nil
this.len--
return true
} | [
-0.3829975724220276,
0.4542617201805115,
0.6545761823654175,
-0.8895880579948425,
-0.11115270853042603,
-0.4346793591976166,
0.3309199810028076,
0.24549226462841034,
0.6525006294250488,
-0.23757819831371307,
-1.2746663093566895,
0.6814397573471069,
-1.0334481000900269,
0.3892492651939392,
... |
func (this *MyCircularDeque1) DeleteLast() bool {
if this.IsEmpty() {
return false
}
deleteTemp := this.tail.Pre
this.tail.Pre = deleteTemp.Pre
deleteTemp.Pre.Next = this.tail
deleteTemp.Next, deleteTemp.Pre = nil, nil
this.len--
return true
} | [
0.024877235293388367,
0.30201610922813416,
1.0639591217041016,
-1.069726586341858,
0.15364231169223785,
-0.39548546075820923,
0.17340593039989471,
0.45314842462539673,
0.4145122170448303,
0.6828429102897644,
-0.8288245797157288,
-0.3706076145172119,
-1.4323076009750366,
-0.1609327942132949... |
func (this *MyCircularDeque1) GetFront() int {
return this.head.Next.Val
} | [
-0.41175931692123413,
0.4820616841316223,
0.35784852504730225,
-0.19701281189918518,
-0.40474429726600647,
-0.4333095848560333,
0.2930395305156708,
-0.2558029294013977,
0.375949889421463,
-1.4085962772369385,
-0.9295916557312012,
1.7995715141296387,
-0.5719146728515625,
0.8169005513191223,... |
func (this *MyCircularDeque1) GetRear() int {
return this.tail.Pre.Val
} | [
-0.324127197265625,
0.1762593686580658,
0.5003758668899536,
-0.34002113342285156,
-0.47198617458343506,
-0.34521180391311646,
0.6117002367973328,
0.1032886654138565,
0.2751864194869995,
-1.0383198261260986,
-0.5160613059997559,
1.2236051559448242,
-0.7012742161750793,
0.08491435647010803,
... |
func (this *MyCircularDeque1) IsEmpty() bool {
return this.head.Next == this.tail
} | [
-1.3305397033691406,
-0.535149335861206,
0.4016975462436676,
-0.5787437558174133,
0.8404573798179626,
0.14605304598808289,
0.15340058505535126,
-0.2237631231546402,
0.43600451946258545,
0.3714415729045868,
-1.0418617725372314,
1.189932942390442,
-0.9949421882629395,
-0.3541810214519501,
... |
func (this *MyCircularDeque1) IsFull() bool {
return this.len == this.cap
} | [
0.11044417321681976,
-0.5816242694854736,
0.3935934901237488,
0.29856353998184204,
0.001553719979710877,
0.3047884404659271,
-0.12716160714626312,
0.028782758861780167,
1.204627513885498,
0.5256499648094177,
-1.3289152383804321,
0.5710663795471191,
-0.5917915105819702,
-0.1272214949131012,... |
func add_jobs(fileNames []string, colID int, jobs chan<- job,
result chan<- column) {
for _, name := range fileNames {
jobs <- job{name, colID, result}
}
close(jobs)
} | [
-0.4673328399658203,
-0.10158659517765045,
0.4372943043708801,
-0.27755266427993774,
0.5612196326255798,
-0.12657301127910614,
-0.2628965675830841,
-0.19865086674690247,
-0.9920600652694702,
-0.28699666261672974,
-0.24981682002544403,
-0.3932015895843506,
-0.5280781984329224,
0.63991558551... |
func start_jobs(done chan<- doneStatus, jobs <-chan job) {
num_processed := 0
for job := range jobs {
success := job.run()
if success {
num_processed++
}
}
done <- doneStatus{num_processed}
} | [
-0.3500984311103821,
0.18421339988708496,
0.4860014021396637,
-0.050008438527584076,
0.9949951171875,
0.046964965760707855,
-0.02509920485317707,
0.44420966506004333,
-0.7243008017539978,
-0.08317089080810547,
-0.7282400131225586,
0.532718300819397,
-0.04755421727895737,
0.2988709211349487... |
func (j job) run() bool {
// ignore data file processed by this job in case of a panic
defer func() bool {
if r := recover(); r != nil {
log.Printf("Warning: Failed to parse file %s. Ignoring file. " +
"Did you pick the correct column??", j.fileName)
}
return false
}()
// main proces... | [
-0.019794844090938568,
0.017921729013323784,
1.0197449922561646,
-0.34605422616004944,
-0.22837357223033905,
0.2492327094078064,
0.49997133016586304,
0.209144726395607,
-1.6738340854644775,
-0.029391461983323097,
-0.5764025449752808,
-0.8636661171913147,
-0.6458649635314941,
0.188874945044... |
func process_column(result column, acc column) column {
if len(acc) != 0 {
if len(result) != len(acc) {
log.Panic("Mismatched column length in data files. Bailing out...")
}
for i, v := range result {
acc[i] += v
}
} else {
acc = result
}
return acc
} | [
0.8834457397460938,
0.01932690106332302,
0.5570584535598755,
-0.05598311871290207,
0.5577046275138855,
-0.48271942138671875,
0.9956184029579163,
-1.0967068672180176,
-0.03399202600121498,
0.34331759810447693,
0.07447148859500885,
0.4309053421020508,
0.37340715527534485,
-0.7037293314933777... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.