text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (GoVersion) GreaterEqThan(version string) bool { return boolResult } | [
-1.8571093082427979,
-0.44463038444519043,
0.5753028392791748,
-0.014605507254600525,
-0.22160205245018005,
1.129859209060669,
0.47086167335510254,
-0.15510079264640808,
-0.3397393822669983,
0.02384069561958313,
-1.3675622940063477,
-0.6170337200164795,
-0.989615797996521,
0.99472731351852... |
func (GoVersion) GreaterThan(version string) bool { return boolResult } | [
-0.7175363898277283,
-0.10271233320236206,
0.4744787812232971,
0.14875927567481995,
-0.1611277312040329,
1.2645716667175293,
0.1461249142885208,
-0.3516816794872284,
-0.12648212909698486,
-0.7020926475524902,
-1.2214109897613525,
-0.6628105044364929,
-1.192217469215393,
0.5417789220809937,... |
func (GoVersion) LessThan(version string) bool { return boolResult } | [
-0.20877183973789215,
-0.7921068072319031,
0.3742426335811615,
-0.6299111843109131,
-0.16865605115890503,
1.0700575113296509,
-0.06463649868965149,
-0.35711202025413513,
0.21985644102096558,
-0.9885262846946716,
-1.6822421550750732,
-0.3988207280635834,
-1.7366961240768433,
0.8429295420646... |
func (GoVersion) LessEqThan(version string) bool { return boolResult } | [
-1.1986163854599,
-1.0010194778442383,
0.5201374888420105,
-0.5972844362258911,
-0.295332670211792,
0.6655092239379883,
0.39799365401268005,
-0.27872228622436523,
0.2077862024307251,
-0.5864061117172241,
-1.604835033416748,
-0.5064805746078491,
-1.8196219205856323,
1.053282618522644,
-0.... |
func (se *shellExecutor) copyCache() {
if !util.HasString(se.cacheInputDir) {
return
}
files, err := ioutil.ReadDir(se.cacheInputDir)
util.PanicIfErr(err)
for _, f := range files {
oldPath := filepath.Join(se.cacheInputDir, f.Name())
newPath := filepath.Join(se.jobDir, f.Name())
if util.IsFileExists(new... | [
-0.2930728793144226,
-0.2141190618276596,
0.9161238074302673,
0.06282925605773926,
-0.6395984292030334,
0.46224212646484375,
1.0960794687271118,
0.31135764718055725,
0.07948780804872513,
0.9953362345695496,
0.6398947238922119,
-0.03016493283212185,
0.2296818494796753,
0.8007839322090149,
... |
func (se *shellExecutor) writeCache() {
if !se.inCmd.HasCache() {
return
}
defer util.RecoverPanic(func(e error) {
util.LogWarn(e.Error())
})
dir, err := ioutil.TempDir("", "_cache_output_")
if err != nil {
util.LogWarn(err.Error())
return
}
se.cacheOutputDir = dir
cache := se.inCmd.Cache
for _, p... | [
-0.3347007632255554,
-0.09161800146102905,
0.9820119738578796,
0.11968116462230682,
0.08037938922643661,
-0.3932611346244812,
1.713780403137207,
0.35584622621536255,
-0.2884577810764313,
0.5960285067558289,
0.6811628341674805,
-0.41032522916793823,
-0.182173952460289,
0.48922300338745117,
... |
func main() {
Logo(Version, true)
if len(os.Args) > 1 {
if err := ProcessArgument(os.Args[1:]...); err != nil {
if err.Error() != "deploy" {
log.Fatal(err)
}
} else {
os.Exit(0)
}
}
Log("Checking contents...")
if config, err := CheckCurrentProjectFolder(); err != nil {
log.Fatal(err)
} els... | [
0.13981716334819794,
-0.13994014263153076,
1.0692024230957031,
1.1505650281906128,
-0.038464393466711044,
0.5164021849632263,
0.6734436750411987,
0.18063992261886597,
-0.5760567784309387,
0.7611823678016663,
0.7312160730361938,
-0.0660414844751358,
-0.3868885040283203,
0.11838192492723465,... |
func NewDetectionRule()(*DetectionRule) {
m := &DetectionRule{
ProtectionRule: *NewProtectionRule(),
}
odataTypeValue := "#microsoft.graph.security.detectionRule"
m.SetOdataType(&odataTypeValue)
return m
} | [
0.7337700128555298,
-0.04442616552114487,
-0.03242048993706703,
0.6109792590141296,
0.6528669595718384,
0.617108166217804,
-0.05419517308473587,
0.272713303565979,
-0.06812583655118942,
-0.3501191735267639,
0.04877437278628349,
0.2990604639053345,
-0.18076206743717194,
0.36102309823036194,... |
func CreateDetectionRuleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewDetectionRule(), nil
} | [
0.9428388476371765,
-0.30389341711997986,
0.2777519226074219,
-0.025786109268665314,
0.10630343109369278,
0.5704867243766785,
0.2653701603412628,
0.3098560869693756,
-0.3332822620868683,
-0.5847588181495667,
0.1579533964395523,
-0.263964980840683,
0.0839003473520279,
0.767433762550354,
0... |
func (m *DetectionRule) GetDetectionAction()(DetectionActionable) {
val, err := m.GetBackingStore().Get("detectionAction")
if err != nil {
panic(err)
}
if val != nil {
return val.(DetectionActionable)
}
return nil
} | [
0.942120373249054,
-0.1499689370393753,
0.17694349586963654,
1.4390685558319092,
1.4534800052642822,
0.4694972038269043,
0.8682737946510315,
-0.13959336280822754,
0.003053013700991869,
0.11208580434322357,
0.01278309989720583,
-0.3855520188808441,
-0.20625285804271698,
0.27353760600090027,... |
func (m *DetectionRule) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := m.ProtectionRule.GetFieldDeserializers()
res["detectionAction"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) err... | [
0.5197200179100037,
0.16746534407138824,
0.5949162244796753,
-0.6529077291488647,
0.4118891954421997,
-0.07291785627603531,
0.588083803653717,
-0.2438327670097351,
-0.7543143630027771,
-0.7029635310173035,
-0.4833511412143707,
0.15297242999076843,
-0.6477741599082947,
0.24159927666187286,
... |
func (m *DetectionRule) GetLastRunDetails()(RunDetailsable) {
val, err := m.GetBackingStore().Get("lastRunDetails")
if err != nil {
panic(err)
}
if val != nil {
return val.(RunDetailsable)
}
return nil
} | [
1.2803536653518677,
0.7962949275970459,
0.4127347469329834,
-0.6647767424583435,
1.427894115447998,
0.3980943560600281,
0.28431236743927,
-0.019891446456313133,
0.1409531533718109,
-0.4063813388347626,
0.07256854325532913,
0.3806178569793701,
-0.4575391709804535,
0.09519878774881363,
1.1... |
func (m *DetectionRule) GetQueryCondition()(QueryConditionable) {
val, err := m.GetBackingStore().Get("queryCondition")
if err != nil {
panic(err)
}
if val != nil {
return val.(QueryConditionable)
}
return nil
} | [
1.4116495847702026,
0.28646767139434814,
0.16125111281871796,
0.7483200430870056,
0.6428180932998657,
0.680665910243988,
0.7251175045967102,
-0.4975062310695648,
0.06967445462942123,
-0.5967147350311279,
0.2750293016433716,
0.13935726881027222,
0.19035270810127258,
-0.13050077855587006,
... |
func (m *DetectionRule) GetSchedule()(RuleScheduleable) {
val, err := m.GetBackingStore().Get("schedule")
if err != nil {
panic(err)
}
if val != nil {
return val.(RuleScheduleable)
}
return nil
} | [
1.1395155191421509,
0.4096324145793915,
0.06356427818536758,
1.6349684000015259,
1.356525182723999,
0.002043906832113862,
0.3042156398296356,
0.3570249080657959,
0.09866964817047119,
-0.10569317638874054,
0.8869545459747314,
-0.2965570092201233,
-0.7608233094215393,
-0.7071589827537537,
... |
func (m *DetectionRule) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
err := m.ProtectionRule.Serialize(writer)
if err != nil {
return err
}
{
err = writer.WriteObjectValue("detectionAction", m.GetDetectionAction())
... | [
0.41961124539375305,
0.12351670116186142,
0.471540242433548,
-0.023066457360982895,
1.28873872756958,
0.08905963599681854,
0.693926990032196,
0.19471126794815063,
-0.4061290919780731,
0.446230947971344,
-0.1627836972475052,
-0.31285569071769714,
-0.4453597366809845,
0.5602611303329468,
0... |
func (m *DetectionRule) SetDetectionAction(value DetectionActionable)() {
err := m.GetBackingStore().Set("detectionAction", value)
if err != nil {
panic(err)
}
} | [
0.41340893507003784,
-0.3092825412750244,
-0.06117207556962967,
1.042996883392334,
0.9676690101623535,
1.0423609018325806,
0.9577990770339966,
0.11340760439634323,
-0.2427266389131546,
0.40404701232910156,
-0.8470489382743835,
-0.8745149374008179,
0.17985160648822784,
0.5870802998542786,
... |
func (m *DetectionRule) SetLastRunDetails(value RunDetailsable)() {
err := m.GetBackingStore().Set("lastRunDetails", value)
if err != nil {
panic(err)
}
} | [
0.7982953786849976,
0.7047058939933777,
0.27327319979667664,
-1.243540644645691,
1.3272621631622314,
0.6454437971115112,
0.28900450468063354,
0.36979609727859497,
-0.0038756392896175385,
-0.21579042077064514,
-0.09818767011165619,
-0.06258407980203629,
-0.3741493225097656,
0.02672955766320... |
func (m *DetectionRule) SetQueryCondition(value QueryConditionable)() {
err := m.GetBackingStore().Set("queryCondition", value)
if err != nil {
panic(err)
}
} | [
1.1250014305114746,
0.4141415059566498,
0.013569111004471779,
0.17745599150657654,
0.26056092977523804,
1.1214674711227417,
0.7876863479614258,
-0.17863479256629944,
-0.1789798140525818,
-0.34706857800483704,
-0.5772385001182556,
-0.25922349095344543,
0.5769822597503662,
0.2610618174076080... |
func (m *DetectionRule) SetSchedule(value RuleScheduleable)() {
err := m.GetBackingStore().Set("schedule", value)
if err != nil {
panic(err)
}
} | [
0.641573965549469,
0.9102868437767029,
-0.2247476428747177,
1.4551465511322021,
1.0099776983261108,
0.3529055416584015,
0.21890269219875336,
0.8547834157943726,
-0.567951500415802,
-0.03676476702094078,
-0.0693744644522667,
-0.7348564267158508,
-0.6579474210739136,
0.033498238772153854,
... |
func (b Bitboard) Neighbors() Bitboard {
return (b&NotFileA)>>1 |
(b&NotFileH)<<1 |
(b&NotRank1)>>8 |
(b&NotRank8)<<8
} | [
-0.8037863373756409,
0.05789492651820183,
0.5762436389923096,
0.23086968064308167,
0.03633369132876396,
0.6498070359230042,
0.3089730143547058,
-0.03309410437941551,
-0.14109227061271667,
0.0601494275033474,
-0.7885668277740479,
0.3093443810939789,
-1.291469693183899,
0.7263569235801697,
... |
func (b Bitboard) Square() Square {
return bsfIndex64[((b&-b)*debruijn64)>>58]
} | [
-0.6713238954544067,
-0.026778027415275574,
0.4326672852039337,
0.9452411532402039,
0.5976241827011108,
-0.3967169523239136,
1.0476646423339844,
-0.20834064483642578,
0.5690171122550964,
-0.3599395751953125,
0.08711664378643036,
1.03730046749115,
-0.553856372833252,
0.3513582646846771,
0... |
func (b Bitboard) Count() uint8 {
return countTable[b&0xff] +
countTable[(b>>8)&0xff] +
countTable[(b>>16)&0xff] +
countTable[(b>>24)&0xff] +
countTable[(b>>32)&0xff] +
countTable[(b>>40)&0xff] +
countTable[(b>>48)&0xff] +
countTable[b>>56]
} | [
0.9386026263237,
0.4503711462020874,
0.6399741172790527,
0.3717595934867859,
-0.39884087443351746,
0.36067578196525574,
0.7399827241897583,
-0.025962093845009804,
-0.49645888805389404,
0.5530123114585876,
-0.9599094986915588,
0.5920767784118652,
-0.7681240439414978,
0.6927574872970581,
0... |
func (p *PaymentSourceListParams) AddExpand(f string) {
p.Expand = append(p.Expand, &f)
} | [
-0.06471935659646988,
0.8812970519065857,
0.3201455771923065,
-0.7660364508628845,
-0.34958234429359436,
0.6523131728172302,
-0.9796423316001892,
0.47197920083999634,
0.025132017210125923,
-1.0132700204849243,
0.194680854678154,
-0.23960627615451813,
-0.15431971848011017,
1.066052556037902... |
func (p *PaymentSourceSourceParams) AppendTo(body *form.Values, keyParts []string) {
if p.Card != nil {
p.Card.AppendToAsCardSourceOrExternalAccount(body, keyParts)
}
} | [
-1.228644609451294,
0.8766148090362549,
0.32075825333595276,
-1.5719106197357178,
0.20118488371372223,
-0.09994593262672424,
-1.167402744293213,
-0.06529085338115692,
-0.026526309549808502,
-0.44836896657943726,
-0.3865162134170532,
-0.25094425678253174,
0.07199060916900635,
1.056009769439... |
func SourceParamsFor(obj interface{}) (*PaymentSourceSourceParams, error) {
var sp *PaymentSourceSourceParams
var err error
switch p := obj.(type) {
case *CardParams:
sp = &PaymentSourceSourceParams{
Card: p,
}
case string:
sp = &PaymentSourceSourceParams{
Token: &p,
}
default:
err = fmt.Errorf("U... | [
-0.6942986249923706,
0.1928972750902176,
0.4388963580131531,
-1.0502127408981323,
-0.9056063890457153,
0.19187797605991364,
-0.7096906900405884,
-0.3187136650085449,
0.17251688241958618,
0.3157917559146881,
-0.5261080861091614,
0.19042862951755524,
0.22068654000759125,
0.7241892218589783,
... |
func (p *PaymentSourceParams) AddExpand(f string) {
p.Expand = append(p.Expand, &f)
} | [
0.2245495766401291,
1.0073267221450806,
0.36951813101768494,
-0.7583909034729004,
-0.44686397910118103,
0.8356837630271912,
-0.6666183471679688,
0.25044289231300354,
-0.1011555939912796,
-0.8566044569015503,
0.40834465622901917,
-0.12366689741611481,
0.00860262755304575,
0.9902347326278687... |
func (p *PaymentSourceParams) AddMetadata(key string, value string) {
if p.Metadata == nil {
p.Metadata = make(map[string]string)
}
p.Metadata[key] = value
} | [
-0.7940911054611206,
0.8541321754455566,
0.3943038880825043,
-1.0570069551467896,
0.6358485817909241,
0.6917937994003296,
-1.1840825080871582,
0.28456687927246094,
-0.204982727766037,
0.8238241672515869,
-0.22411176562309265,
-0.16293500363826752,
0.22083625197410583,
0.6439987421035767,
... |
func (p *PaymentSourceVerifyParams) AddExpand(f string) {
p.Expand = append(p.Expand, &f)
} | [
0.48158714175224304,
0.775891125202179,
0.35244184732437134,
-0.31428733468055725,
-0.1935652494430542,
1.049623966217041,
-0.5464618802070618,
0.24135595560073853,
0.11208488047122955,
-0.916660726070404,
0.2764085829257965,
0.037200432270765305,
-0.3075563311576843,
1.0362138748168945,
... |
func (s *PaymentSource) UnmarshalJSON(data []byte) error {
if id, ok := ParseID(data); ok {
s.ID = id
return nil
}
type paymentSource PaymentSource
var v paymentSource
if err := json.Unmarshal(data, &v); err != nil {
return err
}
var err error
*s = PaymentSource(v)
switch s.Type {
case PaymentSourceT... | [
-0.9381170868873596,
0.9683073163032532,
0.3552057147026062,
-1.9666540622711182,
-0.9149556756019592,
-0.9169496297836304,
-0.4701738655567169,
0.38581523299217224,
0.6490117311477661,
0.02491787075996399,
-0.9325132966041565,
-0.08713386207818985,
-0.37994906306266785,
0.3116079568862915... |
func (s *PaymentSource) MarshalJSON() ([]byte, error) {
var target interface{}
switch s.Type {
case PaymentSourceTypeCard:
var customerID *string
if s.Card.Customer != nil {
customerID = &s.Card.Customer.ID
}
target = struct {
*Card
Customer *string `json:"customer"`
Type PaymentS... | [
-0.5720633268356323,
0.3810240924358368,
0.3595687448978424,
-1.1360136270523071,
-0.5700496435165405,
-0.8257909417152405,
-0.5095992088317871,
0.20036998391151428,
0.8319705724716187,
-0.13904233276844025,
-0.6834158301353455,
1.075791597366333,
0.024690233170986176,
0.20429028570652008,... |
func (r *UserRepository) GetByID(id string) (models.User, error) {
intID, err := strconv.ParseInt(id, 10, 64)
if err != nil {
return models.User{}, fmt.Errorf("Id must be integer: %s", id)
}
var user models.User
if r.C.First(&user, intID).RecordNotFound() {
return models.User{}, fmt.Errorf("User for id %s not ... | [
0.07771933823823929,
0.18702812492847443,
0.4556746482849121,
-0.17507827281951904,
0.24582184851169586,
0.25374260544776917,
0.4869021773338318,
-0.4389236569404602,
0.4069111943244934,
-0.08029922842979431,
-0.11574738472700119,
0.37675240635871887,
-0.40297427773475647,
0.26866820454597... |
func (r *UserRepository) GetAllByName(name string) []models.User {
var users []models.User
r.C.Where("name = ?", name).Find(&users)
return users
} | [
0.1490531712770462,
-0.14507009088993073,
0.5731274485588074,
0.7528718113899231,
0.06171923503279686,
-0.22677083313465118,
-0.5182866454124451,
-0.3574596643447876,
0.09937109053134918,
0.775727391242981,
-1.063128113746643,
-0.13353148102760315,
-0.39340826869010925,
1.0843795537948608,... |
func pkcs7Padding(b []byte, blocksize int) ([]byte, error) {
if blocksize <= 0 {
return nil, ErrInvalidBlockSize
}
if b == nil || len(b) == 0 {
return nil, ErrInvalidPKCS7Data
}
n := blocksize - (len(b) % blocksize)
pb := make([]byte, len(b)+n)
copy(pb, b)
copy(pb[len(b):], bytes.Repeat([]byte{b... | [
-0.010471336543560028,
0.870435893535614,
0.9344765543937683,
0.5621224641799927,
-1.230134129524231,
0.6765628457069397,
-0.7254612445831299,
-0.5317042469978333,
1.1913292407989502,
1.3096897602081299,
0.2549850642681122,
-0.6397075057029724,
-0.7545994520187378,
0.6462315320968628,
0.... |
func pkcs7Trimming(b []byte, blocksize int) ([]byte, error) {
if blocksize <= 0 {
return nil, ErrInvalidBlockSize
}
if b == nil || len(b) == 0 {
return nil, ErrInvalidPKCS7Data
}
if len(b)%blocksize != 0 {
return nil, ErrInvalidPKCS7Padding
}
c := b[len(b)-1]
n := int(c)
if n == 0 || n > l... | [
0.5168939828872681,
0.3102472424507141,
0.9907267093658447,
0.3145940601825714,
-0.5532407760620117,
0.15859565138816833,
-0.3627462685108185,
-0.4347842037677765,
0.48353689908981323,
1.023170828819275,
-0.03906906768679619,
0.17561082541942596,
-0.8730446100234985,
-0.016637291759252548,... |
func DecryptString(key []byte, cryptoText string) (string, error) {
ciphertext, _ := base64.StdEncoding.DecodeString(cryptoText)
ciphertext, err:=Decrypt(key, ciphertext)
if err!=nil{
return "", err
}
return fmt.Sprintf("%s", ciphertext), nil
} | [
-0.016603274270892143,
-0.003351279767230153,
0.3618719279766083,
0.07373590767383575,
-0.7164871692657471,
-0.4554753601551056,
-0.7918850183486938,
-0.06445338577032089,
-0.3225148618221283,
1.3938894271850586,
0.5960606932640076,
0.14482469856739044,
-0.7755663990974426,
-0.472077667713... |
func GetChat(c *gin.Context) {
http.ServeFile(c.Writer, c.Request, "chat.html")
log.Printf("Getting chat.")
fmt.Println()
} | [
1.076923131942749,
0.1957814246416092,
0.5457867383956909,
1.1774543523788452,
0.9413873553276062,
0.5953956842422485,
0.8316424489021301,
-0.06954114884138107,
-1.5875567197799683,
-0.2420593500137329,
1.357794165611267,
0.9987725615501404,
0.4860058128833771,
-0.21187381446361542,
-0.4... |
func GetChatData(c *gin.Context) {
msgs, err := models.AllChatMsgs() // msgs are type []ChatMessageForm
if err != nil {
c.JSON(500, err)
} else {
c.JSON(200, msgs)
}
} | [
-0.28035470843315125,
-0.1964080035686493,
0.8157128691673279,
0.6033621430397034,
0.2341475486755371,
0.9920180439949036,
-0.6110525727272034,
-0.5876290202140808,
-0.9812325835227966,
0.10055005550384521,
-0.22961774468421936,
0.6137463450431824,
0.5254526734352112,
1.3145288228988647,
... |
func GetHack(c *gin.Context) {
http.ServeFile(c.Writer, c.Request, "hack.html")
} | [
0.24221569299697876,
1.3187438249588013,
0.44497770071029663,
1.2116780281066895,
1.7534877061843872,
0.02706485614180565,
1.058411717414856,
0.1921514868736267,
-0.920028567314148,
-0.1271539181470871,
1.0929830074310303,
0.9382298588752747,
0.1996082216501236,
-0.5288446545600891,
-0.5... |
func TestTransportTimeoutServerHangs(t *testing.T) {
clientDone := make(chan struct{})
ct := newClientTester(t)
ct.client = func() error {
defer ct.cc.(*net.TCPConn).CloseWrite()
defer close(clientDone)
buf := make([]byte, 1<<19)
_, err := rand.Read(buf)
if err != nil {
t.Fatal("fail to gen random data... | [
0.052546191960573196,
0.7388806343078613,
0.6724379658699036,
-0.42383769154548645,
-0.03501315414905548,
0.7334151864051819,
0.542726993560791,
-1.1527358293533325,
-0.34105855226516724,
0.03964748978614807,
-0.7185949087142944,
0.4445575475692749,
-0.24732400476932526,
0.715474009513855,... |
func printHeadTag(r *http.Response) {
var head string
var err error
var b = bytes.NewBuffer(nil)
var n int64
var openInd, closeInd int
//if len(r.Body) == 0 {
// fmt.Printf("getrequester.getHeadTag: no body\n")
// return
//}
if n, err = b.ReadFrom(r.Body); err != nil {
fmt.Printf("getrequester.getHeadTag er... | [
0.06902551651000977,
-1.1725058555603027,
1.3337318897247314,
0.2262599915266037,
0.08297319710254669,
0.5536975264549255,
-0.011963657103478909,
-0.7659962773323059,
0.22178423404693604,
-0.19356568157672882,
0.3186233937740326,
0.8912352323532104,
-1.0563222169876099,
0.6180396676063538,... |
func (gqc *GQLClient) Request(req *graphql.Request) (*map[string]interface{}, error) {
// make a request
req.Header.Add("Authentication", gqc.Headers.AccessToken)
ctx := context.Background()
var respData map[string]interface{}
if err := gqc.client.Run(ctx, req, &respData); err != nil {
return nil, err
}
retur... | [
-0.8809736371040344,
0.02497144043445587,
0.6261040568351746,
-0.2843315601348877,
0.21363991498947144,
-0.18208062648773193,
-0.5223856568336487,
-1.0455995798110962,
-0.3110847473144531,
-0.005795413162559271,
0.5211138129234314,
0.9882715940475464,
0.06914905458688736,
-0.23999299108982... |
func New(config *Config) *BTCVanity {
return &BTCVanity{
config: config,
stop: make(chan bool),
}
} | [
0.29947859048843384,
-0.564370334148407,
0.39428743720054626,
-0.09993826597929001,
0.23700860142707825,
-0.5333998799324036,
-0.004060528706759214,
-0.061072416603565216,
-0.9920503497123718,
0.8164660334587097,
-0.5864706039428711,
0.9458900094032288,
-0.21051643788814545,
0.047612905502... |
func (b *BTCVanity) Find(pattern string) (IWallet, error) {
var resWallet IWallet
var resError error
var chainParams *chaincfg.Params
if b.config.TestNet {
chainParams = &chaincfg.TestNet3Params
} else {
chainParams = &chaincfg.MainNetParams
}
btcWorker := &worker{gen: &Generator{params: chainParams}}
mu... | [
0.19317133724689484,
-0.05061042681336403,
0.7222305536270142,
-0.3248690962791443,
0.27003782987594604,
-0.26165980100631714,
0.3864036202430725,
-0.7772324085235596,
-0.7188166379928589,
0.7619127035140991,
0.036114007234573364,
-0.03343129903078079,
-1.8091888427734375,
0.87999713420867... |
func (b *BTCVanity) Stop() {
b.stop <- true
} | [
-0.3000544011592865,
0.1313314288854599,
0.36490553617477417,
0.36768436431884766,
1.3890995979309082,
0.3742416501045227,
-0.1497097909450531,
-0.05835488438606262,
-1.0823636054992676,
0.976925253868103,
-0.711402416229248,
0.5135646462440491,
-1.2623467445373535,
-0.15895210206508636,
... |
func newConn(ev string) (*grpc.ClientConn) {
connChanIn <- ev
var conn *grpc.ClientConn
for ch := range connChanOut {
if ch.RespID == strings.Split(ev, ":")[0] {
conn = ch.Connect
break
}
log.Println("failed:", "connetion id not found")
break
}
return conn
} | [
0.4659876227378845,
-1.5469611883163452,
0.5663999915122986,
0.9047818779945374,
-0.06148182228207588,
-0.19057293236255646,
-0.24473002552986145,
-0.14341405034065247,
-0.6738011837005615,
-0.1374584287405014,
0.01344364508986473,
-0.07218550890684128,
-0.31419283151626587,
-0.32140648365... |
func Environ() (Config, error) {
cfg := Config{}
err := envconfig.Process("", &cfg)
defaultAddress(&cfg)
defaultProxy(&cfg)
defaultRunner(&cfg)
defaultSession(&cfg)
defaultCallback(&cfg)
configureGithub(&cfg)
if err := kubernetesServiceConflict(&cfg); err != nil {
return cfg, err
}
return cfg, err
} | [
-0.017714349552989006,
0.04357385262846947,
0.7031479477882385,
0.3398158848285675,
0.33981016278266907,
-0.333767831325531,
-0.3689124882221222,
0.6766180396080017,
0.28304538130760193,
0.5158064365386963,
-0.4866753816604614,
0.25676479935646057,
-0.39967256784439087,
0.3863072395324707,... |
func (c *Config) String() string {
out, _ := yaml.Marshal(c)
return string(out)
} | [
0.7905337810516357,
-0.7680343389511108,
-0.20894743502140045,
-0.5199598073959351,
-0.7168929576873779,
0.09932617843151093,
0.20846013724803925,
-0.07056328654289246,
-0.3274834454059601,
0.26930609345436096,
-0.45260733366012573,
0.4247802495956421,
0.31967440247535706,
0.40035963058471... |
func (c *Config) IsGitHub() bool {
return c.Github.ClientID != ""
} | [
0.21258291602134705,
0.5938271284103394,
0.22567689418792725,
1.4066535234451294,
0.5877455472946167,
0.7792454957962036,
-0.42813003063201904,
0.5097970366477966,
0.40695375204086304,
0.9586597681045532,
-0.03561658039689064,
0.6568385362625122,
-1.0640103816986084,
0.8434600830078125,
... |
func (c *Config) IsGitHubEnterprise() bool {
return c.IsGitHub() && !strings.HasPrefix(c.Github.Server, "https://github.com")
} | [
-0.824592649936676,
0.20801809430122375,
0.18846037983894348,
1.036428451538086,
0.2816937267780304,
0.5201417207717896,
-0.6431295275688171,
0.23913569748401642,
0.9232556819915771,
0.36581894755363464,
-0.5801542401313782,
0.021261190995573997,
-1.8729116916656494,
1.206709861755371,
0... |
func (c *Config) IsGitLab() bool {
return c.GitLab.ClientID != ""
} | [
0.4021446108818054,
0.16525213420391083,
0.06775692105293274,
0.2196996659040451,
0.2303118109703064,
1.4063818454742432,
-0.4588868021965027,
0.03073284961283207,
0.10614628344774246,
1.064505696296692,
0.23358584940433502,
-0.4388287365436554,
-1.0815834999084473,
0.46456724405288696,
... |
func (c *Config) IsGogs() bool {
return c.Gogs.Server != ""
} | [
-0.4701579213142395,
1.5482149124145508,
0.12265454977750778,
0.4446127116680145,
0.4193507432937622,
-0.03816370293498039,
-0.9341768026351929,
0.46204087138175964,
0.13477526605129242,
1.0129690170288086,
-0.17137132585048676,
0.20538774132728577,
-1.0731077194213867,
0.8585240840911865,... |
func (c *Config) IsGitea() bool {
return c.Gitea.Server != ""
} | [
-1.0343247652053833,
-0.028204582631587982,
0.31920453906059265,
-0.2913873493671417,
0.3356249928474426,
0.13791115581989288,
0.06489510834217072,
0.5601373314857483,
0.5112291574478149,
0.7972748279571533,
0.34283992648124695,
0.6056885719299316,
-1.020169734954834,
1.322429895401001,
... |
func (c *Config) IsBitbucket() bool {
return c.Bitbucket.ClientID != ""
} | [
0.5347663164138794,
0.4895840585231781,
0.24978037178516388,
0.0026420149952173233,
0.9598989486694336,
0.21000653505325317,
0.060508131980895996,
-0.2735592722892761,
0.04599452018737793,
0.4764387011528015,
-0.39835217595100403,
0.9503068923950195,
-0.44736650586128235,
0.773237824440002... |
func (c *Config) IsStash() bool {
return c.Stash.Server != ""
} | [
-0.4581248164176941,
0.26579606533050537,
0.35366904735565186,
0.5753452777862549,
-0.14530208706855774,
0.4611731171607971,
0.013242149725556374,
-0.04380399361252785,
0.7989100813865662,
0.6267940998077393,
-0.9744650721549988,
0.8619801998138428,
0.35241028666496277,
0.8105417490005493,... |
func (b *Bytes) Decode(value string) error {
v, err := humanize.ParseBytes(value)
*b = Bytes(v)
return err
} | [
0.26589512825012207,
0.6443056464195251,
0.27913153171539307,
0.5365529656410217,
-0.35549864172935486,
0.21754297614097595,
-0.973327100276947,
0.04142065346240997,
0.2469031810760498,
-0.3488030433654785,
-0.63604736328125,
0.3749929666519165,
-0.7757405042648315,
0.11551336944103241,
... |
func (b *Bytes) Int64() int64 {
return int64(*b)
} | [
-0.4409109055995941,
-0.5154805779457092,
-0.026328235864639282,
0.8365742564201355,
0.4756788909435272,
0.08692795783281326,
-0.3765968084335327,
0.284567654132843,
0.20042704045772552,
-0.6902438402175903,
-0.1395377218723297,
0.001230277819558978,
-1.2209053039550781,
0.1905442923307418... |
func (b *Bytes) String() string {
return fmt.Sprint(*b)
} | [
0.25229135155677795,
-0.49209344387054443,
0.011969025246798992,
0.13264545798301697,
0.17911984026432037,
0.8288331031799316,
-0.1934974044561386,
-1.079909086227417,
0.105336494743824,
-0.5929818749427795,
-0.4539574980735779,
0.7121346592903137,
-0.8773313164710999,
0.1888994723558426,
... |
func (u *UserCreate) Decode(value string) error {
for _, param := range strings.Split(value, ",") {
parts := strings.Split(param, ":")
if len(parts) != 2 {
continue
}
key := parts[0]
val := parts[1]
switch key {
case "username":
u.Username = val
case "token":
u.Token = val
case "machine":
... | [
-0.5011320114135742,
0.4504525661468506,
0.28719550371170044,
0.44456973671913147,
-0.42581701278686523,
0.29078543186187744,
-0.7315552830696106,
0.12447365373373032,
-0.4760599136352539,
0.25399190187454224,
-0.8915221691131592,
-0.18140462040901184,
-0.7131536602973938,
-0.1972075998783... |
func (p *Processor) IsAllowed() bool {
// return false since no startup tasks available for unix platform.
return false
} | [
0.058768924325704575,
0.5774132013320923,
0.6838571429252625,
1.089099407196045,
-0.21506178379058838,
0.912947952747345,
0.07349321991205215,
0.9264293909072876,
0.250876247882843,
-0.3208255469799042,
0.4431917071342468,
1.184599757194519,
-0.6722782254219055,
0.2244085818529129,
-0.50... |
func (p *Processor) ExecuteTasks() error {
return nil
} | [
0.1177058070898056,
0.44833841919898987,
0.23267973959445953,
0.3671356737613678,
0.9148229956626892,
1.2737683057785034,
1.0667539834976196,
0.6453405022621155,
0.05503755807876587,
-0.07911315560340881,
0.025572964921593666,
-0.04525183513760567,
-0.8281306028366089,
-0.01019741408526897... |
func ForIsGosWhile() {
sum := 1
for sum < 1000 {
sum += sum
}
fmt.Println(sum)
} | [
1.207627773284912,
0.5518161058425903,
0.5788835883140564,
0.2175581157207489,
0.5662603378295898,
0.3931070566177368,
0.1502649188041687,
-0.5699167251586914,
-0.28027641773223877,
-0.015046883374452591,
-0.5077683329582214,
0.8822594881057739,
0.34099429845809937,
0.35290461778640747,
... |
func (pow *ProofOfWork)Run() ([]byte, uint64) {
/*
The steps of algorithm
1.assemble data
2.calculate hash
3.compare to the exit criteria(that is target)
*/
var nonce uint64
var hash [32]byte
block := pow.block
fmt.Println("start mine!")
for {
//1.assemble data
item := [][]byte{
Uint64ToBtye(block.V... | [
-0.3682020902633667,
-0.4197036623954773,
0.7985792756080627,
0.4383421242237091,
0.24452923238277435,
0.516883909702301,
0.0444735623896122,
0.239754781126976,
-0.7475369572639465,
0.12538056075572968,
-0.5226706266403198,
-0.03104846365749836,
-0.9736779928207397,
0.45930981636047363,
... |
func FilePathExists(path string) (bool, error) {
_, err := os.Stat(path)
if err == nil {
return true, nil
}
if os.IsNotExist(err) {
return false, nil
}
return true, err
} | [
-0.6147362589836121,
-0.736079752445221,
0.6575649976730347,
-0.2532193064689636,
1.3013163805007935,
0.31596115231513977,
-0.3150113821029663,
0.0776023268699646,
-0.039347127079963684,
0.5711370706558228,
-0.6464617848396301,
-0.8353017568588257,
0.1004830077290535,
0.20742160081863403,
... |
func CreateFolderPath(path string) error {
return os.MkdirAll(path, os.ModePerm)
} | [
0.033610884100198746,
-0.0764775425195694,
0.2941874861717224,
0.6749975085258484,
-0.0178518109023571,
1.3455137014389038,
1.349902868270874,
-0.7610177397727966,
-0.7009646892547607,
0.28269442915916443,
-0.4894271790981293,
-0.4652461111545563,
-0.8367183208465576,
0.9511051774024963,
... |
func CreateFileIfNotExists(path string) error {
exists, er := FilePathExists(path)
if er != nil {
return er
} else {
if !exists {
var file, err = os.Create(path)
if err != nil {
return err
}
defer file.Close()
}
}
return nil
} | [
0.8217867016792297,
-0.44547343254089355,
0.34776097536087036,
-0.23613105714321136,
1.2960171699523926,
1.0225152969360352,
-0.3486200273036957,
-0.7553417682647705,
-0.5502593517303467,
0.6366564631462097,
0.43669912219047546,
-0.7880873084068298,
-0.11295989900827408,
0.9105378985404968... |
func CreateFileWithPathIfNotExists(path string) (bool, error) {
exists, err := FilePathExists(path)
if err != nil {
return false, err
}
if !exists {
dir, _ := filepath.Split(path)
if len(dir) > 0 {
err = CreateFolderPath(dir)
if err != nil {
return false, err
}
}
err = CreateFileIfNotExists(p... | [
0.24454857409000397,
0.18847018480300903,
0.5456041693687439,
0.15826937556266785,
1.0552324056625366,
0.5155399441719055,
-0.2802395224571228,
-0.7039444446563721,
-0.5358031988143921,
0.3242611289024353,
0.051919061690568924,
-1.6698672771453857,
-0.2862464487552643,
1.131241798400879,
... |
func ReadAllDataFromFile(filePath string) ([]byte, error) {
if filePath == "" {
return nil, errors.New("invalid file path. value:" + filePath)
}
var file, fileErr = os.OpenFile(filePath, os.O_RDWR, 0644)
defer file.Close()
if fileErr != nil {
return nil, fileErr
}
return ioutil.ReadAll(file)
} | [
0.47763416171073914,
-0.5421919822692871,
0.5623724460601807,
0.4302673935890198,
-0.16685475409030914,
1.4406403303146362,
-0.5862342119216919,
-0.27584144473075867,
-0.4358826279640198,
0.0167804304510355,
0.2010572850704193,
0.490753710269928,
-0.302136093378067,
0.5975496172904968,
-... |
func WriteDataToFile(filePath string, data []byte) error {
if filePath == "" {
return errors.New("invalid file path. value:" + filePath)
}
if data == nil {
return errors.New("invalid data. value: nil")
}
return ioutil.WriteFile(filePath, data, 0644)
} | [
-0.0105906892567873,
-0.02734753116965294,
0.13110320270061493,
-0.13312695920467377,
0.7833344340324402,
0.9934147596359253,
-0.3155632019042969,
0.3073015809059143,
-0.5254031419754028,
-0.010094673372805119,
-0.7754698395729065,
0.05869336426258087,
0.3235088884830475,
0.809508025646209... |
func Test(t *testing.T) { TestingT(t) } | [
0.5603705644607544,
0.47240784764289856,
0.14808350801467896,
0.21293595433235168,
0.38073426485061646,
0.712630569934845,
1.494964361190796,
-0.18387949466705322,
-0.4030367434024811,
0.012481830082833767,
-0.6709293127059937,
-0.1728723794221878,
-0.05282559245824814,
0.4567270874977112,... |
func Success(data interface{}) *JSONResponse {
return &JSONResponse{
Status: http.StatusOK,
Content: data,
ContentType: "application/json",
}
} | [
-0.17211304605007172,
-0.5222587585449219,
0.42169204354286194,
-0.17460934817790985,
-1.6686729192733765,
-0.38119229674339294,
-0.3925275504589081,
-0.28423964977264404,
0.882520854473114,
0.15382319688796997,
-0.88870769739151,
-0.3323468863964081,
0.580466091632843,
-0.693189263343811,... |
func Error(err error) *JSONResponse {
return ErrorFromString(err.Error(), 500)
} | [
-0.6112592220306396,
-0.8005133867263794,
0.07772533595561981,
0.301663875579834,
-1.1775202751159668,
-1.1486358642578125,
-0.23175789415836334,
-0.7812964916229248,
1.3844181299209595,
0.21576115489006042,
0.045591652393341064,
0.24605633318424225,
-0.05798683688044548,
-0.07672607898712... |
func (s *Server) getIMGURL(url string) string {
if url == "" {
return ""
}
end := strings.LastIndex(url, "-")
if end == -1 {
return url + "-t500x500.jpg"
}
return string([]rune(url)[0:strings.LastIndex(url, "-")]) + "-t500x500.jpg"
} | [
-1.408024787902832,
0.2450970709323883,
0.7813548445701599,
0.27629372477531433,
-0.39663469791412354,
-0.0807049348950386,
-0.3140178322792053,
0.722883939743042,
-0.13983789086341858,
0.958961009979248,
-0.24417684972286224,
0.5316804051399231,
-0.4483199119567871,
0.13190490007400513,
... |
func (s *Server) getMediaURL(url string) (string, error) {
res, err := http.Get(url + "?client_id=" + s.scdl.ClientID())
if err != nil {
if data, err := ioutil.ReadAll(res.Body); err == nil {
return "", &failedRequestError{status: res.StatusCode, errMsg: string(data)}
}
return "", &failedRequestError{status:... | [
-0.6476215124130249,
-0.2757328450679779,
0.9677935242652893,
0.16966325044631958,
-0.3388434052467346,
0.025808798149228096,
-0.42803090810775757,
-0.551893949508667,
0.41194701194763184,
0.6208675503730774,
0.14690300822257996,
1.1426172256469727,
-0.8720173239707947,
0.7970139980316162,... |
func (s *Server) getMediaURLMany(urls []trackInfo) ([]trackInfo, error) {
if len(urls) == 0 {
return nil, errors.New("No URLs provided")
}
type result struct {
url string
index int
}
resChan := make(chan result, len(urls))
errChan := make(chan error)
for i, d := range urls {
go func(i int, url string)... | [
-1.3190679550170898,
0.2162686139345169,
0.8978815674781799,
0.3946169316768646,
0.4689524173736572,
-0.5321412682533264,
-0.640425980091095,
-0.2613908350467682,
-0.4711388051509857,
-0.17063908278942108,
0.21973998844623566,
-0.17208153009414673,
-0.9752205610275269,
1.1478112936019897,
... |
func ValidatePath(path string) error {
if path == "" {
return fmt.Errorf("path cannot be empty")
}
if string(path[0]) != "/" {
return fmt.Errorf("path must start with / character")
}
if len(path) == 1 { // done checking - it's the root
return nil
}
if string(path[len(path)-1]) == "/" {
return fmt.Errorf... | [
0.3454227149486542,
-0.41504621505737305,
0.9672921895980835,
-0.20495343208312988,
-0.9932535886764526,
-0.12068388611078262,
1.00809907913208,
-1.048304557800293,
0.011874241754412651,
0.2571735680103302,
0.5061632394790649,
0.14509637653827667,
-0.7815913558006287,
-0.04817954823374748,... |
func ParseACL(acl string) []zk.ACL {
acls := strings.Split(acl, ",")
zkACLs := make([]zk.ACL, 0)
for _, a := range acls {
firstColon := strings.Index(a, ":")
lastColon := strings.LastIndex(a, ":")
if firstColon == -1 || lastColon == -1 || firstColon == lastColon {
fmt.Println(a + " does not have the form sc... | [
0.18153850734233856,
-0.38107630610466003,
0.5912386178970337,
-0.1176091730594635,
-0.7231488227844238,
-0.3731115758419037,
0.14626860618591309,
0.17686454951763153,
0.7244746088981628,
0.7573277950286865,
-0.04632648825645447,
0.14110204577445984,
0.03398033231496811,
-0.481429874897003... |
func IsOptionSet(name string, f *flag.FlagSet) bool {
set := false
f.Visit(func(f *flag.Flag) {
if f.Name == name {
set = true
}
})
return set
} | [
-0.46990513801574707,
0.07576021552085876,
0.6389906406402588,
0.2608250081539154,
-0.2328505665063858,
-0.2097165882587433,
-0.32578665018081665,
-0.7190387845039368,
-0.6278647780418396,
0.8632774353027344,
0.593183159828186,
0.041826631873846054,
-0.4379808306694031,
-0.3511379361152649... |
func DialogBox(
hInstance HINSTANCE,
TemplateName string,
hWndParent HWND,
lpDialogFunc DLGPROC,
) INT_PTR {
var ret, _, _ = userDialogBoxParamW.Call(
uintptr(hInstance),
UintptrFromString(&TemplateName),
uintptr(hWndParent),
uintptr(lpDialogFunc),
0,
)
return INT_PTR(ret)
} | [
0.1826539933681488,
0.3724028468132019,
0.7259559035301208,
-0.7545087933540344,
-0.9516814351081848,
-0.46835190057754517,
0.8102220296859741,
-0.47566691040992737,
0.21218186616897583,
-0.5902277827262878,
-0.2812609374523163,
0.7777280807495117,
-0.39489251375198364,
0.16707389056682587... |
func DialogBoxIndirect(
hInstance HINSTANCE,
lpTemplate *DLGTEMPLATE,
hWndParent HWND,
lpDialogFunc DLGPROC,
) INT_PTR {
return DialogBoxIndirectParam(
hInstance,
lpTemplate,
hWndParent,
lpDialogFunc,
0,
)
} | [
0.2608664631843567,
-0.42678624391555786,
0.49675434827804565,
-0.921979546546936,
-1.0016087293624878,
0.37942227721214294,
0.6587772369384766,
-0.1572546362876892,
-0.14897321164608002,
-0.6493536829948425,
-0.24159730970859528,
1.1186537742614746,
-0.4378626346588135,
-0.051656555384397... |
func GET_WHEEL_DELTA_WPARAM(wParam WPARAM) int16 {
return int16(HIWORD(uint32(wParam)))
} | [
0.006440210621803999,
0.03214352950453758,
0.6347790956497192,
-0.1848168969154358,
0.5580255389213562,
0.4304042458534241,
1.306714653968811,
-0.4898435175418854,
0.020513636991381645,
-0.15528400242328644,
0.04552290216088295,
0.2539519667625427,
-0.46494102478027344,
1.1507288217544556,... |
func HIWORD(val uint32) uint16 {
return uint16(val >> 16 & 0xffff)
} | [
1.8547155857086182,
0.920371413230896,
0.4717293381690979,
-0.07492166757583618,
-0.05226411297917366,
0.42428329586982727,
-0.4549061954021454,
-0.7248129844665527,
0.5573816299438477,
-0.4581594169139862,
-0.7926346659660339,
0.19319866597652435,
-0.27008935809135437,
0.6781007051467896,... |
func LOWORD(val uint32) uint16 {
return uint16(val)
} | [
1.8608794212341309,
0.5169278383255005,
0.3163297474384308,
-2.144974946975708,
0.18648356199264526,
0.20466339588165283,
-0.9761826395988464,
-1.5316343307495117,
0.5864028334617615,
-1.7107009887695312,
-0.2849656045436859,
0.41501596570014954,
-0.6484612822532654,
0.9064040184020996,
... |
func MAKEINTRESOURCE(id WORD) *WCHAR {
// turn 'id' to unsafe.Pointer without 'go vet' triggering a warning:
var ptr unsafe.Pointer
ptr = unsafe.Pointer(uintptr(ptr) + uintptr(uint(id)))
return (*WCHAR)(ptr)
} | [
0.46533265709877014,
-0.8353468775749207,
0.38851198554039,
-1.5393353700637817,
-0.6745204925537109,
0.2256583720445633,
-0.3703462779521942,
-1.087234377861023,
0.13098879158496857,
0.710045337677002,
0.44817009568214417,
0.17103791236877441,
-1.3143670558929443,
-0.7161732912063599,
0... |
func MAKELANGID(p, s WORD) LANGID {
return LANGID(s<<10 | p)
} | [
1.1048141717910767,
-0.05256671458482742,
0.04081229120492935,
-0.5630673766136169,
-1.5256917476654053,
1.403814673423767,
-0.6007360219955444,
0.8032947778701782,
0.6872240304946899,
-0.04386694356799126,
-0.6007987260818481,
0.496017187833786,
-0.17779773473739624,
-0.3636539578437805,
... |
func RGB(red, green, blue int) COLORREF {
return COLORREF(uint32(red) | uint32(green)<<8 | uint32(blue)<<16)
} | [
0.09286818653345108,
0.6350893378257751,
0.3815266191959381,
-0.5043023824691772,
-0.07861083000898361,
0.7016456723213196,
-0.6359325051307678,
-1.2016910314559937,
-0.7183399200439453,
-0.3819427490234375,
0.85165935754776,
0.8627515435218811,
-0.7449405789375305,
0.09645792841911316,
... |
func WindowMessageName(msg UINT) string {
var messages = map[UINT]string{
WM_ACTIVATE: "WM_ACTIVATE",
WM_CHAR: "WM_CHAR",
WM_COMMAND: "WM_COMMAND",
WM_COPYDATA: "WM_COPYDATA",
WM_CREATE: "WM_CREATE",
WM_DESTROY: "WM_DESTROY",
WM_DROPFILES: "WM_DROPFILES",
WM_INITDIALOG: "WM... | [
0.26756551861763,
-0.9007430672645569,
1.0601060390472412,
-0.7529822587966919,
-1.4088951349258423,
-0.012013205327093601,
0.9031413197517395,
-0.5780444741249084,
0.361698180437088,
0.5778393745422363,
-0.47514885663986206,
0.30761823058128357,
-0.38081398606300354,
0.9670478701591492,
... |
func New(o *Options) (Interface, error) {
var (
registration = o.registration()
path = o.path()
serviceName = o.serviceName()
registrar sd.Registrar
logger = logging.DefaultCaller(o.logger(), "serviceName", o.serviceName(), "path", path, "registration", registration)
// use the internal ... | [
0.1106935441493988,
0.4161403179168701,
0.6005573868751526,
0.22795000672340393,
-0.2865757644176483,
-0.822239875793457,
1.4664949178695679,
-0.33072665333747864,
-0.13822543621063232,
-0.2904137969017029,
-0.14959770441055298,
0.4271481931209564,
-0.2536720335483551,
1.0527044534683228,
... |
func (fn CreateCopyHandlerFunc) Handle(params CreateCopyParams) middleware.Responder {
return fn(params)
} | [
-0.10204344987869263,
-0.4953119456768036,
0.43474096059799194,
0.6439285278320312,
-0.4949565827846527,
0.868567705154419,
0.9803289771080017,
0.15742386877536774,
-0.03924250602722168,
0.1374286711215973,
0.19400779902935028,
-0.4784989356994629,
-0.29889732599258423,
-0.3195186257362366... |
func NewCreateCopy(ctx *middleware.Context, handler CreateCopyHandler) *CreateCopy {
return &CreateCopy{Context: ctx, Handler: handler}
} | [
-0.405411034822464,
-0.815765380859375,
0.3089444637298584,
0.8511276245117188,
-1.1811304092407227,
0.2755576968193054,
0.06726711243391037,
-0.40884703397750854,
-0.09736760705709457,
0.6560797691345215,
0.12092036008834839,
-0.619286060333252,
-0.0830240473151207,
0.47835689783096313,
... |
func WithProviderID(id *uint32) OptionFunc {
return func(opts *option) error {
opts.providerID = id
return nil
}
} | [
-0.07841423898935318,
-0.3381260931491852,
0.04386887699365616,
-0.2867913544178009,
-0.5724940896034241,
0.387252539396286,
0.34926074743270874,
0.15812253952026367,
1.4007714986801147,
0.4695592224597931,
0.2603493630886078,
0.3487999141216278,
0.3615100681781769,
0.9884907603263855,
0... |
func WithCommitment(commitment []byte) OptionFunc {
return func(opts *option) error {
if len(commitment) != 32 {
return fmt.Errorf("invalid `commitment` length; expected: 32, given: %v", len(commitment))
}
opts.commitment = commitment
return nil
}
} | [
0.46940794587135315,
-0.1821787804365158,
0.5979495644569397,
-0.39823079109191895,
0.038326386362314224,
0.3155156970024109,
1.0494110584259033,
-0.2589415907859802,
0.5947389602661133,
0.8386218547821045,
-0.49135956168174744,
-1.2562460899353027,
0.36377111077308655,
-0.2808133959770202... |
func WithVRFDifficulty(difficulty []byte) OptionFunc {
return func(opts *option) error {
if len(difficulty) != 32 {
return fmt.Errorf("invalid `difficulty` length; expected: 32, given: %v", len(difficulty))
}
opts.vrfDifficulty = difficulty
return nil
}
} | [
0.015814723446965218,
0.43236449360847473,
0.5999744534492493,
-0.26084277033805847,
0.3786255419254303,
0.3816900849342346,
0.44268888235092163,
-0.44490259885787964,
0.6443454027175903,
-0.7255393266677856,
-0.3892248868942261,
-0.5726490616798401,
-0.22734560072422028,
0.589575588703155... |
func WithScryptParams(params config.ScryptParams) OptionFunc {
return func(opts *option) error {
if params.P != 1 || params.R != 1 {
return errors.New("invalid scrypt params: only r = 1, p = 1 are supported for initialization")
}
opts.n = params.N
return nil
}
} | [
-0.22457419335842133,
0.5293439626693726,
0.6050375699996948,
0.425025075674057,
0.1648719161748886,
-0.0021327463909983635,
0.09377895295619965,
-0.14467929303646088,
0.4448709189891815,
1.2527750730514526,
-0.2554354965686798,
0.14959989488124847,
-0.2652208209037781,
0.8290470838546753,... |
func WithLogger(logger *zap.Logger) OptionFunc {
return func(opts *option) error {
opts.logger = logger
return nil
}
} | [
-0.20815971493721008,
0.1364932358264923,
0.443501353263855,
-0.3607475757598877,
-0.3087266981601715,
-0.31602153182029724,
0.5329968929290771,
0.08173102885484695,
0.8793721795082092,
-0.5892700552940369,
0.05194415524601936,
-0.4558960795402527,
0.36873263120651245,
0.3148724436759949,
... |
func WithRetryDelay(retryDelay time.Duration) OptionFunc {
return func(opts *option) error {
opts.retryDelay = retryDelay
return nil
}
} | [
0.554431676864624,
-0.13024568557739258,
0.44682249426841736,
-0.22663840651512146,
0.3653164803981781,
0.25118932127952576,
0.20947608351707458,
-0.44073447585105896,
0.5096107721328735,
-0.4136711061000824,
-0.9557339549064636,
-0.34070366621017456,
0.5549396872520447,
0.2660926580429077... |
func WithMaxRetries(maxRetries int) OptionFunc {
return func(opts *option) error {
opts.maxRetries = maxRetries
return nil
}
} | [
0.4624943733215332,
0.37689444422721863,
0.34077316522598267,
-0.08662993460893631,
-0.08076271414756775,
-0.15752722322940826,
-0.7108474969863892,
0.2521994411945343,
1.3095425367355347,
-0.17156895995140076,
0.02657969482243061,
-0.2763468027114868,
0.7538623809814453,
-0.12753751873970... |
func New(opts ...OptionFunc) (*WorkOracle, error) {
options := &option{
maxRetries: 10,
retryDelay: time.Second,
logger: zap.NewNop(),
}
for _, opt := range opts {
if err := opt(options); err != nil {
return nil, err
}
}
if err := options.validate(); err != nil {
return nil, err
}
scrypt :=... | [
0.17094174027442932,
0.3811940550804138,
0.6675830483436584,
-0.08247556537389755,
-0.12639951705932617,
-0.2126786708831787,
0.326002836227417,
-0.5406633019447327,
0.07003041356801987,
1.3010976314544678,
-0.31951653957366943,
0.6714028716087341,
-0.23771785199642181,
-0.2630797028541565... |
func (w *WorkOracle) Position(p uint64) (WorkOracleResult, error) {
return w.Positions(p, p)
} | [
-0.8747898936271667,
0.2095726877450943,
0.21566540002822876,
0.21558508276939392,
0.8472364544868469,
-0.28974950313568115,
0.8759310245513916,
-0.8378377556800842,
0.4471685588359833,
0.4612421989440918,
0.13301798701286316,
-0.9105654954910278,
-0.7606595158576965,
-0.3964948058128357,
... |
func (w *WorkOracle) Positions(start, end uint64) (WorkOracleResult, error) {
if w.scrypt == nil {
return WorkOracleResult{}, ErrWorkOracleClosed
}
if start > end {
return WorkOracleResult{}, fmt.Errorf("invalid `start` and `end`; expected: start <= end, given: %v > %v", start, end)
}
tries := 0
for {
res... | [
-0.8914998769760132,
0.6007546782493591,
0.4332942068576813,
0.026733234524726868,
0.2703336179256439,
-0.7230072617530823,
-0.09015188366174698,
-1.09820556640625,
-0.09797913581132889,
0.05266523361206055,
0.476656973361969,
-0.4540978968143463,
-0.9204760789871216,
-0.7438626885414124,
... |
func (format *ProcessTSV) Configure(conf core.PluginConfigReader) error {
format.SimpleFormatter.Configure(conf)
directives := conf.GetStringArray("Directives", []string{})
format.directives = make([]tsvDirective, 0, len(directives))
format.delimiter = conf.GetString("Delimiter", "\t")
format.quotedValues = conf... | [
-0.24698597192764282,
-0.9989185929298401,
0.7609001398086548,
-0.5716480016708374,
-0.3879936933517456,
-1.236140251159668,
-0.4097657799720764,
0.27878761291503906,
-1.220297932624817,
0.4354541301727295,
0.039294082671403885,
-0.005836485885083675,
0.6016666889190674,
-0.123125426471233... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.