id
int32
0
25.3k
idx
stringlengths
5
9
nl_tokens
sequencelengths
1
418
pl_tokens
sequencelengths
22
4.98k
14,200
all-14201
[ "printAccount", "outputs", "account", "into", "into", "w", "using", "tabwriter", "." ]
[ "func", "printAccount", "(", "w", "io", ".", "<mask>", ",", "a", "*", "acme", ".", "Account", ",", "kp", "string", ")", "{", "tw", ":=", "tabwriter", ".", "NewWriter", "(", "w", ",", "0", ",", "8", ",", "0", ",", "'\\t'", ",", "0", ")", "\n", "fmt", ".", "Fprintln", "(", "tw", ",", "\"", "\\t", "\"", ",", "a", ".", "URI", ")", "\n", "fmt", ".", "Fprintln", "(", "tw", ",", "\"", "\\t", "\"", ",", "kp", ")", "\n", "fmt", ".", "Fprintln", "(", "tw", ",", "\"", "\\t", "\"", ",", "strings", ".", "Join", "(", "a", ".", "Contact", ",", "\"", "\"", ")", ")", "\n", "fmt", ".", "Fprintln", "(", "tw", ",", "\"", "\\t", "\"", ",", "a", ".", "CurrentTerms", ")", "\n", "agreed", ":=", "a", ".", "AgreedTerms", "\n", "if", "a", ".", "AgreedTerms", "==", "\"", "\"", "{", "agreed", "=", "\"", "\"", "\n", "}", "else", "if", "a", ".", "AgreedTerms", "==", "a", ".", "CurrentTerms", "{", "agreed", "=", "\"", "\"", "\n", "}", "\n", "fmt", ".", "Fprintln", "(", "tw", ",", "\"", "\\t", "\"", ",", "agreed", ")", "\n", "// TODO: print authorization and certificates", "tw", ".", "Flush", "(", ")", "\n", "}" ]
14,201
all-14202
[ "UnmarshalEasyJSON", "satisfies", "easyjson", ".", "Unmarshaler", "." ]
[ "func", "(", "t", "*", "Subtype", ")", "UnmarshalEasyJSON", "(", "in", "*", "jlexer", ".", "Lexer", ")", "{", "<mask>", "Subtype", "(", "in", ".", "String", "(", ")", ")", "{", "case", "SubtypeArray", ":", "*", "t", "=", "SubtypeArray", "\n", "case", "SubtypeNull", ":", "*", "t", "=", "SubtypeNull", "\n", "case", "SubtypeNode", ":", "*", "t", "=", "SubtypeNode", "\n", "case", "SubtypeRegexp", ":", "*", "t", "=", "SubtypeRegexp", "\n", "case", "SubtypeDate", ":", "*", "t", "=", "SubtypeDate", "\n", "case", "SubtypeMap", ":", "*", "t", "=", "SubtypeMap", "\n", "case", "SubtypeSet", ":", "*", "t", "=", "SubtypeSet", "\n", "case", "SubtypeWeakmap", ":", "*", "t", "=", "SubtypeWeakmap", "\n", "case", "SubtypeWeakset", ":", "*", "t", "=", "SubtypeWeakset", "\n", "case", "SubtypeIterator", ":", "*", "t", "=", "SubtypeIterator", "\n", "case", "SubtypeGenerator", ":", "*", "t", "=", "SubtypeGenerator", "\n", "case", "SubtypeError", ":", "*", "t", "=", "SubtypeError", "\n", "case", "SubtypeProxy", ":", "*", "t", "=", "SubtypeProxy", "\n", "case", "SubtypePromise", ":", "*", "t", "=", "SubtypePromise", "\n", "case", "SubtypeTypedarray", ":", "*", "t", "=", "SubtypeTypedarray", "\n", "case", "SubtypeArraybuffer", ":", "*", "t", "=", "SubtypeArraybuffer", "\n", "case", "SubtypeDataview", ":", "*", "t", "=", "SubtypeDataview", "\n\n", "default", ":", "in", ".", "AddError", "(", "errors", ".", "New", "(", "\"", "\"", ")", ")", "\n", "}", "\n", "}" ]
14,202
all-14203
[ "EnabledReposForPlugin", "returns", "the", "orgs", "and", "repos", "that", "have", "enabled", "the", "passed", "plugin", "." ]
[ "func", "(", "c", "*", "Configuration", ")", "EnabledReposForPlugin", "(", "plugin", "string", ")", "(", "orgs", ",", "repos", "[", "]", "string", ")", "{", "for", "repo", ",", "plugins", ":=", "range", "c", ".", "Plugins", "{", "found", ":=", "false", "\n", "for", "_", ",", "candidate", ":=", "range", "plugins", "{", "if", "candidate", "==", "plugin", "{", "<mask>", "=", "true", "\n", "break", "\n", "}", "\n", "}", "\n", "if", "found", "{", "if", "strings", ".", "Contains", "(", "repo", ",", "\"", "\"", ")", "{", "repos", "=", "append", "(", "repos", ",", "repo", ")", "\n", "}", "else", "{", "orgs", "=", "append", "(", "orgs", ",", "repo", ")", "\n", "}", "\n", "}", "\n", "}", "\n", "return", "\n", "}" ]
14,203
all-14204
[ "Specify", "the", "value", "of", "a", "uniform", "variable", "for", "a", "specified", "program", "object" ]
[ "func", "ProgramUniform1uiv", "(", "program", "uint32", ",", "location", "int32", ",", "count", "int32", ",", "value", "*", "uint32", ")", "{", "syscall", ".", "Syscall6", "(", "gpProgramUniform1uiv", ",", "4", ",", "uintptr", "(", "program", ")", ",", "uintptr", "(", "location", ")", ",", "uintptr", "(", "count", ")", ",", "uintptr", "(", "unsafe", ".", "Pointer", "(", "<mask>", ")", ")", ",", "0", ",", "0", ")", "\n", "}" ]
14,204
all-14205
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "ResetNavigationHistoryParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "<mask>", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoPage19", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
14,205
all-14206
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "Entry", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoLog4", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "<mask>", "(", ")", "\n", "}" ]
14,206
all-14207
[ "GetManifest", "returns", "the", "image", "s", "manifest", "along", "with", "its", "MIME", "type", "(", "which", "may", "be", "empty", "when", "it", "can", "t", "be", "determined", "but", "the", "manifest", "is", "available", ")", ".", "It", "may", "use", "a", "remote", "(", "=", "slow", ")", "service", ".", "If", "instanceDigest", "is", "not", "nil", "it", "contains", "a", "digest", "of", "the", "specific", "manifest", "instance", "to", "retrieve", "(", "when", "the", "primary", "manifest", "is", "a", "manifest", "list", ")", ";", "this", "never", "happens", "if", "the", "primary", "manifest", "is", "not", "a", "manifest", "list", "(", "e", ".", "g", ".", "if", "the", "source", "never", "returns", "manifest", "lists", ")", "." ]
[ "func", "(", "s", "*", "ociImageSource", ")", "GetManifest", "(", "ctx", "context", ".", "Context", ",", "instanceDigest", "*", "digest", ".", "Digest", ")", "(", "[", "]", "byte", ",", "string", ",", "error", ")", "{", "<mask>", "dig", "digest", ".", "Digest", "\n", "var", "mimeType", "string", "\n", "if", "instanceDigest", "==", "nil", "{", "dig", "=", "digest", ".", "Digest", "(", "s", ".", "descriptor", ".", "Digest", ")", "\n", "mimeType", "=", "s", ".", "descriptor", ".", "MediaType", "\n", "}", "else", "{", "dig", "=", "*", "instanceDigest", "\n", "// XXX: instanceDigest means that we don't immediately have the context of what", "// mediaType the manifest has. In OCI this means that we don't know", "// what reference it came from, so we just *assume* that its", "// MediaTypeImageManifest.", "// FIXME: We should actually be able to look up the manifest in the index,", "// and see the MIME type there.", "mimeType", "=", "imgspecv1", ".", "MediaTypeImageManifest", "\n", "}", "\n\n", "manifestPath", ",", "err", ":=", "s", ".", "ref", ".", "blobPath", "(", "dig", ",", "s", ".", "sharedBlobDir", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "\"", "\"", ",", "err", "\n", "}", "\n", "m", ",", "err", ":=", "ioutil", ".", "ReadFile", "(", "manifestPath", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "\"", "\"", ",", "err", "\n", "}", "\n\n", "return", "m", ",", "mimeType", ",", "nil", "\n", "}" ]
14,207
all-14208
[ "Create", "a", "new", "OutgoingCallerID", ".", "Note", "the", "ValidationCode", "is", "only", "returned", "in", "response", "to", "a", "Create", "you", "can", "t", "retrieve", "it", "later", ".", "https", ":", "//", "www", ".", "twilio", ".", "com", "/", "docs", "/", "api", "/", "rest", "/", "outgoing", "-", "caller", "-", "ids#list", "-", "post" ]
[ "func", "(", "c", "*", "OutgoingCallerIDService", ")", "Create", "(", "ctx", "context", ".", "Context", ",", "data", "<mask>", ".", "Values", ")", "(", "*", "CallerIDRequest", ",", "error", ")", "{", "id", ":=", "new", "(", "CallerIDRequest", ")", "\n", "err", ":=", "c", ".", "client", ".", "CreateResource", "(", "ctx", ",", "callerIDPathPart", ",", "data", ",", "id", ")", "\n", "return", "id", ",", "err", "\n", "}" ]
14,208
all-14209
[ "DeleteContainerFile", "deletes", "a", "file", "in", "the", "container" ]
[ "func", "(", "r", "*", "ProtocolLXD", ")", "DeleteContainerFile", "(", "containerName", "string", ",", "path", "string", ")", "error", "{", "if", "!", "r", ".", "HasExtension", "(", "\"", "\"", ")", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\\\"", "\\\"", "\"", ")", "\n", "}", "\n\n", "// Send the request", "_", ",", "_", ",", "err", ":=", "r", ".", "<mask>", "(", "\"", "\"", ",", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "url", ".", "QueryEscape", "(", "containerName", ")", ",", "url", ".", "QueryEscape", "(", "path", ")", ")", ",", "nil", ",", "\"", "\"", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
14,209
all-14210
[ "UnmarshalEasyJSON", "sets", "the", "ISBN10", "from", "a", "easyjson", ".", "Lexer" ]
[ "func", "(", "u", "*", "ISBN10", ")", "UnmarshalEasyJSON", "(", "in", "*", "jlexer", ".", "Lexer", ")", "{", "if", "data", ":=", "in", ".", "<mask>", "(", ")", ";", "in", ".", "Ok", "(", ")", "{", "*", "u", "=", "ISBN10", "(", "data", ")", "\n", "}", "\n", "}" ]
14,210
all-14211
[ "Copy", "returns", "a", "deep", "copy", "of", "this", "configuration", "." ]
[ "func", "(", "c", "*", "AuthConfig", ")", "Copy", "(", ")", "*", "AuthConfig", "{", "if", "c", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "<mask>", "o", "AuthConfig", "\n", "o", ".", "Enabled", "=", "c", ".", "Enabled", "\n", "o", ".", "Username", "=", "c", ".", "Username", "\n", "o", ".", "Password", "=", "c", ".", "Password", "\n", "return", "&", "o", "\n", "}" ]
14,211
all-14212
[ "GetKeyOk", "returns", "a", "tuple", "with", "the", "Key", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "a", "*", "APIKey", ")", "GetKeyOk", "(", ")", "(", "string", ",", "bool", ")", "{", "if", "a", "==", "nil", "||", "a", ".", "Key", "==", "nil", "{", "return", "\"", "\"", ",", "<mask>", "\n", "}", "\n", "return", "*", "a", ".", "Key", ",", "true", "\n", "}" ]
14,212
all-14213
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "StopTypeProfileParams", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "<mask>", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoProfiler6", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "Error", "(", ")", "\n", "}" ]
14,213
all-14214
[ "Append", "is", "a", "wrapper", "around", "gtk_tree_store_append", "()", "." ]
[ "func", "(", "v", "*", "TreeStore", ")", "Append", "(", "parent", "*", "TreeIter", ")", "*", "TreeIter", "{", "var", "ti", "C", ".", "GtkTreeIter", "\n", "var", "cParent", "*", "C", ".", "GtkTreeIter", "\n", "if", "<mask>", "!=", "nil", "{", "cParent", "=", "parent", ".", "native", "(", ")", "\n", "}", "\n", "C", ".", "gtk_tree_store_append", "(", "v", ".", "native", "(", ")", ",", "&", "ti", ",", "cParent", ")", "\n", "iter", ":=", "&", "TreeIter", "{", "ti", "}", "\n", "return", "iter", "\n", "}" ]
14,214
all-14215
[ "specify", "a", "three", "-", "dimensional", "texture", "subimage" ]
[ "func", "TexSubImage3D", "(", "target", "uint32", ",", "level", "int32", ",", "xoffset", "int32", ",", "yoffset", "int32", ",", "zoffset", "int32", ",", "width", "int32", ",", "height", "int32", ",", "depth", "int32", ",", "format", "uint32", ",", "xtype", "uint32", ",", "pixels", "unsafe", ".", "Pointer", ")", "{", "syscall", ".", "Syscall12", "(", "gpTexSubImage3D", ",", "11", ",", "uintptr", "(", "target", ")", ",", "uintptr", "(", "level", ")", ",", "uintptr", "(", "xoffset", ")", ",", "uintptr", "(", "yoffset", ")", ",", "uintptr", "(", "zoffset", ")", ",", "uintptr", "(", "width", ")", ",", "uintptr", "(", "height", ")", ",", "uintptr", "(", "<mask>", ")", ",", "uintptr", "(", "format", ")", ",", "uintptr", "(", "xtype", ")", ",", "uintptr", "(", "pixels", ")", ",", "0", ")", "\n", "}" ]
14,215
all-14216
[ "BoolStringPtrState", "is", "a", "state", "normalization", "function", "for", "stringified", "3", "-", "state", "bool", "pointers", ".", "The", "function", "silently", "drops", "any", "result", "that", "can", "t", "be", "parsed", "with", "ParseBool", "and", "will", "return", "an", "empty", "string", "for", "these", "cases", ".", "This", "is", "designed", "to", "address", "the", "current", "lack", "of", "HCL", "and", "Terraform", "to", "be", "able", "to", "distinguish", "between", "nil", "states", "and", "zero", "values", "properly", ".", "This", "is", "a", "systemic", "issue", "that", "affects", "reading", "writing", "and", "diffing", "of", "these", "values", ".", "These", "issues", "will", "eventually", "be", "addressed", "in", "HCL2", "." ]
[ "func", "BoolStringPtrState", "(", "v", "<mask>", "{", "}", ")", "string", "{", "b", ",", "err", ":=", "strconv", ".", "ParseBool", "(", "v", ".", "(", "string", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "strconv", ".", "FormatBool", "(", "b", ")", "\n", "}" ]
14,216
all-14217
[ "GetResource", "retrieves", "an", "instance", "resource", "with", "the", "given", "path", "part", "(", "e", ".", "g", ".", "/", "Messages", ")", "and", "sid", "(", "e", ".", "g", ".", "MM123", ")", "." ]
[ "func", "(", "c", "*", "Client", ")", "GetResource", "(", "ctx", "context", ".", "Context", ",", "pathPart", "string", ",", "sid", "string", ",", "v", "<mask>", "{", "}", ")", "error", "{", "sidPart", ":=", "strings", ".", "Join", "(", "[", "]", "string", "{", "pathPart", ",", "sid", "}", ",", "\"", "\"", ")", "\n", "return", "c", ".", "MakeRequest", "(", "ctx", ",", "\"", "\"", ",", "sidPart", ",", "nil", ",", "v", ")", "\n", "}" ]
14,217
all-14218
[ "WithApp", "adds", "the", "app", "to", "the", "delete", "apps", "app", "routes", "route", "params" ]
[ "func", "(", "o", "*", "DeleteAppsAppRoutesRouteParams", ")", "WithApp", "(", "app", "string", ")", "*", "DeleteAppsAppRoutesRouteParams", "{", "o", ".", "SetApp", "(", "app", ")", "\n", "<mask>", "o", "\n", "}" ]
14,218
all-14219
[ "lexNumberOrDuration", "scans", "a", "number", "or", "a", "duration", "item", "." ]
[ "func", "lexNumberOrDuration", "(", "l", "*", "lexer", ")", "stateFn", "{", "if", "l", ".", "scanNumber", "(", ")", "{", "l", ".", "emit", "(", "ItemNumber", ")", "\n", "return", "lexStatements", "\n", "}", "\n", "// Next two chars must be a valid unit and a non-alphanumeric.", "if", "l", ".", "accept", "(", "\"", "\"", ")", "{", "if", "isAlphaNumeric", "(", "l", ".", "next", "(", ")", ")", "{", "return", "l", ".", "errorf", "(", "\"", "\"", ",", "l", ".", "input", "[", "l", ".", "<mask>", ":", "l", ".", "pos", "]", ")", "\n", "}", "\n", "l", ".", "backup", "(", ")", "\n", "l", ".", "emit", "(", "ItemDuration", ")", "\n", "return", "lexStatements", "\n", "}", "\n", "return", "l", ".", "errorf", "(", "\"", "\"", ",", "l", ".", "input", "[", "l", ".", "start", ":", "l", ".", "pos", "]", ")", "\n", "}" ]
14,219
all-14220
[ "Return", "true", "if", "the", "indicies", "at", "w", ".", "RS", "[", ":", "i", "]", "end", "in", "a", "short", "syllable", ".", "Define", "a", "short", "syllable", "in", "a", "word", "as", "either", "(", "a", ")", "a", "vowel", "followed", "by", "a", "non", "-", "vowel", "other", "than", "w", "x", "or", "Y", "and", "preceded", "by", "a", "non", "-", "vowel", "or", "(", "b", ")", "a", "vowel", "at", "the", "beginning", "of", "the", "word", "followed", "by", "a", "non", "-", "vowel", "." ]
[ "func", "endsShortSyllable", "(", "w", "*", "snowballword", ".", "SnowballWord", ",", "i", "int", ")", "bool", "{", "if", "i", "==", "2", "{", "// Check for a vowel at the beginning of the word followed by a non-vowel.", "if", "isLowerVowel", "(", "w", ".", "RS", "[", "0", "]", ")", "&&", "!", "isLowerVowel", "(", "w", ".", "RS", "[", "1", "]", ")", "{", "return", "true", "\n", "}", "else", "{", "return", "false", "\n", "}", "\n\n", "}", "else", "if", "i", ">=", "3", "{", "// The runes 1, 2, & 3 positions to the left of `i`.", "s1", ":=", "w", ".", "RS", "[", "i", "-", "1", "]", "\n", "s2", ":=", "w", ".", "RS", "[", "i", "-", "2", "]", "\n", "s3", ":=", "w", ".", "RS", "[", "i", "-", "3", "]", "\n\n", "// Check for a vowel followed by a non-vowel other than w, x or Y", "// and preceded by a non-vowel.", "// (Note: w, x, Y rune codepoints = 119, 120, 89)", "//", "if", "!", "isLowerVowel", "(", "s1", ")", "&&", "s1", "!=", "119", "&&", "s1", "!=", "120", "&&", "s1", "!=", "89", "&&", "isLowerVowel", "(", "s2", ")", "&&", "!", "isLowerVowel", "(", "s3", ")", "{", "return", "true", "\n", "}", "else", "{", "return", "false", "\n", "}", "\n\n", "}", "\n", "return", "<mask>", "\n", "}" ]
14,220
all-14221
[ "void", "pango_layout_set_height", "(", "PangoLayout", "*", "layout", "int", "height", ")", ";" ]
[ "func", "(", "v", "*", "Layout", ")", "SetHeight", "(", "<mask>", "int", ")", "{", "C", ".", "pango_layout_set_height", "(", "v", ".", "native", "(", ")", ",", "C", ".", "int", "(", "width", ")", ")", "\n", "}" ]
14,221
all-14222
[ "gocoreName", "generates", "the", "name", "this", "package", "uses", "to", "refer", "to", "a", "dwarf", "type", ".", "This", "name", "differs", "from", "the", "dwarf", "name", "in", "that", "it", "stays", "closer", "to", "the", "Go", "name", "for", "the", "type", ".", "For", "instance", "(", "dwarf", "name", "-", ">", "gocoreName", ")", "struct", "runtime", ".", "siginfo", "-", ">", "runtime", ".", "siginfo", "*", "void", "-", ">", "unsafe", ".", "Pointer", "struct", "struct", "{", "runtime", ".", "signalLock", "uint32", ";", "runtime", ".", "hz", "int32", "}", "-", ">", "struct", "{", "signalLock", "uint32", ";", "hz", "int32", "}" ]
[ "func", "gocoreName", "(", "dt", "dwarf", ".", "Type", ")", "string", "{", "switch", "x", ":=", "dt", ".", "(", "type", ")", "{", "<mask>", "*", "dwarf", ".", "PtrType", ":", "if", "_", ",", "ok", ":=", "x", ".", "Type", ".", "(", "*", "dwarf", ".", "VoidType", ")", ";", "ok", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "\"", "\"", "+", "gocoreName", "(", "x", ".", "Type", ")", "\n", "case", "*", "dwarf", ".", "ArrayType", ":", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "x", ".", "Count", ",", "gocoreName", "(", "x", ".", "Type", ")", ")", "\n", "case", "*", "dwarf", ".", "StructType", ":", "if", "!", "strings", ".", "HasPrefix", "(", "x", ".", "StructName", ",", "\"", "\"", ")", "{", "// This is a named type, return that name.", "return", "x", ".", "StructName", "\n", "}", "\n", "// Build gocore name from the DWARF fields.", "s", ":=", "\"", "\"", "\n", "first", ":=", "true", "\n", "for", "_", ",", "f", ":=", "range", "x", ".", "Field", "{", "if", "!", "first", "{", "s", "+=", "\"", "\"", "\n", "}", "\n", "name", ":=", "f", ".", "Name", "\n", "if", "i", ":=", "strings", ".", "Index", "(", "name", ",", "\"", "\"", ")", ";", "i", ">=", "0", "{", "// Remove pkg path from field names.", "name", "=", "name", "[", "i", "+", "1", ":", "]", "\n", "}", "\n", "s", "+=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "name", ",", "gocoreName", "(", "f", ".", "Type", ")", ")", "\n", "first", "=", "false", "\n", "}", "\n", "s", "+=", "\"", "\"", "\n", "return", "s", "\n", "default", ":", "return", "dt", ".", "String", "(", ")", "\n", "}", "\n", "}" ]
14,222
all-14223
[ "GetVisibleChildName", "is", "a", "wrapper", "around", "gtk_stack_get_visible_child_name", "()", "." ]
[ "func", "(", "v", "*", "Stack", ")", "GetVisibleChildName", "(", ")", "string", "{", "c", ":=", "C", ".", "gtk_stack_get_visible_child_name", "(", "v", ".", "native", "(", ")", ")", "\n", "return", "C", ".", "GoString", "(", "(", "*", "C", ".", "<mask>", ")", "(", "c", ")", ")", "\n", "}" ]
14,223
all-14224
[ "Specify", "the", "value", "of", "a", "uniform", "variable", "for", "a", "specified", "program", "object" ]
[ "func", "ProgramUniform2f", "(", "<mask>", "uint32", ",", "location", "int32", ",", "v0", "float32", ",", "v1", "float32", ")", "{", "C", ".", "glowProgramUniform2f", "(", "gpProgramUniform2f", ",", "(", "C", ".", "GLuint", ")", "(", "program", ")", ",", "(", "C", ".", "GLint", ")", "(", "location", ")", ",", "(", "C", ".", "GLfloat", ")", "(", "v0", ")", ",", "(", "C", ".", "GLfloat", ")", "(", "v1", ")", ")", "\n", "}" ]
14,224
all-14225
[ "ForEach", "iterates", "over", "all", "key", "values", "of", "a", "folder", "." ]
[ "func", "(", "tx", "Tx", ")", "ForEach", "(", "folders", "[", "]", "[", "]", "byte", ",", "f", "func", "(", "Bucket", ",", "bytesp", ".", "Slice", ",", "bytesp", ".", "Slice", ")", "error", ")", "error", "{", "return", "tx", ".", "Bucket", "(", "folders", ",", "func", "(", "b", "Bucket", ")", "error", "{", "return", "errorsp", ".", "WithStacks", "(", "b", ".", "Bucket", ".", "ForEach", "(", "func", "(", "k", ",", "v", "[", "]", "<mask>", ")", "error", "{", "return", "errorsp", ".", "WithStacks", "(", "f", "(", "b", ",", "bytesp", ".", "Slice", "(", "k", ")", ",", "bytesp", ".", "Slice", "(", "v", ")", ")", ")", "\n", "}", ")", ")", "\n", "}", ")", "\n", "}" ]
14,225
all-14226
[ "NewTaskEngine", "returns", "a", "default", "TaskEngine" ]
[ "func", "NewTaskEngine", "(", "cfg", "*", "config", ".", "Config", ",", "client", "dockerapi", ".", "DockerClient", ",", "credentialsManager", "credentials", ".", "Manager", ",", "containerChangeEventStream", "*", "eventstream", ".", "EventStream", ",", "imageManager", "ImageManager", ",", "state", "dockerstate", ".", "TaskEngineState", ",", "metadataManager", "containermetadata", ".", "<mask>", ",", "resourceFields", "*", "taskresource", ".", "ResourceFields", ")", "TaskEngine", "{", "taskEngine", ":=", "NewDockerTaskEngine", "(", "cfg", ",", "client", ",", "credentialsManager", ",", "containerChangeEventStream", ",", "imageManager", ",", "state", ",", "metadataManager", ",", "resourceFields", ")", "\n\n", "return", "taskEngine", "\n", "}" ]
14,226
all-14227
[ "WithHTTPClient", "adds", "the", "HTTPClient", "to", "the", "post", "apps", "app", "routes", "params" ]
[ "func", "(", "o", "*", "PostAppsAppRoutesParams", ")", "WithHTTPClient", "(", "<mask>", "*", "http", ".", "Client", ")", "*", "PostAppsAppRoutesParams", "{", "o", ".", "SetHTTPClient", "(", "client", ")", "\n", "return", "o", "\n", "}" ]
14,227
all-14228
[ "ListServicesByNamespaceID", "returns", "list", "of", "services", "in", "given", "namespace", ".", "Returns", "map", "[", "srv_name", "]", "*", "sd", ".", "Service" ]
[ "func", "(", "p", "*", "AWSSDProvider", ")", "ListServicesByNamespaceID", "(", "namespaceID", "*", "string", ")", "(", "map", "[", "string", "]", "*", "sd", ".", "Service", ",", "error", ")", "{", "serviceIds", ":=", "make", "(", "[", "]", "*", "string", ",", "0", ")", "\n\n", "f", ":=", "func", "(", "resp", "*", "sd", ".", "ListServicesOutput", ",", "lastPage", "bool", ")", "bool", "{", "for", "_", ",", "srv", ":=", "range", "resp", ".", "Services", "{", "serviceIds", "=", "append", "(", "serviceIds", ",", "srv", ".", "Id", ")", "\n", "}", "\n\n", "return", "true", "\n", "}", "\n\n", "err", ":=", "p", ".", "client", ".", "ListServicesPages", "(", "&", "sd", ".", "ListServicesInput", "{", "Filters", ":", "[", "]", "*", "sd", ".", "ServiceFilter", "{", "{", "Name", ":", "aws", ".", "String", "(", "sd", ".", "ServiceFilterNameNamespaceId", ")", ",", "Values", ":", "[", "]", "*", "string", "{", "namespaceID", "}", ",", "}", "}", ",", "}", ",", "f", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// get detail of each listed service", "services", ":=", "make", "(", "map", "[", "string", "]", "*", "sd", ".", "<mask>", ")", "\n", "for", "_", ",", "serviceID", ":=", "range", "serviceIds", "{", "service", ",", "err", ":=", "p", ".", "GetServiceDetail", "(", "serviceID", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "services", "[", "aws", ".", "StringValue", "(", "service", ".", "Name", ")", "]", "=", "service", "\n", "}", "\n\n", "return", "services", ",", "nil", "\n", "}" ]
14,228
all-14229
[ "LoadManifestDescriptor", "loads", "the", "manifest", "descriptor", "to", "be", "used", "to", "retrieve", "the", "image", "name", "when", "pulling", "an", "image" ]
[ "func", "LoadManifestDescriptor", "(", "imgRef", "<mask>", ".", "ImageReference", ")", "(", "imgspecv1", ".", "Descriptor", ",", "error", ")", "{", "ociRef", ",", "ok", ":=", "imgRef", ".", "(", "ociReference", ")", "\n", "if", "!", "ok", "{", "return", "imgspecv1", ".", "Descriptor", "{", "}", ",", "errors", ".", "Errorf", "(", "\"", "\"", ")", "\n", "}", "\n", "return", "ociRef", ".", "getManifestDescriptor", "(", ")", "\n", "}" ]
14,229
all-14230
[ "Publish", "an", "event", "." ]
[ "func", "(", "b", "*", "Bus", ")", "Publish", "(", "eventName", "string", ",", "eventBody", "<mask>", "{", "}", ")", "{", "e", ":=", "NewEvent", "(", "eventName", ",", "eventBody", ")", "\n\n", "b", ".", "mu", ".", "RLock", "(", ")", "\n", "defer", "b", ".", "mu", ".", "RUnlock", "(", ")", "\n", "for", "_", ",", "h", ":=", "range", "b", ".", "handlers", "{", "h", ".", "Handle", "(", "e", ")", "\n", "}", "\n", "}" ]
14,230
all-14231
[ "ReceiveComment", "creates", "a", "fake", "commented", "event" ]
[ "func", "(", "o", "*", "FakeCommentPluginWrapper", ")", "ReceiveComment", "(", "comment", "sql", ".", "Comment", ")", "[", "]", "Point", "{", "// Create a fake \"commented\" event for every comment we receive.", "fakeEvent", ":=", "sql", ".", "IssueEvent", "{", "IssueID", ":", "comment", ".", "IssueID", ",", "Event", ":", "\"", "\"", ",", "EventCreatedAt", ":", "comment", ".", "CommentCreatedAt", ",", "Actor", ":", "&", "<mask>", ".", "User", ",", "}", "\n\n", "return", "append", "(", "o", ".", "plugin", ".", "ReceiveComment", "(", "comment", ")", ",", "o", ".", "plugin", ".", "ReceiveIssueEvent", "(", "fakeEvent", ")", "...", ",", ")", "\n", "}" ]
14,231
all-14232
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "SetUserAgentOverrideParams", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoEmulation2", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "<mask>", "(", ")", "\n", "}" ]
14,232
all-14233
[ "SetRecording", "set", "the", "recording", "state", "for", "the", "service", ".", "See", ":", "https", ":", "//", "chromedevtools", ".", "github", ".", "io", "/", "devtools", "-", "protocol", "/", "tot", "/", "BackgroundService#method", "-", "setRecording", "parameters", ":", "shouldRecord", "service" ]
[ "func", "SetRecording", "(", "shouldRecord", "bool", ",", "service", "ServiceName", ")", "*", "SetRecordingParams", "{", "return", "&", "SetRecordingParams", "{", "ShouldRecord", ":", "shouldRecord", ",", "<mask>", ":", "service", ",", "}", "\n", "}" ]
14,233
all-14234
[ "updates", "a", "subset", "of", "a", "buffer", "object", "s", "data", "store" ]
[ "func", "BufferSubData", "(", "target", "uint32", ",", "offset", "int", ",", "<mask>", "int", ",", "data", "unsafe", ".", "Pointer", ")", "{", "C", ".", "glowBufferSubData", "(", "gpBufferSubData", ",", "(", "C", ".", "GLenum", ")", "(", "target", ")", ",", "(", "C", ".", "GLintptr", ")", "(", "offset", ")", ",", "(", "C", ".", "GLsizeiptr", ")", "(", "size", ")", ",", "data", ")", "\n", "}" ]
14,234
all-14235
[ "List", "tasks", "sharing", "the", "same", "taskGroupId", ".", "As", "a", "task", "-", "group", "may", "contain", "an", "unbounded", "number", "of", "tasks", "this", "end", "-", "point", "may", "return", "a", "continuationToken", ".", "To", "continue", "listing", "tasks", "you", "must", "call", "the", "listTaskGroup", "again", "with", "the", "continuationToken", "as", "the", "query", "-", "string", "option", "continuationToken", ".", "By", "default", "this", "end", "-", "point", "will", "try", "to", "return", "up", "to", "1000", "members", "in", "one", "request", ".", "But", "it", "**", "may", "return", "less", "**", "even", "if", "more", "tasks", "are", "available", ".", "It", "may", "also", "return", "a", "continuationToken", "even", "though", "there", "are", "no", "more", "results", ".", "However", "you", "can", "only", "be", "sure", "to", "have", "seen", "all", "results", "if", "you", "keep", "calling", "listTaskGroup", "with", "the", "last", "continuationToken", "until", "you", "get", "a", "result", "without", "a", "continuationToken", ".", "If", "you", "are", "not", "interested", "in", "listing", "all", "the", "members", "at", "once", "you", "may", "use", "the", "query", "-", "string", "option", "limit", "to", "return", "fewer", ".", "See", "#listTaskGroup" ]
[ "func", "(", "queue", "*", "Queue", ")", "ListTaskGroup", "(", "taskGroupId", ",", "continuationToken", ",", "limit", "string", ")", "(", "*", "ListTaskGroupResponse", ",", "error", ")", "{", "v", ":=", "url", ".", "Values", "{", "}", "\n", "if", "continuationToken", "!=", "\"", "\"", "{", "v", ".", "Add", "(", "\"", "\"", ",", "continuationToken", ")", "\n", "}", "\n", "if", "limit", "!=", "\"", "\"", "{", "v", ".", "Add", "(", "\"", "\"", ",", "limit", ")", "\n", "}", "\n", "cd", ":=", "tcclient", ".", "Client", "(", "*", "queue", ")", "\n", "responseObject", ",", "_", ",", "err", ":=", "(", "&", "<mask>", ")", ".", "APICall", "(", "nil", ",", "\"", "\"", ",", "\"", "\"", "+", "url", ".", "QueryEscape", "(", "taskGroupId", ")", "+", "\"", "\"", ",", "new", "(", "ListTaskGroupResponse", ")", ",", "v", ")", "\n", "return", "responseObject", ".", "(", "*", "ListTaskGroupResponse", ")", ",", "err", "\n", "}" ]
14,235
all-14236
[ "HasClass", "is", "a", "wrapper", "around", "gtk_style_context_has_class", "()", "." ]
[ "func", "(", "v", "*", "StyleContext", ")", "HasClass", "(", "className", "string", ")", "bool", "{", "cstr", ":=", "C", ".", "CString", "(", "className", ")", "\n", "defer", "C", ".", "<mask>", "(", "unsafe", ".", "Pointer", "(", "cstr", ")", ")", "\n\n", "return", "gobool", "(", "C", ".", "gtk_style_context_has_class", "(", "v", ".", "native", "(", ")", ",", "(", "*", "C", ".", "gchar", ")", "(", "cstr", ")", ")", ")", "\n", "}" ]
14,236
all-14237
[ "GetLimitOk", "returns", "a", "tuple", "with", "the", "Limit", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "t", "*", "TileDefRequest", ")", "GetLimitOk", "(", ")", "(", "int", ",", "bool", ")", "{", "if", "t", "==", "nil", "||", "t", ".", "Limit", "==", "nil", "{", "return", "0", ",", "<mask>", "\n", "}", "\n", "return", "*", "t", ".", "Limit", ",", "true", "\n", "}" ]
14,237
all-14238
[ "MarshalJSON", "marshals", "this", "TagValue", "into", "JSON", "that", "only", "contains", "runes", "allowed", "in", "OpenTSDB", ".", "It", "implements", "json", ".", "Marshaler", ".", "The", "runes", "allowed", "in", "OpenTSDB", "are", "all", "single", "-", "byte", ".", "This", "function", "encodes", "the", "arbitrary", "byte", "sequence", "found", "in", "this", "TagValue", "in", "the", "following", "way", ":", "-", "The", "string", "that", "underlies", "TagValue", "is", "scanned", "byte", "by", "byte", ".", "-", "If", "a", "byte", "represents", "a", "legal", "OpenTSDB", "rune", "with", "the", "exception", "of", "_", "that", "byte", "is", "directly", "copied", "to", "the", "resulting", "JSON", "byte", "slice", ".", "-", "If", "_", "is", "encountered", "it", "is", "replaced", "by", "__", ".", "-", "If", ":", "is", "encountered", "it", "is", "replaced", "by", "_", ".", ".", "-", "All", "other", "bytes", "are", "replaced", "by", "_", "followed", "by", "two", "bytes", "containing", "the", "uppercase", "ASCII", "representation", "of", "their", "hexadecimal", "value", ".", "This", "encoding", "allows", "to", "save", "arbitrary", "Go", "strings", "in", "OpenTSDB", ".", "That", "s", "required", "because", "Prometheus", "label", "values", "can", "contain", "anything", "and", "even", "Prometheus", "metric", "names", "may", "(", "and", "often", "do", ")", "contain", ":", "(", "which", "is", "disallowed", "in", "OpenTSDB", "strings", ")", ".", "The", "encoding", "uses", "_", "as", "an", "escape", "character", "and", "renders", "a", ":", "more", "or", "less", "recognizable", "as", "_", ".", "Examples", ":", "foo", "-", "bar", "-", "42", "-", ">", "foo", "-", "bar", "-", "42", "foo_bar_42", "-", ">", "foo__bar__42", "http", ":", "//", "example", ".", "org", ":", "8080", "-", ">", "http_", ".", "//", "example", ".", "org_", ".", "8080", "Björn", "s", "email", ":", "bjoern" ]
[ "func", "(", "tv", "TagValue", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "length", ":=", "len", "(", "tv", ")", "\n", "// Need at least two more bytes than in tv.", "result", ":=", "<mask>", ".", "NewBuffer", "(", "make", "(", "[", "]", "byte", ",", "0", ",", "length", "+", "2", ")", ")", "\n", "result", ".", "WriteByte", "(", "'\"'", ")", "\n", "for", "i", ":=", "0", ";", "i", "<", "length", ";", "i", "++", "{", "b", ":=", "tv", "[", "i", "]", "\n", "switch", "{", "case", "(", "b", ">=", "'-'", "&&", "b", "<=", "'9'", ")", "||", "// '-', '.', '/', 0-9", "(", "b", ">=", "'A'", "&&", "b", "<=", "'Z'", ")", "||", "(", "b", ">=", "'a'", "&&", "b", "<=", "'z'", ")", ":", "result", ".", "WriteByte", "(", "b", ")", "\n", "case", "b", "==", "'_'", ":", "result", ".", "WriteString", "(", "\"", "\"", ")", "\n", "case", "b", "==", "':'", ":", "result", ".", "WriteString", "(", "\"", "\"", ")", "\n", "default", ":", "result", ".", "WriteString", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "b", ")", ")", "\n", "}", "\n", "}", "\n", "result", ".", "WriteByte", "(", "'\"'", ")", "\n", "return", "result", ".", "Bytes", "(", ")", ",", "nil", "\n", "}" ]
14,238
all-14239
[ "FindSet", "returns", "the", "DisjointSet", "with", "the", "represent", "name", "." ]
[ "func", "FindSet", "(", "forests", "*", "Forests", ",", "name", "string", ")", "*", "DisjointSet", "{", "forests", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "forests", ".", "mu", ".", "Unlock", "(", ")", "\n", "for", "data", ":=", "range", "forests", ".", "data", "{", "if", "data", ".", "represent", "==", "name", "{", "return", "data", "\n", "}", "\n", "for", "k", ":=", "range", "data", ".", "<mask>", "{", "if", "k", "==", "name", "{", "return", "data", "\n", "}", "\n", "}", "\n", "}", "\n", "return", "nil", "\n", "}" ]
14,239
all-14240
[ "WithPrefix", "sets", "the", "comparison", "to", "scan", "all", "keys", "prefixed", "by", "the", "key", "." ]
[ "func", "(", "cmp", "Cmp", ")", "WithPrefix", "(", ")", "Cmp", "{", "cmp", ".", "RangeEnd", "=", "getPrefix", "(", "cmp", ".", "<mask>", ")", "\n", "return", "cmp", "\n", "}" ]
14,240
all-14241
[ "New", "provides", "a", "pointer", "to", "an", "instance", "of", "Spinner", "with", "the", "supplied", "options" ]
[ "func", "New", "(", "cs", "[", "]", "string", ",", "d", "<mask>", ".", "Duration", ",", "options", "...", "Option", ")", "*", "Spinner", "{", "s", ":=", "&", "Spinner", "{", "Delay", ":", "d", ",", "chars", ":", "cs", ",", "color", ":", "color", ".", "New", "(", "color", ".", "FgWhite", ")", ".", "SprintFunc", "(", ")", ",", "lock", ":", "&", "sync", ".", "RWMutex", "{", "}", ",", "Writer", ":", "color", ".", "Output", ",", "active", ":", "false", ",", "stopChan", ":", "make", "(", "chan", "struct", "{", "}", ",", "1", ")", ",", "}", "\n\n", "for", "_", ",", "option", ":=", "range", "options", "{", "option", "(", "s", ")", "\n", "}", "\n", "return", "s", "\n", "}" ]
14,241
all-14242
[ "SearchInResource", "searches", "for", "given", "string", "in", "resource", "content", ".", "See", ":", "https", ":", "//", "chromedevtools", ".", "github", ".", "io", "/", "devtools", "-", "protocol", "/", "tot", "/", "Page#method", "-", "searchInResource", "parameters", ":", "frameID", "-", "Frame", "id", "for", "resource", "to", "search", "in", ".", "url", "-", "URL", "of", "the", "resource", "to", "search", "in", ".", "query", "-", "String", "to", "search", "for", "." ]
[ "func", "SearchInResource", "(", "frameID", "cdp", ".", "FrameID", ",", "url", "string", ",", "query", "string", ")", "*", "SearchInResourceParams", "{", "return", "&", "SearchInResourceParams", "{", "FrameID", ":", "frameID", ",", "URL", ":", "<mask>", ",", "Query", ":", "query", ",", "}", "\n", "}" ]
14,242
all-14243
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "ForcePseudoStateParams", ")", "UnmarshalJSON", "(", "<mask>", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoCss49", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "Error", "(", ")", "\n", "}" ]
14,243
all-14244
[ "TaskStatsHandler", "returns", "the", "handler", "method", "for", "handling", "task", "stats", "requests", "." ]
[ "func", "TaskStatsHandler", "(", "state", "dockerstate", ".", "TaskEngineState", ",", "statsEngine", "stats", ".", "<mask>", ")", "func", "(", "http", ".", "ResponseWriter", ",", "*", "http", ".", "Request", ")", "{", "return", "func", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ")", "{", "taskARN", ",", "err", ":=", "getTaskARNByRequest", "(", "r", ",", "state", ")", "\n", "if", "err", "!=", "nil", "{", "errResponseJSON", ",", "_", ":=", "json", ".", "Marshal", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "err", ".", "Error", "(", ")", ")", ")", "\n", "utils", ".", "WriteJSONToResponse", "(", "w", ",", "http", ".", "StatusBadRequest", ",", "errResponseJSON", ",", "utils", ".", "RequestTypeTaskStats", ")", "\n", "return", "\n", "}", "\n\n", "seelog", ".", "Infof", "(", "\"", "\"", ",", "taskARN", ")", "\n\n", "// v3 handler shares the same task stats response format with v2 handler.", "v2", ".", "WriteTaskStatsResponse", "(", "w", ",", "taskARN", ",", "state", ",", "statsEngine", ")", "\n", "}", "\n", "}" ]
14,244
all-14245
[ "AddFlags", "parses", "options", "for", "database", "configuration" ]
[ "func", "(", "config", "*", "InfluxConfig", ")", "AddFlags", "(", "cmd", "*", "cobra", ".", "Command", ")", "{", "cmd", ".", "PersistentFlags", "(", ")", ".", "StringVar", "(", "&", "config", ".", "<mask>", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ")", "\n", "cmd", ".", "PersistentFlags", "(", ")", ".", "StringVar", "(", "&", "config", ".", "Password", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ")", "\n", "cmd", ".", "PersistentFlags", "(", ")", ".", "StringVar", "(", "&", "config", ".", "Host", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ")", "\n", "cmd", ".", "PersistentFlags", "(", ")", ".", "StringVar", "(", "&", "config", ".", "DB", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ")", "\n", "}" ]
14,245
all-14246
[ "UnmarshalJSON", "satisfies", "json", ".", "Unmarshaler", "." ]
[ "func", "(", "t", "*", "Modifier", ")", "UnmarshalJSON", "(", "buf", "[", "]", "<mask>", ")", "error", "{", "return", "easyjson", ".", "Unmarshal", "(", "buf", ",", "t", ")", "\n", "}" ]
14,246
all-14247
[ "GetRunCheckOk", "returns", "a", "tuple", "with", "the", "RunCheck", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "i", "*", "IntegrationSlackRequest", ")", "GetRunCheckOk", "(", ")", "(", "bool", ",", "bool", ")", "{", "if", "i", "==", "nil", "||", "i", ".", "RunCheck", "==", "nil", "{", "return", "false", ",", "false", "\n", "}", "\n", "return", "*", "i", ".", "RunCheck", ",", "<mask>", "\n", "}" ]
14,247
all-14248
[ "NewDialer", "returns", "a", "new", "SMTP", "Dialer", ".", "The", "given", "parameters", "are", "used", "to", "connect", "to", "the", "SMTP", "server", "." ]
[ "func", "NewDialer", "(", "host", "string", ",", "port", "int", ",", "username", ",", "password", "string", ")", "*", "Dialer", "{", "return", "&", "Dialer", "{", "Host", ":", "host", ",", "Port", ":", "<mask>", ",", "Username", ":", "username", ",", "Password", ":", "password", ",", "SSL", ":", "port", "==", "465", ",", "Timeout", ":", "10", "*", "time", ".", "Second", ",", "RetryFailure", ":", "true", ",", "}", "\n", "}" ]
14,248
all-14249
[ "drawGroundImage", "draws", "the", "ground", "image", "to", "the", "given", "screen", "image", "." ]
[ "func", "drawGroundImage", "(", "screen", "*", "ebiten", ".", "Image", ",", "ground", "*", "ebiten", ".", "Image", ")", "{", "perspectiveGroundImage", ".", "Clear", "(", ")", "\n", "gw", ",", "_", ":=", "ground", ".", "Size", "(", ")", "\n", "pw", ",", "ph", ":=", "perspectiveGroundImage", ".", "Size", "(", ")", "\n", "for", "j", ":=", "0", ";", "j", "<", "ph", ";", "j", "++", "{", "// z is in [2, -1]", "rate", ":=", "float64", "(", "j", ")", "/", "float64", "(", "ph", ")", "\n", "z", ":=", "(", "1", "-", "rate", ")", "*", "2", "+", "rate", "*", "-", "1", "\n", "if", "z", "<=", "0", "{", "break", "\n", "}", "\n", "op", ":=", "&", "ebiten", ".", "DrawImageOptions", "{", "}", "\n", "op", ".", "GeoM", ".", "Translate", "(", "-", "float64", "(", "pw", ")", "/", "2", ",", "0", ")", "\n", "op", ".", "GeoM", ".", "Scale", "(", "1", "/", "z", ",", "8", ")", "// 8 is an arbitrary number not to make empty lines.", "\n", "op", ".", "GeoM", ".", "Translate", "(", "float64", "(", "pw", ")", "/", "2", ",", "float64", "(", "j", ")", "/", "z", ")", "\n\n", "perspectiveGroundImage", ".", "DrawImage", "(", "ground", ".", "SubImage", "(", "image", ".", "Rect", "(", "0", ",", "j", ",", "gw", ",", "j", "+", "1", ")", ")", ".", "(", "*", "ebiten", ".", "<mask>", ")", ",", "op", ")", "\n", "}", "\n\n", "perspectiveGroundImage", ".", "DrawImage", "(", "fogImage", ",", "nil", ")", "\n\n", "op", ":=", "&", "ebiten", ".", "DrawImageOptions", "{", "}", "\n", "op", ".", "GeoM", ".", "Translate", "(", "-", "float64", "(", "pw", ")", "/", "2", ",", "0", ")", "\n", "op", ".", "GeoM", ".", "Rotate", "(", "-", "1", "*", "float64", "(", "thePlayer", ".", "lean", ")", "/", "maxLean", "*", "math", ".", "Pi", "/", "8", ")", "\n", "op", ".", "GeoM", ".", "Translate", "(", "float64", "(", "screenWidth", ")", "/", "2", ",", "screenHeight", "/", "3", ")", "\n", "screen", ".", "DrawImage", "(", "perspectiveGroundImage", ",", "op", ")", "\n", "}" ]
14,249
all-14250
[ "/", "*", "open", "-", "regexp", ".", "MustCompile", "(", "(", "[", "0", "-", "9", "]", "+", ")", "d", "(", "[", "0", "-", "9", "]", "+", ")", "(", "e", ")", "?o$", ")", "sil", "-", "regexp", ".", "MustCompile", "(", "(", "[", "0", "-", "9", "]", "+", ")", "d", "(", "[", "0", "-", "9", "]", "+", ")", "(", "e", ")", "?s$", ")" ]
[ "func", "Roll", "(", "desc", "string", ")", "(", "RollResult", ",", "string", ",", "error", ")", "{", "for", "_", ",", "rollHandler", ":=", "range", "rollHandlers", "{", "rollHandler", ".", "Pattern", "(", ")", ".", "Longest", "(", ")", "\n\n", "if", "r", ":=", "rollHandler", ".", "Pattern", "(", ")", ".", "FindStringSubmatch", "(", "desc", ")", ";", "r", "!=", "nil", "{", "result", ",", "err", ":=", "rollHandler", ".", "Roll", "(", "r", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "\"", "\"", ",", "err", "\n", "}", "\n\n", "indexes", ":=", "rollHandler", ".", "Pattern", "(", ")", ".", "FindStringSubmatchIndex", "(", "desc", ")", "\n", "reason", ":=", "strings", ".", "Trim", "(", "desc", "[", "indexes", "[", "0", "]", "+", "len", "(", "r", "[", "0", "]", ")", ":", "]", ",", "\"", "\\t", "\\r", "\\n", "\"", ")", "\n", "return", "result", ",", "<mask>", ",", "nil", "\n", "}", "\n", "}", "\n\n", "return", "nil", ",", "\"", "\"", ",", "errors", ".", "New", "(", "\"", "\"", "+", "desc", ")", "\n", "}" ]
14,250
all-14251
[ "loadAndMergeConfig", "loads", "configuration", "files", "in", "dirPath" ]
[ "func", "loadAndMergeConfig", "(", "dirPath", "string", ")", "(", "*", "registryConfiguration", ",", "error", ")", "{", "mergedConfig", ":=", "registryConfiguration", "{", "Docker", ":", "map", "[", "string", "]", "registryNamespace", "{", "}", "}", "\n", "dockerDefaultMergedFrom", ":=", "\"", "\"", "\n", "nsMergedFrom", ":=", "map", "[", "string", "]", "string", "{", "}", "\n\n", "dir", ",", "err", ":=", "os", ".", "Open", "(", "dirPath", ")", "\n", "if", "err", "!=", "nil", "{", "if", "os", ".", "IsNotExist", "(", "err", ")", "{", "return", "&", "mergedConfig", ",", "nil", "\n", "}", "\n", "return", "nil", ",", "err", "\n", "}", "\n", "configNames", ",", "err", ":=", "dir", ".", "Readdirnames", "(", "0", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "for", "_", ",", "configName", ":=", "<mask>", "configNames", "{", "if", "!", "strings", ".", "HasSuffix", "(", "configName", ",", "\"", "\"", ")", "{", "continue", "\n", "}", "\n", "configPath", ":=", "filepath", ".", "Join", "(", "dirPath", ",", "configName", ")", "\n", "configBytes", ",", "err", ":=", "ioutil", ".", "ReadFile", "(", "configPath", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "config", "registryConfiguration", "\n", "err", "=", "yaml", ".", "Unmarshal", "(", "configBytes", ",", "&", "config", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "errors", ".", "Wrapf", "(", "err", ",", "\"", "\"", ",", "configPath", ")", "\n", "}", "\n\n", "if", "config", ".", "DefaultDocker", "!=", "nil", "{", "if", "mergedConfig", ".", "DefaultDocker", "!=", "nil", "{", "return", "nil", ",", "errors", ".", "Errorf", "(", "`Error parsing signature storage configuration: \"default-docker\" defined both in \"%s\" and \"%s\"`", ",", "dockerDefaultMergedFrom", ",", "configPath", ")", "\n", "}", "\n", "mergedConfig", ".", "DefaultDocker", "=", "config", ".", "DefaultDocker", "\n", "dockerDefaultMergedFrom", "=", "configPath", "\n", "}", "\n\n", "for", "nsName", ",", "nsConfig", ":=", "range", "config", ".", "Docker", "{", "// includes config.Docker == nil", "if", "_", ",", "ok", ":=", "mergedConfig", ".", "Docker", "[", "nsName", "]", ";", "ok", "{", "return", "nil", ",", "errors", ".", "Errorf", "(", "`Error parsing signature storage configuration: \"docker\" namespace \"%s\" defined both in \"%s\" and \"%s\"`", ",", "nsName", ",", "nsMergedFrom", "[", "nsName", "]", ",", "configPath", ")", "\n", "}", "\n", "mergedConfig", ".", "Docker", "[", "nsName", "]", "=", "nsConfig", "\n", "nsMergedFrom", "[", "nsName", "]", "=", "configPath", "\n", "}", "\n", "}", "\n\n", "return", "&", "mergedConfig", ",", "nil", "\n", "}" ]
14,251
all-14252
[ "WalkPrefix", "is", "used", "to", "walk", "the", "tree", "under", "a", "prefix" ]
[ "func", "(", "t", "*", "Tree", ")", "WalkPrefix", "(", "prefix", "string", ",", "fn", "WalkFn", ")", "{", "n", ":=", "t", ".", "root", "\n", "search", ":=", "prefix", "\n", "for", "{", "// Check for key exhaution", "if", "len", "(", "<mask>", ")", "==", "0", "{", "recursiveWalk", "(", "n", ",", "fn", ")", "\n", "return", "\n", "}", "\n\n", "// Look for an edge", "n", "=", "n", ".", "getEdge", "(", "search", "[", "0", "]", ")", "\n", "if", "n", "==", "nil", "{", "break", "\n", "}", "\n\n", "// Consume the search prefix", "if", "strings", ".", "HasPrefix", "(", "search", ",", "n", ".", "prefix", ")", "{", "search", "=", "search", "[", "len", "(", "n", ".", "prefix", ")", ":", "]", "\n\n", "}", "else", "if", "strings", ".", "HasPrefix", "(", "n", ".", "prefix", ",", "search", ")", "{", "// Child may be under our search prefix", "recursiveWalk", "(", "n", ",", "fn", ")", "\n", "return", "\n", "}", "else", "{", "break", "\n", "}", "\n", "}", "\n\n", "}" ]
14,252
all-14253
[ "ListRepo", "returns", "info", "about", "all", "Repos", ".", "provenance", "specifies", "a", "set", "of", "provenance", "repos", "only", "repos", "which", "have", "ALL", "of", "the", "specified", "repos", "as", "provenance", "will", "be", "returned", "unless", "provenance", "is", "nil", "in", "which", "case", "it", "is", "ignored", "." ]
[ "func", "(", "c", "APIClient", ")", "ListRepo", "(", ")", "(", "[", "]", "*", "pfs", ".", "RepoInfo", ",", "error", ")", "{", "<mask>", ":=", "&", "pfs", ".", "ListRepoRequest", "{", "}", "\n", "repoInfos", ",", "err", ":=", "c", ".", "PfsAPIClient", ".", "ListRepo", "(", "c", ".", "Ctx", "(", ")", ",", "request", ",", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "grpcutil", ".", "ScrubGRPC", "(", "err", ")", "\n", "}", "\n", "return", "repoInfos", ".", "RepoInfo", ",", "nil", "\n", "}" ]
14,253
all-14254
[ "ContainerEvents", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockDockerClient", ")", "ContainerEvents", "(", "arg0", "context", ".", "Context", ")", "(", "<-", "chan", "dockerapi", ".", "DockerContainerChangeEvent", ",", "error", ")", "{", "ret", ":=", "m", ".", "ctrl", ".", "Call", "(", "m", ",", "\"", "\"", ",", "arg0", ")", "\n", "ret0", ",", "_", ":=", "<mask>", "[", "0", "]", ".", "(", "<-", "chan", "dockerapi", ".", "DockerContainerChangeEvent", ")", "\n", "ret1", ",", "_", ":=", "ret", "[", "1", "]", ".", "(", "error", ")", "\n", "return", "ret0", ",", "ret1", "\n", "}" ]
14,254
all-14255
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "PictureTile", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "<mask>", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoLayertree9", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
14,255
all-14256
[ "flushLine", "flushes", "the", "line", "j", "if", "possible", "and", "if", "the", "line", "is", "flushed", "the", "other", "lines", "above", "the", "line", "go", "down", ".", "flushLine", "returns", "a", "boolean", "value", "indicating", "whether", "the", "line", "is", "actually", "flushed", "." ]
[ "func", "(", "f", "*", "Field", ")", "flushLine", "(", "j", "int", ")", "bool", "{", "for", "i", ":=", "0", ";", "i", "<", "fieldBlockNumX", ";", "i", "++", "{", "if", "f", ".", "<mask>", "[", "i", "]", "[", "j", "]", "==", "BlockTypeNone", "{", "return", "false", "\n", "}", "\n", "}", "\n", "for", "j2", ":=", "j", ";", "1", "<=", "j2", ";", "j2", "--", "{", "for", "i", ":=", "0", ";", "i", "<", "fieldBlockNumX", ";", "i", "++", "{", "f", ".", "blocks", "[", "i", "]", "[", "j2", "]", "=", "f", ".", "blocks", "[", "i", "]", "[", "j2", "-", "1", "]", "\n", "}", "\n", "}", "\n", "for", "i", ":=", "0", ";", "i", "<", "fieldBlockNumX", ";", "i", "++", "{", "f", ".", "blocks", "[", "i", "]", "[", "0", "]", "=", "BlockTypeNone", "\n", "}", "\n", "return", "true", "\n", "}" ]
14,256
all-14257
[ "Reset", "resets", "executor", "-", "specific", "information", "for", "this", "task", "e", ".", "g", ".", "TaskID", "ExecutorID", "SlaveID", "and", "Attributes" ]
[ "func", "(", "td", "*", "TaskData", ")", "Reset", "(", ")", "{", "td", ".", "TaskID", "=", "\"", "\"", "\n", "td", ".", "ExecutorID", "=", "\"", "\"", "\n", "td", ".", "SlaveID", "=", "\"", "\"", "\n", "td", ".", "Attributes", "=", "make", "(", "<mask>", "[", "string", "]", "string", ")", "\n", "}" ]
14,257
all-14258
[ "baseVirtualDeviceToBaseVirtualEthernetCard", "converts", "a", "BaseVirtualDevice", "value", "into", "a", "BaseVirtualEthernetCard", "." ]
[ "func", "baseVirtualDeviceToBaseVirtualEthernetCard", "(", "v", "types", ".", "BaseVirtualDevice", ")", "(", "types", ".", "BaseVirtualEthernetCard", ",", "error", ")", "{", "if", "bve", ",", "<mask>", ":=", "v", ".", "(", "types", ".", "BaseVirtualEthernetCard", ")", ";", "ok", "{", "return", "bve", ",", "nil", "\n", "}", "\n", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "v", ")", "\n", "}" ]
14,258
all-14259
[ "copyWithSnapshots", "creates", "a", "non", "-", "sparse", "copy", "of", "a", "container", "including", "its", "snapshots", "This", "does", "not", "introduce", "a", "dependency", "relation", "between", "the", "source", "RBD", "storage", "volume", "and", "the", "target", "RBD", "storage", "volume", "." ]
[ "func", "(", "s", "*", "storageCeph", ")", "copyWithSnapshots", "(", "sourceVolumeName", "string", ",", "targetVolumeName", "string", ",", "sourceParentSnapshot", "string", ")", "error", "{", "logger", ".", "Debugf", "(", "`Creating non-sparse copy of RBD storage volume \"%s to \"%s\"`", ",", "sourceVolumeName", ",", "targetVolumeName", ")", "\n\n", "args", ":=", "[", "]", "string", "{", "\"", "\"", ",", "\"", "\"", ",", "s", ".", "UserName", ",", "\"", "\"", ",", "s", ".", "ClusterName", ",", "sourceVolumeName", ",", "}", "\n\n", "if", "sourceParentSnapshot", "!=", "\"", "\"", "{", "args", "=", "append", "(", "args", ",", "\"", "\"", ",", "sourceParentSnapshot", ")", "\n", "}", "\n\n", "// redirect output to stdout", "args", "=", "append", "(", "args", ",", "\"", "\"", ")", "\n\n", "rbdSendCmd", ":=", "exec", ".", "Command", "(", "\"", "\"", ",", "args", "...", ")", "\n", "rbdRecvCmd", ":=", "exec", ".", "Command", "(", "\"", "\"", ",", "\"", "\"", ",", "s", ".", "UserName", ",", "\"", "\"", ",", "\"", "\"", ",", "s", ".", "ClusterName", ",", "\"", "\"", ",", "targetVolumeName", ")", "\n\n", "rbdRecvCmd", ".", "Stdin", ",", "_", "=", "rbdSendCmd", ".", "StdoutPipe", "(", ")", "\n", "rbdRecvCmd", ".", "Stdout", "=", "os", ".", "Stdout", "\n", "rbdRecvCmd", ".", "Stderr", "=", "<mask>", ".", "Stderr", "\n\n", "err", ":=", "rbdRecvCmd", ".", "Start", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "err", "=", "rbdSendCmd", ".", "Run", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "err", "=", "rbdRecvCmd", ".", "Wait", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "logger", ".", "Debugf", "(", "`Created non-sparse copy of RBD storage volume \"%s\" to \"%s\"`", ",", "sourceVolumeName", ",", "targetVolumeName", ")", "\n", "return", "nil", "\n", "}" ]
14,259
all-14260
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "GetHistogramsParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "<mask>", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser12", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
14,260
all-14261
[ "treeFunc", "returns", "or", "accumulates", "keyPrefix", "dependencies", "." ]
[ "func", "treeFunc", "(", "b", "*", "Brain", ",", "used", ",", "missing", "*", "dep", ".", "Set", ")", "func", "(", "string", ")", "(", "[", "]", "*", "dep", ".", "KeyPair", ",", "error", ")", "{", "return", "func", "(", "s", "string", ")", "(", "[", "]", "*", "dep", ".", "KeyPair", ",", "error", ")", "{", "result", ":=", "[", "]", "*", "dep", ".", "KeyPair", "{", "}", "\n\n", "if", "len", "(", "s", ")", "==", "0", "{", "return", "<mask>", ",", "nil", "\n", "}", "\n\n", "d", ",", "err", ":=", "dep", ".", "NewKVListQuery", "(", "s", ")", "\n", "if", "err", "!=", "nil", "{", "return", "result", ",", "err", "\n", "}", "\n\n", "used", ".", "Add", "(", "d", ")", "\n\n", "// Only return non-empty top-level keys", "if", "value", ",", "ok", ":=", "b", ".", "Recall", "(", "d", ")", ";", "ok", "{", "for", "_", ",", "pair", ":=", "range", "value", ".", "(", "[", "]", "*", "dep", ".", "KeyPair", ")", "{", "parts", ":=", "strings", ".", "Split", "(", "pair", ".", "Key", ",", "\"", "\"", ")", "\n", "if", "parts", "[", "len", "(", "parts", ")", "-", "1", "]", "!=", "\"", "\"", "{", "result", "=", "append", "(", "result", ",", "pair", ")", "\n", "}", "\n", "}", "\n", "return", "result", ",", "nil", "\n", "}", "\n\n", "missing", ".", "Add", "(", "d", ")", "\n\n", "return", "result", ",", "nil", "\n", "}", "\n", "}" ]
14,261
all-14262
[ "GetTitleAlignOk", "returns", "a", "tuple", "with", "the", "TitleAlign", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "l", "*", "LogStreamDefinition", ")", "GetTitleAlignOk", "(", ")", "(", "string", ",", "bool", ")", "{", "if", "l", "==", "nil", "||", "l", ".", "TitleAlign", "==", "nil", "{", "return", "\"", "\"", ",", "false", "\n", "}", "\n", "return", "*", "l", ".", "TitleAlign", ",", "<mask>", "\n", "}" ]
14,262
all-14263
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "StartSamplingParams", ")", "UnmarshalJSON", "(", "<mask>", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoMemory1", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "Error", "(", ")", "\n", "}" ]
14,263
all-14264
[ "Flush", "flushes", "the", "command", "queue", "." ]
[ "func", "(", "q", "*", "commandQueue", ")", "Flush", "(", ")", "{", "if", "q", ".", "err", "!=", "nil", "{", "return", "\n", "}", "\n\n", "es", ":=", "q", ".", "indices", "\n", "vs", ":=", "q", ".", "vertices", "\n", "if", "recordLog", "(", ")", "{", "fmt", ".", "Println", "(", "\"", "\"", ")", "\n", "}", "\n\n", "theGraphicsDriver", ".", "Begin", "(", ")", "\n", "for", "len", "(", "q", ".", "commands", ")", ">", "0", "{", "nv", ":=", "0", "\n", "ne", ":=", "0", "\n", "nc", ":=", "0", "\n", "for", "_", ",", "c", ":=", "range", "q", ".", "commands", "{", "if", "c", ".", "NumIndices", "(", ")", ">", "graphics", ".", "IndicesNum", "{", "panic", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "c", ".", "NumIndices", "(", ")", ",", "graphics", ".", "IndicesNum", ")", ")", "\n", "}", "\n", "if", "ne", "+", "c", ".", "NumIndices", "(", ")", ">", "graphics", ".", "IndicesNum", "{", "break", "\n", "}", "\n", "nv", "+=", "c", ".", "NumVertices", "(", ")", "\n", "ne", "+=", "c", ".", "NumIndices", "(", ")", "\n", "nc", "++", "\n", "}", "\n", "if", "0", "<", "ne", "{", "theGraphicsDriver", ".", "SetVertices", "(", "vs", "[", ":", "nv", "]", ",", "<mask>", "[", ":", "ne", "]", ")", "\n", "es", "=", "es", "[", "ne", ":", "]", "\n", "vs", "=", "vs", "[", "nv", ":", "]", "\n", "}", "\n", "indexOffset", ":=", "0", "\n", "for", "_", ",", "c", ":=", "range", "q", ".", "commands", "[", ":", "nc", "]", "{", "if", "err", ":=", "c", ".", "Exec", "(", "indexOffset", ")", ";", "err", "!=", "nil", "{", "q", ".", "err", "=", "err", "\n", "return", "\n", "}", "\n", "if", "recordLog", "(", ")", "{", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "c", ")", "\n", "}", "\n", "// TODO: indexOffset should be reset if the command type is different", "// from the previous one. This fix is needed when another drawing command is", "// introduced than drawTrianglesCommand.", "indexOffset", "+=", "c", ".", "NumIndices", "(", ")", "\n", "}", "\n", "if", "0", "<", "nc", "{", "// Call glFlush to prevent black flicking (especially on Android (#226) and iOS).", "theGraphicsDriver", ".", "Flush", "(", ")", "\n", "}", "\n", "q", ".", "commands", "=", "q", ".", "commands", "[", "nc", ":", "]", "\n", "}", "\n", "theGraphicsDriver", ".", "End", "(", ")", "\n", "q", ".", "commands", "=", "nil", "\n", "q", ".", "nvertices", "=", "0", "\n", "q", ".", "nindices", "=", "0", "\n", "q", ".", "tmpNumIndices", "=", "0", "\n", "q", ".", "nextIndex", "=", "0", "\n", "}" ]
14,264
all-14265
[ "messageFilter", "builds", "a", "filter", "for", "jobs", "based", "on", "the", "messageBody", "matching", "the", "trigger", "regex", "of", "the", "jobs", "." ]
[ "func", "messageFilter", "(", "lastUpdate", "time", ".", "Time", ",", "change", "client", ".", "ChangeInfo", ",", "presubmits", "[", "]", "config", ".", "Presubmit", ")", "(", "pjutil", ".", "Filter", ",", "error", ")", "{", "var", "filters", "[", "]", "pjutil", ".", "Filter", "\n", "currentRevision", ":=", "change", ".", "Revisions", "[", "change", ".", "CurrentRevision", "]", ".", "Number", "\n", "for", "_", ",", "message", ":=", "range", "change", ".", "Messages", "{", "messageTime", ":=", "message", ".", "Date", ".", "Time", "\n", "if", "message", ".", "RevisionNumber", "!=", "currentRevision", "||", "!", "messageTime", ".", "After", "(", "lastUpdate", ")", "{", "continue", "\n", "}", "\n\n", "if", "!", "pjutil", ".", "TestAllRe", ".", "MatchString", "(", "message", ".", "Message", ")", "{", "for", "_", ",", "presubmit", ":=", "range", "presubmits", "{", "if", "presubmit", ".", "TriggerMatches", "(", "<mask>", ".", "Message", ")", "{", "logrus", ".", "Infof", "(", "\"", "\"", ",", "change", ".", "Number", ",", "message", ".", "Message", ",", "presubmit", ".", "Name", ")", "\n", "filters", "=", "append", "(", "filters", ",", "pjutil", ".", "CommandFilter", "(", "message", ".", "Message", ")", ")", "\n", "}", "\n", "}", "\n", "}", "else", "{", "filters", "=", "append", "(", "filters", ",", "pjutil", ".", "TestAllFilter", "(", ")", ")", "\n", "}", "\n\n", "}", "\n", "return", "pjutil", ".", "AggregateFilter", "(", "filters", ")", ",", "nil", "\n", "}" ]
14,265
all-14266
[ "IsManagedObjectNotFoundError", "checks", "an", "error", "to", "see", "if", "it", "s", "of", "the", "ManagedObjectNotFound", "type", "." ]
[ "func", "IsManagedObjectNotFoundError", "(", "err", "error", ")", "bool", "{", "if", "f", ",", "ok", ":=", "vimSoapFault", "(", "err", ")", ";", "ok", "{", "if", "_", ",", "ok", ":=", "f", ".", "(", "<mask>", ".", "ManagedObjectNotFound", ")", ";", "ok", "{", "return", "true", "\n", "}", "\n", "}", "\n", "return", "false", "\n", "}" ]
14,266
all-14267
[ "Stability", ":", "***", "EXPERIMENTAL", "***", "Get", "an", "active", "provisioner", ".", "The", "term", "provisioner", "is", "taken", "broadly", "to", "mean", "anything", "with", "a", "provisionerId", ".", "This", "does", "not", "necessarily", "mean", "there", "is", "an", "associated", "service", "performing", "any", "provisioning", "activity", ".", "See", "#getProvisioner" ]
[ "func", "(", "queue", "*", "Queue", ")", "GetProvisioner", "(", "provisionerId", "string", ")", "(", "*", "ProvisionerResponse", ",", "error", ")", "{", "cd", ":=", "tcclient", ".", "Client", "(", "*", "queue", ")", "\n", "responseObject", ",", "_", ",", "err", ":=", "(", "&", "cd", ")", ".", "APICall", "(", "nil", ",", "\"", "\"", ",", "\"", "\"", "+", "url", ".", "QueryEscape", "(", "provisionerId", ")", ",", "<mask>", "(", "ProvisionerResponse", ")", ",", "nil", ")", "\n", "return", "responseObject", ".", "(", "*", "ProvisionerResponse", ")", ",", "err", "\n", "}" ]
14,267
all-14268
[ "Insert", "a", "task", "into", "the", "index", ".", "If", "the", "new", "rank", "is", "less", "than", "the", "existing", "rank", "at", "the", "given", "index", "path", "the", "task", "is", "not", "indexed", "but", "the", "response", "is", "still", "200", "OK", ".", "Please", "see", "the", "introduction", "above", "for", "information", "about", "indexing", "successfully", "completed", "tasks", "automatically", "using", "custom", "routes", ".", "Required", "scopes", ":", "index", ":", "insert", "-", "task", ":", "<namespace", ">", "See", "#insertTask" ]
[ "func", "(", "index", "*", "Index", ")", "InsertTask", "(", "namespace", "string", ",", "payload", "*", "InsertTaskRequest", ")", "(", "*", "IndexedTaskResponse", ",", "error", ")", "{", "cd", ":=", "tcclient", ".", "<mask>", "(", "*", "index", ")", "\n", "responseObject", ",", "_", ",", "err", ":=", "(", "&", "cd", ")", ".", "APICall", "(", "payload", ",", "\"", "\"", ",", "\"", "\"", "+", "url", ".", "QueryEscape", "(", "namespace", ")", ",", "new", "(", "IndexedTaskResponse", ")", ",", "nil", ")", "\n", "return", "responseObject", ".", "(", "*", "IndexedTaskResponse", ")", ",", "err", "\n", "}" ]
14,268
all-14269
[ "export", "gogpgme_assuan_status_callback" ]
[ "func", "gogpgme_assuan_status_callback", "(", "handle", "unsafe", ".", "Pointer", ",", "cStatus", "*", "C", ".", "char", ",", "cArgs", "*", "C", ".", "char", ")", "C", ".", "gpgme_error_t", "{", "status", ":=", "C", ".", "GoString", "(", "cStatus", ")", "\n", "args", ":=", "C", ".", "GoString", "(", "cArgs", ")", "\n", "c", ":=", "callbackLookup", "(", "uintptr", "(", "<mask>", ")", ")", ".", "(", "*", "AssuanStatusCallback", ")", "\n", "if", "*", "c", "==", "nil", "{", "return", "0", "\n", "}", "\n", "(", "*", "c", ")", "(", "status", ",", "args", ")", "\n", "return", "0", "\n", "}" ]
14,269
all-14270
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "EventAnimationStarted", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoAnimation13", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "<mask>", "\n", "}" ]
14,270
all-14271
[ "NewSSMClient", "indicates", "an", "expected", "call", "of", "NewSSMClient" ]
[ "func", "(", "mr", "*", "MockSSMClientCreatorMockRecorder", ")", "NewSSMClient", "(", "arg0", ",", "arg1", "<mask>", "{", "}", ")", "*", "gomock", ".", "Call", "{", "return", "mr", ".", "mock", ".", "ctrl", ".", "RecordCallWithMethodType", "(", "mr", ".", "mock", ",", "\"", "\"", ",", "reflect", ".", "TypeOf", "(", "(", "*", "MockSSMClientCreator", ")", "(", "nil", ")", ".", "NewSSMClient", ")", ",", "arg0", ",", "arg1", ")", "\n", "}" ]
14,271
all-14272
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "Rect", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoDom18", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "<mask>", "(", ")", "\n", "}" ]
14,272
all-14273
[ "GetCreatedAt", "sets", "the", "timestamp", "for", "resource", "s", "creation", "time" ]
[ "func", "(", "vol", "*", "VolumeResource", ")", "GetCreatedAt", "(", ")", "<mask>", ".", "Time", "{", "vol", ".", "lock", ".", "RLock", "(", ")", "\n", "defer", "vol", ".", "lock", ".", "RUnlock", "(", ")", "\n\n", "return", "vol", ".", "createdAtUnsafe", "\n", "}" ]
14,273
all-14274
[ "Do", "executes", "Target", ".", "setRemoteLocations", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "SetRemoteLocationsParams", ")", "Do", "(", "ctx", "<mask>", ".", "Context", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandSetRemoteLocations", ",", "p", ",", "nil", ")", "\n", "}" ]
14,274
all-14275
[ "Platform", "routes", "the", "platform", "object", "to", "the", "given", "pattern" ]
[ "func", "(", "r", "*", "Router", ")", "Platform", "(", "<mask>", "string", ",", "platform", "Platform", ")", "{", "c", ":=", "r", ".", "pattern", "(", "pattern", ")", "\n", "platform", ".", "Routes", "(", "r", ".", "clone", "(", "c", ")", ")", "\n", "}" ]
14,275
all-14276
[ "schemaDatastoreSummary", "returns", "schema", "items", "for", "resources", "that", "need", "to", "work", "with", "a", "DatastoreSummary", "." ]
[ "func", "schemaDatastoreSummary", "(", ")", "map", "[", "string", "]", "*", "schema", ".", "Schema", "{", "return", "map", "[", "string", "]", "*", "schema", ".", "Schema", "{", "// Note that the following fields are not represented in the schema here:", "// * Name (more than likely the ID attribute and will be represented in", "// resource schema)", "// * Type (redundant attribute as the datastore type will be represented by", "// the resource)", "\"", "\"", ":", "{", "Type", ":", "schema", ".", "TypeBool", ",", "Description", ":", "\"", "\"", ",", "Computed", ":", "true", ",", "}", ",", "\"", "\"", ":", "{", "Type", ":", "schema", ".", "TypeInt", ",", "Description", ":", "\"", "\"", ",", "Computed", ":", "true", ",", "}", ",", "\"", "\"", ":", "{", "Type", ":", "schema", ".", "TypeInt", ",", "Description", ":", "\"", "\"", ",", "Computed", ":", "<mask>", ",", "}", ",", "\"", "\"", ":", "{", "Type", ":", "schema", ".", "TypeString", ",", "Description", ":", "\"", "\"", ",", "Computed", ":", "true", ",", "}", ",", "\"", "\"", ":", "{", "Type", ":", "schema", ".", "TypeBool", ",", "Description", ":", "\"", "\"", ",", "Computed", ":", "true", ",", "}", ",", "\"", "\"", ":", "{", "Type", ":", "schema", ".", "TypeInt", ",", "Description", ":", "\"", "\"", ",", "Computed", ":", "true", ",", "}", ",", "\"", "\"", ":", "{", "Type", ":", "schema", ".", "TypeString", ",", "Description", ":", "\"", "\"", ",", "Computed", ":", "true", ",", "}", ",", "}", "\n", "}" ]
14,276
all-14277
[ "Serve", "serves", "incoming", "connections", "from", "the", "given", "listener", ".", "Serve", "blocks", "until", "the", "given", "listener", "returns", "permanent", "error", "." ]
[ "func", "(", "s", "*", "Server", ")", "Serve", "(", "ln", "net", ".", "Listener", ")", "error", "{", "var", "lastOverflowErrorTime", "time", ".", "Time", "\n", "var", "lastPerIPErrorTime", "time", ".", "Time", "\n", "var", "c", "net", ".", "Conn", "\n", "var", "err", "error", "\n\n", "s", ".", "mu", ".", "Lock", "(", ")", "\n", "{", "if", "s", ".", "ln", "!=", "nil", "{", "s", ".", "mu", ".", "Unlock", "(", ")", "\n", "return", "ErrAlreadyServing", "\n", "}", "\n\n", "s", ".", "ln", "=", "ln", "\n", "s", ".", "done", "=", "make", "(", "chan", "struct", "{", "}", ")", "\n", "}", "\n", "s", ".", "mu", ".", "Unlock", "(", ")", "\n\n", "maxWorkersCount", ":=", "s", ".", "getConcurrency", "(", ")", "\n", "s", ".", "concurrencyCh", "=", "make", "(", "chan", "struct", "{", "}", ",", "maxWorkersCount", ")", "\n", "wp", ":=", "&", "workerPool", "{", "WorkerFunc", ":", "s", ".", "serveConn", ",", "MaxWorkersCount", ":", "maxWorkersCount", ",", "LogAllErrors", ":", "s", ".", "LogAllErrors", ",", "Logger", ":", "s", ".", "logger", "(", ")", ",", "connState", ":", "s", ".", "setState", ",", "}", "\n", "wp", ".", "Start", "(", ")", "\n\n", "// Count our waiting to accept a connection as an open connection.", "// This way we can't get into any weird state where just after accepting", "// a connection Shutdown is called which reads open as 0 because it isn't", "// incremented yet.", "atomic", ".", "AddInt32", "(", "&", "s", ".", "<mask>", ",", "1", ")", "\n", "defer", "atomic", ".", "AddInt32", "(", "&", "s", ".", "open", ",", "-", "1", ")", "\n\n", "for", "{", "if", "c", ",", "err", "=", "acceptConn", "(", "s", ",", "ln", ",", "&", "lastPerIPErrorTime", ")", ";", "err", "!=", "nil", "{", "wp", ".", "Stop", "(", ")", "\n", "if", "err", "==", "io", ".", "EOF", "{", "return", "nil", "\n", "}", "\n", "return", "err", "\n", "}", "\n", "s", ".", "setState", "(", "c", ",", "StateNew", ")", "\n", "atomic", ".", "AddInt32", "(", "&", "s", ".", "open", ",", "1", ")", "\n", "if", "!", "wp", ".", "Serve", "(", "c", ")", "{", "atomic", ".", "AddInt32", "(", "&", "s", ".", "open", ",", "-", "1", ")", "\n", "s", ".", "writeFastError", "(", "c", ",", "StatusServiceUnavailable", ",", "\"", "\"", ")", "\n", "c", ".", "Close", "(", ")", "\n", "s", ".", "setState", "(", "c", ",", "StateClosed", ")", "\n", "if", "time", ".", "Since", "(", "lastOverflowErrorTime", ")", ">", "time", ".", "Minute", "{", "s", ".", "logger", "(", ")", ".", "Printf", "(", "\"", "\"", "+", "\"", "\"", ",", "maxWorkersCount", ")", "\n", "lastOverflowErrorTime", "=", "time", ".", "Now", "(", ")", "\n", "}", "\n\n", "// The current server reached concurrency limit,", "// so give other concurrently running servers a chance", "// accepting incoming connections on the same address.", "//", "// There is a hope other servers didn't reach their", "// concurrency limits yet :)", "//", "// See also: https://github.com/valyala/fasthttp/pull/485#discussion_r239994990", "if", "s", ".", "SleepWhenConcurrencyLimitsExceeded", ">", "0", "{", "time", ".", "Sleep", "(", "s", ".", "SleepWhenConcurrencyLimitsExceeded", ")", "\n", "}", "\n", "}", "\n", "c", "=", "nil", "\n", "}", "\n", "}" ]
14,277
all-14278
[ "GetSizingOk", "returns", "a", "tuple", "with", "the", "Sizing", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "i", "*", "ImageDefinition", ")", "GetSizingOk", "(", ")", "(", "string", ",", "bool", ")", "{", "if", "i", "==", "nil", "||", "i", ".", "Sizing", "==", "nil", "{", "return", "\"", "\"", ",", "false", "\n", "}", "\n", "return", "*", "i", ".", "Sizing", ",", "<mask>", "\n", "}" ]
14,278
all-14279
[ "GetParam", "retrieves", "a", "param", "from", "a", "context" ]
[ "func", "GetParam", "(", "ctx", "context", ".", "Context", ",", "name", "string", ")", "Param", "{", "n", ":=", "paramName", "(", "<mask>", ")", "\n", "if", "p", ",", "ok", ":=", "ctx", ".", "Value", "(", "n", ")", ".", "(", "Param", ")", ";", "ok", "{", "return", "p", "\n", "}", "\n", "return", "\"", "\"", "\n", "}" ]
14,279
all-14280
[ "GetHideZeroCounts", "returns", "the", "HideZeroCounts", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "m", "*", "ManageStatusDefinition", ")", "GetHideZeroCounts", "(", ")", "bool", "{", "if", "m", "==", "nil", "||", "m", ".", "HideZeroCounts", "==", "nil", "{", "return", "<mask>", "\n", "}", "\n", "return", "*", "m", ".", "HideZeroCounts", "\n", "}" ]
14,280
all-14281
[ "Global", "Helpers", "*", "PromptConfirmation", "displays", "a", "prompt", "scans", "a", "line", "of", "input", "and", "returns", "it", "." ]
[ "func", "PromptConfirmation", "(", "format", "string", ",", "a", "...", "interface", "{", "}", ")", "string", "{", "m", ":=", "fmt", ".", "Sprintf", "(", "format", ",", "a", "...", ")", "\n", "fmt", ".", "Fprintf", "(", "<mask>", ",", "m", ")", "\n", "var", "yn", "string", "\n", "fmt", ".", "Fscanf", "(", "in", ",", "\"", "\"", ",", "&", "yn", ")", "\n", "return", "yn", "\n", "}" ]
14,281
all-14282
[ "evaluateEntrytypeFlag", "evaluates", "entry", "-", "type", "flag", "and", "choose", "proper", "filter", "/", "filters", "to", "filter", "entries" ]
[ "func", "evaluateEntrytypeFlag", "(", "entrytype", "string", ")", "[", "]", "EntryFilter", "{", "var", "entrytypelist", "[", "]", "string", "\n", "if", "entrytype", "!=", "\"", "\"", "{", "entrytypelist", "=", "strings", ".", "Split", "(", "entrytype", ",", "\"", "\"", ")", "\n", "}", "\n\n", "validRequest", ":=", "map", "[", "string", "]", "[", "]", "EntryFilter", "{", "\"", "\"", ":", "{", "passConfChange", "}", ",", "\"", "\"", ":", "{", "passInternalRaftRequest", ",", "passRequest", ",", "passUnknownNormal", "}", ",", "\"", "\"", ":", "{", "passRequest", "}", ",", "\"", "\"", ":", "{", "passInternalRaftRequest", "}", ",", "\"", "\"", ":", "{", "passIRRRange", "}", ",", "\"", "\"", ":", "{", "passIRRPut", "}", ",", "\"", "\"", ":", "{", "passIRRDeleteRange", "}", ",", "\"", "\"", ":", "{", "passIRRTxn", "}", ",", "\"", "\"", ":", "{", "passIRRCompaction", "}", ",", "\"", "\"", ":", "{", "passIRRLeaseGrant", "}", ",", "\"", "\"", ":", "{", "passIRRLeaseRevoke", "}", ",", "\"", "\"", ":", "{", "passIRRLeaseCheckpoint", "}", ",", "}", "\n", "filters", ":=", "make", "(", "[", "]", "EntryFilter", ",", "0", ")", "\n", "if", "len", "(", "entrytypelist", ")", "==", "0", "{", "filters", "=", "append", "(", "filters", ",", "passInternalRaftRequest", ")", "\n", "filters", "=", "append", "(", "filters", ",", "passRequest", ")", "\n", "filters", "=", "append", "(", "filters", ",", "passUnknownNormal", ")", "\n", "filters", "=", "append", "(", "filters", ",", "passConfChange", ")", "\n", "}", "\n", "for", "_", ",", "et", ":=", "<mask>", "entrytypelist", "{", "if", "f", ",", "ok", ":=", "validRequest", "[", "et", "]", ";", "ok", "{", "filters", "=", "append", "(", "filters", ",", "f", "...", ")", "\n", "}", "else", "{", "log", ".", "Printf", "(", "`[%+v] is not a valid entry-type, ignored.\nPlease set entry-type to one or more of the following:\nConfigChange, Normal, Request, InternalRaftRequest,\nIRRRange, IRRPut, IRRDeleteRange, IRRTxn,\nIRRCompaction, IRRLeaseGrant, IRRLeaseRevoke, IRRLeaseCheckpoint`", ",", "et", ")", "\n", "}", "\n", "}", "\n\n", "return", "filters", "\n", "}" ]
14,282
all-14283
[ "merged", "from", "https", ":", "//", "github", ".", "com", "/", "kubernetes", "/", "kubernetes", "/", "blob", "/", "1f69c34478800e150acd022f6313a15e1cb7a97c", "/", "pkg", "/", "quota", "/", "evaluator", "/", "core", "/", "pods", ".", "go#L333", "and", "https", ":", "//", "github", ".", "com", "/", "kubernetes", "/", "kubernetes", "/", "blob", "/", "560e15fb9acee4b8391afbc21fc3aea7b771e2c4", "/", "pkg", "/", "printers", "/", "internalversion", "/", "printers", ".", "go#L606" ]
[ "func", "isTerminating", "(", "pod", "apiv1", ".", "Pod", ")", "bool", "{", "<mask>", "pod", ".", "Spec", ".", "ActiveDeadlineSeconds", "!=", "nil", "&&", "*", "pod", ".", "Spec", ".", "ActiveDeadlineSeconds", ">=", "int64", "(", "0", ")", "||", "pod", ".", "DeletionTimestamp", "!=", "nil", "\n", "}" ]
14,283
all-14284
[ "defrag", "a", "given", "endpoint" ]
[ "func", "defrag", "(", "c", "*", "v3", ".", "Client", ",", "ep", "string", ")", "{", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "ep", ")", "\n", "ctx", ",", "cancel", ":=", "context", ".", "WithTimeout", "(", "context", ".", "Background", "(", ")", ",", "30", "*", "<mask>", ".", "Second", ")", "\n", "_", ",", "err", ":=", "c", ".", "Defragment", "(", "ctx", ",", "ep", ")", "\n", "cancel", "(", ")", "\n", "if", "err", "!=", "nil", "{", "ExitWithError", "(", "ExitError", ",", "err", ")", "\n", "}", "\n", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "ep", ")", "\n", "}" ]
14,284
all-14285
[ "Return", "a", "URL", "to", "generate", "a", "QRCode", "on", "Google", "Charts", "for", "the", "TOTP", "with", "the", "given", "label", "and", "width", "(", "and", "height", "equal", "to", "width", ")", "." ]
[ "func", "(", "totp", "*", "TOTP", ")", "QRCodeGoogleChartsUrl", "(", "label", "string", ",", "width", "int", ")", "string", "{", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "width", ",", "width", ",", "url", ".", "QueryEscape", "(", "totp", ".", "QRCodeData", "(", "<mask>", ")", ")", ")", "\n", "}" ]
14,285
all-14286
[ "WriteDeflateLevel", "writes", "deflated", "p", "to", "w", "using", "the", "given", "compression", "level", "and", "returns", "the", "number", "of", "compressed", "bytes", "written", "to", "w", ".", "Supported", "compression", "levels", "are", ":", "*", "CompressNoCompression", "*", "CompressBestSpeed", "*", "CompressBestCompression", "*", "CompressDefaultCompression", "*", "CompressHuffmanOnly" ]
[ "func", "WriteDeflateLevel", "(", "w", "io", ".", "Writer", ",", "p", "[", "]", "byte", ",", "level", "int", ")", "(", "int", ",", "error", ")", "{", "switch", "w", ".", "(", "type", ")", "{", "<mask>", "*", "byteSliceWriter", ",", "*", "bytes", ".", "Buffer", ",", "*", "bytebufferpool", ".", "ByteBuffer", ":", "// These writers don't block, so we can just use stacklessWriteDeflate", "ctx", ":=", "&", "compressCtx", "{", "w", ":", "w", ",", "p", ":", "p", ",", "level", ":", "level", ",", "}", "\n", "stacklessWriteDeflate", "(", "ctx", ")", "\n", "return", "len", "(", "p", ")", ",", "nil", "\n", "default", ":", "zw", ":=", "acquireStacklessDeflateWriter", "(", "w", ",", "level", ")", "\n", "n", ",", "err", ":=", "zw", ".", "Write", "(", "p", ")", "\n", "releaseStacklessDeflateWriter", "(", "zw", ",", "level", ")", "\n", "return", "n", ",", "err", "\n", "}", "\n", "}" ]
14,286
all-14287
[ "validateAndOverrideBounds", "performs", "validation", "over", "members", "of", "the", "Config", "struct", "and", "check", "the", "value", "against", "the", "minimum", "required", "value", "." ]
[ "func", "(", "cfg", "*", "Config", ")", "validateAndOverrideBounds", "(", ")", "error", "{", "err", ":=", "cfg", ".", "checkMissingAndDepreciated", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "if", "cfg", ".", "DockerStopTimeout", "<", "minimumDockerStopTimeout", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "cfg", ".", "DockerStopTimeout", ".", "String", "(", ")", ")", "\n", "}", "\n\n", "if", "cfg", ".", "ContainerStartTimeout", "<", "minimumContainerStartTimeout", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "cfg", ".", "ContainerStartTimeout", ".", "String", "(", ")", ")", "\n", "}", "\n", "var", "badDrivers", "[", "]", "string", "\n", "for", "_", ",", "driver", ":=", "range", "cfg", ".", "AvailableLoggingDrivers", "{", "_", ",", "ok", ":=", "dockerclient", ".", "LoggingDriverMinimumVersion", "[", "<mask>", "]", "\n", "if", "!", "ok", "{", "badDrivers", "=", "append", "(", "badDrivers", ",", "string", "(", "driver", ")", ")", "\n", "}", "\n", "}", "\n", "if", "len", "(", "badDrivers", ")", ">", "0", "{", "return", "errors", ".", "New", "(", "\"", "\"", "+", "strings", ".", "Join", "(", "badDrivers", ",", "\"", "\"", ")", ")", "\n", "}", "\n\n", "// If a value has been set for taskCleanupWaitDuration and the value is less than the minimum allowed cleanup duration,", "// print a warning and override it", "if", "cfg", ".", "TaskCleanupWaitDuration", "<", "minimumTaskCleanupWaitDuration", "{", "seelog", ".", "Warnf", "(", "\"", "\"", ",", "DefaultTaskCleanupWaitDuration", ".", "String", "(", ")", ",", "cfg", ".", "TaskCleanupWaitDuration", ",", "minimumTaskCleanupWaitDuration", ")", "\n", "cfg", ".", "TaskCleanupWaitDuration", "=", "DefaultTaskCleanupWaitDuration", "\n", "}", "\n\n", "if", "cfg", ".", "ImagePullInactivityTimeout", "<", "minimumImagePullInactivityTimeout", "{", "seelog", ".", "Warnf", "(", "\"", "\"", ",", "defaultImagePullInactivityTimeout", ".", "String", "(", ")", ",", "cfg", ".", "ImagePullInactivityTimeout", ",", "minimumImagePullInactivityTimeout", ")", "\n", "cfg", ".", "ImagePullInactivityTimeout", "=", "defaultImagePullInactivityTimeout", "\n", "}", "\n\n", "if", "cfg", ".", "ImageCleanupInterval", "<", "minimumImageCleanupInterval", "{", "seelog", ".", "Warnf", "(", "\"", "\"", ",", "DefaultImageCleanupTimeInterval", ".", "String", "(", ")", ",", "cfg", ".", "ImageCleanupInterval", ",", "minimumImageCleanupInterval", ")", "\n", "cfg", ".", "ImageCleanupInterval", "=", "DefaultImageCleanupTimeInterval", "\n", "}", "\n\n", "if", "cfg", ".", "NumImagesToDeletePerCycle", "<", "minimumNumImagesToDeletePerCycle", "{", "seelog", ".", "Warnf", "(", "\"", "\"", ",", "DefaultImageDeletionAge", ",", "cfg", ".", "NumImagesToDeletePerCycle", ",", "minimumNumImagesToDeletePerCycle", ")", "\n", "cfg", ".", "NumImagesToDeletePerCycle", "=", "DefaultNumImagesToDeletePerCycle", "\n", "}", "\n\n", "if", "cfg", ".", "TaskMetadataSteadyStateRate", "<=", "0", "||", "cfg", ".", "TaskMetadataBurstRate", "<=", "0", "{", "seelog", ".", "Warnf", "(", "\"", "\"", ",", "DefaultTaskMetadataSteadyStateRate", ",", "DefaultTaskMetadataBurstRate", ")", "\n", "cfg", ".", "TaskMetadataSteadyStateRate", "=", "DefaultTaskMetadataSteadyStateRate", "\n", "cfg", ".", "TaskMetadataBurstRate", "=", "DefaultTaskMetadataBurstRate", "\n", "}", "\n\n", "// check the PollMetrics specific configurations", "cfg", ".", "pollMetricsOverrides", "(", ")", "\n\n", "cfg", ".", "platformOverrides", "(", ")", "\n\n", "return", "nil", "\n", "}" ]
14,287
all-14288
[ "Create", "takes", "the", "representation", "of", "a", "app", "and", "creates", "it", ".", "Returns", "the", "server", "s", "representation", "of", "the", "app", "and", "an", "error", "if", "there", "is", "any", "." ]
[ "func", "(", "c", "*", "apps", ")", "Create", "(", "app", "*", "v1", ".", "App", ")", "(", "result", "*", "v1", ".", "App", ",", "err", "error", ")", "{", "result", "=", "&", "v1", ".", "App", "{", "}", "\n", "err", "=", "c", ".", "client", ".", "Post", "(", ")", ".", "Namespace", "(", "c", ".", "ns", ")", ".", "Resource", "(", "\"", "\"", ")", ".", "Body", "(", "app", ")", ".", "Do", "(", ")", ".", "Into", "(", "<mask>", ")", "\n", "return", "\n", "}" ]
14,288
all-14289
[ "WriteHeader", "sets", "the", "context", "s", "written", "flag", "before", "writing", "the", "response", "header", "." ]
[ "func", "(", "w", "contextWriter", ")", "WriteHeader", "(", "<mask>", "int", ")", "{", "w", ".", "context", ".", "written", "=", "true", "\n", "w", ".", "ResponseWriter", ".", "WriteHeader", "(", "code", ")", "\n", "}" ]
14,289
all-14290
[ "Format", "formats", "the", "build", "file", "in", "a", "form", "that", "can", "be", "written", "to", "disk", ".", "This", "method", "calls", "Sync", "internally", "." ]
[ "func", "(", "f", "*", "File", ")", "Format", "(", ")", "[", "]", "byte", "{", "f", ".", "Sync", "(", ")", "\n", "return", "bzl", ".", "Format", "(", "f", ".", "<mask>", ")", "\n", "}" ]
14,290
all-14291
[ "MakeRenderPipelineState", "creates", "a", "render", "pipeline", "state", "object", ".", "Reference", ":", "https", ":", "//", "developer", ".", "apple", ".", "com", "/", "documentation", "/", "metal", "/", "mtldevice", "/", "1433369", "-", "makerenderpipelinestate", "." ]
[ "func", "(", "d", "Device", ")", "MakeRenderPipelineState", "(", "rpd", "RenderPipelineDescriptor", ")", "(", "RenderPipelineState", ",", "error", ")", "{", "blendingEnabled", ":=", "C", ".", "BOOL", "(", "0", ")", "\n", "if", "rpd", ".", "ColorAttachments", "[", "0", "]", ".", "BlendingEnabled", "{", "blendingEnabled", "=", "C", ".", "BOOL", "(", "1", ")", "\n", "}", "\n", "c", ":=", "&", "rpd", ".", "ColorAttachments", "[", "0", "]", "\n", "descriptor", ":=", "C", ".", "struct_RenderPipelineDescriptor", "{", "VertexFunction", ":", "rpd", ".", "VertexFunction", ".", "<mask>", ",", "FragmentFunction", ":", "rpd", ".", "FragmentFunction", ".", "function", ",", "ColorAttachment0PixelFormat", ":", "C", ".", "uint16_t", "(", "c", ".", "PixelFormat", ")", ",", "ColorAttachment0BlendingEnabled", ":", "C", ".", "BOOL", "(", "blendingEnabled", ")", ",", "ColorAttachment0DestinationAlphaBlendFactor", ":", "C", ".", "uint8_t", "(", "c", ".", "DestinationAlphaBlendFactor", ")", ",", "ColorAttachment0DestinationRGBBlendFactor", ":", "C", ".", "uint8_t", "(", "c", ".", "DestinationRGBBlendFactor", ")", ",", "ColorAttachment0SourceAlphaBlendFactor", ":", "C", ".", "uint8_t", "(", "c", ".", "SourceAlphaBlendFactor", ")", ",", "ColorAttachment0SourceRGBBlendFactor", ":", "C", ".", "uint8_t", "(", "c", ".", "SourceRGBBlendFactor", ")", ",", "}", "\n", "rps", ":=", "C", ".", "Device_MakeRenderPipelineState", "(", "d", ".", "device", ",", "descriptor", ")", "\n", "if", "rps", ".", "RenderPipelineState", "==", "nil", "{", "return", "RenderPipelineState", "{", "}", ",", "errors", ".", "New", "(", "C", ".", "GoString", "(", "rps", ".", "Error", ")", ")", "\n", "}", "\n\n", "return", "RenderPipelineState", "{", "rps", ".", "RenderPipelineState", "}", ",", "nil", "\n", "}" ]
14,291
all-14292
[ "Register", "injects", "the", "mesh", ".", "Gossip", "and", "enables", "full", "-", "duplex", "communication", ".", "Clients", "should", "consume", "from", "ReadFrom", "without", "blocking", "." ]
[ "func", "(", "p", "*", "Peer", ")", "Register", "(", "gossip", "mesh", ".", "Gossip", ")", "{", "p", ".", "<mask>", "<-", "func", "(", ")", "{", "p", ".", "gossip", "=", "gossip", "}", "\n", "}" ]
14,292
all-14293
[ "validateChangeBatch", "validates", "that", "the", "changes", "passed", "to", "InMemory", "DNS", "provider", "is", "valid" ]
[ "func", "(", "c", "*", "inMemoryClient", ")", "validateChangeBatch", "(", "zone", "string", ",", "changes", "*", "inMemoryChange", ")", "error", "{", "curZone", ",", "ok", ":=", "c", ".", "zones", "[", "zone", "]", "\n", "if", "!", "ok", "{", "return", "ErrZoneNotFound", "\n", "}", "\n", "mesh", ":=", "<mask>", "[", "string", "]", "map", "[", "string", "]", "bool", "{", "}", "\n", "for", "_", ",", "newEndpoint", ":=", "range", "changes", ".", "Create", "{", "if", "c", ".", "findByType", "(", "newEndpoint", ".", "Type", ",", "curZone", "[", "newEndpoint", ".", "Name", "]", ")", "!=", "nil", "{", "return", "ErrRecordAlreadyExists", "\n", "}", "\n", "if", "err", ":=", "c", ".", "updateMesh", "(", "mesh", ",", "newEndpoint", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "}", "\n", "for", "_", ",", "updateEndpoint", ":=", "range", "changes", ".", "UpdateNew", "{", "if", "c", ".", "findByType", "(", "updateEndpoint", ".", "Type", ",", "curZone", "[", "updateEndpoint", ".", "Name", "]", ")", "==", "nil", "{", "return", "ErrRecordNotFound", "\n", "}", "\n", "if", "err", ":=", "c", ".", "updateMesh", "(", "mesh", ",", "updateEndpoint", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "}", "\n", "for", "_", ",", "updateOldEndpoint", ":=", "range", "changes", ".", "UpdateOld", "{", "if", "rec", ":=", "c", ".", "findByType", "(", "updateOldEndpoint", ".", "Type", ",", "curZone", "[", "updateOldEndpoint", ".", "Name", "]", ")", ";", "rec", "==", "nil", "||", "rec", ".", "Target", "!=", "updateOldEndpoint", ".", "Target", "{", "return", "ErrRecordNotFound", "\n", "}", "\n", "}", "\n", "for", "_", ",", "deleteEndpoint", ":=", "range", "changes", ".", "Delete", "{", "if", "rec", ":=", "c", ".", "findByType", "(", "deleteEndpoint", ".", "Type", ",", "curZone", "[", "deleteEndpoint", ".", "Name", "]", ")", ";", "rec", "==", "nil", "||", "rec", ".", "Target", "!=", "deleteEndpoint", ".", "Target", "{", "return", "ErrRecordNotFound", "\n", "}", "\n", "if", "err", ":=", "c", ".", "updateMesh", "(", "mesh", ",", "deleteEndpoint", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "}", "\n", "return", "nil", "\n", "}" ]
14,293
all-14294
[ "buildLinkToRecord", "build", "a", "resource", "link", ".", "The", "symmetry", "of", "the", "dyn", "API", "is", "used", "to", "save", "switch", "-", "case", "boilerplate", ".", "Empty", "response", "means", "the", "endpoint", "is", "not", "mappable", "to", "a", "records", "link", ":", "either", "because", "the", "fqdn", "is", "not", "matched", "by", "the", "domainFilter", "or", "it", "is", "in", "the", "wrong", "zone" ]
[ "func", "(", "d", "*", "dynProviderState", ")", "buildLinkToRecord", "(", "ep", "*", "endpoint", ".", "Endpoint", ")", "string", "{", "if", "ep", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "var", "matchingZone", "=", "\"", "\"", "\n", "for", "_", ",", "zone", ":=", "range", "d", ".", "ZoneIDFilter", ".", "zoneIDs", "{", "if", "strings", ".", "HasSuffix", "(", "ep", ".", "DNSName", ",", "zone", ")", "{", "matchingZone", "=", "zone", "\n", "<mask>", "\n", "}", "\n", "}", "\n\n", "if", "matchingZone", "==", "\"", "\"", "{", "// no matching zone, ignore", "return", "\"", "\"", "\n", "}", "\n\n", "if", "!", "d", ".", "DomainFilter", ".", "Match", "(", "ep", ".", "DNSName", ")", "{", "// no matching domain, ignore", "return", "\"", "\"", "\n", "}", "\n\n", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "ep", ".", "RecordType", ",", "matchingZone", ",", "ep", ".", "DNSName", ")", "\n", "}" ]
14,294
all-14295
[ "These", "are", "the", "only", "actions", "indicating", "the", "code", "diffs", "may", "have", "changed", "." ]
[ "func", "isPRChanged", "(", "pe", "github", ".", "PullRequestEvent", ")", "bool", "{", "switch", "pe", ".", "<mask>", "{", "case", "github", ".", "PullRequestActionOpened", ":", "return", "true", "\n", "case", "github", ".", "PullRequestActionReopened", ":", "return", "true", "\n", "case", "github", ".", "PullRequestActionSynchronize", ":", "return", "true", "\n", "case", "github", ".", "PullRequestActionEdited", ":", "return", "true", "\n", "default", ":", "return", "false", "\n", "}", "\n", "}" ]
14,295
all-14296
[ "SetIconFromFile", "is", "a", "wrapper", "around", "gtk_window_set_icon_from_file", "()", "." ]
[ "func", "(", "v", "*", "Window", ")", "SetIconFromFile", "(", "file", "string", ")", "error", "{", "cstr", ":=", "C", ".", "CString", "(", "file", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "cstr", ")", ")", "\n", "var", "err", "*", "C", ".", "GError", "=", "nil", "\n", "res", ":=", "C", ".", "gtk_window_set_icon_from_file", "(", "v", ".", "native", "(", ")", ",", "(", "*", "C", ".", "gchar", ")", "(", "cstr", ")", ",", "&", "err", ")", "\n", "if", "<mask>", "==", "0", "{", "defer", "C", ".", "g_error_free", "(", "err", ")", "\n", "return", "errors", ".", "New", "(", "C", ".", "GoString", "(", "(", "*", "C", ".", "char", ")", "(", "err", ".", "message", ")", ")", ")", "\n", "}", "\n", "return", "nil", "\n", "}" ]
14,296
all-14297
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "CollectClassNamesFromSubtreeParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "<mask>", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoDom77", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
14,297
all-14298
[ "ParseURL", "parses", "an", "URL", "into", "ObjectStoreURL", "." ]
[ "func", "ParseURL", "(", "urlStr", "string", ")", "(", "*", "ObjectStoreURL", ",", "error", ")", "{", "url", ",", "err", ":=", "url", ".", "Parse", "(", "urlStr", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "urlStr", ",", "err", ")", "\n", "}", "\n", "switch", "url", ".", "Scheme", "{", "case", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ":", "return", "&", "ObjectStoreURL", "{", "Store", ":", "url", ".", "Scheme", ",", "Bucket", ":", "url", ".", "Host", ",", "Object", ":", "strings", ".", "Trim", "(", "url", ".", "Path", ",", "\"", "\"", ")", ",", "}", ",", "nil", "\n", "case", "\"", "\"", ",", "\"", "\"", ":", "// In Azure, the first part of the path is the container name.", "parts", ":=", "strings", ".", "Split", "(", "strings", ".", "Trim", "(", "url", ".", "Path", ",", "\"", "\"", ")", ",", "\"", "\"", ")", "\n", "if", "len", "(", "parts", ")", "<", "1", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "urlStr", ")", "\n", "}", "\n", "return", "&", "ObjectStoreURL", "{", "<mask>", ":", "url", ".", "Scheme", ",", "Bucket", ":", "parts", "[", "0", "]", ",", "Object", ":", "strings", ".", "Trim", "(", "path", ".", "Join", "(", "parts", "[", "1", ":", "]", "...", ")", ",", "\"", "\"", ")", ",", "}", ",", "nil", "\n", "}", "\n", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "url", ".", "Scheme", ")", "\n", "}" ]
14,298
all-14299
[ "SyncProjects", "updates", "the", "list", "of", "projects", "in", "RBAC" ]
[ "func", "(", "r", "*", "Server", ")", "SyncProjects", "(", ")", "error", "{", "if", "r", ".", "ProjectsFunc", "==", "nil", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "}", "\n\n", "resources", ":=", "[", "]", "rbacResource", "{", "}", "\n", "resourcesMap", ":=", "map", "[", "string", "]", "string", "{", "}", "\n\n", "// Get all projects", "projects", ",", "err", ":=", "r", ".", "ProjectsFunc", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "// Convert to RBAC format", "for", "id", ",", "name", ":=", "range", "projects", "{", "resources", "=", "append", "(", "resources", ",", "rbacResource", "{", "Name", ":", "<mask>", ",", "Identifier", ":", "strconv", ".", "FormatInt", "(", "id", ",", "10", ")", ",", "}", ")", "\n\n", "resourcesMap", "[", "name", "]", "=", "strconv", ".", "FormatInt", "(", "id", ",", "10", ")", "\n", "}", "\n\n", "// Update RBAC", "err", "=", "r", ".", "postResources", "(", "resources", ",", "nil", ",", "true", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "// Update project map", "r", ".", "resourcesLock", ".", "Lock", "(", ")", "\n", "r", ".", "resources", "=", "resourcesMap", "\n", "r", ".", "resourcesLock", ".", "Unlock", "(", ")", "\n\n", "return", "nil", "\n", "}" ]
14,299
all-14300
[ "/", "*", "Contents", "returns", "all", "data", "ever", "written", "to", "the", "buffer", "." ]
[ "func", "(", "b", "*", "Buffer", ")", "Contents", "(", ")", "[", "]", "byte", "{", "b", ".", "<mask>", ".", "Lock", "(", ")", "\n", "defer", "b", ".", "lock", ".", "Unlock", "(", ")", "\n\n", "contents", ":=", "make", "(", "[", "]", "byte", ",", "len", "(", "b", ".", "contents", ")", ")", "\n", "copy", "(", "contents", ",", "b", ".", "contents", ")", "\n", "return", "contents", "\n", "}" ]