id
int32
0
25.3k
idx
stringlengths
5
9
nl_tokens
sequence
pl_tokens
sequence
25,100
all-25101
[ "Do", "executes", "Target", ".", "attachToBrowserTarget", "against", "the", "provided", "context", ".", "returns", ":", "sessionID", "-", "Id", "assigned", "to", "the", "session", "." ]
[ "func", "(", "p", "*", "AttachToBrowserTargetParams", ")", "Do", "(", "ctx", "<mask>", ".", "Context", ")", "(", "sessionID", "SessionID", ",", "err", "error", ")", "{", "// execute", "var", "res", "AttachToBrowserTargetReturns", "\n", "err", "=", "cdp", ".", "Execute", "(", "ctx", ",", "CommandAttachToBrowserTarget", ",", "nil", ",", "&", "res", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\"", "\"", ",", "err", "\n", "}", "\n\n", "return", "res", ".", "SessionID", ",", "nil", "\n", "}" ]
25,101
all-25102
[ "GetTextAlignOk", "returns", "a", "tuple", "with", "the", "TextAlign", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "q", "*", "QueryValueDefinition", ")", "GetTextAlignOk", "(", ")", "(", "string", ",", "bool", ")", "{", "if", "q", "==", "nil", "||", "q", ".", "TextAlign", "==", "nil", "{", "return", "\"", "\"", ",", "false", "\n", "}", "\n", "return", "*", "q", ".", "TextAlign", ",", "<mask>", "\n", "}" ]
25,102
all-25103
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "SignedExchangeInfo", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoNetwork6", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "<mask>", "\n", "}" ]
25,103
all-25104
[ "MustAssetCode4", "retrieves", "the", "AssetCode4", "value", "from", "the", "union", "panicing", "if", "the", "value", "is", "not", "set", "." ]
[ "func", "(", "u", "AllowTrustOpAsset", ")", "MustAssetCode4", "(", ")", "[", "4", "]", "byte", "{", "val", ",", "<mask>", ":=", "u", ".", "GetAssetCode4", "(", ")", "\n\n", "if", "!", "ok", "{", "panic", "(", "\"", "\"", ")", "\n", "}", "\n\n", "return", "val", "\n", "}" ]
25,104
all-25105
[ "CacheRemoteFasthttpFunc", "receives", "a", "fasthttp", "handler", "its", "cache", "expiration", "and", "the", "remote", "address", "of", "the", "remote", "cache", "server", "(", "look", "ListenAndServe", ")", "returns", "a", "remote", "-", "cached", "handler", "You", "CAN", "NOT", "add", "validators", "with", "this", "function" ]
[ "func", "CacheRemoteFasthttpFunc", "(", "bodyHandler", "fasthttp", ".", "RequestHandler", ",", "expiration", "<mask>", ".", "Duration", ",", "remoteServerAddr", "string", ")", "fasthttp", ".", "RequestHandler", "{", "return", "CacheRemoteFasthttp", "(", "bodyHandler", ",", "expiration", ",", "remoteServerAddr", ")", ".", "ServeHTTP", "\n", "}" ]
25,105
all-25106
[ "GetInvertOk", "returns", "a", "tuple", "with", "the", "Invert", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "c", "*", "ConditionalFormat", ")", "GetInvertOk", "(", ")", "(", "bool", ",", "bool", ")", "{", "if", "c", "==", "nil", "||", "c", ".", "Invert", "==", "nil", "{", "return", "false", ",", "<mask>", "\n", "}", "\n", "return", "*", "c", ".", "Invert", ",", "true", "\n", "}" ]
25,106
all-25107
[ "UnmarshalXML", "unmarshal", "SOAPHeader" ]
[ "func", "(", "h", "*", "Header", ")", "UnmarshalXML", "(", "d", "*", "xml", ".", "Decoder", ",", "start", "xml", ".", "StartElement", ")", "error", "{", "var", "(", "token", "xml", ".", "Token", "\n", "err", "error", "\n", ")", "\n", "Loop", ":", "for", "{", "if", "token", ",", "err", "=", "d", ".", "Token", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "if", "token", "==", "nil", "{", "break", "\n", "}", "\n", "switch", "se", ":=", "token", ".", "(", "<mask>", ")", "{", "case", "xml", ".", "StartElement", ":", "if", "err", "=", "d", ".", "DecodeElement", "(", "h", ".", "Content", ",", "&", "se", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "case", "xml", ".", "EndElement", ":", "break", "Loop", "\n", "}", "\n", "}", "\n", "return", "nil", "\n", "}" ]
25,107
all-25108
[ "Add", "text", "element", "to", "svg", "and", "returns", "its", "expected", "width" ]
[ "func", "(", "gc", "*", "GraphicContext", ")", "drawString", "(", "text", "string", ",", "drawType", "drawType", ",", "x", ",", "y", "float64", ")", "float64", "{", "switch", "gc", ".", "svg", ".", "FontMode", "{", "case", "PathFontMode", ":", "w", ":=", "gc", ".", "CreateStringPath", "(", "text", ",", "x", ",", "y", ")", "\n", "gc", ".", "drawPaths", "(", "drawType", ")", "\n", "gc", ".", "Current", ".", "Path", ".", "Clear", "(", ")", "\n", "return", "w", "\n", "case", "SvgFontMode", ":", "gc", ".", "embedSvgFont", "(", "text", ")", "\n", "}", "\n\n", "// create elements", "svgText", ":=", "Text", "{", "}", "\n", "group", ":=", "gc", ".", "newGroup", "(", "drawType", ")", "\n\n", "// set attrs to text element", "svgText", ".", "Text", "=", "text", "\n", "svgText", ".", "FontSize", "=", "gc", ".", "Current", ".", "FontSize", "\n", "svgText", ".", "X", "=", "x", "\n", "svgText", ".", "Y", "=", "y", "\n", "svgText", ".", "FontFamily", "=", "gc", ".", "Current", ".", "FontData", ".", "<mask>", "\n\n", "// attach to group", "group", ".", "Texts", "=", "[", "]", "*", "Text", "{", "&", "svgText", "}", "\n", "left", ",", "_", ",", "right", ",", "_", ":=", "gc", ".", "GetStringBounds", "(", "text", ")", "\n", "return", "right", "-", "left", "\n", "}" ]
25,108
all-25109
[ "Self", "-", "Service", "authenticator", "first", "creates", "a", "global", "session", "with", "the", "core", "then", "creates", "a", "local", "session", "with", "self", "-", "service", "." ]
[ "func", "(", "a", "*", "ssAuthenticator", ")", "Sign", "(", "r", "*", "http", ".", "Request", ")", "error", "{", "if", "time", ".", "Now", "(", ")", ".", "After", "(", "a", ".", "refreshAt", ")", "{", "u", ":=", "buildURL", "(", "a", ".", "host", ",", "\"", "\"", ")", "\n", "u", "+=", "\"", "\"", "+", "strconv", ".", "Itoa", "(", "a", ".", "accountID", ")", "\n", "authReq", ",", "err", ":=", "http", ".", "NewRequest", "(", "\"", "\"", ",", "u", ",", "nil", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "if", "err", ":=", "a", ".", "auther", ".", "Sign", "(", "authReq", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "// A bit tricky: if the auther is the cookie signer it could have updated the", "// host after being redirected.", "if", "ca", ",", "ok", ":=", "a", ".", "auther", ".", "(", "*", "cookieSigner", ")", ";", "ok", "{", "a", ".", "SetHost", "(", "ca", ".", "host", ")", "\n", "authReq", ".", "Host", "=", "a", ".", "host", "\n", "authReq", ".", "URL", ".", "Host", "=", "a", ".", "host", "\n", "}", "\n\n", "authReq", ".", "Header", ".", "Set", "(", "\"", "\"", ",", "\"", "\"", ")", "\n", "resp", ",", "err", ":=", "a", ".", "client", ".", "DoHidden", "(", "authReq", ")", "\n", "if", "err", "!=", "nil", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n", "if", "resp", ".", "StatusCode", "!=", "303", "{", "body", ",", "err", ":=", "ioutil", ".", "ReadAll", "(", "resp", ".", "Body", ")", "\n", "var", "msg", "string", "\n", "if", "err", "!=", "nil", "{", "msg", "=", "\"", "\"", "\n", "}", "\n", "if", "len", "(", "body", ")", ">", "0", "{", "msg", "=", "\"", "\"", "+", "string", "(", "body", ")", "\n", "}", "\n", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "resp", ".", "Status", ",", "msg", ")", "\n", "}", "\n", "a", ".", "refreshAt", "=", "<mask>", ".", "Now", "(", ")", ".", "Add", "(", "2", "*", "time", ".", "Hour", ")", "\n", "}", "\n", "a", ".", "auther", ".", "Sign", "(", "r", ")", "\n", "r", ".", "Header", ".", "Set", "(", "\"", "\"", ",", "\"", "\"", ")", "\n", "r", ".", "Host", "=", "a", ".", "host", "\n", "r", ".", "URL", ".", "Host", "=", "a", ".", "host", "\n\n", "return", "nil", "\n", "}" ]
25,109
all-25110
[ "SetResponseHeaders", "sets", "the", "response", "headers", "." ]
[ "func", "(", "c", "headerCtx", ")", "SetResponseHeaders", "(", "headers", "map", "[", "string", "]", "string", ")", "{", "if", "h", ":=", "c", ".", "<mask>", "(", ")", ";", "h", "!=", "nil", "{", "h", ".", "respHeaders", "=", "headers", "\n", "return", "\n", "}", "\n", "panic", "(", "\"", "\"", ")", "\n", "}" ]
25,110
all-25111
[ "native", "()", "returns", "a", "pointer", "to", "the", "underlying", "GtkPrintContext", "." ]
[ "func", "(", "pc", "*", "PrintContext", ")", "native", "(", ")", "*", "C", ".", "GtkPrintContext", "{", "if", "pc", "==", "nil", "||", "pc", ".", "GObject", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "p", ":=", "unsafe", ".", "Pointer", "(", "<mask>", ".", "GObject", ")", "\n", "return", "C", ".", "toGtkPrintContext", "(", "p", ")", "\n", "}" ]
25,111
all-25112
[ "controls", "feedback", "mode" ]
[ "func", "FeedbackBuffer", "(", "size", "int32", ",", "xtype", "uint32", ",", "<mask>", "*", "float32", ")", "{", "C", ".", "glowFeedbackBuffer", "(", "gpFeedbackBuffer", ",", "(", "C", ".", "GLsizei", ")", "(", "size", ")", ",", "(", "C", ".", "GLenum", ")", "(", "xtype", ")", ",", "(", "*", "C", ".", "GLfloat", ")", "(", "unsafe", ".", "Pointer", "(", "buffer", ")", ")", ")", "\n", "}" ]
25,112
all-25113
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "StackTraceID", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoRuntime1", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "<mask>", "\n", "}" ]
25,113
all-25114
[ "Set", "is", "required", "for", "kingpin", "interfaces", "to", "allow", "command", "line", "params", "to", "be", "set", "to", "our", "map", "datatype" ]
[ "func", "(", "o", "*", "ListInt16Option", ")", "<mask>", "(", "value", "string", ")", "error", "{", "val", ":=", "Int16Option", "{", "}", "\n", "val", ".", "Set", "(", "value", ")", "\n", "*", "o", "=", "append", "(", "*", "o", ",", "val", ")", "\n", "return", "nil", "\n", "}" ]
25,114
all-25115
[ "newDockerContainerMetadataResolver", "returns", "a", "new", "instance", "of", "DockerContainerMetadataResolver", "." ]
[ "func", "newDockerContainerMetadataResolver", "(", "taskEngine", "ecsengine", ".", "TaskEngine", ")", "(", "*", "DockerContainerMetadataResolver", ",", "error", ")", "{", "dockerTaskEngine", ",", "<mask>", ":=", "taskEngine", ".", "(", "*", "ecsengine", ".", "DockerTaskEngine", ")", "\n", "if", "!", "ok", "{", "// Error type casting docker task engine.", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "}", "\n\n", "resolver", ":=", "&", "DockerContainerMetadataResolver", "{", "dockerTaskEngine", ":", "dockerTaskEngine", ",", "}", "\n\n", "return", "resolver", ",", "nil", "\n", "}" ]
25,115
all-25116
[ "SinceStart", "returns", "the", "time", "since", "the", "start", "of", "the", "request", ".", "If", "there", "is", "no", "request", "state", "then", "the", "fallback", "is", "returned", "." ]
[ "func", "(", "<mask>", "*", "RequestState", ")", "SinceStart", "(", "now", "time", ".", "Time", ",", "fallback", "time", ".", "Duration", ")", "time", ".", "Duration", "{", "if", "rs", "==", "nil", "{", "return", "fallback", "\n", "}", "\n", "return", "now", ".", "Sub", "(", "rs", ".", "Start", ")", "\n", "}" ]
25,116
all-25117
[ "Applies", "various", "transformations", "necessary", "for", "the", "other", "subsequent", "stemming", "steps", ".", "Most", "important", "of", "which", "is", "defining", "the", "two", "regions", "R1", "&", "R2", "." ]
[ "func", "preprocess", "(", "word", "*", "snowballword", ".", "SnowballWord", ")", "{", "// Clean up apostrophes", "normalizeApostrophes", "(", "word", ")", "\n", "trimLeftApostrophes", "(", "word", ")", "\n\n", "// Capitalize Y's that are not behaving", "// as vowels.", "capitalizeYs", "(", "word", ")", "\n\n", "// Find the two regions, R1 & R2", "r1start", ",", "r2start", ":=", "r1r2", "(", "word", ")", "\n", "<mask>", ".", "R1start", "=", "r1start", "\n", "word", ".", "R2start", "=", "r2start", "\n", "}" ]
25,117
all-25118
[ "Parameter", "callback", "has", "type", "C", ".", "GLDEBUGPROCARB", "." ]
[ "func", "DebugMessageCallbackARB", "(", "<mask>", "unsafe", ".", "Pointer", ",", "userParam", "unsafe", ".", "Pointer", ")", "{", "syscall", ".", "Syscall", "(", "gpDebugMessageCallbackARB", ",", "2", ",", "syscall", ".", "NewCallback", "(", "callback", ")", ",", "uintptr", "(", "userParam", ")", ",", "0", ")", "\n", "}" ]
25,118
all-25119
[ "UInt64ToBytes", "unwrap", "uint64", "value", "to", "byte", "array", "of", "length", "8", "using", "big", "endian" ]
[ "func", "UInt64ToBytes", "(", "value", "uint64", ")", "[", "]", "byte", "{", "result", ":=", "make", "(", "[", "]", "byte", ",", "8", ")", "\n", "binary", ".", "BigEndian", ".", "PutUint64", "(", "<mask>", ",", "value", ")", "\n\n", "return", "result", "\n", "}" ]
25,119
all-25120
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "ScriptPosition", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "<mask>", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoDebugger22", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
25,120
all-25121
[ "Reservoir", "fetches", "an", "instrument", "from", "the", "registry", "or", "creates", "a", "new", "one", ".", "If", "another", "instrument", "type", "is", "already", "registered", "with", "the", "same", "name", "/", "tags", "a", "blank", "one", "will", "be", "returned", "and", "an", "error", "will", "be", "logged", "to", "the", "Errors", "()", "channel", "." ]
[ "func", "(", "r", "*", "Registry", ")", "Reservoir", "(", "name", "string", ",", "tags", "[", "]", "string", ")", "*", "Reservoir", "{", "factory", ":=", "func", "(", ")", "interface", "{", "}", "{", "return", "NewReservoir", "(", ")", "}", "\n", "return", "r", ".", "fetchReservoir", "(", "name", ",", "<mask>", ",", "factory", ")", "\n", "}" ]
25,121
all-25122
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "GetObjectByHeapObjectIDReturns", ")", "UnmarshalJSON", "(", "data", "[", "]", "<mask>", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler11", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "Error", "(", ")", "\n", "}" ]
25,122
all-25123
[ "Copied", "from", "go", "/", "build", ".", "safeCgoName" ]
[ "func", "safeCgoName", "(", "s", "string", ",", "spaces", "bool", ")", "bool", "{", "if", "s", "==", "\"", "\"", "{", "return", "false", "\n", "}", "\n", "safe", ":=", "safeBytes", "\n", "if", "!", "spaces", "{", "<mask>", "=", "safe", "[", "len", "(", "safeSpaces", ")", ":", "]", "\n", "}", "\n", "for", "i", ":=", "0", ";", "i", "<", "len", "(", "s", ")", ";", "i", "++", "{", "if", "c", ":=", "s", "[", "i", "]", ";", "c", "<", "utf8", ".", "RuneSelf", "&&", "bytes", ".", "IndexByte", "(", "safe", ",", "c", ")", "<", "0", "{", "return", "false", "\n", "}", "\n", "}", "\n", "return", "true", "\n", "}" ]
25,123
all-25124
[ "Do", "executes", "Page", ".", "navigateToHistoryEntry", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "NavigateToHistoryEntryParams", ")", "Do", "(", "ctx", "<mask>", ".", "Context", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandNavigateToHistoryEntry", ",", "p", ",", "nil", ")", "\n", "}" ]
25,124
all-25125
[ "CreateIndex", "creates", "an", "index", "on", "the", "server", "using", "the", "given", "Index", "struct", "." ]
[ "func", "(", "c", "*", "Client", ")", "CreateIndex", "(", "index", "*", "Index", ")", "error", "{", "span", ":=", "c", ".", "tracer", ".", "StartSpan", "(", "\"", "\"", ")", "\n", "defer", "span", ".", "Finish", "(", ")", "\n\n", "data", ":=", "[", "]", "byte", "(", "index", ".", "options", ".", "String", "(", ")", ")", "\n", "<mask>", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "index", ".", "name", ")", "\n", "response", ",", "_", ",", "err", ":=", "c", ".", "httpRequest", "(", "\"", "\"", ",", "path", ",", "data", ",", "nil", ",", "false", ")", "\n", "if", "err", "!=", "nil", "{", "if", "response", "!=", "nil", "&&", "response", ".", "StatusCode", "==", "409", "{", "return", "ErrIndexExists", "\n", "}", "\n", "return", "err", "\n", "}", "\n", "return", "nil", "\n\n", "}" ]
25,125
all-25126
[ "Executes", "what", "s", "in", "st", ".", "sa" ]
[ "func", "txFunCallOmni", "(", "st", "*", "State", ")", "{", "t", ":=", "reflect", ".", "ValueOf", "(", "st", ".", "sa", ")", "\n", "<mask>", "t", ".", "Kind", "(", ")", "{", "case", "reflect", ".", "Int", ":", "// If it's an int, assume that it's a MACRO, which points to", "// the location in the bytecode that contains the macro code", "txMacroCall", "(", "st", ")", "\n", "case", "reflect", ".", "Func", ":", "txFunCall", "(", "st", ")", "\n", "default", ":", "st", ".", "Warnf", "(", "\"", "\\n", "\"", ",", "st", ".", "sa", ")", "\n", "st", ".", "sa", "=", "nil", "\n", "st", ".", "Advance", "(", ")", "\n", "}", "\n", "}" ]
25,126
all-25127
[ "/", "*" ]
[ "func", "ComputeBTCAddress", "(", "pubKeyHex", "string", ",", "chainCodeHex", "string", ",", "path", "string", ",", "index", "int32", ")", "string", "{", "pubKeyBytes", ":=", "DerivePublicKeyForPath", "(", "HexDecode", "(", "pubKeyHex", ")", ",", "HexDecode", "(", "chainCodeHex", ")", ",", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "<mask>", ",", "index", ")", ",", ")", "\n", "return", "BTCAddrFromPubKeyBytes", "(", "pubKeyBytes", ")", "\n", "}" ]
25,127
all-25128
[ "Get", "a", "value", "from", "the", "ENV", ".", "If", "it", "doesn", "t", "exist", "an", "error", "will", "be", "returned" ]
[ "func", "MustGet", "(", "key", "string", ")", "(", "string", ",", "error", ")", "{", "gil", ".", "RLock", "(", ")", "\n", "defer", "gil", ".", "RUnlock", "(", ")", "\n", "if", "v", ",", "ok", ":=", "env", "[", "<mask>", "]", ";", "ok", "{", "return", "v", ",", "nil", "\n", "}", "\n", "return", "\"", "\"", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "key", ")", "\n", "}" ]
25,128
all-25129
[ "IsUnexportedField", "returns", "whether", "the", "field", "is", "unexported", ".", "This", "function", "is", "to", "avoid", "the", "bug", "in", "versions", "older", "than", "Go1", ".", "3", ".", "See", "following", "links", ":", "https", ":", "//", "code", ".", "google", ".", "com", "/", "p", "/", "go", "/", "issues", "/", "detail?id", "=", "7247", "http", ":", "//", "golang", ".", "org", "/", "ref", "/", "spec#Exported_identifiers" ]
[ "func", "IsUnexportedField", "(", "field", "reflect", ".", "StructField", ")", "bool", "{", "return", "!", "(", "field", ".", "PkgPath", "==", "\"", "\"", "&&", "unicode", ".", "IsUpper", "(", "rune", "(", "field", ".", "<mask>", "[", "0", "]", ")", ")", ")", "\n", "}" ]
25,129
all-25130
[ "Requires", "an", "*", "apicontainer", ".", "Container", "and", "returns", "the", "Resources", "for", "the", "HostConfig", "struct" ]
[ "func", "(", "task", "*", "<mask>", ")", "getDockerResources", "(", "container", "*", "apicontainer", ".", "Container", ")", "dockercontainer", ".", "Resources", "{", "// Convert MB to B and set Memory", "dockerMem", ":=", "int64", "(", "container", ".", "Memory", "*", "1024", "*", "1024", ")", "\n", "if", "dockerMem", "!=", "0", "&&", "dockerMem", "<", "apicontainer", ".", "DockerContainerMinimumMemoryInBytes", "{", "seelog", ".", "Warnf", "(", "\"", "\"", ",", "task", ".", "Arn", ",", "container", ".", "Name", ",", "apicontainer", ".", "DockerContainerMinimumMemoryInBytes", ")", "\n", "dockerMem", "=", "apicontainer", ".", "DockerContainerMinimumMemoryInBytes", "\n", "}", "\n", "// Set CPUShares", "cpuShare", ":=", "task", ".", "dockerCPUShares", "(", "container", ".", "CPU", ")", "\n", "resources", ":=", "dockercontainer", ".", "Resources", "{", "Memory", ":", "dockerMem", ",", "CPUShares", ":", "cpuShare", ",", "}", "\n", "return", "resources", "\n", "}" ]
25,130
all-25131
[ "modulo", "returns", "the", "modulo", "of", "b", "from", "a", "." ]
[ "func", "modulo", "(", "b", ",", "a", "interface", "{", "}", ")", "(", "interface", "{", "}", ",", "error", ")", "{", "av", ":=", "reflect", ".", "ValueOf", "(", "a", ")", "\n", "bv", ":=", "reflect", ".", "ValueOf", "(", "b", ")", "\n\n", "switch", "av", ".", "Kind", "(", ")", "{", "<mask>", "reflect", ".", "Int", ",", "reflect", ".", "Int8", ",", "reflect", ".", "Int16", ",", "reflect", ".", "Int32", ",", "reflect", ".", "Int64", ":", "switch", "bv", ".", "Kind", "(", ")", "{", "case", "reflect", ".", "Int", ",", "reflect", ".", "Int8", ",", "reflect", ".", "Int16", ",", "reflect", ".", "Int32", ",", "reflect", ".", "Int64", ":", "return", "av", ".", "Int", "(", ")", "%", "bv", ".", "Int", "(", ")", ",", "nil", "\n", "case", "reflect", ".", "Uint", ",", "reflect", ".", "Uint8", ",", "reflect", ".", "Uint16", ",", "reflect", ".", "Uint32", ",", "reflect", ".", "Uint64", ":", "return", "av", ".", "Int", "(", ")", "%", "int64", "(", "bv", ".", "Uint", "(", ")", ")", ",", "nil", "\n", "default", ":", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "bv", ",", "b", ")", "\n", "}", "\n", "case", "reflect", ".", "Uint", ",", "reflect", ".", "Uint8", ",", "reflect", ".", "Uint16", ",", "reflect", ".", "Uint32", ",", "reflect", ".", "Uint64", ":", "switch", "bv", ".", "Kind", "(", ")", "{", "case", "reflect", ".", "Int", ",", "reflect", ".", "Int8", ",", "reflect", ".", "Int16", ",", "reflect", ".", "Int32", ",", "reflect", ".", "Int64", ":", "return", "int64", "(", "av", ".", "Uint", "(", ")", ")", "%", "bv", ".", "Int", "(", ")", ",", "nil", "\n", "case", "reflect", ".", "Uint", ",", "reflect", ".", "Uint8", ",", "reflect", ".", "Uint16", ",", "reflect", ".", "Uint32", ",", "reflect", ".", "Uint64", ":", "return", "av", ".", "Uint", "(", ")", "%", "bv", ".", "Uint", "(", ")", ",", "nil", "\n", "default", ":", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "bv", ",", "b", ")", "\n", "}", "\n", "default", ":", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "av", ",", "a", ")", "\n", "}", "\n", "}" ]
25,131
all-25132
[ "On", "enables", "maintenance", "." ]
[ "func", "(", "s", "*", "MemoryStore", ")", "On", "(", ")", "(", "changed", "bool", ",", "err", "error", ")", "{", "s", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "s", ".", "mu", ".", "Unlock", "(", ")", "\n\n", "if", "s", ".", "<mask>", "{", "return", "\n", "}", "\n", "s", ".", "on", "=", "true", "\n", "changed", "=", "true", "\n", "return", "\n", "}" ]
25,132
all-25133
[ "RawQuery", "creates", "a", "query", "with", "the", "given", "string", ".", "Note", "that", "the", "query", "is", "not", "validated", "before", "sending", "to", "the", "server", "." ]
[ "func", "(", "idx", "*", "<mask>", ")", "RawQuery", "(", "query", "string", ")", "*", "PQLBaseQuery", "{", "q", ":=", "NewPQLBaseQuery", "(", "query", ",", "idx", ",", "nil", ")", "\n", "// NOTE: raw queries always assumed to have keys set", "q", ".", "hasKeys", "=", "true", "\n", "return", "q", "\n", "}" ]
25,133
all-25134
[ "ValidEnum", "validates", "a", "proposed", "value", "for", "this", "enum", ".", "Implements", "the", "Enum", "interface", "for", "InflationResultCode" ]
[ "func", "(", "e", "InflationResultCode", ")", "ValidEnum", "(", "v", "int32", ")", "bool", "{", "_", ",", "<mask>", ":=", "inflationResultCodeMap", "[", "v", "]", "\n", "return", "ok", "\n", "}" ]
25,134
all-25135
[ "New", "creates", "a", "new", "TupleType", "with", "the", "given", "namespace", "and", "type", "name" ]
[ "func", "New", "(", "namespace", "string", ",", "name", "string", ")", "(", "t", "TupleType", ")", "{", "hash", ":=", "syncHash", ".", "Hash", "(", "[", "]", "byte", "(", "name", ")", ")", "\n", "ns_hash", ":=", "syncHash", ".", "Hash", "(", "[", "]", "byte", "(", "namespace", ")", ")", "\n", "t", "=", "TupleType", "{", "namespace", ",", "name", ",", "ns_hash", ",", "hash", ",", "make", "(", "[", "]", "[", "]", "Field", ",", "0", ")", ",", "<mask>", "(", "map", "[", "string", "]", "int", ")", "}", "\n", "return", "\n", "}" ]
25,135
all-25136
[ "PublicationLineageLocator", "builds", "a", "locator", "from", "the", "given", "href", "." ]
[ "func", "(", "api", "*", "API", ")", "PublicationLineageLocator", "(", "href", "string", ")", "*", "PublicationLineageLocator", "{", "<mask>", "&", "PublicationLineageLocator", "{", "Href", "(", "href", ")", ",", "api", "}", "\n", "}" ]
25,136
all-25137
[ "Group", "takes", "a", "path", "which", "typically", "a", "prefix", "for", "an", "endpoint", "It", "will", "call", "callback", "function", "with", "a", "group", "router", "which", "you", "can", "add", "handler", "for", "different", "request", "methods" ]
[ "func", "(", "r", "*", "Router", ")", "Group", "(", "path", "string", ",", "fn", "func", "(", "r", "*", "GroupRouter", ")", ")", "{", "gr", ":=", "NewGroupRouter", "(", "r", ",", "<mask>", ")", "\n", "fn", "(", "gr", ")", "\n", "}" ]
25,137
all-25138
[ "export", "FileSequence_End" ]
[ "func", "FileSequence_End", "(", "id", "FileSeqId", ")", "C", ".", "int", "{", "fs", ",", "ok", ":=", "sFileSeqs", ".", "Get", "(", "id", ")", "\n", "if", "!", "<mask>", "{", "return", "0", "\n", "}", "\n", "return", "C", ".", "int", "(", "fs", ".", "End", "(", ")", ")", "\n", "}" ]
25,138
all-25139
[ "RestoreFrom", "restores", "state", "from", "another", "cluster", "which", "can", "be", "access", "through", "otherC", "." ]
[ "func", "(", "c", "APIClient", ")", "RestoreFrom", "(", "<mask>", "bool", ",", "otherC", "*", "APIClient", ")", "(", "retErr", "error", ")", "{", "restoreClient", ",", "err", ":=", "c", ".", "AdminAPIClient", ".", "Restore", "(", "c", ".", "Ctx", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "grpcutil", ".", "ScrubGRPC", "(", "err", ")", "\n", "}", "\n", "defer", "func", "(", ")", "{", "if", "_", ",", "err", ":=", "restoreClient", ".", "CloseAndRecv", "(", ")", ";", "err", "!=", "nil", "&&", "retErr", "==", "nil", "{", "retErr", "=", "grpcutil", ".", "ScrubGRPC", "(", "err", ")", "\n", "}", "\n", "}", "(", ")", "\n", "return", "otherC", ".", "Extract", "(", "objects", ",", "func", "(", "op", "*", "admin", ".", "Op", ")", "error", "{", "return", "restoreClient", ".", "Send", "(", "&", "admin", ".", "RestoreRequest", "{", "Op", ":", "op", "}", ")", "\n", "}", ")", "\n", "}" ]
25,139
all-25140
[ "GetStatusOk", "returns", "a", "tuple", "with", "the", "Status", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "g", "*", "GroupData", ")", "GetStatusOk", "(", ")", "(", "string", ",", "bool", ")", "{", "if", "g", "==", "nil", "||", "g", ".", "Status", "==", "nil", "{", "return", "\"", "\"", ",", "false", "\n", "}", "\n", "return", "*", "g", ".", "Status", ",", "<mask>", "\n", "}" ]
25,140
all-25141
[ "/", "*", "CreateCheckBox", "creates", "a", "new", "CheckBox", "control", ".", "parent", "-", "is", "container", "that", "keeps", "the", "control", ".", "The", "same", "View", "can", "be", "a", "view", "and", "a", "parent", "at", "the", "same", "time", ".", "width", "-", "is", "minimal", "width", "of", "the", "control", ".", "title", "-", "button", "title", ".", "scale", "-", "the", "way", "of", "scaling", "the", "control", "when", "the", "parent", "is", "resized", ".", "Use", "DoNotScale", "constant", "if", "the", "control", "should", "keep", "its", "original", "size", ".", "CheckBox", "state", "can", "be", "changed", "using", "mouse", "or", "pressing", "space", "on", "keyboard", "while", "the", "control", "is", "active" ]
[ "func", "CreateCheckBox", "(", "parent", "Control", ",", "width", "int", ",", "<mask>", "string", ",", "scale", "int", ")", "*", "CheckBox", "{", "c", ":=", "new", "(", "CheckBox", ")", "\n", "c", ".", "BaseControl", "=", "NewBaseControl", "(", ")", "\n", "c", ".", "parent", "=", "parent", "\n\n", "if", "width", "==", "AutoSize", "{", "width", "=", "xs", ".", "Len", "(", "title", ")", "+", "4", "\n", "}", "\n\n", "c", ".", "SetSize", "(", "width", ",", "1", ")", "// TODO: only one line checkboxes are supported at that moment", "\n", "c", ".", "SetConstraints", "(", "width", ",", "1", ")", "\n", "c", ".", "state", "=", "0", "\n", "c", ".", "SetTitle", "(", "title", ")", "\n", "c", ".", "SetTabStop", "(", "true", ")", "\n", "c", ".", "allow3state", "=", "false", "\n", "c", ".", "onChange", "=", "nil", "\n", "c", ".", "SetScale", "(", "scale", ")", "\n\n", "if", "parent", "!=", "nil", "{", "parent", ".", "AddChild", "(", "c", ")", "\n", "}", "\n\n", "return", "c", "\n", "}" ]
25,141
all-25142
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "StopSamplingParams", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "<mask>", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler3", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "Error", "(", ")", "\n", "}" ]
25,142
all-25143
[ "Add", "will", "block", "until", "the", "number", "of", "goroutines", "being", "throttled", "has", "fallen", "below", "the", "throttle", "." ]
[ "func", "(", "w", "*", "WaitGroup", ")", "Add", "(", ")", "{", "w", ".", "outstanding", "++", "\n", "if", "w", ".", "outstanding", ">", "w", ".", "throttle", "{", "select", "{", "<mask>", "<-", "w", ".", "completed", ":", "w", ".", "outstanding", "--", "\n", "return", "\n", "}", "\n", "}", "\n", "}" ]
25,143
all-25144
[ "Based", "on", "https", ":", "//", "developers", ".", "google", ".", "com", "/", "protocol", "-", "buffers", "/", "docs", "/", "reference", "/", "proto3", "-", "spec" ]
[ "func", "buildProtoRegexp", "(", ")", "*", "regexp", ".", "Regexp", "{", "hexEscape", ":=", "`\\\\[xX][0-9a-fA-f]{2}`", "\n", "octEscape", ":=", "`\\\\[0-7]{3}`", "\n", "charEscape", ":=", "`\\\\[abfnrtv'\"\\\\]`", "\n", "charValue", ":=", "strings", ".", "Join", "(", "[", "]", "string", "{", "hexEscape", ",", "octEscape", ",", "charEscape", ",", "\"", "\\x00", "\\\\", "\\\\", "\\\"", "\\\\", "\\\\", "\"", "}", ",", "\"", "\"", ")", "\n", "strLit", ":=", "`'(?:`", "+", "charValue", "+", "`|\")*'|\"(?:`", "+", "charValue", "+", "`|')*\"`", "\n", "ident", ":=", "`[A-Za-z][A-Za-z0-9_]*`", "\n", "fullIdent", ":=", "ident", "+", "`(?:\\.`", "+", "ident", "+", "`)*`", "\n", "importStmt", ":=", "`\\bimport\\s*(?:public|weak)?\\s*(?P<import>`", "+", "strLit", "+", "`)\\s*;`", "\n", "packageStmt", ":=", "`\\bpackage\\s*(?P<package>`", "+", "fullIdent", "+", "`)\\s*;`", "\n", "optionStmt", ":=", "`\\boption\\s*(?P<optkey>`", "+", "fullIdent", "+", "`)\\s*=\\s*(?P<optval>`", "+", "strLit", "+", "`)\\s*;`", "\n", "serviceStmt", ":=", "`(?P<service>service)`", "\n", "<mask>", ":=", "`//[^\\n]*`", "\n", "protoReSrc", ":=", "strings", ".", "Join", "(", "[", "]", "string", "{", "importStmt", ",", "packageStmt", ",", "optionStmt", ",", "serviceStmt", ",", "comment", "}", ",", "\"", "\"", ")", "\n", "return", "regexp", ".", "MustCompile", "(", "protoReSrc", ")", "\n", "}" ]
25,144
all-25145
[ "FindBaseProfile", "finds", "the", "coverage", "profile", "file", "from", "the", "latest", "healthy", "build", "stored", "in", "given", "gcs", "directory" ]
[ "func", "FindBaseProfile", "(", "ctx", "context", ".", "Context", ",", "<mask>", "*", "storage", ".", "Client", ",", "bucket", ",", "prowJobName", ",", "artifactsDirName", ",", "covProfileName", "string", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "dirOfJob", ":=", "path", ".", "Join", "(", "\"", "\"", ",", "prowJobName", ")", "\n\n", "strBuilds", ",", "err", ":=", "listGcsObjects", "(", "ctx", ",", "client", ",", "bucket", ",", "dirOfJob", "+", "\"", "\"", ",", "\"", "\"", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n\n", "builds", ":=", "sortBuilds", "(", "strBuilds", ")", "\n", "profilePath", ":=", "\"", "\"", "\n", "for", "_", ",", "build", ":=", "range", "builds", "{", "buildDirPath", ":=", "path", ".", "Join", "(", "dirOfJob", ",", "strconv", ".", "Itoa", "(", "build", ")", ")", "\n", "dirOfStatusJSON", ":=", "path", ".", "Join", "(", "buildDirPath", ",", "statusJSON", ")", "\n\n", "statusText", ",", "err", ":=", "readGcsObject", "(", "ctx", ",", "client", ",", "bucket", ",", "dirOfStatusJSON", ")", "\n", "if", "err", "!=", "nil", "{", "logrus", ".", "Infof", "(", "\"", "\"", ",", "dirOfStatusJSON", ",", "bucket", ")", "\n", "}", "else", "if", "isBuildSucceeded", "(", "statusText", ")", "{", "artifactsDirPath", ":=", "path", ".", "Join", "(", "buildDirPath", ",", "artifactsDirName", ")", "\n", "profilePath", "=", "path", ".", "Join", "(", "artifactsDirPath", ",", "covProfileName", ")", "\n", "break", "\n", "}", "\n", "}", "\n", "if", "profilePath", "==", "\"", "\"", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "dirOfJob", ",", "bucket", ",", "len", "(", "builds", ")", ")", "\n", "}", "\n", "return", "readGcsObject", "(", "ctx", ",", "client", ",", "bucket", ",", "profilePath", ")", "\n", "}" ]
25,145
all-25146
[ "Do", "executes", "DOM", ".", "undo", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "UndoParams", ")", "Do", "(", "ctx", "context", ".", "<mask>", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandUndo", ",", "nil", ",", "nil", ")", "\n", "}" ]
25,146
all-25147
[ "Create", "creates", "an", "instance", "of", "the", "type", "of", "the", "given", "parameter" ]
[ "func", "(", "di", "*", "dependencyInjector", ")", "Create", "(", "avar", "<mask>", "{", "}", ")", "interface", "{", "}", "{", "varType", ":=", "reflect", ".", "TypeOf", "(", "avar", ")", "\n\n", "if", "di", ".", "caching", "{", "return", "di", ".", "cachedCreateFromType", "(", "varType", ")", ".", "Interface", "(", ")", "\n", "}", "else", "{", "return", "di", ".", "CreateFromType", "(", "varType", ")", ".", "Interface", "(", ")", "\n", "}", "\n", "}" ]
25,147
all-25148
[ "PrettyPrintAsJSON", "marshalles", "input", "as", "indented", "JSON", "and", "calles", "fmt", ".", "Println", "with", "the", "result", ".", "If", "indent", "arguments", "are", "given", "they", "are", "joined", "into", "a", "string", "and", "used", "as", "JSON", "line", "indent", ".", "If", "no", "indet", "argument", "is", "given", "two", "spaces", "will", "be", "used", "to", "indent", "JSON", "lines", "." ]
[ "func", "PrettyPrintAsJSON", "(", "input", "interface", "{", "}", ",", "indent", "...", "string", ")", "error", "{", "<mask>", "indentStr", "string", "\n", "if", "len", "(", "indent", ")", "==", "0", "{", "indentStr", "=", "\"", "\"", "\n", "}", "else", "{", "indentStr", "=", "strings", ".", "Join", "(", "indent", ",", "\"", "\"", ")", "\n", "}", "\n", "data", ",", "err", ":=", "json", ".", "MarshalIndent", "(", "input", ",", "\"", "\"", ",", "indentStr", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "_", ",", "err", "=", "fmt", ".", "Println", "(", "string", "(", "data", ")", ")", "\n", "return", "err", "\n", "}" ]
25,148
all-25149
[ "GetMax", "returns", "the", "Max", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "w", "*", "WidgetAxis", ")", "GetMax", "(", ")", "<mask>", "{", "if", "w", "==", "nil", "||", "w", ".", "Max", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "w", ".", "Max", "\n", "}" ]
25,149
all-25150
[ "Fetch", "returns", "an", "instrument", "from", "the", "Registry", "or", "creates", "a", "new", "one", "using", "the", "provided", "factory", "." ]
[ "func", "(", "r", "*", "Registry", ")", "Fetch", "(", "name", "string", ",", "tags", "[", "]", "string", ",", "factory", "func", "(", ")", "interface", "{", "}", ")", "interface", "{", "}", "{", "key", ":=", "MetricID", "(", "name", ",", "tags", ")", "\n\n", "r", ".", "mutex", ".", "RLock", "(", ")", "\n", "v", ",", "ok", ":=", "r", ".", "instruments", "[", "key", "]", "\n", "r", ".", "mutex", ".", "RUnlock", "(", ")", "\n", "if", "<mask>", "{", "return", "v", "\n", "}", "\n\n", "r", ".", "mutex", ".", "Lock", "(", ")", "\n", "defer", "r", ".", "mutex", ".", "Unlock", "(", ")", "\n\n", "if", "v", ",", "ok", "=", "r", ".", "instruments", "[", "key", "]", ";", "!", "ok", "{", "switch", "v", "=", "factory", "(", ")", ";", "v", ".", "(", "type", ")", "{", "case", "Discrete", ",", "Sample", ":", "r", ".", "instruments", "[", "key", "]", "=", "v", "\n", "}", "\n", "}", "\n", "return", "v", "\n", "}" ]
25,150
all-25151
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "RedoParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoDom17", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "<mask>", "\n", "}" ]
25,151
all-25152
[ "Used", "to", "print", "tokens" ]
[ "func", "(", "t", "Token", ")", "String", "(", ")", "string", "{", "switch", "t", ".", "Type", "{", "case", "TokenEOF", ":", "return", "\"", "\"", "\n", "case", "TokenError", ":", "return", "t", ".", "Value", "\n", "}", "\n", "if", "len", "(", "t", ".", "<mask>", ")", ">", "10", "{", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "t", ".", "Value", ")", "\n", "}", "\n", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "t", ".", "Value", ")", "\n", "}" ]
25,152
all-25153
[ "NewTCPCryptoState", "returns", "a", "valid", "TCPCryptoState", "." ]
[ "func", "newTCPCryptoState", "(", "sessionKey", "*", "[", "32", "]", "<mask>", ",", "outbound", "bool", ")", "*", "tcpCryptoState", "{", "s", ":=", "&", "tcpCryptoState", "{", "sessionKey", ":", "sessionKey", "}", "\n", "if", "outbound", "{", "s", ".", "nonce", "[", "0", "]", "|=", "(", "1", "<<", "7", ")", "\n", "}", "\n", "s", ".", "nonce", "[", "0", "]", "|=", "(", "1", "<<", "6", ")", "\n", "return", "s", "\n", "}" ]
25,153
all-25154
[ "render", "multiple", "instances", "of", "primitives", "using", "a", "count", "derived", "from", "a", "specifed", "stream", "of", "a", "transform", "feedback", "object" ]
[ "func", "DrawTransformFeedbackStreamInstanced", "(", "mode", "uint32", ",", "id", "uint32", ",", "stream", "uint32", ",", "instancecount", "int32", ")", "{", "syscall", ".", "Syscall6", "(", "gpDrawTransformFeedbackStreamInstanced", ",", "4", ",", "uintptr", "(", "<mask>", ")", ",", "uintptr", "(", "id", ")", ",", "uintptr", "(", "stream", ")", ",", "uintptr", "(", "instancecount", ")", ",", "0", ",", "0", ")", "\n", "}" ]
25,154
all-25155
[ "Locator", "returns", "a", "locator", "for", "the", "given", "resource" ]
[ "func", "(", "r", "*", "RightScript", ")", "Locator", "(", "api", "*", "API", ")", "*", "RightScriptLocator", "{", "for", "_", ",", "l", ":=", "<mask>", "r", ".", "Links", "{", "if", "l", "[", "\"", "\"", "]", "==", "\"", "\"", "{", "return", "api", ".", "RightScriptLocator", "(", "l", "[", "\"", "\"", "]", ")", "\n", "}", "\n", "}", "\n", "return", "nil", "\n", "}" ]
25,155
all-25156
[ "GetTitle", "returns", "the", "Title", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "m", "*", "ManageStatusDefinition", ")", "GetTitle", "(", ")", "<mask>", "{", "if", "m", "==", "nil", "||", "m", ".", "Title", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "m", ".", "Title", "\n", "}" ]
25,156
all-25157
[ "Load", "loads", "the", "ByteCode", "for", "template", "specified", "by", "key", "which", "for", "this", "ByteCodeLoader", "is", "the", "path", "to", "the", "template", "we", "want", ".", "If", "cached", "vm", ".", "ByteCode", "struct", "is", "found", "it", "is", "loaded", "and", "its", "last", "modified", "time", "is", "compared", "against", "that", "of", "the", "template", "file", ".", "If", "the", "template", "is", "newer", "it", "s", "compiled", ".", "Otherwise", "the", "cached", "version", "is", "used", "saving", "us", "the", "time", "to", "parse", "and", "compile", "the", "template", "." ]
[ "func", "(", "l", "*", "CachedByteCodeLoader", ")", "Load", "(", "key", "string", ")", "(", "bc", "*", "vm", ".", "ByteCode", ",", "err", "error", ")", "{", "defer", "func", "(", ")", "{", "if", "bc", "!=", "nil", "&&", "err", "==", "nil", "&&", "l", ".", "ShouldDumpByteCode", "(", ")", "{", "fmt", ".", "Fprintf", "(", "os", ".", "Stderr", ",", "\"", "\\n", "\"", ",", "bc", ".", "String", "(", ")", ")", "\n", "}", "\n", "}", "(", ")", "\n\n", "var", "source", "TemplateSource", "\n", "if", "l", ".", "CacheLevel", ">", "CacheNone", "{", "var", "entity", "*", "CacheEntity", "\n", "for", "_", ",", "cache", ":=", "range", "l", ".", "Caches", "{", "entity", ",", "err", "=", "cache", ".", "Get", "(", "key", ")", "\n", "if", "err", "==", "nil", "{", "break", "\n", "}", "\n", "}", "\n\n", "if", "err", "==", "nil", "{", "if", "l", ".", "CacheLevel", "==", "CacheNoVerify", "{", "return", "entity", ".", "ByteCode", ",", "nil", "\n", "}", "\n\n", "t", ",", "err", ":=", "entity", ".", "Source", ".", "LastModified", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "errors", ".", "Wrap", "(", "err", ",", "\"", "\"", ")", "\n", "}", "\n\n", "if", "t", ".", "Before", "(", "entity", ".", "ByteCode", ".", "GeneratedOn", ")", "{", "return", "entity", ".", "ByteCode", ",", "nil", "\n", "}", "\n\n", "// ByteCode validation failed, but we can still re-use source", "source", "=", "entity", ".", "Source", "\n", "}", "\n", "}", "\n\n", "if", "source", "==", "nil", "{", "source", ",", "err", "=", "l", ".", "Fetcher", ".", "FetchTemplate", "(", "key", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "errors", ".", "Wrap", "(", "err", ",", "\"", "\"", ")", "\n", "}", "\n", "}", "\n\n", "rdr", ",", "err", ":=", "source", ".", "Reader", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "errors", ".", "Wrap", "(", "err", ",", "\"", "\"", ")", "\n", "}", "\n\n", "bc", ",", "err", "=", "l", ".", "LoadReader", "(", "key", ",", "rdr", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "errors", ".", "Wrap", "(", "err", ",", "\"", "\"", ")", "\n", "}", "\n\n", "entity", ":=", "&", "CacheEntity", "{", "bc", ",", "source", "}", "\n", "for", "_", ",", "<mask>", ":=", "range", "l", ".", "Caches", "{", "cache", ".", "Set", "(", "key", ",", "entity", ")", "\n", "}", "\n\n", "return", "bc", ",", "nil", "\n", "}" ]
25,157
all-25158
[ "isConnectedSince", "checks", "whether", "the", "local", "member", "is", "connected", "to", "the", "remote", "member", "since", "the", "given", "time", "." ]
[ "func", "isConnectedSince", "(", "transport", "rafthttp", ".", "Transporter", ",", "since", "time", ".", "Time", ",", "remote", "types", ".", "<mask>", ")", "bool", "{", "t", ":=", "transport", ".", "ActiveSince", "(", "remote", ")", "\n", "return", "!", "t", ".", "IsZero", "(", ")", "&&", "t", ".", "Before", "(", "since", ")", "\n", "}" ]
25,158
all-25159
[ "HasPrecision", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "t", "*", "TileDef", ")", "HasPrecision", "(", ")", "bool", "{", "if", "t", "!=", "nil", "&&", "t", ".", "Precision", "!=", "nil", "{", "return", "<mask>", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
25,159
all-25160
[ "DrawImage", "draws", "the", "raster", "image", "in", "the", "current", "canvas" ]
[ "func", "(", "gc", "*", "GraphicContext", ")", "DrawImage", "(", "img", "image", ".", "Image", ")", "{", "DrawImage", "(", "img", ",", "gc", ".", "img", ",", "gc", ".", "Current", ".", "Tr", ",", "<mask>", ".", "Over", ",", "BilinearFilter", ")", "\n", "}" ]
25,160
all-25161
[ "MustCreateStore", "will", "dial", "the", "passed", "database", "and", "return", "a", "new", "store", ".", "It", "will", "panic", "if", "the", "initial", "connection", "failed", "." ]
[ "func", "MustCreateStore", "(", "uri", "string", ")", "*", "Store", "{", "<mask>", ",", "err", ":=", "CreateStore", "(", "uri", ")", "\n", "if", "err", "!=", "nil", "{", "panic", "(", "err", ")", "\n", "}", "\n\n", "return", "store", "\n", "}" ]
25,161
all-25162
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "SamplingProfileNode", ")", "UnmarshalJSON", "(", "<mask>", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoMemory4", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "Error", "(", ")", "\n", "}" ]
25,162
all-25163
[ "Do", "executes", "ServiceWorker", ".", "stopWorker", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "StopWorkerParams", ")", "Do", "(", "ctx", "context", ".", "<mask>", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandStopWorker", ",", "p", ",", "nil", ")", "\n", "}" ]
25,163
all-25164
[ "False", "checks", "a", "value", "is", "false", "." ]
[ "func", "False", "(", "tb", "testing", ".", "TB", ",", "value", "bool", ",", "msgAndArgs", "...", "interface", "{", "}", ")", "{", "tb", ".", "Helper", "(", ")", "\n", "if", "<mask>", "{", "fatal", "(", "tb", ",", "msgAndArgs", ",", "\"", "\"", ")", "\n", "}", "\n", "}" ]
25,164
all-25165
[ "AddFlags", "adds", "kube", "client", "flags", "to", "existing", "FlagSet", "." ]
[ "func", "(", "o", "*", "KubernetesClientOptions", ")", "AddFlags", "(", "fs", "*", "flag", ".", "FlagSet", ")", "{", "fs", ".", "StringVar", "(", "&", "o", ".", "namespace", ",", "\"", "\"", ",", "v1", ".", "NamespaceDefault", ",", "\"", "\"", ")", "\n", "fs", ".", "StringVar", "(", "&", "o", ".", "kubeConfig", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ")", "\n", "<mask>", ".", "BoolVar", "(", "&", "o", ".", "inMemory", ",", "\"", "\"", ",", "false", ",", "\"", "\"", ")", "\n", "}" ]
25,165
all-25166
[ "HasResource", "tells", "if", "current", "client", "holds", "any", "resources" ]
[ "func", "(", "c", "*", "Client", ")", "HasResource", "(", ")", "bool", "{", "<mask>", ",", "_", ":=", "c", ".", "storage", ".", "List", "(", ")", "\n", "return", "len", "(", "resources", ")", ">", "0", "\n", "}" ]
25,166
all-25167
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "SetDocumentCookieDisabledParams", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoEmulation11", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "<mask>", "(", ")", "\n", "}" ]
25,167
all-25168
[ "NewCentosCluster", "creates", "a", "simple", "CentOS", "Amazon", "cluster" ]
[ "func", "NewCentosCluster", "(", "name", "string", ")", "*", "cluster", ".", "Cluster", "{", "controlPlaneProviderConfig", ":=", "&", "cluster", ".", "ControlPlaneProviderConfig", "{", "Cloud", ":", "cluster", ".", "CloudAmazon", ",", "Location", ":", "\"", "\"", ",", "SSH", ":", "&", "cluster", ".", "SSH", "{", "PublicKeyPath", ":", "\"", "\"", ",", "User", ":", "\"", "\"", ",", "}", ",", "KubernetesAPI", ":", "&", "cluster", ".", "KubernetesAPI", "{", "Port", ":", "\"", "\"", ",", "}", ",", "Network", ":", "&", "cluster", ".", "Network", "{", "Type", ":", "cluster", ".", "NetworkTypePublic", ",", "CIDR", ":", "\"", "\"", ",", "InternetGW", ":", "&", "cluster", ".", "InternetGW", "{", "}", ",", "}", ",", "Values", ":", "&", "cluster", ".", "Values", "{", "ItemMap", ":", "map", "[", "string", "]", "string", "{", "\"", "\"", ":", "kubeadm", ".", "GetRandomToken", "(", ")", ",", "}", ",", "}", ",", "}", "\n", "machineSetsProviderConfigs", ":=", "[", "]", "*", "cluster", ".", "MachineProviderConfig", "{", "{", "ServerPool", ":", "&", "cluster", ".", "ServerPool", "{", "Type", ":", "cluster", ".", "ServerPoolTypeMaster", ",", "Name", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "name", ")", ",", "MaxCount", ":", "1", ",", "MinCount", ":", "1", ",", "Image", ":", "\"", "\"", ",", "Size", ":", "\"", "\"", ",", "BootstrapScripts", ":", "[", "]", "string", "{", "\"", "\"", ",", "}", ",", "InstanceProfile", ":", "&", "cluster", ".", "IAMInstanceProfile", "{", "Name", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "name", ")", ",", "<mask>", ":", "&", "cluster", ".", "IAMRole", "{", "Name", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "name", ")", ",", "Policies", ":", "[", "]", "*", "cluster", ".", "IAMPolicy", "{", "{", "Name", ":", "\"", "\"", ",", "Document", ":", "`{\n\t\t\t\t\t\t\t\t \"Version\": \"2012-10-17\",\n\t\t\t\t\t\t\t\t \"Statement\": [\n\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\"Effect\": \"Allow\",\n\t\t\t\t\t\t\t\t\t\t\"Action\": [\n\t\t\t\t\t\t\t\t\t\t \"ec2:*\",\n\t\t\t\t\t\t\t\t\t\t \"elasticloadbalancing:*\",\n\t\t\t\t\t\t\t\t\t\t \"ecr:GetAuthorizationToken\",\n\t\t\t\t\t\t\t\t\t\t \"ecr:BatchCheckLayerAvailability\",\n\t\t\t\t\t\t\t\t\t\t \"ecr:GetDownloadUrlForLayer\",\n\t\t\t\t\t\t\t\t\t\t \"ecr:GetRepositoryPolicy\",\n\t\t\t\t\t\t\t\t\t\t \"ecr:DescribeRepositories\",\n\t\t\t\t\t\t\t\t\t\t \"ecr:ListImages\",\n\t\t\t\t\t\t\t\t\t\t \"ecr:BatchGetImage\",\n\t\t\t\t\t\t\t\t\t\t \"autoscaling:DescribeAutoScalingGroups\",\n\t\t\t\t\t\t\t\t\t\t \"autoscaling:UpdateAutoScalingGroup\"\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\"Resource\": \"*\"\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t ]\n\t\t\t\t\t\t\t\t}`", ",", "}", ",", "}", ",", "}", ",", "}", ",", "Subnets", ":", "[", "]", "*", "cluster", ".", "Subnet", "{", "{", "Name", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "name", ")", ",", "CIDR", ":", "\"", "\"", ",", "Zone", ":", "\"", "\"", ",", "}", ",", "}", ",", "Firewalls", ":", "[", "]", "*", "cluster", ".", "Firewall", "{", "{", "Name", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "name", ",", "uuid", ".", "TimeOrderedUUID", "(", ")", ")", ",", "IngressRules", ":", "[", "]", "*", "cluster", ".", "IngressRule", "{", "{", "IngressFromPort", ":", "\"", "\"", ",", "IngressToPort", ":", "\"", "\"", ",", "IngressSource", ":", "\"", "\"", ",", "IngressProtocol", ":", "\"", "\"", ",", "}", ",", "{", "IngressFromPort", ":", "\"", "\"", ",", "IngressToPort", ":", "\"", "\"", ",", "IngressSource", ":", "\"", "\"", ",", "IngressProtocol", ":", "\"", "\"", ",", "}", ",", "{", "IngressFromPort", ":", "\"", "\"", ",", "IngressToPort", ":", "\"", "\"", ",", "IngressSource", ":", "\"", "\"", ",", "IngressProtocol", ":", "\"", "\"", ",", "}", ",", "}", ",", "}", ",", "}", ",", "}", ",", "}", ",", "{", "ServerPool", ":", "&", "cluster", ".", "ServerPool", "{", "Type", ":", "cluster", ".", "ServerPoolTypeNode", ",", "Name", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "name", ")", ",", "MaxCount", ":", "1", ",", "MinCount", ":", "1", ",", "Image", ":", "\"", "\"", ",", "Size", ":", "\"", "\"", ",", "BootstrapScripts", ":", "[", "]", "string", "{", "\"", "\"", ",", "}", ",", "InstanceProfile", ":", "&", "cluster", ".", "IAMInstanceProfile", "{", "Name", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "name", ")", ",", "Role", ":", "&", "cluster", ".", "IAMRole", "{", "Name", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "name", ")", ",", "Policies", ":", "[", "]", "*", "cluster", ".", "IAMPolicy", "{", "{", "Name", ":", "\"", "\"", ",", "Document", ":", "`{\n\t\t\t\t\t\t\t\t \"Version\": \"2012-10-17\",\n\t\t\t\t\t\t\t\t \"Statement\": [\n\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\"Effect\": \"Allow\",\n\t\t\t\t\t\t\t\t\t\t\"Action\": [\n\t\t\t\t\t\t\t\t\t\t \"ec2:Describe*\",\n\t\t\t\t\t\t\t\t\t\t \"ec2:AttachVolume\",\n\t\t\t\t\t\t\t\t\t\t \"ec2:DetachVolume\",\n\t\t\t\t\t\t\t\t\t\t \"ecr:GetAuthorizationToken\",\n\t\t\t\t\t\t\t\t\t\t \"ecr:BatchCheckLayerAvailability\",\n\t\t\t\t\t\t\t\t\t\t \"ecr:GetDownloadUrlForLayer\",\n\t\t\t\t\t\t\t\t\t\t \"ecr:GetRepositoryPolicy\",\n\t\t\t\t\t\t\t\t\t\t \"ecr:DescribeRepositories\",\n\t\t\t\t\t\t\t\t\t\t \"ecr:ListImages\",\n\t\t\t\t\t\t\t\t\t\t \"ecr:BatchGetImage\",\n\t\t\t\t\t\t\t\t\t\t \"autoscaling:DescribeAutoScalingGroups\",\n\t\t\t\t\t\t\t\t\t\t \"autoscaling:UpdateAutoScalingGroup\"\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\"Resource\": \"*\"\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t ]\n\t\t\t\t\t\t\t\t}`", ",", "}", ",", "}", ",", "}", ",", "}", ",", "Subnets", ":", "[", "]", "*", "cluster", ".", "Subnet", "{", "{", "Name", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "name", ")", ",", "CIDR", ":", "\"", "\"", ",", "Zone", ":", "\"", "\"", ",", "}", ",", "}", ",", "Firewalls", ":", "[", "]", "*", "cluster", ".", "Firewall", "{", "{", "Name", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "name", ",", "uuid", ".", "TimeOrderedUUID", "(", ")", ")", ",", "IngressRules", ":", "[", "]", "*", "cluster", ".", "IngressRule", "{", "{", "IngressFromPort", ":", "\"", "\"", ",", "IngressToPort", ":", "\"", "\"", ",", "IngressSource", ":", "\"", "\"", ",", "IngressProtocol", ":", "\"", "\"", ",", "}", ",", "{", "IngressFromPort", ":", "\"", "\"", ",", "IngressToPort", ":", "\"", "\"", ",", "IngressSource", ":", "\"", "\"", ",", "IngressProtocol", ":", "\"", "\"", ",", "}", ",", "}", ",", "}", ",", "}", ",", "}", ",", "}", ",", "}", "\n", "c", ":=", "cluster", ".", "NewCluster", "(", "name", ")", "\n", "c", ".", "SetProviderConfig", "(", "controlPlaneProviderConfig", ")", "\n", "c", ".", "NewMachineSetsFromProviderConfigs", "(", "machineSetsProviderConfigs", ")", "\n", "return", "c", "\n", "}" ]
25,168
all-25169
[ "NewMockDockerClient", "creates", "a", "new", "mock", "instance" ]
[ "func", "NewMockDockerClient", "(", "ctrl", "*", "gomock", ".", "<mask>", ")", "*", "MockDockerClient", "{", "mock", ":=", "&", "MockDockerClient", "{", "ctrl", ":", "ctrl", "}", "\n", "mock", ".", "recorder", "=", "&", "MockDockerClientMockRecorder", "{", "mock", "}", "\n", "return", "mock", "\n", "}" ]
25,169
all-25170
[ "Get", "an", "item", "from", "the", "cache", ".", "Returns", "the", "item", "or", "nil", "and", "a", "bool", "indicating", "whether", "the", "key", "was", "found", "." ]
[ "func", "(", "c", "*", "cache", ")", "Get", "(", "k", "string", ")", "(", "interface", "{", "}", ",", "bool", ")", "{", "c", ".", "mu", ".", "RLock", "(", ")", "\n", "// \"Inlining\" of get and Expired", "item", ",", "found", ":=", "c", ".", "items", "[", "k", "]", "\n", "if", "!", "found", "{", "c", ".", "mu", ".", "RUnlock", "(", ")", "\n", "return", "nil", ",", "false", "\n", "}", "\n", "if", "item", ".", "Expiration", ">", "0", "{", "if", "time", ".", "Now", "(", ")", ".", "UnixNano", "(", ")", ">", "item", ".", "Expiration", "{", "c", ".", "mu", ".", "RUnlock", "(", ")", "\n", "return", "nil", ",", "false", "\n", "}", "\n", "}", "\n", "c", ".", "mu", ".", "RUnlock", "(", ")", "\n", "return", "item", ".", "Object", ",", "<mask>", "\n", "}" ]
25,170
all-25171
[ "HasUnit", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "w", "*", "Widget", ")", "HasUnit", "(", ")", "bool", "{", "if", "w", "!=", "nil", "&&", "w", ".", "Unit", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "<mask>", "\n", "}" ]
25,171
all-25172
[ "Save", "mail", "notifier", "adds", "a", "new", "mail", "notifier", "it", "replaces", "the", "existing", "one", "if", "there", "is", "already", "a", "notifier", "available", "." ]
[ "func", "(", "m", "MongoDb", ")", "SaveMailNotifier", "(", "ctxt", "string", ",", "notifier", "<mask>", ".", "MailNotifier", ")", "error", "{", "c", ":=", "m", ".", "Connect", "(", "models", ".", "COLL_NAME_MAIL_NOTIFIER", ")", "\n", "defer", "m", ".", "Close", "(", "c", ")", "\n", "_", ",", "err", ":=", "c", ".", "Upsert", "(", "bson", ".", "M", "{", "}", ",", "bson", ".", "M", "{", "\"", "\"", ":", "notifier", "}", ")", "\n", "if", "err", "!=", "nil", "{", "logger", ".", "Get", "(", ")", ".", "Error", "(", "\"", "\"", ",", "ctxt", ",", "notifier", ".", "MailId", ",", "err", ")", "\n", "return", "errors", ".", "New", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "notifier", ".", "MailId", ",", "err", ")", ")", "\n", "}", "\n", "return", "nil", "\n", "}" ]
25,172
all-25173
[ "title", ":", "get", "autoscale", "config", "path", ":", "/", "autoscale", "/", "config", "method", ":", "GET", "produce", ":", "application", "/", "json", "responses", ":", "200", ":", "Ok", "401", ":", "Unauthorized" ]
[ "func", "autoScaleGetConfig", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ",", "t", "auth", ".", "Token", ")", "error", "{", "allowedGetConfig", ":=", "permission", ".", "Check", "(", "t", ",", "permission", ".", "PermNodeAutoscaleRead", ")", "\n", "if", "!", "allowedGetConfig", "{", "return", "permission", ".", "ErrUnauthorized", "\n", "}", "\n", "config", ",", "err", ":=", "autoscale", ".", "CurrentConfig", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "w", ".", "Header", "(", ")", ".", "<mask>", "(", "\"", "\"", ",", "\"", "\"", ")", "\n", "return", "json", ".", "NewEncoder", "(", "w", ")", ".", "Encode", "(", "config", ")", "\n", "}" ]
25,173
all-25174
[ "IsSuppressed", "reports", "true", "if", "level", "should", "be", "suppressed", "." ]
[ "func", "(", "w", "*", "Writer", ")", "IsSuppressed", "(", "level", "string", ")", "bool", "{", "_", ",", "<mask>", ":=", "w", ".", "suppressMap", "[", "level", "]", "\n", "return", "ok", "\n", "}" ]
25,174
all-25175
[ "NewGroup", "creates", "a", "new", "broadcast", "group", "." ]
[ "func", "NewGroup", "(", ")", "*", "Group", "{", "in", ":=", "make", "(", "chan", "Message", ")", "\n", "<mask>", ":=", "make", "(", "chan", "bool", ")", "\n", "return", "&", "Group", "{", "in", ":", "in", ",", "close", ":", "close", ",", "clock", ":", "0", "}", "\n", "}" ]
25,175
all-25176
[ "NetworkOptionGroupAttachmentLocator", "builds", "a", "locator", "from", "the", "given", "href", "." ]
[ "func", "(", "api", "*", "API", ")", "NetworkOptionGroupAttachmentLocator", "(", "href", "string", ")", "*", "NetworkOptionGroupAttachmentLocator", "{", "<mask>", "&", "NetworkOptionGroupAttachmentLocator", "{", "Href", "(", "href", ")", ",", "api", "}", "\n", "}" ]
25,176
all-25177
[ "AddDashboardListItems", "adds", "dashboards", "to", "an", "existing", "dashboard", "list", ".", "Any", "items", "already", "in", "the", "list", "are", "ignored", "(", "not", "added", "twice", ")", "." ]
[ "func", "(", "client", "*", "Client", ")", "AddDashboardListItems", "(", "dashboardListId", "int", ",", "items", "[", "]", "DashboardListItem", ")", "(", "[", "]", "DashboardListItem", ",", "error", ")", "{", "req", ":=", "reqDashboardListItems", "{", "items", "}", "\n", "<mask>", "out", "reqAddedDashboardListItems", "\n", "if", "err", ":=", "client", ".", "doJsonRequest", "(", "\"", "\"", ",", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "dashboardListId", ")", ",", "req", ",", "&", "out", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "out", ".", "Dashboards", ",", "nil", "\n", "}" ]
25,177
all-25178
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "TakeCoverageDeltaReturns", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoCss1", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "<mask>", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
25,178
all-25179
[ "GetEd25519", "retrieves", "the", "Ed25519", "value", "from", "the", "union", "returning", "ok", "if", "the", "union", "s", "switch", "indicated", "the", "value", "is", "valid", "." ]
[ "func", "(", "u", "PublicKey", ")", "GetEd25519", "(", ")", "(", "result", "Uint256", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n\n", "if", "armName", "==", "\"", "\"", "{", "result", "=", "*", "u", ".", "Ed25519", "\n", "ok", "=", "<mask>", "\n", "}", "\n\n", "return", "\n", "}" ]
25,179
all-25180
[ "DecodeMap", "provides", "the", "implementation", "of", "the", "algorithm", "for", "decoding", "maps", "where", "f", "is", "called", "to", "decode", "each", "pair", "of", "key", "and", "value", ".", "The", "function", "f", "is", "expected", "to", "decode", "two", "values", "from", "the", "map", "the", "first", "one", "being", "the", "key", "and", "the", "second", "the", "associated", "value", ".", "The", "first", "decoder", "must", "be", "used", "to", "decode", "the", "key", "the", "second", "one", "for", "the", "value", "." ]
[ "func", "(", "d", "Decoder", ")", "DecodeMap", "(", "f", "func", "(", "Decoder", ",", "Decoder", ")", "error", ")", "(", "err", "error", ")", "{", "var", "typ", "Type", "\n\n", "if", "d", ".", "off", "!=", "0", "{", "if", "d", ".", "off", ",", "err", "=", "0", ",", "d", ".", "<mask>", ".", "ParseMapValue", "(", "d", ".", "off", "-", "1", ")", ";", "err", "!=", "nil", "{", "return", "\n", "}", "\n", "}", "\n\n", "if", "typ", ",", "err", "=", "d", ".", "Parser", ".", "ParseType", "(", ")", ";", "err", "!=", "nil", "{", "return", "\n", "}", "\n\n", "err", "=", "d", ".", "decodeMapImpl", "(", "typ", ",", "f", ")", "\n", "return", "\n", "}" ]
25,180
all-25181
[ "Returns", "the", "value", "of", "a", "uniform", "variable" ]
[ "func", "GetUniformfv", "(", "program", "uint32", ",", "location", "int32", ",", "params", "*", "float32", ")", "{", "C", ".", "glowGetUniformfv", "(", "gpGetUniformfv", ",", "(", "C", ".", "GLuint", ")", "(", "program", ")", ",", "(", "C", ".", "GLint", ")", "(", "<mask>", ")", ",", "(", "*", "C", ".", "GLfloat", ")", "(", "unsafe", ".", "Pointer", "(", "params", ")", ")", ")", "\n", "}" ]
25,181
all-25182
[ "EncodeValue", "signs", "and", "encodes", "a", "cookie", "value" ]
[ "func", "(", "c", "CookieSigner", ")", "EncodeValue", "(", "<mask>", "string", ")", "string", "{", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "base64", ".", "URLEncoding", ".", "EncodeToString", "(", "c", ".", "mac", "(", "value", ")", ")", ",", "value", ")", "\n", "}" ]
25,182
all-25183
[ "HasTimestamp", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "c", "*", "Check", ")", "HasTimestamp", "(", ")", "bool", "{", "if", "c", "!=", "nil", "&&", "c", ".", "Timestamp", "!=", "nil", "{", "return", "<mask>", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
25,183
all-25184
[ "/", "*", "Routine", "which", "helps", "us", "to", "create", "global", "dict", "of", "msg", "types" ]
[ "func", "CreateMsgType", "(", "alist", "[", "]", "AttrListTuple", ",", "familyId", "uint16", ")", "MessageType", "{", "if", "v", ",", "exists", ":=", "Family2MT", "[", "familyId", "]", ";", "exists", "{", "return", "*", "v", "\n", "}", "\n", "<mask>", "mt", "MessageType", "\n", "mt", ".", "InitMessageType", "(", "alist", ",", "familyId", ")", "\n", "Family2MT", "[", "familyId", "]", "=", "&", "mt", "\n", "return", "mt", "\n", "}" ]
25,184
all-25185
[ "GetPaperWidth", "()", "is", "a", "wrapper", "around", "gtk_print_settings_get_paper_width", "()", "." ]
[ "func", "(", "ps", "*", "PrintSettings", ")", "GetPaperWidth", "(", "unit", "Unit", ")", "float64", "{", "c", ":=", "C", ".", "gtk_print_settings_get_paper_width", "(", "<mask>", ".", "native", "(", ")", ",", "C", ".", "GtkUnit", "(", "unit", ")", ")", "\n", "return", "float64", "(", "c", ")", "\n", "}" ]
25,185
all-25186
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "CaptureScreenshotParams", ")", "UnmarshalJSON", "(", "<mask>", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoPage80", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "Error", "(", ")", "\n", "}" ]
25,186
all-25187
[ "SetCanonical", "sets", "the", "given", "key", ":", "value", "header", "assuming", "that", "key", "is", "in", "canonical", "form", "." ]
[ "func", "(", "h", "*", "RequestHeader", ")", "SetCanonical", "(", "key", ",", "value", "[", "]", "byte", ")", "{", "h", ".", "parseRawHeaders", "(", ")", "\n", "switch", "string", "(", "key", ")", "{", "case", "\"", "\"", ":", "h", ".", "SetHostBytes", "(", "value", ")", "\n", "case", "\"", "\"", ":", "h", ".", "SetContentTypeBytes", "(", "<mask>", ")", "\n", "case", "\"", "\"", ":", "h", ".", "SetUserAgentBytes", "(", "value", ")", "\n", "case", "\"", "\"", ":", "h", ".", "collectCookies", "(", ")", "\n", "h", ".", "cookies", "=", "parseRequestCookies", "(", "h", ".", "cookies", ",", "value", ")", "\n", "case", "\"", "\"", ":", "if", "contentLength", ",", "err", ":=", "parseContentLength", "(", "value", ")", ";", "err", "==", "nil", "{", "h", ".", "contentLength", "=", "contentLength", "\n", "h", ".", "contentLengthBytes", "=", "append", "(", "h", ".", "contentLengthBytes", "[", ":", "0", "]", ",", "value", "...", ")", "\n", "}", "\n", "case", "\"", "\"", ":", "if", "bytes", ".", "Equal", "(", "strClose", ",", "value", ")", "{", "h", ".", "SetConnectionClose", "(", ")", "\n", "}", "else", "{", "h", ".", "ResetConnectionClose", "(", ")", "\n", "h", ".", "h", "=", "setArgBytes", "(", "h", ".", "h", ",", "key", ",", "value", ",", "argsHasValue", ")", "\n", "}", "\n", "case", "\"", "\"", ":", "// Transfer-Encoding is managed automatically.", "default", ":", "h", ".", "h", "=", "setArgBytes", "(", "h", ".", "h", ",", "key", ",", "value", ",", "argsHasValue", ")", "\n", "}", "\n", "}" ]
25,187
all-25188
[ "NewFuncDepot", "creates", "a", "new", "FuncDepot", "under", "the", "given", "namespace" ]
[ "func", "NewFuncDepot", "(", "namespace", "string", ")", "*", "FuncDepot", "{", "return", "&", "FuncDepot", "{", "namespace", ",", "make", "(", "<mask>", "[", "string", "]", "reflect", ".", "Value", ")", "}", "\n", "}" ]
25,188
all-25189
[ "HaveTitle", "passes", "when", "the", "expected", "title", "is", "equivalent", "to", "the", "title", "of", "the", "provided", "page", "." ]
[ "func", "HaveTitle", "(", "title", "string", ")", "types", ".", "GomegaMatcher", "{", "return", "&", "<mask>", ".", "ValueMatcher", "{", "Method", ":", "\"", "\"", ",", "Property", ":", "\"", "\"", ",", "Expected", ":", "title", "}", "\n", "}" ]
25,189
all-25190
[ "Read", "Read" ]
[ "func", "(", "ms", "*", "MongoStore", ")", "Read", "(", ")", "<-", "chan", "string", "{", "chResult", ":=", "make", "(", "chan", "string", ")", "\n", "go", "func", "(", ")", "{", "ms", ".", "c", "(", "func", "(", "c", "*", "mgo", ".", "<mask>", ")", "{", "iter", ":=", "c", ".", "Find", "(", "nil", ")", ".", "Select", "(", "bson", ".", "M", "{", "\"", "\"", ":", "0", "}", ")", ".", "Sort", "(", "\"", "\"", ")", ".", "Iter", "(", ")", "\n", "var", "dirty", "_Dirties", "\n", "for", "iter", ".", "Next", "(", "&", "dirty", ")", "{", "chResult", "<-", "dirty", ".", "Value", "\n", "}", "\n", "if", "err", ":=", "iter", ".", "Close", "(", ")", ";", "err", "!=", "nil", "{", "ms", ".", "lg", ".", "Println", "(", "err", ")", "\n", "}", "\n", "close", "(", "chResult", ")", "\n", "}", ")", "\n", "}", "(", ")", "\n", "return", "chResult", "\n", "}" ]
25,190
all-25191
[ "GetBody", "returns", "the", "Body", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "s", "*", "SyntheticsRequest", ")", "GetBody", "(", ")", "string", "{", "if", "s", "==", "nil", "||", "s", ".", "<mask>", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "s", ".", "Body", "\n", "}" ]
25,191
all-25192
[ "NewInlineQueryResultGif", "returns", "a", "new", "InlineQueryResultGif", "with", "all", "mandatory", "fields", "set", "." ]
[ "func", "NewInlineQueryResultGif", "(", "id", ",", "gifURL", ",", "thumbURL", "string", ")", "*", "InlineQueryResultGif", "{", "return", "&", "InlineQueryResultGif", "{", "InlineQueryResultBase", ":", "InlineQueryResultBase", "{", "Type", ":", "GifResult", ",", "ID", ":", "<mask>", ",", "}", ",", "GifURL", ":", "gifURL", ",", "ThumbURL", ":", "thumbURL", ",", "}", "\n", "}" ]
25,192
all-25193
[ "Copy", "returns", "a", "copy", "of", "the", "labels", "." ]
[ "func", "(", "ls", "Labels", ")", "Copy", "(", ")", "Labels", "{", "res", ":=", "make", "(", "Labels", ",", "len", "(", "ls", ")", ")", "\n", "copy", "(", "res", ",", "ls", ")", "\n", "return", "<mask>", "\n", "}" ]
25,193
all-25194
[ "DefaultDialOptions", "is", "a", "helper", "returning", "a", "slice", "of", "grpc", ".", "Dial", "options", "such", "that", "grpc", ".", "Dial", "()", "is", "synchronous", ":", "the", "call", "doesn", "t", "return", "until", "the", "connection", "has", "been", "established", "and", "it", "s", "safe", "to", "send", "RPCs" ]
[ "func", "DefaultDialOptions", "(", ")", "[", "]", "grpc", ".", "DialOption", "{", "return", "[", "]", "grpc", ".", "DialOption", "{", "// Don't return from Dial() until the connection has been established", "grpc", ".", "WithBlock", "(", ")", ",", "// If no connection is established in 30s, fail the call", "grpc", ".", "WithTimeout", "(", "30", "*", "<mask>", ".", "Second", ")", ",", "grpc", ".", "WithDefaultCallOptions", "(", "grpc", ".", "MaxCallRecvMsgSize", "(", "grpcutil", ".", "MaxMsgSize", ")", ",", "grpc", ".", "MaxCallSendMsgSize", "(", "grpcutil", ".", "MaxMsgSize", ")", ",", ")", ",", "}", "\n", "}" ]
25,194
all-25195
[ "Do", "executes", "Page", ".", "setFontSizes", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "SetFontSizesParams", ")", "Do", "(", "ctx", "<mask>", ".", "Context", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandSetFontSizes", ",", "p", ",", "nil", ")", "\n", "}" ]
25,195
all-25196
[ "GetOrgProjects", "returns", "the", "list", "of", "projects", "in", "this", "org", ".", "See", "https", ":", "//", "developer", ".", "github", ".", "com", "/", "v3", "/", "projects", "/", "#list", "-", "organization", "-", "projects" ]
[ "func", "(", "c", "*", "Client", ")", "GetOrgProjects", "(", "org", "string", ")", "(", "[", "]", "Project", ",", "error", ")", "{", "c", ".", "log", "(", "\"", "\"", ",", "org", ")", "\n", "path", ":=", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "org", ")", ")", "\n", "var", "projects", "[", "]", "Project", "\n", "err", ":=", "c", ".", "readPaginatedResults", "(", "path", ",", "\"", "\"", ",", "func", "(", ")", "interface", "{", "}", "{", "return", "&", "[", "]", "Project", "{", "}", "\n", "}", ",", "func", "(", "obj", "interface", "{", "}", ")", "{", "projects", "=", "append", "(", "<mask>", ",", "*", "(", "obj", ".", "(", "*", "[", "]", "Project", ")", ")", "...", ")", "\n", "}", ",", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "projects", ",", "nil", "\n", "}" ]
25,196
all-25197
[ "SetMeta", "updates", "the", "meta", "value", "of", "the", "current", "iteration", "record", "if", "it", "has", "not", "been", "updated", "or", "deleted", "since", "iterating", "or", "seeking", "to", "it", ".", "If", "the", "record", "has", "been", "updated", "then", "SetMeta", "positions", "the", "iterator", "on", "the", "most", "current", "value", "and", "returns", "ErrRecordUpdated", ".", "If", "the", "record", "has", "been", "deleted", "then", "SetMeta", "keeps", "the", "iterator", "positioned", "on", "the", "current", "record", "with", "the", "current", "value", "and", "returns", "ErrRecordDeleted", "." ]
[ "func", "(", "it", "*", "Iterator", ")", "SetMeta", "(", "meta", "uint16", ")", "error", "{", "// Try to reuse the same value bytes. Do this only in the case where meta", "// is increasing, in order to avoid cases where the meta is changed, then", "// changed back to the original value, which would make it impossible to", "// detect updates had occurred in the interim.", "if", "meta", ">", "decodeMeta", "(", "it", ".", "value", ")", "{", "valOffset", ",", "valSize", ":=", "decodeValue", "(", "<mask>", ".", "value", ")", "\n", "new", ":=", "encodeValue", "(", "valOffset", ",", "valSize", ",", "meta", ")", "\n", "return", "it", ".", "trySetValue", "(", "new", ")", "\n", "}", "\n\n", "return", "it", ".", "Set", "(", "it", ".", "Value", "(", ")", ",", "meta", ")", "\n", "}" ]
25,197
all-25198
[ "GetExpectedNumHashtrees", "computes", "the", "expected", "number", "of", "hashtrees", "that", "Pachyderm", "will", "create", "given", "the", "HashtreeSpec", "spec", "." ]
[ "func", "GetExpectedNumHashtrees", "(", "<mask>", "*", "ppsclient", ".", "HashtreeSpec", ")", "(", "int64", ",", "error", ")", "{", "if", "spec", "==", "nil", "||", "spec", ".", "Constant", "==", "0", "{", "return", "1", ",", "nil", "\n", "}", "else", "if", "spec", ".", "Constant", ">", "0", "{", "return", "int64", "(", "spec", ".", "Constant", ")", ",", "nil", "\n", "}", "\n", "return", "0", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "spec", ")", "\n", "}" ]
25,198
all-25199
[ "resourceVSphereComputeClusterHasClusterConfigChange", "checks", "all", "resource", "keys", "associated", "with", "cluster", "configuration", "(", "and", "not", "for", "example", "member", "hosts", "folder", "tags", "etc", ")", "to", "see", "if", "there", "has", "been", "a", "change", "in", "the", "configuration", "of", "those", "keys", ".", "This", "helper", "is", "designed", "to", "detect", "no", "-", "ops", "in", "a", "cluster", "configuration", "to", "see", "if", "we", "really", "need", "to", "send", "a", "configure", "API", "call", "to", "vSphere", "." ]
[ "func", "resourceVSphereComputeClusterHasClusterConfigChange", "(", "d", "*", "schema", ".", "ResourceData", ")", "bool", "{", "for", "k", ":=", "range", "resourceVSphereComputeCluster", "(", ")", ".", "Schema", "{", "switch", "{", "case", "resourceVSphereComputeClusterHasClusterConfigChangeExcluded", "(", "k", ")", ":", "continue", "\n", "case", "d", ".", "HasChange", "(", "k", ")", ":", "return", "<mask>", "\n", "}", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
25,199
all-25200
[ "New", "returns", "a", "generator", "that", "performs", "buffalo", "related", "rx", "checks" ]
[ "func", "New", "(", "opts", "*", "Options", ")", "(", "*", "genny", ".", "Generator", ",", "error", ")", "{", "g", ":=", "genny", ".", "New", "(", ")", "\n\n", "if", "err", ":=", "opts", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "g", ",", "<mask>", ".", "WithStack", "(", "err", ")", "\n", "}", "\n\n", "g", ".", "RunFn", "(", "appDetails", "(", "opts", ")", ")", "\n\n", "cBox", ":=", "packr", ".", "Folder", "(", "filepath", ".", "Join", "(", "opts", ".", "App", ".", "Root", ",", "\"", "\"", ")", ")", "\n", "g", ".", "RunFn", "(", "configs", "(", "opts", ",", "cBox", ")", ")", "\n\n", "aBox", ":=", "packr", ".", "Folder", "(", "opts", ".", "App", ".", "Root", ")", "\n", "g", ".", "RunFn", "(", "pkgChecks", "(", "opts", ",", "aBox", ")", ")", "\n\n", "return", "g", ",", "nil", "\n", "}" ]