id
int32
0
25.3k
idx
stringlengths
5
9
nl_tokens
listlengths
1
418
pl_tokens
listlengths
22
4.98k
2,700
all-2701
[ "Equal", "returns", "whether", "two", "keys", "are", "equal", "." ]
[ "func", "(", "k", "*", "Key", ")", "Equal", "(", "o", "*", "Key", ")", "bool", "{", "for", "k", "!=", "nil", "&&", "o", "!=", "nil", "{", "if", "k", ".", "kind", "!=", "o", ".", "kind", "||", "k", ".", "stringID", "!=", "o", ".", "stringID"...
2,701
all-2702
[ "creates", "and", "initializes", "a", "buffer", "object", "s", "immutable", "data", "store" ]
[ "func", "NamedBufferStorage", "(", "<mask>", "uint32", ",", "size", "int", ",", "data", "unsafe", ".", "Pointer", ",", "flags", "uint32", ")", "{", "syscall", ".", "Syscall6", "(", "gpNamedBufferStorage", ",", "4", ",", "uintptr", "(", "buffer", ")", ",", ...
2,702
all-2703
[ "List", "all", "articles" ]
[ "func", "List", "(", "c", "*", "gin", ".", "Context", ")", "{", "db", ":=", "c", ".", "MustGet", "(", "\"", "\"", ")", ".", "(", "*", "mgo", ".", "<mask>", ")", "\n", "articles", ":=", "[", "]", "models", ".", "Article", "{", "}", "\n", "err"...
2,703
all-2704
[ "Watch", "returns", "a", "watch", ".", "Interface", "that", "watches", "the", "requested", "prowJobs", "." ]
[ "func", "(", "c", "*", "FakeProwJobs", ")", "Watch", "(", "opts", "v1", ".", "ListOptions", ")", "(", "<mask>", ".", "Interface", ",", "error", ")", "{", "return", "c", ".", "Fake", ".", "InvokesWatch", "(", "testing", ".", "NewWatchAction", "(", "prow...
2,704
all-2705
[ "TargetsActive", "returns", "the", "active", "targets", "currently", "being", "scraped", "." ]
[ "func", "(", "m", "*", "Manager", ")", "TargetsActive", "(", ")", "map", "[", "string", "]", "[", "]", "*", "Target", "{", "m", ".", "mtxScrape", ".", "Lock", "(", ")", "\n", "defer", "m", ".", "mtxScrape", ".", "Unlock", "(", ")", "\n\n", "targe...
2,705
all-2706
[ "DeepCopy", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "Pull", "." ]
[ "func", "(", "in", "*", "Pull", ")", "DeepCopy", "(", ")", "*", "Pull", "{", "if", "<mask>", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "Pull", ")", "\n", "in", ".", "DeepCopyInto", "(", "out", ")", "\n", "retu...
2,706
all-2707
[ "createCluster", "causes", "gcloud", "to", "create", "a", "cluster", "in", "project", "returning", "the", "context", "name" ]
[ "func", "createCluster", "(", "proj", ",", "choice", "string", ")", "(", "*", "cluster", ",", "error", ")", "{", "const", "def", "=", "\"", "\"", "\n", "if", "choice", "==", "\"", "\"", "{", "fmt", ".", "Printf", "(", "\"", "\"", ",", "def", ")",...
2,707
all-2708
[ "strings", "with", "one", "byte", "length" ]
[ "func", "readShortUtf8", "(", "rd", "*", "bufio", ".", "Reader", ")", "(", "[", "]", "byte", ",", "int", ")", "{", "size", ":=", "rd", ".", "ReadB", "(", ")", "\n", "b", ":=", "rd", ".", "ReadCesu8", "(", "int", "(", "<mask>", ")", ")", "\n", ...
2,708
all-2709
[ "threadsafe", "list", "of", "peers", "." ]
[ "func", "(", "ps", "*", "PeerSet", ")", "List", "(", ")", "[", "]", "*", "Peer", "{", "ps", ".", "mtx", ".", "Lock", "(", ")", "\n", "defer", "ps", ".", "mtx", ".", "Unlock", "(", ")", "\n", "return", "ps", ".", "<mask>", "\n", "}" ]
2,709
all-2710
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "SetBlockedURLSParams", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "<mask>", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoNetwork18", "(", "&"...
2,710
all-2711
[ "Declaration", "returns", "the", "declaration", "for", "this", "field", "." ]
[ "func", "(", "a", "*", "<mask>", ")", "Declaration", "(", ")", "string", "{", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "a", ".", "Name", "(", ")", ",", "a", ".", "ArgType", "(", ")", ")", "\n", "}" ]
2,711
all-2712
[ "LayerInfosForCopy", "returns", "an", "updated", "set", "of", "layer", "blob", "information", "which", "may", "not", "match", "the", "manifest", ".", "The", "Digest", "field", "is", "guaranteed", "to", "be", "provided", ";", "Size", "may", "be", "-", "1", ...
[ "func", "(", "i", "*", "memoryImage", ")", "LayerInfosForCopy", "(", "ctx", "<mask>", ".", "Context", ")", "(", "[", "]", "types", ".", "BlobInfo", ",", "error", ")", "{", "return", "nil", ",", "nil", "\n", "}" ]
2,712
all-2713
[ "Disconnect", "close", "current", "connection" ]
[ "func", "(", "c", "*", "<mask>", ")", "Disconnect", "(", ")", "error", "{", "if", "!", "c", ".", "connActive", ".", "get", "(", ")", "{", "return", "ErrConnectionIsNotOpen", "\n", "}", "\n\n", "c", ".", "userDisconnect", ".", "Close", "(", ")", "\n\n...
2,713
all-2714
[ "AddTaskIPAddress", "adds", "ip", "adddress", "for", "a", "task", "arn", "into", "the", "state" ]
[ "func", "(", "state", "*", "DockerTaskEngineState", ")", "AddTaskIPAddress", "(", "addr", "string", ",", "taskARN", "string", ")", "{", "<mask>", ".", "lock", ".", "Lock", "(", ")", "\n", "defer", "state", ".", "lock", ".", "Unlock", "(", ")", "\n\n", ...
2,714
all-2715
[ "NewMockCNI", "creates", "a", "new", "mock", "instance" ]
[ "func", "NewMockCNI", "(", "ctrl", "*", "gomock", ".", "<mask>", ")", "*", "MockCNI", "{", "mock", ":=", "&", "MockCNI", "{", "ctrl", ":", "ctrl", "}", "\n", "mock", ".", "recorder", "=", "&", "MockCNIMockRecorder", "{", "mock", "}", "\n", "return", ...
2,715
all-2716
[ "isLabel", "reports", "whether", "the", "string", "can", "be", "used", "as", "label", "." ]
[ "func", "isLabel", "(", "s", "string", ")", "bool", "{", "if", "len", "(", "s", ")", "==", "0", "||", "!", "isAlpha", "(", "rune", "(", "s", "[", "0", "]", ")", ")", "{", "return", "false", "\n", "}", "\n", "for", "_", ",", "c", ":=", "rang...
2,716
all-2717
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "GetMetricsReturns", ")", "UnmarshalJSON", "(", "<mask>", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformance2", "(", "&"...
2,717
all-2718
[ "Support", "migrating", "single", "string", "Driver", "fields", "to", "slices", "." ]
[ "func", "migrateStringToSlice", "(", "value", "string", ",", "values", "[", "]", "string", ")", "(", "<mask>", "[", "]", "string", ")", "{", "if", "value", "!=", "\"", "\"", "{", "result", "=", "append", "(", "result", ",", "value", ")", "\n", "}", ...
2,718
all-2719
[ "Set", "sets", "the", "value", "by", "key", "and", "associates", "it", "with", "the", "current", "goroutine", "." ]
[ "func", "Set", "(", "key", "string", ",", "<mask>", "interface", "{", "}", ")", "{", "gid", ":=", "curGoroutineID", "(", ")", "\n", "dataLock", ".", "Lock", "(", ")", "\n", "if", "data", "[", "gid", "]", "==", "nil", "{", "data", "[", "gid", "]",...
2,719
all-2720
[ "UnmarshalJSON", "deserialises", "the", "raw", "JSON", "to", "a", "ASMAuthResource", "struct" ]
[ "func", "(", "auth", "*", "ASMAuthResource", ")", "UnmarshalJSON", "(", "b", "[", "]", "byte", ")", "error", "{", "temp", ":=", "asmAuthResourceJSON", "{", "}", "\n\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "temp", ")", ";"...
2,720
all-2721
[ "Log", "calls", "UI", ".", "Log", "to", "write", ".", "This", "is", "a", "thread", "safe", "function", "." ]
[ "func", "(", "ui", "*", "ConcurrentUI", ")", "<mask>", "(", "message", "string", ")", "{", "ui", ".", "l", ".", "Lock", "(", ")", "\n", "defer", "ui", ".", "l", ".", "Unlock", "(", ")", "\n", "ui", ".", "UI", ".", "Log", "(", "message", ")", ...
2,721
all-2722
[ "Get", "provides", "a", "mock", "function", "with", "given", "fields", ":", "_a0", "_a1" ]
[ "func", "(", "_m", "*", "InstrumentedStorage", ")", "Get", "(", "_a0", "context", ".", "Context", ",", "_a1", "string", ")", "(", "*", "mnemosynerpc", ".", "Session", ",", "error", ")", "{", "ret", ":=", "_m", ".", "Called", "(", "_a0", ",", "_a1", ...
2,722
all-2723
[ "HaveURL", "passes", "when", "the", "expected", "URL", "is", "equivalent", "to", "the", "current", "URL", "of", "the", "provided", "page", "." ]
[ "func", "HaveURL", "(", "url", "string", ")", "types", ".", "GomegaMatcher", "{", "return", "&", "<mask>", ".", "ValueMatcher", "{", "Method", ":", "\"", "\"", ",", "Property", ":", "\"", "\"", ",", "Expected", ":", "url", "}", "\n", "}" ]
2,723
all-2724
[ "This", "is", "run", "at", "init", "time", "only", "." ]
[ "func", "escapedPathExp", "(", "pathExp", "string", ")", "(", "string", ",", "error", ")", "{", "// PathExp validation", "if", "pathExp", "==", "\"", "\"", "{", "return", "\"", "\"", ",", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n", "...
2,724
all-2725
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "GetWindowBoundsParams", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "<mask>", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser8", "(", "&"...
2,725
all-2726
[ "NewManager", "creates", "a", "metadataManager", "for", "a", "given", "DockerTaskEngine", "settings", "." ]
[ "func", "NewManager", "(", "<mask>", "DockerMetadataClient", ",", "cfg", "*", "config", ".", "Config", ")", "Manager", "{", "return", "&", "metadataManager", "{", "client", ":", "client", ",", "cluster", ":", "cfg", ".", "Cluster", ",", "dataDir", ":", "cf...
2,726
all-2727
[ "parse", "takes", "a", "file", "sequence", "pattern", "and", "returns", "the", "parsed", "data", "as", "a", "Result" ]
[ "func", "parse", "(", "pattern", "string", ",", "opts", "*", "OptionsType", ")", "*", "Result", "{", "res", ":=", "&", "Result", "{", "String", ":", "pattern", ",", "origString", ":", "pattern", "}", "\n\n", "padStyle", ":=", "fileseq", ".", "PadStyleHas...
2,727
all-2728
[ "SetCursorVisible", "is", "a", "wrapper", "around", "gtk_text_view_set_cursor_visible", "()", "." ]
[ "func", "(", "v", "*", "TextView", ")", "SetCursorVisible", "(", "<mask>", "bool", ")", "{", "C", ".", "gtk_text_view_set_cursor_visible", "(", "v", ".", "native", "(", ")", ",", "gbool", "(", "visible", ")", ")", "\n", "}" ]
2,728
all-2729
[ "decode", "accepts", "an", "ogg", "stream", "and", "returns", "a", "decorded", "stream", "." ]
[ "func", "decode", "(", "in", "audio", ".", "ReadSeekCloser", ")", "(", "*", "decoded", ",", "int", ",", "int", ",", "error", ")", "{", "r", ",", "err", ":=", "newDecoder", "(", "in", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",",...
2,729
all-2730
[ "Uint16SliceToStringSlice", "converts", "a", "slice", "of", "type", "uint16", "to", "a", "slice", "of", "type", "*", "string", ".", "It", "uses", "strconv", ".", "Itoa", "on", "each", "element" ]
[ "func", "Uint16SliceToStringSlice", "(", "slice", "[", "]", "uint16", ")", "[", "]", "*", "string", "{", "stringSlice", ":=", "make", "(", "[", "]", "*", "string", ",", "len", "(", "slice", ")", ")", "\n", "for", "i", ",", "el", ":=", "<mask>", "sl...
2,730
all-2731
[ "HasName", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "m", "*", "Monitor", ")", "HasName", "(", ")", "bool", "{", "if", "m", "!=", "nil", "&&", "m", ".", "Name", "!=", "nil", "{", "return", "<mask>", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
2,731
all-2732
[ "SaveVimClient", "saves", "a", "client", "to", "the", "supplied", "path", ".", "This", "facilitates", "re", "-", "use", "of", "the", "session", "at", "a", "later", "date", ".", "Note", "the", "logic", "in", "this", "function", "has", "been", "largely", "...
[ "func", "(", "c", "*", "Config", ")", "SaveVimClient", "(", "<mask>", "*", "govmomi", ".", "Client", ")", "error", "{", "if", "!", "c", ".", "Persist", "{", "return", "nil", "\n", "}", "\n\n", "p", ",", "err", ":=", "c", ".", "vimSessionFile", "(",...
2,732
all-2733
[ "cancel", "indicates", "that", "an", "error", "has", "occurred", "which", "will", "prevent", "any", "further", "calls", "to", "Write", "it", "causes", "all", "calls", "to", "wait", "()", "to", "return" ]
[ "func", "(", "c", "*", "<mask>", ")", "cancel", "(", ")", "{", "c", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "c", ".", "mu", ".", "Unlock", "(", ")", "\n", "c", ".", "n", "=", "math", ".", "MaxInt64", "\n", "}" ]
2,733
all-2734
[ "RootSnapshot", "returns", "a", "root", "Snapshot", "instance", "belonging", "to", "the", "current", "virtual", "machine", ".", "Parameters", ":", "index", ":", "Identifies", "a", "root", "snapshot", ".", "See", "below", "for", "range", "of", "values", ".", ...
[ "func", "(", "v", "*", "VM", ")", "RootSnapshot", "(", "index", "int", ")", "(", "*", "Snapshot", ",", "error", ")", "{", "var", "snapshotHandle", "C", ".", "VixHandle", "=", "C", ".", "VIX_INVALID_HANDLE", "\n", "<mask>", "err", "C", ".", "VixError", ...
2,734
all-2735
[ "Open", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockFileSystem", ")", "Open", "(", "arg0", "string", ")", "(", "io", ".", "ReadWriteCloser", ",", "error", ")", "{", "ret", ":=", "m", ".", "ctrl", ".", "Call", "(", "m", ",", "\"", "\"", ",", "arg0", ")", "\n", "ret0", ...
2,735
all-2736
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "GetHistogramParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser14", "(", "&", "w", ",", "v", ")...
2,736
all-2737
[ "Validate", "validates", "GitHub", "options", "." ]
[ "func", "(", "o", "*", "GitHubOptions", ")", "Validate", "(", "dryRun", "bool", ")", "error", "{", "for", "_", ",", "uri", ":=", "range", "o", ".", "endpoint", ".", "Strings", "(", ")", "{", "if", "uri", "==", "\"", "\"", "{", "uri", "=", "github...
2,737
all-2738
[ "Retrieves", "the", "GObject", "instance", "used", "as", "the", "target", "of", "the", "binding", "." ]
[ "func", "(", "v", "*", "Binding", ")", "GetTarget", "(", ")", "*", "<mask>", "{", "obj", ":=", "C", ".", "g_binding_get_target", "(", "v", ".", "native", "(", ")", ")", "\n", "if", "obj", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "retur...
2,738
all-2739
[ "Do", "executes", "DOMSnapshot", ".", "captureSnapshot", "against", "the", "provided", "context", ".", "returns", ":", "documents", "-", "The", "nodes", "in", "the", "DOM", "tree", ".", "The", "DOMNode", "at", "index", "0", "corresponds", "to", "the", "root"...
[ "func", "(", "p", "*", "CaptureSnapshotParams", ")", "Do", "(", "ctx", "context", ".", "Context", ")", "(", "documents", "[", "]", "*", "DocumentSnapshot", ",", "strings", "[", "]", "string", ",", "err", "error", ")", "{", "// execute", "var", "<mask>", ...
2,739
all-2740
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "GetCookiesReturns", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoNetwork34", "(", "&", "w", ",", "v", ")"...
2,740
all-2741
[ "SetTitle", "is", "a", "wrapper", "around", "gtk_status_icon_set_title", "()" ]
[ "func", "(", "v", "*", "StatusIcon", ")", "SetTitle", "(", "<mask>", "string", ")", "{", "cstr", ":=", "C", ".", "CString", "(", "title", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "cstr", ")", ")", "\n", "C", ".", ...
2,741
all-2742
[ "parseMultiPartBody", "parses", "a", "multipart", "message", "in", "root", ".", "The", "result", "is", "placed", "in", "e", "." ]
[ "func", "parseMultiPartBody", "(", "root", "*", "Part", ",", "e", "*", "Envelope", ")", "error", "{", "// Parse top-level multipart", "ctype", ":=", "root", ".", "Header", ".", "Get", "(", "hnContentType", ")", "\n", "mediatype", ",", "params", ",", "_", "...
2,742
all-2743
[ "GetURI", "is", "a", "wrapper", "around", "gtk_file_chooser_get_uri", "()", "." ]
[ "func", "(", "v", "*", "FileChooser", ")", "GetURI", "(", ")", "string", "{", "c", ":=", "C", ".", "gtk_file_chooser_get_uri", "(", "v", ".", "native", "(", ")", ")", "\n", "s", ":=", "goString", "(", "c", ")", "\n", "defer", "C", ".", "g_free", ...
2,743
all-2744
[ "Log", "indicates", "an", "expected", "call", "of", "Log" ]
[ "func", "(", "mr", "*", "MockAuditLoggerMockRecorder", ")", "Log", "(", "arg0", ",", "arg1", ",", "arg2", "interface", "{", "}", ")", "*", "gomock", ".", "Call", "{", "return", "mr", ".", "mock", ".", "ctrl", ".", "RecordCallWithMethodType", "(", "mr", ...
2,744
all-2745
[ "GetClientIDOk", "returns", "a", "tuple", "with", "the", "ClientID", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "i", "*", "IntegrationGCPCreateRequest", ")", "GetClientIDOk", "(", ")", "(", "string", ",", "bool", ")", "{", "if", "i", "==", "nil", "||", "i", ".", "ClientID", "==", "nil", "{", "return", "\"", "\"", ",", "<mask>", "\n", "}", "\n", ...
2,745
all-2746
[ "MarshalJSON", "calls", "json", ".", "RawMessage", "method", "of", "the", "same", "name", ".", "Required", "since", "LaunchInfo", "is", "of", "type", "json", ".", "RawMessage", "..." ]
[ "func", "(", "this", "*", "LaunchInfo", ")", "MarshalJSON", "(", ")", "(", "[", "]", "<mask>", ",", "error", ")", "{", "x", ":=", "json", ".", "RawMessage", "(", "*", "this", ")", "\n", "return", "(", "&", "x", ")", ".", "MarshalJSON", "(", ")", ...
2,746
all-2747
[ "Read", "function", "gets", "the", "value", "of", "the", "node", ".", "If", "the", "receiver", "node", "is", "not", "a", "key", "-", "value", "pair", "a", "Not", "A", "File", "error", "will", "be", "returned", "." ]
[ "func", "(", "n", "*", "node", ")", "Read", "(", ")", "(", "string", ",", "*", "v2error", ".", "Error", ")", "{", "if", "n", ".", "IsDir", "(", ")", "{", "return", "\"", "\"", ",", "v2error", ".", "NewError", "(", "v2error", ".", "EcodeNotFile", ...
2,747
all-2748
[ "ApplyDefault", "applies", "the", "defaults", "for", "the", "UtilityImages", "decorations", ".", "If", "a", "field", "has", "a", "zero", "value", "it", "replaces", "that", "with", "the", "value", "set", "in", "def", "." ]
[ "func", "(", "u", "*", "UtilityImages", ")", "ApplyDefault", "(", "def", "*", "UtilityImages", ")", "*", "UtilityImages", "{", "if", "u", "==", "nil", "{", "return", "def", "\n", "}", "else", "if", "def", "==", "nil", "{", "<mask>", "u", "\n", "}", ...
2,748
all-2749
[ "ResetSecretForApiClient", "requests", "a", "snapshot", "of", "an", "existing", "api", "client" ]
[ "func", "(", "c", "*", "Client", ")", "ResetSecretForApiClient", "(", "identifier", "string", ")", "(", "*", "ApiClient", ",", "error", ")", "{", "ac", ":=", "<mask>", "(", "ApiClient", ")", "\n", "_", ",", "err", ":=", "c", ".", "MakeApiRequest", "(",...
2,749
all-2750
[ "BatchQuery", "creates", "a", "batch", "query", "with", "the", "given", "queries", "." ]
[ "func", "(", "idx", "*", "Index", ")", "BatchQuery", "(", "queries", "...", "PQLQuery", ")", "*", "PQLBatchQuery", "{", "stringQueries", ":=", "make", "(", "[", "]", "string", ",", "0", ",", "len", "(", "queries", ")", ")", "\n", "hasKeys", ":=", "fa...
2,750
all-2751
[ "CloseNotify", "implements", "the", "http", ".", "CloseNotifier", "interface" ]
[ "func", "(", "w", "*", "Response", ")", "CloseNotify", "(", ")", "<-", "chan", "bool", "{", "if", "cn", ",", "<mask>", ":=", "w", ".", "ResponseWriter", ".", "(", "closeNotifier", ")", ";", "ok", "{", "return", "cn", ".", "CloseNotify", "(", ")", "...
2,751
all-2752
[ "fast", "path", "for", "single", "topic", "validation", "that", "avoids", "the", "extra", "goroutine" ]
[ "func", "(", "p", "*", "PubSub", ")", "validateSingleTopic", "(", "val", "*", "topicVal", ",", "src", "peer", ".", "ID", ",", "msg", "*", "Message", ")", "bool", "{", "select", "{", "case", "val", ".", "validateThrottle", "<-", "struct", "{", "}", "{...
2,752
all-2753
[ "GetKey", "returns", "the", "key", "associated", "with", "the", "provided", "ID", "." ]
[ "func", "(", "j", "*", "JWKClient", ")", "GetKey", "(", "ID", "string", ")", "(", "jose", ".", "JSONWebKey", ",", "error", ")", "{", "j", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "j", ".", "mu", ".", "Unlock", "(", ")", "\n\n", "searche...
2,753
all-2754
[ "GetIncludeTags", "returns", "the", "IncludeTags", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "o", "*", "Options", ")", "GetIncludeTags", "(", ")", "bool", "{", "if", "o", "==", "nil", "||", "o", ".", "IncludeTags", "==", "nil", "{", "return", "<mask>", "\n", "}", "\n", "return", "*", "o", ".", "IncludeTags", "\n", "}" ]
2,754
all-2755
[ "NewConfig", "creates", "a", "new", "Config", "populated", "with", "default", "values", "." ]
[ "func", "NewConfig", "(", ")", "*", "Config", "{", "lpurl", ",", "_", ":=", "url", ".", "Parse", "(", "DefaultListenPeerURLs", ")", "\n", "apurl", ",", "_", ":=", "url", ".", "Parse", "(", "DefaultInitialAdvertisePeerURLs", ")", "\n", "lcurl", ",", "_", ...
2,755
all-2756
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "GetMetadataReturns", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoIndexeddb11", "(", "&", "w", ",", "v", ...
2,756
all-2757
[ "map", "all", "or", "part", "of", "a", "buffer", "object", "s", "data", "store", "into", "the", "client", "s", "address", "space" ]
[ "func", "MapNamedBufferRange", "(", "buffer", "uint32", ",", "offset", "int", ",", "length", "int", ",", "access", "uint32", ")", "unsafe", ".", "Pointer", "{", "ret", ":=", "C", ".", "glowMapNamedBufferRange", "(", "gpMapNamedBufferRange", ",", "(", "C", "....
2,757
all-2758
[ "GiBToByte", "returns", "n", "*", "1024^3", ".", "The", "output", "is", "returned", "as", "int64", "-", "if", "another", "type", "is", "needed", "it", "needs", "to", "be", "cast", ".", "Remember", "that", "int32", "overflows", "at", "around", "2GiB", "an...
[ "func", "GiBToByte", "(", "n", "interface", "{", "}", ")", "int64", "{", "switch", "v", ":=", "n", ".", "(", "type", ")", "{", "<mask>", "int", ":", "return", "int64", "(", "v", "*", "int", "(", "math", ".", "Pow", "(", "1024", ",", "3", ")", ...
2,758
all-2759
[ "Do", "executes", "BackgroundService", ".", "startObserving", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "StartObservingParams", ")", "Do", "(", "ctx", "<mask>", ".", "Context", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandStartObserving", ",", "p", ",", "nil", ")", "\n", "}" ]
2,759
all-2760
[ "SetCaps", "applies", "the", "caps", "for", "a", "particular", "root", "uid" ]
[ "func", "SetCaps", "(", "<mask>", "string", ",", "caps", "[", "]", "byte", ",", "uid", "int64", ")", "error", "{", "cpath", ":=", "C", ".", "CString", "(", "path", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "cpath", ...
2,760
all-2761
[ "Set", "is", "required", "for", "kingpin", "interfaces", "to", "allow", "command", "line", "params", "to", "be", "set", "to", "our", "map", "datatype" ]
[ "func", "(", "o", "*", "MapUint32Option", ")", "Set", "(", "value", "string", ")", "error", "{", "parts", ":=", "stringMapRegex", ".", "Split", "(", "<mask>", ",", "2", ")", "\n", "if", "len", "(", "parts", ")", "!=", "2", "{", "return", "fmt", "."...
2,761
all-2762
[ "HasRequireFullWindow", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "o", "*", "Options", ")", "HasRequireFullWindow", "(", ")", "bool", "{", "if", "o", "!=", "nil", "&&", "o", ".", "RequireFullWindow", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "<mask>", "\n", "}" ]
2,762
all-2763
[ "gitRevParse", "returns", "current", "commit", "from", "HEAD", "in", "a", "git", "tree" ]
[ "func", "(", "g", "*", "gitCtx", ")", "gitRevParse", "(", ")", "(", "string", ",", "error", ")", "{", "gitRevParseCommand", ":=", "g", ".", "gitCommand", "(", "\"", "\"", ",", "\"", "\"", ")", "\n", "_", ",", "commit", ",", "err", ":=", "gitRevPars...
2,763
all-2764
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "GetDOMCountersParams", ")", "UnmarshalJSON", "(", "<mask>", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoMemory11", "(", "&",...
2,764
all-2765
[ "FromURL", "converts", "the", "given", "URL", "to", "a", "folder", "name" ]
[ "func", "FromURL", "(", "url", "string", ")", "string", "{", "result", ":=", "url", "\n", "for", "_", ",", "<mask>", ":=", "range", "replaces", "{", "result", "=", "strings", ".", "Replace", "(", "result", ",", "replace", ".", "a", ",", "replace", "....
2,765
all-2766
[ "expandHostVirtualSwitchBondBridge", "reads", "certain", "ResourceData", "keys", "and", "returns", "a", "HostVirtualSwitchBondBridge", "." ]
[ "func", "expandHostVirtualSwitchBondBridge", "(", "d", "*", "schema", ".", "ResourceData", ")", "*", "types", ".", "HostVirtualSwitchBondBridge", "{", "obj", ":=", "&", "types", ".", "HostVirtualSwitchBondBridge", "{", "NicDevice", ":", "structure", ".", "SliceInter...
2,766
all-2767
[ "addApprovers", "iterates", "through", "the", "list", "of", "comments", "on", "a", "PR", "and", "identifies", "all", "of", "the", "people", "that", "have", "said", "/", "approve", "and", "adds", "them", "to", "the", "Approvers", ".", "The", "function", "us...
[ "func", "addApprovers", "(", "approversHandler", "*", "approvers", ".", "Approvers", ",", "approveComments", "[", "]", "*", "comment", ",", "author", "string", ",", "reviewActsAsApprove", "bool", ")", "{", "for", "_", ",", "c", ":=", "range", "approveComments"...
2,767
all-2768
[ "DialTimeout", "is", "like", "Dial", "but", "takes", "a", "timeout", ".", "The", "timeout", "includes", "name", "resolution", "if", "required", "." ]
[ "func", "DialTimeout", "(", "ctx", "context", ".", "Context", ",", "protocol", ",", "addr", "string", ",", "timeout", "time", ".", "Duration", ")", "(", "*", "Conn", ",", "error", ")", "{", "dialCtx", ":=", "ctx", "// Used for dialing and name resolution, but ...
2,768
all-2769
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "EventShadowRootPopped", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "<mask>", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoDom56", "(", "&", ...
2,769
all-2770
[ "RunForPFS", "creates", "a", "port", "forwarder", "for", "PFS", "over", "HTTP", "." ]
[ "func", "(", "f", "*", "PortForwarder", ")", "RunForPFS", "(", "localPort", "uint16", ")", "<mask>", "{", "if", "localPort", "==", "0", "{", "localPort", "=", "pfsLocalPort", "\n", "}", "\n", "return", "f", ".", "Run", "(", "\"", "\"", ",", "localPort"...
2,770
all-2771
[ "Stack", "logs", "the", "error", "err", "with", "the", "stack", "trace", "." ]
[ "func", "Stack", "(", "err", "interface", "{", "}", ")", "{", "stack", ":=", "make", "(", "[", "]", "byte", ",", "64", "<<", "10", ")", "\n", "<mask>", "=", "stack", "[", ":", "runtime", ".", "Stack", "(", "stack", ",", "false", ")", "]", "\n\n...
2,771
all-2772
[ "HasOrderDir", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "c", "*", "ChangeRequest", ")", "HasOrderDir", "(", ")", "bool", "{", "if", "c", "!=", "nil", "&&", "c", ".", "OrderDir", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "<mask>", "\n", "}" ]
2,772
all-2773
[ "doCompact", "picks", "some", "table", "on", "level", "l", "and", "compacts", "it", "away", "to", "the", "next", "level", "." ]
[ "func", "(", "s", "*", "levelsController", ")", "doCompact", "(", "p", "compactionPriority", ")", "error", "{", "l", ":=", "p", ".", "level", "\n", "y", ".", "AssertTrue", "(", "l", "+", "1", "<", "s", ".", "kv", ".", "opt", ".", "MaxLevels", ")", ...
2,773
all-2774
[ "Gets", "the", "length", "of", "the", "entry", "block" ]
[ "func", "(", "f", "HeaderExtension", ")", "EntrySize", "(", ")", "int", "{", "// Length of the name includes a null terminator", "// the 4 * 5 is 4 bytes (uint32) for the 5 fields", "baseSize", ":=", "f", ".", "FileEntry", ".", "EntrySize", "(", ")", "\n\n", "for", "key...
2,774
all-2775
[ "Fetch", "queries", "the", "Vault", "API" ]
[ "func", "(", "d", "*", "VaultListQuery", ")", "Fetch", "(", "clients", "*", "ClientSet", ",", "opts", "*", "QueryOptions", ")", "(", "interface", "{", "}", ",", "*", "ResponseMetadata", ",", "error", ")", "{", "select", "{", "case", "<-", "d", ".", "...
2,775
all-2776
[ "Encode", "serializes", "the", "JSON", "marshalable", "obj", "data", "as", "a", "JWT", "." ]
[ "func", "(", "rs", "*", "RSASigner", ")", "Encode", "(", "obj", "interface", "{", "}", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "return", "<mask>", ".", "alg", ".", "Encode", "(", "rs", ",", "obj", ")", "\n", "}" ]
2,776
all-2777
[ "NewFromCache", "creates", "a", "GitHub", "cache", "RoundTripper", "that", "is", "backed", "by", "the", "specified", "httpcache", ".", "Cache", "implementation", "." ]
[ "func", "NewFromCache", "(", "delegate", "http", ".", "RoundTripper", ",", "cache", "httpcache", ".", "Cache", ",", "maxConcurrency", "int", ")", "http", ".", "RoundTripper", "{", "cacheTransport", ":=", "httpcache", ".", "NewTransport", "(", "cache", ")", "\n...
2,777
all-2778
[ "Run", "starts", "threads", "workers", "returning", "after", "receiving", "a", "stop", "signal", "." ]
[ "func", "(", "c", "*", "controller", ")", "Run", "(", "threads", "int", ",", "stop", "<-", "chan", "struct", "{", "}", ")", "error", "{", "defer", "runtime", ".", "HandleCrash", "(", ")", "\n", "defer", "c", ".", "workqueue", ".", "ShutDown", "(", ...
2,778
all-2779
[ "Fingerprint", "returns", "the", "fingerprint", "of", "the", "public", "key", "." ]
[ "func", "(", "c", "*", "CertInfo", ")", "Fingerprint", "(", ")", "<mask>", "{", "fingerprint", ",", "err", ":=", "CertFingerprintStr", "(", "string", "(", "c", ".", "PublicKey", "(", ")", ")", ")", "\n", "// Parsing should never fail, since we generated the cert...
2,779
all-2780
[ "NewValueIterator", "creates", "a", "new", "iterator", "for", "value", "data", "." ]
[ "func", "NewValueIterator", "(", "format", "Format", ",", "reader", "io", ".", "Reader", ")", "*", "Iterator", "{", "return", "NewIterator", "(", "reader", ",", "FieldValueUnmarshaller", "(", "<mask>", ")", ")", "\n", "}" ]
2,780
all-2781
[ "PushFile", "makes", "sure", "that", "pfsFile", "has", "the", "same", "content", "as", "osFile", "." ]
[ "func", "PushFile", "(", "c", "*", "pachclient", ".", "APIClient", ",", "pfc", "pachclient", ".", "PutFileClient", ",", "pfsFile", "*", "pfs", ".", "File", ",", "osFile", "io", ".", "ReadSeeker", ")", "error", "{", "fileInfo", ",", "err", ":=", "c", "....
2,781
all-2782
[ "/", "*", "Kill", "sends", "a", "SIGKILL", "signal", "to", "all", "the", "processes", "started", "by", "Run", "and", "waits", "for", "them", "to", "exit", ".", "The", "timeout", "specified", "is", "applied", "to", "each", "process", "killed", "." ]
[ "func", "KillAndWait", "(", "timeout", "...", "interface", "{", "}", ")", "{", "trackedSessionsMutex", ".", "Lock", "(", ")", "\n", "defer", "trackedSessionsMutex", ".", "Unlock", "(", ")", "\n", "for", "_", ",", "<mask>", ":=", "range", "trackedSessions", ...
2,782
all-2783
[ "Start", "a", "Service", "and", "log", "its", "output", "." ]
[ "func", "(", "s", "*", "ServiceManager", ")", "Start", "(", ")", "*", "exec", ".", "Cmd", "{", "log", ".", "Println", "(", "\"", "\"", ")", "\n", "cmd", ":=", "exec", ".", "Command", "(", "s", ".", "Cmd", ",", "s", ".", "Args", "...", ")", "\...
2,783
all-2784
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "GetFramesWithManifestsReturns", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoApplicationcache3", "(", "&", "w",...
2,784
all-2785
[ "Setup", "external", "authentication" ]
[ "func", "(", "d", "*", "Daemon", ")", "setupExternalAuthentication", "(", "authEndpoint", "string", ",", "authPubkey", "string", ",", "expiry", "int64", ",", "domains", "string", ")", "error", "{", "// Parse the list of domains", "authDomains", ":=", "[", "]", "...
2,785
all-2786
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "SetEmulatedMediaParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "<mask>", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoEmulation9", "(", "&", "w", ",", "v",...
2,786
all-2787
[ "StdoutPipe", "returns", "a", "pipe", "that", "will", "be", "connected", "to", "the", "command", "s", "standard", "output", "when", "the", "command", "starts", ".", "Wait", "will", "close", "the", "pipe", "after", "seeing", "the", "command", "exit", "so", ...
[ "func", "(", "c", "*", "Cmd", ")", "StdoutPipe", "(", ")", "(", "<mask>", ".", "ReadCloser", ",", "error", ")", "{", "if", "c", ".", "Stdout", "!=", "nil", "{", "return", "nil", ",", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n", ...
2,787
all-2788
[ "StartImageCleanupProcess", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockImageManager", ")", "StartImageCleanupProcess", "(", "arg0", "context", ".", "<mask>", ")", "{", "m", ".", "ctrl", ".", "Call", "(", "m", ",", "\"", "\"", ",", "arg0", ")", "\n", "}" ]
2,788
all-2789
[ "NewNetworkBus", "-", "returns", "a", "new", "network", "bus", "object", "at", "the", "server", "address", "and", "path" ]
[ "func", "NewNetworkBus", "(", "address", ",", "path", "string", ")", "*", "NetworkBus", "{", "bus", ":=", "<mask>", "(", "NetworkBus", ")", "\n", "bus", ".", "sharedBus", "=", "New", "(", ")", "\n", "bus", ".", "Server", "=", "NewServer", "(", "address...
2,789
all-2790
[ "Create", "a", "raft", "instance", "and", "all", "its", "dependencies", "to", "be", "used", "as", "backend", "for", "the", "dqlite", "driver", "running", "on", "this", "LXD", "node", ".", "If", "this", "node", "should", "not", "serve", "as", "dqlite", "n...
[ "func", "newRaft", "(", "database", "*", "db", ".", "Node", ",", "cert", "*", "shared", ".", "CertInfo", ",", "latency", "float64", ")", "(", "*", "raftInstance", ",", "error", ")", "{", "if", "latency", "<=", "0", "{", "return", "nil", ",", "fmt", ...
2,790
all-2791
[ "own", "methods" ]
[ "func", "(", "l", "*", "TextView", ")", "calculateVirtualSize", "(", ")", "{", "w", ":=", "l", ".", "width", "-", "1", "\n", "l", ".", "virtualWidth", "=", "l", ".", "<mask>", "-", "1", "\n", "l", ".", "virtualHeight", "=", "0", "\n\n", "l", ".",...
2,791
all-2792
[ "Close", "flushes", "all", "pending", "data", "to", "reporters", "and", "releases", "resources", "." ]
[ "func", "(", "r", "*", "Registry", ")", "Close", "(", ")", "error", "{", "if", "r", ".", "closing", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "close", "(", "r", ".", "closing", ")", "\n", "return", "<-", "r", ".", "<mask>", "\n", "}" ...
2,792
all-2793
[ "registerContainerInstance", "registers", "the", "container", "instance", "ID", "for", "the", "ECS", "Agent" ]
[ "func", "(", "agent", "*", "ecsAgent", ")", "registerContainerInstance", "(", "stateManager", "statemanager", ".", "StateManager", ",", "client", "api", ".", "ECSClient", ",", "additionalAttributes", "[", "]", "*", "ecs", ".", "Attribute", ")", "error", "{", "...
2,793
all-2794
[ "GetMaxWidthChars", "is", "a", "wrapper", "around", "gtk_label_get_max_width_chars", "()", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "GetMaxWidthChars", "(", ")", "int", "{", "c", ":=", "C", ".", "gtk_label_get_max_width_chars", "(", "v", ".", "native", "(", ")", ")", "\n", "return", "int", "(", "c", ")", "\n", "}" ]
2,794
all-2795
[ "GetCreatePassiveOfferOp", "retrieves", "the", "CreatePassiveOfferOp", "value", "from", "the", "union", "returning", "ok", "if", "the", "union", "s", "switch", "indicated", "the", "value", "is", "valid", "." ]
[ "func", "(", "u", "OperationBody", ")", "GetCreatePassiveOfferOp", "(", ")", "(", "result", "CreatePassiveOfferOp", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "<mask>", ")", ")", "\n\n",...
2,795
all-2796
[ "IsAnyNotFoundError", "checks", "to", "see", "if", "the", "fault", "is", "of", "any", "not", "found", "error", "type", "that", "we", "track", "." ]
[ "func", "IsAnyNotFoundError", "(", "err", "error", ")", "bool", "{", "switch", "{", "<mask>", "IsManagedObjectNotFoundError", "(", "err", ")", ":", "fallthrough", "\n", "case", "isNotFoundError", "(", "err", ")", ":", "return", "true", "\n", "}", "\n", "retu...
2,796
all-2797
[ "checkMultiArg", "checks", "that", "v", "has", "type", "[]", "S", "[]", "*", "S", "[]", "I", "or", "[]", "P", "for", "some", "struct", "type", "S", "for", "some", "interface", "type", "I", "or", "some", "non", "-", "interface", "non", "-", "pointer",...
[ "func", "checkMultiArg", "(", "v", "reflect", ".", "Value", ")", "(", "m", "multiArgType", ",", "elemType", "reflect", ".", "Type", ")", "{", "if", "v", ".", "Kind", "(", ")", "!=", "reflect", ".", "Slice", "{", "return", "multiArgTypeInvalid", ",", "n...
2,797
all-2798
[ "GetKubernetesClient", "retrieves", "the", "Kubernetes", "cluster", "client", "from", "within", "the", "cluster" ]
[ "func", "GetKubernetesClient", "(", "masterURL", ",", "kubeConfig", "string", ")", "(", "kubernetes", ".", "Interface", ",", "error", ")", "{", "config", ",", "err", ":=", "loadClusterConfig", "(", "masterURL", ",", "kubeConfig", ")", "\n", "if", "err", "!="...
2,798
all-2799
[ "ReleaseIPResource", "marks", "the", "ip", "available", "in", "the", "ipam", "db" ]
[ "func", "(", "client", "*", "cniClient", ")", "ReleaseIPResource", "(", "cfg", "*", "Config", ")", "error", "{", "runtimeConfig", ":=", "libcni", ".", "RuntimeConf", "{", "ContainerID", ":", "cfg", ".", "ContainerID", ",", "NetNS", ":", "fmt", ".", "Sprint...
2,799
all-2800
[ "newWatcher", "is", "the", "internal", "function", "for", "properly", "setting", "up", "a", "new", "watcher", "." ]
[ "func", "newWatcher", "(", "dir_notify", "bool", ",", "initpaths", "...", "string", ")", "(", "w", "*", "Watcher", ")", "{", "w", "=", "new", "(", "Watcher", ")", "\n", "w", ".", "auto_watch", "=", "dir_notify", "\n", "w", ".", "paths", "=", "make", ...