id stringlengths 2 7 | text stringlengths 17 51.2k | title stringclasses 1 value |
|---|---|---|
c171600 | if account == project.Username && repo == project.Reponame {
return project, nil
}
}
return nil, nil
} | |
c171601 | c.recentBuilds("recent-builds", nil, limit, offset)
} | |
c171602 |
params := url.Values{}
if status != "" {
params.Set("filter", status)
}
return c.recentBuilds(path, params, limit, offset)
} | |
c171603 |
err := c.request("GET", fmt.Sprintf("project/%s/%s/%d/artifacts", account, repo, buildNum), &artifacts, nil, nil)
if err != nil {
return nil, err
}
return artifacts, nil
} | |
c171604 | buildNum), build, nil, nil)
if err != nil {
return nil, err
}
return build, nil
} | |
c171605 | return c.BuildOpts(account, repo, branch, nil)
} | |
c171606 | opts := map[string]interface{}{"build_parameters": buildParameters}
return c.BuildOpts(account, repo, branch, opts)
} | |
c171607 |
err := c.request("POST", fmt.Sprintf("project/%s/%s/tree/%s", account, repo, branch), build, nil, opts)
if err != nil {
return nil, err
}
return build, nil
} | |
c171608 | repo), status, nil, nil)
if err != nil {
return "", err
}
return status.Status, nil
} | |
c171609 | c.request("DELETE", fmt.Sprintf("project/%s/%s/envvar/%s", account, repo, name), nil, nil, nil)
} | |
c171610 | return c.request("POST", fmt.Sprintf("project/%s/%s/ssh-key", account, repo), nil, nil, key)
} | |
c171611 | return nil, err
}
c.debugRequest(req)
resp, err := c.client().Do(req)
if err != nil {
return nil, err
}
defer resp.Body.Close()
c.debugResponse(resp)
output := []*Output{}
if err = json.NewDecoder(resp.Body).Decode(&output); err != nil {
return nil, err
}
return output, nil
} | |
c171612 |
err := c.request("GET", fmt.Sprintf("project/%s/%s/checkout-key", account, repo), &checkoutKeys, nil, nil)
if err != nil {
return nil, err
}
return checkoutKeys, nil
} | |
c171613 | c.request("POST", fmt.Sprintf("project/%s/%s/checkout-key", account, repo), checkoutKey, nil, body)
if err != nil {
return nil, err
}
return checkoutKey, nil
} | |
c171614 | repo, fingerprint), &checkoutKey, nil, nil)
if err != nil {
return nil, err
}
return checkoutKey, nil
} | |
c171615 | fmt.Sprintf("project/%s/%s/checkout-key/%s", account, repo, fingerprint), nil, nil, nil)
} | |
c171616 | opts {
o(conf)
}
conn, err := newConn(conf.Conn, conf.Client.Muted)
c := &Client{
conn: conn,
muted: conf.Client.Muted,
}
if err != nil {
c.muted = true
return c, err
}
c.rate = conf.Client.Rate
c.prefix = conf.Client.Prefix
c.tags = joinTags(conf.Conn.TagFormat, conf.Client.Tags)
return c, nil
} | |
c171617 |
rate: conf.Client.Rate,
prefix: conf.Client.Prefix,
tags: joinTags(tf, conf.Client.Tags),
}
clone.conn = c.conn
return clone
} | |
c171618 | c.skip() {
return
}
c.conn.metric(c.prefix, bucket, n, "c", c.rate, c.tags)
} | |
c171619 | }
c.conn.gauge(c.prefix, bucket, value, c.tags)
} | |
c171620 | c.conn.metric(c.prefix, bucket, value, "ms", c.rate, c.tags)
} | |
c171621 | t.c.Timing(bucket, int(t.Duration()/time.Millisecond))
} | |
c171622 | }
c.conn.unique(c.prefix, bucket, value, c.tags)
} | |
c171623 |
c.conn.flush(0)
c.conn.mu.Unlock()
} | |
c171624 |
c.conn.flush(0)
c.conn.handleError(c.conn.w.Close())
c.conn.closed = true
c.conn.mu.Unlock()
} | |
c171625 | {
c.Client.Rate = rate
})
} | |
c171626 | c.Client.Prefix += strings.TrimSuffix(p, ".") + "."
})
} | |
c171627 | {
c.Conn.TagFormat = tf
})
} | |
c171628 | oldTag := range c.Client.Tags {
if newTag.K == oldTag.K {
exists = true
oldTag.V = newTag.V
}
}
if !exists {
c.Client.Tags = append(c.Client.Tags, tag{
K: newTag.K,
V: newTag.V,
})
}
}
})
} | |
c171629 | := c.w.Write(c.buf[:n-1])
c.handleError(err)
if n < len(c.buf) {
copy(c.buf, c.buf[n:])
}
c.buf = c.buf[:len(c.buf)-n]
} | |
c171630 | find asset")
}
return getAdjancencyGraphFromFile(data, "qwerty")
} | |
c171631 | find asset")
}
return getAdjancencyGraphFromFile(data, "dvorak")
} | |
c171632 | find asset")
}
return getAdjancencyGraphFromFile(data, "keypad")
} | |
c171633 | find asset")
}
return getAdjancencyGraphFromFile(data, "mac_keypad")
} | |
c171634 | find asset")
}
return getAdjancencyGraphFromFile(data, "keypad")
} | |
c171635 | extraUpperCaseEntropy(match)
//TODO: L33t
return baseEntropy + upperCaseEntropy
} | |
c171636 | math.Log2(possibilities)
//add extra entropu for shifted keys. ( % instead of 5 A instead of a)
//Math is similar to extra entropy for uppercase letters in dictionary matches.
if S := float64(shiftCount); S > float64(0) {
possibilities = float64(0)
U := length - S
for i := float64(0); i < math.Min(S, U)+1; i++ {
possibilities += zxcvbnmath.NChoseK(S+U, i)
}
entropy += math.Log2(possibilities)
}
return entropy
} | |
c171637 |
entropy := math.Log2(cardinality * float64(len(match.Token)))
return entropy
} | |
c171638 | this be just the first or any char?
if unicode.IsUpper(rune(firstChar)) {
baseEntropy++
}
}
if !ascending {
baseEntropy++
}
return baseEntropy + math.Log2(float64(len(match.Token)))
} | |
c171639 | var possibilities float64
for i := float64(0); i <= math.Min(subsitutions, unsub)+1; i++ {
possibilities += zxcvbnmath.NChoseK(subsitutions+unsub, i)
}
if possibilities <= 1 {
return float64(1)
}
return math.Log2(possibilities)
} | |
c171640 |
if dateMatch.Separator != "" {
entropy += 2 //add two bits for separator selection [/,-,.,etc]
}
return entropy
} | |
c171641 | filters[i](matcher) {
shouldBeFiltered = true
break
}
}
if !shouldBeFiltered {
matches = append(matches, matcher.MatchingFunc(password)...)
}
}
sort.Sort(match.Matches(matches))
return matches
} | |
c171642 | return pos + 4, nil
default:
return 0, errUnexpectedValue
}
} | |
c171643 | '4', '5', '6', '7', '8', '9', '0':
pos++
default:
return pos, nil
}
if pos >= max {
return pos, nil
}
}
return pos, nil
} | |
c171644 | // data
pos, err = Any(in, pos)
if err != nil {
return 0, err
}
pos, err = skipSpace(in, pos)
if err != nil {
return 0, err
}
switch in[pos] {
case ',':
pos++
case ']':
return pos + 1, nil
}
}
} | |
c171645 | result = append(result, '[')
result = append(result, data...)
result = append(result, ']')
return result, nil
}
pos, err = skipSpace(in, pos)
if err != nil {
return nil, err
}
switch in[pos] {
case ',':
pos++
case ']':
return nil, errIndexOutOfBounds
}
idx++
}
} | |
c171646 | err != nil {
return 0, err
}
// data
pos, err = Any(in, pos)
if err != nil {
return 0, err
}
pos, err = skipSpace(in, pos)
if err != nil {
return 0, err
}
switch in[pos] {
case ',':
pos++
case '}':
return pos + 1, nil
}
}
} | |
c171647 |
if err != nil {
return nil, err
}
valueStart := pos
// data
pos, err = Any(in, pos)
if err != nil {
return nil, err
}
if match {
return in[valueStart:pos], nil
}
pos, err = skipSpace(in, pos)
if err != nil {
return nil, err
}
switch in[pos] {
case ',':
pos++
case '}':
return nil, errKeyNotFound
}
}
} | |
c171648 | err != nil {
return nil, err
}
if index == idx {
return in[itemStart:pos], nil
}
pos, err = skipSpace(in, pos)
if err != nil {
return nil, err
}
switch in[pos] {
case ',':
pos++
case ']':
return nil, errIndexOutOfBounds
}
idx++
}
} | |
c171649 | error) { return in, nil }
}
k := []byte(key)
return func(in []byte) ([]byte, error) {
return scanner.FindKey(in, 0, k)
}
} | |
c171650 | filter := range filters {
data, err = filter.Apply(data)
if err != nil {
return nil, err
}
}
return data, nil
}
} | |
c171651 | return scanner.FindIndex(in, 0, index)
}
} | |
c171652 | []byte) ([]byte, error) {
return scanner.FindRange(in, 0, from, to)
}
} | |
c171653 | }
case '"':
return pos + 1, nil
}
pos++
if pos >= max {
break
}
}
return 0, errors.New("unclosed string")
} | |
c171654 | return expect(in, pos, f...)
default:
return 0, errUnexpectedValue
}
} | |
c171655 | selector; %v", err.Error()))
}
return op
} | |
c171656 | }
if op, ok := parseArray(key); ok {
ops = append(ops, op)
continue
}
ops = append(ops, Dot(key))
}
return Chain(ops...), nil
} | |
c171657 | pos)
default:
max := len(in) - pos
if max > 20 {
max = 20
}
return 0, opErr{
pos: pos,
msg: "invalid object",
content: string(in[pos : pos+max]),
}
}
} | |
c171658 | ok := ctx.Value(requestContextKey).(events.APIGatewayProxyRequest)
return event, ok
} | |
c171659 | return strfmt.Duration(0)
}
return *v
} | |
c171660 | {
if v == nil {
return nil
}
return *v
} | |
c171661 | return strfmt.URI("")
}
return *v
} | |
c171662 | return strfmt.Email("")
}
return *v
} | |
c171663 | return strfmt.Hostname("")
}
return *v
} | |
c171664 | return strfmt.IPv4("")
}
return *v
} | |
c171665 | return strfmt.IPv6("")
}
return *v
} | |
c171666 | return strfmt.CIDR("")
}
return *v
} | |
c171667 | return strfmt.MAC("")
}
return *v
} | |
c171668 | return strfmt.UUID("")
}
return *v
} | |
c171669 | return strfmt.UUID3("")
}
return *v
} | |
c171670 | return strfmt.UUID4("")
}
return *v
} | |
c171671 | return strfmt.UUID5("")
}
return *v
} | |
c171672 | return strfmt.ISBN("")
}
return *v
} | |
c171673 | return strfmt.ISBN10("")
}
return *v
} | |
c171674 | return strfmt.ISBN13("")
}
return *v
} | |
c171675 | return strfmt.CreditCard("")
}
return *v
} | |
c171676 | return strfmt.SSN("")
}
return *v
} | |
c171677 | return strfmt.HexColor("")
}
return *v
} | |
c171678 | return strfmt.RGBColor("")
}
return *v
} | |
c171679 | return strfmt.Password("")
}
return *v
} | |
c171680 | jwriter.Writer
id.MarshalEasyJSON(&w)
return w.BuildBytes()
} | |
c171681 | *jwriter.Writer) {
w.String(bson.ObjectId(*id).Hex())
} | |
c171682 | {
l := jlexer.Lexer{Data: data}
id.UnmarshalEasyJSON(&l)
return l.Error()
} | |
c171683 | := in.String(); in.Ok() {
*id = NewObjectId(data)
}
} | |
c171684 | return nil
}
return errors.New("couldn't unmarshal bson raw value as ObjectId")
} | |
c171685 | out := new(ObjectId)
id.DeepCopyInto(out)
return out
} | |
c171686 | label, which is zero to 63 octets in length
parts := strings.Split(str, ".")
valid := true
for _, p := range parts {
if len(p) > 63 {
valid = false
}
}
return valid
} | |
c171687 | mail.ParseAddress(str)
return e == nil && addr.Address != ""
} | |
c171688 |
b.MarshalEasyJSON(&w)
return w.BuildBytes()
} | |
c171689 | w.String(base64.StdEncoding.EncodeToString([]byte(b)))
} | |
c171690 | data}
b.UnmarshalEasyJSON(&l)
return l.Error()
} | |
c171691 | n, err := enc.Decode(dbuf, []byte(data))
if err != nil {
in.AddError(err)
return
}
*b = dbuf[:n]
}
} | |
c171692 | return nil
}
return errors.New("couldn't unmarshal bson raw value as Base64")
} | |
c171693 | := new(Base64)
b.DeepCopyInto(out)
return out
} | |
c171694 | u.MarshalEasyJSON(&w)
return w.BuildBytes()
} | |
c171695 | *jwriter.Writer) {
w.String(string(u))
} | |
c171696 |
u.UnmarshalEasyJSON(&l)
return l.Error()
} | |
c171697 | new(URI)
u.DeepCopyInto(out)
return out
} | |
c171698 |
e.MarshalEasyJSON(&w)
return w.BuildBytes()
} | |
c171699 |
w.String(string(e))
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.